[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21724] branches/blender2.5/blender: patch from William

Campbell Barton ideasman42 at gmail.com
Mon Jul 20 18:39:17 CEST 2009


Revision: 21724
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21724
Author:   campbellbarton
Date:     2009-07-20 18:39:16 +0200 (Mon, 20 Jul 2009)

Log Message:
-----------
patch from William
 Cleaned up force fields panel, as well as the other fixes (sculpt, lamps)
 

Modified Paths:
--------------
    branches/blender2.5/blender/release/ui/buttons_data_lamp.py
    branches/blender2.5/blender/release/ui/buttons_physics_field.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/editors/screen/screen_ops.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_lamp.c

Modified: branches/blender2.5/blender/release/ui/buttons_data_lamp.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_lamp.py	2009-07-20 16:26:50 UTC (rev 21723)
+++ branches/blender2.5/blender/release/ui/buttons_data_lamp.py	2009-07-20 16:39:16 UTC (rev 21724)
@@ -47,9 +47,11 @@
 		layout = self.layout
 		
 		lamp = context.lamp
-
-		layout.itemR(lamp, "type")
 		
+		split = layout.split(percentage=0.2)
+		split.itemL(text="Type:")
+		split.itemR(lamp, "type", text="")
+		
 		split = layout.split()
 		
 		sub = split.column()
@@ -64,7 +66,9 @@
 		sub.itemR(lamp, "diffuse")
 		
 		if lamp.type in ('POINT', 'SPOT'):
-			sub.itemR(lamp, "falloff_type")
+			split = sub.split(percentage=0.3)
+			split.itemL(text="Falloff:")
+			split.itemR(lamp, "falloff_type", text="")
 			sub.itemR(lamp, "sphere")
 			
 			if (lamp.falloff_type == 'LINEAR_QUADRATIC_WEIGHTED'):
@@ -81,47 +85,75 @@
 				sub.itemR(lamp, "size", text="Size X")
 				sub.itemR(lamp, "size_y")
 				
-class DATA_PT_sunsky(DataButtonsPanel):
-	__idname__ = "DATA_PT_sunsky"
-	__label__ = "Sun/Sky"
+class DATA_PT_sky(DataButtonsPanel):
+	__idname__ = "DATA_PT_sky"
+	__label__ = "Sky"
 	
 	def poll(self, context):
 		lamp = context.lamp
 		return (lamp and lamp.type == 'SUN')
+		
+	def draw_header(self, context):
+		layout = self.layout
+		lamp = context.lamp.sky
 
+		layout.itemR(lamp, "sky", text="")
+
 	def draw(self, context):
 		layout = self.layout
 		lamp = context.lamp.sky
 
-		row = layout.row()
-		row.itemR(lamp, "sky")
-		row.itemR(lamp, "atmosphere")
+		layout.active = lamp.sky
 		
-		row = layout.row()
-		row.active = lamp.sky or lamp.atmosphere
-		row.itemR(lamp, "atmosphere_turbidity", text="Turbidity")
-			
 		split = layout.split()
+		col = split.column()
 
+		col.itemL(text="Colors:")
+		col.itemR(lamp, "sky_blend_type", text="Blend Type")
+		col.itemR(lamp, "sky_blend")
+		col.itemR(lamp, "sky_color_space", text="Color Space")
+		col.itemR(lamp, "sky_exposure", text="Exposure")
+		
 		col = split.column()
-		sub = col.column()
-		sub.active = lamp.sky
-		sub.itemR(lamp, "sky_blend_type", text="Blend Type")
-		sub.itemR(lamp, "sky_blend")
-		sub.itemR(lamp, "sky_color_space", text="Color Space")
-		sub.itemR(lamp, "sky_exposure")
-		sub.itemR(lamp, "horizon_brightness", text="Hor Bright")
-		sub.itemR(lamp, "spread", text="Hor Spread")
-		sub.itemR(lamp, "sun_brightness", text="Sun Bright")
-		sub.itemR(lamp, "sun_size")
-		sub.itemR(lamp, "backscattered_light", text="Back Light")
+		col.itemL(text="Horizon:")
+		col.itemR(lamp, "horizon_brightness", text="Brightness")
+		col.itemR(lamp, "spread", text="Spread")
+		col.itemL(text="Sun:")
+		col.itemR(lamp, "sun_brightness", text="Brightness")
+		col.itemR(lamp, "sun_size", text="Size")
+		col.itemR(lamp, "backscattered_light", text="Back Light")
 				
