Fix for align bone to cursor (missing normalize)
authorCampbell Barton <ideasman42@gmail.com>
Fri, 17 Oct 2014 20:11:14 +0000 (22:11 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 17 Oct 2014 20:11:41 +0000 (22:11 +0200)
source/blender/editors/armature/armature_edit.c

index b7ab7fe064df2a56e83136f4a952eb469d989224..8bcee52baabe20d575166c1720daa9e6c629bf38 100644 (file)
@@ -296,7 +296,9 @@ static int armature_calc_roll_exec(bContext *C, wmOperator *op)
                                float cursor_rel[3];
                                sub_v3_v3v3(cursor_rel, cursor_local, ebone->head);
                                if (axis_flip) negate_v3(cursor_rel);
-                               ebone->roll = ED_rollBoneToVector(ebone, cursor_rel, axis_only);
+                               if (normalize_v3(cursor_rel) != 0.0f) {
+                                       ebone->roll = ED_rollBoneToVector(ebone, cursor_rel, axis_only);
+                               }
                        }
                }
        }