From d45689a2c163306cc7f86fee99ece9ed2eac51d3 Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Wed, 18 Sep 2013 13:52:49 +0200 Subject: [PATCH 01/42] CMake for assimp_view: copy dlls from assimp build over to output folder. --- tools/assimp_view/CMakeLists.txt | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tools/assimp_view/CMakeLists.txt b/tools/assimp_view/CMakeLists.txt index e3f15e9d8..dc7ae543a 100644 --- a/tools/assimp_view/CMakeLists.txt +++ b/tools/assimp_view/CMakeLists.txt @@ -1,18 +1,16 @@ FIND_PACKAGE(DirectX REQUIRED) -# Make sure the compiler can find include files from our Hello library. -include_directories ( + +INCLUDE_DIRECTORIES ( ${Assimp_SOURCE_DIR}/include ${Assimp_SOURCE_DIR}/code ${DirectX_INCLUDE_DIR} ) -# Make sure the linker can find the Hello library once it is built. -link_directories (${Assimp_BINARY_DIR} ${AssetImporter_BINARY_DIR}/lib) +# Make sure the linker can find the Assimp library once it is built. +LINK_DIRECTORIES (${Assimp_BINARY_DIR} ${AssetImporter_BINARY_DIR}/lib) -# Add executable called "helloDemo" that is built from the source files -# "demo.cxx" and "demo_b.cxx". The extensions are automatically found. -add_executable( assimp_viewer WIN32 +ADD_EXECUTABLE( assimp_viewer WIN32 AnimEvaluator.cpp Background.cpp Display.cpp @@ -46,12 +44,17 @@ add_executable( assimp_viewer WIN32 SET_PROPERTY(TARGET assimp_viewer PROPERTY DEBUG_POSTFIX ${ASSIMP_DEBUG_POSTFIX}) IF( WIN32 ) - ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS ) + ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS ) ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS ) ENDIF( WIN32 ) -# Link the executable to the Hello library. -target_link_libraries ( assimp_viewer assimp ${DirectX_LIBRARY} ${DirectX_D3DX9_LIBRARY} comctl32.lib Winmm.lib ) +# +ADD_CUSTOM_COMMAND(TARGET assimp_viewer + PRE_BUILD + COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} $) + +# Link the executable to the assimp + dx libs. +TARGET_LINK_LIBRARIES ( assimp_viewer assimp ${DirectX_LIBRARY} ${DirectX_D3DX9_LIBRARY} comctl32.lib Winmm.lib ) INSTALL( TARGETS assimp_viewer DESTINATION "${ASSIMP_BIN_INSTALL_DIR}" COMPONENT assimp-dev From 995978b16338e83a86441bf892324e9c38af22b7 Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Wed, 18 Sep 2013 13:55:02 +0200 Subject: [PATCH 02/42] CMake for assimp_cmd: also copy over assimp output binary as PRE_BUILD event. --- tools/assimp_cmd/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/assimp_cmd/CMakeLists.txt b/tools/assimp_cmd/CMakeLists.txt index 9d1a291d2..ec31e76b0 100644 --- a/tools/assimp_cmd/CMakeLists.txt +++ b/tools/assimp_cmd/CMakeLists.txt @@ -19,6 +19,11 @@ ADD_EXECUTABLE( assimp_cmd SET_PROPERTY(TARGET assimp_cmd PROPERTY DEBUG_POSTFIX ${ASSIMP_DEBUG_POSTFIX}) +# +ADD_CUSTOM_COMMAND(TARGET assimp_cmd + PRE_BUILD + COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} $) + TARGET_LINK_LIBRARIES( assimp_cmd assimp ${ZLIB_LIBRARIES}) SET_TARGET_PROPERTIES( assimp_cmd PROPERTIES OUTPUT_NAME assimp From f8f7e2468c6544b244b54c5c3255525d17f24821 Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Wed, 18 Sep 2013 14:10:26 +0200 Subject: [PATCH 03/42] CMake: use copy_if_different instead of copy and only run PRE_BUILD on Windows as it is not required on *nix anyway. --- tools/assimp_cmd/CMakeLists.txt | 9 +++++---- tools/assimp_view/CMakeLists.txt | 9 ++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/assimp_cmd/CMakeLists.txt b/tools/assimp_cmd/CMakeLists.txt index ec31e76b0..8581eba09 100644 --- a/tools/assimp_cmd/CMakeLists.txt +++ b/tools/assimp_cmd/CMakeLists.txt @@ -19,10 +19,11 @@ ADD_EXECUTABLE( assimp_cmd SET_PROPERTY(TARGET assimp_cmd PROPERTY DEBUG_POSTFIX ${ASSIMP_DEBUG_POSTFIX}) -# -ADD_CUSTOM_COMMAND(TARGET assimp_cmd - PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} $) +IF( WIN32 ) + ADD_CUSTOM_COMMAND(TARGET assimp_cmd + PRE_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} $) +ENDIF( WIN32 ) TARGET_LINK_LIBRARIES( assimp_cmd assimp ${ZLIB_LIBRARIES}) SET_TARGET_PROPERTIES( assimp_cmd PROPERTIES diff --git a/tools/assimp_view/CMakeLists.txt b/tools/assimp_view/CMakeLists.txt index dc7ae543a..4673cfeb4 100644 --- a/tools/assimp_view/CMakeLists.txt +++ b/tools/assimp_view/CMakeLists.txt @@ -43,15 +43,14 @@ ADD_EXECUTABLE( assimp_viewer WIN32 SET_PROPERTY(TARGET assimp_viewer PROPERTY DEBUG_POSTFIX ${ASSIMP_DEBUG_POSTFIX}) -IF( WIN32 ) - ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS ) - ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS ) -ENDIF( WIN32 ) +ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS ) +ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS ) + # ADD_CUSTOM_COMMAND(TARGET assimp_viewer PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} $) + COMMAND ${CMAKE_COMMAND} -E copy_if_different $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} $) # Link the executable to the assimp + dx libs. TARGET_LINK_LIBRARIES ( assimp_viewer assimp ${DirectX_LIBRARY} ${DirectX_D3DX9_LIBRARY} comctl32.lib Winmm.lib ) From e9ffabbfeeac863923994bbf957cd0946f674d09 Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Wed, 18 Sep 2013 14:27:24 +0200 Subject: [PATCH 04/42] LWO: ignore chunks of length zero. --- code/LWOLoader.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/LWOLoader.cpp b/code/LWOLoader.cpp index 5898eb8f6..0d03575ae 100644 --- a/code/LWOLoader.cpp +++ b/code/LWOLoader.cpp @@ -1296,6 +1296,11 @@ void LWOImporter::LoadLWO2File() uint8_t* const next = mFileBuffer+head->length; unsigned int iUnnamed = 0; + if(!head->length) { + mFileBuffer = next; + continue; + } + switch (head->type) { // new layer From ab2e81d004608d40b97e4d6283fadd22a0742dcd Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Wed, 18 Sep 2013 14:27:56 +0200 Subject: [PATCH 05/42] LWO: take last CLIP with the requested index (CLIPs ordered by ordinal string) --- code/LWOMaterial.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/code/LWOMaterial.cpp b/code/LWOMaterial.cpp index 0e8c5ecbd..a9ee1e3d7 100644 --- a/code/LWOMaterial.cpp +++ b/code/LWOMaterial.cpp @@ -167,19 +167,21 @@ bool LWOImporter::HandleTextures(aiMaterial* pcMat, const TextureList& in, aiTex // The older LWOB format does not use indirect references to clips. // The file name of a texture is directly specified in the tex chunk. if (mIsLWO2) { - // find the corresponding clip - ClipList::iterator clip = mClips.begin(); + // find the corresponding clip (take the last one if multiple + // share the same index) + ClipList::iterator end = mClips.end(), candidate = end; temp = (*it).mClipIdx; - for (ClipList::iterator end = mClips.end(); clip != end; ++clip) { - if ((*clip).idx == temp) - break; + for (ClipList::iterator clip = mClips.begin(); clip != end; ++clip) { + if ((*clip).idx == temp) { + candidate = clip; + } } - if (mClips.end() == clip) { + if (candidate == end) { DefaultLogger::get()->error("LWO2: Clip index is out of bounds"); temp = 0; - // fixme: appearently some LWO files shipping with Doom3 don't + // fixme: apparently some LWO files shipping with Doom3 don't // have clips at all ... check whether that's true or whether // it's a bug in the loader. @@ -188,16 +190,16 @@ bool LWOImporter::HandleTextures(aiMaterial* pcMat, const TextureList& in, aiTex //continue; } else { - if (Clip::UNSUPPORTED == (*clip).type) { + if (Clip::UNSUPPORTED == (*candidate).type) { DefaultLogger::get()->error("LWO2: Clip type is not supported"); continue; } - AdjustTexturePath((*clip).path); - s.Set((*clip).path); + AdjustTexturePath((*candidate).path); + s.Set((*candidate).path); // Additional image settings int flags = 0; - if ((*clip).negate) { + if ((*candidate).negate) { flags |= aiTextureFlags_Invert; } pcMat->AddProperty(&flags,1,AI_MATKEY_TEXFLAGS(type,cur)); From de03173e6d21ac8fb7ee6d6243d7c8f9e3a511ad Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Wed, 18 Sep 2013 14:37:49 +0200 Subject: [PATCH 06/42] CMake: simplify. --- tools/assimp_cmd/CMakeLists.txt | 2 +- tools/assimp_view/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/assimp_cmd/CMakeLists.txt b/tools/assimp_cmd/CMakeLists.txt index 8581eba09..e6f34fefb 100644 --- a/tools/assimp_cmd/CMakeLists.txt +++ b/tools/assimp_cmd/CMakeLists.txt @@ -22,7 +22,7 @@ SET_PROPERTY(TARGET assimp_cmd PROPERTY DEBUG_POSTFIX ${ASSIMP_DEBUG_POSTFIX}) IF( WIN32 ) ADD_CUSTOM_COMMAND(TARGET assimp_cmd PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} $) + COMMAND ${CMAKE_COMMAND} -E copy_if_different $ $) ENDIF( WIN32 ) TARGET_LINK_LIBRARIES( assimp_cmd assimp ${ZLIB_LIBRARIES}) diff --git a/tools/assimp_view/CMakeLists.txt b/tools/assimp_view/CMakeLists.txt index 4673cfeb4..167601b24 100644 --- a/tools/assimp_view/CMakeLists.txt +++ b/tools/assimp_view/CMakeLists.txt @@ -50,7 +50,7 @@ ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS ) # ADD_CUSTOM_COMMAND(TARGET assimp_viewer PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} $) + COMMAND ${CMAKE_COMMAND} -E copy_if_different $ $) # Link the executable to the assimp + dx libs. TARGET_LINK_LIBRARIES ( assimp_viewer assimp ${DirectX_LIBRARY} ${DirectX_D3DX9_LIBRARY} comctl32.lib Winmm.lib ) From 69acdabdef0dd72a7c12d7cc742bc55aee71baf1 Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Wed, 18 Sep 2013 14:42:42 +0200 Subject: [PATCH 07/42] CMake: make assimp_view/assimp_cmd's file copying DEPEND on assimp. --- tools/assimp_cmd/CMakeLists.txt | 3 ++- tools/assimp_view/CMakeLists.txt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/assimp_cmd/CMakeLists.txt b/tools/assimp_cmd/CMakeLists.txt index e6f34fefb..899a8e02a 100644 --- a/tools/assimp_cmd/CMakeLists.txt +++ b/tools/assimp_cmd/CMakeLists.txt @@ -22,7 +22,8 @@ SET_PROPERTY(TARGET assimp_cmd PROPERTY DEBUG_POSTFIX ${ASSIMP_DEBUG_POSTFIX}) IF( WIN32 ) ADD_CUSTOM_COMMAND(TARGET assimp_cmd PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different $ $) + COMMAND ${CMAKE_COMMAND} -E copy_if_different $ $ + MAIN_DEPENDENCY assimp) ENDIF( WIN32 ) TARGET_LINK_LIBRARIES( assimp_cmd assimp ${ZLIB_LIBRARIES}) diff --git a/tools/assimp_view/CMakeLists.txt b/tools/assimp_view/CMakeLists.txt index 167601b24..655a38571 100644 --- a/tools/assimp_view/CMakeLists.txt +++ b/tools/assimp_view/CMakeLists.txt @@ -50,7 +50,8 @@ ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS ) # ADD_CUSTOM_COMMAND(TARGET assimp_viewer PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different $ $) + COMMAND ${CMAKE_COMMAND} -E copy_if_different $ $ + MAIN_DEPENDENCY assimp) # Link the executable to the assimp + dx libs. TARGET_LINK_LIBRARIES ( assimp_viewer assimp ${DirectX_LIBRARY} ${DirectX_D3DX9_LIBRARY} comctl32.lib Winmm.lib ) From 69e9e7c40308444f4762ce0b4835b0b3e62c162c Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Wed, 18 Sep 2013 15:17:04 +0200 Subject: [PATCH 08/42] aiMaterial: use overloads instead of template specializations. This fixes multiple instances of int material properties being accidentally registered as BINARY because the given type was unsigned int. --- include/assimp/material.h | 61 +++++++++++++++++++++++++++++++++++++ include/assimp/material.inl | 43 +++++++++----------------- 2 files changed, 76 insertions(+), 28 deletions(-) diff --git a/include/assimp/material.h b/include/assimp/material.h index 25cb3d6e0..9151c8ec5 100644 --- a/include/assimp/material.h +++ b/include/assimp/material.h @@ -691,6 +691,12 @@ public: aiReturn Get(const char* pKey,unsigned int type, unsigned int idx, Type* pOut, unsigned int* pMax) const; + aiReturn Get(const char* pKey,unsigned int type, + unsigned int idx, int* pOut, unsigned int* pMax) const; + + aiReturn Get(const char* pKey,unsigned int type, + unsigned int idx, float* pOut, unsigned int* pMax) const; + // ------------------------------------------------------------------- /** @brief Retrieve a Type value with a specific key * from the material @@ -705,6 +711,25 @@ public: aiReturn Get(const char* pKey,unsigned int type, unsigned int idx,Type& pOut) const; + + aiReturn Get(const char* pKey,unsigned int type, + unsigned int idx, int& pOut) const; + + aiReturn Get(const char* pKey,unsigned int type, + unsigned int idx, float& pOut) const; + + aiReturn Get(const char* pKey,unsigned int type, + unsigned int idx, aiString& pOut) const; + + aiReturn Get(const char* pKey,unsigned int type, + unsigned int idx, aiColor3D& pOut) const; + + aiReturn Get(const char* pKey,unsigned int type, + unsigned int idx, aiColor4D& pOut) const; + + aiReturn Get(const char* pKey,unsigned int type, + unsigned int idx, aiUVTransform& pOut) const; + // ------------------------------------------------------------------- /** Get the number of textures for a particular texture type. * @param type Texture type to check for @@ -797,6 +822,42 @@ public: unsigned int type = 0, unsigned int index = 0); + aiReturn AddProperty (const aiVector3D* pInput, + unsigned int pNumValues, + const char* pKey, + unsigned int type = 0, + unsigned int index = 0); + + aiReturn AddProperty (const aiColor3D* pInput, + unsigned int pNumValues, + const char* pKey, + unsigned int type = 0, + unsigned int index = 0); + + aiReturn AddProperty (const aiColor4D* pInput, + unsigned int pNumValues, + const char* pKey, + unsigned int type = 0, + unsigned int index = 0); + + aiReturn AddProperty (const int* pInput, + unsigned int pNumValues, + const char* pKey, + unsigned int type = 0, + unsigned int index = 0); + + aiReturn AddProperty (const float* pInput, + unsigned int pNumValues, + const char* pKey, + unsigned int type = 0, + unsigned int index = 0); + + aiReturn AddProperty (const aiUVTransform* pInput, + unsigned int pNumValues, + const char* pKey, + unsigned int type = 0, + unsigned int index = 0); + // ------------------------------------------------------------------------------ /** @brief Remove a given key from the list. * diff --git a/include/assimp/material.inl b/include/assimp/material.inl index 5e9051f4e..027149d00 100644 --- a/include/assimp/material.inl +++ b/include/assimp/material.inl @@ -89,7 +89,7 @@ inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, } iNum = std::min((size_t)iNum,prop->mDataLength / sizeof(Type)); - memcpy(pOut,prop->mData,iNum * sizeof(Type)); + ::memcpy(pOut,prop->mData,iNum * sizeof(Type)); if (pMax) { *pMax = iNum; } @@ -115,51 +115,45 @@ inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, return AI_FAILURE; } - memcpy(&pOut,prop->mData,sizeof(Type)); + ::memcpy(&pOut,prop->mData,sizeof(Type)); } return ret; } // --------------------------------------------------------------------------- -template <> -inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, +inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, unsigned int idx,float* pOut, unsigned int* pMax) const { return ::aiGetMaterialFloatArray(this,pKey,type,idx,pOut,pMax); } // --------------------------------------------------------------------------- -template <> -inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, +inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, unsigned int idx,int* pOut, unsigned int* pMax) const { return ::aiGetMaterialIntegerArray(this,pKey,type,idx,pOut,pMax); } // --------------------------------------------------------------------------- -template <> -inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, +inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, unsigned int idx,float& pOut) const { return aiGetMaterialFloat(this,pKey,type,idx,&pOut); } // --------------------------------------------------------------------------- -template <> -inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, +inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, unsigned int idx,int& pOut) const { return aiGetMaterialInteger(this,pKey,type,idx,&pOut); } // --------------------------------------------------------------------------- -template <> -inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, +inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, unsigned int idx,aiColor4D& pOut) const { return aiGetMaterialColor(this,pKey,type,idx,&pOut); } // --------------------------------------------------------------------------- -template <> -inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, +inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, unsigned int idx,aiColor3D& pOut) const { aiColor4D c; @@ -168,8 +162,7 @@ inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, return ret; } // --------------------------------------------------------------------------- -template <> -inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, +inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, unsigned int idx,aiString& pOut) const { return aiGetMaterialString(this,pKey,type,idx,&pOut); @@ -190,8 +183,7 @@ aiReturn aiMaterial::AddProperty (const TYPE* pInput, } // --------------------------------------------------------------------------- -template<> -inline aiReturn aiMaterial::AddProperty (const float* pInput, +inline aiReturn aiMaterial::AddProperty(const float* pInput, const unsigned int pNumValues, const char* pKey, unsigned int type, @@ -203,8 +195,7 @@ inline aiReturn aiMaterial::AddProperty (const float* pInput, } // --------------------------------------------------------------------------- -template<> -inline aiReturn aiMaterial::AddProperty (const aiUVTransform* pInput, +inline aiReturn aiMaterial::AddProperty(const aiUVTransform* pInput, const unsigned int pNumValues, const char* pKey, unsigned int type, @@ -216,8 +207,7 @@ inline aiReturn aiMaterial::AddProperty (const aiUVTransform* pIn } // --------------------------------------------------------------------------- -template<> -inline aiReturn aiMaterial::AddProperty (const aiColor4D* pInput, +inline aiReturn aiMaterial::AddProperty(const aiColor4D* pInput, const unsigned int pNumValues, const char* pKey, unsigned int type, @@ -229,8 +219,7 @@ inline aiReturn aiMaterial::AddProperty (const aiColor4D* pInput, } // --------------------------------------------------------------------------- -template<> -inline aiReturn aiMaterial::AddProperty (const aiColor3D* pInput, +inline aiReturn aiMaterial::AddProperty(const aiColor3D* pInput, const unsigned int pNumValues, const char* pKey, unsigned int type, @@ -242,8 +231,7 @@ inline aiReturn aiMaterial::AddProperty (const aiColor3D* pInput, } // --------------------------------------------------------------------------- -template<> -inline aiReturn aiMaterial::AddProperty (const aiVector3D* pInput, +inline aiReturn aiMaterial::AddProperty(const aiVector3D* pInput, const unsigned int pNumValues, const char* pKey, unsigned int type, @@ -255,8 +243,7 @@ inline aiReturn aiMaterial::AddProperty (const aiVector3D* pInput, } // --------------------------------------------------------------------------- -template<> -inline aiReturn aiMaterial::AddProperty (const int* pInput, +inline aiReturn aiMaterial::AddProperty(const int* pInput, const unsigned int pNumValues, const char* pKey, unsigned int type, From 0f5272cb508cf32dcba6c14a6b626fca96b95817 Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Wed, 18 Sep 2013 18:35:41 +0200 Subject: [PATCH 09/42] Obj: set aiMesh::mPrimitiveTypes --- code/ObjFileImporter.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/code/ObjFileImporter.cpp b/code/ObjFileImporter.cpp index bb12785e1..aed160738 100644 --- a/code/ObjFileImporter.cpp +++ b/code/ObjFileImporter.cpp @@ -276,14 +276,23 @@ void ObjFileImporter::createTopology(const ObjFile::Model* pModel, for (size_t index = 0; index < pObjMesh->m_Faces.size(); index++) { ObjFile::Face* const inp = pObjMesh->m_Faces[ index ]; + if (inp->m_PrimitiveType == aiPrimitiveType_LINE) { pMesh->mNumFaces += inp->m_pVertices->size() - 1; + pMesh->mPrimitiveTypes |= aiPrimitiveType_LINE; } else if (inp->m_PrimitiveType == aiPrimitiveType_POINT) { pMesh->mNumFaces += inp->m_pVertices->size(); + pMesh->mPrimitiveTypes |= aiPrimitiveType_POINT; } else { ++pMesh->mNumFaces; + if (inp->m_pVertices->size() > 3) { + pMesh->mPrimitiveTypes |= aiPrimitiveType_POLYGON; + } + else { + pMesh->mPrimitiveTypes |= aiPrimitiveType_TRIANGLE; + } } } From e80886f12c748870c73fff8a0258d3a9612118e9 Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Wed, 18 Sep 2013 19:34:03 +0200 Subject: [PATCH 10/42] Obj: support line continuations with \ (fixes #91) --- code/ObjFileParser.cpp | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/code/ObjFileParser.cpp b/code/ObjFileParser.cpp index 83f25c40a..ab8fdd124 100644 --- a/code/ObjFileParser.cpp +++ b/code/ObjFileParser.cpp @@ -200,6 +200,8 @@ void ObjFileParser::copyNextWord(char *pBuffer, size_t length) break; ++m_DataIt; } + + ai_assert(index < length); pBuffer[index] = '\0'; } @@ -207,16 +209,30 @@ void ObjFileParser::copyNextWord(char *pBuffer, size_t length) // Copy the next line into a temporary buffer void ObjFileParser::copyNextLine(char *pBuffer, size_t length) { - size_t index = 0; - while (m_DataIt != m_DataItEnd) - { - if (*m_DataIt == '\n' || *m_DataIt == '\r' || index == length-1) - break; + size_t index = 0u; - pBuffer[ index ] = *m_DataIt; - ++index; - ++m_DataIt; + // some OBJ files have line continuations using \ (such as in C++ et al) + bool continuation = false; + for (;m_DataIt != m_DataItEnd && index < length-1; ++m_DataIt) + { + const char c = *m_DataIt; + if (c == '\\') { + continuation = true; + continue; + } + + if (c == '\n' || c == '\r') { + if(continuation) { + pBuffer[ index++ ] = ' '; + continue; + } + break; + } + + continuation = false; + pBuffer[ index++ ] = c; } + ai_assert(index < length); pBuffer[ index ] = '\0'; } From 90179ec6e3e6f46a3da62cceff0dffa4faac53b6 Mon Sep 17 00:00:00 2001 From: Jared Duke Date: Sat, 21 Sep 2013 10:59:13 -0700 Subject: [PATCH 11/42] Enable SimpleAssimpViewX compilation on OSX Update the XCode projects, and fix several compilation problems. --- .../ModelLoaderHelperClasses.h | 8 +- samples/SimpleAssimpViewX/MyDocument.h | 13 +- samples/SimpleAssimpViewX/MyDocument.mm | 24 ++- .../project.pbxproj | 176 ++++++++++-------- .../xcode3/assimp.xcodeproj/project.pbxproj | 32 ---- 5 files changed, 121 insertions(+), 132 deletions(-) diff --git a/samples/SimpleAssimpViewX/ModelLoaderHelperClasses.h b/samples/SimpleAssimpViewX/ModelLoaderHelperClasses.h index 6e6729bc7..0e6dfab3c 100644 --- a/samples/SimpleAssimpViewX/ModelLoaderHelperClasses.h +++ b/samples/SimpleAssimpViewX/ModelLoaderHelperClasses.h @@ -8,10 +8,10 @@ #import #import -#import "aiColor4D.h" -#import "aiVector3D.h" -#import "aiVector2D.h" -#import "aiMatrix4x4.h" +#import "color4.h" +#import "vector3.h" +#import "vector2.h" +#import "matrix4x4.h" /* workflow: diff --git a/samples/SimpleAssimpViewX/MyDocument.h b/samples/SimpleAssimpViewX/MyDocument.h index 11e836321..16745dc3c 100644 --- a/samples/SimpleAssimpViewX/MyDocument.h +++ b/samples/SimpleAssimpViewX/MyDocument.h @@ -10,9 +10,10 @@ #import "ModelLoaderHelperClasses.h" // assimp include files. These three are usually needed. -#import "assimp.h" -#import "aiPostProcess.h" -#import "aiScene.h" +#import "cimport.h" +#import "postprocess.h" +#import "scene.h" +#import "types.h" #import #import @@ -29,7 +30,7 @@ // Assimp Stuff aiScene* _scene; - struct aiVector3D scene_min, scene_max, scene_center; + aiVector3D scene_min, scene_max, scene_center; double normalizedScale; // Our array of textures. @@ -53,7 +54,7 @@ - (void) deleteGLResourcesInContext:(CGLContextObj)cgl_ctx; - (void) loadTexturesInContext:(CGLContextObj)cgl_ctx withModelPath:(NSString*) modelPath; -- (void) getBoundingBoxWithMinVector:(struct aiVector3D*) min maxVectr:(struct aiVector3D*) max; -- (void) getBoundingBoxForNode:(const struct aiNode*)nd minVector:(struct aiVector3D*) min maxVector:(struct aiVector3D*) max matrix:(struct aiMatrix4x4*) trafo; +- (void) getBoundingBoxWithMinVector:(aiVector3D*) min maxVectr:(aiVector3D*) max; +- (void) getBoundingBoxForNode:(const aiNode*)nd minVector:(aiVector3D*) min maxVector:(aiVector3D*) max matrix:(aiMatrix4x4*) trafo; @end diff --git a/samples/SimpleAssimpViewX/MyDocument.mm b/samples/SimpleAssimpViewX/MyDocument.mm index 7ff025d07..f074126ca 100644 --- a/samples/SimpleAssimpViewX/MyDocument.mm +++ b/samples/SimpleAssimpViewX/MyDocument.mm @@ -6,7 +6,8 @@ // Copyright __MyCompanyName__ 2010 . All rights reserved. // -#import "aiConfig.h" +#import "cimport.h" +#import "config.h" #import "MyDocument.h" #import @@ -16,7 +17,7 @@ #define aisgl_min(x,y) (xx?y:x) -static void color4_to_float4(const struct aiColor4D *c, float f[4]) +static void color4_to_float4(const aiColor4D *c, float f[4]) { f[0] = c->r; f[1] = c->g; @@ -160,7 +161,8 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink,const CVTimeS // Load our new path. // only ever give us triangles. - aiSetImportPropertyInteger(AI_CONFIG_PP_SBP_REMOVE, aiPrimitiveType_LINE | aiPrimitiveType_POINT ); + aiPropertyStore* props = aiCreatePropertyStore(); + aiSetImportPropertyInteger(props, AI_CONFIG_PP_SBP_REMOVE, aiPrimitiveType_LINE | aiPrimitiveType_POINT ); NSUInteger aiPostProccesFlags; @@ -181,7 +183,9 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink,const CVTimeS } // aiProcess_FlipUVs is needed for VAO / VBOs, not sure why. - _scene = (aiScene*) aiImportFile([[openPanel filename] cStringUsingEncoding:[NSString defaultCStringEncoding]], aiPostProccesFlags | aiProcess_Triangulate | aiProcess_FlipUVs | aiProcess_PreTransformVertices | 0 ); + _scene = (aiScene*) aiImportFileExWithProperties([[openPanel filename] cStringUsingEncoding:[NSString defaultCStringEncoding]], aiPostProccesFlags | aiProcess_Triangulate | aiProcess_FlipUVs | aiProcess_PreTransformVertices | 0, NULL, props); + + aiReleasePropertyStore(props); if (_scene) { @@ -755,9 +759,9 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink,const CVTimeS } -- (void) getBoundingBoxWithMinVector:(struct aiVector3D*) min maxVectr:(struct aiVector3D*) max +- (void) getBoundingBoxWithMinVector:(aiVector3D*) min maxVectr:(aiVector3D*) max { - struct aiMatrix4x4 trafo; + aiMatrix4x4 trafo; aiIdentityMatrix4(&trafo); min->x = min->y = min->z = 1e10f; @@ -766,9 +770,9 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink,const CVTimeS [self getBoundingBoxForNode:_scene->mRootNode minVector:min maxVector:max matrix:&trafo]; } -- (void) getBoundingBoxForNode:(const struct aiNode*)nd minVector:(struct aiVector3D*) min maxVector:(struct aiVector3D*) max matrix:(struct aiMatrix4x4*) trafo +- (void) getBoundingBoxForNode:(const aiNode*)nd minVector:(aiVector3D*) min maxVector:(aiVector3D*) max matrix:(aiMatrix4x4*) trafo { - struct aiMatrix4x4 prev; + aiMatrix4x4 prev; unsigned int n = 0, t; prev = *trafo; @@ -776,10 +780,10 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink,const CVTimeS for (; n < nd->mNumMeshes; ++n) { - const struct aiMesh* mesh = _scene->mMeshes[nd->mMeshes[n]]; + const aiMesh* mesh = _scene->mMeshes[nd->mMeshes[n]]; for (t = 0; t < mesh->mNumVertices; ++t) { - struct aiVector3D tmp = mesh->mVertices[t]; + aiVector3D tmp = mesh->mVertices[t]; aiTransformVecByMatrix4(&tmp,trafo); min->x = aisgl_min(min->x,tmp.x); diff --git a/samples/SimpleAssimpViewX/SimpleAssimpViewX.xcodeproj/project.pbxproj b/samples/SimpleAssimpViewX/SimpleAssimpViewX.xcodeproj/project.pbxproj index 71e73044f..625b92cd9 100644 --- a/samples/SimpleAssimpViewX/SimpleAssimpViewX.xcodeproj/project.pbxproj +++ b/samples/SimpleAssimpViewX/SimpleAssimpViewX.xcodeproj/project.pbxproj @@ -9,11 +9,6 @@ /* Begin PBXBuildFile section */ 1B0E9A901279ED43003108E7 /* libassimp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B0E9A8F1279ED43003108E7 /* libassimp.a */; }; 1B0E9A951279EDCD003108E7 /* ModelLoaderHelperClasses.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1B0E9A941279EDCD003108E7 /* ModelLoaderHelperClasses.mm */; }; - 1B0E9AF51279EFCC003108E7 /* aiColor4D.inl in Resources */ = {isa = PBXBuildFile; fileRef = 1B0E9AD71279EFCC003108E7 /* aiColor4D.inl */; }; - 1B0E9AF61279EFCC003108E7 /* aiMaterial.inl in Resources */ = {isa = PBXBuildFile; fileRef = 1B0E9ADD1279EFCC003108E7 /* aiMaterial.inl */; }; - 1B0E9AF71279EFCC003108E7 /* aiMatrix3x3.inl in Resources */ = {isa = PBXBuildFile; fileRef = 1B0E9ADF1279EFCC003108E7 /* aiMatrix3x3.inl */; }; - 1B0E9AF81279EFCC003108E7 /* aiMatrix4x4.inl in Resources */ = {isa = PBXBuildFile; fileRef = 1B0E9AE11279EFCC003108E7 /* aiMatrix4x4.inl */; }; - 1B0E9AF91279EFCC003108E7 /* aiVector3D.inl in Resources */ = {isa = PBXBuildFile; fileRef = 1B0E9AEA1279EFCC003108E7 /* aiVector3D.inl */; }; 1B0E9B1A1279F107003108E7 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B0E9B191279F107003108E7 /* libz.dylib */; }; 1BDF446B127772AF00D3E723 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1BDF446A127772AF00D3E723 /* OpenGL.framework */; }; 1BDF446F127772AF00D3E723 /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1BDF446E127772AF00D3E723 /* Quartz.framework */; }; @@ -25,6 +20,13 @@ 8D15AC2F0486D014006FF6A4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165FFE840EACC02AAC07 /* InfoPlist.strings */; }; 8D15AC310486D014006FF6A4 /* MyDocument.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2A37F4ACFDCFA73011CA2CEA /* MyDocument.mm */; settings = {ATTRIBUTES = (); }; }; 8D15AC320486D014006FF6A4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A37F4B0FDCFA73011CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; + C75BB4F617EE0B64004F0260 /* color4.inl in Resources */ = {isa = PBXBuildFile; fileRef = C75BB4F117EE0B64004F0260 /* color4.inl */; }; + C75BB4F717EE0B64004F0260 /* quaternion.inl in Resources */ = {isa = PBXBuildFile; fileRef = C75BB4F517EE0B64004F0260 /* quaternion.inl */; }; + C75BB51417EE0B75004F0260 /* material.inl in Resources */ = {isa = PBXBuildFile; fileRef = C75BB50317EE0B75004F0260 /* material.inl */; }; + C75BB51517EE0B75004F0260 /* matrix3x3.inl in Resources */ = {isa = PBXBuildFile; fileRef = C75BB50517EE0B75004F0260 /* matrix3x3.inl */; }; + C75BB51617EE0B75004F0260 /* matrix4x4.inl in Resources */ = {isa = PBXBuildFile; fileRef = C75BB50717EE0B75004F0260 /* matrix4x4.inl */; }; + C75BB51717EE0B75004F0260 /* vector2.inl in Resources */ = {isa = PBXBuildFile; fileRef = C75BB51017EE0B75004F0260 /* vector2.inl */; }; + C75BB51817EE0B75004F0260 /* vector3.inl in Resources */ = {isa = PBXBuildFile; fileRef = C75BB51217EE0B75004F0260 /* vector3.inl */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -33,40 +35,6 @@ 1B0E9A8F1279ED43003108E7 /* libassimp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libassimp.a; sourceTree = ""; }; 1B0E9A931279EDCD003108E7 /* ModelLoaderHelperClasses.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModelLoaderHelperClasses.h; sourceTree = ""; }; 1B0E9A941279EDCD003108E7 /* ModelLoaderHelperClasses.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ModelLoaderHelperClasses.mm; sourceTree = ""; }; - 1B0E9AD31279EFCC003108E7 /* aiAnim.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aiAnim.h; sourceTree = ""; }; - 1B0E9AD41279EFCC003108E7 /* aiAssert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aiAssert.h; sourceTree = ""; }; - 1B0E9AD51279EFCC003108E7 /* aiCamera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aiCamera.h; sourceTree = ""; }; - 1B0E9AD61279EFCC003108E7 /* aiColor4D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aiColor4D.h; sourceTree = ""; }; - 1B0E9AD71279EFCC003108E7 /* aiColor4D.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = aiColor4D.inl; sourceTree = ""; }; - 1B0E9AD81279EFCC003108E7 /* aiConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aiConfig.h; sourceTree = ""; }; - 1B0E9AD91279EFCC003108E7 /* aiDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aiDefines.h; sourceTree = ""; }; - 1B0E9ADA1279EFCC003108E7 /* aiFileIO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aiFileIO.h; sourceTree = ""; }; - 1B0E9ADB1279EFCC003108E7 /* aiLight.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aiLight.h; sourceTree = ""; }; - 1B0E9ADC1279EFCC003108E7 /* aiMaterial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aiMaterial.h; sourceTree = ""; }; - 1B0E9ADD1279EFCC003108E7 /* aiMaterial.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = aiMaterial.inl; sourceTree = ""; }; - 1B0E9ADE1279EFCC003108E7 /* aiMatrix3x3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aiMatrix3x3.h; sourceTree = ""; }; - 1B0E9ADF1279EFCC003108E7 /* aiMatrix3x3.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = aiMatrix3x3.inl; sourceTree = ""; }; - 1B0E9AE01279EFCC003108E7 /* aiMatrix4x4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aiMatrix4x4.h; sourceTree = ""; }; - 1B0E9AE11279EFCC003108E7 /* aiMatrix4x4.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = aiMatrix4x4.inl; sourceTree = ""; }; - 1B0E9AE21279EFCC003108E7 /* aiMesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aiMesh.h; sourceTree = ""; }; - 1B0E9AE31279EFCC003108E7 /* aiPostProcess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aiPostProcess.h; sourceTree = ""; }; - 1B0E9AE41279EFCC003108E7 /* aiQuaternion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aiQuaternion.h; sourceTree = ""; }; - 1B0E9AE51279EFCC003108E7 /* aiScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aiScene.h; sourceTree = ""; }; - 1B0E9AE61279EFCC003108E7 /* aiTexture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aiTexture.h; sourceTree = ""; }; - 1B0E9AE71279EFCC003108E7 /* aiTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aiTypes.h; sourceTree = ""; }; - 1B0E9AE81279EFCC003108E7 /* aiVector2D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aiVector2D.h; sourceTree = ""; }; - 1B0E9AE91279EFCC003108E7 /* aiVector3D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aiVector3D.h; sourceTree = ""; }; - 1B0E9AEA1279EFCC003108E7 /* aiVector3D.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = aiVector3D.inl; sourceTree = ""; }; - 1B0E9AEB1279EFCC003108E7 /* aiVersion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aiVersion.h; sourceTree = ""; }; - 1B0E9AEC1279EFCC003108E7 /* assimp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = assimp.h; sourceTree = ""; }; - 1B0E9AED1279EFCC003108E7 /* assimp.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = assimp.hpp; sourceTree = ""; }; - 1B0E9AEE1279EFCC003108E7 /* DefaultLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DefaultLogger.h; sourceTree = ""; }; - 1B0E9AEF1279EFCC003108E7 /* IOStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOStream.h; sourceTree = ""; }; - 1B0E9AF01279EFCC003108E7 /* IOSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSystem.h; sourceTree = ""; }; - 1B0E9AF11279EFCC003108E7 /* Logger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Logger.h; sourceTree = ""; }; - 1B0E9AF21279EFCC003108E7 /* LogStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LogStream.h; sourceTree = ""; }; - 1B0E9AF31279EFCC003108E7 /* NullLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NullLogger.h; sourceTree = ""; }; - 1B0E9AF41279EFCC003108E7 /* ProgressHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProgressHandler.h; sourceTree = ""; }; 1B0E9AFD1279F006003108E7 /* poppack1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = poppack1.h; path = "/Users/vade/Asset Import/include/Compiler/poppack1.h"; sourceTree = ""; }; 1B0E9AFE1279F006003108E7 /* pushpack1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pushpack1.h; path = "/Users/vade/Asset Import/include/Compiler/pushpack1.h"; sourceTree = ""; }; 1B0E9B191279F107003108E7 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; @@ -85,6 +53,46 @@ 7788DA0506752A1600599AAD /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; 8D15AC360486D014006FF6A4 /* SimpleAssimpViewX-Info.plist */ = {isa = PBXFileReference; explicitFileType = text.plist.xml; fileEncoding = 4; path = "SimpleAssimpViewX-Info.plist"; sourceTree = ""; }; 8D15AC370486D014006FF6A4 /* SimpleAssimpViewX.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SimpleAssimpViewX.app; sourceTree = BUILT_PRODUCTS_DIR; }; + C75BB4EA17EE0B64004F0260 /* ai_assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ai_assert.h; sourceTree = ""; }; + C75BB4EB17EE0B64004F0260 /* anim.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = anim.h; sourceTree = ""; }; + C75BB4EC17EE0B64004F0260 /* camera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = camera.h; sourceTree = ""; }; + C75BB4ED17EE0B64004F0260 /* cexport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cexport.h; sourceTree = ""; }; + C75BB4EE17EE0B64004F0260 /* cfileio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cfileio.h; sourceTree = ""; }; + C75BB4EF17EE0B64004F0260 /* cimport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cimport.h; sourceTree = ""; }; + C75BB4F017EE0B64004F0260 /* color4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = color4.h; sourceTree = ""; }; + C75BB4F117EE0B64004F0260 /* color4.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = color4.inl; sourceTree = ""; }; + C75BB4F217EE0B64004F0260 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = ""; }; + C75BB4F317EE0B64004F0260 /* metadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = metadata.h; sourceTree = ""; }; + C75BB4F417EE0B64004F0260 /* NullLogger.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = NullLogger.hpp; sourceTree = ""; }; + C75BB4F517EE0B64004F0260 /* quaternion.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = quaternion.inl; sourceTree = ""; }; + C75BB4F817EE0B75004F0260 /* DefaultLogger.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = DefaultLogger.hpp; sourceTree = ""; }; + C75BB4F917EE0B75004F0260 /* defs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = defs.h; sourceTree = ""; }; + C75BB4FA17EE0B75004F0260 /* Exporter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Exporter.hpp; sourceTree = ""; }; + C75BB4FB17EE0B75004F0260 /* Importer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Importer.hpp; sourceTree = ""; }; + C75BB4FC17EE0B75004F0260 /* importerdesc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = importerdesc.h; sourceTree = ""; }; + C75BB4FD17EE0B75004F0260 /* IOStream.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = IOStream.hpp; sourceTree = ""; }; + C75BB4FE17EE0B75004F0260 /* IOSystem.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = IOSystem.hpp; sourceTree = ""; }; + C75BB4FF17EE0B75004F0260 /* light.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = light.h; sourceTree = ""; }; + C75BB50017EE0B75004F0260 /* Logger.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Logger.hpp; sourceTree = ""; }; + C75BB50117EE0B75004F0260 /* LogStream.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = LogStream.hpp; sourceTree = ""; }; + C75BB50217EE0B75004F0260 /* material.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = material.h; sourceTree = ""; }; + C75BB50317EE0B75004F0260 /* material.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = material.inl; sourceTree = ""; }; + C75BB50417EE0B75004F0260 /* matrix3x3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = matrix3x3.h; sourceTree = ""; }; + C75BB50517EE0B75004F0260 /* matrix3x3.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = matrix3x3.inl; sourceTree = ""; }; + C75BB50617EE0B75004F0260 /* matrix4x4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = matrix4x4.h; sourceTree = ""; }; + C75BB50717EE0B75004F0260 /* matrix4x4.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = matrix4x4.inl; sourceTree = ""; }; + C75BB50817EE0B75004F0260 /* mesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mesh.h; sourceTree = ""; }; + C75BB50917EE0B75004F0260 /* postprocess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = postprocess.h; sourceTree = ""; }; + C75BB50A17EE0B75004F0260 /* ProgressHandler.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ProgressHandler.hpp; sourceTree = ""; }; + C75BB50B17EE0B75004F0260 /* quaternion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = quaternion.h; sourceTree = ""; }; + C75BB50C17EE0B75004F0260 /* scene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scene.h; sourceTree = ""; }; + C75BB50D17EE0B75004F0260 /* texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = texture.h; sourceTree = ""; }; + C75BB50E17EE0B75004F0260 /* types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = types.h; sourceTree = ""; }; + C75BB50F17EE0B75004F0260 /* vector2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vector2.h; sourceTree = ""; }; + C75BB51017EE0B75004F0260 /* vector2.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = vector2.inl; sourceTree = ""; }; + C75BB51117EE0B75004F0260 /* vector3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vector3.h; sourceTree = ""; }; + C75BB51217EE0B75004F0260 /* vector3.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = vector3.inl; sourceTree = ""; }; + C75BB51317EE0B75004F0260 /* version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = version.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -134,40 +142,46 @@ 1B0E9AD21279EFCC003108E7 /* include */ = { isa = PBXGroup; children = ( - 1B0E9AD31279EFCC003108E7 /* aiAnim.h */, - 1B0E9AD41279EFCC003108E7 /* aiAssert.h */, - 1B0E9AD51279EFCC003108E7 /* aiCamera.h */, - 1B0E9AD61279EFCC003108E7 /* aiColor4D.h */, - 1B0E9AD71279EFCC003108E7 /* aiColor4D.inl */, - 1B0E9AD81279EFCC003108E7 /* aiConfig.h */, - 1B0E9AD91279EFCC003108E7 /* aiDefines.h */, - 1B0E9ADA1279EFCC003108E7 /* aiFileIO.h */, - 1B0E9ADB1279EFCC003108E7 /* aiLight.h */, - 1B0E9ADC1279EFCC003108E7 /* aiMaterial.h */, - 1B0E9ADD1279EFCC003108E7 /* aiMaterial.inl */, - 1B0E9ADE1279EFCC003108E7 /* aiMatrix3x3.h */, - 1B0E9ADF1279EFCC003108E7 /* aiMatrix3x3.inl */, - 1B0E9AE01279EFCC003108E7 /* aiMatrix4x4.h */, - 1B0E9AE11279EFCC003108E7 /* aiMatrix4x4.inl */, - 1B0E9AE21279EFCC003108E7 /* aiMesh.h */, - 1B0E9AE31279EFCC003108E7 /* aiPostProcess.h */, - 1B0E9AE41279EFCC003108E7 /* aiQuaternion.h */, - 1B0E9AE51279EFCC003108E7 /* aiScene.h */, - 1B0E9AE61279EFCC003108E7 /* aiTexture.h */, - 1B0E9AE71279EFCC003108E7 /* aiTypes.h */, - 1B0E9AE81279EFCC003108E7 /* aiVector2D.h */, - 1B0E9AE91279EFCC003108E7 /* aiVector3D.h */, - 1B0E9AEA1279EFCC003108E7 /* aiVector3D.inl */, - 1B0E9AEB1279EFCC003108E7 /* aiVersion.h */, - 1B0E9AEC1279EFCC003108E7 /* assimp.h */, - 1B0E9AED1279EFCC003108E7 /* assimp.hpp */, - 1B0E9AEE1279EFCC003108E7 /* DefaultLogger.h */, - 1B0E9AEF1279EFCC003108E7 /* IOStream.h */, - 1B0E9AF01279EFCC003108E7 /* IOSystem.h */, - 1B0E9AF11279EFCC003108E7 /* Logger.h */, - 1B0E9AF21279EFCC003108E7 /* LogStream.h */, - 1B0E9AF31279EFCC003108E7 /* NullLogger.h */, - 1B0E9AF41279EFCC003108E7 /* ProgressHandler.h */, + C75BB4F817EE0B75004F0260 /* DefaultLogger.hpp */, + C75BB4F917EE0B75004F0260 /* defs.h */, + C75BB4FA17EE0B75004F0260 /* Exporter.hpp */, + C75BB4FB17EE0B75004F0260 /* Importer.hpp */, + C75BB4FC17EE0B75004F0260 /* importerdesc.h */, + C75BB4FD17EE0B75004F0260 /* IOStream.hpp */, + C75BB4FE17EE0B75004F0260 /* IOSystem.hpp */, + C75BB4FF17EE0B75004F0260 /* light.h */, + C75BB50017EE0B75004F0260 /* Logger.hpp */, + C75BB50117EE0B75004F0260 /* LogStream.hpp */, + C75BB50217EE0B75004F0260 /* material.h */, + C75BB50317EE0B75004F0260 /* material.inl */, + C75BB50417EE0B75004F0260 /* matrix3x3.h */, + C75BB50517EE0B75004F0260 /* matrix3x3.inl */, + C75BB50617EE0B75004F0260 /* matrix4x4.h */, + C75BB50717EE0B75004F0260 /* matrix4x4.inl */, + C75BB50817EE0B75004F0260 /* mesh.h */, + C75BB50917EE0B75004F0260 /* postprocess.h */, + C75BB50A17EE0B75004F0260 /* ProgressHandler.hpp */, + C75BB50B17EE0B75004F0260 /* quaternion.h */, + C75BB50C17EE0B75004F0260 /* scene.h */, + C75BB50D17EE0B75004F0260 /* texture.h */, + C75BB50E17EE0B75004F0260 /* types.h */, + C75BB50F17EE0B75004F0260 /* vector2.h */, + C75BB51017EE0B75004F0260 /* vector2.inl */, + C75BB51117EE0B75004F0260 /* vector3.h */, + C75BB51217EE0B75004F0260 /* vector3.inl */, + C75BB51317EE0B75004F0260 /* version.h */, + C75BB4EA17EE0B64004F0260 /* ai_assert.h */, + C75BB4EB17EE0B64004F0260 /* anim.h */, + C75BB4EC17EE0B64004F0260 /* camera.h */, + C75BB4ED17EE0B64004F0260 /* cexport.h */, + C75BB4EE17EE0B64004F0260 /* cfileio.h */, + C75BB4EF17EE0B64004F0260 /* cimport.h */, + C75BB4F017EE0B64004F0260 /* color4.h */, + C75BB4F117EE0B64004F0260 /* color4.inl */, + C75BB4F217EE0B64004F0260 /* config.h */, + C75BB4F317EE0B64004F0260 /* metadata.h */, + C75BB4F417EE0B64004F0260 /* NullLogger.hpp */, + C75BB4F517EE0B64004F0260 /* quaternion.inl */, 1B0E9AFC1279F006003108E7 /* Compiler */, ); path = include; @@ -295,11 +309,13 @@ 8D15AC2F0486D014006FF6A4 /* InfoPlist.strings in Resources */, 2F7446AB0DB6BCF400F9684A /* MainMenu.xib in Resources */, 2F7446AC0DB6BCF400F9684A /* MyDocument.xib in Resources */, - 1B0E9AF51279EFCC003108E7 /* aiColor4D.inl in Resources */, - 1B0E9AF61279EFCC003108E7 /* aiMaterial.inl in Resources */, - 1B0E9AF71279EFCC003108E7 /* aiMatrix3x3.inl in Resources */, - 1B0E9AF81279EFCC003108E7 /* aiMatrix4x4.inl in Resources */, - 1B0E9AF91279EFCC003108E7 /* aiVector3D.inl in Resources */, + C75BB4F617EE0B64004F0260 /* color4.inl in Resources */, + C75BB4F717EE0B64004F0260 /* quaternion.inl in Resources */, + C75BB51417EE0B75004F0260 /* material.inl in Resources */, + C75BB51517EE0B75004F0260 /* matrix3x3.inl in Resources */, + C75BB51617EE0B75004F0260 /* matrix4x4.inl in Resources */, + C75BB51717EE0B75004F0260 /* vector2.inl in Resources */, + C75BB51817EE0B75004F0260 /* vector3.inl in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -413,7 +429,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; - SDKROOT = macosx10.6; + SDKROOT = macosx; }; name = Debug; }; @@ -425,7 +441,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; PREBINDING = NO; - SDKROOT = macosx10.6; + SDKROOT = macosx; }; name = Release; }; diff --git a/workspaces/xcode3/assimp.xcodeproj/project.pbxproj b/workspaces/xcode3/assimp.xcodeproj/project.pbxproj index e0e268982..e6c5b6b11 100644 --- a/workspaces/xcode3/assimp.xcodeproj/project.pbxproj +++ b/workspaces/xcode3/assimp.xcodeproj/project.pbxproj @@ -1487,7 +1487,6 @@ B919758A163AEA54009C397B /* version.h in Headers */ = {isa = PBXBuildFile; fileRef = F9BA8B9E1543268400E63FFE /* version.h */; settings = {ATTRIBUTES = (Public, ); }; }; B919758B163AEA54009C397B /* OgreImporter.hpp in Headers */ = {isa = PBXBuildFile; fileRef = F9BA8C36154328B600E63FFE /* OgreImporter.hpp */; }; B919758C163AEA54009C397B /* OgreXmlHelper.hpp in Headers */ = {isa = PBXBuildFile; fileRef = F9BA8C3A154328B600E63FFE /* OgreXmlHelper.hpp */; }; - B9197595163AEA54009C397B /* M3Importer.h in Headers */ = {isa = PBXBuildFile; fileRef = F99A9F2715436207000682F3 /* M3Importer.h */; }; B9197596163AEA54009C397B /* PlyExporter.h in Headers */ = {isa = PBXBuildFile; fileRef = F99A9F3115436269000682F3 /* PlyExporter.h */; }; B919759C163AEA54009C397B /* crc32.h in Headers */ = {isa = PBXBuildFile; fileRef = F960704B154366AB004D91DD /* crc32.h */; }; B919759D163AEA54009C397B /* deflate.h in Headers */ = {isa = PBXBuildFile; fileRef = F960704D154366AB004D91DD /* deflate.h */; }; @@ -1565,7 +1564,6 @@ B919761A163AEA54009C397B /* OgreMaterial.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9BA8C37154328B600E63FFE /* OgreMaterial.cpp */; }; B919761B163AEA54009C397B /* OgreMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9BA8C38154328B600E63FFE /* OgreMesh.cpp */; }; B919761C163AEA54009C397B /* OgreSkeleton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9BA8C39154328B600E63FFE /* OgreSkeleton.cpp */; }; - B919761F163AEA54009C397B /* M3Importer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99A9F2615436207000682F3 /* M3Importer.cpp */; }; B9197620163AEA54009C397B /* PlyExporter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99A9F3015436269000682F3 /* PlyExporter.cpp */; }; B9197625163AEA54009C397B /* adler32.c in Sources */ = {isa = PBXBuildFile; fileRef = F9607047154366AB004D91DD /* adler32.c */; }; B9197626163AEA54009C397B /* compress.c in Sources */ = {isa = PBXBuildFile; fileRef = F9607049154366AB004D91DD /* compress.c */; }; @@ -1830,14 +1828,6 @@ F97BA03715439DB3009EB9DD /* ai_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = F97BA03515439DB3009EB9DD /* ai_assert.h */; }; F97BA03815439DB3009EB9DD /* ai_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = F97BA03515439DB3009EB9DD /* ai_assert.h */; }; F97BA03915439DB3009EB9DD /* ai_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = F97BA03515439DB3009EB9DD /* ai_assert.h */; }; - F99A9F2815436207000682F3 /* M3Importer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99A9F2615436207000682F3 /* M3Importer.cpp */; }; - F99A9F2915436207000682F3 /* M3Importer.h in Headers */ = {isa = PBXBuildFile; fileRef = F99A9F2715436207000682F3 /* M3Importer.h */; }; - F99A9F2A15436207000682F3 /* M3Importer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99A9F2615436207000682F3 /* M3Importer.cpp */; }; - F99A9F2B15436207000682F3 /* M3Importer.h in Headers */ = {isa = PBXBuildFile; fileRef = F99A9F2715436207000682F3 /* M3Importer.h */; }; - F99A9F2C15436207000682F3 /* M3Importer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99A9F2615436207000682F3 /* M3Importer.cpp */; }; - F99A9F2D15436207000682F3 /* M3Importer.h in Headers */ = {isa = PBXBuildFile; fileRef = F99A9F2715436207000682F3 /* M3Importer.h */; }; - F99A9F2E15436207000682F3 /* M3Importer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99A9F2615436207000682F3 /* M3Importer.cpp */; }; - F99A9F2F15436207000682F3 /* M3Importer.h in Headers */ = {isa = PBXBuildFile; fileRef = F99A9F2715436207000682F3 /* M3Importer.h */; }; F99A9F3215436269000682F3 /* PlyExporter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99A9F3015436269000682F3 /* PlyExporter.cpp */; }; F99A9F3315436269000682F3 /* PlyExporter.h in Headers */ = {isa = PBXBuildFile; fileRef = F99A9F3115436269000682F3 /* PlyExporter.h */; }; F99A9F3415436269000682F3 /* PlyExporter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F99A9F3015436269000682F3 /* PlyExporter.cpp */; }; @@ -2369,8 +2359,6 @@ F96070DD1543675E004D91DD /* sweep_context.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sweep_context.cc; sourceTree = ""; }; F96070DE1543675E004D91DD /* sweep_context.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sweep_context.h; sourceTree = ""; }; F97BA03515439DB3009EB9DD /* ai_assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ai_assert.h; sourceTree = ""; }; - F99A9F2615436207000682F3 /* M3Importer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = M3Importer.cpp; path = ../../code/M3Importer.cpp; sourceTree = SOURCE_ROOT; }; - F99A9F2715436207000682F3 /* M3Importer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = M3Importer.h; path = ../../code/M3Importer.h; sourceTree = SOURCE_ROOT; }; F99A9F3015436269000682F3 /* PlyExporter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlyExporter.cpp; sourceTree = ""; }; F99A9F3115436269000682F3 /* PlyExporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlyExporter.h; sourceTree = ""; }; F9BA8B751543268400E63FFE /* anim.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = anim.h; sourceTree = ""; }; @@ -3173,7 +3161,6 @@ F90BAFD40F5DD8F200124155 /* IRR */, 3AB8A3A80E50D5F400606590 /* LWO */, 7411B15811416D6600BCD793 /* LWS */, - F99A9F21154361F8000682F3 /* M3 */, 3AF45B870E4B74DA00207D74 /* MD2 */, 3AF45B880E4B751000207D74 /* MD3 */, 3AF45B8A0E4B755E00207D74 /* MD5 */, @@ -3309,15 +3296,6 @@ name = IFC; sourceTree = ""; }; - F99A9F21154361F8000682F3 /* M3 */ = { - isa = PBXGroup; - children = ( - F99A9F2615436207000682F3 /* M3Importer.cpp */, - F99A9F2715436207000682F3 /* M3Importer.h */, - ); - name = M3; - sourceTree = ""; - }; F99A9F5315436318000682F3 /* STEP */ = { isa = PBXGroup; children = ( @@ -3499,7 +3477,6 @@ F9BA8C041543268400E63FFE /* version.h in Headers */, F9BA8C48154328B600E63FFE /* OgreImporter.hpp in Headers */, F9BA8C4C154328B600E63FFE /* OgreXmlHelper.hpp in Headers */, - F99A9F2D15436207000682F3 /* M3Importer.h in Headers */, F99A9F3715436269000682F3 /* PlyExporter.h in Headers */, F9607088154366AB004D91DD /* crc32.h in Headers */, F960708A154366AB004D91DD /* deflate.h in Headers */, @@ -3748,7 +3725,6 @@ F9BA8C261543268400E63FFE /* version.h in Headers */, F9BA8C4E154328B600E63FFE /* OgreImporter.hpp in Headers */, F9BA8C52154328B600E63FFE /* OgreXmlHelper.hpp in Headers */, - F99A9F2F15436207000682F3 /* M3Importer.h in Headers */, F99A9F3915436269000682F3 /* PlyExporter.h in Headers */, F960709C154366AB004D91DD /* crc32.h in Headers */, F960709E154366AB004D91DD /* deflate.h in Headers */, @@ -3997,7 +3973,6 @@ B919758A163AEA54009C397B /* version.h in Headers */, B919758B163AEA54009C397B /* OgreImporter.hpp in Headers */, B919758C163AEA54009C397B /* OgreXmlHelper.hpp in Headers */, - B9197595163AEA54009C397B /* M3Importer.h in Headers */, B9197596163AEA54009C397B /* PlyExporter.h in Headers */, B919759C163AEA54009C397B /* crc32.h in Headers */, B919759D163AEA54009C397B /* deflate.h in Headers */, @@ -4246,7 +4221,6 @@ F9BA8BC01543268400E63FFE /* version.h in Headers */, F9BA8C3C154328B600E63FFE /* OgreImporter.hpp in Headers */, F9BA8C40154328B600E63FFE /* OgreXmlHelper.hpp in Headers */, - F99A9F2915436207000682F3 /* M3Importer.h in Headers */, F99A9F3315436269000682F3 /* PlyExporter.h in Headers */, F9607060154366AB004D91DD /* crc32.h in Headers */, F9607062154366AB004D91DD /* deflate.h in Headers */, @@ -4495,7 +4469,6 @@ F9BA8BE21543268400E63FFE /* version.h in Headers */, F9BA8C42154328B600E63FFE /* OgreImporter.hpp in Headers */, F9BA8C46154328B600E63FFE /* OgreXmlHelper.hpp in Headers */, - F99A9F2B15436207000682F3 /* M3Importer.h in Headers */, F99A9F3515436269000682F3 /* PlyExporter.h in Headers */, F9607074154366AB004D91DD /* crc32.h in Headers */, F9607076154366AB004D91DD /* deflate.h in Headers */, @@ -4815,7 +4788,6 @@ F9BA8C49154328B600E63FFE /* OgreMaterial.cpp in Sources */, F9BA8C4A154328B600E63FFE /* OgreMesh.cpp in Sources */, F9BA8C4B154328B600E63FFE /* OgreSkeleton.cpp in Sources */, - F99A9F2C15436207000682F3 /* M3Importer.cpp in Sources */, F99A9F3615436269000682F3 /* PlyExporter.cpp in Sources */, F9607085154366AB004D91DD /* adler32.c in Sources */, F9607086154366AB004D91DD /* compress.c in Sources */, @@ -4978,7 +4950,6 @@ F9BA8C4F154328B600E63FFE /* OgreMaterial.cpp in Sources */, F9BA8C50154328B600E63FFE /* OgreMesh.cpp in Sources */, F9BA8C51154328B600E63FFE /* OgreSkeleton.cpp in Sources */, - F99A9F2E15436207000682F3 /* M3Importer.cpp in Sources */, F99A9F3815436269000682F3 /* PlyExporter.cpp in Sources */, F9607099154366AB004D91DD /* adler32.c in Sources */, F960709A154366AB004D91DD /* compress.c in Sources */, @@ -5141,7 +5112,6 @@ B919761A163AEA54009C397B /* OgreMaterial.cpp in Sources */, B919761B163AEA54009C397B /* OgreMesh.cpp in Sources */, B919761C163AEA54009C397B /* OgreSkeleton.cpp in Sources */, - B919761F163AEA54009C397B /* M3Importer.cpp in Sources */, B9197620163AEA54009C397B /* PlyExporter.cpp in Sources */, B9197625163AEA54009C397B /* adler32.c in Sources */, B9197626163AEA54009C397B /* compress.c in Sources */, @@ -5304,7 +5274,6 @@ F9BA8C3D154328B600E63FFE /* OgreMaterial.cpp in Sources */, F9BA8C3E154328B600E63FFE /* OgreMesh.cpp in Sources */, F9BA8C3F154328B600E63FFE /* OgreSkeleton.cpp in Sources */, - F99A9F2815436207000682F3 /* M3Importer.cpp in Sources */, F99A9F3215436269000682F3 /* PlyExporter.cpp in Sources */, F960705D154366AB004D91DD /* adler32.c in Sources */, F960705E154366AB004D91DD /* compress.c in Sources */, @@ -5467,7 +5436,6 @@ F9BA8C43154328B600E63FFE /* OgreMaterial.cpp in Sources */, F9BA8C44154328B600E63FFE /* OgreMesh.cpp in Sources */, F9BA8C45154328B600E63FFE /* OgreSkeleton.cpp in Sources */, - F99A9F2A15436207000682F3 /* M3Importer.cpp in Sources */, F99A9F3415436269000682F3 /* PlyExporter.cpp in Sources */, F9607071154366AB004D91DD /* adler32.c in Sources */, F9607072154366AB004D91DD /* compress.c in Sources */, From 6f4632e4d903c6e212d205d981aafea74290dc83 Mon Sep 17 00:00:00 2001 From: Jared Duke Date: Wed, 25 Sep 2013 13:25:02 -0700 Subject: [PATCH 12/42] Allow spaces before the ascii STL header keyword The text "solid" is the general STL header indicator that the file is in fact an ascii STL archive. Allows spaces to precede the "solid" keyword, providing compatibility with exporters that insert such (non-compliant )spaces. --- code/STLLoader.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/code/STLLoader.cpp b/code/STLLoader.cpp index fff58d04a..39c6ac9cd 100644 --- a/code/STLLoader.cpp +++ b/code/STLLoader.cpp @@ -86,7 +86,12 @@ bool IsAsciiSTL(const char* buffer, unsigned int fileSize) { if (IsBinarySTL(buffer, fileSize)) return false; - if (fileSize < 5) + const char* bufferEnd = buffer + fileSize; + + if (!SkipSpaces(&buffer)) + return false; + + if (buffer + 5 >= bufferEnd) return false; return strncmp(buffer, "solid", 5) == 0; @@ -209,7 +214,11 @@ void STLImporter::LoadASCIIFile() { aiMesh* pMesh = pScene->mMeshes[0]; - const char* sz = mBuffer + 5; // skip the "solid" + const char* sz = mBuffer; + SkipSpaces(&sz); + ai_assert(!IsLineEnd(sz)); + + sz += 5; // skip the "solid" SkipSpaces(&sz); const char* szMe = sz; while (!::IsSpaceOrNewLine(*sz)) { From 5a0b40db92b05c357c1997fe5ea997ddffb99857 Mon Sep 17 00:00:00 2001 From: acgessler Date: Sun, 29 Sep 2013 21:56:32 +0200 Subject: [PATCH 13/42] ColladaExporter: fix assertion in ::isalnum() when a special character > 0x7f is present in material names. --- code/ColladaExporter.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/ColladaExporter.cpp b/code/ColladaExporter.cpp index 19f86fcf8..8fba4bf74 100644 --- a/code/ColladaExporter.cpp +++ b/code/ColladaExporter.cpp @@ -235,9 +235,13 @@ void ColladaExporter::WriteMaterials() if( mat->Get( AI_MATKEY_NAME, name) != aiReturn_SUCCESS ) name = "mat"; materials[a].name = std::string( "m") + boost::lexical_cast (a) + name.C_Str(); - for( std::string::iterator it = materials[a].name.begin(); it != materials[a].name.end(); ++it ) - if( !isalnum( *it) ) + for( std::string::iterator it = materials[a].name.begin(); it != materials[a].name.end(); ++it ) { + // isalnum on MSVC asserts for code points in [0,255]. Thus prevent unwanted promotion + // of char to signed int and take the unsigned char value. + if( !isalnum( static_cast(*it) ) ) { *it = '_'; + } + } ReadMaterialSurface( materials[a].ambient, mat, aiTextureType_AMBIENT, AI_MATKEY_COLOR_AMBIENT); if( !materials[a].ambient.texture.empty() ) numTextures++; From 8f34c24ae0fd9c49eb90d8f1c1cc2b3c85fd3e30 Mon Sep 17 00:00:00 2001 From: Marshall Hahn Date: Mon, 30 Sep 2013 14:07:53 -0400 Subject: [PATCH 14/42] remove duplicate vectors when export obj format --- code/ObjExporter.cpp | 54 +++++++++++++++++++++++++++----------- code/ObjExporter.h | 15 +++++++++++ include/assimp/vector3.h | 1 + include/assimp/vector3.inl | 10 +++++++ 4 files changed, 65 insertions(+), 15 deletions(-) diff --git a/code/ObjExporter.cpp b/code/ObjExporter.cpp index 9ac902ee3..6cc1063d2 100644 --- a/code/ObjExporter.cpp +++ b/code/ObjExporter.cpp @@ -59,16 +59,10 @@ void ExportSceneObj(const char* pFile,IOSystem* pIOSystem, const aiScene* pScene // we're still here - export successfully completed. Write both the main OBJ file and the material script { boost::scoped_ptr outfile (pIOSystem->Open(pFile,"wt")); - if(outfile == NULL) { - throw DeadlyExportError("could not open output .obj file: " + std::string(pFile)); - } outfile->Write( exporter.mOutput.str().c_str(), static_cast(exporter.mOutput.tellp()),1); } { boost::scoped_ptr outfile (pIOSystem->Open(exporter.GetMaterialLibFileName(),"wt")); - if(outfile == NULL) { - throw DeadlyExportError("could not open output .mtl file: " + std::string(exporter.GetMaterialLibFileName())); - } outfile->Write( exporter.mOutputMat.str().c_str(), static_cast(exporter.mOutputMat.tellp()),1); } } @@ -199,6 +193,7 @@ void ObjExporter :: WriteGeometryFile() AddNode(pScene->mRootNode,mBase); // write vertex positions + vpMap.getVectors(vp); mOutput << "# " << vp.size() << " vertex positions" << endl; BOOST_FOREACH(const aiVector3D& v, vp) { mOutput << "v " << v.x << " " << v.y << " " << v.z << endl; @@ -206,6 +201,7 @@ void ObjExporter :: WriteGeometryFile() mOutput << endl; // write uv coordinates + vtMap.getVectors(vt); mOutput << "# " << vt.size() << " UV coordinates" << endl; BOOST_FOREACH(const aiVector3D& v, vt) { mOutput << "vt " << v.x << " " << v.y << " " << v.z << endl; @@ -213,6 +209,7 @@ void ObjExporter :: WriteGeometryFile() mOutput << endl; // write vertex normals + vnMap.getVectors(vn); mOutput << "# " << vn.size() << " vertex normals" << endl; BOOST_FOREACH(const aiVector3D& v, vn) { mOutput << "vn " << v.x << " " << v.y << " " << v.z << endl; @@ -252,6 +249,31 @@ void ObjExporter :: WriteGeometryFile() } } + + + + +int ObjExporter::vecIndexMap::getIndex(const aiVector3D& vec) +{ + std::map::iterator vertIt = vecMap.find(vec); + if(vertIt != vecMap.end()){// vertex already exists, so reference it + return vertIt->second; + } + vecMap[vec] = mNextIndex; + int ret = mNextIndex; + mNextIndex++; + return ret; +} + +void ObjExporter::vecIndexMap::getVectors( std::vector& vecs ) +{ + vecs.resize(vecMap.size()); + for(std::map::iterator it = vecMap.begin(); it != vecMap.end(); it++){ + vecs[it->second-1] = it->first; + } +} + + // ------------------------------------------------------------------------------------------------ void ObjExporter :: AddMesh(const aiString& name, const aiMesh* m, const aiMatrix4x4& mat) { @@ -262,6 +284,7 @@ void ObjExporter :: AddMesh(const aiString& name, const aiMesh* m, const aiMatri mesh.matname = GetMaterialName(m->mMaterialIndex); mesh.faces.resize(m->mNumFaces); + for(unsigned int i = 0; i < m->mNumFaces; ++i) { const aiFace& f = m->mFaces[i]; @@ -281,21 +304,22 @@ void ObjExporter :: AddMesh(const aiString& name, const aiMesh* m, const aiMatri for(unsigned int a = 0; a < f.mNumIndices; ++a) { const unsigned int idx = f.mIndices[a]; - // XXX need a way to check if this is an unique vertex or if we had it already, - // in which case we should instead reference the previous occurrence. - ai_assert(m->mVertices); - vp.push_back( mat * m->mVertices[idx] ); - face.indices[a].vp = vp.size(); + aiVector3D vert = mat * m->mVertices[idx]; + face.indices[a].vp = vpMap.getIndex(vert); if (m->mNormals) { - vn.push_back( m->mNormals[idx] ); + face.indices[a].vn = vnMap.getIndex(m->mNormals[idx]); + } + else{ + face.indices[a].vn = 0; } - face.indices[a].vn = vn.size(); if (m->mTextureCoords[0]) { - vt.push_back( m->mTextureCoords[0][idx] ); + face.indices[a].vt = vtMap.getIndex(m->mTextureCoords[0][idx]); + } + else{ + face.indices[a].vt = 0; } - face.indices[a].vt = vt.size(); } } } diff --git a/code/ObjExporter.h b/code/ObjExporter.h index f857f5879..4f2f83240 100644 --- a/code/ObjExporter.h +++ b/code/ObjExporter.h @@ -112,6 +112,21 @@ private: const aiScene* const pScene; std::vector vp, vn, vt; + + class vecIndexMap + { + int mNextIndex; + std::map vecMap; + public: + + vecIndexMap():mNextIndex(1) + {} + + int getIndex(const aiVector3D& vec); + void getVectors( std::vector& vecs ); + }; + + vecIndexMap vpMap, vnMap, vtMap; std::vector meshes; // this endl() doesn't flush() the stream diff --git a/include/assimp/vector3.h b/include/assimp/vector3.h index cbdee264d..5b3da297d 100644 --- a/include/assimp/vector3.h +++ b/include/assimp/vector3.h @@ -85,6 +85,7 @@ public: // comparison bool operator== (const aiVector3t& other) const; bool operator!= (const aiVector3t& other) const; + bool operator< (const aiVector3t& other) const; template operator aiVector3t () const; diff --git a/include/assimp/vector3.inl b/include/assimp/vector3.inl index c03437980..90370fa07 100644 --- a/include/assimp/vector3.inl +++ b/include/assimp/vector3.inl @@ -149,6 +149,16 @@ AI_FORCE_INLINE bool aiVector3t::operator!= (const aiVector3t& oth } // ------------------------------------------------------------------------------------------------ template +AI_FORCE_INLINE bool aiVector3t::operator< (const aiVector3t& other) const { + if(x < other.x) return true; + if(x > other.x) return false; + if(y < other.y) return true; + if(y > other.y) return false; + if(z < other.z) return true; + return false; +} +// ------------------------------------------------------------------------------------------------ +template AI_FORCE_INLINE const aiVector3t aiVector3t::SymMul(const aiVector3t& o) { return aiVector3t(x*o.x,y*o.y,z*o.z); } From 66fd9bb8a28ea170522d1d50fc3c3c51bdfbbefb Mon Sep 17 00:00:00 2001 From: Marshall Hahn Date: Mon, 30 Sep 2013 14:11:37 -0400 Subject: [PATCH 15/42] fixed bad merge --- code/ObjExporter.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/ObjExporter.cpp b/code/ObjExporter.cpp index 6cc1063d2..bbf26ce56 100644 --- a/code/ObjExporter.cpp +++ b/code/ObjExporter.cpp @@ -59,10 +59,16 @@ void ExportSceneObj(const char* pFile,IOSystem* pIOSystem, const aiScene* pScene // we're still here - export successfully completed. Write both the main OBJ file and the material script { boost::scoped_ptr outfile (pIOSystem->Open(pFile,"wt")); + if(outfile == NULL) { + throw DeadlyExportError("could not open output .obj file: " + std::string(pFile)); + } outfile->Write( exporter.mOutput.str().c_str(), static_cast(exporter.mOutput.tellp()),1); } { boost::scoped_ptr outfile (pIOSystem->Open(exporter.GetMaterialLibFileName(),"wt")); + if(outfile == NULL) { + throw DeadlyExportError("could not open output .mtl file: " + std::string(exporter.GetMaterialLibFileName())); + } outfile->Write( exporter.mOutputMat.str().c_str(), static_cast(exporter.mOutputMat.tellp()),1); } } From b72b16c90b025486a756caad68838cbd7b77f887 Mon Sep 17 00:00:00 2001 From: Marshall Hahn Date: Mon, 30 Sep 2013 14:12:38 -0400 Subject: [PATCH 16/42] whitespace fix --- code/ObjExporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ObjExporter.cpp b/code/ObjExporter.cpp index bbf26ce56..dce217d12 100644 --- a/code/ObjExporter.cpp +++ b/code/ObjExporter.cpp @@ -60,7 +60,7 @@ void ExportSceneObj(const char* pFile,IOSystem* pIOSystem, const aiScene* pScene { boost::scoped_ptr outfile (pIOSystem->Open(pFile,"wt")); if(outfile == NULL) { - throw DeadlyExportError("could not open output .obj file: " + std::string(pFile)); + throw DeadlyExportError("could not open output .obj file: " + std::string(pFile)); } outfile->Write( exporter.mOutput.str().c_str(), static_cast(exporter.mOutput.tellp()),1); } From c29109d1a4ee237d60d4334acfbceb95b2e5cf3a Mon Sep 17 00:00:00 2001 From: Calvin Hsu Date: Mon, 30 Sep 2013 15:12:56 -0700 Subject: [PATCH 17/42] obj: Fix tabs causing vertices to be skipped If an obj vertex definition 'v' is followed by a tab instead of a space, the vertex definition is skipped. --- code/ObjFileParser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ObjFileParser.cpp b/code/ObjFileParser.cpp index ab8fdd124..3d81ab925 100644 --- a/code/ObjFileParser.cpp +++ b/code/ObjFileParser.cpp @@ -112,7 +112,7 @@ void ObjFileParser::parseFile() case 'v': // Parse a vertex texture coordinate { ++m_DataIt; - if (*m_DataIt == ' ') + if (*m_DataIt == ' ' || *m_DataIt == '\t') { // Read in vertex definition getVector3(m_pModel->m_Vertices); From 32a10ec0a040aad78e3d9e5cbdac336a76af2903 Mon Sep 17 00:00:00 2001 From: Calvin Hsu Date: Mon, 30 Sep 2013 15:13:11 -0700 Subject: [PATCH 18/42] obj: Add support for relative vertex indexing obj files allow faces to specify indices relatively by using negative integers. See vertex refering in http://www.martinreddy.net/gfx/3d/OBJ.spec --- code/ObjFileParser.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/code/ObjFileParser.cpp b/code/ObjFileParser.cpp index 3d81ab925..e701ddc62 100644 --- a/code/ObjFileParser.cpp +++ b/code/ObjFileParser.cpp @@ -290,6 +290,10 @@ void ObjFileParser::getFace(aiPrimitiveType type) std::vector *pNormalID = new std::vector; bool hasNormal = false; + const int vSize = m_pModel->m_Vertices.size(); + const int vtSize = m_pModel->m_TextureCoord.size(); + const int vnSize = m_pModel->m_Normals.size(); + const bool vt = (!m_pModel->m_TextureCoord.empty()); const bool vn = (!m_pModel->m_Normals.empty()); int iStep = 0, iPos = 0; @@ -323,7 +327,11 @@ void ObjFileParser::getFace(aiPrimitiveType type) { //OBJ USES 1 Base ARRAYS!!!! const int iVal = atoi( pPtr ); + + // increment iStep position based off of the sign and # of digits int tmp = iVal; + if (iVal < 0) + ++iStep; while ( ( tmp = tmp / 10 )!=0 ) ++iStep; @@ -348,6 +356,27 @@ void ObjFileParser::getFace(aiPrimitiveType type) reportErrorTokenInFace(); } } + else if ( iVal < 0 ) + { + // Store relatively index + if ( 0 == iPos ) + { + pIndices->push_back( vSize + iVal ); + } + else if ( 1 == iPos ) + { + pTexID->push_back( vtSize + iVal ); + } + else if ( 2 == iPos ) + { + pNormalID->push_back( vnSize + iVal ); + hasNormal = true; + } + else + { + reportErrorTokenInFace(); + } + } } pPtr += iStep; } From c5921540064ee19cabd0707422274b9c3262f9b9 Mon Sep 17 00:00:00 2001 From: Marshall Hahn Date: Tue, 1 Oct 2013 11:21:36 -0400 Subject: [PATCH 19/42] using a custom compare function instead of a global aiVector3t less than operator --- code/ObjExporter.cpp | 4 ++-- code/ObjExporter.h | 17 ++++++++++++++++- include/assimp/vector3.h | 1 - include/assimp/vector3.inl | 10 ---------- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/code/ObjExporter.cpp b/code/ObjExporter.cpp index dce217d12..b680abb74 100644 --- a/code/ObjExporter.cpp +++ b/code/ObjExporter.cpp @@ -261,7 +261,7 @@ void ObjExporter :: WriteGeometryFile() int ObjExporter::vecIndexMap::getIndex(const aiVector3D& vec) { - std::map::iterator vertIt = vecMap.find(vec); + vecIndexMap::dataType::iterator vertIt = vecMap.find(vec); if(vertIt != vecMap.end()){// vertex already exists, so reference it return vertIt->second; } @@ -274,7 +274,7 @@ int ObjExporter::vecIndexMap::getIndex(const aiVector3D& vec) void ObjExporter::vecIndexMap::getVectors( std::vector& vecs ) { vecs.resize(vecMap.size()); - for(std::map::iterator it = vecMap.begin(); it != vecMap.end(); it++){ + for(vecIndexMap::dataType::iterator it = vecMap.begin(); it != vecMap.end(); it++){ vecs[it->second-1] = it->first; } } diff --git a/code/ObjExporter.h b/code/ObjExporter.h index 4f2f83240..4f6555aa5 100644 --- a/code/ObjExporter.h +++ b/code/ObjExporter.h @@ -113,10 +113,25 @@ private: std::vector vp, vn, vt; + + struct aiVectorCompare + { + bool operator() (const aiVector3D& a, const aiVector3D& b) const + { + if(a.x < b.x) return true; + if(a.x > b.x) return false; + if(a.y < b.y) return true; + if(a.y > b.y) return false; + if(a.z < b.z) return true; + return false; + } + }; + class vecIndexMap { int mNextIndex; - std::map vecMap; + typedef std::map dataType; + dataType vecMap; public: vecIndexMap():mNextIndex(1) diff --git a/include/assimp/vector3.h b/include/assimp/vector3.h index 5b3da297d..cbdee264d 100644 --- a/include/assimp/vector3.h +++ b/include/assimp/vector3.h @@ -85,7 +85,6 @@ public: // comparison bool operator== (const aiVector3t& other) const; bool operator!= (const aiVector3t& other) const; - bool operator< (const aiVector3t& other) const; template operator aiVector3t () const; diff --git a/include/assimp/vector3.inl b/include/assimp/vector3.inl index 90370fa07..c03437980 100644 --- a/include/assimp/vector3.inl +++ b/include/assimp/vector3.inl @@ -149,16 +149,6 @@ AI_FORCE_INLINE bool aiVector3t::operator!= (const aiVector3t& oth } // ------------------------------------------------------------------------------------------------ template -AI_FORCE_INLINE bool aiVector3t::operator< (const aiVector3t& other) const { - if(x < other.x) return true; - if(x > other.x) return false; - if(y < other.y) return true; - if(y > other.y) return false; - if(z < other.z) return true; - return false; -} -// ------------------------------------------------------------------------------------------------ -template AI_FORCE_INLINE const aiVector3t aiVector3t::SymMul(const aiVector3t& o) { return aiVector3t(x*o.x,y*o.y,z*o.z); } From 325ef632cfad8efb3ece5f62121e0f6457bdc735 Mon Sep 17 00:00:00 2001 From: acgessler Date: Tue, 1 Oct 2013 17:56:00 +0200 Subject: [PATCH 20/42] PlyExporter: fix export format for compatibility with Blender and MeshLab (and the PLY spec). Fixes #122 --- code/PlyExporter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/PlyExporter.cpp b/code/PlyExporter.cpp index 257e6f1f7..e78cfd964 100644 --- a/code/PlyExporter.cpp +++ b/code/PlyExporter.cpp @@ -103,7 +103,7 @@ PlyExporter :: PlyExporter(const char* _filename, const aiScene* pScene) mOutput << "ply" << endl; mOutput << "format ascii 1.0" << endl; - mOutput << "Created by Open Asset Import Library - http://assimp.sf.net (v" + mOutput << "comment Created by Open Asset Import Library - http://assimp.sf.net (v" << aiGetVersionMajor() << '.' << aiGetVersionMinor() << '.' << aiGetVersionRevision() << ")" << endl; @@ -159,7 +159,7 @@ PlyExporter :: PlyExporter(const char* _filename, const aiScene* pScene) } mOutput << "element face " << faces << endl; - mOutput << "property list uint uint vertex_indices" << endl; + mOutput << "property list uint uint vertex_index" << endl; mOutput << "end_header" << endl; for (unsigned int i = 0; i < pScene->mNumMeshes; ++i) { From 3408a0a838b7ca52b3c36a483ebbf1e9b24666cb Mon Sep 17 00:00:00 2001 From: acgessler Date: Wed, 2 Oct 2013 01:39:59 +0200 Subject: [PATCH 21/42] Blender: iterative loading code for the linked list of scene objects, fixes #28 but is preliminary as it touches code that is normally machine-generated. --- code/BlenderDNA.h | 28 +++++++++------ code/BlenderDNA.inl | 80 ++++++++++++++++++++++++++++--------------- code/BlenderScene.cpp | 43 ++++++++++++++++++----- 3 files changed, 105 insertions(+), 46 deletions(-) diff --git a/code/BlenderDNA.h b/code/BlenderDNA.h index 2eeaee97a..b4733f385 100644 --- a/code/BlenderDNA.h +++ b/code/BlenderDNA.h @@ -278,19 +278,23 @@ public: // -------------------------------------------------------- // field parsing for pointer or dynamic array types // (boost::shared_ptr or boost::shared_array) + // The return value indicates whether the data was already cached. template class TOUT, typename T> - void ReadFieldPtr(TOUT& out, const char* name, - const FileDatabase& db) const; + bool ReadFieldPtr(TOUT& out, const char* name, + const FileDatabase& db, + bool non_recursive = false) const; // -------------------------------------------------------- // field parsing for static arrays of pointer or dynamic // array types (boost::shared_ptr[] or boost::shared_array[]) + // The return value indicates whether the data was already cached. template class TOUT, typename T, size_t N> - void ReadFieldPtr(TOUT (&out)[N], const char* name, + bool ReadFieldPtr(TOUT (&out)[N], const char* name, const FileDatabase& db) const; // -------------------------------------------------------- // field parsing for `normal` values + // The return value indicates whether the data was already cached. template void ReadField(T& out, const char* name, const FileDatabase& db) const; @@ -299,17 +303,18 @@ private: // -------------------------------------------------------- template