diff options
author | Campbell Barton <campbell@blender.org> | 2022-02-16 05:46:00 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-02-16 05:46:00 +0300 |
commit | 18d18b5a986724d43f45bac63a98400741e8e12a (patch) | |
tree | ca8f8a5cd12adac5c8a2dcbc975dbb6a67971471 /source/blender/makesrna/intern/rna_scene.c | |
parent | a0ad8c57ef7da7ee21b3c2352057cf78b60000ae (diff) |
UV: move sticky selection from image space into tool settings
Having this setting stored in the image space caused low level selection
logic to have to pass around the image space (which could be NULL
in some cases). Use the tool-settings instead since there doesn't seem
to be much/any advantage in having this setting per-space.
Diffstat (limited to 'source/blender/makesrna/intern/rna_scene.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index c8f65e5e153..178029ef340 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -2883,6 +2883,25 @@ static void rna_def_tool_settings(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}, }; + static const EnumPropertyItem uv_sticky_mode_items[] = { + {SI_STICKY_DISABLE, + "DISABLED", + ICON_STICKY_UVS_DISABLE, + "Disabled", + "Sticky vertex selection disabled"}, + {SI_STICKY_LOC, + "SHARED_LOCATION", + ICON_STICKY_UVS_LOC, + "Shared Location", + "Select UVs that are at the same location and share a mesh vertex"}, + {SI_STICKY_VERTEX, + "SHARED_VERTEX", + ICON_STICKY_UVS_VERT, + "Shared Vertex", + "Select UVs that share a mesh vertex, whether or not they are at the same location"}, + {0, NULL, 0, NULL, NULL}, + }; + srna = RNA_def_struct(brna, "ToolSettings", NULL); RNA_def_struct_path_func(srna, "rna_ToolSettings_path"); RNA_def_struct_ui_text(srna, "Tool Settings", ""); @@ -3454,6 +3473,13 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "UV Selection Mode", "UV selection and display mode"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL); + prop = RNA_def_property(srna, "uv_sticky_select_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "uv_sticky"); + RNA_def_property_enum_items(prop, uv_sticky_mode_items); + RNA_def_property_ui_text( + prop, "Sticky Selection Mode", "Method for extending UV vertex selection"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL); + prop = RNA_def_property(srna, "use_uv_select_sync", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SYNC_SELECTION); RNA_def_property_ui_text( |