diff options
author | Martin Poirier <theeth@yahoo.com> | 2009-11-26 22:29:57 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2009-11-26 22:29:57 +0300 |
commit | deb942702df8dce55fd1a507d58df2e09cd2ce16 (patch) | |
tree | a1094f932a2acac3df1cee30489ec0280b392226 /source | |
parent | 5457ab4fc39fcb6047f37a0aee534cfba689b53f (diff) |
Preliminary RNA and DNA changes for further transform snap fixes.
Also make the mesh selection type enum available at runtime.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 9 | ||||
-rw-r--r-- | source/blender/makesrna/RNA_enum_types.h | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 39 |
3 files changed, 28 insertions, 24 deletions
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index e998b943a2e..111a90ed389 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -1007,10 +1007,11 @@ typedef struct Scene { #define SCE_SNAP_TARGET_MEDIAN 2 #define SCE_SNAP_TARGET_ACTIVE 3 /* toolsettings->snap_mode */ -#define SCE_SNAP_MODE_VERTEX 0 -#define SCE_SNAP_MODE_EDGE 1 -#define SCE_SNAP_MODE_FACE 2 -#define SCE_SNAP_MODE_VOLUME 3 +#define SCE_SNAP_MODE_INCREMENT 0 +#define SCE_SNAP_MODE_VERTEX 1 +#define SCE_SNAP_MODE_EDGE 2 +#define SCE_SNAP_MODE_FACE 3 +#define SCE_SNAP_MODE_VOLUME 4 /* toolsettings->selectmode */ #define SCE_SELECT_VERTEX 1 /* for mesh */ diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h index 13e2d5a2dc2..b33dbe6f20d 100644 --- a/source/blender/makesrna/RNA_enum_types.h +++ b/source/blender/makesrna/RNA_enum_types.h @@ -38,7 +38,9 @@ extern EnumPropertyItem object_mode_items[]; extern EnumPropertyItem proportional_falloff_items[]; extern EnumPropertyItem proportional_editing_items[]; -extern EnumPropertyItem snap_mode_items[]; +extern EnumPropertyItem snap_target_items[]; +extern EnumPropertyItem snap_element_items[]; +extern EnumPropertyItem mesh_select_mode_items[]; extern EnumPropertyItem space_type_items[]; extern EnumPropertyItem region_type_items[]; extern EnumPropertyItem modifier_type_items[]; diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index bc9fa9d5573..8d8b97d01a8 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -48,7 +48,7 @@ #include "WM_types.h" -EnumPropertyItem snap_mode_items[] = { +EnumPropertyItem snap_target_items[] = { {SCE_SNAP_TARGET_CLOSEST, "CLOSEST", 0, "Closest", "Snap closest point onto target."}, {SCE_SNAP_TARGET_CENTER, "CENTER", 0, "Center", "Snap center onto target."}, {SCE_SNAP_TARGET_MEDIAN, "MEDIAN", 0, "Median", "Snap median onto target."}, @@ -72,6 +72,20 @@ EnumPropertyItem proportional_editing_items[] = { {PROP_EDIT_CONNECTED, "CONNECTED", 0, "Connected", ""}, {0, NULL, 0, NULL, NULL}}; +EnumPropertyItem mesh_select_mode_items[] = { + {SCE_SELECT_VERTEX, "VERTEX", ICON_VERTEXSEL, "Vertex", "Vertex selection mode."}, + {SCE_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection mode."}, + {SCE_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection mode."}, + {0, NULL, 0, NULL, NULL}}; + +EnumPropertyItem snap_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."}, + {SCE_SNAP_MODE_EDGE, "EDGE", ICON_SNAP_EDGE, "Edge", "Snap to edges."}, + {SCE_SNAP_MODE_FACE, "FACE", ICON_SNAP_FACE, "Face", "Snap to faces."}, + {SCE_SNAP_MODE_VOLUME, "VOLUME", ICON_SNAP_VOLUME, "Volume", "Snap to volume."}, + {0, NULL, 0, NULL, NULL}}; + #ifdef RNA_RUNTIME #include "DNA_anim_types.h" @@ -561,19 +575,6 @@ static void rna_def_tool_settings(BlenderRNA *brna) {UV_SELECT_ISLAND, "ISLAND", ICON_UV_ISLANDSEL, "Island", "Island selection mode."}, {0, NULL, 0, NULL, NULL}}; - static EnumPropertyItem mesh_select_mode_items[] = { - {SCE_SELECT_VERTEX, "VERTEX", ICON_VERTEXSEL, "Vertex", "Vertex selection mode."}, - {SCE_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection mode."}, - {SCE_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection mode."}, - {0, NULL, 0, NULL, NULL}}; - - static EnumPropertyItem snap_element_items[] = { - {SCE_SNAP_MODE_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices."}, - {SCE_SNAP_MODE_EDGE, "EDGE", ICON_SNAP_EDGE, "Edge", "Snap to edges."}, - {SCE_SNAP_MODE_FACE, "FACE", ICON_SNAP_FACE, "Face", "Snap to faces."}, - {SCE_SNAP_MODE_VOLUME, "VOLUME", ICON_SNAP_VOLUME, "Volume", "Snap to volume."}, - {0, NULL, 0, NULL, NULL}}; - static EnumPropertyItem auto_key_items[] = { {AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add & Replace", ""}, {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""}, @@ -647,8 +648,8 @@ static void rna_def_tool_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "snap", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP); - RNA_def_property_ui_text(prop, "Snap", "Snap while Ctrl is held during transform."); - RNA_def_property_ui_icon(prop, ICON_SNAP_GEAR, 1); + RNA_def_property_ui_text(prop, "Snap", "Snap during transform."); + RNA_def_property_ui_icon(prop, ICON_SNAP_ON, 1); RNA_def_property_update(prop, NC_SCENE|ND_MODE, NULL); /* header redraw */ prop= RNA_def_property(srna, "snap_align_rotation", PROP_BOOLEAN, PROP_NONE); @@ -663,10 +664,10 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to."); RNA_def_property_update(prop, NC_SCENE|ND_MODE, NULL); /* header redraw */ - prop= RNA_def_property(srna, "snap_mode", PROP_ENUM, PROP_NONE); + prop= RNA_def_property(srna, "snap_target", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "snap_target"); - RNA_def_property_enum_items(prop, snap_mode_items); - RNA_def_property_ui_text(prop, "Snap Mode", "Which part to snap onto the target."); + RNA_def_property_enum_items(prop, snap_target_items); + RNA_def_property_ui_text(prop, "Snap Target", "Which part to snap onto the target."); RNA_def_property_update(prop, NC_SCENE|ND_MODE, NULL); /* header redraw */ prop= RNA_def_property(srna, "snap_peel_object", PROP_BOOLEAN, PROP_NONE); |