From 7d4c40b9fcc228bf63845d6065f97dc6546aadd1 Mon Sep 17 00:00:00 2001 From: zhouhang95 <765229842@qq.com> Date: Mon, 5 Aug 2024 17:28:48 +0800 Subject: [PATCH] change ReadFBXFile like ReadAlembic --- projects/FBX/FBXSDK.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/projects/FBX/FBXSDK.cpp b/projects/FBX/FBXSDK.cpp index 7111bd921c..695d2ca19e 100644 --- a/projects/FBX/FBXSDK.cpp +++ b/projects/FBX/FBXSDK.cpp @@ -304,9 +304,15 @@ struct FBXObject : PrimitiveObject { }; struct ReadFBXFile: INode { + std::shared_ptr _inner_fbx_object; + std::string usedPath; virtual void apply() override { // Change the following filename to a suitable filename value. auto lFilename = get_input2("path"); + if (lFilename == usedPath && _inner_fbx_object != nullptr) { + set_output("fbx_object", _inner_fbx_object); + return; + } // Initialize the SDK manager. This object handles all our memory management. FbxManager* lSdkManager = FbxManager::Create(); @@ -337,6 +343,8 @@ struct ReadFBXFile: INode { // The file is imported; so get rid of the importer. lImporter->Destroy(); fbx_object->userData().set2("version", vec3i(major, minor, revision)); + usedPath = lFilename; + _inner_fbx_object = fbx_object; set_output("fbx_object", std::move(fbx_object)); }