BlenderLoader.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  1. /*
  2. Open Asset Import Library (ASSIMP)
  3. ----------------------------------------------------------------------
  4. Copyright (c) 2006-2010, ASSIMP Development Team
  5. All rights reserved.
  6. Redistribution and use of this software in source and binary forms,
  7. with or without modification, are permitted provided that the
  8. following conditions are met:
  9. * Redistributions of source code must retain the above
  10. copyright notice, this list of conditions and the
  11. following disclaimer.
  12. * Redistributions in binary form must reproduce the above
  13. copyright notice, this list of conditions and the
  14. following disclaimer in the documentation and/or other
  15. materials provided with the distribution.
  16. * Neither the name of the ASSIMP team, nor the names of its
  17. contributors may be used to endorse or promote products
  18. derived from this software without specific prior
  19. written permission of the ASSIMP Development Team.
  20. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  23. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  24. OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  25. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  26. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. ----------------------------------------------------------------------
  32. */
  33. /** @file BlenderLoader.cpp
  34. * @brief Implementation of the Blender3D importer class.
  35. */
  36. #include "AssimpPCH.h"
  37. #ifndef ASSIMP_BUILD_NO_BLEND_IMPORTER
  38. #include "BlenderLoader.h"
  39. #include "BlenderDNA.h"
  40. #include "BlenderScene.h"
  41. #include "BlenderSceneGen.h"
  42. #include "StreamReader.h"
  43. #include "TinyFormatter.h"
  44. //#include <boost/make_shared.hpp>
  45. using namespace Assimp;
  46. using namespace Assimp::Blender;
  47. using namespace Assimp::Formatter;
  48. #define for_each BOOST_FOREACH
  49. static const aiLoaderDesc blenderDesc = {
  50. "Blender 3D Importer \nhttp://www.blender3d.org",
  51. "Alexander Gessler <[email protected]>",
  52. "",
  53. "",
  54. aiLoaderFlags_SupportBinaryFlavour | aiLoaderFlags_Experimental,
  55. 0,
  56. 0,
  57. 2,
  58. 50
  59. };
  60. namespace Assimp {
  61. namespace Blender {
  62. /** Mini smart-array to avoid pulling in even more boost stuff */
  63. template <template <typename,typename> class TCLASS, typename T>
  64. struct TempArray {
  65. ~TempArray () {
  66. for_each(T* elem, arr) {
  67. delete elem;
  68. }
  69. }
  70. void dismiss() {
  71. arr.clear();
  72. }
  73. TCLASS< T*,std::allocator<T*> >* operator -> () {
  74. return &arr;
  75. }
  76. operator TCLASS< T*,std::allocator<T*> > () {
  77. return arr;
  78. }
  79. private:
  80. TCLASS< T*,std::allocator<T*> > arr;
  81. };
  82. /** ConversionData acts as intermediate storage location for
  83. * the various ConvertXXX routines in BlenderImporter.*/
  84. struct ConversionData {
  85. std::set<const Object*> objects;
  86. TempArray <std::vector, aiMesh> meshes;
  87. TempArray <std::vector, aiCamera> cameras;
  88. TempArray <std::vector, aiLight> lights;
  89. TempArray <std::vector, aiMaterial> materials;
  90. };
  91. }
  92. }
  93. // ------------------------------------------------------------------------------------------------
  94. // Constructor to be privately used by Importer
  95. BlenderImporter::BlenderImporter()
  96. {}
  97. // ------------------------------------------------------------------------------------------------
  98. // Destructor, private as well
  99. BlenderImporter::~BlenderImporter()
  100. {}
  101. // ------------------------------------------------------------------------------------------------
  102. // Returns whether the class can handle the format of the given file.
  103. bool BlenderImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
  104. {
  105. const std::string& extension = GetExtension(pFile);
  106. if (extension == "blend") {
  107. return true;
  108. }
  109. else if ((!extension.length() || checkSig) && pIOHandler) {
  110. const char* tokens[] = {"BLENDER"};
  111. return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1);
  112. }
  113. return false;
  114. }
  115. // ------------------------------------------------------------------------------------------------
  116. // List all extensions handled by this loader
  117. void BlenderImporter::GetExtensionList(std::set<std::string>& app)
  118. {
  119. app.insert("blend");
  120. }
  121. // ------------------------------------------------------------------------------------------------
  122. // Loader registry entry
  123. const aiLoaderDesc& BlenderImporter::GetInfo () const
  124. {
  125. return blenderDesc;
  126. }
  127. // ------------------------------------------------------------------------------------------------
  128. // Setup configuration properties for the loader
  129. void BlenderImporter::SetupProperties(const Importer* pImp)
  130. {
  131. // nothing to be done for the moment
  132. }
  133. // ------------------------------------------------------------------------------------------------
  134. // Imports the given file into the given scene structure.
  135. void BlenderImporter::InternReadFile( const std::string& pFile,
  136. aiScene* pScene, IOSystem* pIOHandler)
  137. {
  138. FileDatabase file;
  139. boost::shared_ptr<IOStream> stream(pIOHandler->Open(pFile,"rb"));
  140. if (!stream) {
  141. ThrowException("Could not open file for reading");
  142. }
  143. char magic[8] = {0};
  144. stream->Read(magic,7,1);
  145. if (strcmp(magic,"BLENDER")) {
  146. ThrowException("BLENDER magic bytes are missing");
  147. }
  148. file.i64bit = (stream->Read(magic,1,1),magic[0]=='-');
  149. file.little = (stream->Read(magic,1,1),magic[0]=='v');
  150. stream->Read(magic,3,1);
  151. magic[3] = '\0';
  152. LogInfo((format(),"Blender version is ",magic[0],".",magic+1,
  153. " (64bit: ",file.i64bit?"true":"false",
  154. ", little endian: ",file.little?"true":"false",")"
  155. ));
  156. ParseBlendFile(file,stream);
  157. Scene scene;
  158. ExtractScene(scene,file);
  159. ConvertBlendFile(pScene,scene);
  160. }
  161. // ------------------------------------------------------------------------------------------------
  162. void BlenderImporter::ParseBlendFile(FileDatabase& out, boost::shared_ptr<IOStream> stream)
  163. {
  164. out.reader = boost::shared_ptr<StreamReaderAny>(new StreamReaderAny(stream,out.little));
  165. DNAParser dna_reader(out);
  166. const DNA* dna = NULL;
  167. out.entries.reserve(128); { // even small BLEND files tend to consist of many file blocks
  168. SectionParser parser(*out.reader.get(),out.i64bit);
  169. // first parse the file in search for the DNA and insert all other sections into the database
  170. while ((parser.Next(),1)) {
  171. const FileBlockHead& head = parser.GetCurrent();
  172. if (head.id == "ENDB") {
  173. break; // only valid end of the file
  174. }
  175. else if (head.id == "DNA1") {
  176. dna_reader.Parse();
  177. dna = &dna_reader.GetDNA();
  178. continue;
  179. }
  180. out.entries.push_back(head);
  181. }
  182. }
  183. if (!dna) {
  184. ThrowException("SDNA not found");
  185. }
  186. std::sort(out.entries.begin(),out.entries.end());
  187. }
  188. // ------------------------------------------------------------------------------------------------
  189. void BlenderImporter::ExtractScene(Scene& out, const FileDatabase& file)
  190. {
  191. const FileBlockHead* block = NULL;
  192. std::map<std::string,size_t>::const_iterator it = file.dna.indices.find("Scene");
  193. if (it == file.dna.indices.end()) {
  194. ThrowException("There is no `Scene` structure record");
  195. }
  196. const Structure& ss = file.dna.structures[(*it).second];
  197. // we need a scene somewhere to start with.
  198. for_each(const FileBlockHead& bl,file.entries) {
  199. if (bl.id == "SC") {
  200. block = &bl;
  201. break;
  202. }
  203. }
  204. if (!block) {
  205. ThrowException("There is not a single `Scene` record to load");
  206. }
  207. file.reader->SetCurrentPos(block->start);
  208. ss.Convert(out,file);
  209. #ifndef ASSIMP_BUILD_BLENDER_NO_STATS
  210. DefaultLogger::get()->info((format(),
  211. "(Stats) Fields read: " ,file.stats().fields_read,
  212. ", pointers resolved: " ,file.stats().pointers_resolved,
  213. ", cache hits: " ,file.stats().cache_hits,
  214. ", cached objects: " ,file.stats().cached_objects
  215. ));
  216. #endif
  217. }
  218. // ------------------------------------------------------------------------------------------------
  219. void BlenderImporter::ConvertBlendFile(aiScene* out, const Scene& in)
  220. {
  221. ConversionData conv;
  222. // FIXME it must be possible to take the hierarchy directly from
  223. // the file. This is terrible. Here, we're first looking for
  224. // all objects which don't have parent objects at all -
  225. std::deque<const Object*> no_parents;
  226. for (boost::shared_ptr<Base> cur = boost::static_pointer_cast<Base> ( in.base.first ); cur; cur = cur->next) {
  227. if (cur->object) {
  228. if(!cur->object->parent) {
  229. no_parents.push_back(cur->object.get());
  230. }
  231. else conv.objects.insert(cur->object.get());
  232. }
  233. }
  234. for (boost::shared_ptr<Base> cur = in.basact; cur; cur = cur->next) {
  235. if (cur->object) {
  236. if(cur->object->parent) {
  237. conv.objects.insert(cur->object.get());
  238. }
  239. }
  240. }
  241. if (no_parents.empty()) {
  242. ThrowException("Expected at least one object with no parent");
  243. }
  244. aiNode* root = out->mRootNode = new aiNode("<BlenderRoot>");
  245. root->mNumChildren = static_cast<unsigned int>(no_parents.size());
  246. root->mChildren = new aiNode*[root->mNumChildren]();
  247. for (unsigned int i = 0; i < root->mNumChildren; ++i) {
  248. root->mChildren[i] = ConvertNode(in, no_parents[i], conv);
  249. root->mChildren[i]->mParent = root;
  250. }
  251. if (conv.meshes->size()) {
  252. out->mMeshes = new aiMesh*[out->mNumMeshes = static_cast<unsigned int>( conv.meshes->size() )];
  253. std::copy(conv.meshes->begin(),conv.meshes->end(),out->mMeshes);
  254. conv.meshes.dismiss();
  255. }
  256. if (conv.lights->size()) {
  257. out->mLights = new aiLight*[out->mNumLights = static_cast<unsigned int>( conv.lights->size() )];
  258. std::copy(conv.lights->begin(),conv.lights->end(),out->mLights);
  259. conv.lights.dismiss();
  260. }
  261. if (conv.cameras->size()) {
  262. out->mCameras = new aiCamera*[out->mNumCameras = static_cast<unsigned int>( conv.cameras->size() )];
  263. std::copy(conv.cameras->begin(),conv.cameras->end(),out->mCameras);
  264. conv.cameras.dismiss();
  265. }
  266. if (conv.materials->size()) {
  267. out->mMaterials = new aiMaterial*[out->mNumMaterials = static_cast<unsigned int>( conv.materials->size() )];
  268. std::copy(conv.materials->begin(),conv.materials->end(),out->mMaterials);
  269. conv.materials.dismiss();
  270. }
  271. // acknowledge that the scene might come out incomplete
  272. // by Assimps definition of `complete`: blender scenes
  273. // can consist of thousands of cameras or lights with
  274. // not a single mesh in them.
  275. if (!out->mNumMeshes) {
  276. out->mFlags |= AI_SCENE_FLAGS_INCOMPLETE;
  277. }
  278. }
  279. // ------------------------------------------------------------------------------------------------
  280. void BlenderImporter::CheckActualType(const ElemBase* dt, const char* check)
  281. {
  282. ai_assert(dt);
  283. if (strcmp(dt->dna_type,check)) {
  284. ThrowException((format(),
  285. "Expected object at ",std::hex,dt," to be of type `",check,
  286. "`, but it claims to be a `",dt->dna_type,"`instead"
  287. ));
  288. }
  289. }
  290. // ------------------------------------------------------------------------------------------------
  291. void BlenderImporter::NotSupportedObjectType(const Object* obj, const char* type)
  292. {
  293. LogWarn((format(), "Object `",obj->id.name,"` - type is unsupported: `",type, "`, skipping" ));
  294. }
  295. // ------------------------------------------------------------------------------------------------
  296. aiMesh* BlenderImporter::ConvertMesh(const Scene& in, const Object* obj, const Mesh* mesh, ConversionData& conv_data)
  297. {
  298. if (!mesh->totface || !mesh->totvert) {
  299. return NULL;
  300. }
  301. ScopeGuard<aiMesh> out(new aiMesh());
  302. aiVector3D* vo = out->mVertices = new aiVector3D[mesh->totface*4];
  303. aiVector3D* vn = out->mNormals = new aiVector3D[mesh->totface*4];
  304. out->mNumFaces = mesh->totface;
  305. out->mFaces = new aiFace[out->mNumFaces]();
  306. for (unsigned int i = 0; i < out->mNumFaces; ++i) {
  307. aiFace& f = out->mFaces[i];
  308. const MFace& mf = mesh->mface[i];
  309. f.mIndices = new unsigned int[ f.mNumIndices = mf.v4?4:3 ];
  310. if (mf.v1 >= mesh->totvert) {
  311. ThrowException("Vertex index v1 out of range");
  312. }
  313. const MVert* v = &mesh->mvert[mf.v1];
  314. vo->x = v->co[0];
  315. vo->y = v->co[1];
  316. vo->z = v->co[2];
  317. vn->x = v->no[0];
  318. vn->y = v->no[1];
  319. vn->z = v->no[2];
  320. f.mIndices[0] = out->mNumVertices++;
  321. ++vo;
  322. ++vn;
  323. // if (f.mNumIndices >= 2) {
  324. if (mf.v2 >= mesh->totvert) {
  325. ThrowException("Vertex index v2 out of range");
  326. }
  327. v = &mesh->mvert[mf.v2];
  328. vo->x = v->co[0];
  329. vo->y = v->co[1];
  330. vo->z = v->co[2];
  331. vn->x = v->no[0];
  332. vn->y = v->no[1];
  333. vn->z = v->no[2];
  334. f.mIndices[1] = out->mNumVertices++;
  335. ++vo;
  336. ++vn;
  337. if (mf.v3 >= mesh->totvert) {
  338. ThrowException("Vertex index v3 out of range");
  339. }
  340. // if (f.mNumIndices >= 3) {
  341. v = &mesh->mvert[mf.v3];
  342. vo->x = v->co[0];
  343. vo->y = v->co[1];
  344. vo->z = v->co[2];
  345. vn->x = v->no[0];
  346. vn->y = v->no[1];
  347. vn->z = v->no[2];
  348. f.mIndices[2] = out->mNumVertices++;
  349. ++vo;
  350. ++vn;
  351. if (mf.v4 >= mesh->totvert) {
  352. ThrowException("Vertex index v4 out of range");
  353. }
  354. // if (f.mNumIndices >= 4) {
  355. if (mf.v4) {
  356. v = &mesh->mvert[mf.v4];
  357. vo->x = v->co[0];
  358. vo->y = v->co[1];
  359. vo->z = v->co[2];
  360. vn->x = v->no[0];
  361. vn->y = v->no[1];
  362. vn->z = v->no[2];
  363. f.mIndices[3] = out->mNumVertices++;
  364. ++vo;
  365. ++vn;
  366. }
  367. // }
  368. // }
  369. // }
  370. }
  371. if (mesh->mtface) {
  372. vo = out->mTextureCoords[0] = new aiVector3D[out->mNumVertices];
  373. for (unsigned int i = 0; i < out->mNumFaces; ++i) {
  374. const aiFace& f = out->mFaces[i];
  375. const MTFace* v = &mesh->mtface[i];
  376. for (unsigned int i = 0; i < f.mNumIndices; ++i,++vo) {
  377. vo->x = v->uv[i][0];
  378. vo->y = v->uv[i][1];
  379. }
  380. }
  381. }
  382. if (mesh->tface) {
  383. vo = out->mTextureCoords[0] = new aiVector3D[out->mNumVertices];
  384. for (unsigned int i = 0; i < out->mNumFaces; ++i) {
  385. const aiFace& f = out->mFaces[i];
  386. const TFace* v = &mesh->tface[i];
  387. for (unsigned int i = 0; i < f.mNumIndices; ++i,++vo) {
  388. vo->x = v->uv[i][0];
  389. vo->y = v->uv[i][1];
  390. }
  391. }
  392. }
  393. if (mesh->mcol) {
  394. aiColor4D* vo = out->mColors[0] = new aiColor4D[out->mNumVertices];
  395. for (unsigned int i = 0; i < out->mNumFaces; ++i) {
  396. for (unsigned int n = 0; n < 4; ++n, ++vo) {
  397. const MCol* col = &mesh->mcol[(i<<2)+n];
  398. vo->r = col->r;
  399. vo->g = col->g;
  400. vo->b = col->b;
  401. vo->a = col->a;
  402. }
  403. }
  404. }
  405. return out.dismiss();
  406. }
  407. // ------------------------------------------------------------------------------------------------
  408. aiCamera* BlenderImporter::ConvertCamera(const Scene& in, const Object* obj, const Camera* mesh, ConversionData& conv_data)
  409. {
  410. ScopeGuard<aiCamera> out(new aiCamera());
  411. return NULL ; //out.dismiss();
  412. }
  413. // ------------------------------------------------------------------------------------------------
  414. aiLight* BlenderImporter::ConvertLight(const Scene& in, const Object* obj, const Lamp* mesh, ConversionData& conv_data)
  415. {
  416. ScopeGuard<aiLight> out(new aiLight());
  417. return NULL ; //out.dismiss();
  418. }
  419. // ------------------------------------------------------------------------------------------------
  420. aiNode* BlenderImporter::ConvertNode(const Scene& in, const Object* obj, ConversionData& conv_data)
  421. {
  422. std::deque<const Object*> children;
  423. for(std::set<const Object*>::iterator it = conv_data.objects.begin(); it != conv_data.objects.end() ;++it) {
  424. const Object* object = *it;
  425. if (object->parent.get() == obj) {
  426. children.push_back(object);
  427. conv_data.objects.erase(it++);
  428. if(it == conv_data.objects.end()) {
  429. break;
  430. }
  431. }
  432. }
  433. ScopeGuard<aiNode> node(new aiNode(obj->id.name));
  434. if (obj->data) {
  435. switch (obj->type)
  436. {
  437. case Object :: Type_EMPTY:
  438. break; // do nothing
  439. // supported object types
  440. case Object :: Type_MESH: {
  441. CheckActualType(obj->data.get(),"Mesh");
  442. aiMesh* mesh = ConvertMesh(in,obj,static_cast<const Mesh*>(
  443. obj->data.get()),conv_data);
  444. if (mesh) {
  445. node->mMeshes = new unsigned int[node->mNumMeshes = 1u];
  446. node->mMeshes[0] = conv_data.meshes->size();
  447. conv_data.meshes->push_back(mesh);
  448. }}
  449. break;
  450. case Object :: Type_LAMP: {
  451. CheckActualType(obj->data.get(),"Lamp");
  452. aiLight* mesh = ConvertLight(in,obj,static_cast<const Lamp*>(
  453. obj->data.get()),conv_data);
  454. if (mesh) {
  455. conv_data.lights->push_back(mesh);
  456. }}
  457. break;
  458. case Object :: Type_CAMERA: {
  459. CheckActualType(obj->data.get(),"Camera");
  460. aiCamera* mesh = ConvertCamera(in,obj,static_cast<const Camera*>(
  461. obj->data.get()),conv_data);
  462. if (mesh) {
  463. conv_data.cameras->push_back(mesh);
  464. }}
  465. break;
  466. // unsupported object types / log, but do not break
  467. case Object :: Type_CURVE:
  468. NotSupportedObjectType(obj,"Curve");
  469. break;
  470. case Object :: Type_SURF:
  471. NotSupportedObjectType(obj,"Surface");
  472. break;
  473. case Object :: Type_FONT:
  474. NotSupportedObjectType(obj,"Font");
  475. break;
  476. case Object :: Type_MBALL:
  477. NotSupportedObjectType(obj,"MetaBall");
  478. break;
  479. case Object :: Type_WAVE:
  480. NotSupportedObjectType(obj,"Wave");
  481. break;
  482. case Object :: Type_LATTICE:
  483. NotSupportedObjectType(obj,"Lattice");
  484. break;
  485. // invalid or unknown type
  486. default:
  487. break;
  488. }
  489. }
  490. for(unsigned int x = 0; x < 4; ++x) {
  491. for(unsigned int y = 0; y < 4; ++y) {
  492. node->mTransformation[y][x] = obj->parentinv[x][y];
  493. }
  494. }
  495. aiMatrix4x4 m;
  496. for(unsigned int x = 0; x < 4; ++x) {
  497. for(unsigned int y = 0; y < 4; ++y) {
  498. m[y][x] = obj->obmat[x][y];
  499. }
  500. }
  501. node->mTransformation = m*node->mTransformation;
  502. if (children.size()) {
  503. node->mNumChildren = static_cast<unsigned int>(children.size());
  504. aiNode** nd = node->mChildren = new aiNode*[node->mNumChildren]();
  505. for_each (const Object* nobj,children) {
  506. *nd = ConvertNode(in,nobj,conv_data);
  507. (*nd++)->mParent = node;
  508. }
  509. }
  510. return node.dismiss();
  511. }
  512. // ------------------------------------------------------------------------------------------------
  513. /*static*/ void BlenderImporter::ThrowException(const std::string& msg)
  514. {
  515. throw DeadlyImportError("BLEND: "+msg);
  516. }
  517. // ------------------------------------------------------------------------------------------------
  518. /*static*/ void BlenderImporter::LogWarn(const Formatter::format& message) {
  519. DefaultLogger::get()->warn(std::string("BLEND: ")+=message);
  520. }
  521. // ------------------------------------------------------------------------------------------------
  522. /*static*/ void BlenderImporter::LogError(const Formatter::format& message) {
  523. DefaultLogger::get()->error(std::string("BLEND: ")+=message);
  524. }
  525. // ------------------------------------------------------------------------------------------------
  526. /*static*/ void BlenderImporter::LogInfo(const Formatter::format& message) {
  527. DefaultLogger::get()->info(std::string("BLEND: ")+=message);
  528. }
  529. // ------------------------------------------------------------------------------------------------
  530. /*static*/ void BlenderImporter::LogDebug(const Formatter::format& message) {
  531. DefaultLogger::get()->debug(std::string("BLEND: ")+=message);
  532. }
  533. #endif