Depsgraph: Restore ID datablock tag when Object is tagged with OB_RECALC_DATA
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 18 Jul 2017 15:08:29 +0000 (17:08 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 19 Jul 2017 13:20:06 +0000 (15:20 +0200)
Was lost in one of the previous commits.

source/blender/depsgraph/intern/depsgraph_tag.cc

index 883eadedb39603c6fdf5f90ebd81b2fd999bbba5..db7d2a4323b9f52dff7550ae4bf68490ea8e2c37 100644 (file)
@@ -176,6 +176,19 @@ void id_tag_update_object_data(Depsgraph *graph, IDDepsNode *id_node)
                return;
        }
        data_comp->tag_update(graph);
+       /* Special legacy compatibility code, tag data ID for update when object
+        * is tagged for data update.
+        */
+       if (idtype == ID_OB) {
+               Object *object = (Object *)id_node->id_orig;
+               ID *data_id = (ID *)object->data;
+               if (data_id != NULL) {
+                       IDDepsNode *data_id_node = graph->find_id_node(data_id);
+                       BLI_assert(data_id_node != NULL);
+                       /* TODO(sergey): Do we want more granular tags here? */
+                       data_id_node->tag_update(graph);
+               }
+       }
 }
 
 /* Tag corresponding to OB_RECALC_TIME. */