Merge branch 'master' into blender2.8
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 2 May 2017 13:40:23 +0000 (15:40 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 2 May 2017 13:41:15 +0000 (15:41 +0200)
1  2 
source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
source/blender/depsgraph/intern/builder/deg_builder_relations.cc

index db575c0da7c79a96b4007565e99e2e1bc8148e9d,7df9fe0bdc834022a73e241429fee773e144859c..b87bbb60479543a8d673e4f9bf477c8e3219e2e3
@@@ -72,6 -72,7 +72,6 @@@ extern "C" 
  #include "BKE_animsys.h"
  #include "BKE_constraint.h"
  #include "BKE_curve.h"
 -#include "BKE_depsgraph.h"
  #include "BKE_effect.h"
  #include "BKE_fcurve.h"
  #include "BKE_idcode.h"
@@@ -124,7 -125,7 +124,7 @@@ static void modifier_walk(void *user_da
  {
        BuilderWalkUserData *data = (BuilderWalkUserData *)user_data;
        if (*obpoin) {
 -              data->builder->build_object(data->scene, NULL, *obpoin);
 +              data->builder->build_object(data->scene, *obpoin);
        }
  }
  
@@@ -137,7 -138,7 +137,7 @@@ void constraint_walk(bConstraint * /*co
        if (*idpoin) {
                ID *id = *idpoin;
                if (GS(id->name) == ID_OB) {
 -                      data->builder->build_object(data->scene, NULL, (Object *)id);
 +                      data->builder->build_object(data->scene, (Object *)id);
                }
        }
  }
@@@ -336,7 -337,9 +336,7 @@@ void DepsgraphNodeBuilder::begin_build(
        } FOREACH_NODETREE_END
  }
  
 -void DepsgraphNodeBuilder::build_group(Scene *scene,
 -                                       Base *base,
 -                                       Group *group)
 +void DepsgraphNodeBuilder::build_group(Scene *scene, Group *group)
  {
        ID *group_id = &group->id;
        if (group_id->tag & LIB_TAG_DOIT) {
        group_id->tag |= LIB_TAG_DOIT;
  
        LINKLIST_FOREACH (GroupObject *, go, &group->gobject) {
 -              build_object(scene, base, go->ob);
 +              build_object(scene, go->ob);
        }
  }
  
@@@ -384,23 -387,35 +384,23 @@@ SubgraphDepsNode *DepsgraphNodeBuilder:
        return subgraph_node;
  }
  
 -void DepsgraphNodeBuilder::build_object(Scene *scene, Base *base, Object *ob)
 +void DepsgraphNodeBuilder::build_object(Scene *scene, Object *ob)
  {
 -      const bool has_object = (ob->id.tag & LIB_TAG_DOIT);
 -      IDDepsNode *id_node = (has_object)
 -              ? m_graph->find_id_node(&ob->id)
 -              : add_id_node(&ob->id);
 -      /* Update node layers.
 -       * Do it for both new and existing ID nodes. This is so because several
 -       * bases might be sharing same object.
 -       */
 -      if (base != NULL) {
 -              id_node->layers |= base->lay;
 -      }
 -      if (ob == scene->camera) {
 -              /* Camera should always be updated, it used directly by viewport. */
 -              id_node->layers |= (unsigned int)(-1);
 -      }
        /* Skip rest of components if the ID node was already there. */
 -      if (has_object) {
 +      if (ob->id.tag & LIB_TAG_DOIT) {
                return;
        }
        ob->id.tag |= LIB_TAG_DOIT;
 +
 +      /* Create ID node for obejct and begin init. */
 +      IDDepsNode *id_node = add_id_node(&ob->id);
        ob->customdata_mask = 0;
  
        /* Standard components. */
        build_object_transform(scene, ob);
  
        if (ob->parent != NULL) {
 -              build_object(scene, NULL, ob->parent);
 +              build_object(scene, ob->parent);
        }
        if (ob->modifiers.first != NULL) {
                BuilderWalkUserData data;
        /* Object that this is a proxy for. */
        if (ob->proxy) {
                ob->proxy->proxy_from = ob;
 -              build_object(scene, base, ob->proxy);
 +              build_object(scene, ob->proxy);
        }
  
        /* Object dupligroup. */
        if (ob->dup_group != NULL) {
 -              build_group(scene, base, ob->dup_group);
 +              build_group(scene, ob->dup_group);
        }
  }
  
@@@ -839,18 -854,11 +839,11 @@@ void DepsgraphNodeBuilder::build_obdata
        }
  
        /* materials */
-       if (ob->totcol != 0) {
-               for (int a = 1; a <= ob->totcol; a++) {
-                       Material *ma = give_current_material(ob, a);
-                       if (ma != NULL) {
-                               build_material(ma);
-                       }
+       for (int a = 1; a <= ob->totcol; a++) {
+               Material *ma = give_current_material(ob, a);
+               if (ma != NULL) {
+                       build_material(ma);
                }
-               add_operation_node(&ob->id,
-                                  DEPSNODE_TYPE_SHADING,
-                                  DEPSOP_TYPE_EXEC,
-                                  NULL,
-                                  DEG_OPCODE_PLACEHOLDER, "Material Update");
        }
  
        /* geometry collision */
                         */
                        Curve *cu = (Curve *)obdata;
                        if (cu->bevobj != NULL) {
 -                              build_object(scene, NULL, cu->bevobj);
 +                              build_object(scene, cu->bevobj);
                        }
                        if (cu->taperobj != NULL) {
 -                              build_object(scene, NULL, cu->taperobj);
 +                              build_object(scene, cu->taperobj);
                        }
                        if (ob->type == OB_FONT && cu->textoncurve != NULL) {
 -                              build_object(scene, NULL, cu->textoncurve);
 +                              build_object(scene, cu->textoncurve);
                        }
                        break;
                }
index ae12d00e035227792d0f92f8966ab8dcf9255f0b,2dae3daaab2865c94b4c148c182fee2658cc26da..27a24031911401ed3b43ec5510b3760adc90dc9d
@@@ -274,10 -274,10 +274,10 @@@ void DepsgraphRelationBuilder::add_oper
        }
  }
  
 -void DepsgraphRelationBuilder::add_collision_relations(const OperationKey &key, Scene *scene, Object *ob, Group *group, int layer, bool dupli, const char *name)
 +void DepsgraphRelationBuilder::add_collision_relations(const OperationKey &key, Scene *scene, Object *ob, Group *group, bool dupli, const char *name)
  {
        unsigned int numcollobj;
 -      Object **collobjs = get_collisionobjects_ext(scene, ob, group, layer, &numcollobj, eModifierType_Collision, dupli);
 +      Object **collobjs = get_collisionobjects_ext(scene, ob, group, &numcollobj, eModifierType_Collision, dupli);
  
        for (unsigned int i = 0; i < numcollobj; i++)
        {
@@@ -329,7 -329,7 +329,7 @@@ void DepsgraphRelationBuilder::add_forc
                        }
  
                        if (add_absorption && (eff->pd->flag & PFIELD_VISIBILITY)) {
 -                              add_collision_relations(key, scene, ob, NULL, eff->ob->lay, true, "Force Absorption");
 +                              add_collision_relations(key, scene, ob, NULL, true, "Force Absorption");
                        }
                }
        }
@@@ -1308,10 -1308,10 +1308,10 @@@ void DepsgraphRelationBuilder::build_pa
  
                /* collisions */
                if (part->type != PART_HAIR) {
 -                      add_collision_relations(psys_key, scene, ob, part->collision_group, ob->lay, true, "Particle Collision");
 +                      add_collision_relations(psys_key, scene, ob, part->collision_group, true, "Particle Collision");
                }
                else if ((psys->flag & PSYS_HAIR_DYNAMICS) && psys->clmd && psys->clmd->coll_parms) {
 -                      add_collision_relations(psys_key, scene, ob, psys->clmd->coll_parms->group, ob->lay | scene->lay, true, "Hair Collision");
 +                      add_collision_relations(psys_key, scene, ob, psys->clmd->coll_parms->group, true, "Hair Collision");
                }
  
                /* effectors */
@@@ -1489,28 -1489,13 +1489,13 @@@ void DepsgraphRelationBuilder::build_ob
        }
  
        /* materials */
-       if (ob->totcol != 0) {
-               ComponentKey object_shading_key(&ob->id, DEPSNODE_TYPE_SHADING);
+       if (ob->totcol) {
                for (int a = 1; a <= ob->totcol; a++) {
                        Material *ma = give_current_material(ob, a);
                        if (ma != NULL) {
                                build_material(ma);
-                               ComponentKey material_shading_key(&ma->id,
-                                                                 DEPSNODE_TYPE_SHADING);
-                               add_relation(material_shading_key,
-                                            object_shading_key,
-                                            DEPSREL_TYPE_UPDATE,
-                                            "Object Shading");
                        }
                }
-               OperationKey obdata_geom_done_key(obdata,
-                                                 DEPSNODE_TYPE_GEOMETRY,
-                                                 DEG_OPCODE_PLACEHOLDER,
-                                                 "Eval Done");
-               add_relation(geom_key,
-                            object_shading_key,
-                            DEPSREL_TYPE_UPDATE,
-                            "Object Shading");
        }
  
        /* geometry collision */