From 4cb118ad65e695ff1ae0ce87ec519e9793a26d68 Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Mon, 6 Jan 2025 10:45:29 +0800 Subject: [PATCH] feat: use existing material instances when creating an instance of GeometrySceneAsset and no material instance is passed --- thermion_dart/native/src/scene/GeometrySceneAsset.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/thermion_dart/native/src/scene/GeometrySceneAsset.cpp b/thermion_dart/native/src/scene/GeometrySceneAsset.cpp index 90e1dc9a..b60872ec 100644 --- a/thermion_dart/native/src/scene/GeometrySceneAsset.cpp +++ b/thermion_dart/native/src/scene/GeometrySceneAsset.cpp @@ -63,6 +63,11 @@ namespace thermion return nullptr; } + if(materialInstanceCount == 0) { + materialInstanceCount = _materialInstanceCount; + materialInstances = _materialInstances; + } + std::unique_ptr instance = std::make_unique( _engine, _vertexBuffer,