only animate a single primitive

This commit is contained in:
Nick Fisher
2021-09-21 16:52:29 +08:00
parent 26af350dbe
commit 14c8f431a2
6 changed files with 111 additions and 274 deletions

View File

@@ -142,11 +142,14 @@ void FilamentViewer::loadResources(string relativeResourcePath) {
}
_animator = _asset->getAnimator();
// _asset->releaseSourceData(); // we need to wait until the Morpher is created to release the source data
_scene->addEntities(_asset->getEntities(), _asset->getEntityCount());
};
void FilamentViewer::releaseSourceAssets() {
_asset->releaseSourceData();
}
void FilamentViewer::loadGltf(const char* const uri, const char* const relativeResourcePath) {
if(_asset) {
_resourceLoader->evictResourceData();
@@ -192,8 +195,8 @@ StringList FilamentViewer::getTargetNames(const char* meshName) {
return StringList(nullptr, 0);
}
void FilamentViewer::createMorpher(const char* meshName, const char* entityName, const char* materialInstanceName) {
morphHelper = new gltfio::GPUMorphHelper((FFilamentAsset*)_asset, meshName, entityName, materialInstanceName);
void FilamentViewer::createMorpher(const char* meshName, int primitiveIndex) {
morphHelper = new gltfio::GPUMorphHelper((FFilamentAsset*)_asset, meshName, primitiveIndex);
}