Skip to content

Commit

Permalink
Merge pull request #1373 from anatawa12/animation-without-m-broken
Browse files Browse the repository at this point in the history
fix: animating transform with C# named properties are broken by merge bone
  • Loading branch information
anatawa12 authored Dec 22, 2024
2 parents 5297c6e + 5f3891e commit f4beb31
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG-PRERELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ The format is based on [Keep a Changelog].

### Fixed
- Prefab overrides on the scene are reverted on first load of the scene at first launch `#1372`
- Animating transform with C# named properties are broken by merge bone `#1373`
- Animator window won't create such animation but some script generates and it works surprisingly

### Security

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ The format is based on [Keep a Changelog].

### Fixed
- Prefab overrides on the scene are reverted on first load of the scene at first launch `#1372`
- Animating transform with C# named properties are broken by merge bone `#1373`
- Animator window won't create such animation but some script generates and it works surprisingly

### Security

Expand Down
3 changes: 3 additions & 0 deletions Editor/Processors/MergePhysBoneProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,9 @@ private static Vector3 QuaternionToEulerXZY(Quaternion q)
{
"m_LocalRotation.x", "m_LocalRotation.y", "m_LocalRotation.z", "m_LocalRotation.w",
"m_LocalPosition.x", "m_LocalPosition.y", "m_LocalPosition.z" ,
// Animator Window won't create the following properties, but generated by some scripts and works in runtime
"localRotation.x", "localRotation.y", "localRotation.z", "localRotation.w",
"localPosition.x", "localPosition.y", "localPosition.z",
};

sealed class MergePhysBoneMerger : MergePhysBoneEditorModificationUtils
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,10 @@ bool GameObjectAnimated(Transform transform, BuildContext context)
"m_LocalRotation.x", "m_LocalRotation.y", "m_LocalRotation.z", "m_LocalRotation.w",
"m_LocalPosition.x", "m_LocalPosition.y", "m_LocalPosition.z",
"m_LocalScale.x", "m_LocalScale.y", "m_LocalScale.z",
// Animator Window won't create the following properties, but generated by some scripts and works in runtime
"localRotation.x", "localRotation.y", "localRotation.z", "localRotation.w",
"localPosition.x", "localPosition.y", "localPosition.z",
"localScale.x", "localScale.y", "localScale.z",
"localEulerAnglesRaw.x", "localEulerAnglesRaw.y", "localEulerAnglesRaw.z"
};
}
Expand Down
4 changes: 4 additions & 0 deletions Editor/Processors/TraceAndOptimize/OptimizePhysBone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ private static bool IsAnimatedExternally(VRCPhysBoneBase physBone, AnimationComp
"m_LocalRotation.x", "m_LocalRotation.y", "m_LocalRotation.z", "m_LocalRotation.w",
"m_LocalPosition.x", "m_LocalPosition.y", "m_LocalPosition.z",
"m_LocalScale.x", "m_LocalScale.y", "m_LocalScale.z",
// Animator Window won't create the following properties, but generated by some scripts and works in runtime
"localRotation.x", "localRotation.y", "localRotation.z", "localRotation.w",
"localPosition.x", "localPosition.y", "localPosition.z",
"localScale.x", "localScale.y", "localScale.z",
"localEulerAnglesRaw.x", "localEulerAnglesRaw.y", "localEulerAnglesRaw.z"
};

Expand Down

0 comments on commit f4beb31

Please sign in to comment.