[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20483] branches/blender2.5/blender/ release/ui: UI:

Brecht Van Lommel brecht at blender.org
Fri May 29 01:45:50 CEST 2009


Revision: 20483
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20483
Author:   blendix
Date:     2009-05-29 01:45:50 +0200 (Fri, 29 May 2009)

Log Message:
-----------
UI:
* Added panels with dummy preview template.
* Added constraints panel for bones next to objects, though it
  doesn't work that well yet, the operators and code need to be
  changed so they don't assume it is one or the other in/out
  of posemode.
* Added some graying out in the scene and world buttons.

Modified Paths:
--------------
    branches/blender2.5/blender/release/ui/buttons_data_bone.py
    branches/blender2.5/blender/release/ui/buttons_material.py
    branches/blender2.5/blender/release/ui/buttons_object_constraint.py
    branches/blender2.5/blender/release/ui/buttons_objects.py
    branches/blender2.5/blender/release/ui/buttons_scene.py
    branches/blender2.5/blender/release/ui/buttons_texture.py
    branches/blender2.5/blender/release/ui/buttons_world.py
    branches/blender2.5/blender/release/ui/space_outliner.py

Modified: branches/blender2.5/blender/release/ui/buttons_data_bone.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_bone.py	2009-05-28 23:41:12 UTC (rev 20482)
+++ branches/blender2.5/blender/release/ui/buttons_data_bone.py	2009-05-28 23:45:50 UTC (rev 20483)
@@ -1,7 +1,7 @@
 
 import bpy
  
-class DataButtonsPanel(bpy.types.Panel):
+class BoneButtonsPanel(bpy.types.Panel):
 	__space_type__ = "BUTTONS_WINDOW"
 	__region_type__ = "WINDOW"
 	__context__ = "bone"
@@ -10,8 +10,8 @@
 		ob = context.active_object
 		return (ob and ob.type == 'ARMATURE')
 
-class DATA_PT_bone(DataButtonsPanel):
-	__idname__ = "DATA_PT_bone"
+class BONE_PT_bone(BoneButtonsPanel):
+	__idname__ = "BONE_PT_bone"
 	__label__ = "Bone"
 
 	def draw(self, context):
@@ -49,16 +49,5 @@
 		
 		sub.itemR(bone, "cyclic_offset")
 
-class DATA_PT_constraints(DataButtonsPanel):
-	__idname__ = "DATA_PT_constraints"
-	__label__ = "Constraints"
-	
-	def draw(self, context):
-		bone = context.active_object.data.bones[0]
-		layout = self.layout
-		split = layout.split()
-		
-		sub = split.column()
+bpy.types.register(BONE_PT_bone)
 
-bpy.types.register(DATA_PT_bone)
-#bpy.types.register(DATA_PT_constraints)
\ No newline at end of file

Modified: branches/blender2.5/blender/release/ui/buttons_material.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_material.py	2009-05-28 23:41:12 UTC (rev 20482)
+++ branches/blender2.5/blender/release/ui/buttons_material.py	2009-05-28 23:45:50 UTC (rev 20483)
@@ -9,6 +9,16 @@
 	def poll(self, context):
 		ob = context.active_object
 		return (ob and ob.active_material)
+
+class MATERIAL_PT_preview(MaterialButtonsPanel):
+	__idname__= "MATERIAL_PT_preview"
+	__label__ = "Preview"
+
+	def draw(self, context):
+		layout = self.layout
+
+		mat = context.active_object.active_material
+		layout.template_preview(mat)
 	
 class MATERIAL_PT_material(MaterialButtonsPanel):
 	__idname__= "MATERIAL_PT_material"
@@ -188,8 +198,10 @@
 			sub.itemR(halo, "flare_seed", text="Seed")
 			sub.itemR(halo, "flares_sub", text="Sub")
 				
+bpy.types.register(MATERIAL_PT_preview)
 bpy.types.register(MATERIAL_PT_material)
 bpy.types.register(MATERIAL_PT_raymir)
 bpy.types.register(MATERIAL_PT_raytransp)
 bpy.types.register(MATERIAL_PT_sss)
-bpy.types.register(MATERIAL_PT_halo)
\ No newline at end of file
+bpy.types.register(MATERIAL_PT_halo)
+

Modified: branches/blender2.5/blender/release/ui/buttons_object_constraint.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_object_constraint.py	2009-05-28 23:41:12 UTC (rev 20482)
+++ branches/blender2.5/blender/release/ui/buttons_object_constraint.py	2009-05-28 23:45:50 UTC (rev 20483)
@@ -1,34 +1,39 @@
 
 import bpy
 
