Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey@blender.org>2021-11-29 13:57:31 +0300
committerSergey Sharybin <sergey@blender.org>2021-11-29 18:59:50 +0300
commitaa7051c8f21a6b7e2b413b40317502e69764fa05 (patch)
tree054d91be095c70436406e8c8abd80a4a5d3c87fb /source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
parentdae9917915c4e0dc2a7b382cbed756538439d59b (diff)
Fix T93439: Armature widgets from hidden collections are invisible
The are few things in the dependency graph which lead to the issue: - IDs are only built once. - Object-data level (Armature, i,e,) builder dependent on the object visibility. This caused issues when an armature is first built as not directly visible (via driver, i.e.) and then was built as a directly visible. This did not update visibility flag on the node for the custom shape object. The idea behind the fix is to go away form passing object visibility flag to the geometry-level builders and instead rely on the common visibility flush post-processing to make sure certain objects are fully visible when needed. This is the safest minimal part of the change for 3.0 release which acts as an additional way to ensure visibility. This means that it might not be a complete fix (if some configuration was overseen) but it should not make currently working cases to not work. The fix should also make modifiers used on rigify widgets to work. The more complete fix will have `is_object_visible` argument removed from the geometry-level builder functions. Differential Revision: https://developer.blender.org/D13404
Diffstat (limited to 'source/blender/depsgraph/intern/builder/deg_builder_nodes.cc')
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_nodes.cc31
1 files changed, 23 insertions, 8 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index a09f79ffa39..6c37ba8bfb3 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -179,15 +179,30 @@ IDNode *DepsgraphNodeBuilder::add_id_node(ID *id)
id_node->previously_visible_components_mask = previously_visible_components_mask;
id_node->previous_eval_flags = previous_eval_flags;
id_node->previous_customdata_masks = previous_customdata_masks;
+
/* NOTE: Zero number of components indicates that ID node was just created. */
- if (id_node->components.is_empty() && deg_copy_on_write_is_needed(id_type)) {
- ComponentNode *comp_cow = id_node->add_component(NodeType::COPY_ON_WRITE);
- OperationNode *op_cow = comp_cow->add_operation(
- [id_node](::Depsgraph *depsgraph) { deg_evaluate_copy_on_write(depsgraph, id_node); },
- OperationCode::COPY_ON_WRITE,
- "",
- -1);
- graph_->operations.append(op_cow);
+ const bool is_newly_created = id_node->components.is_empty();
+
+ if (is_newly_created) {
+ if (deg_copy_on_write_is_needed(id_type)) {
+ ComponentNode *comp_cow = id_node->add_component(NodeType::COPY_ON_WRITE);
+ OperationNode *op_cow = comp_cow->add_operation(
+ [id_node](::Depsgraph *depsgraph) { deg_evaluate_copy_on_write(depsgraph, id_node); },
+ OperationCode::COPY_ON_WRITE,
+ "",
+ -1);
+ graph_->operations.append(op_cow);
+ }
+
+ ComponentNode *visibility_component = id_node->add_component(NodeType::VISIBILITY);
+ OperationNode *visibility_operation = visibility_component->add_operation(
+ nullptr, OperationCode::OPERATION, "", -1);
+ /* Pin the node so that it and its relations are preserved by the unused nodes/relations
+ * deletion. This is mainly to make it easier to debug visibility. */
+ /* NOTE: Keep un-pinned for the 3.0 release. This way we are more sure that side effects of the
+ * change is minimal outside of the dependency graph area. */
+ // visibility_operation->flag |= OperationFlag::DEPSOP_FLAG_PINNED;
+ graph_->operations.append(visibility_operation);
}
return id_node;
}