Merge branch 'master' into blender2.8
[blender.git] / source / blender / depsgraph / intern / builder / deg_builder_nodes.cc
index 565218d8be009dececbfede8c18c3ee01045b934..eff6b34fee6f88deb540da20fafdf75539b34630 100644 (file)
@@ -118,51 +118,6 @@ namespace DEG {
 
 namespace {
 
-struct BuilderWalkUserData {
-       DepsgraphNodeBuilder *builder;
-};
-
-static void modifier_walk(void *user_data,
-                          struct Object * /*object*/,
-                          struct ID **idpoin,
-                          int /*cb_flag*/)
-{
-       BuilderWalkUserData *data = (BuilderWalkUserData *)user_data;
-       ID *id = *idpoin;
-       if (id == NULL) {
-               return;
-       }
-       switch (GS(id->name)) {
-               case ID_OB:
-                       data->builder->build_object(NULL,
-                                                   (Object *)id,
-                                                   DEG_ID_LINKED_INDIRECTLY);
-                       break;
-               case ID_TE:
-                       data->builder->build_texture((Tex *)id);
-                       break;
-               default:
-                       /* pass */
-                       break;
-       }
-}
-
-void constraint_walk(bConstraint * /*con*/,
-                     ID **idpoin,
-                     bool /*is_reference*/,
-                     void *user_data)
-{
-       BuilderWalkUserData *data = (BuilderWalkUserData *)user_data;
-       if (*idpoin) {
-               ID *id = *idpoin;
-               if (GS(id->name) == ID_OB) {
-                       data->builder->build_object(NULL,
-                                                   (Object *)id,
-                                                   DEG_ID_LINKED_INDIRECTLY);
-               }
-       }
-}
-
 void free_copy_on_write_datablock(void *id_v)
 {
        ID *id = (ID *)id_v;
@@ -1436,4 +1391,53 @@ void DepsgraphNodeBuilder::build_lightprobe(Object *object)
        build_animdata(&probe->id);
 }
 
+/* **** ID traversal callbacks functions **** */
+
+void DepsgraphNodeBuilder::modifier_walk(void *user_data,
+                                         struct Object * /*object*/,
+                                         struct ID **idpoin,
+                                         int /*cb_flag*/)
+{
+       BuilderWalkUserData *data = (BuilderWalkUserData *)user_data;
+       ID *id = *idpoin;
+       if (id == NULL) {
+               return;
+       }
+       switch (GS(id->name)) {
+               case ID_OB:
+                       data->builder->build_object(NULL,
+                                                   (Object *)id,
+                                                   DEG_ID_LINKED_INDIRECTLY);
+                       break;
+               case ID_TE:
+                       data->builder->build_texture((Tex *)id);
+                       break;
+               default:
+                       /* pass */
+                       break;
+       }
+}
+
+void DepsgraphNodeBuilder::constraint_walk(bConstraint * /*con*/,
+                                           ID **idpoin,
+                                           bool /*is_reference*/,
+                                           void *user_data)
+{
+       BuilderWalkUserData *data = (BuilderWalkUserData *)user_data;
+       ID *id = *idpoin;
+       if (id == NULL) {
+               return;
+       }
+       switch (GS(id->name)) {
+               case ID_OB:
+                       data->builder->build_object(NULL,
+                                                   (Object *)id,
+                                                   DEG_ID_LINKED_INDIRECTLY);
+                       break;
+               default:
+                       /* pass */
+                       break;
+       }
+}
+
 }  // namespace DEG