Blender Git Commits

Blender Git "master" branch commits.

Page: 7 / 5574

Revision e2a9e7e by Hans Goudey
December 22, 2021, 17:25 (GMT)
Nodes: Remove unnecessary node tree socket tagging

`SOCK_IN_USE` is now set in `update_socket_used_tags` in
`node_tree_update.cc` when a node tree is changed.
It doesn't need to run every single redraw. Removing this
results in a small speedup of 0.4 ms when drawing a tree
with about 4000 nodes (from about 70 ms total).

Differential Revision: https://developer.blender.org/D13645
Revision 6a71b2a by Hans Goudey
December 22, 2021, 17:04 (GMT)
Mesh: Parallelize bounding box calculation (WIP)

This replaces the single-threaded calculation of mesh min and max
positions with a `parallel_reduce` loop. Since the bounding box
of a mesh is retrieved quite often (at the end of each evaluation,
currently 2(?!) times when leaving edit mode, etc.), this makes for a
quite noticeable speedup actually.

On my Ryzen 3700x and a 4.2 million vertex mesh, I observed
a 4.4x performance increase, from 14 ms to 4.4 ms.

I added some methods to `float3` so they would be inlined, but
they're also a nice addition, since they're used often anyway.

Differential Revision: https://developer.blender.org/D13572
December 22, 2021, 16:53 (GMT)
Cleanup: Remove debug print.
December 22, 2021, 16:50 (GMT)
Fix (unreported) potential bug in collections parenting update code.

Own mistake in rB2ef192a55b2c. Did not seem to have any visible effect
though...
December 22, 2021, 16:39 (GMT)
Cleanup: Use `LISTBASE_FOREACH_` macros.
December 22, 2021, 16:34 (GMT)
Fix T93799: Outliner: Remaping objects could result in duplicates in a collection.

Fix is similar to how CollectionObject with NULL object pointers are handled.

Using one of the 'free' pad bytes in Object_Runtime struct instead of a
gset (or other external way to detect object duplicates), as this is
several times faster.

NOTE: This makes remapping slightly slower again (adds 10 extra seconds
to file case in T94059).

General improvements of remapping time complexity, especially when
remapping a lot of IDs at once, is a separate topic currently
investigated in D13615.
December 22, 2021, 16:03 (GMT)
Fix part of T93799: Outliner: Remap Users crash (for `ID Type` `Object`).

This commit fixes the crash itself, however this can still lead to a
same collection 'owning' the same object several time.

Issue here was a bad assumption in layer resync code, that would lead to
removing valid objects from the viewlayer's `object_bases_hash` in
`BKE_layer_collection_sync`, when deleting no-more-used bases, in case
of bases duplicate.
December 22, 2021, 15:39 (GMT)
Fix: Build issue on 32 bit archs

The cast to size_t leads to a build issue on 32
bit archs. cursor_delim_type_utf8 expects an int
so an additional cast to size_t is not required.

Reported by user frispete on devtalk.
December 22, 2021, 15:07 (GMT)
Fix T93999: GPencil Box tool allows decreasing subdiv, but not increase

The problem was the number of points for each edge of the box was wrong and the wheelmouse effect was anulated.

Also fixed the value displayed in the status bar to keep consistency with subdivision value.

Reviewed By: lichtwerk

Maniphest Tasks: T93999

Differential Revision: https://developer.blender.org/D1363
Revision dbbf0e7 by Hans Goudey
December 22, 2021, 14:52 (GMT)
Nodes: Improve node tree copy performance

When copying a full node tree, we can avoid an O(n^2) loop finding a
unique name for every node if we assume they already have unique names.
That is a reasonable assumption, since unique names are verified
elsewhere when adding a new node.

Copying a node tree with about 4000 nodes took 42 ms before,
now it takes 6 ms.

Differential Revision: https://developer.blender.org/D13644
Revision fdc4a1a by Hans Goudey
December 22, 2021, 14:47 (GMT)
Nodes: Refactor to remove node and socket "new" pointers

These pointers point to the new nodes when duplicating,
and their even used to point to "original" nodes for
"localized" trees. They're just a bad design decision
that make code confusing and buggy.

Instead, node copy functions now optionally add to a map
of old to new socket pointers. The case where the compositor
abused these pointers as "original" pointers are handled
by looking up the string node names.

Differential Revision: https://developer.blender.org/D13518
December 22, 2021, 12:16 (GMT)
Geometry Nodes: improve multi socket handling in evaluator

Previously, the values passed to a multi-input socket were stored
in the order that they arrived in. Then, when the values are accessed,
they are sorted depending on the link order.

Now, the ordering is determined in the beginning before execution starts.
Every value is assigned to the right index directly, avoiding the sort
in the end. This makes the ordering more explicit.
December 22, 2021, 08:28 (GMT)
Fix T94295: VSE fades error when no suitable sequences selected

