[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20112] branches/blender2.5/blender/ release/ui: 2.5 Buttons:

Thomas Dinges dingto at gmx.de
Fri May 8 23:52:58 CEST 2009


Revision: 20112
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20112
Author:   dingto
Date:     2009-05-08 23:52:57 +0200 (Fri, 08 May 2009)

Log Message:
-----------
2.5 Buttons:

* More Lamp options: Shadow and Spot (WIP, incomplete)
* Added initial lattice panel

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

Added Paths:
-----------
    branches/blender2.5/blender/release/ui/buttons_data_lattice.py

Modified: branches/blender2.5/blender/release/ui/buttons_data_lamp.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_lamp.py	2009-05-08 21:24:58 UTC (rev 20111)
+++ branches/blender2.5/blender/release/ui/buttons_data_lamp.py	2009-05-08 21:52:57 UTC (rev 20112)
@@ -8,7 +8,7 @@
 	
 	def poll(self, context):
 		ob = context.active_object
-		return (ob and ob.type == "LAMP")
+		return (ob and ob.type == 'LAMP')
 	
 class DATA_PT_lamp(DataButtonsPanel):
 	__idname__ = "DATA_PT_lamp"
@@ -108,6 +108,89 @@
 				sub.itemR(lamp, "atmosphere_inscattering", text="Inscattering")
 				sub.itemR(lamp, "atmosphere_extinction", text="Extinction")
 				sub.itemR(lamp, "atmosphere_distance_factor", text="Distance")
+				
+class DATA_PT_shadow(DataButtonsPanel):
+	__idname__ = "DATA_PT_shadow"
+	__label__ = "Shadow"
+	
+	def poll(self, context):
+		ob = context.active_object
+		lamp = context.main.lamps[0]
+		return (ob.type == 'LAMP' and lamp.type in ('LOCAL','SUN', 'SPOT', 'AREA'))
 
+	def draw(self, context):
+		lamp = context.main.lamps[0]
+		layout = self.layout
+
+		if not lamp:
+			return
+		
+		layout.row()
+		layout.itemR(lamp, "shadow_method", expand=True)
+		
+		layout.row()
+		layout.itemR(lamp, "only_shadow")
+		layout.itemR(lamp, "shadow_layer", text="Layer")
+		if (lamp.shadow_method == 'RAY_SHADOW'):
+			if (lamp.type in ('LOCAL', 'SUN', 'SPOT', 'AREA')):
+
+				layout.split(number=2)
+
+				sub = layout.sub(0)
+				sub.column()
+				sub.itemL(text="Display:")
+				sub.itemR(lamp, "shadow_color")
+		
+				sub = layout.sub(1)
+				sub.column()
+				sub.itemL(text="Sampling:")
+				sub.itemR(lamp, "shadow_ray_sampling_method", text="")
+				
+				if (lamp.type in ('LOCAL', 'SUN', 'SPOT') and lamp.shadow_ray_sampling_method in ('CONSTANT_QMC', 'ADAPTIVE_QMC')):
+					sub.itemR(lamp, "shadow_soft_size", text="Soft Size")
+					sub.itemR(lamp, "shadow_ray_samples", text="Samples")
+					if (lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC'):
+						sub.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
+						
+				if (lamp.type == 'AREA'):
+					sub.itemR(lamp, "shadow_ray_samples_x", text="Samples")
+					if (lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC'):
+						sub.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
+					if (lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED'):
+						sub.itemR(lamp, "umbra")
+						sub.itemR(lamp, "dither")
+						sub.itemR(lamp, "jitter")
+						
+class DATA_PT_spot(DataButtonsPanel):
+	__idname__ = "DATA_PT_spot"
+	__label__ = "Spot"
+	
+	def poll(self, context):
+		ob = context.active_object
+		lamp = context.main.lamps[0]
+		return (ob.type == 'LAMP' and lamp.type == 'SPOT')
+
+	def draw(self, context):
+		lamp = context.main.lamps[0]
+		layout = self.layout
+
+		if not lamp:
+			return
+		
+		layout.split(number=2)
+		
+		sub = layout.sub(0)
+		sub.column()
+		sub.itemR(lamp, "square")
+		sub.itemR(lamp, "halo")
+		
+		sub = layout.sub(1)
+		sub.column()
+		sub.itemR(lamp, "spot_size")
+		sub.itemR(lamp, "spot_blend")
+		sub.itemR(lamp, "halo_intensity")
+
 bpy.types.register(DATA_PT_lamp)
 bpy.types.register(DATA_PT_sunsky)
+bpy.types.register(DATA_PT_shadow)
+bpy.types.register(DATA_PT_spot)

Added: branches/blender2.5/blender/release/ui/buttons_data_lattice.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_lattice.py	                        (rev 0)
+++ branches/blender2.5/blender/release/ui/buttons_data_lattice.py	2009-05-08 21:52:57 UTC (rev 20112)
@@ -0,0 +1,40 @@
+
+import bpy
+
+class DataButtonsPanel(bpy.types.Panel):
+	__space_type__ = "BUTTONS_WINDOW"
+	__region_type__ = "WINDOW"
+	__context__ = "data"
+	
+	def poll(self, context):
+		ob = context.active_object
+		return (ob and ob.type == 'LATTICE')
+	
+class DATA_PT_lattice(DataButtonsPanel):
+	__idname__ = "DATA_PT_lattice"
+	__label__ = "Lattice"
+
+	def draw(self, context):
+		lat = context.main.lattices[0]
+		layout = self.layout
+
+		if not lat:
+			return
+		
+		layout.row()
+		layout.itemR(lat, "points_u")
+		layout.itemR(lat, "interpolation_type_u", expand=True)
+		
+		layout.row()
+		layout.itemR(lat, "points_v")
+		layout.itemR(lat, "interpolation_type_v", expand=True)
+		
+		layout.row()
+		layout.itemR(lat, "points_w")
+		layout.itemR(lat, "interpolation_type_w", expand=True)
+		
+		layout.row()
+		layout.itemR(lat, "outside")
+		layout.itemR(lat, "shape_keys")
+
+bpy.types.register(DATA_PT_lattice)
\ No newline at end of file





More information about the Bf-blender-cvs mailing list