Merge branch 'master' into blender2.8
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 4 Apr 2018 10:57:36 +0000 (12:57 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 4 Apr 2018 10:57:36 +0000 (12:57 +0200)
intern/cycles/render/mesh_subdivision.cpp
source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
source/blender/depsgraph/intern/builder/deg_builder_relations.cc

index ea71f71b655f583768ff5bac085d8fcfbd9303bf..9dd81eb67003c6b013537a62aaab34aeef991784 100644 (file)
@@ -204,7 +204,7 @@ public:
                        src = dest;
                }
 
-               if(num_refiner_verts) {
+               if(num_local_points) {
                        patch_table->ComputeLocalPointValues(&verts[0], &verts[num_refiner_verts]);
                }
 
@@ -238,7 +238,7 @@ public:
                                src = dest;
                        }
 
-                       if(num_refiner_verts) {
+                       if(num_local_points) {
                                if(attr.same_storage(attr.type, TypeDesc::TypeFloat)) {
                                        patch_table->ComputeLocalPointValues((OsdValue<float>*)&attr.buffer[0],
                                                                                     (OsdValue<float>*)&attr.buffer[num_refiner_verts * attr.data_sizeof()]);
index 7d606629acbdbb2c48d6b83692500dbf16e2ee18..565218d8be009dececbfede8c18c3ee01045b934 100644 (file)
@@ -124,14 +124,26 @@ struct BuilderWalkUserData {
 
 static void modifier_walk(void *user_data,
                           struct Object * /*object*/,
-                          struct Object **obpoin,
+                          struct ID **idpoin,
                           int /*cb_flag*/)
 {
        BuilderWalkUserData *data = (BuilderWalkUserData *)user_data;
-       if (*obpoin) {
-               data->builder->build_object(NULL,
-                                           *obpoin,
-                                           DEG_ID_LINKED_INDIRECTLY);
+       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;
        }
 }
 
@@ -483,7 +495,7 @@ void DepsgraphNodeBuilder::build_object(Base *base,
        if (object->modifiers.first != NULL) {
                BuilderWalkUserData data;
                data.builder = this;
-               modifiers_foreachObjectLink(object, modifier_walk, &data);
+               modifiers_foreachIDLink(object, modifier_walk, &data);
        }
        /* Constraints. */
        if (object->constraints.first != NULL) {
@@ -1315,6 +1327,11 @@ void DepsgraphNodeBuilder::build_texture(Tex *texture)
                        build_image(texture->ima);
                }
        }
+       /* Placeholder so we can add relations and tag ID node for update. */
+       add_operation_node(&texture->id,
+                          DEG_NODE_TYPE_PARAMETERS,
+                          NULL,
+                          DEG_OPCODE_PLACEHOLDER);
 }
 
 void DepsgraphNodeBuilder::build_image(Image *image) {
index 5e25f60e3ac3c3f27fe654e331d65180890699f9..96a99eea624b90bdc135e8703d41d976bee588aa 100644 (file)
@@ -123,12 +123,24 @@ struct BuilderWalkUserData {
 
 void modifier_walk(void *user_data,
                    struct Object * /*object*/,
-                   struct Object **obpoin,
+                   struct ID **idpoin,
                    int /*cb_flag*/)
 {
        BuilderWalkUserData *data = (BuilderWalkUserData *)user_data;
-       if (*obpoin) {
-               data->builder->build_object(NULL, *obpoin);
+       ID *id = *idpoin;
+       if (id == NULL) {
+               return;
+       }
+       switch (GS(id->name)) {
+               case ID_OB:
+                       data->builder->build_object(NULL, (Object *)id);
+                       break;
+               case ID_TE:
+                       data->builder->build_texture((Tex *)id);
+                       break;
+               default:
+                       /* pass */
+                       break;
        }
 }
 
@@ -463,7 +475,7 @@ void DepsgraphRelationBuilder::build_object(Base *base, Object *object)
        if (object->modifiers.first != NULL) {
                BuilderWalkUserData data;
                data.builder = this;
-               modifiers_foreachObjectLink(object, modifier_walk, &data);
+               modifiers_foreachIDLink(object, modifier_walk, &data);
        }
        /* Constraints. */
        if (object->constraints.first != NULL) {