[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22502] branches/volume25: volume material

Matt Ebb matt at mke3.net
Sun Aug 16 08:10:31 CEST 2009


Revision: 22502
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22502
Author:   broken
Date:     2009-08-16 08:10:31 +0200 (Sun, 16 Aug 2009)

Log Message:
-----------
volume material

* data reorganisation - uses own values now instead of reusing surface material properties (i.e. an individual density value, rather than reusing alpha) Files saved with the old system won't load up the same after this.

* improved defaults and ui

Modified Paths:
--------------
    branches/volume25/release/ui/buttons_material.py
    branches/volume25/release/ui/buttons_texture.py
    branches/volume25/source/blender/blenkernel/intern/material.c
    branches/volume25/source/blender/blenkernel/intern/texture.c
    branches/volume25/source/blender/blenloader/intern/readfile.c
    branches/volume25/source/blender/makesdna/DNA_material_types.h
    branches/volume25/source/blender/makesrna/intern/rna_material.c
    branches/volume25/source/blender/makesrna/intern/rna_texture.c
    branches/volume25/source/blender/render/intern/source/texture.c
    branches/volume25/source/blender/render/intern/source/volumetric.c

Modified: branches/volume25/release/ui/buttons_material.py
===================================================================
--- branches/volume25/release/ui/buttons_material.py	2009-08-16 05:48:07 UTC (rev 22501)
+++ branches/volume25/release/ui/buttons_material.py	2009-08-16 06:10:31 UTC (rev 22502)
@@ -107,7 +107,7 @@
 	COMPAT_ENGINES = set(['BLENDER_RENDER'])
 	
 	def poll(self, context):
-		return context.material.type in ['SURFACE', 'WIRE', 'HALO']
+		return context.material.type in ('SURFACE', 'WIRE', 'HALO')
 	
 	def draw(self, context):
 		layout = self.layout
@@ -165,7 +165,7 @@
 	COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
 
 	def poll(self, context):
-		return (context.material.type in ['SURFACE', 'WIRE', 'HALO'])
+		return (context.material.type in ('SURFACE', 'WIRE', 'HALO'))
 
 	def draw(self, context):
 		layout = self.layout
@@ -202,7 +202,7 @@
 	COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
 	
 	def poll(self, context):
-		return context.material.type in ['SURFACE', 'WIRE']
+		return context.material.type in ('SURFACE', 'WIRE')
 
 	def draw(self, context):
 		layout = self.layout
@@ -235,7 +235,7 @@
 
 	def poll(self, context):
 		mat = context.material
-		return mat and (mat.type in ['SURFACE', 'WIRE']) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
+		return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
 
 	def draw(self, context):
 		layout = self.layout
@@ -289,7 +289,7 @@
 
 	def poll(self, context):
 		mat = context.material
-		return mat and (mat.type in ['SURFACE', 'WIRE']) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
+		return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
 
 	def draw(self, context):
 		layout = self.layout
@@ -341,7 +341,7 @@
 	
 	def poll(self, context):
 		mat = context.material
-		return mat and (mat.type in ['SURFACE', 'WIRE']) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
+		return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
 
 	def draw_header(self, context):
 		layout = self.layout
@@ -383,7 +383,7 @@
 	
 	def poll(self, context):
 		mat = context.material
-		return mat and (mat.type in ['SURFACE', 'WIRE']) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
+		return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
 	
 	def draw_header(self, context):
 		layout = self.layout
@@ -435,7 +435,7 @@
 		
 	def poll(self, context):
 		mat = context.material
-		return mat and (mat.type in ['SURFACE', 'WIRE']) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
+		return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
 
 	def draw_header(self, context):
 		layout = self.layout
@@ -481,8 +481,8 @@
 		sub.itemR(rayt, "gloss_threshold", slider=True, text="Threshold")
 		sub.itemR(rayt, "gloss_samples", text="Samples")
 
-class MATERIAL_PT_volume(MaterialButtonsPanel):
-	__label__ = "Volume"
+class MATERIAL_PT_volume_shading(MaterialButtonsPanel):
+	__label__ = "Shading"
 	__default_closed__ = False
 	COMPAT_ENGINES = set(['BLENDER_RENDER'])
 	
@@ -497,41 +497,88 @@
 		
 		split = layout.split()
 		
+		row = split.row()
+		row.itemR(vol, "density")
+		row.itemR(vol, "scattering")
+		
+		split = layout.split()
 		col = split.column()
