[3.8.2] VRCSDK Builder page will revert transform changes to rest pose
anatawa12
Problem
Opening VRCSDK Builder page or changing the selected avatar will revert pose (transform) to rest pose defined in the 'Avatar' asset of the root Animator component.
Cause of the problem
In the
OnGUIAvatarCheck
method of the VRCSdkControlPanelAvatarBuilder
class, it will call Animator.Rebind
method to check the situations you call "nested armature".However, Animator.Rebind function will write the default pose defined in the 'Avatar' asset so it will revert any pose changes made in the editor.
This is annoying since this will disturb creating animation clips and testing them in the editor.
Solution
One solution is to use
Animator.Rebind(bool writeDefaultPose)
private method and pass false
to writeDefaultPose
parameter, instead of passing true
to it, which is the default value.This method is not available as public API but it will keep available until Unity 6000.2.0b4 (the latest available C# reference version.
Another solution is to collect the current pose before calling
Animator.Rebind
and restore it after the call but this takes more code.Log In