[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21844] branches/blender2.5/blender/ release/ui/space_view3d_toolbar.py: Toolbar

William Reynish william at reynish.com
Fri Jul 24 13:15:00 CEST 2009


Revision: 21844
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21844
Author:   billrey
Date:     2009-07-24 13:14:59 +0200 (Fri, 24 Jul 2009)

Log Message:
-----------
Toolbar

Improved the brush tools UI and added a bunch of brush controls. There seems to be some RNA magic missing for texture paint to work, so that's empty for now. Added tablet pressure buttons, which needs a new icon.

Added a bunch of tools in a categorized fashion for all edit modes. Need to figure out what to do for vert/edge/face specific tools - perhaps it could detect the mode setting and show most appropriate tools for each mode.

Modified Paths:
--------------
    branches/blender2.5/blender/release/ui/space_view3d_toolbar.py

Modified: branches/blender2.5/blender/release/ui/space_view3d_toolbar.py
===================================================================
--- branches/blender2.5/blender/release/ui/space_view3d_toolbar.py	2009-07-24 10:43:58 UTC (rev 21843)
+++ branches/blender2.5/blender/release/ui/space_view3d_toolbar.py	2009-07-24 11:14:59 UTC (rev 21844)
@@ -14,14 +14,29 @@
 
 	def draw(self, context):
 		layout = self.layout
+		
+		layout.itemL(text="Transform:")
+		
+		split = layout.split()
+		col = split.column(align=True)
+		col.itemO("tfm.translate")
+		col.itemO("tfm.rotate")
+		col.itemO("tfm.resize", text="Scale")
+		
+		layout.itemL(text="Object:")
+		
+		split = layout.split()
+		col = split.column(align=True)
+		col.itemO("object.duplicate")
+		col.itemO("object.delete")
+		
+		layout.itemL(text="Keyframes:")
+		
+		split = layout.split()
+		col = split.column(align=True)
+		col.itemO("anim.insert_keyframe_menu", text="Insert")
+		col.itemO("anim.delete_keyframe_v3d", text="Remove")
 
-		layout.row().itemO("object.duplicate")
-		layout.row().itemO("object.delete")
-		layout.row().itemO("object.mesh_add")
-		layout.row().itemO("object.curve_add")
-		layout.row().itemO("object.text_add")
-		layout.row().itemO("object.surface_add")
-
 # ********** default tools for editmode_mesh ****************
 
 class View3DPanel(bpy.types.Panel):
@@ -35,18 +50,43 @@
 
 	def draw(self, context):
 		layout = self.layout
+		layout.itemL(text="Transform:")
+		
+		split = layout.split()
+		col = split.column(align=True)
+		col.itemO("tfm.translate")
+		col.itemO("tfm.rotate")
+		col.itemO("tfm.resize", text="Scale")
+		
+		layout.itemL(text="Mesh:")
+		split = layout.split()
+		col = split.column(align=True)
+		col.itemO("mesh.duplicate")
+		col.itemO("mesh.delete")
+		
+		layout.itemL(text="Modeling:")
+		split = layout.split()
+		col = split.column(align=True)
+		col.itemO("mesh.extrude")
+		col.itemO("mesh.subdivide")
+		col.itemO("mesh.spin")
+		col.itemO("mesh.screw")
+		
+		layout.itemL(text="Shading:")
+		
+		split = layout.split()
+		col = split.column(align=True)
+		col.itemO("mesh.faces_shade_smooth", text="Smooth")
+		col.itemO("mesh.faces_shade_flat", text="Flat")
+		
+		layout.itemL(text="UV Mapping:")
+		
+		split = layout.split()
+		col = split.column(align=True)
+		col.itemO("uv.mapping_menu", text="Unwrap")
+		col.itemO("mesh.uvs_rotate")
+		col.itemO("mesh.uvs_mirror")
 
-		layout.row().itemO("mesh.duplicate")
-		layout.row().itemO("mesh.delete")
-		layout.row().itemO("mesh.spin")
-		layout.row().itemO("mesh.screw")
-		layout.row().itemO("mesh.primitive_plane_add")
-		layout.row().itemO("mesh.primitive_cube_add")
-		layout.row().itemO("mesh.primitive_circle_add")
-		layout.row().itemO("mesh.primitive_cylinder_add")
-		layout.row().itemO("mesh.faces_shade_smooth")
-		layout.row().itemO("mesh.faces_shade_flat")
-
 # ********** default tools for editmode_curve ****************
 
 class View3DPanel(bpy.types.Panel):
