Fix #109011: OBJECT_OT_shape_key_clear ignores slider min and max
The issue was that the `OBJECT_OT_shape_key_clear` ignored
the slider limits and always reset the value to 0.
Judging by the commit introducing that operator (2e74a6ba30)
the idea was to quickly disable all shape keys.
That means this PR changes that meaning slightly, so I updated the description.
I can foresee a potential issue where users expect the current behavior
with the use case to actually disable all shapekeys.
Given that we have an option now to disable a shapekey without
changing its value (the checkbox) we should look into making a different operator
that utilizes that instead of modifying the value property.
Pull Request: https://projects.blender.org/blender/blender/pulls/123889
This commit is contained in:
committed by
Christoph Lendenfeld
parent
789bcaae78
commit
e45ec6b591
@@ -484,7 +484,7 @@ static int shape_key_clear_exec(bContext *C, wmOperator * /*op*/)
|
||||
}
|
||||
|
||||
LISTBASE_FOREACH (KeyBlock *, kb, &key->block) {
|
||||
kb->curval = 0.0f;
|
||||
kb->curval = clamp_f(0.0f, kb->slidermin, kb->slidermax);
|
||||
}
|
||||
|
||||
DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
|
||||
@@ -497,7 +497,8 @@ void OBJECT_OT_shape_key_clear(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name = "Clear Shape Keys";
|
||||
ot->description = "Clear weights for all shape keys";
|
||||
ot->description =
|
||||
"Reset the weights of all shape keys to 0 or to the closest value respecting the limits";
|
||||
ot->idname = "OBJECT_OT_shape_key_clear";
|
||||
|
||||
/* api callbacks */
|
||||
|
||||
Reference in New Issue
Block a user