Commit: 22370929fe407eb43bdc7511799fa655e14a4b9e
Author: Sergey Sharybin
Date:   Wed Jun 6 12:01:38 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB22370929fe407eb43bdc7511799fa655e14a4b9e

Depsgraph: Expand object data datablocks for drivers

Drivers can reference object data datablock directly, and if there
was no object in the scene with that datablock, blender will crash.

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

M       source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M       source/blender/depsgraph/intern/builder/deg_builder_relations.cc

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

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc 
b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 607e1389c5f..8861ffc956a 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -383,12 +383,27 @@ void DepsgraphNodeBuilder::build_id(ID* id) {
                return;
        }
        switch (GS(id->name)) {
+               case ID_AR:
+                       build_armature((bArmature *)id);
+                       break;
+               case ID_CA:
+                       build_camera((Camera *)id);
+                       break;
                case ID_GR:
                        build_collection((Collection *)id);
                        break;
                case ID_OB:
                        build_object(-1, (Object *)id, 
DEG_ID_LINKED_INDIRECTLY);
                        break;
+               case ID_KE:
+                       build_shapekeys((Key *)id);
+                       break;
+               case ID_LA:
+                       build_lamp((Lamp *)id);
+                       break;
+               case ID_LP:
+                       build_lightprobe((LightProbe *)id);
+                       break;
                case ID_NT:
                        build_nodetree((bNodeTree *)id);
                        break;
@@ -410,8 +425,16 @@ void DepsgraphNodeBuilder::build_id(ID* id) {
                case ID_MC:
                        build_movieclip((MovieClip *)id);
                        break;
+               case ID_ME:
+               case ID_CU:
+               case ID_MB:
+               case ID_LT:
+                       build_object_data_geometry_datablock(id);
+                       break;
                default:
                        fprintf(stderr, "Unhandled ID %s\n", id->name);
+                       BLI_assert(!"Should never happen");
+                       break;
        }
 }
 
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc 
b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index d91d80cead6..26f5c167627 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -399,12 +399,27 @@ void DepsgraphRelationBuilder::build_id(ID *id)
                return;
        }
        switch (GS(id->name)) {
+               case ID_AR:
+                       build_armature((bArmature *)id);
+                       break;
+               case ID_CA:
+                       build_camera((Camera *)id);
+                       break;
                case ID_GR:
                        build_collection(NULL, (Collection *)id);
                        break;
                case ID_OB:
                        build_object(NULL, (Object *)id);
                        break;
+               case ID_KE:
+                       build_shapekeys((Key *)id);
+                       break;
+               case ID_LA:
+                       build_lamp((Lamp *)id);
+                       break;
+               case ID_LP:
+                       build_lightprobe((LightProbe *)id);
+                       break;
                case ID_NT:
                        build_nodetree((bNodeTree *)id);
                        break;
@@ -423,8 +438,16 @@ void DepsgraphRelationBuilder::build_id(ID *id)
                case ID_MC:
                        build_movieclip((MovieClip *)id);
                        break;
+               case ID_ME:
+               case ID_CU:
+               case ID_MB:
+               case ID_LT:
+                       build_object_data_geometry_datablock(id);
+                       break;
                default:
                        fprintf(stderr, "Unhandled ID %s\n", id->name);
+                       BLI_assert(!"Should never happen");
+                       break;
        }
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to