diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index 979227da0bd..b1238e7d327 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -464,9 +464,24 @@ extern "C" int GHOST_HACK_getFirstFile(char buf[FIRSTFILEBUFLG]) // key window from here if the closing one is not in the orderedWindows. This // saves lack of key windows when closing "About", but does not interfere with // Blender's window manager when closing Blender's windows. +// +// NOTE: It also receives notifiers when menus are closed on macOS 14. +// Presumably it considers menus to be windows. - (void)windowWillClose:(NSNotification *)notification { NSWindow *closing_window = (NSWindow *)[notification object]; + + if (![closing_window isKeyWindow]) { + /* If the window wasn't key then its either none of the windows are key or another window + * is a key. The former situation is a bit strange, but probably forcin a key window is not + * something desirable. The latter situation is when we definitely do not want to change the + * key window. + * + * Ignoring non-key windows also avoids the code which ensures ordering below from running + * when the notifier is received for menus on macOS 14. */ + return; + } + NSInteger index = [[NSApp orderedWindows] indexOfObject:closing_window]; if (index != NSNotFound) { return; diff --git a/source/blender/nodes/shader/materialx/material.cc b/source/blender/nodes/shader/materialx/material.cc index 12fe16ad009..1911db8c618 100644 --- a/source/blender/nodes/shader/materialx/material.cc +++ b/source/blender/nodes/shader/materialx/material.cc @@ -24,17 +24,11 @@ class DefaultMaterialNodeParser : public NodeParser { NodeItem surface = create_node( "standard_surface", NodeItem::Type::SurfaceShader, - {{"base_color", val(MaterialX::Color3(material_->r, material_->g, material_->b))}, - {"diffuse_roughness", val(material_->roughness)}}); - - if (material_->metallic > 0.0f) { - surface.set_input("metalness", val(material_->metallic)); - } - if (material_->spec) { - surface.set_input("specular", val(material_->spec)); - surface.set_input("specular_color", val(material_->spec)); - surface.set_input("specular_roughness", val(material_->roughness)); - } + {{"base", val(1.0f)}, + {"base_color", val(MaterialX::Color3(material_->r, material_->g, material_->b))}, + {"diffuse_roughness", val(material_->roughness)}, + {"specular", val(material_->spec)}, + {"metalness", val(material_->metallic)}}); NodeItem res = create_node( "surfacematerial", NodeItem::Type::Material, {{"surfaceshader", surface}});