-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: updateBoneMatricesForInstance #7859
base: main
Are you sure you want to change the base?
feat: updateBoneMatricesForInstance #7859
Conversation
Added a method to control to which instance to apply the bone matrices updates of an animator. This is particularly useful if you want to apply the animation from one master asset to other instances that are different assets but share the same skeleton as the master asset. A common example for this is e.g. clothing.
* | ||
* @param instance The instance to update. | ||
*/ | ||
void updateBoneMatricesForInstance(FilamentInstance* instance); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like maybe we can formalize addInstance
below instead of adding this method?
We can do some validation of the the animation associated with the "new", added instance vs the one that's used to build this animator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought so as well first. However, the "problem" I found with that is that we are again creating all those channels and data for the new instance.
With the solution I have right now we don't need to recreate any data (however I admit that my solution is maybe a bit fragile as it relies on the name of the entities to synchronise entity transforms).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(The solution I am talking about is not visible in this PR but it is what I outlined here)
Wasn't able to get this solution working on Android. Are there any additional instructions you can provide on how this should be used? |
I provided instructions here: |
Hey, any chance to get this one reviewed? Is there any way how i can help? |
Added a method to control to which instance to apply the bone matrices updates of an animator.
This is particularly useful if you want to apply the animation from one master asset to other instances that are different assets (have different meshes) but share the same skeleton as the master asset. A common example for this is e.g. clothing.
In our use case we have one main character which contains all the animations. We then have clothings that are rigged to the same skeleton of the main character.
We are then able to apply the transformations of the character to the clothing assets while playing an animation.
The initial discussion has been started here: