[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21743] branches/blender2.5/blender: 2.5: RNA & UI

Brecht Van Lommel brecht at blender.org
Tue Jul 21 02:55:20 CEST 2009


Revision: 21743
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21743
Author:   blendix
Date:     2009-07-21 02:55:20 +0200 (Tue, 21 Jul 2009)

Log Message:
-----------
2.5: RNA & UI

* Revert lamp sampling/buffers change. The right enum items should
  be defined in RNA, not the layout, so that it works in outliner,
  python api too.
* Also changed type popup to radio buttons again, and removed the
  icons. This is more consistent, and I don't think it's a good idea
  to start using icons for these things, too much clutter.

* Replace Mesh with Normals panel in the mesh buttons.
* Remove Material panel from mesh buttons.
* Added name fields for shape/vgroup/vcol/uv.
* Spacing tweak to Object and Bone names.

* Fix some naming conflicts in RNA, with "name" and "type" properties
  being defined twice in the same struct.

* context.scene.tool_settings -> context.tool_settings.

Modified Paths:
--------------
    branches/blender2.5/blender/release/ui/buttons_data_bone.py
    branches/blender2.5/blender/release/ui/buttons_data_lamp.py
    branches/blender2.5/blender/release/ui/buttons_data_mesh.py
    branches/blender2.5/blender/release/ui/buttons_material.py
    branches/blender2.5/blender/release/ui/buttons_objects.py
    branches/blender2.5/blender/release/ui/buttons_physics_cloth.py
    branches/blender2.5/blender/release/ui/buttons_scene.py
    branches/blender2.5/blender/release/ui/space_console.py
    branches/blender2.5/blender/release/ui/space_image.py
    branches/blender2.5/blender/release/ui/space_view3d.py
    branches/blender2.5/blender/release/ui/space_view3d_toolbar.py
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_brush.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_fcurve.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_lamp.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_nodetree.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_object.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_space.c

Modified: branches/blender2.5/blender/release/ui/buttons_data_bone.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_bone.py	2009-07-21 00:36:07 UTC (rev 21742)
+++ branches/blender2.5/blender/release/ui/buttons_data_bone.py	2009-07-21 00:55:20 UTC (rev 21743)
@@ -19,9 +19,9 @@
 		if not bone:
 			bone = context.edit_bone
 		
-		split = layout.split(percentage=0.06)
-		split.itemL(text="", icon="ICON_BONE_DATA")
-		split.itemR(bone, "name", text="")
+		row = layout.row()
+		row.itemL(text="", icon="ICON_BONE_DATA")
+		row.itemR(bone, "name", text="")
 
 class BONE_PT_transform(BoneButtonsPanel):
 	__idname__ = "BONE_PT_transform"

Modified: branches/blender2.5/blender/release/ui/buttons_data_lamp.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_lamp.py	2009-07-21 00:36:07 UTC (rev 21742)
+++ branches/blender2.5/blender/release/ui/buttons_data_lamp.py	2009-07-21 00:55:20 UTC (rev 21743)
@@ -48,9 +48,7 @@
 		
 		lamp = context.lamp
 		
-		split = layout.split(percentage=0.2)
-		split.itemL(text="Type:")
-		split.itemR(lamp, "type", text="")
+		layout.itemR(lamp, "type", expand=True)
 		
 		split = layout.split()
 		
@@ -165,14 +163,9 @@
 	def draw(self, context):
 		layout = self.layout
 		lamp = context.lamp
+
+		layout.itemR(lamp, "shadow_method", expand=True)
 		
-		row = layout.row(align=True)
-		row.item_enumR(lamp, "shadow_method", 'NOSHADOW')
-		row.item_enumR(lamp, "shadow_method", 'RAY_SHADOW')
-		if lamp.type == 'SPOT':
-			row.item_enumR(lamp, "shadow_method", 'BUFFER_SHADOW')
-			
-		
 		if lamp.shadow_method != 'NOSHADOW':
 		
 			split = layout.split()
@@ -186,12 +179,9 @@
 		
 		if lamp.shadow_method == 'RAY_SHADOW':
 		
-			row = layout.row(align=True)
-			layout.itemL(text="Sampling:")
-			row.item_enumR(lamp, "shadow_ray_sampling_method", 'ADAPTIVE_QMC')
-			row.item_enumR(lamp, "shadow_ray_sampling_method", 'CONSTANT_QMC')
-			if lamp.type == 'AREA':
-				row.item_enumR(lamp, "shadow_ray_sampling_method", 'CONSTANT_JITTERED')
+			col = layout.column()
+			col.itemL(text="Sampling:")
+			col.row().itemR(lamp, "shadow_ray_sampling_method", expand=True)
 				
 			if lamp.type in ('POINT', 'SUN', 'SPOT'):
 				flow = layout.column_flow()

Modified: branches/blender2.5/blender/release/ui/buttons_data_mesh.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_mesh.py	2009-07-21 00:36:07 UTC (rev 21742)
+++ branches/blender2.5/blender/release/ui/buttons_data_mesh.py	2009-07-21 00:55:20 UTC (rev 21743)
@@ -29,9 +29,9 @@
 			split.template_ID(space, "pin_id")
 			split.itemS()
 
-class DATA_PT_mesh(DataButtonsPanel):
-	__idname__ = "DATA_PT_mesh"
-	__label__ = "Mesh"
+class DATA_PT_normals(DataButtonsPanel):
+	__idname__ = "DATA_PT_normals"
+	__label__ = "Normals"
 
 	def draw(self, context):
 		layout = self.layout
@@ -48,49 +48,15 @@
 		sub = split.column()
 		sub.itemR(mesh, "vertex_normal_flip")
 		sub.itemR(mesh, "double_sided")
-			
-		layout.itemS()
-		layout.itemR(mesh, "texco_mesh")
 
-class DATA_PT_materials(DataButtonsPanel):
-	__idname__ = "DATA_PT_materials"
-	__label__ = "Materials"
-	
-	def poll(self, context):
-		return (context.object and context.object.type in ('MESH', 'CURVE', 'FONT', 'SURFACE'))
-
-	def draw(self, context):
-		layout = self.layout
-		ob = context.object
-
-		row = layout.row()
-
-		row.template_list(ob, "materials", ob, "active_material_index")
-
-		col = row.column(align=True)
-		col.itemO("object.material_slot_add", icon="ICON_ZOOMIN", text="")
-		col.itemO("object.material_slot_remove", icon="ICON_ZOOMOUT", text="")
-
+		row = layout.row(align=True)
 		if context.edit_object:
-			row = layout.row(align=True)
+			row.itemO("MESH_OT_faces_shade_smooth")
+			row.itemO("MESH_OT_faces_shade_flat")
+		else:
+			row.itemO("OBJECT_OT_shade_smooth")
+			row.itemO("OBJECT_OT_shade_flat")
 
-			row.itemO("object.material_slot_assign", text="Assign")
-			row.itemO("object.material_slot_select", text="Select")
-			row.itemO("object.material_slot_deselect", text="Deselect")
-
-		"""
-		layout.itemS()
-
-		box= layout.box()
-
-		row = box.row()
-		row.template_list(ob, "materials", ob, "active_material_index", compact=True)
-
-		subrow = row.row(align=True)
-		subrow.itemO("object.material_slot_add", icon="ICON_ZOOMIN", text="")
-		subrow.itemO("object.material_slot_remove", icon="ICON_ZOOMOUT", text="")
-		"""
-
 class DATA_PT_vertex_groups(DataButtonsPanel):
 	__idname__ = "DATA_PT_vertex_groups"
 	__label__ = "Vertex Groups"
@@ -114,6 +80,11 @@
 		if ob.data.users > 1:
 			col.itemO("object.vertex_group_copy_to_linked", icon="ICON_BLANK1", text="")
 
+		group = ob.active_vertex_group
+		if group:
+			row = layout.row()
+			row.itemR(group, "name")
+
 		if context.edit_object:
 			row = layout.row(align=True)
 
@@ -150,7 +121,7 @@
 			col.itemS()
 
 			subcol = col.column(align=True)
-			subcol.itemR(ob, "shape_key_lock", icon="ICON_PINNED", text="")
+			subcol.itemR(ob, "shape_key_lock", icon="ICON_UNPINNED", text="")
 			subcol.itemR(kb, "mute", icon="ICON_MUTE_IPO_ON", text="")
 
 			if key.relative:
@@ -158,6 +129,9 @@
 				row.itemR(key, "relative")
 				row.itemL()
 
+				row = layout.row()
+				row.itemR(kb, "name")
+
 				if ob.active_shape_key_index != 0:
 					if not ob.shape_key_lock:
 						row = layout.row(align=True)
@@ -173,6 +147,9 @@
 				row.itemR(key, "relative")
 				row.itemR(key, "slurph")
 
+				row = layout.row()
+				row.itemR(kb, "name")
+
 		if context.edit_object:
 			layout.enabled = False
 
@@ -186,12 +163,17 @@
 
 		row = layout.row()
 
-		row.template_list(me, "uv_textures", me, "active_uv_texture_index")
+		col = row.column()
+		col.template_list(me, "uv_textures", me, "active_uv_texture_index", rows=2)
 
 		col = row.column(align=True)
 		col.itemO("mesh.uv_texture_add", icon="ICON_ZOOMIN", text="")
 		col.itemO("mesh.uv_texture_remove", icon="ICON_ZOOMOUT", text="")
 
+		lay = me.active_uv_texture
+		if lay:
+			layout.itemR(lay, "name")
+
 class DATA_PT_vertex_colors(DataButtonsPanel):
 	__idname__ = "DATA_PT_vertex_colors"
 	__label__ = "Vertex Colors"
