Merge branch 'master' into blender2.8
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 23 Nov 2017 11:04:57 +0000 (12:04 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 23 Nov 2017 11:04:57 +0000 (12:04 +0100)
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_relations.cc
source/blender/depsgraph/intern/builder/deg_builder_relations.h

index aea74af68614ca698d6f575b76c63e5ad0711ecf,838afbbdbbbc08d14da6c5595fcc59ea0831419b..948e1410df5a4c3e0086079ea64fd49b58d5e1de
@@@ -406,19 -334,14 +406,19 @@@ void DepsgraphNodeBuilder::build_object
                return;
        }
        object->id.tag |= LIB_TAG_DOIT;
 +
 +      /* Create ID node for object and begin init. */
 +      IDDepsNode *id_node = add_id_node(&object->id);
 +      id_node->linked_state = linked_state;
 +
        object->customdata_mask = 0;
-       /* Standard components. */
+       /* Transform. */
        build_object_transform(object);
+       /* Parent. */
        if (object->parent != NULL) {
 -              build_object(NULL, object->parent);
 +              build_object(object->parent, linked_state);
        }
+       /* Modifiers. */
        if (object->modifiers.first != NULL) {
                BuilderWalkUserData data;
                data.builder = this;
        /* Object that this is a proxy for. */
        if (object->proxy) {
                object->proxy->proxy_from = object;
 -              build_object(base, object->proxy);
 +              build_object(object->proxy, DEG_ID_LINKED_INDIRECTLY);
        }
        /* Object dupligroup. */
        if (object->dup_group != NULL) {
 -              build_group(base, object->dup_group);
 +              build_group(object->dup_group);
        }
  }
  
 -      /* type-specific data... */
+ void DepsgraphNodeBuilder::build_object_data(Object *object)
+ {
+       if (object->data == NULL) {
+               return;
+       }
+       IDDepsNode *id_node = graph_->find_id_node(&object->id);
 -              case OB_MESH:     /* Geometry */
++      /* type-specific data. */
+       switch (object->type) {
++              case OB_MESH:
+               case OB_CURVE:
+               case OB_FONT:
+               case OB_SURF:
+               case OB_MBALL:
+               case OB_LATTICE:
+                       build_obdata_geom(object);
+                       /* TODO(sergey): Only for until we support granular
+                        * update of curves.
+                        */
+                       if (object->type == OB_FONT) {
+                               Curve *curve = (Curve *)object->data;
+                               if (curve->textoncurve) {
+                                       id_node->eval_flags |= DAG_EVAL_NEED_CURVE_PATH;
+                               }
+                       }
+                       break;
+               case OB_ARMATURE:
+                       if (ID_IS_LINKED(object) && object->proxy_from != NULL) {
+                               build_proxy_rig(object);
+                       }
+                       else {
+                               build_rig(object);
+                       }
+                       break;
+               case OB_LAMP:
+                       build_lamp(object);
+                       break;
+               case OB_CAMERA:
+                       build_camera(object);
+                       break;
++              case OB_LIGHTPROBE:
++                      build_lightprobe(object);
++                      break;
+               default:
+               {
+                       ID *obdata = (ID *)object->data;
+                       if ((obdata->tag & LIB_TAG_DOIT) == 0) {
+                               build_animdata(obdata);
+                       }
+                       break;
+               }
+       }
+ }
  void DepsgraphNodeBuilder::build_object_transform(Object *object)
  {
        OperationDepsNode *op_node;
index a956c94a6824b425d6d5d6a5f868bce1e19cd2c9,2fa9ba01cc74b980991bccbf29e5fb61f752cdbc..00109eeafcc01ddbc7fb6792f2788408b71896c4
@@@ -157,12 -118,10 +157,13 @@@ struct DepsgraphNodeBuilder 
                                               const char *name = "",
                                               int name_tag = -1);
  
 -      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(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);
        void build_pose_constraints(Object *object, bPoseChannel *pchan);
index 9da3046ff07e4d6c3a72187dc819ea6055e4380b,67faa59bbc3288eb5424cd529ebc39d774b64e02..26eaea9a18c1ff202bc7a50a3d61c56b34df7106
@@@ -592,6 -540,49 +541,52 @@@ void DepsgraphRelationBuilder::build_ob
        }
  }
  
+ void DepsgraphRelationBuilder::build_object_data(Object *object)
+ {
+       if (object->data == NULL) {
+               return;
+       }
+       ID *obdata_id = (ID *)object->data;
+       /* Object data animation. */
+       build_animdata(obdata_id);
+       /* type-specific data. */
+       switch (object->type) {
+               case OB_MESH:
+               case OB_CURVE:
+               case OB_FONT:
+               case OB_SURF:
+               case OB_MBALL:
+               case OB_LATTICE:
+               {
+                       build_obdata_geom(object);
+                       break;
+               }
+               case OB_ARMATURE:
+                       if (ID_IS_LINKED(object) && object->proxy_from != NULL) {
+                               build_proxy_rig(object);
+                       }
+                       else {
+                               build_rig(object);
+                       }
+                       break;
+               case OB_LAMP:
+                       build_lamp(object);
+                       break;
+               case OB_CAMERA:
+                       build_camera(object);
+                       break;
++              case OB_LIGHTPROBE:
++                      build_lightprobe(object);
++                      break;
+       }
+       Key *key = BKE_key_from_object(object);
+       if (key != NULL) {
+               ComponentKey geometry_key((ID *)object->data, DEG_NODE_TYPE_GEOMETRY);
+               ComponentKey key_key(&key->id, DEG_NODE_TYPE_GEOMETRY);
+               add_relation(key_key, geometry_key, "Shapekeys");
+       }
+ }
  void DepsgraphRelationBuilder::build_object_parent(Object *object)
  {
        /* XXX: for now, need to use the component key (not just direct to the parent op),
index 15d9f1db4dcbd93f3d9777cf9114c60069e70240,2bb087a13595051e9053094808d6b9a0c1b77c62..57c9c762d9bb4768076c4d6a507422fde2fba848
@@@ -186,9 -184,10 +186,10 @@@ struct DepsgraphRelationBuilde
                                      const DepsNodeHandle *handle,
                                      const char *description);
  
 -      void build_scene(Scene *scene);
 +      void build_view_layer(Scene *scene, ViewLayer *view_layer);
        void build_group(Object *object, Group *group);
        void build_object(Object *object);
+       void build_object_data(Object *object);
        void build_object_parent(Object *object);
        void build_constraints(ID *id,
                               eDepsNode_Type component_type,