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. |
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 |
December 21, 2021, 13:34 (GMT) |
USD export format fixes. |
December 21, 2021, 13:28 (GMT) |
December 21, 2021, 13:24 (GMT) |
USD Export: USD Preview Surface conversion. Added "USD Preview Surface From Nodes" export option, to convert a Principled BSDF material node tree to an approximate USD Preview Surface shader representation. Also added the following options for texture export. Export Textures: If converting Preview Surface, export textures referenced by shader nodes to a 'textures' directory next to the USD file. Overwrite Textures: Allow overwriting existing texture files when exporting textures (this option is off by default). Relative Texture Paths: Save material texture asset paths as relative paths in the USD. |
December 21, 2021, 13:07 (GMT) |
Fix T92930: Outliner "Show Active" bone fails in certain situations Outliner would frame the armature object instead of the bone if the bone was on a hidden armature layer. Similar to issues reported in e.g. T58068 and T80464, this is due to the fact that `BKE_pose_channel_active` always checks for the armature layer (and returns NULL if a bone is not on a visible armature layer). Now propose to make this layer check **optional** (and e.g. from the Outliner be more permissive). This also introduces `BKE_pose_channel_active_if_layer_visible` which just wraps `BKE_pose_channel_active` with the check being ON. Maniphest Tasks: T92930 Differential Revision: https://developer.blender.org/D13154 |
December 21, 2021, 10:14 (GMT) |
Review comments from Jacques |
December 21, 2021, 10:12 (GMT) |
Tests: initialise BKE callbacks before loading blend file Initialise the BKE callback system in `BlendfileLoadingBaseTest::SetUpTestCase()`. This allows certain tests to run in debug mode (when `BLI_assert` is enabled). |
December 21, 2021, 09:09 (GMT) |
Fix T93757: Do not force-instantiate indrectly linked objects in linking case. |
December 21, 2021, 08:52 (GMT) |
Fix T93839: Copy/Paste of empty instantiating a collection. Do not also instantiate a collection in the view layer, if it is already instantiated through an empty object. |
December 21, 2021, 08:50 (GMT) |
Use add, moved wrap/unwrap outside C section. |
December 21, 2021, 07:18 (GMT) |
Fix incorrect logic performing way to many remaps. |
December 21, 2021, 07:18 (GMT) |
Add early exit when remapping multiple. |
December 21, 2021, 04:48 (GMT) |
Fix build error in debug builds from recent commit r7acd3ad7d8e58b913c5 converted a pointer to a reference, but an assert still compares the variable to a pointer. |
December 21, 2021, 04:27 (GMT) |
Fix T94280: Crash when splitting meta strip This happens because in `SEQ_time_update_sequence` function `SEQ_get_meta_by_seqbase` returns uninitialized value. This isn't nice, but it shouldn't happen in first place. Problem is, that `SEQ_edit_strip_split` does move strips into detached `ListBase`, so other functions can't see them anymore. Detached `ListBase` is used solely to preserve relationships during duplication. Move strips to original `ListBase` immediately after duplication and return `NULL` if `SEQ_get_meta_by_seqbase` can't find meta strip. Splitting itself can still rely on fact, that number of original and duplicated strips is same and they are placed next to each other in exactly same order at the end of original `ListBase`. |
December 21, 2021, 00:10 (GMT) |
Cleanup: Use span instead of raw pointer This is a followup to the previous commit. |
December 21, 2021, 00:03 (GMT) |
Cleanup: Use simpler loops in weld modifier In this commit I changed many loops to range-based for loops. I also removed some of the redundant iterator variables, using indexing inside the loop instead. Generally an optimizing compiler should have no problem doing the smartest thing in that situation, and this way makes it much easier to tell where data is coming from. I only changed the loops I was confident about, so there is still more that could be done in the future. Differential Revision: https://developer.blender.org/D13637 |
|