Commit: cf95267456a0c4f988691ecc822c211ff7849c55
Author: Sergey Sharybin
Date:   Mon Apr 16 16:17:03 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBcf95267456a0c4f988691ecc822c211ff7849c55

Merge branch 'master' into blender2.8

===================================================================



===================================================================

diff --cc source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index a5a28ce0a8c,b3f6958e9c3..92af811dab4
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@@ -325,64 -262,49 +325,101 @@@ ID *DepsgraphNodeBuilder::ensure_cow_id
  /* **** Build functions for entity nodes **** */
  
  void DepsgraphNodeBuilder::begin_build() {
 +      if (DEG_depsgraph_use_copy_on_write()) {
 +              /* Store existing copy-on-write versions of datablock, so we 
can re-use
 +               * them for new ID nodes.
 +               */
 +              cow_id_hash_ = BLI_ghash_ptr_new("Depsgraph id hash");
 +              foreach (IDDepsNode *id_node, graph_->id_nodes) {
 +                      if (deg_copy_on_write_is_expanded(id_node->id_cow)) {
 +                              if (id_node->id_orig == id_node->id_cow) {
 +                                      continue;
 +                              }
 +                              BLI_ghash_insert(cow_id_hash_,
 +                                               id_node->id_orig,
 +                                               id_node->id_cow);
 +                              id_node->id_cow = NULL;
 +                      }
 +              }
 +      }
 +
 +      GSET_FOREACH_BEGIN(OperationDepsNode *, op_node, graph_->entry_tags)
 +      {
 +              ComponentDepsNode *comp_node = op_node->owner;
 +              IDDepsNode *id_node = comp_node->owner;
 +
 +              SavedEntryTag entry_tag;
 +              entry_tag.id = id_node->id_orig;
 +              entry_tag.component_type = comp_node->type;
 +              entry_tag.opcode = op_node->opcode;
 +              saved_entry_tags_.push_back(entry_tag);
 +      };
 +      GSET_FOREACH_END();
 +
 +      /* Make sure graph has no nodes left from previous state. */
 +      graph_->clear_all_nodes();
 +      graph_->operations.clear();
 +      BLI_gset_clear(graph_->entry_tags, NULL);
 +}
 +
 +void DepsgraphNodeBuilder::end_build()
 +{
 +      foreach (const SavedEntryTag& entry_tag, saved_entry_tags_) {
 +              IDDepsNode *id_node = find_id_node(entry_tag.id);
 +              if (id_node == NULL) {
 +                      continue;
 +              }
 +              ComponentDepsNode *comp_node =
 +                      id_node->find_component(entry_tag.component_type);
 +              if (comp_node == NULL) {
 +                      continue;
 +              }
 +              OperationDepsNode *op_node = 
comp_node->find_operation(entry_tag.opcode);
 +              if (op_node == NULL) {
 +                      continue;
 +              }
 +              op_node->tag_update(graph_);
 +      }
  }
  
+ void DepsgraphNodeBuilder::build_id(ID* id) {
+       if (id == NULL) {
+               return;
+       }
+       switch (GS(id->name)) {
 -              case ID_SCE:
 -                      build_scene((Scene *)id);
 -                      break;
+               case ID_GR:
 -                      build_group(NULL, (Group *)id);
++                      build_group((Group *)id);
+                       break;
+               case ID_OB:
 -                      build_object(NULL, (Object *)id);
++                      build_object(-1, (Object *)id, 
DEG_ID_LINKED_INDIRECTLY);
+                       break;
+               case ID_NT:
+                       build_nodetree((bNodeTree *)id);
+                       break;
+               case ID_MA:
+                       build_material((Material *)id);
+                       break;
+               case ID_TE:
+                       build_texture((Tex *)id);
+                       break;
+               case ID_IM:
+                       build_image((Image *)id);
+                       break;
+               case ID_WO:
+                       build_world((World *)id);
+                       break;
+               case ID_MSK:
+                       build_mask((Mask *)id);
+                       break;
+               case ID_MC:
+                       build_movieclip((MovieClip *)id);
+                       break;
+               default:
+                       fprintf(stderr, "Unhandled ID %s\n", id->name);
+       }
+ }
+ 
 -void DepsgraphNodeBuilder::build_group(Base *base, Group *group)
 +void DepsgraphNodeBuilder::build_group(Group *group)
  {
        if (built_map_.checkIsBuiltAndTag(group)) {
                return;
diff --cc source/blender/depsgraph/intern/builder/deg_builder_nodes.h
index df94671b4c6,f2154e58703..757cacc6050
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
@@@ -157,16 -126,10 +157,17 @@@ struct DepsgraphNodeBuilder 
                                               const char *name = "",
                                               int name_tag = -1);
  
+       void build_id(ID* id);
 -      void build_scene(Scene *scene);
 -      void build_group(Base *base, Group *group);
 -      void build_object(Base *base, Object *object);
 +      void build_view_layer(Scene *scene,
 +                             ViewLayer *view_layer,
 +                             eDepsNode_LinkedState_Type linked_state);
 +      void build_group(Group *group);
 +      void build_object(int base_index,
 +                        Object *object,
 +                        eDepsNode_LinkedState_Type linked_state);
 +      void build_object_flags(int base_index,
 +                              Object *object,
 +                              eDepsNode_LinkedState_Type linked_state);
        void build_object_data(Object *object);
        void build_object_transform(Object *object);
        void build_object_constraints(Object *object);

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to