Fix T56363: Blender crash when deleting a curve object.
authorBastien Montagne <montagne29@wanadoo.fr>
Tue, 14 Aug 2018 12:05:09 +0000 (14:05 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Tue, 14 Aug 2018 12:06:42 +0000 (14:06 +0200)
Conversion code could leave object with inconsistent material data
compared to its new obdata.

Ideally, various conversion code would handle that properly, conserving
materials when possible, but for now at least ensure we get valid
result!

source/blender/editors/object/object_add.c

index e977dea6140b4e9ce8409d76419b112082a52fde..8fc2d419c3ce0c64a005c9c155864ea21d2ae4d0 100644 (file)
@@ -1903,6 +1903,9 @@ static int convert_exec(bContext *C, wmOperator *op)
                        continue;
                }
 
+               /* Ensure new object has consistent material data with its new obdata. */
+               test_object_materials(bmain, newob, newob->data);
+
                /* tag obdata if it was been changed */
 
                /* If the original object is active then make this object active */