Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_material.py
| Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | class MATERIAL_PT_preview(MaterialButtonsPanel, Panel): | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_EEVEE'} | COMPAT_ENGINES = {'BLENDER_EEVEE'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| self.layout.template_preview(context.material) | self.layout.template_preview(context.material) | ||||
| class MATERIAL_PT_custom_props(MaterialButtonsPanel, PropertyPanel, Panel): | class MATERIAL_PT_custom_props(MaterialButtonsPanel, PropertyPanel, Panel): | ||||
| COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_OPENGL'} | COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_OPENGL', 'BLENDER_LANPR'} | ||||
| _context_path = "material" | _context_path = "material" | ||||
| _property_type = bpy.types.Material | _property_type = bpy.types.Material | ||||
| class EEVEE_MATERIAL_PT_context_material(MaterialButtonsPanel, Panel): | class EEVEE_MATERIAL_PT_context_material(MaterialButtonsPanel, Panel): | ||||
| bl_label = "" | bl_label = "" | ||||
| bl_context = "material" | bl_context = "material" | ||||
| bl_options = {'HIDE_HEADER'} | bl_options = {'HIDE_HEADER'} | ||||
| COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_OPENGL'} | COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_OPENGL', 'BLENDER_LANPR'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| if context.active_object and context.active_object.type == 'GPENCIL': | if context.active_object and context.active_object.type == 'GPENCIL': | ||||
| return False | return False | ||||
| else: | else: | ||||
| engine = context.engine | engine = context.engine | ||||
| return (context.material or context.object) and (engine in cls.COMPAT_ENGINES) | return (context.material or context.object) and (engine in cls.COMPAT_ENGINES) | ||||
| ▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | if node: | ||||
| layout.label(text="Incompatible output node") | layout.label(text="Incompatible output node") | ||||
| else: | else: | ||||
| layout.label(text="No output node") | layout.label(text="No output node") | ||||
| class EEVEE_MATERIAL_PT_surface(MaterialButtonsPanel, Panel): | class EEVEE_MATERIAL_PT_surface(MaterialButtonsPanel, Panel): | ||||
| bl_label = "Surface" | bl_label = "Surface" | ||||
| bl_context = "material" | bl_context = "material" | ||||
| COMPAT_ENGINES = {'BLENDER_EEVEE'} | COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_LANPR'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| engine = context.engine | engine = context.engine | ||||
| return context.material and (engine in cls.COMPAT_ENGINES) | return context.material and (engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| Show All 11 Lines | def draw(self, context): | ||||
| layout.prop(mat, "metallic") | layout.prop(mat, "metallic") | ||||
| layout.prop(mat, "specular_intensity", text="Specular") | layout.prop(mat, "specular_intensity", text="Specular") | ||||
| layout.prop(mat, "roughness") | layout.prop(mat, "roughness") | ||||
| class EEVEE_MATERIAL_PT_options(MaterialButtonsPanel, Panel): | class EEVEE_MATERIAL_PT_options(MaterialButtonsPanel, Panel): | ||||
| bl_label = "Options" | bl_label = "Options" | ||||
| bl_context = "material" | bl_context = "material" | ||||
| COMPAT_ENGINES = {'BLENDER_EEVEE'} | COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_LANPR'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| engine = context.engine | engine = context.engine | ||||
| return context.material and (engine in cls.COMPAT_ENGINES) | return context.material and (engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| ▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines | |||||