diff options
Diffstat (limited to 'release/scripts/op/wm.py')
-rw-r--r-- | release/scripts/op/wm.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/release/scripts/op/wm.py b/release/scripts/op/wm.py index f1eda24b7ca..230a3b8b492 100644 --- a/release/scripts/op/wm.py +++ b/release/scripts/op/wm.py @@ -61,7 +61,10 @@ def context_path_validate(context, path): def execute_context_assign(self, context): if context_path_validate(context, self.properties.path) is Ellipsis: return {'PASS_THROUGH'} - exec("context.%s=self.properties.value" % self.properties.path) + if self.properties.relative: + exec("context.%s+=self.properties.value" % self.properties.path) + else: + exec("context.%s=self.properties.value" % self.properties.path) return {'FINISHED'} @@ -86,6 +89,8 @@ class WM_OT_context_set_int(bpy.types.Operator): # same as enum path = rna_path_prop value = IntProperty(name="Value", description="Assign value", default=0) + relative = BoolProperty(name="Relative", + description="Apply the value as a relative difference", default=False) execute = execute_context_assign @@ -97,8 +102,9 @@ class WM_OT_context_set_float(bpy.types.Operator): # same as enum bl_undo = True path = rna_path_prop - value = FloatProperty(name="Value", - description="Assignment value", default=0.0) + value = FloatProperty(name="Value", description="Assignment value", default=0.0) + relative = BoolProperty(name="Relative", + description="Apply the value as a relative difference", default=False) execute = execute_context_assign |