-		col.itemR(vol, "step_calculation")
-		col.itemR(vol, "step_size")
-		col.itemR(vol, "shading_step_size")
+		col.itemR(vol, "absorption")
+		col.itemR(vol, "absorption_color", text="")
 		
-		col.itemR(mat, "alpha", text="Density", slider=True)
+				
+		col = split.column()
+		col.itemR(vol, "emission")
+		col.itemR(vol, "emission_color", text="")
 		
-		col.itemR(vol, "scattering_mode")
-		if vol.scattering_mode == 'SINGLE':
+		
+
+class MATERIAL_PT_volume_scattering(MaterialButtonsPanel):
+	__label__ = "Scattering"
+	__default_closed__ = False
+	COMPAT_ENGINES = set(['BLENDER_RENDER'])
+	
+	def poll(self, context):
+		return (context.material.type == 'VOLUME') and (context.scene.render_data.engine in self.COMPAT_ENGINES)
+	
+	def draw(self, context):
+		layout = self.layout
+		
+		mat = context.material
+		vol = context.material.volume
+		
+		split = layout.split()
+		
+		col = split.column()
+		col.itemR(vol, "scattering_mode", text="")
+		if vol.scattering_mode == 'SINGLE_SCATTERING':
 			col.itemR(vol, "light_cache")
 			sub = col.column()
 			sub.active = vol.light_cache
+			sub.itemR(vol, "cache_resolution")
+		elif vol.scattering_mode in ('MULTIPLE_SCATTERING', 'SINGLE_PLUS_MULTIPLE_SCATTERING'):
 			col.itemR(vol, "cache_resolution")
-		elif vol.scattering_mode in ['MULTIPLE', 'SINGLE_PLUS_MULTIPLE']:
-			col.itemR(vol, "cache_resolution")
+			
+			col = col.column(align=True)
 			col.itemR(vol, "ms_diffusion")
 			col.itemR(vol, "ms_spread")
 			col.itemR(vol, "ms_intensity")
-			
-		col.itemR(vol, "density_scale")
-		col.itemR(vol, "depth_cutoff")
 		
 		col = split.column()
-		col.itemR(vol, "absorption")
-		col.itemR(vol, "absorption_color")
-		col.itemR(vol, "scattering")
+		# col.itemL(text="Anisotropic Scattering:")
+		col.itemR(vol, "phase_function", text="")
+		if vol.phase_function in ('SCHLICK', 'HENYEY-GREENSTEIN'):
+			col.itemR(vol, "asymmetry")
 		
-		col.itemR(mat, "emit")
-		col.itemR(mat, "diffuse_color")
+class MATERIAL_PT_volume_integration(MaterialButtonsPanel):
+	__label__ = "Integration"
+	__default_closed__ = False
+	COMPAT_ENGINES = set(['BLENDER_RENDER'])
+	
+	def poll(self, context):
+		return (context.material.type == 'VOLUME') and (context.scene.render_data.engine in self.COMPAT_ENGINES)
+	
+	def draw(self, context):
+		layout = self.layout
 		
-		col.itemR(vol, "phase_function")
-		col.itemR(vol, "asymmetry")
+		mat = context.material
+		vol = context.material.volume
 		
-
-
+		split = layout.split()
+		
+		col = split.column()
+		col.itemL(text="Step Calculation:")
+		col.itemR(vol, "step_calculation", text="")
+		col = col.column(align=True)
+		col.itemR(vol, "step_size")
+		col.itemR(vol, "shading_step_size")
+		
+		col = split.column()
+		col.itemL()
+		col.itemR(vol, "depth_cutoff")
+		col.itemR(vol, "density_scale")
+		
+		
 class MATERIAL_PT_halo(MaterialButtonsPanel):
 	__label__= "Halo"
 	COMPAT_ENGINES = set(['BLENDER_RENDER'])
@@ -592,7 +639,9 @@
 bpy.types.register(MATERIAL_PT_raymir)
 bpy.types.register(MATERIAL_PT_raytransp)
 bpy.types.register(MATERIAL_PT_sss)
-bpy.types.register(MATERIAL_PT_volume)
+bpy.types.register(MATERIAL_PT_volume_shading)
+bpy.types.register(MATERIAL_PT_volume_scattering)
+bpy.types.register(MATERIAL_PT_volume_integration)
 bpy.types.register(MATERIAL_PT_halo)
 bpy.types.register(MATERIAL_PT_physics)
 bpy.types.register(MATERIAL_PT_strand)