+
+		
+		
+class DATA_PT_atmosphere(DataButtonsPanel):
+	__idname__ = "DATA_PT_atmosphere"
+	__label__ = "Atmosphere"
+	
+	def poll(self, context):
+		lamp = context.lamp
+		return (lamp and lamp.type == 'SUN')
+
+	def draw_header(self, context):
+		layout = self.layout
+		lamp = context.lamp.sky
+
+		layout.itemR(lamp, "atmosphere", text="")
+
+	def draw(self, context):
+		layout = self.layout
+		lamp = context.lamp.sky
+	
+		layout.active = lamp.atmosphere
+		
+		split = layout.split()
 		sub = split.column()
-		sub.active = lamp.atmosphere
-		sub.itemR(lamp, "sun_intensity", text="Sun Intens")
-		sub.itemR(lamp, "atmosphere_inscattering", text="Inscattering")
-		sub.itemR(lamp, "atmosphere_extinction", text="Extinction")
-		sub.itemR(lamp, "atmosphere_distance_factor", text="Distance")
+		sub.itemR(lamp, "atmosphere_turbidity", text="Turbidity")
+		sub.itemR(lamp, "sun_intensity", text="Sun Intensity")
+		sub = split.column()
+		sub.itemR(lamp, "atmosphere_inscattering", text="Inscattering", slider=True)
+		sub.itemR(lamp, "atmosphere_extinction", text="Extinction", slider=True)
+		sub.itemR(lamp, "atmosphere_distance_factor", text="Distance")		
 				
 class DATA_PT_shadow(DataButtonsPanel):
 	__idname__ = "DATA_PT_shadow"
@@ -252,7 +284,8 @@
 bpy.types.register(DATA_PT_preview)
 bpy.types.register(DATA_PT_lamp)
 bpy.types.register(DATA_PT_shadow)
-bpy.types.register(DATA_PT_sunsky)
+bpy.types.register(DATA_PT_sky)
+bpy.types.register(DATA_PT_atmosphere)
 bpy.types.register(DATA_PT_spot)
 bpy.types.register(DATA_PT_falloff_curve)
 

Modified: branches/blender2.5/blender/release/ui/buttons_physics_field.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_physics_field.py	2009-07-20 16:26:50 UTC (rev 21723)
+++ branches/blender2.5/blender/release/ui/buttons_physics_field.py	2009-07-20 16:39:16 UTC (rev 21724)
@@ -21,118 +21,129 @@
 
 		#layout.active = field.enabled
 		
+		split = layout.split(percentage=0.3)
+		
+		split.itemL(text="Type:")
+		split.itemR(field, "type", text=""
+		)
+
 		split = layout.split()
-		col = split.column(align=True)
-		col.itemL(text="Type:")
-		col.itemR(field, "type", text="")
-		colsub = split.column(align=True)
+		
+		sub = split.column()
 							
 		if field.type == "GUIDE":
-			colsub = col.column()
-			colsub.itemL(text="blabla")
-			colsub.itemR(field, "guide_path_add")
+			sub = col.column()
+			sub.itemR(field, "guide_path_add")
 			
 		if field.type == "WIND":
-			col.itemR(field, "strength")
-			col.itemR(field, "noise")
-			col.itemR(field, "seed")
-			colsub.itemL(text="")
-			colsub.itemL(text="")
-			colsub.itemL(text="")
-			colsub.itemL(text="")
-			colsub.itemL(text="")
-			colsub.itemL(text="")
-			colsub.itemL(text="")
+			sub.itemR(field, "strength")
+			sub = split.column()
+			sub.itemR(field, "noise")
+			sub.itemR(field, "seed")
+
 		
 		if field.type == "VORTEX":
-			col.itemR(field, "strength")
-			colsub.itemL(text="")
-			colsub.itemL(text="")
-			colsub.itemL(text="")
-			colsub.itemL(text="")
-			colsub.itemL(text="")
+			sub.itemR(field, "strength")
+			sub = split.column()
+			sub.itemL(text="")
 
 		if field.type in ("SPHERICAL", "CHARGE", "LENNARDJ"):
-			col.itemR(field, "strength")
-			colsub.itemL(text="")
-			colsub.itemR(field, "surface")
-			colsub.itemR(field, "planar")
-			colsub.itemL(text="")
-			colsub.itemL(text="")
+			sub.itemR(field, "strength")
+			sub = split.column()
+			sub.itemR(field, "planar")
+			sub.itemR(field, "surface")
 			
 		if field.type == "MAGNET":
-			col.itemR(field, "strength")
-			colsub.itemL(text="")
-			colsub.itemR(field, "planar")
-			colsub.itemL(text="")
-			colsub.itemL(text="")
-			colsub.itemL(text="")
+			sub.itemR(field, "strength")
+			sub = split.column()
+			sub.itemR(field, "planar")
 			
 		if field.type == "HARMONIC":
