forked from bartvdbraak/blender
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!
This commit is contained in:
parent
82187a58f5
commit
d2382f782e
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
@ -2609,6 +2613,10 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
|
||||
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 */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user