diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index da41f9c6bef..59fa52525ad 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -28,7 +28,6 @@ class NODE_HT_header(Header): layout = self.layout scene = context.scene - ob = context.object snode = context.space_data snode_id = snode.id id_from = snode.id_from @@ -49,21 +48,26 @@ class NODE_HT_header(Header): if scene.render.use_shading_nodes: layout.prop(snode, "shader_type", text="", expand=True) + ob = context.object if (not scene.render.use_shading_nodes or snode.shader_type == 'OBJECT') and ob: + row = layout.row() + # disable material slot buttons when pinned, cannot find correct slot within id_from (#36589) + row.enabled = not snode.pin # Show material.new when no active ID/slot exists if not id_from and ob.type in {'MESH', 'CURVE', 'SURFACE', 'FONT', 'METABALL'}: - layout.template_ID(ob, "active_material", new="material.new") + row.template_ID(ob, "active_material", new="material.new") # Material ID, but not for Lamps if id_from and ob.type != 'LAMP': - layout.template_ID(id_from, "active_material", new="material.new") + row.template_ID(id_from, "active_material", new="material.new") + # Don't show "Use Nodes" Button when Engine is BI for Lamps if snode_id and not (scene.render.use_shading_nodes == 0 and ob.type == 'LAMP'): layout.prop(snode_id, "use_nodes") if snode.shader_type == 'WORLD': - layout.template_ID(scene, "world", new="world.new") + row.template_ID(scene, "world", new="world.new") if snode_id: - layout.prop(snode_id, "use_nodes") + row.prop(snode_id, "use_nodes") elif snode.tree_type == 'TextureNodeTree': layout.prop(snode, "texture_type", text="", expand=True)