* Fixed some poll checks, they showed empty panels when there was no active material.
* Some minor code/whitespace cleanup.
# An exception, dont call the parent poll func because
# this manages materials for all engine types
# An exception, dont call the parent poll func because
# this manages materials for all engine types
- return (context.object) and (context.scene.render_data.engine in self.COMPAT_ENGINES)
+ engine = context.scene.render_data.engine
+ return (context.object) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
def draw(self, context):
layout = self.layout
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def poll(self, context):
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def poll(self, context):
- return (context.material.type in ('SURFACE', 'WIRE', 'HALO'))
+ mat = context.material
+ engine = context.scene.render_data.engine
+ return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
def draw(self, context):
layout = self.layout
def poll(self, context):
mat = context.material
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)
-
- def poll(self, context):
- return context.material.type in ('SURFACE', 'WIRE', 'HALO')
+ engine = context.scene.render_data.engine
+ return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
def draw(self, context):
layout = self.layout
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def poll(self, context):
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def poll(self, context):
- return (context.material.type in ('SURFACE', 'WIRE', 'HALO'))
+ mat = context.material
+ engine = context.scene.render_data.engine
+ return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
def draw(self, context):
layout = self.layout
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def poll(self, context):
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def poll(self, context):
- return context.material.type in ('SURFACE', 'WIRE')
+ mat = context.material
+ engine = context.scene.render_data.engine
+ return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
def draw(self, context):
layout = self.layout
sub = col.column()
sub.active = (not mat.ray_shadow_bias)
sub.itemR(mat, "shadow_ray_bias", text="Ray Bias")
sub = col.column()
sub.active = (not mat.ray_shadow_bias)
sub.itemR(mat, "shadow_ray_bias", text="Ray Bias")
class MATERIAL_PT_diffuse(MaterialButtonsPanel):
__label__ = "Diffuse"
class MATERIAL_PT_diffuse(MaterialButtonsPanel):
__label__ = "Diffuse"
def poll(self, context):
mat = context.material
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)
+ engine = context.scene.render_data.engine
+ return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
def draw(self, context):
layout = self.layout
split = row.split(percentage=0.3)
split.itemL(text="Blend:")
split.itemR(mat, "diffuse_ramp_blend", text="")
split = row.split(percentage=0.3)
split.itemL(text="Blend:")
split.itemR(mat, "diffuse_ramp_blend", text="")
class MATERIAL_PT_specular(MaterialButtonsPanel):
__label__ = "Specular"
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def poll(self, context):
mat = context.material
class MATERIAL_PT_specular(MaterialButtonsPanel):
__label__ = "Specular"
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
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)
+ engine = context.scene.render_data.engine
+ return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
def draw(self, context):
layout = self.layout
def poll(self, context):
mat = context.material
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)
+ engine = context.scene.render_data.engine
+ return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw_header(self, context):
layout = self.layout
def draw_header(self, context):
layout = self.layout
def poll(self, context):
mat = context.material
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)
+ engine = context.scene.render_data.engine
+ return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw_header(self, context):
layout = self.layout
def draw_header(self, context):
layout = self.layout
col = split.column()
col.itemR(raym, "reflect", text="Reflectivity")
col.itemR(mat, "mirror_color", text="")
col = split.column()
col.itemR(raym, "reflect", text="Reflectivity")
col.itemR(mat, "mirror_color", text="")
col = split.column()
col.itemR(raym, "fresnel")
sub = col.column()
col = split.column()
col.itemR(raym, "fresnel")
sub = col.column()
sub.itemR(raym, "gloss_threshold", text="Threshold")
sub.itemR(raym, "gloss_samples", text="Samples")
sub.itemR(raym, "gloss_anisotropic", text="Anisotropic")
sub.itemR(raym, "gloss_threshold", text="Threshold")
sub.itemR(raym, "gloss_samples", text="Samples")
sub.itemR(raym, "gloss_anisotropic", text="Anisotropic")
class MATERIAL_PT_transp(MaterialButtonsPanel):
__label__= "Transparency"
__default_closed__ = True
class MATERIAL_PT_transp(MaterialButtonsPanel):
__label__= "Transparency"
__default_closed__ = True
def poll(self, context):
mat = context.material
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)
+ engine = context.scene.render_data.engine
+ return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw_header(self, context):
layout = self.layout
def draw_header(self, context):
layout = self.layout
row = col.row()
row.active = mat.transparency and (not mat.shadeless)
row.itemR(mat, "specular_alpha", text="Specular")
row = col.row()
row.active = mat.transparency and (not mat.shadeless)
row.itemR(mat, "specular_alpha", text="Specular")
col = split.column()
col.active = (not mat.shadeless)
col.itemR(rayt, "fresnel")
col = split.column()
col.active = (not mat.shadeless)
col.itemR(rayt, "fresnel")
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
- return (context.material.type == 'VOLUME') and (context.scene.render_data.engine in self.COMPAT_ENGINES)
+ mat = context.material
+ engine = context.scene.render_data.engine
+ return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
def draw(self, context):
layout = self.layout
col = split.column()
col.itemR(vol, "absorption")
col.itemR(vol, "absorption_color", text="")
col = split.column()
col.itemR(vol, "absorption")
col.itemR(vol, "absorption_color", text="")
col = split.column()
col.itemR(vol, "emission")
col.itemR(vol, "emission_color", text="")
col = split.column()
col.itemR(vol, "emission")
col.itemR(vol, "emission_color", text="")
class MATERIAL_PT_volume_scattering(MaterialButtonsPanel):
__label__ = "Scattering"
class MATERIAL_PT_volume_scattering(MaterialButtonsPanel):
__label__ = "Scattering"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
- return (context.material.type == 'VOLUME') and (context.scene.render_data.engine in self.COMPAT_ENGINES)
+ mat = context.material
+ engine = context.scene.render_data.engine
+ return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
def draw(self, context):
layout = self.layout
def poll(self, context):
mat = context.material
def poll(self, context):
mat = context.material
- return mat and (mat.type == 'VOLUME') and (context.scene.render_data.engine in self.COMPAT_ENGINES)
+ engine = context.scene.render_data.engine
+ return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES)
def draw_header(self, context):
layout = self.layout
def draw_header(self, context):
layout = self.layout
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
- return (context.material.type == 'VOLUME') and (context.scene.render_data.engine in self.COMPAT_ENGINES)
+ mat = context.material
+ engine = context.scene.render_data.engine
+ return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
def draw(self, context):
layout = self.layout
def poll(self, context):
mat = context.material
def poll(self, context):
mat = context.material
- return mat and (mat.type == 'HALO') and (context.scene.render_data.engine in self.COMPAT_ENGINES)
+ engine = context.scene.render_data.engine
+ return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
def draw(self, context):
layout = self.layout
def poll(self, context):
mat = context.material
def poll(self, context):
mat = context.material
- return mat and (mat.type == 'HALO') and (context.scene.render_data.engine in self.COMPAT_ENGINES)
+ engine = context.scene.render_data.engine
+ return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES)
def draw_header(self, context):
layout = self.layout
def draw_header(self, context):
layout = self.layout
bpy.types.register(MATERIAL_PT_strand)
bpy.types.register(MATERIAL_PT_options)
bpy.types.register(MATERIAL_PT_shadow)
bpy.types.register(MATERIAL_PT_strand)
bpy.types.register(MATERIAL_PT_options)
bpy.types.register(MATERIAL_PT_shadow)