-class DataButtonsPanel(bpy.types.Panel):
+class ConstraintButtonsPanel(bpy.types.Panel):
 	__space_type__ = "BUTTONS_WINDOW"
 	__region_type__ = "WINDOW"
 	__context__ = "object"
 
-	def poll(self, context):
-		ob = context.active_object
-		return (ob != None)
-		
-class DATA_PT_constraints(DataButtonsPanel):
-	__idname__ = "DATA_PT_constraints"
-	__label__ = "Constraints"
-
-	def draw(self, context):
-		ob = context.active_object
+	def draw_constraint(self, con):
 		layout = self.layout
+		box = layout.template_constraint(con)
 
-		row = layout.row()
-		row.item_menu_enumO("OBJECT_OT_constraint_add", "type")
-		row.itemL();
+		if box:
+			if con.type == "COPY_LOCATION":
+				self.copy_location(box, con)
 
-		for con in ob.constraints:
-			box = layout.template_constraint(con)
+			# show/key buttons here are most likely obsolete now, with
+			# keyframing functionality being part of every button
+			if con.type not in ("RIGID_BODY_JOINT", "NULL"):
+				box.itemR(con, "influence")
+	
+	def space_template(self, layout, con, target=True, owner=True):
+		if target or owner:
+			row = layout.row()
 
-			if box:
-				if con.type == 'COPY_LOCATION':
-					self.copy_location(box, con)
-					
+			row.itemL(text="Convert:")
+
+			if target:
+				row.itemR(con, "target_space", text="")
+
+			if target and owner:
+				row.itemL(icon=8) # XXX
+
+			if owner:
+				row.itemR(con, "owner_space", text="")
+			
 	def target_template(self, layout, con, subtargets=True):
 		layout.itemR(con, "target") # XXX limiting settings for only 'curves' or some type of object
 		
@@ -55,5 +60,49 @@
 
 		layout.itemR(con, "offset")
 
-bpy.types.register(DATA_PT_constraints)
+		self.space_template(layout, con)
 
+class OBJECT_PT_constraints(ConstraintButtonsPanel):
+	__idname__ = "OBJECT_PT_constraints"
+	__label__ = "Constraints"
+	__context__ = "object"
+
+	def poll(self, context):
+		ob = context.active_object
+		return (ob != None)
+		
+	def draw(self, context):
+		ob = context.active_object
+		layout = self.layout
+
+		row = layout.row()
+		row.item_menu_enumO("OBJECT_OT_constraint_add", "type")
+		row.itemL();
+
+		for con in ob.constraints:
+			self.draw_constraint(con)
+
+class BONE_PT_constraints(ConstraintButtonsPanel):
+	__idname__ = "BONE_PT_constraints"
+	__label__ = "Constraints"
+	__context__ = "bone"
+
+	def poll(self, context):
+		ob = context.active_object
+		return (ob and ob.type == "ARMATURE")
+		
+	def draw(self, context):
+		ob = context.active_object
+		pchan = ob.pose.pose_channels[0]
+		layout = self.layout
+
+		#row = layout.row()
+		#row.item_menu_enumO("BONE_OT_constraint_add", "type")
+		#row.itemL();
+
+		for con in pchan.constraints:
+			self.draw_constraint(con)
+
+bpy.types.register(OBJECT_PT_constraints)
+bpy.types.register(BONE_PT_constraints)
+

Modified: branches/blender2.5/blender/release/ui/buttons_objects.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_objects.py	2009-05-28 23:41:12 UTC (rev 20482)
+++ branches/blender2.5/blender/release/ui/buttons_objects.py	2009-05-28 23:45:50 UTC (rev 20483)
@@ -39,15 +39,15 @@
 
 		for group in bpy.data.groups:
 			if ob in group.objects:
-				box = layout.box()
+				col = layout.column(align=True)
 
-				row = box.row()
-				row.itemR(group, "name")
+				row = col.box().row()
+				row.itemR(group, "name", text="")
 				#row.itemO("OBJECT_OT_remove_group")
 
-				row = box.row()
-				row.column().itemR(group, "layer")
-				row.column().itemR(group, "dupli_offset")
+				split = col.box().split()
+				split.column().itemR(group, "layer")
+				split.column().itemR(group, "dupli_offset")
 
 class OBJECT_PT_display(ObjectButtonsPanel):
 	__idname__ = "OBJECT_PT_display"
