diff options
Diffstat (limited to 'release/scripts/ui/properties_material.py')
-rw-r--r-- | release/scripts/ui/properties_material.py | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/release/scripts/ui/properties_material.py b/release/scripts/ui/properties_material.py index aee3aeeaeae..a8fe05ca110 100644 --- a/release/scripts/ui/properties_material.py +++ b/release/scripts/ui/properties_material.py @@ -161,13 +161,13 @@ class MATERIAL_PT_pipeline(MaterialButtonsPanel, bpy.types.Panel): def poll(cls, context): mat = context.material engine = context.scene.render.engine - return mat and (not simple_material(mat)) and (mat.type in ('SURFACE', 'WIRE', 'VOLUME')) and (engine in cls.COMPAT_ENGINES) + return mat and (not simple_material(mat)) and (mat.type in {'SURFACE', 'WIRE', 'VOLUME'}) and (engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self. layout mat = context.material - mat_type = mat.type in ('SURFACE', 'WIRE') + mat_type = mat.type in {'SURFACE', 'WIRE'} row = layout.row() row.active = mat_type @@ -209,7 +209,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel, bpy.types.Panel): def poll(cls, context): mat = context.material engine = context.scene.render.engine - return check_material(mat) and (mat.type in ('SURFACE', 'WIRE')) and (engine in cls.COMPAT_ENGINES) + return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -264,7 +264,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel, bpy.types.Panel): def poll(cls, context): mat = context.material engine = context.scene.render.engine - return check_material(mat) and (mat.type in ('SURFACE', 'WIRE')) and (engine in cls.COMPAT_ENGINES) + return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -284,7 +284,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel, bpy.types.Panel): col.prop(mat, "use_specular_ramp", text="Ramp") col = layout.column() - if mat.specular_shader in ('COOKTORR', 'PHONG'): + if mat.specular_shader in {'COOKTORR', 'PHONG'}: col.prop(mat, "specular_hardness", text="Hardness") elif mat.specular_shader == 'BLINN': row = col.row() @@ -317,14 +317,14 @@ class MATERIAL_PT_shading(MaterialButtonsPanel, bpy.types.Panel): def poll(cls, context): mat = context.material engine = context.scene.render.engine - return check_material(mat) and (mat.type in ('SURFACE', 'WIRE')) and (engine in cls.COMPAT_ENGINES) + return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout mat = active_node_mat(context.material) - if mat.type in ('SURFACE', 'WIRE'): + if mat.type in {'SURFACE', 'WIRE'}: split = layout.split() col = split.column() @@ -352,7 +352,7 @@ class MATERIAL_PT_transp(MaterialButtonsPanel, bpy.types.Panel): def poll(cls, context): mat = context.material engine = context.scene.render.engine - return check_material(mat) and (mat.type in ('SURFACE', 'WIRE')) and (engine in cls.COMPAT_ENGINES) + return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES) def draw_header(self, context): mat = context.material @@ -373,11 +373,12 @@ class MATERIAL_PT_transp(MaterialButtonsPanel, bpy.types.Panel): row.prop(mat, "transparency_method", expand=True) split = layout.split() + split.active = base_mat.use_transparency col = split.column() col.prop(mat, "alpha") row = col.row() - row.active = base_mat.use_transparency and (not mat.use_shadeless) + row.active = (base_mat.transparency_method != 'MASK') and (not mat.use_shadeless) row.prop(mat, "specular_alpha", text="Specular") col = split.column() @@ -417,7 +418,7 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel, bpy.types.Panel): def poll(cls, context): mat = context.material engine = context.scene.render.engine - return check_material(mat) and (mat.type in ('SURFACE', 'WIRE')) and (engine in cls.COMPAT_ENGINES) + return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES) def draw_header(self, context): raym = active_node_mat(context.material).raytrace_mirror @@ -475,7 +476,7 @@ class MATERIAL_PT_sss(MaterialButtonsPanel, bpy.types.Panel): def poll(cls, context): mat = context.material engine = context.scene.render.engine - return check_material(mat) and (mat.type in ('SURFACE', 'WIRE')) and (engine in cls.COMPAT_ENGINES) + return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES) def draw_header(self, context): mat = active_node_mat(context.material) @@ -645,7 +646,7 @@ class MATERIAL_PT_strand(MaterialButtonsPanel, bpy.types.Panel): def poll(cls, context): mat = context.material engine = context.scene.render.engine - return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in cls.COMPAT_ENGINES) + return mat and (mat.type in {'SURFACE', 'WIRE', 'HALO'}) and (engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -691,7 +692,7 @@ class MATERIAL_PT_options(MaterialButtonsPanel, bpy.types.Panel): def poll(cls, context): mat = context.material engine = context.scene.render.engine - return check_material(mat) and (mat.type in ('SURFACE', 'WIRE')) and (engine in cls.COMPAT_ENGINES) + return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -739,7 +740,7 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel, bpy.types.Panel): def poll(cls, context): mat = context.material engine = context.scene.render.engine - return check_material(mat) and (mat.type in ('SURFACE', 'WIRE')) and (engine in cls.COMPAT_ENGINES) + return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -752,10 +753,13 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel, bpy.types.Panel): col = split.column() col.prop(mat, "use_shadows", text="Receive") col.prop(mat, "use_transparent_shadows", text="Receive Transparent") - col.prop(mat, "use_only_shadow", text="Shadows Only") if simple_material(base_mat): col.prop(mat, "use_cast_shadows_only", text="Cast Only") col.prop(mat, "shadow_cast_alpha", text="Casting Alpha") + col.prop(mat, "use_only_shadow", text="ShadowsOnly") + sub = col.column() + sub.active = mat.use_only_shadow + sub.prop(mat, "shadow_only_type", text="") col = split.column() if simple_material(base_mat): @@ -771,6 +775,7 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel, bpy.types.Panel): col.prop(mat, "use_cast_approximate") + class MATERIAL_PT_transp_game(MaterialButtonsPanel, bpy.types.Panel): bl_label = "Transparency" bl_options = {'DEFAULT_CLOSED'} @@ -875,7 +880,7 @@ class MATERIAL_PT_volume_lighting(VolumeButtonsPanel, bpy.types.Panel): sub = col.column() sub.active = vol.use_light_cache sub.prop(vol, "cache_resolution") - elif vol.light_method in ('MULTIPLE_SCATTERING', 'SHADED_PLUS_MULTIPLE_SCATTERING'): + elif vol.light_method in {'MULTIPLE_SCATTERING', 'SHADED_PLUS_MULTIPLE_SCATTERING'}: sub = col.column() sub.enabled = True sub.active = False |