diff options
author | Sergey Sharybin <sergey@blender.org> | 2021-11-29 14:12:22 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2022-01-03 17:30:14 +0300 |
commit | a230445caec6cae4eda9dbf8ea758322310fc7eb (patch) | |
tree | 9d806bbd391aa6044296dec46bc4c71660ef92fd /source/blender/depsgraph/intern/builder/deg_builder_nodes.cc | |
parent | a3e634d4d7a3f2ae12d9a6e1709e790dfa6f27c5 (diff) |
Depsgraph: Remove object-level visibility from geometry builders
Continuation of the D13404 which finished the design of not having
geometry-level nodes dependent on object-level.
Differential Revision: https://developer.blender.org/D13405
Diffstat (limited to 'source/blender/depsgraph/intern/builder/deg_builder_nodes.cc')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_nodes.cc | 48 |
1 files changed, 15 insertions, 33 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index f8562e16746..ecbe89b1e7f 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -199,9 +199,7 @@ IDNode *DepsgraphNodeBuilder::add_id_node(ID *id) 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; + visibility_operation->flag |= OperationFlag::DEPSOP_FLAG_PINNED; graph_->operations.append(visibility_operation); } return id_node; @@ -589,11 +587,7 @@ void DepsgraphNodeBuilder::build_id(ID *id) case ID_HA: case ID_PT: case ID_VO: - /* TODO(sergey): Get visibility from a "parent" somehow. - * - * NOTE: Similarly to above, we don't want false-positives on - * visibility. */ - build_object_data_geometry_datablock(id, false); + build_object_data_geometry_datablock(id); break; case ID_SPK: build_speaker((Speaker *)id); @@ -769,32 +763,28 @@ void DepsgraphNodeBuilder::build_object(int base_index, if (object->modifiers.first != nullptr) { BuilderWalkUserData data; data.builder = this; - data.is_parent_visible = is_visible; BKE_modifiers_foreach_ID_link(object, modifier_walk, &data); } /* Grease Pencil Modifiers. */ if (object->greasepencil_modifiers.first != nullptr) { BuilderWalkUserData data; data.builder = this; - data.is_parent_visible = is_visible; BKE_gpencil_modifiers_foreach_ID_link(object, modifier_walk, &data); } /* Shader FX. */ if (object->shader_fx.first != nullptr) { BuilderWalkUserData data; data.builder = this; - data.is_parent_visible = is_visible; BKE_shaderfx_foreach_ID_link(object, modifier_walk, &data); } /* Constraints. */ if (object->constraints.first != nullptr) { BuilderWalkUserData data; data.builder = this; - data.is_parent_visible = is_visible; BKE_constraints_id_loop(&object->constraints, constraint_walk, &data); } /* Object data. */ - build_object_data(object, is_visible); + build_object_data(object); /* Parameters, used by both drivers/animation and also to inform dependency * from object's data. */ build_parameters(&object->id); @@ -897,7 +887,7 @@ void DepsgraphNodeBuilder::build_object_instance_collection(Object *object, bool is_parent_collection_visible_ = is_current_parent_collection_visible; } -void DepsgraphNodeBuilder::build_object_data(Object *object, bool is_object_visible) +void DepsgraphNodeBuilder::build_object_data(Object *object) { if (object->data == nullptr) { return; @@ -914,14 +904,14 @@ void DepsgraphNodeBuilder::build_object_data(Object *object, bool is_object_visi case OB_HAIR: case OB_POINTCLOUD: case OB_VOLUME: - build_object_data_geometry(object, is_object_visible); + build_object_data_geometry(object); break; case OB_ARMATURE: if (ID_IS_LINKED(object) && object->proxy_from != nullptr) { - build_proxy_rig(object, is_object_visible); + build_proxy_rig(object); } else { - build_rig(object, is_object_visible); + build_rig(object); } break; case OB_LAMP: @@ -1472,7 +1462,7 @@ void DepsgraphNodeBuilder::build_shapekeys(Key *key) /* ObData Geometry Evaluation */ /* XXX: what happens if the datablock is shared! */ -void DepsgraphNodeBuilder::build_object_data_geometry(Object *object, bool is_object_visible) +void DepsgraphNodeBuilder::build_object_data_geometry(Object *object) { OperationNode *op_node; Scene *scene_cow = get_cow_datablock(scene_); @@ -1494,7 +1484,7 @@ void DepsgraphNodeBuilder::build_object_data_geometry(Object *object, bool is_ob /* Point caches. */ build_object_pointcache(object); /* Geometry. */ - build_object_data_geometry_datablock((ID *)object->data, is_object_visible); + build_object_data_geometry_datablock((ID *)object->data); build_dimensions(object); /* Batch cache. */ add_operation_node( @@ -1504,7 +1494,7 @@ void DepsgraphNodeBuilder::build_object_data_geometry(Object *object, bool is_ob [object_cow](::Depsgraph *depsgraph) { BKE_object_select_update(depsgraph, object_cow); }); } -void DepsgraphNodeBuilder::build_object_data_geometry_datablock(ID *obdata, bool is_object_visible) +void DepsgraphNodeBuilder::build_object_data_geometry_datablock(ID *obdata) { if (built_map_.checkIsBuiltAndTag(obdata)) { return; @@ -1548,17 +1538,15 @@ void DepsgraphNodeBuilder::build_object_data_geometry_datablock(ID *obdata, bool BKE_curve_eval_geometry(depsgraph, (Curve *)obdata_cow); }); op_node->set_as_entry(); - /* Make sure objects used for bevel.taper are in the graph. - * NOTE: This objects might be not linked to the scene. */ Curve *cu = (Curve *)obdata; if (cu->bevobj != nullptr) { - build_object(-1, cu->bevobj, DEG_ID_LINKED_INDIRECTLY, is_object_visible); + build_object(-1, cu->bevobj, DEG_ID_LINKED_INDIRECTLY, false); } if (cu->taperobj != nullptr) { - build_object(-1, cu->taperobj, DEG_ID_LINKED_INDIRECTLY, is_object_visible); + build_object(-1, cu->taperobj, DEG_ID_LINKED_INDIRECTLY, false); } if (cu->textoncurve != nullptr) { - build_object(-1, cu->textoncurve, DEG_ID_LINKED_INDIRECTLY, is_object_visible); + build_object(-1, cu->textoncurve, DEG_ID_LINKED_INDIRECTLY, false); } break; } @@ -2121,10 +2109,7 @@ void DepsgraphNodeBuilder::modifier_walk(void *user_data, } switch (GS(id->name)) { case ID_OB: - /* Special case for object, so we take owner visibility into - * account. */ - data->builder->build_object( - -1, (Object *)id, DEG_ID_LINKED_INDIRECTLY, data->is_parent_visible); + data->builder->build_object(-1, (Object *)id, DEG_ID_LINKED_INDIRECTLY, false); break; default: data->builder->build_id(id); @@ -2144,10 +2129,7 @@ void DepsgraphNodeBuilder::constraint_walk(bConstraint * /*con*/, } switch (GS(id->name)) { case ID_OB: - /* Special case for object, so we take owner visibility into - * account. */ - data->builder->build_object( - -1, (Object *)id, DEG_ID_LINKED_INDIRECTLY, data->is_parent_visible); + data->builder->build_object(-1, (Object *)id, DEG_ID_LINKED_INDIRECTLY, false); break; default: data->builder->build_id(id); |