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.
This commit is contained in:
Sergey Sharybin 2018-06-06 12:01:38 +02:00
parent 7810c60fe3
commit 22370929fe
2 changed files with 46 additions and 0 deletions

View File

@ -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;
}
}

View File

@ -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;
}
}