[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48698] branches/soc-2012-bratwurst: An option to turn off the floating controls from the user preferences, or move them to different areas of the screen.

Jorge Rodriguez bs.vino at gmail.com
Sat Jul 7 02:17:52 CEST 2012


Revision: 48698
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48698
Author:   vino
Date:     2012-07-07 00:17:46 +0000 (Sat, 07 Jul 2012)
Log Message:
-----------
An option to turn off the floating controls from the user preferences, or move them to different areas of the screen.

Modified Paths:
--------------
    branches/soc-2012-bratwurst/release/scripts/presets/interaction/blender.py
    branches/soc-2012-bratwurst/release/scripts/presets/interaction/maya.py
    branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_userpref.py
    branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_view3d.py
    branches/soc-2012-bratwurst/source/blender/makesdna/DNA_userdef_types.h
    branches/soc-2012-bratwurst/source/blender/makesrna/intern/rna_userdef.c

Modified: branches/soc-2012-bratwurst/release/scripts/presets/interaction/blender.py
===================================================================
--- branches/soc-2012-bratwurst/release/scripts/presets/interaction/blender.py	2012-07-06 23:56:59 UTC (rev 48697)
+++ branches/soc-2012-bratwurst/release/scripts/presets/interaction/blender.py	2012-07-07 00:17:46 UTC (rev 48698)
@@ -6,6 +6,7 @@
 bpy.context.user_preferences.view.use_rotate_around_active = False
 bpy.context.user_preferences.edit.use_drag_immediately = False
 bpy.context.user_preferences.edit.use_insertkey_xyz_to_rgb = False
+bpy.context.user_preferences.edit.floating_controls = 'BOTTOM'
 bpy.context.user_preferences.inputs.select_mouse = 'RIGHT'
 bpy.context.user_preferences.inputs.view_zoom_method = 'DOLLY'
 bpy.context.user_preferences.inputs.view_zoom_axis = 'VERTICAL'

Modified: branches/soc-2012-bratwurst/release/scripts/presets/interaction/maya.py
===================================================================
--- branches/soc-2012-bratwurst/release/scripts/presets/interaction/maya.py	2012-07-06 23:56:59 UTC (rev 48697)
+++ branches/soc-2012-bratwurst/release/scripts/presets/interaction/maya.py	2012-07-07 00:17:46 UTC (rev 48698)
@@ -3,6 +3,7 @@
 
 bpy.context.user_preferences.edit.use_drag_immediately = True
 bpy.context.user_preferences.edit.use_insertkey_xyz_to_rgb = False
+bpy.context.user_preferences.edit.floating_controls = 'BOTTOM'
 bpy.context.user_preferences.inputs.select_mouse = 'LEFT'
 bpy.context.user_preferences.inputs.view_zoom_method = 'DOLLY'
 bpy.context.user_preferences.inputs.view_zoom_axis = 'HORIZONTAL'

Modified: branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_userpref.py
===================================================================
--- branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_userpref.py	2012-07-06 23:56:59 UTC (rev 48697)
+++ branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_userpref.py	2012-07-07 00:17:46 UTC (rev 48698)
@@ -294,6 +294,8 @@
         row.separator()
 
         col = row.column()
+        col.label(text="3D view floating controls:")
+        col.prop(edit, "floating_controls")
         col.label(text="Grease Pencil:")
         col.prop(edit, "grease_pencil_manhattan_distance", text="Manhattan Distance")
         col.prop(edit, "grease_pencil_euclidean_distance", text="Euclidean Distance")

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-06 23:56:59 UTC (rev 48697)
+++ branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_view3d.py	2012-07-07 00:17:46 UTC (rev 48698)
@@ -2710,19 +2710,35 @@
     bl_options = {'HIDE_HEADER'}
 
     def draw(self, context):
-        layout = self.layout
-        layout.alignment = 'BOTTOM'
+        if bpy.context.user_preferences.edit.floating_controls == 'BOTTOM' or bpy.context.user_preferences.edit.floating_controls == 'TOP':
+            layout = self.layout
+            if bpy.context.user_preferences.edit.floating_controls == 'BOTTOM':
+	            layout.alignment = 'BOTTOM'
 