@@ -131,4 +131,4 @@
 bpy.types.register(OBJECT_PT_groups)
 bpy.types.register(OBJECT_PT_display)
 bpy.types.register(OBJECT_PT_duplication)
-bpy.types.register(OBJECT_PT_animation)
\ No newline at end of file
+bpy.types.register(OBJECT_PT_animation)

Modified: branches/blender2.5/blender/release/ui/buttons_scene.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_scene.py	2009-05-28 23:41:12 UTC (rev 20482)
+++ branches/blender2.5/blender/release/ui/buttons_scene.py	2009-05-28 23:45:50 UTC (rev 20483)
@@ -77,10 +77,11 @@
 
 	def draw(self, context):
 		scene = context.scene
+		rd = scene.render_data
+
 		layout = self.layout
+		layout.active = rd.antialiasing
 
-		rd = scene.render_data
-
 		split = layout.split()
 		
 		sub = split.column()
@@ -182,10 +183,11 @@
 
 	def draw(self, context):
 		scene = context.scene
+		rd = scene.render_data
+
 		layout = self.layout
+		layout.active = rd.stamp
 
-		rd = scene.render_data
-
 		split = layout.split()
 		
 		sub = split.column()
@@ -211,4 +213,5 @@
 bpy.types.register(RENDER_PT_antialiasing)
 bpy.types.register(RENDER_PT_shading)
 bpy.types.register(RENDER_PT_output)
-bpy.types.register(RENDER_PT_stamp)
\ No newline at end of file
+bpy.types.register(RENDER_PT_stamp)
+

Modified: branches/blender2.5/blender/release/ui/buttons_texture.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_texture.py	2009-05-28 23:41:12 UTC (rev 20482)
+++ branches/blender2.5/blender/release/ui/buttons_texture.py	2009-05-28 23:45:50 UTC (rev 20483)
@@ -10,6 +10,16 @@
 		try:	return (context.active_object.active_material.active_texture.texture != None)
 		except:return False
 
+class TEXTURE_PT_preview(TextureButtonsPanel):
+	__idname__= "TEXTURE_PT_preview"
+	__label__ = "Preview"
+
+	def draw(self, context):
+		layout = self.layout
+
+		tex = context.active_object.active_material.active_texture.texture
+		layout.template_preview(tex)
+
 class TEXTURE_PT_texture(TextureButtonsPanel):
 	__idname__= "TEXTURE_PT_texture"
 	__label__ = "Texture"
@@ -330,6 +340,7 @@
 		sub = split.column()
 		sub.itemR(tex, "nabla")	
 
+bpy.types.register(TEXTURE_PT_preview)
 bpy.types.register(TEXTURE_PT_texture)
 bpy.types.register(TEXTURE_PT_clouds)
 bpy.types.register(TEXTURE_PT_wood)
@@ -344,3 +355,4 @@
 bpy.types.register(TEXTURE_PT_musgrave)
 bpy.types.register(TEXTURE_PT_voronoi)
 bpy.types.register(TEXTURE_PT_distortednoise)
+

Modified: branches/blender2.5/blender/release/ui/buttons_world.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_world.py	2009-05-28 23:41:12 UTC (rev 20482)
+++ branches/blender2.5/blender/release/ui/buttons_world.py	2009-05-28 23:45:50 UTC (rev 20483)
@@ -8,6 +8,15 @@
 
 	def poll(self, context):
 		return (context.scene.world != None)
+
+class WORLD_PT_preview(WorldButtonsPanel):
+	__label__ = "Preview"
+
+	def draw(self, context):
+		layout = self.layout
+
+		world = context.scene.world
+		layout.template_preview(world)
 	
 class WORLD_PT_world(WorldButtonsPanel):
 	__label__ = "World"
@@ -49,6 +58,7 @@
 	def draw(self, context):
 		world = context.scene.world
 		layout = self.layout
+		layout.active = world.mist.enabled
 
 		flow = layout.column_flow()
 		flow.itemR(world.mist, "start")
@@ -71,6 +81,7 @@
 	def draw(self, context):
 		world = context.scene.world
 		layout = self.layout
+		layout.active = world.stars.enabled
 
 		flow = layout.column_flow()
 		flow.itemR(world.stars, "size")
@@ -89,9 +100,9 @@
 
 	def draw(self, context):
 		world = context.scene.world
+		ao = world.ambient_occlusion
 		layout = self.layout
-
-		ao = world.ambient_occlusion
+		layout.active = ao.enabled
 		
 		layout.itemR(ao, "gather_method", expand=True)
 		
@@ -126,8 +137,10 @@
 		col.row().itemR(ao, "color", expand=True)

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list