diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-12-04 18:04:10 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-12-04 18:04:10 +0300 |
commit | cf2e35fcfe31aa2c1836f51d1206901b4be6aeba (patch) | |
tree | bea7f3e6234470e70ab2aa45e6faae28b0f267a2 /source/blender/depsgraph/intern/builder | |
parent | e666ee965c63322531fba5203905e7d9ca567ed3 (diff) |
Fix T58118: Make duplicates real does nothing
The issue was caused by transflag set in geometry evaluation
never copied back top original object.
Now we have a dedicated operation which does all sort copy
back to original object, so we don't have to worry about
atomic assignments or what gets set where.
Still need to move boundbox to the same function, but it
needs some careful doublechecking first.
Diffstat (limited to 'source/blender/depsgraph/intern/builder')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_nodes.cc | 8 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 19 |
2 files changed, 27 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index 8726f51012e..d1837e7a69a 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -579,6 +579,7 @@ void DepsgraphNodeBuilder::build_object(int base_index, } /* Create ID node for object and begin init. */ IDDepsNode *id_node = add_id_node(&object->id); + Object *object_cow = get_cow_datablock(object); id_node->linked_state = linked_state; if (object == scene_->camera) { id_node->is_directly_visible = true; @@ -663,6 +664,13 @@ void DepsgraphNodeBuilder::build_object(int base_index, DEG_OPCODE_PLACEHOLDER, "Dupli"); } + /* Syncronization back to original object. */ + add_operation_node(&object->id, + DEG_NODE_TYPE_SYNCHRONIZE, + function_bind(BKE_object_synchronize_to_original, + _1, + object_cow), + DEG_OPCODE_SYNCHRONIZE_TO_ORIGINAL); } void DepsgraphNodeBuilder::build_object_flags( diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 649bc1a4275..23f1d229d6a 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -683,6 +683,12 @@ void DepsgraphRelationBuilder::build_object(Base *base, Object *object) } /* Point caches. */ build_object_pointcache(object); + /* Syncronization back to original object. */ + OperationKey synchronize_key(&object->id, + DEG_NODE_TYPE_SYNCHRONIZE, + DEG_OPCODE_SYNCHRONIZE_TO_ORIGINAL); + add_relation( + final_transform_key, synchronize_key, "Synchronize to Original"); } void DepsgraphRelationBuilder::build_object_flags(Base *base, Object *object) @@ -697,6 +703,12 @@ void DepsgraphRelationBuilder::build_object_flags(Base *base, Object *object) DEG_NODE_TYPE_OBJECT_FROM_LAYER, DEG_OPCODE_OBJECT_BASE_FLAGS); add_relation(view_layer_done_key, object_flags_key, "Base flags flush"); + /* Syncronization back to original object. */ + OperationKey synchronize_key(&object->id, + DEG_NODE_TYPE_SYNCHRONIZE, + DEG_OPCODE_SYNCHRONIZE_TO_ORIGINAL); + add_relation( + object_flags_key, synchronize_key, "Synchronize to Original"); } void DepsgraphRelationBuilder::build_object_data(Object *object) @@ -2023,6 +2035,13 @@ void DepsgraphRelationBuilder::build_object_data_geometry(Object *object) } } } + /* Syncronization back to original object. */ + ComponentKey final_geometry_jey(&object->id, DEG_NODE_TYPE_GEOMETRY); + OperationKey synchronize_key(&object->id, + DEG_NODE_TYPE_SYNCHRONIZE, + DEG_OPCODE_SYNCHRONIZE_TO_ORIGINAL); + add_relation( + final_geometry_jey, synchronize_key, "Synchronize to Original"); } void DepsgraphRelationBuilder::build_object_data_geometry_datablock(ID *obdata) |