diff options
author | Thomas Dinges <blender@dingto.org> | 2012-12-03 16:03:16 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2012-12-03 16:03:16 +0400 |
commit | 46d4d7559fa9f72a1040a30ca016a1674356cb71 (patch) | |
tree | cd6abdbfe2fc11a0f400e070b241aee6703150db /source/blender/makesrna | |
parent | 4302cde8ff88471e5e51fb9d7bf61fe6d59179e9 (diff) |
Image Editor / UV:
* Bring back "Snap to Vertex", own regression introduced in r39460.
Patch by Brecht (DNA, Transform) and myself (RNA, Script).
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 664b7cb37a7..6f3a483cf7e 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -145,6 +145,11 @@ EnumPropertyItem snap_node_element_items[] = { {0, NULL, 0, NULL, NULL} }; +EnumPropertyItem snap_uv_element_items[] = { + {SCE_SNAP_MODE_INCREMENT, "INCREMENT", ICON_SNAP_INCREMENT, "Increment", "Snap to increments of grid"}, + {SCE_SNAP_MODE_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices"}, + {0, NULL, 0, NULL, NULL} +}; /* workaround for duplicate enums, * have each enum line as a defne then conditionally set it or not @@ -1642,6 +1647,13 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_enum_items(prop, snap_node_element_items); RNA_def_property_ui_text(prop, "Snap Node Element", "Type of element to snap to"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */ + + /* image editor uses own set of snap modes */ + prop = RNA_def_property(srna, "snap_uv_element", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "snap_uv_mode"); + RNA_def_property_enum_items(prop, snap_uv_element_items); + RNA_def_property_ui_text(prop, "Snap UV Element", "Type of element to snap to"); + RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */ prop = RNA_def_property(srna, "snap_target", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "snap_target"); |