Attempt applying RESET pose during import. #96308
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR attempts to use and set the RESET pose so it becomes the default skeletal pose when serializing an imported scene. Now that #96196 has been merged, you might notice that if you instanced + set editable children on some models, after saving, certain rotation quaternions in the pose don't actually match the base model, meaning useless data gets written to the scene which instances it.
The reason this happens is that the imported scene by default
uses the rest pose as the default pose, but scenes will automatically call the RESET animation whenever saving a scene. Even when the rest and reset pose appear to be a 1:1 match, certain bones will still not match because of quantization (rests are stored as Transform3Ds, whereas poses are stored as seperate position/rotation/scale values).(Edit: actually, this isn't always the case, the pose can actually just be whatever the model came in as, though using the rest pose is what is used when importing with retargeting. None of this invalidates the point however since the idea is to make the imported pose consistent with the special RESET pose which gets set everytime a scene is saved). Making the RESET pose the default pose when importing should resolve this discontinuity.