[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20709] branches/blender2.5/blender: UI Buttons:

Brecht Van Lommel brecht at blender.org
Sun Jun 7 15:36:12 CEST 2009


Revision: 20709
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20709
Author:   blendix
Date:     2009-06-07 15:36:12 +0200 (Sun, 07 Jun 2009)

Log Message:
-----------
UI Buttons:
* Context now allows pinning a datablock, independent of
  selection.
* Initial ID browse buttons for most buttons tabs.
* Browsing from world to texture now displays world textures
  again, but is a bit of a hack, not sure there is a right
  way to do this.
* There's a button to switch between active materials and
  textures now, only temporary though.
* There's some code to put context part in own region,
  disabled still because it doesn't work that well yet.

Modified Paths:
--------------
    branches/blender2.5/blender/release/ui/buttons_data_armature.py
    branches/blender2.5/blender/release/ui/buttons_data_camera.py
    branches/blender2.5/blender/release/ui/buttons_data_curve.py
    branches/blender2.5/blender/release/ui/buttons_data_lamp.py
    branches/blender2.5/blender/release/ui/buttons_data_lattice.py
    branches/blender2.5/blender/release/ui/buttons_data_mesh.py
    branches/blender2.5/blender/release/ui/buttons_data_text.py
    branches/blender2.5/blender/release/ui/buttons_material.py
    branches/blender2.5/blender/release/ui/buttons_particle.py
    branches/blender2.5/blender/release/ui/buttons_texture.py
    branches/blender2.5/blender/release/ui/buttons_world.py
    branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c
    branches/blender2.5/blender/source/blender/editors/space_buttons/buttons_context.c
    branches/blender2.5/blender/source/blender/editors/space_buttons/buttons_header.c
    branches/blender2.5/blender/source/blender/editors/space_buttons/buttons_intern.h
    branches/blender2.5/blender/source/blender/editors/space_buttons/space_buttons.c
    branches/blender2.5/blender/source/blender/editors/space_image/image_header.c
    branches/blender2.5/blender/source/blender/makesdna/DNA_space_types.h

Modified: branches/blender2.5/blender/release/ui/buttons_data_armature.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_armature.py	2009-06-07 13:35:39 UTC (rev 20708)
+++ branches/blender2.5/blender/release/ui/buttons_data_armature.py	2009-06-07 13:36:12 UTC (rev 20709)
@@ -14,28 +14,41 @@
 	__label__ = "Skeleton"
 
 	def draw(self, context):
+		ob = context.object
 		arm = context.armature
+		space = context.space_data
 		layout = self.layout
-		
-		layout.itemR(arm, "rest_position")
 
-		split = layout.split()
+		split = layout.split(percentage=0.65)
 
-		sub = split.column()
-		sub.itemL(text="Deform:")
-		sub.itemR(arm, "deform_vertexgroups", text="Vertes Groups")
-		sub.itemR(arm, "deform_envelope", text="Envelopes")
-		sub.itemR(arm, "deform_quaternion", text="Quaternion")
-		sub.itemR(arm, "deform_bbone_rest", text="B-Bones Rest")
-		#sub.itemR(arm, "x_axis_mirror")
-		#sub.itemR(arm, "auto_ik")
-		
-		sub = split.column()
-		sub.itemL(text="Layers:")
-		sub.itemL(text="LAYERS")
-		#sub.itemR(arm, "layer")
-		#sub.itemR(arm, "layer_protection")
+		if ob:
+			split.template_ID(context, ob, "data")
+			split.itemS()
+		elif arm:
+			split.template_ID(context, space, "pin_id")
+			split.itemS()
 
+		if arm:
+			layout.itemS()
+			layout.itemR(arm, "rest_position")
+
+			split = layout.split()
+
+			sub = split.column()
+			sub.itemL(text="Deform:")
+			sub.itemR(arm, "deform_vertexgroups", text="Vertes Groups")
+			sub.itemR(arm, "deform_envelope", text="Envelopes")
+			sub.itemR(arm, "deform_quaternion", text="Quaternion")
+			sub.itemR(arm, "deform_bbone_rest", text="B-Bones Rest")
+			#sub.itemR(arm, "x_axis_mirror")
+			#sub.itemR(arm, "auto_ik")
+			
+			sub = split.column()
+			sub.itemL(text="Layers:")
+			sub.itemL(text="LAYERS")
+			#sub.itemR(arm, "layer")
+			#sub.itemR(arm, "layer_protection")
+
 class DATA_PT_display(DataButtonsPanel):
 	__idname__ = "DATA_PT_display"
 	__label__ = "Display"

Modified: branches/blender2.5/blender/release/ui/buttons_data_camera.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_camera.py	2009-06-07 13:35:39 UTC (rev 20708)
+++ branches/blender2.5/blender/release/ui/buttons_data_camera.py	2009-06-07 13:36:12 UTC (rev 20709)
@@ -9,45 +9,58 @@
 	def poll(self, context):
 		return (context.camera != None)
 		
