From 6894c4a0e3853d68c9fcfb8d0c8274ad4c8f33e1 Mon Sep 17 00:00:00 2001 From: poi-vrc <77053052+poi-vrc@users.noreply.github.com> Date: Sat, 27 Apr 2024 02:07:55 +0800 Subject: [PATCH] fix: proper handling when dresser report errors and return no mappings --- ...matureMappingWearableModuleEditorPresenter.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Editor/UI/Presenters/Modules/ArmatureMappingWearableModuleEditorPresenter.cs b/Editor/UI/Presenters/Modules/ArmatureMappingWearableModuleEditorPresenter.cs index b2333c3b..af85b5e5 100644 --- a/Editor/UI/Presenters/Modules/ArmatureMappingWearableModuleEditorPresenter.cs +++ b/Editor/UI/Presenters/Modules/ArmatureMappingWearableModuleEditorPresenter.cs @@ -204,6 +204,7 @@ private void GenerateDresserMappings() return; } + var avatarArmature = OneConfUtils.GuessArmature(_parentView.TargetAvatar, _view.AvatarArmatureName); var wearableArmature = OneConfUtils.GuessArmature(_parentView.TargetWearable, _view.WearableArmatureName); // execute default dresser (dresser selection is ignored now) @@ -211,15 +212,22 @@ private void GenerateDresserMappings() var settings = new StandardDresserSettings() { SourceArmature = wearableArmature, - TargetArmaturePath = _view.AvatarArmatureName, + TargetArmaturePath = avatarArmature != null ? avatarArmature.name : _view.AvatarArmatureName, DynamicsOption = ConvertToNewDynamicsOption(_view.DresserSettings.dynamicsOption) }; _dresserReport = new DKReport(); dresser.Execute(_dresserReport, _parentView.TargetAvatar, settings, out var objectMappings, out var tags); - // TODO: this is temporary for later migration to Object Mappings + Tags - var oldObjectMappings = ConvertToOldMappings(_parentView.TargetWearable.transform, objectMappings, tags); - UpdateMappingEditorView(oldObjectMappings); + if (objectMappings != null && tags != null) + { + // TODO: this is temporary for later migration to Object Mappings + Tags + var oldObjectMappings = ConvertToOldMappings(_parentView.TargetWearable.transform, objectMappings, tags); + UpdateMappingEditorView(oldObjectMappings); + } + else + { + UpdateMappingEditorView(null); + } ApplySettings(); UpdateDresserReport();