From b25e307deee2120f054f025a2d81a213711a5558 Mon Sep 17 00:00:00 2001 From: geron-cn Date: Fri, 26 Dec 2014 18:27:47 +0800 Subject: [PATCH] fix add search path for armaturenodereader --- .../ArmatureNodeReader/ArmatureNodeReader.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp index 2494264820..89a016417e 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp @@ -115,11 +115,14 @@ void ArmatureNodeReader::setPropsWithFlatBuffers(cocos2d::Node *node, const flatbuffers::Table *nodeOptions) { - auto* custom = static_cast(node); - auto options = (flatbuffers::CSArmatureNodeOption*)nodeOptions; - auto reader = ArmatureNodeReader::getInstance(); + auto* custom = static_cast(node); + auto options = (flatbuffers::CSArmatureNodeOption*)nodeOptions; std::string filepath(options->fileData()->path()->c_str()); + + std::string dirpath = filepath.substr(0, filepath.find_last_of("/")); + FileUtils::getInstance()->addSearchPath(dirpath); + ArmatureDataManager::getInstance()->addArmatureFileInfo(FileUtils::getInstance()->fullPathForFilename(filepath)); custom->init(getArmatureName(filepath)); if (options->isAutoPlay())