Replies: 1 comment 1 reply
-
Yeah, I think it's currently only possible with the imperative api, here is a rough example. I haven't tested it, but it should outline all the APIs necessary to make it work (you might want to peak into the Model and Animator tsx files to see how some of the internals are working): const model = useModel(
{
uri: assetPath,
},
)
const assetModel = getAssetFromModel(model)
const modelAnimations = useModel(
{
uri: path,
},
)
const animator = useAnimator(modelAnimations)
// Sync your model with the external animations:
useEffect(() => {
const instance = assetModel.getInstance();
const id = animator.addToSyncList(assetModel) // this is the key API you want to use
return () => {
animator.removeFromSyncList(id)
}
}, [animator, assetModel]) keep in mind that as you're using now the react-native-filament/package/src/react/Animator.tsx Lines 72 to 104 in 0aa6ab7 In case you got something working, we would appreciate if you create a PR to update the declarative API (react API) to make this work (ie. I see you passed |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
How can I load animation for a separate file, and load the 3D model from another file? My current implementation is as:
getting error:
Is there any example I can use for my case? all examples has the animation and model within the same GLB file.
Beta Was this translation helpful? Give feedback.
All reactions