-class DATA_PT_cameralens(DataButtonsPanel):
+class DATA_PT_camera(DataButtonsPanel):
 	__idname__ = "DATA_PT_camera"
 	__label__ = "Lens"
 
 	def draw(self, context):
+		ob = context.object
 		cam = context.camera
+		space = context.space_data
 		layout = self.layout
 
-		layout.itemR(cam, "type", expand=True)
-		
-		row = layout.row(align=True)
-		if cam.type == 'PERSP':
-			row.itemR(cam, "lens_unit", text="")
-			if cam.lens_unit == 'MILLIMETERS':
-				row.itemR(cam, "lens", text="Angle")
-			elif cam.lens_unit == 'DEGREES':
-				row.itemR(cam, "angle")
+		split = layout.split(percentage=0.65)
 
-		elif cam.type == 'ORTHO':
-			row.itemR(cam, "ortho_scale")
+		if ob:
+			split.template_ID(context, ob, "data")
+			split.itemS()
+		elif arm:
+			split.template_ID(context, space, "pin_id")
+			split.itemS()
+
+		if cam:
+			layout.itemS()
+			layout.itemR(cam, "type", expand=True)
 			
-		split = layout.split()
+			row = layout.row(align=True)
+			if cam.type == 'PERSP':
+				row.itemR(cam, "lens_unit", text="")
+				if cam.lens_unit == 'MILLIMETERS':
+					row.itemR(cam, "lens", text="Angle")
+				elif cam.lens_unit == 'DEGREES':
+					row.itemR(cam, "angle")
+
+			elif cam.type == 'ORTHO':
+				row.itemR(cam, "ortho_scale")
+				
+			split = layout.split()
+			
+			sub = split.column(align=True)
+			sub.itemL(text="Shift:")
+			sub.itemR(cam, "shift_x", text="X")
+			sub.itemR(cam, "shift_y", text="Y")
+			
+			sub = split.column(align=True)
+			sub.itemL(text="Clipping:")
+			sub.itemR(cam, "clip_start", text="Start")
+			sub.itemR(cam, "clip_end", text="End")
+			
+			row = layout.row()
+			row.itemR(cam, "dof_object")
+			row.itemR(cam, "dof_distance")
 		
-		sub = split.column(align=True)
-		sub.itemL(text="Shift:")
-		sub.itemR(cam, "shift_x", text="X")
-		sub.itemR(cam, "shift_y", text="Y")
-		
-		sub = split.column(align=True)
-		sub.itemL(text="Clipping:")
-		sub.itemR(cam, "clip_start", text="Start")
-		sub.itemR(cam, "clip_end", text="End")
-		
-		row = layout.row()
-		row.itemR(cam, "dof_object")
-		row.itemR(cam, "dof_distance")
-		
-class DATA_PT_cameradisplay(DataButtonsPanel):
-	__idname__ = "DATA_PT_cameradisplay"
+class DATA_PT_camera_display(DataButtonsPanel):
+	__idname__ = "DATA_PT_camera_display"
 	__label__ = "Display"
 	
 	def draw(self, context):
@@ -69,5 +82,5 @@
 		colsub.itemR(cam, "passepartout_alpha", text="Alpha", slider=True)
 		col.itemR(cam, "draw_size", text="Size")
 		
-bpy.types.register(DATA_PT_cameralens)
-bpy.types.register(DATA_PT_cameradisplay)
+bpy.types.register(DATA_PT_camera)
+bpy.types.register(DATA_PT_camera_display)

Modified: branches/blender2.5/blender/release/ui/buttons_data_curve.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_curve.py	2009-06-07 13:35:39 UTC (rev 20708)
+++ branches/blender2.5/blender/release/ui/buttons_data_curve.py	2009-06-07 13:36:12 UTC (rev 20709)
@@ -11,13 +11,26 @@
 		return (ob and ob.type == 'CURVE' and context.curve)
 
 class DATA_PT_shape_curve(DataButtonsPanel):
-		__idname__ = "DATA_PT_shape_curve"
-		__label__ = "Shape"
+	__idname__ = "DATA_PT_shape_curve"
+	__label__ = "Shape"
 
-		def draw(self, context):
-			curve = context.curve
-			layout = self.layout
+	def draw(self, context):
+		ob = context.object
+		curve = context.curve
+		space = context.space_data
+		layout = self.layout
 
+		split = layout.split(percentage=0.65)
+
+		if ob:
+			split.template_ID(context, ob, "data")
+			split.itemS()
+		elif curve:
+			split.template_ID(context, space, "pin_id")
+			split.itemS()
+
+		if curve:
+			layout.itemS()
 			layout.itemR(curve, "curve_2d")			
 							
 			split = layout.split()
@@ -46,85 +59,85 @@
 			sub.itemR(curve, "vertex_normal_flip")
 
 class DATA_PT_geometry(DataButtonsPanel):
-		__idname__ = "DATA_PT_geometry"
-		__label__ = "Geometry"
+	__idname__ = "DATA_PT_geometry"
+	__label__ = "Geometry"
 
-		def draw(self, context):
-			curve = context.curve
-			layout = self.layout
+	def draw(self, context):
+		curve = context.curve
+		layout = self.layout
 
