Fix #4111
authorTon Roosendaal <ton@blender.org>
Mon, 17 Apr 2006 14:26:41 +0000 (14:26 +0000)
committerTon Roosendaal <ton@blender.org>
Mon, 17 Apr 2006 14:26:41 +0000 (14:26 +0000)
Objects with a Pose, but which is not an armature, crashes on duplicating.

Now have to find out how it can happen even... only Armatures uses poses.

source/blender/blenkernel/intern/object.c

index 0f1460f1b37b7d61e106c9653541605d2474a4bf..898bb0d3b4f195c6b7b20e16b5a03bec48b4699f 100644 (file)
@@ -878,7 +878,9 @@ Object *copy_object(Object *ob)
        
        if(ob->pose) {
                copy_pose(&obn->pose, ob->pose, 1);
-               armature_rebuild_pose(obn, obn->data);
+               /* backwards compat... non-armatures can get poses in older files? */
+               if(ob->type==OB_ARMATURE)
+                       armature_rebuild_pose(obn, obn->data);
        }
        copy_defgroups(&obn->defbase, &ob->defbase);
        copy_nlastrips(&obn->nlastrips, &ob->nlastrips);