[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49052] branches/soc-2012-bratwurst: Add a button to switch back to object mode.
Jorge Rodriguez
bs.vino at gmail.com
Thu Jul 19 01:27:10 CEST 2012
Revision: 49052
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49052
Author: vino
Date: 2012-07-18 23:27:10 +0000 (Wed, 18 Jul 2012)
Log Message:
-----------
Add a button to switch back to object mode.
Modified Paths:
--------------
branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_view3d.py
branches/soc-2012-bratwurst/source/blender/makesrna/intern/rna_scene.c
Modified: branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_view3d.py
===================================================================
--- branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_view3d.py 2012-07-18 23:07:07 UTC (rev 49051)
+++ branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_view3d.py 2012-07-18 23:27:10 UTC (rev 49052)
@@ -2725,11 +2725,14 @@
# invoke edit mode.
if bpy.context.object.mode == 'EDIT':
+ props = row.operator("object.mode_set", text="", icon='OBJECT_DATA')
+ props.mode='OBJECT'
row.prop(tools, "use_select_vertex", text="", clearfield=True)
row.prop(tools, "use_select_edge", text="", clearfield=True)
row.prop(tools, "use_select_face", text="", clearfield=True)
else:
+ row.prop(tools, "object_select_mode", text="")
props = row.operator("mesh.selection_mode_set", text="", icon='VERTEXSEL')
props.mode='VERTEX'
props = row.operator("mesh.selection_mode_set", text="", icon='EDGESEL')
@@ -2755,11 +2758,14 @@
column.separator()
if bpy.context.object.mode == 'EDIT':
+ props = row.operator("object.mode_set", text="", icon='OBJECT_DATA')
+ props.mode='OBJECT'
column.prop(tools, "use_select_vertex", text="", clearfield=True)
column.prop(tools, "use_select_edge", text="", clearfield=True)
column.prop(tools, "use_select_face", text="", clearfield=True)
else:
+ column.prop(tools, "object_select_mode", text="")
props = column.operator("mesh.selection_mode_set", text="", icon='VERTEXSEL')
props.mode='VERTEX'
props = column.operator("mesh.selection_mode_set", text="", icon='EDGESEL')
Modified: branches/soc-2012-bratwurst/source/blender/makesrna/intern/rna_scene.c
===================================================================
--- branches/soc-2012-bratwurst/source/blender/makesrna/intern/rna_scene.c 2012-07-18 23:07:07 UTC (rev 49051)
+++ branches/soc-2012-bratwurst/source/blender/makesrna/intern/rna_scene.c 2012-07-18 23:27:10 UTC (rev 49052)
@@ -37,6 +37,7 @@
#include "DNA_particle_types.h"
#include "DNA_scene_types.h"
#include "DNA_userdef_types.h"
+#include "DNA_object_types.h"
#include "BLI_math.h"
@@ -1808,6 +1809,12 @@
RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Which mesh elements selection works on");
RNA_def_property_update(prop, 0, "rna_Scene_editmesh_select_mode_update");
+ prop = RNA_def_property(srna, "object_select_mode", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "selectmode", OB_MODE_OBJECT);
+ RNA_def_property_ui_text(prop, "Object Mode", "Switch to object mode");
+ RNA_def_property_ui_icon(prop, ICON_OBJECT_DATA, 0);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+
prop = RNA_def_property(srna, "use_select_vertex", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "selectmode", SCE_SELECT_VERTEX);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_editmesh_use_select_vertex_set", "rna_Scene_editmesh_use_select_mode_clear");
More information about the Bf-blender-cvs
mailing list