Merge branch 'blender-v4.0-release'

This commit is contained in:
Sergey Sharybin 2023-10-11 19:12:12 +02:00
commit 79dc2c7672
2 changed files with 20 additions and 11 deletions

View File

@ -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;

View File

@ -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}});