@@ -60,12 +100,28 @@
 
 	def draw(self, context):
 		layout = self.layout
+		layout.itemL(text="Transform:")
+		
+		split = layout.split()
+		col = split.column(align=True)
+		col.itemO("tfm.translate")
+		col.itemO("tfm.rotate")
+		col.itemO("tfm.resize", text="Scale")
+		
+		layout.itemL(text="Curve:")
+		split = layout.split()
+		col = split.column(align=True)
+		col.itemO("curve.duplicate")
+		col.itemO("curve.delete")
+		col.itemO("curve.cyclic_toggle")
+		col.itemO("curve.switch_direction")
+		
+		layout.itemL(text="Modeling:")
+		split = layout.split()
+		col = split.column(align=True)
+		col.itemO("curve.extrude")
+		col.itemO("curve.subdivide")
 
-		layout.row().itemO("curve.duplicate")
-		layout.row().itemO("curve.delete")
-		layout.row().itemO("object.curve_add")
-		layout.row().itemO("curve.subdivide")
-
 # ********** default tools for editmode_surface ****************
 
 class View3DPanel(bpy.types.Panel):
@@ -79,12 +135,27 @@
 
 	def draw(self, context):
 		layout = self.layout
+		layout.itemL(text="Transform:")
+		split = layout.split()
+		col = split.column(align=True)
+		col.itemO("tfm.translate")
+		col.itemO("tfm.rotate")
+		col.itemO("tfm.resize", text="Scale")
+		
+		layout.itemL(text="Curve:")
+		split = layout.split()
+		col = split.column(align=True)
+		col.itemO("curve.duplicate")
+		col.itemO("curve.delete")
+		col.itemO("curve.cyclic_toggle")
+		col.itemO("curve.switch_direction")
+		
+		layout.itemL(text="Modeling:")
+		split = layout.split()
+		col = split.column(align=True)
+		col.itemO("curve.extrude")
+		col.itemO("curve.subdivide")
 
-		layout.row().itemO("curve.duplicate")
-		layout.row().itemO("curve.delete")
-		layout.row().itemO("object.surface_add")
-		layout.row().itemO("curve.subdivide")
-
 # ********** default tools for editmode_text ****************
 
 class View3DPanel(bpy.types.Panel):
@@ -117,12 +188,26 @@
 
 	def draw(self, context):
 		layout = self.layout
-
-		layout.row().itemO("armature.duplicate_selected")
-		layout.row().itemO("armature.bone_primitive_add")
-		layout.row().itemO("armature.delete")
-		layout.row().itemO("armature.parent_clear")
-
+		layout.itemL(text="Transform:")
+		split = layout.split()
+		col = split.column(align=True)
+		col.itemO("tfm.translate")
+		col.itemO("tfm.rotate")
+		col.itemO("tfm.resize", text="Scale")
+		
+		layout.itemL(text="Bones:")
+		split = layout.split()
+		col = split.column(align=True)
+		col.itemO("armature.bone_primitive_add", text="Add")
+		col.itemO("armature.duplicate_selected", text="Duplicate")
+		col.itemO("armature.delete", text="Delete")
+		
+		layout.itemL(text="Modeling:")
+		split = layout.split()
+		col = split.column(align=True)
+		col.itemO("armature.extrude")
+		
+		
 # ********** default tools for editmode_mball ****************
 
 class View3DPanel(bpy.types.Panel):
@@ -136,9 +221,13 @@
 
 	def draw(self, context):
 		layout = self.layout
+		layout.itemL(text="Transform:")
+		split = layout.split()
+		col = split.column(align=True)
+		col.itemO("tfm.translate")
+		col.itemO("tfm.rotate")
+		col.itemO("tfm.resize", text="Scale")
 
-		row = layout.row()
-
 # ********** default tools for editmode_lattice ****************
 
 class View3DPanel(bpy.types.Panel):
@@ -152,9 +241,13 @@
 
 	def draw(self, context):
 		layout = self.layout
+		layout.itemL(text="Transform:")
+		split = layout.split()
+		col = split.column(align=True)
+		col.itemO("tfm.translate")
+		col.itemO("tfm.rotate")
+		col.itemO("tfm.resize", text="Scale")
 
-		row = layout.row()
-
 # ********** default tools for posemode ****************
 
 class View3DPanel(bpy.types.Panel):
@@ -168,28 +261,38 @@
 
 	def draw(self, context):
 		layout = self.layout
