diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-03-05 19:37:30 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-03-06 13:05:22 +0300 |
commit | 7d9a5b7b10b439f62bcc522fee307a942b859ccc (patch) | |
tree | 81a0b38270efec16b80701dcb6be34fab19023c8 /source/blender/depsgraph/intern/builder/deg_builder_relations.cc | |
parent | abd33a3c0c1cf7097d7ee25a68b6083e19a89f75 (diff) |
Fix T73254: Drivers with the object.dimension variable are not updated
This fixes an issue where drivers using `object.dimension` only add a dependency on `GEOMETRY` to the depsgraph, whereas they should also depend on `TRANSFORM`.
This patch adds a new no-op operation that depends on the geometry and transform components to the Parameters component.
An alternative implementation would be to have `RNANodeQuery::construct_node_identifier` return multiple node identifiers. However, this would spread throughout the depsgraph code and unnecessarily force many other functions to either return or handle multiple nodes where in 99.999% of the time a single node would suffice.
The new `DIMENSIONS` node is added for each object. An upcoming patch will go over all no-op operation nodes and remove them from the depsgraph. Since this is a more dangerous operation, it'll be reviewed separately.
Differential Revision: https://developer.blender.org/D7031
Diffstat (limited to 'source/blender/depsgraph/intern/builder/deg_builder_relations.cc')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 7c8403271f0..78e05a69819 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -1588,6 +1588,15 @@ void DepsgraphRelationBuilder::build_parameters(ID *id) add_relation(parameters_eval_key, parameters_exit_key, "Entry -> Exit"); } +void DepsgraphRelationBuilder::build_dimensions(Object *object) +{ + OperationKey dimensions_key(&object->id, NodeType::PARAMETERS, OperationCode::DIMENSIONS); + ComponentKey geometry_key(&object->id, NodeType::GEOMETRY); + ComponentKey transform_key(&object->id, NodeType::TRANSFORM); + add_relation(geometry_key, dimensions_key, "Geometry -> Dimensions"); + add_relation(transform_key, dimensions_key, "Transform -> Dimensions"); +} + void DepsgraphRelationBuilder::build_world(World *world) { if (built_map_.checkIsBuiltAndTag(world)) { @@ -2029,6 +2038,7 @@ void DepsgraphRelationBuilder::build_object_data_geometry(Object *object) } } } + build_dimensions(object); /* Synchronization back to original object. */ ComponentKey final_geometry_key(&object->id, NodeType::GEOMETRY); OperationKey synchronize_key( |