-			col.itemR(field, "strength")
-			col.itemR(field, "harmonic_damping", text="Damping")
-			colsub.itemL(text="")
-			colsub.itemR(field, "surface")
-			colsub.itemR(field, "planar")
-			colsub.itemL(text="")
-			colsub.itemL(text="")
-			colsub.itemL(text="")
+			sub.itemR(field, "strength")
+			sub.itemR(field, "harmonic_damping", text="Damping")
+			sub = split.column()
+			sub.itemR(field, "surface")
+			sub.itemR(field, "planar")
 			
 		if field.type == "TEXTURE":
-			col.itemR(field, "strength")
-			col.itemR(field, "texture", text="")
-			col.itemL(text="Texture Mode:")
-			col.itemR(field, "texture_mode", text="")
-			col.itemR(field, "texture_nabla")
-			colsub.itemL(text="")
-			colsub.itemR(field, "use_coordinates")
-			colsub.itemR(field, "root_coordinates")
-			colsub.itemR(field, "force_2d")
-			colsub.itemL(text="")
-			colsub.itemL(text="")
-			colsub.itemL(text="")
-			colsub.itemL(text="")
-			colsub.itemL(text="")
+			sub.itemR(field, "strength")
+			sub.itemR(field, "texture", text="")
+			sub.itemR(field, "texture_mode")
+			sub.itemR(field, "texture_nabla")
+			sub = split.column()
+			sub.itemR(field, "use_coordinates")
+			sub.itemR(field, "root_coordinates")
+			sub.itemR(field, "force_2d")
 			
 		if field.type in ("HARMONIC", "SPHERICAL", "CHARGE", "WIND", "VORTEX", "TEXTURE", "MAGNET"):
-			col.itemL(text="Fall-Off:")
-			col.itemR(field, "falloff_type", text="")
-			col.itemR(field, "positive_z", text="Positive Z")
-			col.itemR(field, "use_min_distance", text="Use Minimum")
-			col.itemR(field, "use_max_distance", text="Use Maximum")
-			colsub.itemR(field, "falloff_power", text="Power")
-			colsub1 = colsub.column()
+		
+			
+			layout.itemS()			
+			layout.itemL(text="Falloff:")
+			layout.itemR(field, "falloff_type", expand=True)
+			
+			row = layout.row()
+			row.itemR(field, "falloff_power", text="Power")
+			row.itemR(field, "positive_z", text="Positive Z")
+			
+			split = layout.split()
+			sub = split.column()
+			
+			sub.itemR(field, "use_min_distance", text="Minimum")
+			colsub1 = sub.column()
 			colsub1.active = field.use_min_distance
 			colsub1.itemR(field, "minimum_distance", text="Distance")
-			colsub2 = colsub.column()
+			
+			sub = split.column()
+			
+			sub.itemR(field, "use_max_distance", text="Maximum")
+			colsub2 = sub.column()
 			colsub2.active = field.use_max_distance
 			colsub2.itemR(field, "maximum_distance", text="Distance")
 			
 			if field.falloff_type == "CONE":
-				col.itemL(text="")
-				col.itemL(text="Angular:")
-				col.itemR(field, "use_radial_min", text="Use Minimum")	
-				col.itemR(field, "use_radial_max", text="Use Maximum")
-				colsub.itemL(text="")		
-				colsub.itemR(field, "radial_falloff", text="Power")
-				colsub1 = colsub.column()
+				layout.itemS()	
+				layout.itemL(text="Angular:")
+				
+				row = layout.row()
+				row.itemR(field, "radial_falloff", text="Power")
+				row.itemL(text="")
+				
+				split = layout.split()
+				sub = split.column()
+				
+				sub.itemR(field, "use_radial_min", text="Minimum")	
+				colsub1 = sub.column()
 				colsub1.active = field.use_radial_min
 				colsub1.itemR(field, "radial_minimum", text="Angle")
-				colsub2 = colsub.column()
+				
+				sub = split.column()
+				
+				sub.itemR(field, "use_radial_max", text="Maximum")
+				colsub2 = sub.column()
 				colsub2.active = field.use_radial_max
 				colsub2.itemR(field, "radial_maximum", text="Angle")
 				
 			if field.falloff_type == "TUBE":
-				col.itemL(text="")
-				col.itemL(text="Radial:")
-				col.itemR(field, "use_radial_min", text="Use Minimum")	
-				col.itemR(field, "use_radial_max", text="Use Maximum")
-				colsub.itemL(text="")
-				colsub.itemR(field, "radial_falloff", text="Power")
-				colsub1 = colsub.column()
+				

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list