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:
Diffstat (limited to 'source/blender/makesrna/intern/rna_space.c')
-rw-r--r--source/blender/makesrna/intern/rna_space.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index d391b09189a..7aee6944d8d 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -1796,6 +1796,16 @@ static const EnumPropertyItem *rna_SpaceImageEditor_pivot_itemf(bContext *UNUSED
}
}
+static void rna_SpaceUVEditor_tile_grid_shape_set(PointerRNA *ptr, const int *values)
+{
+ SpaceImage *data = (SpaceImage *)(ptr->data);
+
+ int clamp[2] = {10, 100};
+ for (int i = 0; i < 2; i++) {
+ data->tile_grid_shape[i] = CLAMPIS(values[i], 1, clamp[i]);
+ }
+}
+
/* Space Text Editor */
static void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, bool value)
@@ -3417,7 +3427,8 @@ static void rna_def_space_image_uv(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "tile_grid_shape");
RNA_def_property_array(prop, 2);
RNA_def_property_int_default(prop, 1);
- RNA_def_property_range(prop, 1, 10);
+ RNA_def_property_range(prop, 1, 100);
+ RNA_def_property_int_funcs(prop, NULL, "rna_SpaceUVEditor_tile_grid_shape_set", NULL);
RNA_def_property_ui_text(
prop, "Tile Grid Shape", "How many tiles will be shown in the background");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);