Skip to content

Commit

Permalink
fix: sanitize animator state name on import
Browse files Browse the repository at this point in the history
  • Loading branch information
hybridherbst committed Dec 13, 2023
1 parent 8ef4958 commit 5624176
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Runtime/Scripts/GLTFSceneImporter.cs
Expand Up @@ -1039,7 +1039,9 @@ protected virtual async Task ConstructScene(GLTFScene scene, bool showSceneObj,
var baseLayer = controller.layers[0];
for (int i = 0; i < constructedClips.Count; i++)
{
var state = baseLayer.stateMachine.AddState(constructedClips[i].name);
var name = constructedClips[i].name;
if (string.IsNullOrWhiteSpace(name)) name = "clip " + i;
var state = baseLayer.stateMachine.AddState(name);
state.motion = constructedClips[i];
}
animator.runtimeAnimatorController = controller;
Expand Down

0 comments on commit 5624176

Please sign in to comment.