From a134646c8bbfd1e2ab23342cf70e83abcad83319 Mon Sep 17 00:00:00 2001 From: Ryver <58080736+LoganFairbairn@users.noreply.github.com> Date: Wed, 31 Jan 2024 09:46:31 -0500 Subject: [PATCH] Fixed ambient occlusion not exporting properly. --- core/export_textures.py | 1 - core/material_layers.py | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/export_textures.py b/core/export_textures.py index 3abaf73f..b98ce5ff 100644 --- a/core/export_textures.py +++ b/core/export_textures.py @@ -288,7 +288,6 @@ # List of material channels that use the emission node to bake and export their values. emission_exporting_channels = ( - 'AMBIENT-OCCLUSION', 'SUBSURFACE-SCALE', 'SUBSURFACE-ANISOTROPY', 'SPECULAR-ANISOTROPIC', diff --git a/core/material_layers.py b/core/material_layers.py index 999bf611..310b5399 100644 --- a/core/material_layers.py +++ b/core/material_layers.py @@ -254,6 +254,10 @@ def get_material_layer_node(layer_node_name, layer_index=0, material_channel_nam # Using specified names for nodes allows consistent access to specific nodes accross languages in Blender (as Blender's auto translate feature will translate default node names). # This function also has the benefit of being able to return nodes in sub-node groups, if required. + if not getattr(bpy.context, 'active_object'): + debug_logging.log("Context has no attribute 'active_object'.") + return + if bpy.context.active_object == None: return