Fix wm.context_* operators reusing values when it's not expected

wm.context_* operators typically have their options set by menus
or key bindings.

Re-using options in this case can cause problems where two
actions that change unrelated properties will re-use a setting
from the previous execution.

For example changing the lights Power impacted
changing it's Radius afterwards.
This commit is contained in:
Campbell Barton 2021-01-26 08:04:25 +11:00
parent c134d7437d
commit 14f61c619b
1 changed files with 7 additions and 0 deletions

View File

@ -48,18 +48,21 @@ rna_reverse_prop = BoolProperty(
name="Reverse",
description="Cycle backwards",
default=False,
options={'SKIP_SAVE'},
)
rna_wrap_prop = BoolProperty(
name="Wrap",
description="Wrap back to the first/last values",
default=False,
options={'SKIP_SAVE'},
)
rna_relative_prop = BoolProperty(
name="Relative",
description="Apply relative to the current value (delta)",
default=False,
options={'SKIP_SAVE'},
)
rna_space_type_prop = EnumProperty(
@ -233,6 +236,7 @@ class WM_OT_context_scale_int(Operator):
name="Always Step",
description="Always adjust the value by a minimum of 1 when 'value' is not 1.0",
default=True,
options={'SKIP_SAVE'},
)
def execute(self, context):
@ -741,10 +745,12 @@ class WM_OT_context_modal_mouse(Operator):
input_scale: FloatProperty(
description="Scale the mouse movement by this value before applying the delta",
default=0.01,
options={'SKIP_SAVE'},
)
invert: BoolProperty(
description="Invert the mouse input",
default=False,
options={'SKIP_SAVE'},
)
initial_x: IntProperty(options={'HIDDEN'})
@ -1744,6 +1750,7 @@ class WM_OT_tool_set_by_index(Operator):
expand: BoolProperty(
description="Include tool subgroups",
default=True,
options={'SKIP_SAVE'},
)
as_fallback: BoolProperty(