diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-07-15 14:44:17 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-07-15 14:44:17 +0400 |
commit | cd88217b98d21f6b25fc9476c2b4c943f7c76cf6 (patch) | |
tree | 26b470610abbe88c7689dd3867e7fa28bbd701e8 /source | |
parent | 76ccf2403a0a3784c9a71bf0dd79c07c9f627112 (diff) |
Fix #36145: Error in inverting channels in the UV/Image Editor
Issue was caused by operator redo saving values for previous
inverted channels, meaning the same channels will be inverted
next time operator runs.
Don't think it's useful to save operator values here, since
you don;t have visual feedback about which channels were
inverted. So marked all this properties as SKIP_SAVE. Gives
much more predictable results.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 4dbd7792a29..2da3f3adb67 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1898,6 +1898,8 @@ static int image_invert_exec(bContext *C, wmOperator *op) void IMAGE_OT_invert(wmOperatorType *ot) { + PropertyRNA *prop; + /* identifiers */ ot->name = "Invert Channels"; ot->idname = "IMAGE_OT_invert"; @@ -1908,10 +1910,14 @@ void IMAGE_OT_invert(wmOperatorType *ot) ot->poll = image_invert_poll; /* properties */ - RNA_def_boolean(ot->srna, "invert_r", 0, "Red", "Invert Red Channel"); - RNA_def_boolean(ot->srna, "invert_g", 0, "Green", "Invert Green Channel"); - RNA_def_boolean(ot->srna, "invert_b", 0, "Blue", "Invert Blue Channel"); - RNA_def_boolean(ot->srna, "invert_a", 0, "Alpha", "Invert Alpha Channel"); + prop = RNA_def_boolean(ot->srna, "invert_r", 0, "Red", "Invert Red Channel"); + RNA_def_property_flag(prop, PROP_SKIP_SAVE); + prop = RNA_def_boolean(ot->srna, "invert_g", 0, "Green", "Invert Green Channel"); + RNA_def_property_flag(prop, PROP_SKIP_SAVE); + prop = RNA_def_boolean(ot->srna, "invert_b", 0, "Blue", "Invert Blue Channel"); + RNA_def_property_flag(prop, PROP_SKIP_SAVE); + prop = RNA_def_boolean(ot->srna, "invert_a", 0, "Alpha", "Invert Alpha Channel"); + RNA_def_property_flag(prop, PROP_SKIP_SAVE); /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; |