@@ -201,16 +183,20 @@
 		me = context.mesh
 
 		row = layout.row()
+		col = row.column()
 
-		row.template_list(me, "vertex_colors", me, "active_vertex_color_index")
+		col.template_list(me, "vertex_colors", me, "active_vertex_color_index", rows=2)
 
 		col = row.column(align=True)
 		col.itemO("mesh.vertex_color_add", icon="ICON_ZOOMIN", text="")
 		col.itemO("mesh.vertex_color_remove", icon="ICON_ZOOMOUT", text="")
 
+		lay = me.active_vertex_color
+		if lay:
+			layout.itemR(lay, "name")
+
 bpy.types.register(DATA_PT_context_mesh)
-bpy.types.register(DATA_PT_mesh)
-bpy.types.register(DATA_PT_materials)
+bpy.types.register(DATA_PT_normals)
 bpy.types.register(DATA_PT_vertex_groups)
 bpy.types.register(DATA_PT_shape_keys)
 bpy.types.register(DATA_PT_uv_texture)

Modified: branches/blender2.5/blender/release/ui/buttons_material.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_material.py	2009-07-21 00:36:07 UTC (rev 21742)
+++ branches/blender2.5/blender/release/ui/buttons_material.py	2009-07-21 00:55:20 UTC (rev 21743)
@@ -37,12 +37,19 @@
 		if ob:
 			row = layout.row()
 
-			row.template_list(ob, "materials", ob, "active_material_index")
+			row.template_list(ob, "materials", ob, "active_material_index", rows=2)
 
 			col = row.column(align=True)
 			col.itemO("object.material_slot_add", icon="ICON_ZOOMIN", text="")
 			col.itemO("object.material_slot_remove", icon="ICON_ZOOMOUT", text="")
 
+			if context.edit_object:
+				row = layout.row(align=True)
+
+				row.itemO("object.material_slot_assign", text="Assign")
+				row.itemO("object.material_slot_select", text="Select")
+				row.itemO("object.material_slot_deselect", text="Deselect")
+
 		split = layout.split(percentage=0.65)
 
 		if ob and slot:

Modified: branches/blender2.5/blender/release/ui/buttons_objects.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_objects.py	2009-07-21 00:36:07 UTC (rev 21742)
+++ branches/blender2.5/blender/release/ui/buttons_objects.py	2009-07-21 00:55:20 UTC (rev 21743)
@@ -14,9 +14,9 @@
 		layout = self.layout
 		ob = context.object
 		
-		split = layout.split(percentage=0.06)
-		split.itemL(text="", icon="ICON_OBJECT_DATA")
-		split.itemR(ob, "name", text="")
+		row = layout.row()
+		row.itemL(text="", icon="ICON_OBJECT_DATA")
+		row.itemR(ob, "name", text="")
 
 class OBJECT_PT_transform(ObjectButtonsPanel):
 	__idname__ = "OBJECT_PT_transform"
@@ -176,3 +176,4 @@
 bpy.types.register(OBJECT_PT_display)
 bpy.types.register(OBJECT_PT_duplication)
 bpy.types.register(OBJECT_PT_animation)
+

Modified: branches/blender2.5/blender/release/ui/buttons_physics_cloth.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_physics_cloth.py	2009-07-21 00:36:07 UTC (rev 21742)
+++ branches/blender2.5/blender/release/ui/buttons_physics_cloth.py	2009-07-21 00:55:20 UTC (rev 21743)
@@ -196,3 +196,4 @@
 bpy.types.register(PHYSICS_PT_cloth_cache)
 bpy.types.register(PHYSICS_PT_cloth_collision)
 bpy.types.register(PHYSICS_PT_cloth_stiffness)
+

Modified: branches/blender2.5/blender/release/ui/buttons_scene.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_scene.py	2009-07-21 00:36:07 UTC (rev 21742)
+++ branches/blender2.5/blender/release/ui/buttons_scene.py	2009-07-21 00:55:20 UTC (rev 21743)
@@ -114,9 +114,9 @@
 		col.itemR(rd, "render_textures", text="Textures")
 		col.itemR(rd, "render_shadows", text="Shadows")
 		col.itemR(rd, "render_sss", text="Subsurface Scattering")
+		col.itemR(rd, "render_envmaps", text="Environment Map")
 		
 		col = split.column()
-		col.itemR(rd, "render_envmaps", text="Environment Map")
 		col.itemR(rd, "render_raytracing", text="Ray Tracing")
 		col.itemR(rd, "color_management")
 		col.itemR(rd, "alpha_mode", text="Alpha")
@@ -330,7 +330,7 @@
 		col.itemR(rd, "full_sample")
 
 		col = split.column()
-		col.itemR(rd, "pixel_filter", text="Filter")
+		col.itemR(rd, "pixel_filter", text="")
 		col.itemR(rd, "filter_size", text="Size", slider=True)
 	
 class RENDER_PT_dimensions(RenderButtonsPanel):


@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list