Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2017-01-21 16:54:35 +0300
committerJoshua Leung <aligorith@gmail.com>2017-01-21 16:55:10 +0300
commitd2382f782e74f9e7b4df49ffc8e40dabb0b8af50 (patch)
tree7db87d5722b351d34c88aa7fd5934abd709fefa8
parent82187a58f53fef8fe88f89a8aa38729d871a2a37 (diff)
Fix T49527: Blender stalls when changing armature ghosting range with stepsize = 0
A big thanks to Steffen Mortensen (stifan) for finding the root cause of this bug!
-rw-r--r--source/blender/blenkernel/intern/armature.c1
-rw-r--r--source/blender/editors/space_view3d/drawarmature.c10
2 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 2b333941c6e..0287d6ae9ca 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -87,6 +87,7 @@ bArmature *BKE_armature_add(Main *bmain, const char *name)
arm->deformflag = ARM_DEF_VGROUP | ARM_DEF_ENVELOPE;
arm->flag = ARM_COL_CUSTOM; /* custom bone-group colors */
arm->layer = 1;
+ arm->ghostsize = 1;
return arm;
}
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c
index 95a2df68e4a..149144d969a 100644
--- a/source/blender/editors/space_view3d/drawarmature.c
+++ b/source/blender/editors/space_view3d/drawarmature.c
@@ -2463,6 +2463,10 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, ARegion *ar, Base
if (end <= start)
return;
+ /* prevent infinite loops if this is set to 0 - T49527 */
+ if (arm->ghostsize < 1)
+ arm->ghostsize = 1;
+
stepsize = (float)(arm->ghostsize);
range = (float)(end - start);
@@ -2608,7 +2612,11 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
calc_action_range(adt->action, &start, &end, 0);
if (start == end)
return;
-
+
+ /* prevent infinite loops if this is set to 0 - T49527 */
+ if (arm->ghostsize < 1)
+ arm->ghostsize = 1;
+
stepsize = (float)(arm->ghostsize);
range = (float)(arm->ghostep) * stepsize + 0.5f; /* plus half to make the for loop end correct */