Merge branch 'master' into blender2.8
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 5 Apr 2018 16:25:05 +0000 (18:25 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 5 Apr 2018 16:25:05 +0000 (18:25 +0200)
1  2 
source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
source/blender/depsgraph/intern/builder/deg_builder_nodes.h
source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc

index 565218d8be009dececbfede8c18c3ee01045b934,7b2914303cec179888a65b3ff6d868d7b9d00d78..eff6b34fee6f88deb540da20fafdf75539b34630
@@@ -116,62 -114,6 +116,17 @@@ extern "C" 
  
  namespace DEG {
  
- 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);
-               }
-       }
- }
 +namespace {
 +
 +void free_copy_on_write_datablock(void *id_v)
 +{
 +      ID *id = (ID *)id_v;
 +      deg_free_copy_on_write_datablock(id);
 +      MEM_freeN(id);
 +}
 +
 +}  /* namespace */
 +
  /* ************ */
  /* Node Builder */
  
@@@ -1415,25 -1103,50 +1370,74 @@@ void DepsgraphNodeBuilder::build_moviec
                           DEG_OPCODE_MOVIECLIP_EVAL);
  }
  
 -                      data->builder->build_object(NULL, (Object *)id);
 +void DepsgraphNodeBuilder::build_lightprobe(Object *object)
 +{
 +      LightProbe *probe = (LightProbe *)object->data;
 +      if (built_map_.checkIsBuiltAndTag(probe)) {
 +              return;
 +      }
 +      /* Placeholder so we can add relations and tag ID node for update. */
 +      add_operation_node(&probe->id,
 +                         DEG_NODE_TYPE_PARAMETERS,
 +                         NULL,
 +                         DEG_OPCODE_PLACEHOLDER,
 +                         "LightProbe Eval");
 +      add_operation_node(&object->id,
 +                         DEG_NODE_TYPE_PARAMETERS,
 +                         NULL,
 +                         DEG_OPCODE_PLACEHOLDER,
 +                         "LightProbe Eval");
 +
 +      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);
++                      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
index 8dfbc4fa37ca04a0ead0a18687b07f0cd328a63e,d64aee11536af550f1955cb6d67f3f6a472f8196..fd72ae527b84a027d913dd70863ebb16b46f174c
@@@ -212,27 -163,22 +212,41 @@@ struct DepsgraphNodeBuilder 
        void build_cachefile(CacheFile *cache_file);
        void build_mask(Mask *mask);
        void build_movieclip(MovieClip *clip);
 +      void build_lightprobe(Object *object);
  
 +      struct LayerCollectionState {
 +              int index;
 +              LayerCollection *parent;
 +      };
 +      void build_layer_collection(ID *owner_id,
 +                                  LayerCollection *layer_collection,
 +                                  LayerCollectionState *state);
 +      void build_layer_collections(ID *owner_id,
 +                                   ListBase *layer_collections,
 +                                   LayerCollectionState *state);
 +      void build_view_layer_collections(ID *owner_id, ViewLayer *view_layer);
  protected:
 +      struct SavedEntryTag {
 +              ID *id;
 +              eDepsNode_Type component_type;
 +              eDepsOperation_Code opcode;
 +      };
 +      vector<SavedEntryTag> saved_entry_tags_;
 +
+       struct BuilderWalkUserData {
+               DepsgraphNodeBuilder *builder;
+       };
+       static void modifier_walk(void *user_data,
+                                 struct Object *object,
+                                 struct ID **idpoin,
+                                 int cb_flag);
+       static void constraint_walk(bConstraint *constraint,
+                                   ID **idpoin,
+                                   bool is_reference,
+                                   void *user_data);
        /* State which never changes, same for the whole builder time. */
        Main *bmain_;
        Depsgraph *graph_;