Modified: branches/volume25/release/ui/buttons_texture.py
===================================================================
--- branches/volume25/release/ui/buttons_texture.py	2009-08-16 05:48:07 UTC (rev 22501)
+++ branches/volume25/release/ui/buttons_texture.py	2009-08-16 06:10:31 UTC (rev 22502)
@@ -176,35 +176,51 @@
 			sub.itemR(tex, factor, text=name, slider=True)
 		
 		if ma:
-			split = layout.split()
-			
-			col = split.column()
-			col.itemL(text="Diffuse:")
-			factor_but(col, tex.map_diffuse, "map_diffuse", "diffuse_factor", "Intensity")
-			factor_but(col, tex.map_colordiff, "map_colordiff", "colordiff_factor", "Color")
-			factor_but(col, tex.map_alpha, "map_alpha", "alpha_factor", "Alpha")
-			factor_but(col, tex.map_translucency, "map_translucency", "translucency_factor", "Translucency")
+			if ma.type in ['SURFACE', 'HALO', 'WIRE']:
+				split = layout.split()
+				
+				col = split.column()
+				col.itemL(text="Diffuse:")
+				factor_but(col, tex.map_diffuse, "map_diffuse", "diffuse_factor", "Intensity")
+				factor_but(col, tex.map_colordiff, "map_colordiff", "colordiff_factor", "Color")
+				factor_but(col, tex.map_alpha, "map_alpha", "alpha_factor", "Alpha")
+				factor_but(col, tex.map_translucency, "map_translucency", "translucency_factor", "Translucency")
 
-			col.itemL(text="Specular:")
-			factor_but(col, tex.map_specular, "map_specular", "specular_factor", "Intensity")
-			factor_but(col, tex.map_colorspec, "map_colorspec", "colorspec_factor", "Color")
-			factor_but(col, tex.map_hardness, "map_hardness", "hardness_factor", "Hardness")
+				col.itemL(text="Specular:")
+				factor_but(col, tex.map_specular, "map_specular", "specular_factor", "Intensity")
+				factor_but(col, tex.map_colorspec, "map_colorspec", "colorspec_factor", "Color")
+				factor_but(col, tex.map_hardness, "map_hardness", "hardness_factor", "Hardness")
 
-			col = split.column()
-			col.itemL(text="Shading:")
-			factor_but(col, tex.map_ambient, "map_ambient", "ambient_factor", "Ambient")
-			factor_but(col, tex.map_emit, "map_emit", "emit_factor", "Emit")
-			factor_but(col, tex.map_mirror, "map_mirror", "mirror_factor", "Mirror")
-			factor_but(col, tex.map_raymir, "map_raymir", "raymir_factor", "Ray Mirror")
+				col = split.column()
+				col.itemL(text="Shading:")
+				factor_but(col, tex.map_ambient, "map_ambient", "ambient_factor", "Ambient")
+				factor_but(col, tex.map_emit, "map_emit", "emit_factor", "Emit")
+				factor_but(col, tex.map_mirror, "map_mirror", "mirror_factor", "Mirror")
+				factor_but(col, tex.map_raymir, "map_raymir", "raymir_factor", "Ray Mirror")
 
-			col.itemL(text="Geometry:")
-			factor_but(col, tex.map_normal, "map_normal", "normal_factor", "Normal")
-			factor_but(col, tex.map_warp, "map_warp", "warp_factor", "Warp")
-			factor_but(col, tex.map_displacement, "map_displacement", "displacement_factor", "Displace")
+				col.itemL(text="Geometry:")
+				factor_but(col, tex.map_normal, "map_normal", "normal_factor", "Normal")
+				factor_but(col, tex.map_warp, "map_warp", "warp_factor", "Warp")
+				factor_but(col, tex.map_displacement, "map_displacement", "displacement_factor", "Displace")
 
-			#sub = col.column()
-			#sub.active = tex.map_translucency or tex.map_emit or tex.map_alpha or tex.map_raymir or tex.map_hardness or tex.map_ambient or tex.map_specularity or tex.map_reflection or tex.map_mirror
-			#sub.itemR(tex, "default_value", text="Amount", slider=True)
+				#sub = col.column()

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list