+		layout.itemL(text="Transform:")
+		split = layout.split()
+		col = split.column(align=True)
+		col.itemO("tfm.translate")
+		col.itemO("tfm.rotate")
+		col.itemO("tfm.resize", text="Scale")
+		
+		layout.itemL(text="Bones:")
+		split = layout.split()
+		col = split.column(align=True)
+		col.itemO("pose.hide", text="Hide")
+		col.itemO("pose.reveal", text="Reveal")
+		
+		layout.itemL(text="Keyframes:")
+		
+		split = layout.split()
+		col = split.column(align=True)
+		col.itemO("anim.insert_keyframe_menu", text="Insert")
+		col.itemO("anim.delete_keyframe_v3d", text="Remove")
+		
+		layout.itemL(text="Pose:")
+		
+		split = layout.split()
+		col = split.column(align=True)
+		col.itemO("pose.copy", text="Copy")
+		col.itemO("pose.paste", text="Paste")
+		col.itemO("poselib.pose_add", text="Add to Library")
+		col.itemO("poselib.pose_remove", text="Remove From Library")
 
-		layout.row().itemO("pose.hide")
-		layout.row().itemO("pose.reveal")
-		layout.row().itemO("pose.rot_clear")
-		layout.row().itemO("pose.loc_clear")
+# ********** default tools for paint modes ****************
 
-# ********** default tools for sculptmode ****************
 
-class View3DPanel(bpy.types.Panel):
-	__space_type__ = "VIEW_3D"
-	__region_type__ = "TOOLS"
-	__context__ = "sculptmode"
-
-#class VIEW3D_PT_tools_sculptmode(View3DPanel):
-#	__idname__ = "VIEW3D_PT_tools_sculptmode"
-#	__label__ = "Sculpt Tools"
-#
-#	def draw(self, context):
-#		layout = self.layout
-#
-#		layout.row().itemO("sculpt.radial_control")
-
 class VIEW3D_PT_tools_brush(bpy.types.Panel):
 	__space_type__ = "VIEW_3D"
 	__region_type__ = "TOOLS"
@@ -203,6 +306,8 @@
 			return ts.vpaint
 		elif context.wpaint_object:
 			return ts.wpaint
+		elif context.tpaint_object:
+			return ts.tpaint
 		return False
 
 	def poll(self, context):
@@ -220,27 +325,65 @@
 
 		split = layout.split()
 		col = split.column()
-		col.itemR(brush, "size", slider=True)
+		row = col.row(align=True)
+		row.itemR(brush, "size", slider=True)
+		row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
 		if context.wpaint_object:
 			col.itemR(context.tool_settings, "vertex_group_weight", text="Weight", slider=True)
 		col.itemR(brush, "strength", slider=True)
+		row = col.row(align=True)
+		row.itemR(brush, "falloff", slider=True)
+		row.itemR(brush, "falloff_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
+		if context.vpaint_object:
+			col.itemR(brush, "color", text="")
+		if context.tpaint_object:
+			row = col.row(align=True)
+			row.itemR(brush, "clone_opacity", slider=True, text=Opacity)
+			row.itemR(brush, "opacity_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
+		
+		row = col.row(align=True)
+		row.itemR(brush, "space", text="")
+		rowsub = row.row(align=True)
+		rowsub.active = brush.space
+		rowsub.itemR(brush, "spacing", text="Spacing", slider=True)
+		rowsub.itemR(brush, "spacing_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
 
-
-
 		split = layout.split()
 		col = split.column()
 		col.itemR(brush, "airbrush")
 		col.itemR(brush, "anchored")
 		col.itemR(brush, "rake")
-		col.itemR(brush, "space", text="Spacing")
-		colsub = col.column()
-		colsub.active = brush.space
-		colsub.itemR(brush, "spacing", text="")
 
+
+class VIEW3D_PT_tools_brush_curve(bpy.types.Panel):
+	__space_type__ = "VIEW_3D"
+	__region_type__ = "TOOLS"
+	__label__ = "Curve"
+
+	def brush_src(self, context):
+		ts = context.tool_settings
+		if context.sculpt_object:
+			return ts.sculpt
+		elif context.vpaint_object:
+			return ts.vpaint
+		elif context.wpaint_object:
+			return ts.wpaint
+		elif context.tpaint_object:
+			return ts.tpaint
+		return False
+
+	def poll(self, context):
+		return self.brush_src(context)
+
+	def draw(self, context):
+		src = self.brush_src(context)
+		brush = src.brush
+		layout = self.layout
+
 		split = layout.split()
 		split.template_curve_mapping(brush.curve)
 		

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list