Skip to content

Commit

Permalink
fix: proper handling when dresser report errors and return no mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
poi-vrc committed Apr 26, 2024
1 parent 0bb762f commit 6894c4a
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,22 +204,30 @@ 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)
var dresser = new StandardDresser();
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();
Expand Down

0 comments on commit 6894c4a

Please sign in to comment.