Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-07-05 14:41:02 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-07-05 15:02:57 +0300
commit416e006a2aee09a6354fad9aec6a3f44f9f758b8 (patch)
tree6e8bd578513034d0d1543f37279af7fe0965765e
parent92b775d31930ba1a625336a8145996ec437d4c87 (diff)
Cleanup: use 'use_' prefix for RNA booleans
-rw-r--r--release/scripts/startup/bl_ui/space_image.py4
-rw-r--r--source/blender/editors/space_image/image_ops.c19
-rw-r--r--source/blender/makesrna/intern/rna_shader_fx.c4
-rw-r--r--source/blender/shader_fx/intern/FX_shader_flip.c4
4 files changed, 15 insertions, 16 deletions
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py
index 3fafa328289..31a4aa5da48 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -257,8 +257,8 @@ class IMAGE_MT_image_flip(Menu):
def draw(self, _context):
layout = self.layout
- layout.operator("image.flip", text="Horizontally").use_flip_horizontal = True
- layout.operator("image.flip", text="Vertically").use_flip_vertical = True
+ layout.operator("image.flip", text="Horizontally").use_flip_x = True
+ layout.operator("image.flip", text="Vertically").use_flip_y = True
class IMAGE_MT_image_invert(Menu):
bl_label = "Invert"
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 193c35d10a2..b4e1f1ec9fc 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -2712,10 +2712,10 @@ static int image_flip_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- const bool flip_horizontal = RNA_boolean_get(op->ptr, "use_flip_horizontal");
- const bool flip_vertical = RNA_boolean_get(op->ptr, "use_flip_vertical");
+ const bool use_flip_x = RNA_boolean_get(op->ptr, "use_flip_x");
+ const bool use_flip_y = RNA_boolean_get(op->ptr, "use_flip_y");
- if (!flip_horizontal && !flip_vertical) {
+ if (!use_flip_x && !use_flip_y) {
BKE_image_release_ibuf(ima, ibuf, NULL);
return OPERATOR_FINISHED;
}
@@ -2735,8 +2735,8 @@ static int image_flip_exec(bContext *C, wmOperator *op)
float *orig_float_pixels = MEM_dupallocN(float_pixels);
for (int x = 0; x < size_x; x++) {
for (int y = 0; y < size_y; y++) {
- const int source_pixel_x = flip_horizontal ? size_x - x - 1 : x;
- const int source_pixel_y = flip_vertical ? size_y - y - 1 : y;
+ const int source_pixel_x = use_flip_x ? size_x - x - 1 : x;
+ const int source_pixel_y = use_flip_y ? size_y - y - 1 : y;
float *source_pixel = &orig_float_pixels[4 * (source_pixel_x + source_pixel_y * size_x)];
float *target_pixel = &float_pixels[4 * (x + y * size_x)];
@@ -2755,8 +2755,8 @@ static int image_flip_exec(bContext *C, wmOperator *op)
char *orig_char_pixels = MEM_dupallocN(char_pixels);
for (int x = 0; x < size_x; x++) {
for (int y = 0; y < size_y; y++) {
- const int source_pixel_x = flip_horizontal ? size_x - x - 1 : x;
- const int source_pixel_y = flip_vertical ? size_y - y - 1 : y;
+ const int source_pixel_x = use_flip_x ? size_x - x - 1 : x;
+ const int source_pixel_y = use_flip_y ? size_y - y - 1 : y;
char *source_pixel = &orig_char_pixels[4 * (source_pixel_x + source_pixel_y * size_x)];
char *target_pixel = &char_pixels[4 * (x + y * size_x)];
@@ -2804,10 +2804,9 @@ void IMAGE_OT_flip(wmOperatorType *ot)
/* properties */
PropertyRNA *prop;
prop = RNA_def_boolean(
- ot->srna, "use_flip_horizontal", false, "Horizontal", "Flip the image horizontally");
+ ot->srna, "use_flip_x", false, "Horizontal", "Flip the image horizontally");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
- prop = RNA_def_boolean(
- ot->srna, "use_flip_vertical", false, "Vertical", "Flip the image vertically");
+ prop = RNA_def_boolean(ot->srna, "use_flip_y", false, "Vertical", "Flip the image vertically");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
/* flags */
diff --git a/source/blender/makesrna/intern/rna_shader_fx.c b/source/blender/makesrna/intern/rna_shader_fx.c
index 4a6cb0d740a..7c5212073ab 100644
--- a/source/blender/makesrna/intern/rna_shader_fx.c
+++ b/source/blender/makesrna/intern/rna_shader_fx.c
@@ -649,12 +649,12 @@ static void rna_def_shader_fx_flip(BlenderRNA *brna)
RNA_define_lib_overridable(true);
- prop = RNA_def_property(srna, "flip_horizontal", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_flip_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FX_FLIP_HORIZONTAL);
RNA_def_property_ui_text(prop, "Horizontal", "Flip image horizontally");
RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update");
- prop = RNA_def_property(srna, "flip_vertical", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_flip_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FX_FLIP_VERTICAL);
RNA_def_property_ui_text(prop, "Vertical", "Flip image vertically");
RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update");
diff --git a/source/blender/shader_fx/intern/FX_shader_flip.c b/source/blender/shader_fx/intern/FX_shader_flip.c
index b6a36378f7e..048ff3deba1 100644
--- a/source/blender/shader_fx/intern/FX_shader_flip.c
+++ b/source/blender/shader_fx/intern/FX_shader_flip.c
@@ -65,8 +65,8 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel)
uiLayoutSetPropSep(layout, true);
row = uiLayoutRowWithHeading(layout, true, IFACE_("Axis"));
- uiItemR(row, ptr, "flip_horizontal", toggles_flag, NULL, ICON_NONE);
- uiItemR(row, ptr, "flip_vertical", toggles_flag, NULL, ICON_NONE);
+ uiItemR(row, ptr, "use_flip_x", toggles_flag, NULL, ICON_NONE);
+ uiItemR(row, ptr, "use_flip_y", toggles_flag, NULL, ICON_NONE);
shaderfx_panel_end(layout, ptr);
}