google / filament

Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
https://google.github.io/filament/
Apache License 2.0
17.59k stars 1.86k forks source link

fix: apply applyCrossFade to correct entity #7665

Closed hannojg closed 5 months ago

hannojg commented 5 months ago

A while ago an API was added that supports creating multiple instances from one asset.

Due to that that instance used in an Animator might not be asset->mRoot, but another instance. To account for that. The applyAnimation function handled this correctly, however the applyCrossFade wasn't updated and was still using asset->mRoot.

This PR adds a conditional to either use the provided instance in applyCrossFade or to use the asset's root entity.