From 2c6c19d656a0f2f01debfc9f95a9e8edfa0ca5c5 Mon Sep 17 00:00:00 2001 From: Chris Russ Date: Wed, 22 Jun 2016 17:38:10 +1000 Subject: [PATCH 1/8] allowing to enable building of zlib manually --- CMakeLists.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e9406689..d04abe3bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ # Open Asset Import Library (assimp) # ---------------------------------------------------------------------- -# +# # Copyright (c) 2006-2016, assimp team # All rights reserved. # @@ -175,7 +175,15 @@ ENDIF( CMAKE_COMPILER_IS_GNUCXX ) # Search for external dependencies, and build them from source if not found # Search for zlib -find_package(ZLIB) +OPTION(ASSIMP_BUILD_ZLIB + "Build your own zlib" + OFF +) + +IF ( NOT ASSIMP_BUILD_ZLIB ) + find_package(ZLIB) +ENDIF(ASSIMP_BUILD_ZLIB) + IF( NOT ZLIB_FOUND ) message(STATUS "compiling zlib from souces") include(CheckIncludeFile) @@ -278,7 +286,7 @@ IF ( ASSIMP_BUILD_ASSIMP_TOOLS ) ADD_SUBDIRECTORY( tools/assimp_view/ ) ENDIF ( ASSIMP_BUILD_ASSIMP_VIEW ) ENDIF ( WIN32 ) - + ADD_SUBDIRECTORY( tools/assimp_cmd/ ) ENDIF ( ASSIMP_BUILD_ASSIMP_TOOLS ) From 867063d8c3ad891f707aee98176e4699ba552d4e Mon Sep 17 00:00:00 2001 From: Thiago Goulart Date: Fri, 24 Jun 2016 02:17:36 -0700 Subject: [PATCH 2/8] Fix compilation of iOS static libraries. 1. Building for any targets using clang-703.0.31 failed with multiple errors. Using c++11 or c++14 as -std builds successfully. 2. Building for arm64 failed compilation due to duplicate constructors in rapidjson's document.h. --- contrib/rapidjson/include/rapidjson/document.h | 2 +- port/iOS/build.sh | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/contrib/rapidjson/include/rapidjson/document.h b/contrib/rapidjson/include/rapidjson/document.h index 7079ef8a2..98053cbd5 100644 --- a/contrib/rapidjson/include/rapidjson/document.h +++ b/contrib/rapidjson/include/rapidjson/document.h @@ -557,7 +557,7 @@ public: flags_ |= kIntFlag; } -#if !defined(__x86_64__) +#if !defined(__x86_64__) && !defined(__arm64__) //! Constructor for size_t value. explicit GenericValue( size_t u ) RAPIDJSON_NOEXCEPT : data_(), flags_( kNumberUintFlag ) { data_.n.u64 = u; diff --git a/port/iOS/build.sh b/port/iOS/build.sh index 96d686445..beca60014 100755 --- a/port/iOS/build.sh +++ b/port/iOS/build.sh @@ -22,6 +22,8 @@ CPP_DEV_TARGET_LIST=(miphoneos-version-min mios-simulator-version-min) CPP_DEV_TARGET= CPP_STD_LIB_LIST=(libc++ libstdc++) CPP_STD_LIB= +CPP_STD_LIST=(c++03 c++11 c++14) +CPP_STD= function join { local IFS="$1"; shift; echo "$*"; } @@ -46,7 +48,7 @@ build_arch() export CFLAGS="-arch $1 -pipe -no-cpp-precomp -stdlib=$CPP_STD_LIB -isysroot $SDKROOT -$CPP_DEV_TARGET=$IOS_SDK_TARGET -I$SDKROOT/usr/include/" export LDFLAGS="-L$SDKROOT/usr/lib/" export CPPFLAGS=$CFLAGS - export CXXFLAGS=$CFLAGS + export CXXFLAGS="$CFLAGS -std=$CPP_STD" rm CMakeCache.txt @@ -65,11 +67,16 @@ build_arch() echo "[!] $0 - assimp iOS build script" CPP_STD_LIB=${CPP_STD_LIB_LIST[0]} +CPP_STD=${CPP_STD_LIST[0]} DEPLOY_ARCHS=${BUILD_ARCHS_ALL[*]} DEPLOY_FAT=1 for i in "$@"; do case $i in + -s=*|--std=*) + CPP_STD=`echo $i | sed 's/[-a-zA-Z0-9]*=//'` + echo "[!] Selecting c++ standard: $CPP_STD" + ;; -l=*|--stdlib=*) CPP_STD_LIB=`echo $i | sed 's/[-a-zA-Z0-9]*=//'` echo "[!] Selecting c++ std lib: $CPP_STD_LIB" @@ -85,7 +92,8 @@ for i in "$@"; do -h|--help) echo " - don't build fat library (--no-fat)." echo " - supported architectures (--archs): $(echo $(join , ${BUILD_ARCHS_ALL[*]}) | sed 's/,/, /g')" - echo " - supported C++ STD libs. (--stdlib): $(echo $(join , ${CPP_STD_LIB_LIST[*]}) | sed 's/,/, /g')" + echo " - supported C++ STD libs (--stdlib): $(echo $(join , ${CPP_STD_LIB_LIST[*]}) | sed 's/,/, /g')" + echo " - supported C++ standards (--std): $(echo $(join , ${CPP_STD_LIST[*]}) | sed 's/,/, /g')" exit ;; *) From 7d98643bcfc4ab0d21ea579f58f56dcfbc6b6d15 Mon Sep 17 00:00:00 2001 From: Roy Shilkrot Date: Mon, 27 Jun 2016 20:08:22 -0400 Subject: [PATCH 3/8] adding support for per-vertex colors. --- code/ObjFileData.h | 4 ++++ code/ObjFileImporter.cpp | 11 +++++++++ code/ObjFileParser.cpp | 48 ++++++++++++++++++++++++++++++++++++---- code/ObjFileParser.h | 4 ++++ 4 files changed, 63 insertions(+), 4 deletions(-) diff --git a/code/ObjFileData.h b/code/ObjFileData.h index 370d0e4fb..f4abd643f 100644 --- a/code/ObjFileData.h +++ b/code/ObjFileData.h @@ -240,6 +240,8 @@ struct Mesh { unsigned int m_uiMaterialIndex; /// True, if normals are stored. bool m_hasNormals; + /// True, if vertex colors are stored. + bool m_hasVertexColors; /// Constructor explicit Mesh( const std::string &name ) @@ -289,6 +291,8 @@ struct Model std::vector m_Vertices; //! vector with all generated normals std::vector m_Normals; + //! vector with all vertex colors + std::vector m_VertexColors; //! Group map GroupMap m_Groups; //! Group to face id assignment diff --git a/code/ObjFileImporter.cpp b/code/ObjFileImporter.cpp index a0e016ba5..082709dc7 100644 --- a/code/ObjFileImporter.cpp +++ b/code/ObjFileImporter.cpp @@ -416,6 +416,10 @@ void ObjFileImporter::createVertexArray(const ObjFile::Model* pModel, if ( !pModel->m_Normals.empty() && pObjMesh->m_hasNormals ) pMesh->mNormals = new aiVector3D[ pMesh->mNumVertices ]; + // Allocate buffer for vertex-color vectors + if ( !pModel->m_VertexColors.empty() ) + pMesh->mColors[0] = new aiColor4D[ pMesh->mNumVertices ]; + // Allocate buffer for texture coordinates if ( !pModel->m_TextureCoord.empty() && pObjMesh->m_uiUVCoordinates[0] ) { @@ -449,6 +453,13 @@ void ObjFileImporter::createVertexArray(const ObjFile::Model* pModel, pMesh->mNormals[ newIndex ] = pModel->m_Normals[ normal ]; } + // Copy all vertex colors + if ( !pModel->m_VertexColors.empty()) + { + const aiVector3D color = pModel->m_VertexColors[ vertex ]; + pMesh->mColors[0][ newIndex ] = aiColor4D(color.x, color.y, color.z, 1.0); + } + // Copy all texture coordinates if ( !pModel->m_TextureCoord.empty() && vertexIndex < pSourceFace->m_pTexturCoords->size()) { diff --git a/code/ObjFileParser.cpp b/code/ObjFileParser.cpp index a6f515aba..79bc299bc 100644 --- a/code/ObjFileParser.cpp +++ b/code/ObjFileParser.cpp @@ -136,8 +136,14 @@ void ObjFileParser::parseFile() { ++m_DataIt; if (*m_DataIt == ' ' || *m_DataIt == '\t') { - // read in vertex definition - getVector3(m_pModel->m_Vertices); + size_t numComponents = getNumComponentsInLine(); + if (numComponents == 3) { + // read in vertex definition + getVector3(m_pModel->m_Vertices); + } else if (numComponents == 6) { + // read vertex and vertex-color + getTwoVectors3(m_pModel->m_Vertices, m_pModel->m_VertexColors); + } } else if (*m_DataIt == 't') { // read in texture coordinate ( 2D or 3D ) ++m_DataIt; @@ -257,8 +263,7 @@ void ObjFileParser::copyNextLine(char *pBuffer, size_t length) pBuffer[ index ] = '\0'; } -// ------------------------------------------------------------------- -void ObjFileParser::getVector( std::vector &point3d_array ) { +size_t ObjFileParser::getNumComponentsInLine() { size_t numComponents( 0 ); const char* tmp( &m_DataIt[0] ); while( !IsLineEnd( *tmp ) ) { @@ -268,6 +273,12 @@ void ObjFileParser::getVector( std::vector &point3d_array ) { SkipToken( tmp ); ++numComponents; } + return numComponents; +} + +// ------------------------------------------------------------------- +void ObjFileParser::getVector( std::vector &point3d_array ) { + size_t numComponents = getNumComponentsInLine(); float x, y, z; if( 2 == numComponents ) { copyNextWord( m_buffer, Buffersize ); @@ -309,6 +320,35 @@ void ObjFileParser::getVector3( std::vector &point3d_array ) { m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); } +// ------------------------------------------------------------------- +// Get values for two 3D vectors on the same line +void ObjFileParser::getTwoVectors3( std::vector &point3d_array_a, std::vector &point3d_array_b ) { + float x, y, z; + copyNextWord(m_buffer, Buffersize); + x = (float) fast_atof(m_buffer); + + copyNextWord(m_buffer, Buffersize); + y = (float) fast_atof(m_buffer); + + copyNextWord( m_buffer, Buffersize ); + z = ( float ) fast_atof( m_buffer ); + + point3d_array_a.push_back( aiVector3D( x, y, z ) ); + + copyNextWord(m_buffer, Buffersize); + x = (float) fast_atof(m_buffer); + + copyNextWord(m_buffer, Buffersize); + y = (float) fast_atof(m_buffer); + + copyNextWord( m_buffer, Buffersize ); + z = ( float ) fast_atof( m_buffer ); + + point3d_array_b.push_back( aiVector3D( x, y, z ) ); + + m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); +} + // ------------------------------------------------------------------- // Get values for a new 2D vector instance void ObjFileParser::getVector2( std::vector &point2d_array ) { diff --git a/code/ObjFileParser.h b/code/ObjFileParser.h index 7170f0d50..f1be764f0 100644 --- a/code/ObjFileParser.h +++ b/code/ObjFileParser.h @@ -89,6 +89,8 @@ private: void getVector( std::vector &point3d_array ); /// Stores the following 3d vector. void getVector3( std::vector &point3d_array ); + /// Stores the following two 3d vectors on the line. + void getTwoVectors3( std::vector &point3d_array_a, std::vector &point3d_array_b ); /// Stores the following 3d vector. void getVector2(std::vector &point2d_array); /// Stores the following face. @@ -119,6 +121,8 @@ private: bool needsNewMesh( const std::string &rMaterialName ); /// Error report in token void reportErrorTokenInFace(); + /// Get the number of components in a line. + size_t getNumComponentsInLine(); private: // Copy and assignment constructor should be private From 93caa1737176cae9a10bcd3854aa14ddeae31d22 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Thu, 30 Jun 2016 00:42:08 +0200 Subject: [PATCH 4/8] CMake: use CMAKE_CURRENT_LIST_DIR instead of CmakeSourceDir. --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e9406689..7fbc43b72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,7 +81,8 @@ IF(NOT GIT_COMMIT_HASH) ENDIF(NOT GIT_COMMIT_HASH) configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/revision.h.in + ${CMAKE_CURRENT_LIST_DIR}/revision.h.in +# ${CMAKE_CURRENT_SOURCE_DIR}/revision.h.in ${CMAKE_CURRENT_BINARY_DIR}/revision.h ) From 9c7de7b2a845cf5e061a934d353dc4d631fd46b2 Mon Sep 17 00:00:00 2001 From: cmdrf Date: Fri, 1 Jul 2016 14:50:46 +0200 Subject: [PATCH 5/8] Update to latest Melange SDK --- CMakeLists.txt | 34 +++++++++++++++++++--------------- code/C4DImporter.cpp | 20 +++++++++++++------- code/C4DImporter.h | 14 +++++++------- 3 files changed, 39 insertions(+), 29 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7fbc43b72..d1cd2b320 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -229,31 +229,35 @@ SET ( ASSIMP_BUILD_NONFREE_C4D_IMPORTER OFF CACHE BOOL IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER) IF ( MSVC ) - SET(C4D_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/contrib/Melange/_melange/includes") + SET(C4D_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/contrib/Melange/includes") # pick the correct prebuilt library - IF(MSVC11) - SET(C4D_LIB_POSTFIX "_2012md") + IF(MSVC14) + SET(C4D_LIB_POSTFIX "_2015") + ELSEIF(MSVC12) + SET(C4D_LIB_POSTFIX "_2013") + ELSEIF(MSVC11) + SET(C4D_LIB_POSTFIX "_2012") ELSEIF(MSVC10) - SET(C4D_LIB_POSTFIX "_2010md") + SET(C4D_LIB_POSTFIX "_2010") ELSEIF(MSVC90) - SET(C4D_LIB_POSTFIX "_2008md") + SET(C4D_LIB_POSTFIX "_2008") ELSE() MESSAGE( FATAL_ERROR - "C4D is currently only supported with MSVC 9, 10, 11" + "C4D is currently only supported with MSVC 9, 10, 11, 12, 14" ) ENDIF() - IF(CMAKE_CL_64) - SET(C4D_LIB_ARCH_POSTFIX "_x64") - ELSE() - SET(C4D_LIB_ARCH_POSTFIX "") - ENDIF() + SET(C4D_LIB_BASE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/contrib/Melange/libraries/win") - SET(C4D_LIB_BASE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/contrib/Melange/_melange/lib/WIN") - - SET(C4D_DEBUG_LIBRARY "${C4D_LIB_BASE_PATH}/debug/_melange_lib${C4D_LIB_ARCH_POSTFIX}${C4D_LIB_POSTFIX}.lib") - SET(C4D_RELEASE_LIBRARY "${C4D_LIB_BASE_PATH}/release/_melange_lib${C4D_LIB_ARCH_POSTFIX}${C4D_LIB_POSTFIX}.lib") + SET(C4D_DEBUG_LIBRARY + "${C4D_LIB_BASE_PATH}/melangelib${C4D_LIB_POSTFIX}/melangelib_debug.lib" + "${C4D_LIB_BASE_PATH}/jpeglib${C4D_LIB_POSTFIX}/jpeglib_debug.lib" + ) + SET(C4D_RELEASE_LIBRARY + "${C4D_LIB_BASE_PATH}/melangelib${C4D_LIB_POSTFIX}/melangelib_release.lib" + "${C4D_LIB_BASE_PATH}/jpeglib${C4D_LIB_POSTFIX}/jpeglib_release.lib" + ) # winsock and winmm are necessary dependencies of melange (this is undocumented, but true.) SET(C4D_EXTRA_LIBRARIES WSock32.lib Winmm.lib) diff --git a/code/C4DImporter.cpp b/code/C4DImporter.cpp index 11e3d0c54..5695ca7fd 100644 --- a/code/C4DImporter.cpp +++ b/code/C4DImporter.cpp @@ -52,6 +52,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "C4DImporter.h" #include "TinyFormatter.h" +#include +#include +#include +#include #if defined(_M_X64) || defined(__amd64__) # define __C4D_64BIT @@ -61,10 +65,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "c4d_file.h" #include "default_alien_overloads.h" -using namespace _melange_; +using namespace melange; // overload this function and fill in your own unique data -void GetWriterInfo(LONG &id, String &appname) +void GetWriterInfo(int &id, String &appname) { id = 2424226; appname = "Open Asset Import Library"; @@ -197,7 +201,7 @@ void C4DImporter::InternReadFile( const std::string& pFile, // ------------------------------------------------------------------------------------------------ -bool C4DImporter::ReadShader(aiMaterial* out, _melange_::BaseShader* shader) +bool C4DImporter::ReadShader(aiMaterial* out, melange::BaseShader* shader) { // based on Melange sample code (C4DImportExport.cpp) while(shader) { @@ -263,7 +267,7 @@ bool C4DImporter::ReadShader(aiMaterial* out, _melange_::BaseShader* shader) // ------------------------------------------------------------------------------------------------ -void C4DImporter::ReadMaterials(_melange_::BaseMaterial* mat) +void C4DImporter::ReadMaterials(melange::BaseMaterial* mat) { // based on Melange sample code while (mat) @@ -288,7 +292,7 @@ void C4DImporter::ReadMaterials(_melange_::BaseMaterial* mat) mat->GetParameter(MATERIAL_COLOR_COLOR, data); Vector color = data.GetVector(); mat->GetParameter(MATERIAL_COLOR_BRIGHTNESS, data); - const Real brightness = data.GetReal(); + const Float brightness = data.GetFloat(); color *= brightness; @@ -507,11 +511,13 @@ aiMesh* C4DImporter::ReadMesh(BaseObject* object) // copy normals if (normals_src) { - if(i >= normals_src->GetNormalCount()) { + if(i >= normals_src->GetDataCount()) { LogError("unexpected number of normals, ignoring"); } else { - const NormalStruct& nor = normals_src->GetNormals(i); + ConstNormalHandle normal_handle = normals_src->GetDataAddressR(); + NormalStruct nor; + NormalTag::Get(normal_handle, i, nor); normals->x = nor.a.x; normals->y = nor.a.y; normals->z = nor.a.z; diff --git a/code/C4DImporter.h b/code/C4DImporter.h index 5ecf4fdc8..28abde51e 100644 --- a/code/C4DImporter.h +++ b/code/C4DImporter.h @@ -54,7 +54,7 @@ struct aiMaterial; struct aiImporterDesc; -namespace _melange_ { +namespace melange { class BaseObject; // c4d_file.h class PolygonObject; class BaseMaterial; @@ -103,17 +103,17 @@ protected: private: - void ReadMaterials(_melange_::BaseMaterial* mat); - void RecurseHierarchy(_melange_::BaseObject* object, aiNode* parent); - aiMesh* ReadMesh(_melange_::BaseObject* object); - unsigned int ResolveMaterial(_melange_::PolygonObject* obj); + void ReadMaterials(melange::BaseMaterial* mat); + void RecurseHierarchy(melange::BaseObject* object, aiNode* parent); + aiMesh* ReadMesh(melange::BaseObject* object); + unsigned int ResolveMaterial(melange::PolygonObject* obj); - bool ReadShader(aiMaterial* out, _melange_::BaseShader* shader); + bool ReadShader(aiMaterial* out, melange::BaseShader* shader); std::vector meshes; std::vector materials; - typedef std::map<_melange_::BaseMaterial*, unsigned int> MaterialMap; + typedef std::map MaterialMap; MaterialMap material_mapping; }; // !class C4DImporter From 616aa022a78a1fac47bda130fe6c125482fd0558 Mon Sep 17 00:00:00 2001 From: Fabian Herb Date: Fri, 1 Jul 2016 16:57:45 +0200 Subject: [PATCH 6/8] CMake: whitespace consistency, variable naming --- CMakeLists.txt | 36 +++++++++++++++++------------------- code/CMakeLists.txt | 4 ++-- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d1cd2b320..751c7036d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -232,32 +232,30 @@ IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER) SET(C4D_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/contrib/Melange/includes") # pick the correct prebuilt library - IF(MSVC14) - SET(C4D_LIB_POSTFIX "_2015") - ELSEIF(MSVC12) - SET(C4D_LIB_POSTFIX "_2013") - ELSEIF(MSVC11) - SET(C4D_LIB_POSTFIX "_2012") + IF(MSVC14) + SET(C4D_LIB_POSTFIX "_2015") + ELSEIF(MSVC12) + SET(C4D_LIB_POSTFIX "_2013") + ELSEIF(MSVC11) + SET(C4D_LIB_POSTFIX "_2012") ELSEIF(MSVC10) - SET(C4D_LIB_POSTFIX "_2010") - ELSEIF(MSVC90) - SET(C4D_LIB_POSTFIX "_2008") + SET(C4D_LIB_POSTFIX "_2010") ELSE() MESSAGE( FATAL_ERROR - "C4D is currently only supported with MSVC 9, 10, 11, 12, 14" + "C4D is currently only supported with MSVC 10, 11, 12, 14" ) ENDIF() - SET(C4D_LIB_BASE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/contrib/Melange/libraries/win") + SET(C4D_LIB_BASE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/contrib/Melange/libraries/win") - SET(C4D_DEBUG_LIBRARY - "${C4D_LIB_BASE_PATH}/melangelib${C4D_LIB_POSTFIX}/melangelib_debug.lib" - "${C4D_LIB_BASE_PATH}/jpeglib${C4D_LIB_POSTFIX}/jpeglib_debug.lib" - ) - SET(C4D_RELEASE_LIBRARY - "${C4D_LIB_BASE_PATH}/melangelib${C4D_LIB_POSTFIX}/melangelib_release.lib" - "${C4D_LIB_BASE_PATH}/jpeglib${C4D_LIB_POSTFIX}/jpeglib_release.lib" - ) + SET(C4D_DEBUG_LIBRARIES + "${C4D_LIB_BASE_PATH}/melangelib${C4D_LIB_POSTFIX}/melangelib_debug.lib" + "${C4D_LIB_BASE_PATH}/jpeglib${C4D_LIB_POSTFIX}/jpeglib_debug.lib" + ) + SET(C4D_RELEASE_LIBRARIES + "${C4D_LIB_BASE_PATH}/melangelib${C4D_LIB_POSTFIX}/melangelib_release.lib" + "${C4D_LIB_BASE_PATH}/jpeglib${C4D_LIB_POSTFIX}/jpeglib_release.lib" + ) # winsock and winmm are necessary dependencies of melange (this is undocumented, but true.) SET(C4D_EXTRA_LIBRARIES WSock32.lib Winmm.lib) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 2d39a00c2..35ecf5020 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -775,8 +775,8 @@ if(ANDROID AND ASSIMP_ANDROID_JNIIOSYSTEM) endif(ANDROID AND ASSIMP_ANDROID_JNIIOSYSTEM) IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER) - TARGET_LINK_LIBRARIES(assimp optimized ${C4D_RELEASE_LIBRARY}) - TARGET_LINK_LIBRARIES(assimp debug ${C4D_DEBUG_LIBRARY}) + TARGET_LINK_LIBRARIES(assimp optimized ${C4D_RELEASE_LIBRARIES}) + TARGET_LINK_LIBRARIES(assimp debug ${C4D_DEBUG_LIBRARIES}) TARGET_LINK_LIBRARIES(assimp ${C4D_EXTRA_LIBRARIES}) ENDIF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER) From 3c7dd2b302c10ab621c36d6d4e2b5a33c9d2c4e0 Mon Sep 17 00:00:00 2001 From: Fabian Herb Date: Fri, 1 Jul 2016 17:02:54 +0200 Subject: [PATCH 7/8] More whitespace consistency --- code/C4DImporter.cpp | 10 +++++----- code/C4DImporter.h | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/code/C4DImporter.cpp b/code/C4DImporter.cpp index 5695ca7fd..449f8d255 100644 --- a/code/C4DImporter.cpp +++ b/code/C4DImporter.cpp @@ -292,7 +292,7 @@ void C4DImporter::ReadMaterials(melange::BaseMaterial* mat) mat->GetParameter(MATERIAL_COLOR_COLOR, data); Vector color = data.GetVector(); mat->GetParameter(MATERIAL_COLOR_BRIGHTNESS, data); - const Float brightness = data.GetFloat(); + const Float brightness = data.GetFloat(); color *= brightness; @@ -511,13 +511,13 @@ aiMesh* C4DImporter::ReadMesh(BaseObject* object) // copy normals if (normals_src) { - if(i >= normals_src->GetDataCount()) { + if(i >= normals_src->GetDataCount()) { LogError("unexpected number of normals, ignoring"); } else { - ConstNormalHandle normal_handle = normals_src->GetDataAddressR(); - NormalStruct nor; - NormalTag::Get(normal_handle, i, nor); + ConstNormalHandle normal_handle = normals_src->GetDataAddressR(); + NormalStruct nor; + NormalTag::Get(normal_handle, i, nor); normals->x = nor.a.x; normals->y = nor.a.y; normals->z = nor.a.z; diff --git a/code/C4DImporter.h b/code/C4DImporter.h index 28abde51e..3ba2a17c6 100644 --- a/code/C4DImporter.h +++ b/code/C4DImporter.h @@ -103,17 +103,17 @@ protected: private: - void ReadMaterials(melange::BaseMaterial* mat); - void RecurseHierarchy(melange::BaseObject* object, aiNode* parent); - aiMesh* ReadMesh(melange::BaseObject* object); - unsigned int ResolveMaterial(melange::PolygonObject* obj); + void ReadMaterials(melange::BaseMaterial* mat); + void RecurseHierarchy(melange::BaseObject* object, aiNode* parent); + aiMesh* ReadMesh(melange::BaseObject* object); + unsigned int ResolveMaterial(melange::PolygonObject* obj); - bool ReadShader(aiMaterial* out, melange::BaseShader* shader); + bool ReadShader(aiMaterial* out, melange::BaseShader* shader); std::vector meshes; std::vector materials; - typedef std::map MaterialMap; + typedef std::map MaterialMap; MaterialMap material_mapping; }; // !class C4DImporter From 7b08233ef257c86778b47edf1a21144958c466fc Mon Sep 17 00:00:00 2001 From: Fabian Herb Date: Fri, 1 Jul 2016 17:08:28 +0200 Subject: [PATCH 8/8] Fix identation --- code/C4DImporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/C4DImporter.cpp b/code/C4DImporter.cpp index 449f8d255..252766ca6 100644 --- a/code/C4DImporter.cpp +++ b/code/C4DImporter.cpp @@ -511,7 +511,7 @@ aiMesh* C4DImporter::ReadMesh(BaseObject* object) // copy normals if (normals_src) { - if(i >= normals_src->GetDataCount()) { + if(i >= normals_src->GetDataCount()) { LogError("unexpected number of normals, ignoring"); } else {