Fix T38337: Crash when calling to_mesh() on a Curve object after clearing its parent

This is rather a workaround which only works because curve evaluation is only called
for a temporary object. Not a big deal if we'll skip path creation for such objects.

Still would need to think of general solution.
This commit is contained in:
Sergey Sharybin 2014-01-24 00:16:10 +06:00
parent 9f903208e8
commit 0f72a8a7f0
Notes: blender-bot 2023-02-14 11:18:05 +01:00
Referenced by issue #38337, Depsgraph crash when calling to_mesh() on a Curve object after clearing its parent
1 changed files with 13 additions and 1 deletions

View File

@ -2959,7 +2959,19 @@ const char *DAG_get_node_name(void *node_v)
short DAG_get_eval_flags_for_object(struct Scene *scene, void *object)
{
DagNode *node = dag_find_node(scene->theDag, object);;
DagNode *node;
if (scene->theDag == NULL) {
/* Happens when converting objects to mesh from a python script
* after modifying scene graph.
*
* Currently harmless because it's only called for temporary
* objects which are out of the DAG anyway.
*/
return 0;
}
node = dag_find_node(scene->theDag, object);;
if (node) {
return node->eval_flags;