-			split = layout.split()
+		split = layout.split()
+	
+		sub = split.column()
+		sub.itemL(text="Modification:")
+		sub.itemR(curve, "width")
+		sub.itemR(curve, "extrude")
+		sub.itemR(curve, "taper_object")
 		
-			sub = split.column()
-			sub.itemL(text="Modification:")
-			sub.itemR(curve, "width")
-			sub.itemR(curve, "extrude")
-			sub.itemR(curve, "taper_object")
-			
-			sub = split.column()
-			sub.itemL(text="Bevel:")
-			sub.itemR(curve, "bevel_depth", text="Depth")
-			sub.itemR(curve, "bevel_resolution", text="Resolution")
-			sub.itemR(curve, "bevel_object")
+		sub = split.column()
+		sub.itemL(text="Bevel:")
+		sub.itemR(curve, "bevel_depth", text="Depth")
+		sub.itemR(curve, "bevel_resolution", text="Resolution")
+		sub.itemR(curve, "bevel_object")
 	
 class DATA_PT_pathanim(DataButtonsPanel):
-		__idname__ = "DATA_PT_pathanim"
-		__label__ = "Path Animation"
-		
-		def draw_header(self, context):
-			curve = context.curve
+	__idname__ = "DATA_PT_pathanim"
+	__label__ = "Path Animation"
+	
+	def draw_header(self, context):
+		curve = context.curve
 
-			layout = self.layout
-			layout.itemR(curve, "path", text="")
+		layout = self.layout
+		layout.itemR(curve, "path", text="")
 
-		def draw(self, context):
-			curve = context.curve
-			layout = self.layout
-			layout.active = curve.path	
-			
-			split = layout.split()		
-			
-			sub = split.column()
-			sub.itemR(curve, "path_length", text="Frames")
-			sub.itemR(curve, "follow")
+	def draw(self, context):
+		curve = context.curve
+		layout = self.layout
+		layout.active = curve.path	
+		
+		split = layout.split()		
+		
+		sub = split.column()
+		sub.itemR(curve, "path_length", text="Frames")
+		sub.itemR(curve, "follow")
 
-			sub = split.column()
-			sub.itemR(curve, "stretch")
-			sub.itemR(curve, "offset_path_distance", text="Offset Children")
+		sub = split.column()
+		sub.itemR(curve, "stretch")
+		sub.itemR(curve, "offset_path_distance", text="Offset Children")
 	
 class DATA_PT_current_curve(DataButtonsPanel):
-		__idname__ = "DATA_PT_current_curve"
-		__label__ = "Current Curve"
+	__idname__ = "DATA_PT_current_curve"
+	__label__ = "Current Curve"
 
-		def draw(self, context):
-			currentcurve = context.curve.curves[0] # XXX
-			layout = self.layout
+	def draw(self, context):
+		currentcurve = context.curve.curves[0] # XXX
+		layout = self.layout
 
-			split = layout.split()
+		split = layout.split()
+	
+		sub = split.column()
+		sub.itemL(text="Cyclic:")
+		sub.itemR(currentcurve, "cyclic_u", text="U")
+		sub.itemR(currentcurve, "cyclic_v", text="V")
+		sub.itemL(text="Order:")
+		sub.itemR(currentcurve, "order_u", text="U")
+		sub.itemR(currentcurve, "order_v", text="V")
+		sub.itemL(text="Endpoints:")
+		sub.itemR(currentcurve, "endpoint_u", text="U")
+		sub.itemR(currentcurve, "endpoint_v", text="V")
 		
-			sub = split.column()
-			sub.itemL(text="Cyclic:")
-			sub.itemR(currentcurve, "cyclic_u", text="U")
-			sub.itemR(currentcurve, "cyclic_v", text="V")
-			sub.itemL(text="Order:")
-			sub.itemR(currentcurve, "order_u", text="U")
-			sub.itemR(currentcurve, "order_v", text="V")
-			sub.itemL(text="Endpoints:")
-			sub.itemR(currentcurve, "endpoint_u", text="U")
-			sub.itemR(currentcurve, "endpoint_v", text="V")
-			
-			sub = split.column()
-			sub.itemL(text="Bezier:")
-			sub.itemR(currentcurve, "bezier_u", text="U")
-			sub.itemR(currentcurve, "bezier_v", text="V")
-			sub.itemL(text="Resolution:")
-			sub.itemR(currentcurve, "resolution_u", text="U")
-			sub.itemR(currentcurve, "resolution_v", text="V")
-			sub.itemL(text="Interpolation:")
-			sub.itemR(currentcurve, "tilt_interpolation", text="Tilt")
-			sub.itemR(currentcurve, "radius_interpolation", text="Tilt")
-			sub.itemR(currentcurve, "smooth")
-			
+		sub = split.column()
+		sub.itemL(text="Bezier:")
+		sub.itemR(currentcurve, "bezier_u", text="U")
+		sub.itemR(currentcurve, "bezier_v", text="V")
+		sub.itemL(text="Resolution:")
+		sub.itemR(currentcurve, "resolution_u", text="U")

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list