Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_material.py
| Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | |||||
| class MaterialButtonsPanel: | class MaterialButtonsPanel: | ||||
| bl_space_type = 'PROPERTIES' | bl_space_type = 'PROPERTIES' | ||||
| bl_region_type = 'WINDOW' | bl_region_type = 'WINDOW' | ||||
| bl_context = "material" | bl_context = "material" | ||||
| # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here | # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| return context.material and (context.scene.render.engine in cls.COMPAT_ENGINES) | return context.material and (context.engine in cls.COMPAT_ENGINES) | ||||
| class MATERIAL_PT_context_material(MaterialButtonsPanel, Panel): | class MATERIAL_PT_context_material(MaterialButtonsPanel, Panel): | ||||
| bl_label = "" | bl_label = "" | ||||
| bl_options = {'HIDE_HEADER'} | bl_options = {'HIDE_HEADER'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| # An exception, don't call the parent poll func because | # An exception, don't call the parent poll func because | ||||
| # this manages materials for all engine types | # this manages materials for all engine types | ||||
| engine = context.scene.render.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) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| mat = context.material | mat = context.material | ||||
| ob = context.object | ob = context.object | ||||
| slot = context.material_slot | slot = context.material_slot | ||||
| ▲ Show 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | |||||
| class MATERIAL_PT_pipeline(MaterialButtonsPanel, Panel): | class MATERIAL_PT_pipeline(MaterialButtonsPanel, Panel): | ||||
| bl_label = "Render Pipeline Options" | bl_label = "Render Pipeline Options" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| mat = context.material | mat = context.material | ||||
| engine = context.scene.render.engine | engine = context.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): | def draw(self, context): | ||||
| layout = self. layout | layout = self. layout | ||||
| mat = context.material | mat = context.material | ||||
| mat_type = mat.type in {'SURFACE', 'WIRE'} | mat_type = mat.type in {'SURFACE', 'WIRE'} | ||||
| Show All 36 Lines | |||||
| class MATERIAL_PT_diffuse(MaterialButtonsPanel, Panel): | class MATERIAL_PT_diffuse(MaterialButtonsPanel, Panel): | ||||
| bl_label = "Diffuse" | bl_label = "Diffuse" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| mat = context.material | mat = context.material | ||||
| engine = context.scene.render.engine | engine = context.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): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| mat = active_node_mat(context.material) | mat = active_node_mat(context.material) | ||||
| split = layout.split() | split = layout.split() | ||||
| Show All 40 Lines | |||||
| class MATERIAL_PT_specular(MaterialButtonsPanel, Panel): | class MATERIAL_PT_specular(MaterialButtonsPanel, Panel): | ||||
| bl_label = "Specular" | bl_label = "Specular" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| mat = context.material | mat = context.material | ||||
| engine = context.scene.render.engine | engine = context.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): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| mat = active_node_mat(context.material) | mat = active_node_mat(context.material) | ||||
| layout.active = (not mat.use_shadeless) | layout.active = (not mat.use_shadeless) | ||||
| Show All 36 Lines | |||||
| class MATERIAL_PT_shading(MaterialButtonsPanel, Panel): | class MATERIAL_PT_shading(MaterialButtonsPanel, Panel): | ||||
| bl_label = "Shading" | bl_label = "Shading" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| mat = context.material | mat = context.material | ||||
| engine = context.scene.render.engine | engine = context.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): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| mat = active_node_mat(context.material) | mat = active_node_mat(context.material) | ||||
| if mat.type in {'SURFACE', 'WIRE'}: | if mat.type in {'SURFACE', 'WIRE'}: | ||||
| Show All 17 Lines | |||||
| class MATERIAL_PT_transp(MaterialButtonsPanel, Panel): | class MATERIAL_PT_transp(MaterialButtonsPanel, Panel): | ||||
| bl_label = "Transparency" | bl_label = "Transparency" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER'} | COMPAT_ENGINES = {'BLENDER_RENDER'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| mat = context.material | mat = context.material | ||||
| engine = context.scene.render.engine | engine = context.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): | def draw_header(self, context): | ||||
| mat = context.material | mat = context.material | ||||
| if simple_material(mat): | if simple_material(mat): | ||||
| self.layout.prop(mat, "use_transparency", text="") | self.layout.prop(mat, "use_transparency", text="") | ||||
| ▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
| class MATERIAL_PT_mirror(MaterialButtonsPanel, Panel): | class MATERIAL_PT_mirror(MaterialButtonsPanel, Panel): | ||||
| bl_label = "Mirror" | bl_label = "Mirror" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER'} | COMPAT_ENGINES = {'BLENDER_RENDER'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| mat = context.material | mat = context.material | ||||
| engine = context.scene.render.engine | engine = context.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): | def draw_header(self, context): | ||||
| raym = active_node_mat(context.material).raytrace_mirror | raym = active_node_mat(context.material).raytrace_mirror | ||||
| self.layout.prop(raym, "use", text="") | self.layout.prop(raym, "use", text="") | ||||
| def draw(self, context): | def draw(self, context): | ||||
| ▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
| class MATERIAL_PT_sss(MaterialButtonsPanel, Panel): | class MATERIAL_PT_sss(MaterialButtonsPanel, Panel): | ||||
| bl_label = "Subsurface Scattering" | bl_label = "Subsurface Scattering" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER'} | COMPAT_ENGINES = {'BLENDER_RENDER'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| mat = context.material | mat = context.material | ||||
| engine = context.scene.render.engine | engine = context.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): | def draw_header(self, context): | ||||
| mat = active_node_mat(context.material) | mat = active_node_mat(context.material) | ||||
| sss = mat.subsurface_scattering | sss = mat.subsurface_scattering | ||||
| self.layout.active = (not mat.use_shadeless) | self.layout.active = (not mat.use_shadeless) | ||||
| self.layout.prop(sss, "use", text="") | self.layout.prop(sss, "use", text="") | ||||
| Show All 34 Lines | |||||
| class MATERIAL_PT_halo(MaterialButtonsPanel, Panel): | class MATERIAL_PT_halo(MaterialButtonsPanel, Panel): | ||||
| bl_label = "Halo" | bl_label = "Halo" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER'} | COMPAT_ENGINES = {'BLENDER_RENDER'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| mat = context.material | mat = context.material | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| return mat and (mat.type == 'HALO') and (engine in cls.COMPAT_ENGINES) | return mat and (mat.type == 'HALO') and (engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| mat = context.material # don't use node material | mat = context.material # don't use node material | ||||
| halo = mat.halo | halo = mat.halo | ||||
| Show All 36 Lines | |||||
| class MATERIAL_PT_flare(MaterialButtonsPanel, Panel): | class MATERIAL_PT_flare(MaterialButtonsPanel, Panel): | ||||
| bl_label = "Flare" | bl_label = "Flare" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER'} | COMPAT_ENGINES = {'BLENDER_RENDER'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| mat = context.material | mat = context.material | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| return mat and (mat.type == 'HALO') and (engine in cls.COMPAT_ENGINES) | return mat and (mat.type == 'HALO') and (engine in cls.COMPAT_ENGINES) | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| halo = context.material.halo | halo = context.material.halo | ||||
| self.layout.prop(halo, "use_flare_mode", text="") | self.layout.prop(halo, "use_flare_mode", text="") | ||||
| def draw(self, context): | def draw(self, context): | ||||
| Show All 17 Lines | |||||
| class MATERIAL_PT_game_settings(MaterialButtonsPanel, Panel): | class MATERIAL_PT_game_settings(MaterialButtonsPanel, Panel): | ||||
| bl_label = "Game Settings" | bl_label = "Game Settings" | ||||
| COMPAT_ENGINES = {'BLENDER_GAME'} | COMPAT_ENGINES = {'BLENDER_GAME'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| return context.material and (context.scene.render.engine in cls.COMPAT_ENGINES) | return context.material and (context.engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| game = context.material.game_settings # don't use node material | game = context.material.game_settings # don't use node material | ||||
| row = layout.row() | row = layout.row() | ||||
| row.prop(game, "use_backface_culling") | row.prop(game, "use_backface_culling") | ||||
| row.prop(game, "invisible") | row.prop(game, "invisible") | ||||
| Show All 12 Lines | class MATERIAL_PT_physics(MaterialButtonsPanel, Panel): | ||||
| COMPAT_ENGINES = {'BLENDER_GAME'} | COMPAT_ENGINES = {'BLENDER_GAME'} | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| game = context.material.game_settings | game = context.material.game_settings | ||||
| self.layout.prop(game, "physics", text="") | self.layout.prop(game, "physics", text="") | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| return context.material and (context.scene.render.engine in cls.COMPAT_ENGINES) | return context.material and (context.engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.active = context.material.game_settings.physics | layout.active = context.material.game_settings.physics | ||||
| phys = context.material.physics # don't use node material | phys = context.material.physics # don't use node material | ||||
| split = layout.split() | split = layout.split() | ||||
| Show All 16 Lines | |||||
| class MATERIAL_PT_strand(MaterialButtonsPanel, Panel): | class MATERIAL_PT_strand(MaterialButtonsPanel, Panel): | ||||
| bl_label = "Strand" | bl_label = "Strand" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER'} | COMPAT_ENGINES = {'BLENDER_RENDER'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| mat = context.material | mat = context.material | ||||
| engine = context.scene.render.engine | engine = context.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): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| mat = context.material # don't use node material | mat = context.material # don't use node material | ||||
| tan = mat.strand | tan = mat.strand | ||||
| Show All 29 Lines | |||||
| class MATERIAL_PT_options(MaterialButtonsPanel, Panel): | class MATERIAL_PT_options(MaterialButtonsPanel, Panel): | ||||
| bl_label = "Options" | bl_label = "Options" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| mat = context.material | mat = context.material | ||||
| engine = context.scene.render.engine | engine = context.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): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| base_mat = context.material | base_mat = context.material | ||||
| mat = active_node_mat(base_mat) | mat = active_node_mat(base_mat) | ||||
| Show All 33 Lines | |||||
| class MATERIAL_PT_shadow(MaterialButtonsPanel, Panel): | class MATERIAL_PT_shadow(MaterialButtonsPanel, Panel): | ||||
| bl_label = "Shadow" | bl_label = "Shadow" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| mat = context.material | mat = context.material | ||||
| engine = context.scene.render.engine | engine = context.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): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| base_mat = context.material | base_mat = context.material | ||||
| mat = active_node_mat(base_mat) | mat = active_node_mat(base_mat) | ||||
| Show All 33 Lines | |||||
| class MATERIAL_PT_transp_game(MaterialButtonsPanel, Panel): | class MATERIAL_PT_transp_game(MaterialButtonsPanel, Panel): | ||||
| bl_label = "Transparency" | bl_label = "Transparency" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_GAME'} | COMPAT_ENGINES = {'BLENDER_GAME'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| mat = context.material | mat = context.material | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| return check_material(mat) and (engine in cls.COMPAT_ENGINES) | return check_material(mat) and (engine in cls.COMPAT_ENGINES) | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| mat = context.material | mat = context.material | ||||
| if simple_material(mat): | if simple_material(mat): | ||||
| self.layout.prop(mat, "use_transparency", text="") | self.layout.prop(mat, "use_transparency", text="") | ||||
| Show All 16 Lines | class VolumeButtonsPanel: | ||||
| bl_space_type = 'PROPERTIES' | bl_space_type = 'PROPERTIES' | ||||
| bl_region_type = 'WINDOW' | bl_region_type = 'WINDOW' | ||||
| bl_context = "material" | bl_context = "material" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER'} | COMPAT_ENGINES = {'BLENDER_RENDER'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| mat = context.material | mat = context.material | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| return mat and (mat.type == 'VOLUME') and (engine in cls.COMPAT_ENGINES) | return mat and (mat.type == 'VOLUME') and (engine in cls.COMPAT_ENGINES) | ||||
| class MATERIAL_PT_volume_density(VolumeButtonsPanel, Panel): | class MATERIAL_PT_volume_density(VolumeButtonsPanel, Panel): | ||||
| bl_label = "Density" | bl_label = "Density" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER'} | COMPAT_ENGINES = {'BLENDER_RENDER'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| ▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | |||||
| class MATERIAL_PT_volume_transp(VolumeButtonsPanel, Panel): | class MATERIAL_PT_volume_transp(VolumeButtonsPanel, Panel): | ||||
| bl_label = "Transparency" | bl_label = "Transparency" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER'} | COMPAT_ENGINES = {'BLENDER_RENDER'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| mat = context.material | mat = context.material | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| return mat and simple_material(mat) and (mat.type == 'VOLUME') and (engine in cls.COMPAT_ENGINES) | return mat and simple_material(mat) and (mat.type == 'VOLUME') and (engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| mat = context.material # don't use node material | mat = context.material # don't use node material | ||||
| layout.row().prop(mat, "transparency_method", expand=True) | layout.row().prop(mat, "transparency_method", expand=True) | ||||
| Show All 24 Lines | |||||
| class MATERIAL_PT_volume_options(VolumeButtonsPanel, Panel): | class MATERIAL_PT_volume_options(VolumeButtonsPanel, Panel): | ||||
| bl_label = "Options" | bl_label = "Options" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| mat = context.material | mat = context.material | ||||
| engine = context.scene.render.engine | engine = context.engine | ||||
| return check_material(mat) and (mat.type == 'VOLUME') and (engine in cls.COMPAT_ENGINES) | return check_material(mat) and (mat.type == 'VOLUME') and (engine in cls.COMPAT_ENGINES) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| mat = active_node_mat(context.material) | mat = active_node_mat(context.material) | ||||
| split = layout.split() | split = layout.split() | ||||
| Show All 21 Lines | |||||
| 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'} | COMPAT_ENGINES = {'BLENDER_EEVEE'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| engine = context.scene.render.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) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| mat = context.material | mat = context.material | ||||
| ob = context.object | ob = context.object | ||||
| slot = context.material_slot | slot = context.material_slot | ||||
| ▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | |||||
| 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'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| engine = context.scene.render.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 | ||||
| mat = context.material | mat = context.material | ||||
| layout.prop(mat, "use_nodes", icon='NODETREE') | layout.prop(mat, "use_nodes", icon='NODETREE') | ||||
| Show All 11 Lines | |||||
| 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'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| engine = context.scene.render.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 | ||||
| mat = context.material | mat = context.material | ||||
| layout.prop(mat, "blend_method") | layout.prop(mat, "blend_method") | ||||
| ▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines | |||||