This errored out in two scenarios:
- current frame not in strips framerange (this was reported)
- no strips selected at all

Now handle these cases properly in the operator and give appropriate
report info.

Maniphest Tasks: T94295

Differential Revision: https://developer.blender.org/D13642
Revision d2bf60c by Hans Goudey
December 21, 2021, 20:32 (GMT)
Cleanup: Clang tidy, restore alphabetical sorting
December 21, 2021, 16:00 (GMT)
Fix T94191: correct (time) translation headers not showing DeltaX

Caused by {rBb0d9e6797fb8}

For the header (both Graph Editor case in general `headerTranslation` as
well as `headerTimeTranslate`) we are interested in deltas values
(not absolute values).

Since culprit commit, `snapFrameTransform` was not working with deltas
anymore, but we have to compensate for this.

For the Graph Editor, this only worked "by accident" in rB7192e57d63a5,
since `ival` is still zero at this point.

So now, reacquire the delta right after the snap operation.

Also use a more appropriate center value in the translate operator.

Maniphest Tasks: T94191

Differential Revision: https://developer.blender.org/D13641
December 21, 2021, 15:45 (GMT)
Cleanup: use BKE_pose_is_layer_visible in more places

This was added in rBd13970de8627, now use in more places.
Revision bdbd0cf by Hans Goudey
December 21, 2021, 15:23 (GMT)
Nodes: Improve performance when freeing a node tree

This commit makes freeing a node tree about 25 to 30 times faster.
Freeing a node tree happens whenever it is edited. Freeing a node
tree with about 4000 nodes went from 30-50ms to about 2 ms.

This was so slow before because for every node that was freed
when freeing the node tree, `node_free_node` looped over all
other nodes to detach frames, and then looped over all links to
remove any links connected to the node. That was all pointless
work because everything else is about to be freed anyway.

Instead, move that "detaching" behavior to the dedicated function
for removing a single node, and to the "local" version of the free
function to be safe, since I know less about what that version expects.

Differential Revision: https://developer.blender.org/D13636
December 21, 2021, 14:54 (GMT)
Fix T93960: Asset Catalogs I/O fails with unicode file paths on Windows

On Windows, encode file paths as UTF-16 before trying to open the file
for reading/writing.

This introduces a new class `blender::fstream`, which wraps
`std::fstream` and provides this UTF-16 encoding. This class should also
be used in other areas, like the Alembic importer/exporter.

Manifest Task: T93960

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D13633
December 21, 2021, 14:53 (GMT)
Assets: log message when catalog definitions cannot be loaded

Log a message (via `CLOG`) when asset catalog definitions cannot be
loaded.

Reviewed by @jacqueslucke in D13633
December 21, 2021, 14:18 (GMT)
Nodes: refactor node tree update handling

Goals of this refactor:
* More unified approach to updating everything that needs to be updated
after a change in a node tree.
* The updates should happen in the correct order and quadratic or worse
algorithms should be avoided.
* Improve detection of changes to the output to avoid tagging the depsgraph
when it's not necessary.
* Move towards a more declarative style of defining nodes by having a
more centralized update procedure.

The refactor consists of two main parts:
* Node tree tagging and update refactor.
* Generally, when changes are done to a node tree, it is tagged dirty
until a global update function is called that updates everything in
the correct order.
* The tagging is more fine-grained compared to before, to allow for more
precise depsgraph update tagging.
* Depsgraph changes.
* The shading specific depsgraph node for node trees as been removed.
* Instead, there is a new `NTREE_OUTPUT` depsgrap node, which is only
tagged when the output of the node tree changed (e.g. the Group Output
or Material Output node).
* The copy-on-write relation from node trees to the data block they are
embedded in is now non-flushing. This avoids e.g. triggering a material
update after the shader node tree changed in unrelated ways. Instead
the material has a flushing relation to the new `NTREE_OUTPUT` node now.
* The depsgraph no longer reports data block changes through to cycles
through `Depsgraph.updates` when only the node tree changed in ways
that do not affect the output.

Avoiding unnecessary updates seems to work well for geometry nodes and cycles.
The situation is a bit worse when there are drivers on the node tree, but that
could potentially be improved separately in the future.

Avoiding updates in eevee and the compositor is more tricky, but also less urgent.
* Eevee updates are triggered by calling `DRW_notify_view_update` in
`ED_render_view3d_update` indirectly from `DEG_editors_update`.
* Compositor updates are triggered by `ED_node_composite_job` in `node_area_refresh`.
This is triggered by calling `ED_area_tag_refresh` in `node_area_listener`.

Removing updates always has the risk of breaking some dependency that no
one was aware of. It's not unlikely that this will happen here as well. Adding
back missing updates should be quite a bit easier than getting rid of
unnecessary updates though.

Differential Revision: https://developer.blender.org/D13246
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021