From 49a401a3835077c302564e2ce924305ed842414a Mon Sep 17 00:00:00 2001 From: Matt Seaton Date: Sat, 25 May 2024 20:13:46 -0500 Subject: [PATCH] Bugfix on eye slot and duplicate default overlay when applying so as not to alter original resource --- scripts/auto_updating_humanizer.gd | 2 ++ scripts/humanizer.gd | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/auto_updating_humanizer.gd b/scripts/auto_updating_humanizer.gd index 06122080..ecc991e4 100644 --- a/scripts/auto_updating_humanizer.gd +++ b/scripts/auto_updating_humanizer.gd @@ -22,6 +22,8 @@ func set_skin_color(color: Color) -> void: func set_eye_color(color: Color) -> void: eye_color = color for slot in [&'RightEye', &'LeftEye', &'Eyes']: + if not human_config.body_parts.has(slot): + continue var bp: HumanBodyPart = human_config.body_parts[slot] if bp.node is HumanizerMeshInstance: bp.node.material_config.update_material diff --git a/scripts/humanizer.gd b/scripts/humanizer.gd index f9a00b13..6eb3d00f 100644 --- a/scripts/humanizer.gd +++ b/scripts/humanizer.gd @@ -1030,7 +1030,7 @@ func _setup_overlay_material(asset: HumanAsset, existing_config: HumanizerMateri overlay_dict['ao'] = mi.get_surface_override_material(0).ao_texture.resource_path var overlay = HumanizerOverlay.from_dict(overlay_dict) mi.material_config.set_base_textures(HumanizerOverlay.from_dict(overlay_dict)) - mi.material_config.add_overlay(asset.default_overlay) + mi.material_config.add_overlay(asset.default_overlay.duplicate(true)) #### Animation #### func set_rig(rig_name: String) -> void: