Skip to content

Commit

Permalink
Merge pull request #1011 from anatawa12/fix-duplicated-animation-curve
Browse files Browse the repository at this point in the history
fix: error with duplicated animation curve
  • Loading branch information
anatawa12 authored Apr 14, 2024
2 parents 46f8152 + a0a3f27 commit 9823376
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-PRERELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog].

### Fixed
- NRE with AutoMergeSkinnedMesh `#1010`
- Error with some rare animation clip `#1011`

### Security

Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The format is based on [Keep a Changelog].
- MergePhysBone now warns if chain length are not same `#775`
- MergePhysBone with only one source is now error `#775`
- It was not working well and not a error by a bug.
- Animator Parser is completely rewritten `#850` `#968`
- Animator Parser is completely rewritten `#850` `#968` `#1011`
- New Animator Parser allow us to track animating properties animated by components removed by AAO.
- PhysBone that swings no bones are now removed `#864`
- I found such a PhysBone on Lime so I added this feature.
Expand Down
4 changes: 2 additions & 2 deletions Editor/AnimatorParserV2/AnimationParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public static ImmutableNodeContainer ParseAnimation([NotNull] GameObject root, [

var node = FloatAnimationCurveNode.Create(clip, binding);
if (node == null) continue;
nodes.Add(componentOrGameObject, binding.propertyName, node);
nodes.Set(componentOrGameObject, binding.propertyName, node);
}

foreach (var binding in AnimationUtility.GetObjectReferenceCurveBindings(clip))
Expand All @@ -128,7 +128,7 @@ public static ImmutableNodeContainer ParseAnimation([NotNull] GameObject root, [

var node = ObjectAnimationCurveNode.Create(clip, binding);
if (node == null) continue;
nodes.Add(componentOrGameObject, binding.propertyName, node);
nodes.Set(componentOrGameObject, binding.propertyName, node);
}

return nodes;
Expand Down
6 changes: 6 additions & 0 deletions Editor/AnimatorParserV2/NodeContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ public void Set(ComponentOrGameObject target, string prop, [NotNull] TFloatNode
{
_floatNodes[(target, prop)] = node ?? throw new ArgumentNullException(nameof(node));
}

public void Set(ComponentOrGameObject target, string prop, [NotNull] TObjectNode node)
{
if (node == null) throw new ArgumentNullException(nameof(node));
_objectNodes[(target, prop)] = node;
}
}

internal class AnimatorLayerNodeContainer : NodeContainerBase<AnimatorLayerPropModNode<float>,
Expand Down

0 comments on commit 9823376

Please sign in to comment.