Bugfix: workaround for spline IK crash with curve path not created
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 12 Nov 2009 15:18:01 +0000 (15:18 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 12 Nov 2009 15:18:01 +0000 (15:18 +0000)
yet, this is actually a depsgraph issue .. so instead of crashing it
will not update correct on file load now.

source/blender/blenkernel/intern/armature.c

index cf84fea1f68ad9d04467c381d08457ab61f044e2..a9934fbb77bac71e7ae570d9dbf6595c2aa2a314 100644 (file)
@@ -1743,7 +1743,7 @@ static void splineik_init_tree_from_pchan(Object *ob, bPoseChannel *pchan_tip)
                
                /* get the current length of the curve */
                // NOTE: this is assumed to be correct even after the curve was resized
-               splineLen= cu->path->totdist;
+               splineLen= (cu->path)? cu->path->totdist: 1.0f;
                
                /* calculate the scale factor to multiply all the path values by so that the 
                 * bone chain retains its current length, such that