-        row = layout.row(align=True)
-        row.alignment = 'CENTER'
-        row.scale_x = 1.5
-        row.scale_y = 1.5
-        row.operator("transform.translate", text="", icon='MAN_TRANS')
-        row.operator("transform.rotate", text="", icon='MAN_ROT')
-        row.operator("transform.resize", text="", icon='MAN_SCALE')
+            row = layout.row(align=True)
+            row.alignment = 'CENTER'
+            row.scale_x = 1.5
+            row.scale_y = 1.5
+            row.operator("transform.translate", text="", icon='MAN_TRANS')
+            row.operator("transform.rotate", text="", icon='MAN_ROT')
+            row.operator("transform.resize", text="", icon='MAN_SCALE')
+        elif bpy.context.user_preferences.edit.floating_controls == 'LEFT' or bpy.context.user_preferences.edit.floating_controls == 'RIGHT':
+            layout = self.layout
 
+            row = layout.row()
+            if bpy.context.user_preferences.edit.floating_controls == 'RIGHT':
+	            row.alignment = 'RIGHT'
 
+            column = row.column(align=True)
+            column.alignment = 'CENTER'
+            column.scale_x = 1.5
+            column.scale_y = 1.5
+            column.operator("transform.translate", text="", icon='MAN_TRANS')
+            column.operator("transform.rotate", text="", icon='MAN_ROT')
+            column.operator("transform.resize", text="", icon='MAN_SCALE')
 
+
+
 def register():
     bpy.utils.register_module(__name__)
 

Modified: branches/soc-2012-bratwurst/source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- branches/soc-2012-bratwurst/source/blender/makesdna/DNA_userdef_types.h	2012-07-06 23:56:59 UTC (rev 48697)
+++ branches/soc-2012-bratwurst/source/blender/makesdna/DNA_userdef_types.h	2012-07-07 00:17:46 UTC (rev 48698)
@@ -429,8 +429,9 @@
 	float sculpt_paint_overlay_col[3];
 
 	short tweak_threshold;
-	short pad3;
 
+	short floating_controls;
+
 	char author[80];	/* author name for file formats supporting it */
 
 	int compute_device_type;
@@ -658,6 +659,13 @@
 #define USER_COMPUTE_DEVICE_OPENCL	1
 #define USER_COMPUTE_DEVICE_CUDA	2
 
+/* floating panel options */
+#define USER_FLOATING_CONTROLS_OFF		0
+#define USER_FLOATING_CONTROLS_TOP		1
+#define USER_FLOATING_CONTROLS_LEFT		2
+#define USER_FLOATING_CONTROLS_BOTTOM	3
+#define USER_FLOATING_CONTROLS_RIGHT	4
+
 #ifdef __cplusplus
 }
 #endif

Modified: branches/soc-2012-bratwurst/source/blender/makesrna/intern/rna_userdef.c
===================================================================
--- branches/soc-2012-bratwurst/source/blender/makesrna/intern/rna_userdef.c	2012-07-06 23:56:59 UTC (rev 48697)
+++ branches/soc-2012-bratwurst/source/blender/makesrna/intern/rna_userdef.c	2012-07-07 00:17:46 UTC (rev 48698)
@@ -2669,6 +2669,15 @@
 		{0, NULL, 0, NULL, NULL}
 	};
 
+	static EnumPropertyItem floating_control_modes[] = {
+		{USER_FLOATING_CONTROLS_OFF, "OFF", 0, "Off", ""},
+		{USER_FLOATING_CONTROLS_TOP, "TOP", 0, "Top", ""},
+		{USER_FLOATING_CONTROLS_LEFT, "LEFT", 0, "Left", ""},
+		{USER_FLOATING_CONTROLS_BOTTOM, "BOTTOM", 0, "Bottom", ""},
+		{USER_FLOATING_CONTROLS_RIGHT, "RIGHT", 0, "Right", ""},
+		{0, NULL, 0, NULL, NULL}
+	};
+
 	srna = RNA_def_struct(brna, "UserPreferencesEdit", NULL);
 	RNA_def_struct_sdna(srna, "UserDef");
 	RNA_def_struct_nested(brna, srna, "UserPreferences");
@@ -2859,6 +2868,10 @@
 	prop = RNA_def_property(srna, "use_duplicate_particle", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_PSYS);
 	RNA_def_property_ui_text(prop, "Duplicate Particle", "Causes particle systems to be duplicated with the object");
+
+	prop = RNA_def_property(srna, "floating_controls", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_items(prop, floating_control_modes);
+	RNA_def_property_ui_text(prop, "", "Position of the floating controls in the 3D view");
 }
 
 static void rna_def_userdef_system(BlenderRNA *brna)




More information about the Bf-blender-cvs mailing list