diff --git a/.travis.sh b/.travis.sh index f0f0f5d70..3be5d26b4 100755 --- a/.travis.sh +++ b/.travis.sh @@ -1,7 +1,7 @@ #--------------------------------------------------------------------------- #Open Asset Import Library (assimp) #--------------------------------------------------------------------------- -# Copyright (c) 2006-2017, assimp team +# Copyright (c) 2006-2020, assimp team # # License see LICENSE file # diff --git a/.travis.yml b/.travis.yml index 8fe39d59c..79ccf5b1a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,6 +30,9 @@ env: - secure: "lZ7pHQvl5dpZWzBQAaIMf0wqrvtcZ4wiZKeIZjf83TEsflW8+z0uTpIuN30ZV6Glth/Sq1OhLnTP5+N57fZU/1ebA5twHdvP4bS5CIUUg71/CXQZNl36xeaqvxsG/xRrdpKOsPdjAOsQ9KPTQulsX43XDLS7CasMiLvYOpqKcPc=" - PV=r8e PLATF=linux-x86_64 NDK_HOME=${TRAVIS_BUILD_DIR}/android-ndk-${PV} PATH=${PATH}:${NDK_HOME} +git: + depth: 1 + matrix: include: - os: linux diff --git a/CMakeLists.txt b/CMakeLists.txt index 23b6f6d61..fd3f1b802 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ # Open Asset Import Library (assimp) # ---------------------------------------------------------------------- -# Copyright (c) 2006-2019, assimp team +# Copyright (c) 2006-2020, assimp team # # All rights reserved. # @@ -51,7 +51,7 @@ IF(HUNTER_ENABLED) add_definitions(-DASSIMP_USE_HUNTER) ENDIF(HUNTER_ENABLED) -PROJECT( Assimp VERSION 5.0.0 ) +PROJECT( Assimp VERSION 5.0.1 ) # All supported options ############################################### @@ -100,6 +100,10 @@ OPTION ( ASSIMP_COVERALLS "Enable this to measure test coverage." OFF ) +OPTION( ASSIMP_INSTALL + "DIsable this if you want to use assimp as a submodule." + ON +) OPTION ( ASSIMP_ERROR_MAX "Enable all warnings." OFF @@ -601,55 +605,59 @@ ENDIF ( ASSIMP_BUILD_TESTS ) # Generate a pkg-config .pc for the Assimp library. CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/assimp.pc.in" "${PROJECT_BINARY_DIR}/assimp.pc" @ONLY ) -INSTALL( FILES "${PROJECT_BINARY_DIR}/assimp.pc" DESTINATION ${ASSIMP_LIB_INSTALL_DIR}/pkgconfig/ COMPONENT ${LIBASSIMP-DEV_COMPONENT}) +IF ( ASSIMP_INSTALL ) + INSTALL( FILES "${PROJECT_BINARY_DIR}/assimp.pc" DESTINATION ${ASSIMP_LIB_INSTALL_DIR}/pkgconfig/ COMPONENT ${LIBASSIMP-DEV_COMPONENT}) +ENDIF( ASSIMP_INSTALL ) -IF(CMAKE_CPACK_COMMAND AND UNIX AND ASSIMP_OPT_BUILD_PACKAGES) - # Packing information - SET(CPACK_PACKAGE_NAME "assimp{ASSIMP_VERSION_MAJOR}.{ASSIMP_VERSION_MINOR}") - SET(CPACK_PACKAGE_CONTACT "" CACHE STRING "Package maintainer and PGP signer.") - SET(CPACK_PACKAGE_VENDOR "https://github.com/assimp") - SET(CPACK_PACKAGE_DISPLAY_NAME "Assimp ${ASSIMP_VERSION}") - SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY " - Open Asset Import Library ${ASSIMP_VERSION}") - SET(CPACK_PACKAGE_VERSION "${ASSIMP_VERSION}.${ASSIMP_PACKAGE_VERSION}" ) - SET(CPACK_PACKAGE_VERSION_MAJOR "${ASSIMP_VERSION_MAJOR}") - SET(CPACK_PACKAGE_VERSION_MINOR "${ASSIMP_VERSION_MINOR}") - SET(CPACK_PACKAGE_VERSION_PATCH "${ASSIMP_VERSION_PATCH}") - SET(CPACK_PACKAGE_INSTALL_DIRECTORY "assimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}") - SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") +IF ( ASSIMP_INSTALL ) + IF(CMAKE_CPACK_COMMAND AND UNIX AND ASSIMP_OPT_BUILD_PACKAGES) + # Packing information + SET(CPACK_PACKAGE_NAME "assimp{ASSIMP_VERSION_MAJOR}.{ASSIMP_VERSION_MINOR}") + SET(CPACK_PACKAGE_CONTACT "" CACHE STRING "Package maintainer and PGP signer.") + SET(CPACK_PACKAGE_VENDOR "https://github.com/assimp") + SET(CPACK_PACKAGE_DISPLAY_NAME "Assimp ${ASSIMP_VERSION}") + SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY " - Open Asset Import Library ${ASSIMP_VERSION}") + SET(CPACK_PACKAGE_VERSION "${ASSIMP_VERSION}.${ASSIMP_PACKAGE_VERSION}" ) + SET(CPACK_PACKAGE_VERSION_MAJOR "${ASSIMP_VERSION_MAJOR}") + SET(CPACK_PACKAGE_VERSION_MINOR "${ASSIMP_VERSION_MINOR}") + SET(CPACK_PACKAGE_VERSION_PATCH "${ASSIMP_VERSION_PATCH}") + SET(CPACK_PACKAGE_INSTALL_DIRECTORY "assimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}") + SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") - STRING(TOUPPER ${LIBASSIMP_COMPONENT} "LIBASSIMP_COMPONENT_UPPER") - STRING(TOUPPER ${LIBASSIMP-DEV_COMPONENT} "LIBASSIMP-DEV_COMPONENT_UPPER") + STRING(TOUPPER ${LIBASSIMP_COMPONENT} "LIBASSIMP_COMPONENT_UPPER") + STRING(TOUPPER ${LIBASSIMP-DEV_COMPONENT} "LIBASSIMP-DEV_COMPONENT_UPPER") - SET(CPACK_COMPONENT_ASSIMP-BIN_DISPLAY_NAME "tools") - SET(CPACK_COMPONENT_ASSIMP-BIN_DEPENDS "${LIBASSIMP_COMPONENT}" ) - SET(CPACK_COMPONENT_${LIBASSIMP_COMPONENT_UPPER}_DISPLAY_NAME "libraries") - SET(CPACK_COMPONENT_${LIBASSIMP-DEV_COMPONENT_UPPER}_DISPLAY_NAME "common headers and installs") - SET(CPACK_COMPONENT_${LIBASSIMP-DEV_COMPONENT_UPPER}_DEPENDS $ "{LIBASSIMP_COMPONENT}" ) - SET(CPACK_COMPONENT_ASSIMP-DEV_DISPLAY_NAME "${CPACK_COMPONENT_${LIBASSIMP-DEV_COMPONENT}_DISPLAY_NAME}" ) - SET(CPACK_COMPONENT_ASSIMP-DEV_DEPENDS "${LIBASSIMP-DEV_COMPONENT}" ) - SET(CPACK_DEBIAN_BUILD_DEPENDS debhelper cmake zlib1g-dev pkg-config) + SET(CPACK_COMPONENT_ASSIMP-BIN_DISPLAY_NAME "tools") + SET(CPACK_COMPONENT_ASSIMP-BIN_DEPENDS "${LIBASSIMP_COMPONENT}" ) + SET(CPACK_COMPONENT_${LIBASSIMP_COMPONENT_UPPER}_DISPLAY_NAME "libraries") + SET(CPACK_COMPONENT_${LIBASSIMP-DEV_COMPONENT_UPPER}_DISPLAY_NAME "common headers and installs") + SET(CPACK_COMPONENT_${LIBASSIMP-DEV_COMPONENT_UPPER}_DEPENDS $ "{LIBASSIMP_COMPONENT}" ) + SET(CPACK_COMPONENT_ASSIMP-DEV_DISPLAY_NAME "${CPACK_COMPONENT_${LIBASSIMP-DEV_COMPONENT}_DISPLAY_NAME}" ) + SET(CPACK_COMPONENT_ASSIMP-DEV_DEPENDS "${LIBASSIMP-DEV_COMPONENT}" ) + SET(CPACK_DEBIAN_BUILD_DEPENDS debhelper cmake zlib1g-dev pkg-config) - # debian - SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") - SET(CPACK_DEBIAN_CMAKE_OPTIONS "-DBUILD_ASSIMP_SAMPLES:BOOL=${ASSIMP_BUILD_SAMPLES}") - SET(CPACK_DEBIAN_PACKAGE_SECTION "libs" ) - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_COMPONENTS_ALL}") - SET(CPACK_DEBIAN_PACKAGE_SUGGESTS) - set(cPACK_DEBIAN_PACKAGE_NAME "assimp") - SET(CPACK_DEBIAN_PACKAGE_REMOVE_SOURCE_FILES contrib/gtest contrib/zlib workspaces test doc obj samples packaging) - SET(CPACK_DEBIAN_PACKAGE_SOURCE_COPY svn export --force) - SET(CPACK_DEBIAN_CHANGELOG) - execute_process(COMMAND lsb_release -is - OUTPUT_VARIABLE _lsb_distribution OUTPUT_STRIP_TRAILING_WHITESPACE - RESULT_VARIABLE _lsb_release_failed) - SET(CPACK_DEBIAN_DISTRIBUTION_NAME ${_lsb_distribution} CACHE STRING "Name of the distrubiton") - STRING(TOLOWER ${CPACK_DEBIAN_DISTRIBUTION_NAME} CPACK_DEBIAN_DISTRIBUTION_NAME) - IF( ${CPACK_DEBIAN_DISTRIBUTION_NAME} STREQUAL "ubuntu" ) - SET(CPACK_DEBIAN_DISTRIBUTION_RELEASES lucid maverick natty oneiric precise CACHE STRING "Release code-names of the distrubiton release") + # debian + SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") + SET(CPACK_DEBIAN_CMAKE_OPTIONS "-DBUILD_ASSIMP_SAMPLES:BOOL=${ASSIMP_BUILD_SAMPLES}") + SET(CPACK_DEBIAN_PACKAGE_SECTION "libs" ) + SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_COMPONENTS_ALL}") + SET(CPACK_DEBIAN_PACKAGE_SUGGESTS) + SET(cPACK_DEBIAN_PACKAGE_NAME "assimp") + SET(CPACK_DEBIAN_PACKAGE_REMOVE_SOURCE_FILES contrib/gtest contrib/zlib workspaces test doc obj samples packaging) + SET(CPACK_DEBIAN_PACKAGE_SOURCE_COPY svn export --force) + SET(CPACK_DEBIAN_CHANGELOG) + execute_process(COMMAND lsb_release -is + OUTPUT_VARIABLE _lsb_distribution OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE _lsb_release_failed) + SET(CPACK_DEBIAN_DISTRIBUTION_NAME ${_lsb_distribution} CACHE STRING "Name of the distrubiton") + STRING(TOLOWER ${CPACK_DEBIAN_DISTRIBUTION_NAME} CPACK_DEBIAN_DISTRIBUTION_NAME) + IF( ${CPACK_DEBIAN_DISTRIBUTION_NAME} STREQUAL "ubuntu" ) + SET(CPACK_DEBIAN_DISTRIBUTION_RELEASES lucid maverick natty oneiric precise CACHE STRING "Release code-names of the distrubiton release") + ENDIF() + SET(DPUT_HOST "" CACHE STRING "PPA repository to upload the debian sources") + INCLUDE(CPack) + INCLUDE(DebSourcePPA) ENDIF() - SET(DPUT_HOST "" CACHE STRING "PPA repository to upload the debian sources") - INCLUDE(CPack) - INCLUDE(DebSourcePPA) ENDIF() if(WIN32) diff --git a/LICENSE b/LICENSE index 262606aff..dc8e24706 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ Open Asset Import Library (assimp) -Copyright (c) 2006-2016, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/Readme.md b/Readme.md index 863e64f08..7e0a8cccc 100644 --- a/Readme.md +++ b/Readme.md @@ -131,7 +131,7 @@ Take a look into the https://github.com/assimp/assimp/blob/master/Build.md file. ### Ports ### * [Android](port/AndroidJNI/README.md) * [Python](port/PyAssimp/README.md) -* [.NET](https://github.com/kebby/assimp-net) +* [.NET](https://github.com/assimp/assimp-net) * [Pascal](port/AssimpPascal/Readme.md) * [Javascript (Alpha)](https://github.com/makc/assimp2json) * [Unity 3d Plugin](https://www.assetstore.unity3d.com/en/#!/content/91777) diff --git a/appveyor.yml b/appveyor.yml index fa0a125f0..4fb79dd69 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,6 +4,8 @@ # clone directory clone_folder: c:\projects\assimp +clone_depth: 1 + # branches to build branches: # whitelist @@ -15,10 +17,10 @@ matrix: image: - Visual Studio 2013 - - Visual Studio 2015 - - Visual Studio 2017 + #- Visual Studio 2015 + #- Visual Studio 2017 - Visual Studio 2019 - - MinGW + #- MinGW platform: - Win32 @@ -52,11 +54,11 @@ cache: - bin\.mtime_cache before_build: + - echo NUMBER_OF_PROCESSORS=%NUMBER_OF_PROCESSORS% - ruby scripts\AppVeyor\mtime_cache -g scripts\AppVeyor\cacheglobs.txt -c bin\.mtime_cache\cache.json -build: - parallel: true - project: Assimp.sln +build_script: + cmake --build . --config Release -- /maxcpucount:2 after_build: - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" ( diff --git a/assimp-config-version.cmake.in b/assimp-config-version.cmake.in index 923a38798..68366820a 100644 --- a/assimp-config-version.cmake.in +++ b/assimp-config-version.cmake.in @@ -1,6 +1,6 @@ # Open Asset Import Library (assimp) # ---------------------------------------------------------------------- -# Copyright (c) 2006-2017, assimp team +# Copyright (c) 2006-2020, assimp team # All rights reserved. # # Redistribution and use of this software in source and binary forms, diff --git a/code/3DS/3DSConverter.cpp b/code/3DS/3DSConverter.cpp index 3c3da36a3..3f0e20bb0 100644 --- a/code/3DS/3DSConverter.cpp +++ b/code/3DS/3DSConverter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/3DS/3DSExporter.cpp b/code/3DS/3DSExporter.cpp index 1117a52ef..14810cbff 100644 --- a/code/3DS/3DSExporter.cpp +++ b/code/3DS/3DSExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/3DS/3DSExporter.h b/code/3DS/3DSExporter.h index 035b562cf..9dcd92d58 100644 --- a/code/3DS/3DSExporter.h +++ b/code/3DS/3DSExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/3DS/3DSHelper.h b/code/3DS/3DSHelper.h index 8eb4cd97c..e483f1a25 100644 --- a/code/3DS/3DSHelper.h +++ b/code/3DS/3DSHelper.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/3DS/3DSLoader.cpp b/code/3DS/3DSLoader.cpp index 3c659d0b0..3e8e08967 100644 --- a/code/3DS/3DSLoader.cpp +++ b/code/3DS/3DSLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/3DS/3DSLoader.h b/code/3DS/3DSLoader.h index f57e6a8e3..9181294b3 100644 --- a/code/3DS/3DSLoader.h +++ b/code/3DS/3DSLoader.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/3MF/3MFXmlTags.h b/code/3MF/3MFXmlTags.h index ea6aeede0..3f1fc01ed 100644 --- a/code/3MF/3MFXmlTags.h +++ b/code/3MF/3MFXmlTags.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/3MF/D3MFExporter.cpp b/code/3MF/D3MFExporter.cpp index 1f388ad3e..9d71a54f2 100644 --- a/code/3MF/D3MFExporter.cpp +++ b/code/3MF/D3MFExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/3MF/D3MFExporter.h b/code/3MF/D3MFExporter.h index e82120247..6a447236b 100644 --- a/code/3MF/D3MFExporter.h +++ b/code/3MF/D3MFExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/3MF/D3MFImporter.cpp b/code/3MF/D3MFImporter.cpp index 682de684a..2f30c4fc0 100644 --- a/code/3MF/D3MFImporter.cpp +++ b/code/3MF/D3MFImporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/3MF/D3MFImporter.h b/code/3MF/D3MFImporter.h index 3dbdf07bf..638971247 100644 --- a/code/3MF/D3MFImporter.h +++ b/code/3MF/D3MFImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/3MF/D3MFOpcPackage.cpp b/code/3MF/D3MFOpcPackage.cpp index 873ba8ee8..565790656 100644 --- a/code/3MF/D3MFOpcPackage.cpp +++ b/code/3MF/D3MFOpcPackage.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/3MF/D3MFOpcPackage.h b/code/3MF/D3MFOpcPackage.h index 87d172116..291f8ad53 100644 --- a/code/3MF/D3MFOpcPackage.h +++ b/code/3MF/D3MFOpcPackage.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/AC/ACLoader.cpp b/code/AC/ACLoader.cpp index d4c4bd1a6..ea533743f 100644 --- a/code/AC/ACLoader.cpp +++ b/code/AC/ACLoader.cpp @@ -4,7 +4,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/AC/ACLoader.h b/code/AC/ACLoader.h index cab2c3ae5..1fc654f3c 100644 --- a/code/AC/ACLoader.h +++ b/code/AC/ACLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/AMF/AMFImporter.cpp b/code/AMF/AMFImporter.cpp index dedb6dcdd..df4324d4d 100644 --- a/code/AMF/AMFImporter.cpp +++ b/code/AMF/AMFImporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/AMF/AMFImporter.hpp b/code/AMF/AMFImporter.hpp index 2b8086a06..5994717b8 100644 --- a/code/AMF/AMFImporter.hpp +++ b/code/AMF/AMFImporter.hpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/AMF/AMFImporter_Geometry.cpp b/code/AMF/AMFImporter_Geometry.cpp index f1538e3fb..e9a50b656 100644 --- a/code/AMF/AMFImporter_Geometry.cpp +++ b/code/AMF/AMFImporter_Geometry.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/AMF/AMFImporter_Macro.hpp b/code/AMF/AMFImporter_Macro.hpp index f60c5fbbb..ec06cb999 100644 --- a/code/AMF/AMFImporter_Macro.hpp +++ b/code/AMF/AMFImporter_Macro.hpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/AMF/AMFImporter_Material.cpp b/code/AMF/AMFImporter_Material.cpp index 2f36df061..64da12dda 100644 --- a/code/AMF/AMFImporter_Material.cpp +++ b/code/AMF/AMFImporter_Material.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/AMF/AMFImporter_Node.hpp b/code/AMF/AMFImporter_Node.hpp index a1bf9f008..b7b7836f3 100644 --- a/code/AMF/AMFImporter_Node.hpp +++ b/code/AMF/AMFImporter_Node.hpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/AMF/AMFImporter_Postprocess.cpp b/code/AMF/AMFImporter_Postprocess.cpp index 79b5e15e2..8496d8ded 100644 --- a/code/AMF/AMFImporter_Postprocess.cpp +++ b/code/AMF/AMFImporter_Postprocess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/ASE/ASELoader.cpp b/code/ASE/ASELoader.cpp index 8e99214a8..b2155d5e5 100644 --- a/code/ASE/ASELoader.cpp +++ b/code/ASE/ASELoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/ASE/ASELoader.h b/code/ASE/ASELoader.h index b497aa48b..bb7707bb6 100644 --- a/code/ASE/ASELoader.h +++ b/code/ASE/ASELoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/ASE/ASEParser.cpp b/code/ASE/ASEParser.cpp index 913e7b118..efc6ecd0d 100644 --- a/code/ASE/ASEParser.cpp +++ b/code/ASE/ASEParser.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/ASE/ASEParser.h b/code/ASE/ASEParser.h index 988cbda8d..e55949f99 100644 --- a/code/ASE/ASEParser.h +++ b/code/ASE/ASEParser.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Assbin/AssbinExporter.cpp b/code/Assbin/AssbinExporter.cpp index 76c823f82..496b39d49 100644 --- a/code/Assbin/AssbinExporter.cpp +++ b/code/Assbin/AssbinExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -46,799 +46,22 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_EXPORT #ifndef ASSIMP_BUILD_NO_ASSBIN_EXPORTER -#include "Common/assbin_chunks.h" -#include "PostProcessing/ProcessHelper.h" +#include "AssbinFileWriter.h" -#include -#include +#include #include #include -#include - -#ifdef ASSIMP_BUILD_NO_OWN_ZLIB -# include -#else -# include "../contrib/zlib/zlib.h" -#endif - -#include namespace Assimp { -template -size_t Write(IOStream * stream, const T& v) { - return stream->Write( &v, sizeof(T), 1 ); -} - -// ----------------------------------------------------------------------------------- -// Serialize an aiString -template <> -inline -size_t Write(IOStream * stream, const aiString& s) { - const size_t s2 = (uint32_t)s.length; - stream->Write(&s,4,1); - stream->Write(s.data,s2,1); - - return s2+4; -} - -// ----------------------------------------------------------------------------------- -// Serialize an unsigned int as uint32_t -template <> -inline -size_t Write(IOStream * stream, const unsigned int& w) { - const uint32_t t = (uint32_t)w; - if (w > t) { - // this shouldn't happen, integers in Assimp data structures never exceed 2^32 - throw DeadlyExportError("loss of data due to 64 -> 32 bit integer conversion"); - } - - stream->Write(&t,4,1); - - return 4; -} - -// ----------------------------------------------------------------------------------- -// Serialize an unsigned int as uint16_t -template <> -inline -size_t Write(IOStream * stream, const uint16_t& w) { - static_assert(sizeof(uint16_t)==2, "sizeof(uint16_t)==2"); - stream->Write(&w,2,1); - - return 2; -} - -// ----------------------------------------------------------------------------------- -// Serialize a float -template <> -inline -size_t Write(IOStream * stream, const float& f) { - static_assert(sizeof(float)==4, "sizeof(float)==4"); - stream->Write(&f,4,1); - - return 4; -} - -// ----------------------------------------------------------------------------------- -// Serialize a double -template <> -inline -size_t Write(IOStream * stream, const double& f) { - static_assert(sizeof(double)==8, "sizeof(double)==8"); - stream->Write(&f,8,1); - - return 8; -} - -// ----------------------------------------------------------------------------------- -// Serialize a vec3 -template <> -inline -size_t Write(IOStream * stream, const aiVector3D& v) { - size_t t = Write(stream,v.x); - t += Write(stream,v.y); - t += Write(stream,v.z); - - return t; -} - -// ----------------------------------------------------------------------------------- -// Serialize a color value -template <> -inline -size_t Write(IOStream * stream, const aiColor3D& v) { - size_t t = Write(stream,v.r); - t += Write(stream,v.g); - t += Write(stream,v.b); - - return t; -} - -// ----------------------------------------------------------------------------------- -// Serialize a color value -template <> -inline -size_t Write(IOStream * stream, const aiColor4D& v) { - size_t t = Write(stream,v.r); - t += Write(stream,v.g); - t += Write(stream,v.b); - t += Write(stream,v.a); - - return t; -} - -// ----------------------------------------------------------------------------------- -// Serialize a quaternion -template <> -inline -size_t Write(IOStream * stream, const aiQuaternion& v) { - size_t t = Write(stream,v.w); - t += Write(stream,v.x); - t += Write(stream,v.y); - t += Write(stream,v.z); - ai_assert(t == 16); - - return 16; -} - -// ----------------------------------------------------------------------------------- -// Serialize a vertex weight -template <> -inline -size_t Write(IOStream * stream, const aiVertexWeight& v) { - size_t t = Write(stream,v.mVertexId); - - return t+Write(stream,v.mWeight); -} - -// ----------------------------------------------------------------------------------- -// Serialize a mat4x4 -template <> -inline -size_t Write(IOStream * stream, const aiMatrix4x4& m) { - for (unsigned int i = 0; i < 4;++i) { - for (unsigned int i2 = 0; i2 < 4;++i2) { - Write(stream,m[i][i2]); - } - } - - return 64; -} - -// ----------------------------------------------------------------------------------- -// Serialize an aiVectorKey -template <> -inline -size_t Write(IOStream * stream, const aiVectorKey& v) { - const size_t t = Write(stream,v.mTime); - return t + Write(stream,v.mValue); -} - -// ----------------------------------------------------------------------------------- -// Serialize an aiQuatKey -template <> -inline -size_t Write(IOStream * stream, const aiQuatKey& v) { - const size_t t = Write(stream,v.mTime); - return t + Write(stream,v.mValue); -} - -template -inline -size_t WriteBounds(IOStream * stream, const T* in, unsigned int size) { - T minc, maxc; - ArrayBounds(in,size,minc,maxc); - - const size_t t = Write(stream,minc); - return t + Write(stream,maxc); -} - -// We use this to write out non-byte arrays so that we write using the specializations. -// This way we avoid writing out extra bytes that potentially come from struct alignment. -template -inline -size_t WriteArray(IOStream * stream, const T* in, unsigned int size) { - size_t n = 0; - for (unsigned int i=0; i(stream,in[i]); - - return n; -} - -// ---------------------------------------------------------------------------------- -/** @class AssbinChunkWriter - * @brief Chunk writer mechanism for the .assbin file structure - * - * This is a standard in-memory IOStream (most of the code is based on BlobIOStream), - * the difference being that this takes another IOStream as a "container" in the - * constructor, and when it is destroyed, it appends the magic number, the chunk size, - * and the chunk contents to the container stream. This allows relatively easy chunk - * chunk construction, even recursively. - */ -class AssbinChunkWriter : public IOStream -{ -private: - - uint8_t* buffer; - uint32_t magic; - IOStream * container; - size_t cur_size, cursor, initial; - -private: - // ------------------------------------------------------------------- - void Grow(size_t need = 0) - { - size_t new_size = std::max(initial, std::max( need, cur_size+(cur_size>>1) )); - - const uint8_t* const old = buffer; - buffer = new uint8_t[new_size]; - - if (old) { - memcpy(buffer,old,cur_size); - delete[] old; - } - - cur_size = new_size; - } - -public: - - AssbinChunkWriter( IOStream * container, uint32_t magic, size_t initial = 4096) - : buffer(NULL), magic(magic), container(container), cur_size(0), cursor(0), initial(initial) - { - } - - virtual ~AssbinChunkWriter() - { - if (container) { - container->Write( &magic, sizeof(uint32_t), 1 ); - container->Write( &cursor, sizeof(uint32_t), 1 ); - container->Write( buffer, 1, cursor ); - } - if (buffer) delete[] buffer; - } - - void * GetBufferPointer() { return buffer; } - - // ------------------------------------------------------------------- - virtual size_t Read(void* /*pvBuffer*/, size_t /*pSize*/, size_t /*pCount*/) { - return 0; - } - virtual aiReturn Seek(size_t /*pOffset*/, aiOrigin /*pOrigin*/) { - return aiReturn_FAILURE; - } - virtual size_t Tell() const { - return cursor; - } - virtual void Flush() { - // not implemented - } - - virtual size_t FileSize() const { - return cursor; - } - - // ------------------------------------------------------------------- - virtual size_t Write(const void* pvBuffer, size_t pSize, size_t pCount) { - pSize *= pCount; - if (cursor + pSize > cur_size) { - Grow(cursor + pSize); - } - - memcpy(buffer+cursor, pvBuffer, pSize); - cursor += pSize; - - return pCount; - } - -}; - -// ---------------------------------------------------------------------------------- -/** @class AssbinExport - * @brief Assbin exporter class - * - * This class performs the .assbin exporting, and is responsible for the file layout. - */ -class AssbinExport -{ -private: - bool shortened; - bool compressed; - -protected: - // ----------------------------------------------------------------------------------- - void WriteBinaryNode( IOStream * container, const aiNode* node) - { - AssbinChunkWriter chunk( container, ASSBIN_CHUNK_AINODE ); - - unsigned int nb_metadata = (node->mMetaData != NULL ? node->mMetaData->mNumProperties : 0); - - Write(&chunk,node->mName); - Write(&chunk,node->mTransformation); - Write(&chunk,node->mNumChildren); - Write(&chunk,node->mNumMeshes); - Write(&chunk,nb_metadata); - - for (unsigned int i = 0; i < node->mNumMeshes;++i) { - Write(&chunk,node->mMeshes[i]); - } - - for (unsigned int i = 0; i < node->mNumChildren;++i) { - WriteBinaryNode( &chunk, node->mChildren[i] ); - } - - for (unsigned int i = 0; i < nb_metadata; ++i) { - const aiString& key = node->mMetaData->mKeys[i]; - aiMetadataType type = node->mMetaData->mValues[i].mType; - void* value = node->mMetaData->mValues[i].mData; - - Write(&chunk, key); - Write(&chunk, type); - - switch (type) { - case AI_BOOL: - Write(&chunk, *((bool*) value)); - break; - case AI_INT32: - Write(&chunk, *((int32_t*) value)); - break; - case AI_UINT64: - Write(&chunk, *((uint64_t*) value)); - break; - case AI_FLOAT: - Write(&chunk, *((float*) value)); - break; - case AI_DOUBLE: - Write(&chunk, *((double*) value)); - break; - case AI_AISTRING: - Write(&chunk, *((aiString*) value)); - break; - case AI_AIVECTOR3D: - Write(&chunk, *((aiVector3D*) value)); - break; -#ifdef SWIG - case FORCE_32BIT: -#endif // SWIG - default: - break; - } - } - } - - // ----------------------------------------------------------------------------------- - void WriteBinaryTexture(IOStream * container, const aiTexture* tex) - { - AssbinChunkWriter chunk( container, ASSBIN_CHUNK_AITEXTURE ); - - Write(&chunk,tex->mWidth); - Write(&chunk,tex->mHeight); - chunk.Write( tex->achFormatHint, sizeof(char), 4 ); - - if(!shortened) { - if (!tex->mHeight) { - chunk.Write(tex->pcData,1,tex->mWidth); - } - else { - chunk.Write(tex->pcData,1,tex->mWidth*tex->mHeight*4); - } - } - - } - - // ----------------------------------------------------------------------------------- - void WriteBinaryBone(IOStream * container, const aiBone* b) - { - AssbinChunkWriter chunk( container, ASSBIN_CHUNK_AIBONE ); - - Write(&chunk,b->mName); - Write(&chunk,b->mNumWeights); - Write(&chunk,b->mOffsetMatrix); - - // for the moment we write dumb min/max values for the bones, too. - // maybe I'll add a better, hash-like solution later - if (shortened) { - WriteBounds(&chunk,b->mWeights,b->mNumWeights); - } // else write as usual - else WriteArray(&chunk,b->mWeights,b->mNumWeights); - } - - // ----------------------------------------------------------------------------------- - void WriteBinaryMesh(IOStream * container, const aiMesh* mesh) - { - AssbinChunkWriter chunk( container, ASSBIN_CHUNK_AIMESH ); - - Write(&chunk,mesh->mPrimitiveTypes); - Write(&chunk,mesh->mNumVertices); - Write(&chunk,mesh->mNumFaces); - Write(&chunk,mesh->mNumBones); - Write(&chunk,mesh->mMaterialIndex); - - // first of all, write bits for all existent vertex components - unsigned int c = 0; - if (mesh->mVertices) { - c |= ASSBIN_MESH_HAS_POSITIONS; - } - if (mesh->mNormals) { - c |= ASSBIN_MESH_HAS_NORMALS; - } - if (mesh->mTangents && mesh->mBitangents) { - c |= ASSBIN_MESH_HAS_TANGENTS_AND_BITANGENTS; - } - for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_TEXTURECOORDS;++n) { - if (!mesh->mTextureCoords[n]) { - break; - } - c |= ASSBIN_MESH_HAS_TEXCOORD(n); - } - for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_COLOR_SETS;++n) { - if (!mesh->mColors[n]) { - break; - } - c |= ASSBIN_MESH_HAS_COLOR(n); - } - Write(&chunk,c); - - aiVector3D minVec, maxVec; - if (mesh->mVertices) { - if (shortened) { - WriteBounds(&chunk,mesh->mVertices,mesh->mNumVertices); - } // else write as usual - else WriteArray(&chunk,mesh->mVertices,mesh->mNumVertices); - } - if (mesh->mNormals) { - if (shortened) { - WriteBounds(&chunk,mesh->mNormals,mesh->mNumVertices); - } // else write as usual - else WriteArray(&chunk,mesh->mNormals,mesh->mNumVertices); - } - if (mesh->mTangents && mesh->mBitangents) { - if (shortened) { - WriteBounds(&chunk,mesh->mTangents,mesh->mNumVertices); - WriteBounds(&chunk,mesh->mBitangents,mesh->mNumVertices); - } // else write as usual - else { - WriteArray(&chunk,mesh->mTangents,mesh->mNumVertices); - WriteArray(&chunk,mesh->mBitangents,mesh->mNumVertices); - } - } - for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_COLOR_SETS;++n) { - if (!mesh->mColors[n]) - break; - - if (shortened) { - WriteBounds(&chunk,mesh->mColors[n],mesh->mNumVertices); - } // else write as usual - else WriteArray(&chunk,mesh->mColors[n],mesh->mNumVertices); - } - for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_TEXTURECOORDS;++n) { - if (!mesh->mTextureCoords[n]) - break; - - // write number of UV components - Write(&chunk,mesh->mNumUVComponents[n]); - - if (shortened) { - WriteBounds(&chunk,mesh->mTextureCoords[n],mesh->mNumVertices); - } // else write as usual - else WriteArray(&chunk,mesh->mTextureCoords[n],mesh->mNumVertices); - } - - // write faces. There are no floating-point calculations involved - // in these, so we can write a simple hash over the face data - // to the dump file. We generate a single 32 Bit hash for 512 faces - // using Assimp's standard hashing function. - if (shortened) { - unsigned int processed = 0; - for (unsigned int job;(job = std::min(mesh->mNumFaces-processed,512u));processed += job) { - - uint32_t hash = 0; - for (unsigned int a = 0; a < job;++a) { - - const aiFace& f = mesh->mFaces[processed+a]; - uint32_t tmp = f.mNumIndices; - hash = SuperFastHash(reinterpret_cast(&tmp),sizeof tmp,hash); - for (unsigned int i = 0; i < f.mNumIndices; ++i) { - static_assert(AI_MAX_VERTICES <= 0xffffffff, "AI_MAX_VERTICES <= 0xffffffff"); - tmp = static_cast( f.mIndices[i] ); - hash = SuperFastHash(reinterpret_cast(&tmp),sizeof tmp,hash); - } - } - Write(&chunk,hash); - } - } - else // else write as usual - { - // if there are less than 2^16 vertices, we can simply use 16 bit integers ... - for (unsigned int i = 0; i < mesh->mNumFaces;++i) { - const aiFace& f = mesh->mFaces[i]; - - static_assert(AI_MAX_FACE_INDICES <= 0xffff, "AI_MAX_FACE_INDICES <= 0xffff"); - Write(&chunk,f.mNumIndices); - - for (unsigned int a = 0; a < f.mNumIndices;++a) { - if (mesh->mNumVertices < (1u<<16)) { - Write(&chunk,f.mIndices[a]); - } - else Write(&chunk,f.mIndices[a]); - } - } - } - - // write bones - if (mesh->mNumBones) { - for (unsigned int a = 0; a < mesh->mNumBones;++a) { - const aiBone* b = mesh->mBones[a]; - WriteBinaryBone(&chunk,b); - } - } - } - - // ----------------------------------------------------------------------------------- - void WriteBinaryMaterialProperty(IOStream * container, const aiMaterialProperty* prop) - { - AssbinChunkWriter chunk( container, ASSBIN_CHUNK_AIMATERIALPROPERTY ); - - Write(&chunk,prop->mKey); - Write(&chunk,prop->mSemantic); - Write(&chunk,prop->mIndex); - - Write(&chunk,prop->mDataLength); - Write(&chunk,(unsigned int)prop->mType); - chunk.Write(prop->mData,1,prop->mDataLength); - } - - // ----------------------------------------------------------------------------------- - void WriteBinaryMaterial(IOStream * container, const aiMaterial* mat) - { - AssbinChunkWriter chunk( container, ASSBIN_CHUNK_AIMATERIAL); - - Write(&chunk,mat->mNumProperties); - for (unsigned int i = 0; i < mat->mNumProperties;++i) { - WriteBinaryMaterialProperty( &chunk, mat->mProperties[i]); - } - } - - // ----------------------------------------------------------------------------------- - void WriteBinaryNodeAnim(IOStream * container, const aiNodeAnim* nd) - { - AssbinChunkWriter chunk( container, ASSBIN_CHUNK_AINODEANIM ); - - Write(&chunk,nd->mNodeName); - Write(&chunk,nd->mNumPositionKeys); - Write(&chunk,nd->mNumRotationKeys); - Write(&chunk,nd->mNumScalingKeys); - Write(&chunk,nd->mPreState); - Write(&chunk,nd->mPostState); - - if (nd->mPositionKeys) { - if (shortened) { - WriteBounds(&chunk,nd->mPositionKeys,nd->mNumPositionKeys); - - } // else write as usual - else WriteArray(&chunk,nd->mPositionKeys,nd->mNumPositionKeys); - } - if (nd->mRotationKeys) { - if (shortened) { - WriteBounds(&chunk,nd->mRotationKeys,nd->mNumRotationKeys); - - } // else write as usual - else WriteArray(&chunk,nd->mRotationKeys,nd->mNumRotationKeys); - } - if (nd->mScalingKeys) { - if (shortened) { - WriteBounds(&chunk,nd->mScalingKeys,nd->mNumScalingKeys); - - } // else write as usual - else WriteArray(&chunk,nd->mScalingKeys,nd->mNumScalingKeys); - } - } - - - // ----------------------------------------------------------------------------------- - void WriteBinaryAnim( IOStream * container, const aiAnimation* anim ) - { - AssbinChunkWriter chunk( container, ASSBIN_CHUNK_AIANIMATION ); - - Write(&chunk,anim->mName); - Write(&chunk,anim->mDuration); - Write(&chunk,anim->mTicksPerSecond); - Write(&chunk,anim->mNumChannels); - - for (unsigned int a = 0; a < anim->mNumChannels;++a) { - const aiNodeAnim* nd = anim->mChannels[a]; - WriteBinaryNodeAnim(&chunk,nd); - } - } - - // ----------------------------------------------------------------------------------- - void WriteBinaryLight( IOStream * container, const aiLight* l ) - { - AssbinChunkWriter chunk( container, ASSBIN_CHUNK_AILIGHT ); - - Write(&chunk,l->mName); - Write(&chunk,l->mType); - - if (l->mType != aiLightSource_DIRECTIONAL) { - Write(&chunk,l->mAttenuationConstant); - Write(&chunk,l->mAttenuationLinear); - Write(&chunk,l->mAttenuationQuadratic); - } - - Write(&chunk,l->mColorDiffuse); - Write(&chunk,l->mColorSpecular); - Write(&chunk,l->mColorAmbient); - - if (l->mType == aiLightSource_SPOT) { - Write(&chunk,l->mAngleInnerCone); - Write(&chunk,l->mAngleOuterCone); - } - - } - - // ----------------------------------------------------------------------------------- - void WriteBinaryCamera( IOStream * container, const aiCamera* cam ) - { - AssbinChunkWriter chunk( container, ASSBIN_CHUNK_AICAMERA ); - - Write(&chunk,cam->mName); - Write(&chunk,cam->mPosition); - Write(&chunk,cam->mLookAt); - Write(&chunk,cam->mUp); - Write(&chunk,cam->mHorizontalFOV); - Write(&chunk,cam->mClipPlaneNear); - Write(&chunk,cam->mClipPlaneFar); - Write(&chunk,cam->mAspect); - } - - // ----------------------------------------------------------------------------------- - void WriteBinaryScene( IOStream * container, const aiScene* scene) - { - AssbinChunkWriter chunk( container, ASSBIN_CHUNK_AISCENE ); - - // basic scene information - Write(&chunk,scene->mFlags); - Write(&chunk,scene->mNumMeshes); - Write(&chunk,scene->mNumMaterials); - Write(&chunk,scene->mNumAnimations); - Write(&chunk,scene->mNumTextures); - Write(&chunk,scene->mNumLights); - Write(&chunk,scene->mNumCameras); - - // write node graph - WriteBinaryNode( &chunk, scene->mRootNode ); - - // write all meshes - for (unsigned int i = 0; i < scene->mNumMeshes;++i) { - const aiMesh* mesh = scene->mMeshes[i]; - WriteBinaryMesh( &chunk,mesh); - } - - // write materials - for (unsigned int i = 0; i< scene->mNumMaterials; ++i) { - const aiMaterial* mat = scene->mMaterials[i]; - WriteBinaryMaterial(&chunk,mat); - } - - // write all animations - for (unsigned int i = 0; i < scene->mNumAnimations;++i) { - const aiAnimation* anim = scene->mAnimations[i]; - WriteBinaryAnim(&chunk,anim); - } - - - // write all textures - for (unsigned int i = 0; i < scene->mNumTextures;++i) { - const aiTexture* mesh = scene->mTextures[i]; - WriteBinaryTexture(&chunk,mesh); - } - - // write lights - for (unsigned int i = 0; i < scene->mNumLights;++i) { - const aiLight* l = scene->mLights[i]; - WriteBinaryLight(&chunk,l); - } - - // write cameras - for (unsigned int i = 0; i < scene->mNumCameras;++i) { - const aiCamera* cam = scene->mCameras[i]; - WriteBinaryCamera(&chunk,cam); - } - - } - -public: - AssbinExport() - : shortened(false), compressed(false) // temporary settings until properties are introduced for exporters - { - } - - // ----------------------------------------------------------------------------------- - // Write a binary model dump - void WriteBinaryDump(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene) - { - IOStream * out = pIOSystem->Open( pFile, "wb" ); - if (!out) return; - - time_t tt = time(NULL); -#if _WIN32 - tm* p = gmtime(&tt); -#else - struct tm now; - tm* p = gmtime_r(&tt, &now); -#endif - - // header - char s[64]; - memset( s, 0, 64 ); -#if _MSC_VER >= 1400 - sprintf_s(s,"ASSIMP.binary-dump.%s",asctime(p)); -#else - ai_snprintf(s,64,"ASSIMP.binary-dump.%s",asctime(p)); -#endif - out->Write( s, 44, 1 ); - // == 44 bytes - - Write( out, ASSBIN_VERSION_MAJOR ); - Write( out, ASSBIN_VERSION_MINOR ); - Write( out, aiGetVersionRevision() ); - Write( out, aiGetCompileFlags() ); - Write( out, shortened ); - Write( out, compressed ); - // == 20 bytes - - char buff[256]; - strncpy(buff,pFile,256); - out->Write(buff,sizeof(char),256); - - char cmd[] = "\0"; - strncpy(buff,cmd,128); - out->Write(buff,sizeof(char),128); - - // leave 64 bytes free for future extensions - memset(buff,0xcd,64); - out->Write(buff,sizeof(char),64); - // == 435 bytes - - // ==== total header size: 512 bytes - ai_assert( out->Tell() == ASSBIN_HEADER_LENGTH ); - - // Up to here the data is uncompressed. For compressed files, the rest - // is compressed using standard DEFLATE from zlib. - if (compressed) - { - AssbinChunkWriter uncompressedStream( NULL, 0 ); - WriteBinaryScene( &uncompressedStream, pScene ); - - uLongf uncompressedSize = static_cast(uncompressedStream.Tell()); - uLongf compressedSize = (uLongf)compressBound(uncompressedSize); - uint8_t* compressedBuffer = new uint8_t[ compressedSize ]; - - int res = compress2( compressedBuffer, &compressedSize, (const Bytef*)uncompressedStream.GetBufferPointer(), uncompressedSize, 9 ); - if(res != Z_OK) - { - delete [] compressedBuffer; - pIOSystem->Close(out); - throw DeadlyExportError("Compression failed."); - } - - out->Write( &uncompressedSize, sizeof(uint32_t), 1 ); - out->Write( compressedBuffer, sizeof(char), compressedSize ); - - delete[] compressedBuffer; - } - else - { - WriteBinaryScene( out, pScene ); - } - - pIOSystem->Close( out ); - } -}; - void ExportSceneAssbin(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* /*pProperties*/) { - AssbinExport exporter; - exporter.WriteBinaryDump( pFile, pIOSystem, pScene ); + DumpSceneToAssbin( + pFile, + "\0", // no command(s). + pIOSystem, + pScene, + false, // shortened? + false); // compressed? } } // end of namespace Assimp diff --git a/code/Assbin/AssbinExporter.h b/code/Assbin/AssbinExporter.h index 3e13639bb..350ed85e3 100644 --- a/code/Assbin/AssbinExporter.h +++ b/code/Assbin/AssbinExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Assbin/AssbinFileWriter.cpp b/code/Assbin/AssbinFileWriter.cpp new file mode 100644 index 000000000..4bc8f7cac --- /dev/null +++ b/code/Assbin/AssbinFileWriter.cpp @@ -0,0 +1,858 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2020, assimp team + + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ +/** @file AssbinFileWriter.cpp + * @brief Implementation of Assbin file writer. + */ + +#include "AssbinFileWriter.h" + +#include "Common/assbin_chunks.h" +#include "PostProcessing/ProcessHelper.h" + +#include +#include +#include +#include + +#ifdef ASSIMP_BUILD_NO_OWN_ZLIB +# include +#else +# include "../contrib/zlib/zlib.h" +#endif + +#include + +namespace Assimp { + +template +size_t Write(IOStream * stream, const T& v) { + return stream->Write( &v, sizeof(T), 1 ); +} + +// ----------------------------------------------------------------------------------- +// Serialize an aiString +template <> +inline +size_t Write(IOStream * stream, const aiString& s) { + const size_t s2 = (uint32_t)s.length; + stream->Write(&s,4,1); + stream->Write(s.data,s2,1); + + return s2+4; +} + +// ----------------------------------------------------------------------------------- +// Serialize an unsigned int as uint32_t +template <> +inline +size_t Write(IOStream * stream, const unsigned int& w) { + const uint32_t t = (uint32_t)w; + if (w > t) { + // this shouldn't happen, integers in Assimp data structures never exceed 2^32 + throw DeadlyExportError("loss of data due to 64 -> 32 bit integer conversion"); + } + + stream->Write(&t,4,1); + + return 4; +} + +// ----------------------------------------------------------------------------------- +// Serialize an unsigned int as uint16_t +template <> +inline +size_t Write(IOStream * stream, const uint16_t& w) { + static_assert(sizeof(uint16_t)==2, "sizeof(uint16_t)==2"); + stream->Write(&w,2,1); + + return 2; +} + +// ----------------------------------------------------------------------------------- +// Serialize a float +template <> +inline +size_t Write(IOStream * stream, const float& f) { + static_assert(sizeof(float)==4, "sizeof(float)==4"); + stream->Write(&f,4,1); + + return 4; +} + +// ----------------------------------------------------------------------------------- +// Serialize a double +template <> +inline +size_t Write(IOStream * stream, const double& f) { + static_assert(sizeof(double)==8, "sizeof(double)==8"); + stream->Write(&f,8,1); + + return 8; +} + +// ----------------------------------------------------------------------------------- +// Serialize a vec3 +template <> +inline +size_t Write(IOStream * stream, const aiVector3D& v) { + size_t t = Write(stream,v.x); + t += Write(stream,v.y); + t += Write(stream,v.z); + + return t; +} + +// ----------------------------------------------------------------------------------- +// Serialize a color value +template <> +inline +size_t Write(IOStream * stream, const aiColor3D& v) { + size_t t = Write(stream,v.r); + t += Write(stream,v.g); + t += Write(stream,v.b); + + return t; +} + +// ----------------------------------------------------------------------------------- +// Serialize a color value +template <> +inline +size_t Write(IOStream * stream, const aiColor4D& v) { + size_t t = Write(stream,v.r); + t += Write(stream,v.g); + t += Write(stream,v.b); + t += Write(stream,v.a); + + return t; +} + +// ----------------------------------------------------------------------------------- +// Serialize a quaternion +template <> +inline +size_t Write(IOStream * stream, const aiQuaternion& v) { + size_t t = Write(stream,v.w); + t += Write(stream,v.x); + t += Write(stream,v.y); + t += Write(stream,v.z); + ai_assert(t == 16); + + return 16; +} + +// ----------------------------------------------------------------------------------- +// Serialize a vertex weight +template <> +inline +size_t Write(IOStream * stream, const aiVertexWeight& v) { + size_t t = Write(stream,v.mVertexId); + + return t+Write(stream,v.mWeight); +} + +// ----------------------------------------------------------------------------------- +// Serialize a mat4x4 +template <> +inline +size_t Write(IOStream * stream, const aiMatrix4x4& m) { + for (unsigned int i = 0; i < 4;++i) { + for (unsigned int i2 = 0; i2 < 4;++i2) { + Write(stream,m[i][i2]); + } + } + + return 64; +} + +// ----------------------------------------------------------------------------------- +// Serialize an aiVectorKey +template <> +inline +size_t Write(IOStream * stream, const aiVectorKey& v) { + const size_t t = Write(stream,v.mTime); + return t + Write(stream,v.mValue); +} + +// ----------------------------------------------------------------------------------- +// Serialize an aiQuatKey +template <> +inline +size_t Write(IOStream * stream, const aiQuatKey& v) { + const size_t t = Write(stream,v.mTime); + return t + Write(stream,v.mValue); +} + +template +inline +size_t WriteBounds(IOStream * stream, const T* in, unsigned int size) { + T minc, maxc; + ArrayBounds(in,size,minc,maxc); + + const size_t t = Write(stream,minc); + return t + Write(stream,maxc); +} + +// We use this to write out non-byte arrays so that we write using the specializations. +// This way we avoid writing out extra bytes that potentially come from struct alignment. +template +inline +size_t WriteArray(IOStream * stream, const T* in, unsigned int size) { + size_t n = 0; + for (unsigned int i=0; i(stream,in[i]); + + return n; +} + +// ---------------------------------------------------------------------------------- +/** @class AssbinChunkWriter + * @brief Chunk writer mechanism for the .assbin file structure + * + * This is a standard in-memory IOStream (most of the code is based on BlobIOStream), + * the difference being that this takes another IOStream as a "container" in the + * constructor, and when it is destroyed, it appends the magic number, the chunk size, + * and the chunk contents to the container stream. This allows relatively easy chunk + * chunk construction, even recursively. + */ +class AssbinChunkWriter : public IOStream +{ +private: + + uint8_t* buffer; + uint32_t magic; + IOStream * container; + size_t cur_size, cursor, initial; + +private: + // ------------------------------------------------------------------- + void Grow(size_t need = 0) + { + size_t new_size = std::max(initial, std::max( need, cur_size+(cur_size>>1) )); + + const uint8_t* const old = buffer; + buffer = new uint8_t[new_size]; + + if (old) { + memcpy(buffer,old,cur_size); + delete[] old; + } + + cur_size = new_size; + } + +public: + + AssbinChunkWriter( IOStream * container, uint32_t magic, size_t initial = 4096) + : buffer(NULL), magic(magic), container(container), cur_size(0), cursor(0), initial(initial) + { + } + + virtual ~AssbinChunkWriter() + { + if (container) { + container->Write( &magic, sizeof(uint32_t), 1 ); + container->Write( &cursor, sizeof(uint32_t), 1 ); + container->Write( buffer, 1, cursor ); + } + if (buffer) delete[] buffer; + } + + void * GetBufferPointer() { return buffer; } + + // ------------------------------------------------------------------- + virtual size_t Read(void* /*pvBuffer*/, size_t /*pSize*/, size_t /*pCount*/) { + return 0; + } + virtual aiReturn Seek(size_t /*pOffset*/, aiOrigin /*pOrigin*/) { + return aiReturn_FAILURE; + } + virtual size_t Tell() const { + return cursor; + } + virtual void Flush() { + // not implemented + } + + virtual size_t FileSize() const { + return cursor; + } + + // ------------------------------------------------------------------- + virtual size_t Write(const void* pvBuffer, size_t pSize, size_t pCount) { + pSize *= pCount; + if (cursor + pSize > cur_size) { + Grow(cursor + pSize); + } + + memcpy(buffer+cursor, pvBuffer, pSize); + cursor += pSize; + + return pCount; + } + +}; + +// ---------------------------------------------------------------------------------- +/** @class AssbinFileWriter + * @brief Assbin file writer class + * + * This class writes an .assbin file, and is responsible for the file layout. + */ +class AssbinFileWriter +{ +private: + bool shortened; + bool compressed; + +protected: + // ----------------------------------------------------------------------------------- + void WriteBinaryNode( IOStream * container, const aiNode* node) + { + AssbinChunkWriter chunk( container, ASSBIN_CHUNK_AINODE ); + + unsigned int nb_metadata = (node->mMetaData != NULL ? node->mMetaData->mNumProperties : 0); + + Write(&chunk,node->mName); + Write(&chunk,node->mTransformation); + Write(&chunk,node->mNumChildren); + Write(&chunk,node->mNumMeshes); + Write(&chunk,nb_metadata); + + for (unsigned int i = 0; i < node->mNumMeshes;++i) { + Write(&chunk,node->mMeshes[i]); + } + + for (unsigned int i = 0; i < node->mNumChildren;++i) { + WriteBinaryNode( &chunk, node->mChildren[i] ); + } + + for (unsigned int i = 0; i < nb_metadata; ++i) { + const aiString& key = node->mMetaData->mKeys[i]; + aiMetadataType type = node->mMetaData->mValues[i].mType; + void* value = node->mMetaData->mValues[i].mData; + + Write(&chunk, key); + Write(&chunk, type); + + switch (type) { + case AI_BOOL: + Write(&chunk, *((bool*) value)); + break; + case AI_INT32: + Write(&chunk, *((int32_t*) value)); + break; + case AI_UINT64: + Write(&chunk, *((uint64_t*) value)); + break; + case AI_FLOAT: + Write(&chunk, *((float*) value)); + break; + case AI_DOUBLE: + Write(&chunk, *((double*) value)); + break; + case AI_AISTRING: + Write(&chunk, *((aiString*) value)); + break; + case AI_AIVECTOR3D: + Write(&chunk, *((aiVector3D*) value)); + break; +#ifdef SWIG + case FORCE_32BIT: +#endif // SWIG + default: + break; + } + } + } + + // ----------------------------------------------------------------------------------- + void WriteBinaryTexture(IOStream * container, const aiTexture* tex) + { + AssbinChunkWriter chunk( container, ASSBIN_CHUNK_AITEXTURE ); + + Write(&chunk,tex->mWidth); + Write(&chunk,tex->mHeight); + // Write the texture format, but don't include the null terminator. + chunk.Write( tex->achFormatHint, sizeof(char), HINTMAXTEXTURELEN - 1 ); + + if(!shortened) { + if (!tex->mHeight) { + chunk.Write(tex->pcData,1,tex->mWidth); + } + else { + chunk.Write(tex->pcData,1,tex->mWidth*tex->mHeight*4); + } + } + + } + + // ----------------------------------------------------------------------------------- + void WriteBinaryBone(IOStream * container, const aiBone* b) + { + AssbinChunkWriter chunk( container, ASSBIN_CHUNK_AIBONE ); + + Write(&chunk,b->mName); + Write(&chunk,b->mNumWeights); + Write(&chunk,b->mOffsetMatrix); + + // for the moment we write dumb min/max values for the bones, too. + // maybe I'll add a better, hash-like solution later + if (shortened) { + WriteBounds(&chunk,b->mWeights,b->mNumWeights); + } // else write as usual + else WriteArray(&chunk,b->mWeights,b->mNumWeights); + } + + // ----------------------------------------------------------------------------------- + void WriteBinaryMesh(IOStream * container, const aiMesh* mesh) + { + AssbinChunkWriter chunk( container, ASSBIN_CHUNK_AIMESH ); + + Write(&chunk,mesh->mPrimitiveTypes); + Write(&chunk,mesh->mNumVertices); + Write(&chunk,mesh->mNumFaces); + Write(&chunk,mesh->mNumBones); + Write(&chunk,mesh->mMaterialIndex); + + // first of all, write bits for all existent vertex components + unsigned int c = 0; + if (mesh->mVertices) { + c |= ASSBIN_MESH_HAS_POSITIONS; + } + if (mesh->mNormals) { + c |= ASSBIN_MESH_HAS_NORMALS; + } + if (mesh->mTangents && mesh->mBitangents) { + c |= ASSBIN_MESH_HAS_TANGENTS_AND_BITANGENTS; + } + for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_TEXTURECOORDS;++n) { + if (!mesh->mTextureCoords[n]) { + break; + } + c |= ASSBIN_MESH_HAS_TEXCOORD(n); + } + for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_COLOR_SETS;++n) { + if (!mesh->mColors[n]) { + break; + } + c |= ASSBIN_MESH_HAS_COLOR(n); + } + Write(&chunk,c); + + aiVector3D minVec, maxVec; + if (mesh->mVertices) { + if (shortened) { + WriteBounds(&chunk,mesh->mVertices,mesh->mNumVertices); + } // else write as usual + else WriteArray(&chunk,mesh->mVertices,mesh->mNumVertices); + } + if (mesh->mNormals) { + if (shortened) { + WriteBounds(&chunk,mesh->mNormals,mesh->mNumVertices); + } // else write as usual + else WriteArray(&chunk,mesh->mNormals,mesh->mNumVertices); + } + if (mesh->mTangents && mesh->mBitangents) { + if (shortened) { + WriteBounds(&chunk,mesh->mTangents,mesh->mNumVertices); + WriteBounds(&chunk,mesh->mBitangents,mesh->mNumVertices); + } // else write as usual + else { + WriteArray(&chunk,mesh->mTangents,mesh->mNumVertices); + WriteArray(&chunk,mesh->mBitangents,mesh->mNumVertices); + } + } + for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_COLOR_SETS;++n) { + if (!mesh->mColors[n]) + break; + + if (shortened) { + WriteBounds(&chunk,mesh->mColors[n],mesh->mNumVertices); + } // else write as usual + else WriteArray(&chunk,mesh->mColors[n],mesh->mNumVertices); + } + for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_TEXTURECOORDS;++n) { + if (!mesh->mTextureCoords[n]) + break; + + // write number of UV components + Write(&chunk,mesh->mNumUVComponents[n]); + + if (shortened) { + WriteBounds(&chunk,mesh->mTextureCoords[n],mesh->mNumVertices); + } // else write as usual + else WriteArray(&chunk,mesh->mTextureCoords[n],mesh->mNumVertices); + } + + // write faces. There are no floating-point calculations involved + // in these, so we can write a simple hash over the face data + // to the dump file. We generate a single 32 Bit hash for 512 faces + // using Assimp's standard hashing function. + if (shortened) { + unsigned int processed = 0; + for (unsigned int job;(job = std::min(mesh->mNumFaces-processed,512u));processed += job) { + + uint32_t hash = 0; + for (unsigned int a = 0; a < job;++a) { + + const aiFace& f = mesh->mFaces[processed+a]; + uint32_t tmp = f.mNumIndices; + hash = SuperFastHash(reinterpret_cast(&tmp),sizeof tmp,hash); + for (unsigned int i = 0; i < f.mNumIndices; ++i) { + static_assert(AI_MAX_VERTICES <= 0xffffffff, "AI_MAX_VERTICES <= 0xffffffff"); + tmp = static_cast( f.mIndices[i] ); + hash = SuperFastHash(reinterpret_cast(&tmp),sizeof tmp,hash); + } + } + Write(&chunk,hash); + } + } + else // else write as usual + { + // if there are less than 2^16 vertices, we can simply use 16 bit integers ... + for (unsigned int i = 0; i < mesh->mNumFaces;++i) { + const aiFace& f = mesh->mFaces[i]; + + static_assert(AI_MAX_FACE_INDICES <= 0xffff, "AI_MAX_FACE_INDICES <= 0xffff"); + Write(&chunk,f.mNumIndices); + + for (unsigned int a = 0; a < f.mNumIndices;++a) { + if (mesh->mNumVertices < (1u<<16)) { + Write(&chunk,f.mIndices[a]); + } + else Write(&chunk,f.mIndices[a]); + } + } + } + + // write bones + if (mesh->mNumBones) { + for (unsigned int a = 0; a < mesh->mNumBones;++a) { + const aiBone* b = mesh->mBones[a]; + WriteBinaryBone(&chunk,b); + } + } + } + + // ----------------------------------------------------------------------------------- + void WriteBinaryMaterialProperty(IOStream * container, const aiMaterialProperty* prop) + { + AssbinChunkWriter chunk( container, ASSBIN_CHUNK_AIMATERIALPROPERTY ); + + Write(&chunk,prop->mKey); + Write(&chunk,prop->mSemantic); + Write(&chunk,prop->mIndex); + + Write(&chunk,prop->mDataLength); + Write(&chunk,(unsigned int)prop->mType); + chunk.Write(prop->mData,1,prop->mDataLength); + } + + // ----------------------------------------------------------------------------------- + void WriteBinaryMaterial(IOStream * container, const aiMaterial* mat) + { + AssbinChunkWriter chunk( container, ASSBIN_CHUNK_AIMATERIAL); + + Write(&chunk,mat->mNumProperties); + for (unsigned int i = 0; i < mat->mNumProperties;++i) { + WriteBinaryMaterialProperty( &chunk, mat->mProperties[i]); + } + } + + // ----------------------------------------------------------------------------------- + void WriteBinaryNodeAnim(IOStream * container, const aiNodeAnim* nd) + { + AssbinChunkWriter chunk( container, ASSBIN_CHUNK_AINODEANIM ); + + Write(&chunk,nd->mNodeName); + Write(&chunk,nd->mNumPositionKeys); + Write(&chunk,nd->mNumRotationKeys); + Write(&chunk,nd->mNumScalingKeys); + Write(&chunk,nd->mPreState); + Write(&chunk,nd->mPostState); + + if (nd->mPositionKeys) { + if (shortened) { + WriteBounds(&chunk,nd->mPositionKeys,nd->mNumPositionKeys); + + } // else write as usual + else WriteArray(&chunk,nd->mPositionKeys,nd->mNumPositionKeys); + } + if (nd->mRotationKeys) { + if (shortened) { + WriteBounds(&chunk,nd->mRotationKeys,nd->mNumRotationKeys); + + } // else write as usual + else WriteArray(&chunk,nd->mRotationKeys,nd->mNumRotationKeys); + } + if (nd->mScalingKeys) { + if (shortened) { + WriteBounds(&chunk,nd->mScalingKeys,nd->mNumScalingKeys); + + } // else write as usual + else WriteArray(&chunk,nd->mScalingKeys,nd->mNumScalingKeys); + } + } + + + // ----------------------------------------------------------------------------------- + void WriteBinaryAnim( IOStream * container, const aiAnimation* anim ) + { + AssbinChunkWriter chunk( container, ASSBIN_CHUNK_AIANIMATION ); + + Write(&chunk,anim->mName); + Write(&chunk,anim->mDuration); + Write(&chunk,anim->mTicksPerSecond); + Write(&chunk,anim->mNumChannels); + + for (unsigned int a = 0; a < anim->mNumChannels;++a) { + const aiNodeAnim* nd = anim->mChannels[a]; + WriteBinaryNodeAnim(&chunk,nd); + } + } + + // ----------------------------------------------------------------------------------- + void WriteBinaryLight( IOStream * container, const aiLight* l ) + { + AssbinChunkWriter chunk( container, ASSBIN_CHUNK_AILIGHT ); + + Write(&chunk,l->mName); + Write(&chunk,l->mType); + + if (l->mType != aiLightSource_DIRECTIONAL) { + Write(&chunk,l->mAttenuationConstant); + Write(&chunk,l->mAttenuationLinear); + Write(&chunk,l->mAttenuationQuadratic); + } + + Write(&chunk,l->mColorDiffuse); + Write(&chunk,l->mColorSpecular); + Write(&chunk,l->mColorAmbient); + + if (l->mType == aiLightSource_SPOT) { + Write(&chunk,l->mAngleInnerCone); + Write(&chunk,l->mAngleOuterCone); + } + + } + + // ----------------------------------------------------------------------------------- + void WriteBinaryCamera( IOStream * container, const aiCamera* cam ) + { + AssbinChunkWriter chunk( container, ASSBIN_CHUNK_AICAMERA ); + + Write(&chunk,cam->mName); + Write(&chunk,cam->mPosition); + Write(&chunk,cam->mLookAt); + Write(&chunk,cam->mUp); + Write(&chunk,cam->mHorizontalFOV); + Write(&chunk,cam->mClipPlaneNear); + Write(&chunk,cam->mClipPlaneFar); + Write(&chunk,cam->mAspect); + } + + // ----------------------------------------------------------------------------------- + void WriteBinaryScene( IOStream * container, const aiScene* scene) + { + AssbinChunkWriter chunk( container, ASSBIN_CHUNK_AISCENE ); + + // basic scene information + Write(&chunk,scene->mFlags); + Write(&chunk,scene->mNumMeshes); + Write(&chunk,scene->mNumMaterials); + Write(&chunk,scene->mNumAnimations); + Write(&chunk,scene->mNumTextures); + Write(&chunk,scene->mNumLights); + Write(&chunk,scene->mNumCameras); + + // write node graph + WriteBinaryNode( &chunk, scene->mRootNode ); + + // write all meshes + for (unsigned int i = 0; i < scene->mNumMeshes;++i) { + const aiMesh* mesh = scene->mMeshes[i]; + WriteBinaryMesh( &chunk,mesh); + } + + // write materials + for (unsigned int i = 0; i< scene->mNumMaterials; ++i) { + const aiMaterial* mat = scene->mMaterials[i]; + WriteBinaryMaterial(&chunk,mat); + } + + // write all animations + for (unsigned int i = 0; i < scene->mNumAnimations;++i) { + const aiAnimation* anim = scene->mAnimations[i]; + WriteBinaryAnim(&chunk,anim); + } + + + // write all textures + for (unsigned int i = 0; i < scene->mNumTextures;++i) { + const aiTexture* mesh = scene->mTextures[i]; + WriteBinaryTexture(&chunk,mesh); + } + + // write lights + for (unsigned int i = 0; i < scene->mNumLights;++i) { + const aiLight* l = scene->mLights[i]; + WriteBinaryLight(&chunk,l); + } + + // write cameras + for (unsigned int i = 0; i < scene->mNumCameras;++i) { + const aiCamera* cam = scene->mCameras[i]; + WriteBinaryCamera(&chunk,cam); + } + + } + +public: + AssbinFileWriter(bool shortened, bool compressed) + : shortened(shortened), compressed(compressed) + { + } + + // ----------------------------------------------------------------------------------- + // Write a binary model dump + void WriteBinaryDump(const char* pFile, const char* cmd, IOSystem* pIOSystem, const aiScene* pScene) + { + IOStream * out = pIOSystem->Open( pFile, "wb" ); + if (!out) + throw std::runtime_error("Unable to open output file " + std::string(pFile) + '\n'); + + auto CloseIOStream = [&]() { + if (out) { + pIOSystem->Close(out); + out = nullptr; // Ensure this is only done once. + } + }; + + try { + time_t tt = time(NULL); +#if _WIN32 + tm* p = gmtime(&tt); +#else + struct tm now; + tm* p = gmtime_r(&tt, &now); +#endif + + // header + char s[64]; + memset(s, 0, 64); +#if _MSC_VER >= 1400 + sprintf_s(s, "ASSIMP.binary-dump.%s", asctime(p)); +#else + ai_snprintf(s, 64, "ASSIMP.binary-dump.%s", asctime(p)); +#endif + out->Write(s, 44, 1); + // == 44 bytes + + Write(out, ASSBIN_VERSION_MAJOR); + Write(out, ASSBIN_VERSION_MINOR); + Write(out, aiGetVersionRevision()); + Write(out, aiGetCompileFlags()); + Write(out, shortened); + Write(out, compressed); + // == 20 bytes + + char buff[256] = {0}; + ai_snprintf(buff, 256, "%s", pFile); + out->Write(buff, sizeof(char), 256); + + memset(buff, 0, sizeof(buff)); + ai_snprintf(buff, 128, "%s", cmd); + out->Write(buff, sizeof(char), 128); + + // leave 64 bytes free for future extensions + memset(buff, 0xcd, 64); + out->Write(buff, sizeof(char), 64); + // == 435 bytes + + // ==== total header size: 512 bytes + ai_assert(out->Tell() == ASSBIN_HEADER_LENGTH); + + // Up to here the data is uncompressed. For compressed files, the rest + // is compressed using standard DEFLATE from zlib. + if (compressed) + { + AssbinChunkWriter uncompressedStream(NULL, 0); + WriteBinaryScene(&uncompressedStream, pScene); + + uLongf uncompressedSize = static_cast(uncompressedStream.Tell()); + uLongf compressedSize = (uLongf)compressBound(uncompressedSize); + uint8_t* compressedBuffer = new uint8_t[compressedSize]; + + int res = compress2(compressedBuffer, &compressedSize, (const Bytef*)uncompressedStream.GetBufferPointer(), uncompressedSize, 9); + if (res != Z_OK) + { + delete[] compressedBuffer; + throw DeadlyExportError("Compression failed."); + } + + out->Write(&uncompressedSize, sizeof(uint32_t), 1); + out->Write(compressedBuffer, sizeof(char), compressedSize); + + delete[] compressedBuffer; + } + else + { + WriteBinaryScene(out, pScene); + } + + CloseIOStream(); + } + catch (...) { + CloseIOStream(); + throw; + } + } +}; + +void DumpSceneToAssbin( + const char* pFile, const char* cmd, IOSystem* pIOSystem, + const aiScene* pScene, bool shortened, bool compressed) { + AssbinFileWriter fileWriter(shortened, compressed); + fileWriter.WriteBinaryDump(pFile, cmd, pIOSystem, pScene); +} + +} // end of namespace Assimp diff --git a/code/Assbin/AssbinFileWriter.h b/code/Assbin/AssbinFileWriter.h new file mode 100644 index 000000000..25db6db2d --- /dev/null +++ b/code/Assbin/AssbinFileWriter.h @@ -0,0 +1,66 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2020, assimp team + + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ + +/** @file AssbinFileWriter.h + * @brief Declaration of Assbin file writer. + */ + +#ifndef AI_ASSBINFILEWRITER_H_INC +#define AI_ASSBINFILEWRITER_H_INC + +#include +#include +#include + +namespace Assimp { + +void ASSIMP_API DumpSceneToAssbin( + const char* pFile, + const char* cmd, + IOSystem* pIOSystem, + const aiScene* pScene, + bool shortened, + bool compressed); + +} + +#endif // AI_ASSBINFILEWRITER_H_INC diff --git a/code/Assbin/AssbinLoader.cpp b/code/Assbin/AssbinLoader.cpp index becc3f8fc..71e35cb6a 100644 --- a/code/Assbin/AssbinLoader.cpp +++ b/code/Assbin/AssbinLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team @@ -535,7 +535,7 @@ void AssbinImporter::ReadBinaryTexture(IOStream * stream, aiTexture* tex) { tex->mWidth = Read(stream); tex->mHeight = Read(stream); - stream->Read( tex->achFormatHint, sizeof(char), 4 ); + stream->Read( tex->achFormatHint, sizeof(char), HINTMAXTEXTURELEN - 1 ); if(!shortened) { if (!tex->mHeight) { diff --git a/code/Assbin/AssbinLoader.h b/code/Assbin/AssbinLoader.h index 9f2dde125..e6e99f26e 100644 --- a/code/Assbin/AssbinLoader.h +++ b/code/Assbin/AssbinLoader.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Assjson/cencode.c b/code/Assjson/cencode.c index db99e7efa..bd302100b 100644 --- a/code/Assjson/cencode.c +++ b/code/Assjson/cencode.c @@ -42,7 +42,7 @@ int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, { state_in->result = result; state_in->step = step_A; - return codechar - code_out; + return (int)(codechar - code_out); } fragment = *plainchar++; result = (fragment & 0x0fc) >> 2; @@ -53,7 +53,7 @@ int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, { state_in->result = result; state_in->step = step_B; - return codechar - code_out; + return (int)(codechar - code_out); } fragment = *plainchar++; result |= (fragment & 0x0f0) >> 4; @@ -64,7 +64,7 @@ int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, { state_in->result = result; state_in->step = step_C; - return codechar - code_out; + return (int)(codechar - code_out); } fragment = *plainchar++; result |= (fragment & 0x0c0) >> 6; @@ -81,7 +81,7 @@ int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, } } /* control should not reach here */ - return codechar - code_out; + return (int)(codechar - code_out); } int base64_encode_blockend(char* code_out, base64_encodestate* state_in) @@ -104,6 +104,6 @@ int base64_encode_blockend(char* code_out, base64_encodestate* state_in) } *codechar++ = '\n'; - return codechar - code_out; + return (int)(codechar - code_out); } diff --git a/code/Assxml/AssxmlExporter.cpp b/code/Assxml/AssxmlExporter.cpp index afdecbaf6..720fd5b40 100644 --- a/code/Assxml/AssxmlExporter.cpp +++ b/code/Assxml/AssxmlExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -46,607 +46,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_EXPORT #ifndef ASSIMP_BUILD_NO_ASSXML_EXPORTER -#include "PostProcessing/ProcessHelper.h" - -#include -#include +#include "AssxmlFileWriter.h" #include #include -#include - -#ifdef ASSIMP_BUILD_NO_OWN_ZLIB -# include -#else -# include -#endif - -#include -#include - -using namespace Assimp; - namespace Assimp { -namespace AssxmlExport { - -// ----------------------------------------------------------------------------------- -static int ioprintf( IOStream * io, const char *format, ... ) { - using namespace std; - if ( nullptr == io ) { - return -1; - } - - static const int Size = 4096; - char sz[ Size ]; - ::memset( sz, '\0', Size ); - va_list va; - va_start( va, format ); - const unsigned int nSize = vsnprintf( sz, Size-1, format, va ); - ai_assert( nSize < Size ); - va_end( va ); - - io->Write( sz, sizeof(char), nSize ); - - return nSize; -} - -// ----------------------------------------------------------------------------------- -// Convert a name to standard XML format -static void ConvertName(aiString& out, const aiString& in) { - out.length = 0; - for (unsigned int i = 0; i < in.length; ++i) { - switch (in.data[i]) { - case '<': - out.Append("<");break; - case '>': - out.Append(">");break; - case '&': - out.Append("&");break; - case '\"': - out.Append(""");break; - case '\'': - out.Append("'");break; - default: - out.data[out.length++] = in.data[i]; - } - } - out.data[out.length] = 0; -} - -// ----------------------------------------------------------------------------------- -// Write a single node as text dump -static void WriteNode(const aiNode* node, IOStream * io, unsigned int depth) { - char prefix[512]; - for (unsigned int i = 0; i < depth;++i) - prefix[i] = '\t'; - prefix[depth] = '\0'; - - const aiMatrix4x4& m = node->mTransformation; - - aiString name; - ConvertName(name,node->mName); - ioprintf(io,"%s \n" - "%s\t \n" - "%s\t\t%0 6f %0 6f %0 6f %0 6f\n" - "%s\t\t%0 6f %0 6f %0 6f %0 6f\n" - "%s\t\t%0 6f %0 6f %0 6f %0 6f\n" - "%s\t\t%0 6f %0 6f %0 6f %0 6f\n" - "%s\t \n", - prefix,name.data,prefix, - prefix,m.a1,m.a2,m.a3,m.a4, - prefix,m.b1,m.b2,m.b3,m.b4, - prefix,m.c1,m.c2,m.c3,m.c4, - prefix,m.d1,m.d2,m.d3,m.d4,prefix); - - if (node->mNumMeshes) { - ioprintf(io, "%s\t\n%s\t", - prefix,node->mNumMeshes,prefix); - - for (unsigned int i = 0; i < node->mNumMeshes;++i) { - ioprintf(io,"%i ",node->mMeshes[i]); - } - ioprintf(io,"\n%s\t\n",prefix); - } - - if (node->mNumChildren) { - ioprintf(io,"%s\t\n", - prefix,node->mNumChildren); - - for (unsigned int i = 0; i < node->mNumChildren;++i) { - WriteNode(node->mChildren[i],io,depth+2); - } - ioprintf(io,"%s\t\n",prefix); - } - ioprintf(io,"%s\n",prefix); -} - - -// ----------------------------------------------------------------------------------- -// Some chuncks of text will need to be encoded for XML -// http://stackoverflow.com/questions/5665231/most-efficient-way-to-escape-xml-html-in-c-string#5665377 -static std::string encodeXML(const std::string& data) { - std::string buffer; - buffer.reserve(data.size()); - for(size_t pos = 0; pos != data.size(); ++pos) { - switch(data[pos]) { - case '&': buffer.append("&"); break; - case '\"': buffer.append("""); break; - case '\'': buffer.append("'"); break; - case '<': buffer.append("<"); break; - case '>': buffer.append(">"); break; - default: buffer.append(&data[pos], 1); break; - } - } - return buffer; -} - -// ----------------------------------------------------------------------------------- -// Write a text model dump -static -void WriteDump(const aiScene* scene, IOStream* io, bool shortened) { - time_t tt = ::time( NULL ); -#if _WIN32 - tm* p = gmtime(&tt); -#else - struct tm now; - tm* p = gmtime_r(&tt, &now); -#endif - ai_assert(nullptr != p); - - // write header - std::string header( - "\n" - "\n\n" - "" - " \n\n" - "\n" - ); - - const unsigned int majorVersion( aiGetVersionMajor() ); - const unsigned int minorVersion( aiGetVersionMinor() ); - const unsigned int rev( aiGetVersionRevision() ); - const char *curtime( asctime( p ) ); - ioprintf( io, header.c_str(), majorVersion, minorVersion, rev, curtime, scene->mFlags, 0 ); - - // write the node graph - WriteNode(scene->mRootNode, io, 0); - -#if 0 - // write cameras - for (unsigned int i = 0; i < scene->mNumCameras;++i) { - aiCamera* cam = scene->mCameras[i]; - ConvertName(name,cam->mName); - - // camera header - ioprintf(io,"\t\n" - "\t\t %0 8f %0 8f %0 8f \n" - "\t\t %0 8f %0 8f %0 8f \n" - "\t\t %0 8f %0 8f %0 8f \n" - "\t\t %f \n" - "\t\t %f \n" - "\t\t %f \n" - "\t\t %f \n" - "\t\n", - name.data, - cam->mUp.x,cam->mUp.y,cam->mUp.z, - cam->mLookAt.x,cam->mLookAt.y,cam->mLookAt.z, - cam->mPosition.x,cam->mPosition.y,cam->mPosition.z, - cam->mHorizontalFOV,cam->mAspect,cam->mClipPlaneNear,cam->mClipPlaneFar,i); - } - - // write lights - for (unsigned int i = 0; i < scene->mNumLights;++i) { - aiLight* l = scene->mLights[i]; - ConvertName(name,l->mName); - - // light header - ioprintf(io,"\t type=\"%s\"\n" - "\t\t %0 8f %0 8f %0 8f \n" - "\t\t %0 8f %0 8f %0 8f \n" - "\t\t %0 8f %0 8f %0 8f \n", - name.data, - (l->mType == aiLightSource_DIRECTIONAL ? "directional" : - (l->mType == aiLightSource_POINT ? "point" : "spot" )), - l->mColorDiffuse.r, l->mColorDiffuse.g, l->mColorDiffuse.b, - l->mColorSpecular.r,l->mColorSpecular.g,l->mColorSpecular.b, - l->mColorAmbient.r, l->mColorAmbient.g, l->mColorAmbient.b); - - if (l->mType != aiLightSource_DIRECTIONAL) { - ioprintf(io, - "\t\t %0 8f %0 8f %0 8f \n" - "\t\t %f \n" - "\t\t %f \n" - "\t\t %f \n", - l->mPosition.x,l->mPosition.y,l->mPosition.z, - l->mAttenuationConstant,l->mAttenuationLinear,l->mAttenuationQuadratic); - } - - if (l->mType != aiLightSource_POINT) { - ioprintf(io, - "\t\t %0 8f %0 8f %0 8f \n", - l->mDirection.x,l->mDirection.y,l->mDirection.z); - } - - if (l->mType == aiLightSource_SPOT) { - ioprintf(io, - "\t\t %f \n" - "\t\t %f \n", - l->mAngleOuterCone,l->mAngleInnerCone); - } - ioprintf(io,"\t\n"); - } -#endif - aiString name; - - // write textures - if (scene->mNumTextures) { - ioprintf(io,"\n",scene->mNumTextures); - for (unsigned int i = 0; i < scene->mNumTextures;++i) { - aiTexture* tex = scene->mTextures[i]; - bool compressed = (tex->mHeight == 0); - - // mesh header - ioprintf(io,"\t \n", - (compressed ? -1 : tex->mWidth),(compressed ? -1 : tex->mHeight), - (compressed ? "true" : "false")); - - if (compressed) { - ioprintf(io,"\t\t \n",tex->mWidth); - - if (!shortened) { - for (unsigned int n = 0; n < tex->mWidth;++n) { - ioprintf(io,"\t\t\t%2x",reinterpret_cast(tex->pcData)[n]); - if (n && !(n % 50)) { - ioprintf(io,"\n"); - } - } - } - } - else if (!shortened){ - ioprintf(io,"\t\t \n",tex->mWidth*tex->mHeight*4); - - // const unsigned int width = (unsigned int)std::log10((double)std::max(tex->mHeight,tex->mWidth))+1; - for (unsigned int y = 0; y < tex->mHeight;++y) { - for (unsigned int x = 0; x < tex->mWidth;++x) { - aiTexel* tx = tex->pcData + y*tex->mWidth+x; - unsigned int r = tx->r,g=tx->g,b=tx->b,a=tx->a; - ioprintf(io,"\t\t\t%2x %2x %2x %2x",r,g,b,a); - - // group by four for readability - if ( 0 == ( x + y*tex->mWidth ) % 4 ) { - ioprintf( io, "\n" ); - } - } - } - } - ioprintf(io,"\t\t\n\t\n"); - } - ioprintf(io,"\n"); - } - - // write materials - if (scene->mNumMaterials) { - ioprintf(io,"\n",scene->mNumMaterials); - for (unsigned int i = 0; i< scene->mNumMaterials; ++i) { - const aiMaterial* mat = scene->mMaterials[i]; - - ioprintf(io,"\t\n"); - ioprintf(io,"\t\t\n",mat->mNumProperties); - for (unsigned int n = 0; n < mat->mNumProperties;++n) { - - const aiMaterialProperty* prop = mat->mProperties[n]; - const char* sz = ""; - if (prop->mType == aiPTI_Float) { - sz = "float"; - } - else if (prop->mType == aiPTI_Integer) { - sz = "integer"; - } - else if (prop->mType == aiPTI_String) { - sz = "string"; - } - else if (prop->mType == aiPTI_Buffer) { - sz = "binary_buffer"; - } - - ioprintf(io,"\t\t\tmKey.data, sz, - ::TextureTypeToString((aiTextureType)prop->mSemantic),prop->mIndex); - - if (prop->mType == aiPTI_Float) { - ioprintf(io," size=\"%i\">\n\t\t\t\t", - static_cast(prop->mDataLength/sizeof(float))); - - for (unsigned int p = 0; p < prop->mDataLength/sizeof(float);++p) { - ioprintf(io,"%f ",*((float*)(prop->mData+p*sizeof(float)))); - } - } - else if (prop->mType == aiPTI_Integer) { - ioprintf(io," size=\"%i\">\n\t\t\t\t", - static_cast(prop->mDataLength/sizeof(int))); - - for (unsigned int p = 0; p < prop->mDataLength/sizeof(int);++p) { - ioprintf(io,"%i ",*((int*)(prop->mData+p*sizeof(int)))); - } - } - else if (prop->mType == aiPTI_Buffer) { - ioprintf(io," size=\"%i\">\n\t\t\t\t", - static_cast(prop->mDataLength)); - - for (unsigned int p = 0; p < prop->mDataLength;++p) { - ioprintf(io,"%2x ",prop->mData[p]); - if (p && 0 == p%30) { - ioprintf(io,"\n\t\t\t\t"); - } - } - } - else if (prop->mType == aiPTI_String) { - ioprintf(io,">\n\t\t\t\t\"%s\"",encodeXML(prop->mData+4).c_str() /* skip length */); - } - ioprintf(io,"\n\t\t\t\n"); - } - ioprintf(io,"\t\t\n"); - ioprintf(io,"\t\n"); - } - ioprintf(io,"\n"); - } - - // write animations - if (scene->mNumAnimations) { - ioprintf(io,"\n",scene->mNumAnimations); - for (unsigned int i = 0; i < scene->mNumAnimations;++i) { - aiAnimation* anim = scene->mAnimations[i]; - - // anim header - ConvertName(name,anim->mName); - ioprintf(io,"\t\n", - name.data, anim->mDuration, anim->mTicksPerSecond); - - // write bone animation channels - if (anim->mNumChannels) { - ioprintf(io,"\t\t\n",anim->mNumChannels); - for (unsigned int n = 0; n < anim->mNumChannels;++n) { - aiNodeAnim* nd = anim->mChannels[n]; - - // node anim header - ConvertName(name,nd->mNodeName); - ioprintf(io,"\t\t\t\n",name.data); - - if (!shortened) { - // write position keys - if (nd->mNumPositionKeys) { - ioprintf(io,"\t\t\t\t\n",nd->mNumPositionKeys); - for (unsigned int a = 0; a < nd->mNumPositionKeys;++a) { - aiVectorKey* vc = nd->mPositionKeys+a; - ioprintf(io,"\t\t\t\t\t\n" - "\t\t\t\t\t\t%0 8f %0 8f %0 8f\n\t\t\t\t\t\n", - vc->mTime,vc->mValue.x,vc->mValue.y,vc->mValue.z); - } - ioprintf(io,"\t\t\t\t\n"); - } - - // write scaling keys - if (nd->mNumScalingKeys) { - ioprintf(io,"\t\t\t\t\n",nd->mNumScalingKeys); - for (unsigned int a = 0; a < nd->mNumScalingKeys;++a) { - aiVectorKey* vc = nd->mScalingKeys+a; - ioprintf(io,"\t\t\t\t\t\n" - "\t\t\t\t\t\t%0 8f %0 8f %0 8f\n\t\t\t\t\t\n", - vc->mTime,vc->mValue.x,vc->mValue.y,vc->mValue.z); - } - ioprintf(io,"\t\t\t\t\n"); - } - - // write rotation keys - if (nd->mNumRotationKeys) { - ioprintf(io,"\t\t\t\t\n",nd->mNumRotationKeys); - for (unsigned int a = 0; a < nd->mNumRotationKeys;++a) { - aiQuatKey* vc = nd->mRotationKeys+a; - ioprintf(io,"\t\t\t\t\t\n" - "\t\t\t\t\t\t%0 8f %0 8f %0 8f %0 8f\n\t\t\t\t\t\n", - vc->mTime,vc->mValue.x,vc->mValue.y,vc->mValue.z,vc->mValue.w); - } - ioprintf(io,"\t\t\t\t\n"); - } - } - ioprintf(io,"\t\t\t\n"); - } - ioprintf(io,"\t\t\n"); - } - ioprintf(io,"\t\n"); - } - ioprintf(io,"\n"); - } - - // write meshes - if (scene->mNumMeshes) { - ioprintf(io,"\n",scene->mNumMeshes); - for (unsigned int i = 0; i < scene->mNumMeshes;++i) { - aiMesh* mesh = scene->mMeshes[i]; - // const unsigned int width = (unsigned int)std::log10((double)mesh->mNumVertices)+1; - - // mesh header - ioprintf(io,"\t\n", - (mesh->mPrimitiveTypes & aiPrimitiveType_POINT ? "points" : ""), - (mesh->mPrimitiveTypes & aiPrimitiveType_LINE ? "lines" : ""), - (mesh->mPrimitiveTypes & aiPrimitiveType_TRIANGLE ? "triangles" : ""), - (mesh->mPrimitiveTypes & aiPrimitiveType_POLYGON ? "polygons" : ""), - mesh->mMaterialIndex); - - // bones - if (mesh->mNumBones) { - ioprintf(io,"\t\t\n",mesh->mNumBones); - - for (unsigned int n = 0; n < mesh->mNumBones;++n) { - aiBone* bone = mesh->mBones[n]; - - ConvertName(name,bone->mName); - // bone header - ioprintf(io,"\t\t\t\n" - "\t\t\t\t \n" - "\t\t\t\t\t%0 6f %0 6f %0 6f %0 6f\n" - "\t\t\t\t\t%0 6f %0 6f %0 6f %0 6f\n" - "\t\t\t\t\t%0 6f %0 6f %0 6f %0 6f\n" - "\t\t\t\t\t%0 6f %0 6f %0 6f %0 6f\n" - "\t\t\t\t \n", - name.data, - bone->mOffsetMatrix.a1,bone->mOffsetMatrix.a2,bone->mOffsetMatrix.a3,bone->mOffsetMatrix.a4, - bone->mOffsetMatrix.b1,bone->mOffsetMatrix.b2,bone->mOffsetMatrix.b3,bone->mOffsetMatrix.b4, - bone->mOffsetMatrix.c1,bone->mOffsetMatrix.c2,bone->mOffsetMatrix.c3,bone->mOffsetMatrix.c4, - bone->mOffsetMatrix.d1,bone->mOffsetMatrix.d2,bone->mOffsetMatrix.d3,bone->mOffsetMatrix.d4); - - if (!shortened && bone->mNumWeights) { - ioprintf(io,"\t\t\t\t\n",bone->mNumWeights); - - // bone weights - for (unsigned int a = 0; a < bone->mNumWeights;++a) { - aiVertexWeight* wght = bone->mWeights+a; - - ioprintf(io,"\t\t\t\t\t\n\t\t\t\t\t\t%f\n\t\t\t\t\t\n", - wght->mVertexId,wght->mWeight); - } - ioprintf(io,"\t\t\t\t\n"); - } - ioprintf(io,"\t\t\t\n"); - } - ioprintf(io,"\t\t\n"); - } - - // faces - if (!shortened && mesh->mNumFaces) { - ioprintf(io,"\t\t\n",mesh->mNumFaces); - for (unsigned int n = 0; n < mesh->mNumFaces; ++n) { - aiFace& f = mesh->mFaces[n]; - ioprintf(io,"\t\t\t\n" - "\t\t\t\t",f.mNumIndices); - - for (unsigned int j = 0; j < f.mNumIndices;++j) - ioprintf(io,"%i ",f.mIndices[j]); - - ioprintf(io,"\n\t\t\t\n"); - } - ioprintf(io,"\t\t\n"); - } - - // vertex positions - if (mesh->HasPositions()) { - ioprintf(io,"\t\t \n",mesh->mNumVertices); - if (!shortened) { - for (unsigned int n = 0; n < mesh->mNumVertices; ++n) { - ioprintf(io,"\t\t%0 8f %0 8f %0 8f\n", - mesh->mVertices[n].x, - mesh->mVertices[n].y, - mesh->mVertices[n].z); - } - } - ioprintf(io,"\t\t\n"); - } - - // vertex normals - if (mesh->HasNormals()) { - ioprintf(io,"\t\t \n",mesh->mNumVertices); - if (!shortened) { - for (unsigned int n = 0; n < mesh->mNumVertices; ++n) { - ioprintf(io,"\t\t%0 8f %0 8f %0 8f\n", - mesh->mNormals[n].x, - mesh->mNormals[n].y, - mesh->mNormals[n].z); - } - } - ioprintf(io,"\t\t\n"); - } - - // vertex tangents and bitangents - if (mesh->HasTangentsAndBitangents()) { - ioprintf(io,"\t\t \n",mesh->mNumVertices); - if (!shortened) { - for (unsigned int n = 0; n < mesh->mNumVertices; ++n) { - ioprintf(io,"\t\t%0 8f %0 8f %0 8f\n", - mesh->mTangents[n].x, - mesh->mTangents[n].y, - mesh->mTangents[n].z); - } - } - ioprintf(io,"\t\t\n"); - - ioprintf(io,"\t\t \n",mesh->mNumVertices); - if (!shortened) { - for (unsigned int n = 0; n < mesh->mNumVertices; ++n) { - ioprintf(io,"\t\t%0 8f %0 8f %0 8f\n", - mesh->mBitangents[n].x, - mesh->mBitangents[n].y, - mesh->mBitangents[n].z); - } - } - ioprintf(io,"\t\t\n"); - } - - // texture coordinates - for (unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a) { - if (!mesh->mTextureCoords[a]) - break; - - ioprintf(io,"\t\t \n",mesh->mNumVertices, - a,mesh->mNumUVComponents[a]); - - if (!shortened) { - if (mesh->mNumUVComponents[a] == 3) { - for (unsigned int n = 0; n < mesh->mNumVertices; ++n) { - ioprintf(io,"\t\t%0 8f %0 8f %0 8f\n", - mesh->mTextureCoords[a][n].x, - mesh->mTextureCoords[a][n].y, - mesh->mTextureCoords[a][n].z); - } - } - else { - for (unsigned int n = 0; n < mesh->mNumVertices; ++n) { - ioprintf(io,"\t\t%0 8f %0 8f\n", - mesh->mTextureCoords[a][n].x, - mesh->mTextureCoords[a][n].y); - } - } - } - ioprintf(io,"\t\t\n"); - } - - // vertex colors - for (unsigned int a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; ++a) { - if (!mesh->mColors[a]) - break; - ioprintf(io,"\t\t \n",mesh->mNumVertices,a); - if (!shortened) { - for (unsigned int n = 0; n < mesh->mNumVertices; ++n) { - ioprintf(io,"\t\t%0 8f %0 8f %0 8f %0 8f\n", - mesh->mColors[a][n].r, - mesh->mColors[a][n].g, - mesh->mColors[a][n].b, - mesh->mColors[a][n].a); - } - } - ioprintf(io,"\t\t\n"); - } - ioprintf(io,"\t\n"); - } - ioprintf(io,"\n"); - } - ioprintf(io,"\n"); -} - -} // end of namespace AssxmlExport - void ExportSceneAssxml(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* /*pProperties*/) { - IOStream * out = pIOSystem->Open( pFile, "wt" ); - if (!out) return; - - bool shortened = false; - AssxmlExport::WriteDump( pScene, out, shortened ); - - pIOSystem->Close( out ); + DumpSceneToAssxml( + pFile, + "\0", // command(s) + pIOSystem, + pScene, + false); // shortened? } } // end of namespace Assimp diff --git a/code/Assxml/AssxmlExporter.h b/code/Assxml/AssxmlExporter.h index 8ca887eea..a2b40ada1 100644 --- a/code/Assxml/AssxmlExporter.h +++ b/code/Assxml/AssxmlExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Assxml/AssxmlFileWriter.cpp b/code/Assxml/AssxmlFileWriter.cpp new file mode 100644 index 000000000..0ed59e509 --- /dev/null +++ b/code/Assxml/AssxmlFileWriter.cpp @@ -0,0 +1,664 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2020, assimp team + + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ + +/** @file AssxmlFileWriter.cpp + * @brief Implementation of Assxml file writer. + */ + +#include "AssxmlFileWriter.h" + +#include "PostProcessing/ProcessHelper.h" + +#include +#include +#include +#include + +#include + +#ifdef ASSIMP_BUILD_NO_OWN_ZLIB +# include +#else +# include +#endif + +#include +#include +#include + +using namespace Assimp; + +namespace Assimp { + +namespace AssxmlFileWriter { + +// ----------------------------------------------------------------------------------- +static int ioprintf( IOStream * io, const char *format, ... ) { + using namespace std; + if ( nullptr == io ) { + return -1; + } + + static const int Size = 4096; + char sz[ Size ]; + ::memset( sz, '\0', Size ); + va_list va; + va_start( va, format ); + const unsigned int nSize = vsnprintf( sz, Size-1, format, va ); + ai_assert( nSize < Size ); + va_end( va ); + + io->Write( sz, sizeof(char), nSize ); + + return nSize; +} + +// ----------------------------------------------------------------------------------- +// Convert a name to standard XML format +static void ConvertName(aiString& out, const aiString& in) { + out.length = 0; + for (unsigned int i = 0; i < in.length; ++i) { + switch (in.data[i]) { + case '<': + out.Append("<");break; + case '>': + out.Append(">");break; + case '&': + out.Append("&");break; + case '\"': + out.Append(""");break; + case '\'': + out.Append("'");break; + default: + out.data[out.length++] = in.data[i]; + } + } + out.data[out.length] = 0; +} + +// ----------------------------------------------------------------------------------- +// Write a single node as text dump +static void WriteNode(const aiNode* node, IOStream * io, unsigned int depth) { + char prefix[512]; + for (unsigned int i = 0; i < depth;++i) + prefix[i] = '\t'; + prefix[depth] = '\0'; + + const aiMatrix4x4& m = node->mTransformation; + + aiString name; + ConvertName(name,node->mName); + ioprintf(io,"%s \n" + "%s\t \n" + "%s\t\t%0 6f %0 6f %0 6f %0 6f\n" + "%s\t\t%0 6f %0 6f %0 6f %0 6f\n" + "%s\t\t%0 6f %0 6f %0 6f %0 6f\n" + "%s\t\t%0 6f %0 6f %0 6f %0 6f\n" + "%s\t \n", + prefix,name.data,prefix, + prefix,m.a1,m.a2,m.a3,m.a4, + prefix,m.b1,m.b2,m.b3,m.b4, + prefix,m.c1,m.c2,m.c3,m.c4, + prefix,m.d1,m.d2,m.d3,m.d4,prefix); + + if (node->mNumMeshes) { + ioprintf(io, "%s\t\n%s\t", + prefix,node->mNumMeshes,prefix); + + for (unsigned int i = 0; i < node->mNumMeshes;++i) { + ioprintf(io,"%u ",node->mMeshes[i]); + } + ioprintf(io,"\n%s\t\n",prefix); + } + + if (node->mNumChildren) { + ioprintf(io,"%s\t\n", + prefix,node->mNumChildren); + + for (unsigned int i = 0; i < node->mNumChildren;++i) { + WriteNode(node->mChildren[i],io,depth+2); + } + ioprintf(io,"%s\t\n",prefix); + } + ioprintf(io,"%s\n",prefix); +} + + +// ----------------------------------------------------------------------------------- +// Some chuncks of text will need to be encoded for XML +// http://stackoverflow.com/questions/5665231/most-efficient-way-to-escape-xml-html-in-c-string#5665377 +static std::string encodeXML(const std::string& data) { + std::string buffer; + buffer.reserve(data.size()); + for(size_t pos = 0; pos != data.size(); ++pos) { + switch(data[pos]) { + case '&': buffer.append("&"); break; + case '\"': buffer.append("""); break; + case '\'': buffer.append("'"); break; + case '<': buffer.append("<"); break; + case '>': buffer.append(">"); break; + default: buffer.append(&data[pos], 1); break; + } + } + return buffer; +} + +// ----------------------------------------------------------------------------------- +// Write a text model dump +static +void WriteDump(const char* pFile, const char* cmd, const aiScene* scene, IOStream* io, bool shortened) { + time_t tt = ::time( NULL ); +#if _WIN32 + tm* p = gmtime(&tt); +#else + struct tm now; + tm* p = gmtime_r(&tt, &now); +#endif + ai_assert(nullptr != p); + + std::string c = cmd; + std::string::size_type s; + + // https://sourceforge.net/tracker/?func=detail&aid=3167364&group_id=226462&atid=1067632 + // -- not allowed in XML comments + while((s = c.find("--")) != std::string::npos) { + c[s] = '?'; + } + + // write header + std::string header( + "\n" + "\n\n" + "" + " \n\n" + "\n" + ); + + const unsigned int majorVersion( aiGetVersionMajor() ); + const unsigned int minorVersion( aiGetVersionMinor() ); + const unsigned int rev( aiGetVersionRevision() ); + const char *curtime( asctime( p ) ); + ioprintf( io, header.c_str(), majorVersion, minorVersion, rev, pFile, c.c_str(), curtime, scene->mFlags, 0u ); + + // write the node graph + WriteNode(scene->mRootNode, io, 0); + +#if 0 + // write cameras + for (unsigned int i = 0; i < scene->mNumCameras;++i) { + aiCamera* cam = scene->mCameras[i]; + ConvertName(name,cam->mName); + + // camera header + ioprintf(io,"\t\n" + "\t\t %0 8f %0 8f %0 8f \n" + "\t\t %0 8f %0 8f %0 8f \n" + "\t\t %0 8f %0 8f %0 8f \n" + "\t\t %f \n" + "\t\t %f \n" + "\t\t %f \n" + "\t\t %f \n" + "\t\n", + name.data, + cam->mUp.x,cam->mUp.y,cam->mUp.z, + cam->mLookAt.x,cam->mLookAt.y,cam->mLookAt.z, + cam->mPosition.x,cam->mPosition.y,cam->mPosition.z, + cam->mHorizontalFOV,cam->mAspect,cam->mClipPlaneNear,cam->mClipPlaneFar,i); + } + + // write lights + for (unsigned int i = 0; i < scene->mNumLights;++i) { + aiLight* l = scene->mLights[i]; + ConvertName(name,l->mName); + + // light header + ioprintf(io,"\t type=\"%s\"\n" + "\t\t %0 8f %0 8f %0 8f \n" + "\t\t %0 8f %0 8f %0 8f \n" + "\t\t %0 8f %0 8f %0 8f \n", + name.data, + (l->mType == aiLightSource_DIRECTIONAL ? "directional" : + (l->mType == aiLightSource_POINT ? "point" : "spot" )), + l->mColorDiffuse.r, l->mColorDiffuse.g, l->mColorDiffuse.b, + l->mColorSpecular.r,l->mColorSpecular.g,l->mColorSpecular.b, + l->mColorAmbient.r, l->mColorAmbient.g, l->mColorAmbient.b); + + if (l->mType != aiLightSource_DIRECTIONAL) { + ioprintf(io, + "\t\t %0 8f %0 8f %0 8f \n" + "\t\t %f \n" + "\t\t %f \n" + "\t\t %f \n", + l->mPosition.x,l->mPosition.y,l->mPosition.z, + l->mAttenuationConstant,l->mAttenuationLinear,l->mAttenuationQuadratic); + } + + if (l->mType != aiLightSource_POINT) { + ioprintf(io, + "\t\t %0 8f %0 8f %0 8f \n", + l->mDirection.x,l->mDirection.y,l->mDirection.z); + } + + if (l->mType == aiLightSource_SPOT) { + ioprintf(io, + "\t\t %f \n" + "\t\t %f \n", + l->mAngleOuterCone,l->mAngleInnerCone); + } + ioprintf(io,"\t\n"); + } +#endif + aiString name; + + // write textures + if (scene->mNumTextures) { + ioprintf(io,"\n",scene->mNumTextures); + for (unsigned int i = 0; i < scene->mNumTextures;++i) { + aiTexture* tex = scene->mTextures[i]; + bool compressed = (tex->mHeight == 0); + + // mesh header + ioprintf(io,"\t \n", + (compressed ? -1 : tex->mWidth),(compressed ? -1 : tex->mHeight), + (compressed ? "true" : "false")); + + if (compressed) { + ioprintf(io,"\t\t \n",tex->mWidth); + + if (!shortened) { + for (unsigned int n = 0; n < tex->mWidth;++n) { + ioprintf(io,"\t\t\t%2x",reinterpret_cast(tex->pcData)[n]); + if (n && !(n % 50)) { + ioprintf(io,"\n"); + } + } + } + } + else if (!shortened){ + ioprintf(io,"\t\t \n",tex->mWidth*tex->mHeight*4); + + // const unsigned int width = (unsigned int)std::log10((double)std::max(tex->mHeight,tex->mWidth))+1; + for (unsigned int y = 0; y < tex->mHeight;++y) { + for (unsigned int x = 0; x < tex->mWidth;++x) { + aiTexel* tx = tex->pcData + y*tex->mWidth+x; + unsigned int r = tx->r,g=tx->g,b=tx->b,a=tx->a; + ioprintf(io,"\t\t\t%2x %2x %2x %2x",r,g,b,a); + + // group by four for readability + if ( 0 == ( x + y*tex->mWidth ) % 4 ) { + ioprintf( io, "\n" ); + } + } + } + } + ioprintf(io,"\t\t\n\t\n"); + } + ioprintf(io,"\n"); + } + + // write materials + if (scene->mNumMaterials) { + ioprintf(io,"\n",scene->mNumMaterials); + for (unsigned int i = 0; i< scene->mNumMaterials; ++i) { + const aiMaterial* mat = scene->mMaterials[i]; + + ioprintf(io,"\t\n"); + ioprintf(io,"\t\t\n",mat->mNumProperties); + for (unsigned int n = 0; n < mat->mNumProperties;++n) { + + const aiMaterialProperty* prop = mat->mProperties[n]; + const char* sz = ""; + if (prop->mType == aiPTI_Float) { + sz = "float"; + } + else if (prop->mType == aiPTI_Integer) { + sz = "integer"; + } + else if (prop->mType == aiPTI_String) { + sz = "string"; + } + else if (prop->mType == aiPTI_Buffer) { + sz = "binary_buffer"; + } + + ioprintf(io,"\t\t\tmKey.data, sz, + ::TextureTypeToString((aiTextureType)prop->mSemantic),prop->mIndex); + + if (prop->mType == aiPTI_Float) { + ioprintf(io," size=\"%i\">\n\t\t\t\t", + static_cast(prop->mDataLength/sizeof(float))); + + for (unsigned int p = 0; p < prop->mDataLength/sizeof(float);++p) { + ioprintf(io,"%f ",*((float*)(prop->mData+p*sizeof(float)))); + } + } + else if (prop->mType == aiPTI_Integer) { + ioprintf(io," size=\"%i\">\n\t\t\t\t", + static_cast(prop->mDataLength/sizeof(int))); + + for (unsigned int p = 0; p < prop->mDataLength/sizeof(int);++p) { + ioprintf(io,"%i ",*((int*)(prop->mData+p*sizeof(int)))); + } + } + else if (prop->mType == aiPTI_Buffer) { + ioprintf(io," size=\"%i\">\n\t\t\t\t", + static_cast(prop->mDataLength)); + + for (unsigned int p = 0; p < prop->mDataLength;++p) { + ioprintf(io,"%2x ",prop->mData[p]); + if (p && 0 == p%30) { + ioprintf(io,"\n\t\t\t\t"); + } + } + } + else if (prop->mType == aiPTI_String) { + ioprintf(io,">\n\t\t\t\t\"%s\"",encodeXML(prop->mData+4).c_str() /* skip length */); + } + ioprintf(io,"\n\t\t\t\n"); + } + ioprintf(io,"\t\t\n"); + ioprintf(io,"\t\n"); + } + ioprintf(io,"\n"); + } + + // write animations + if (scene->mNumAnimations) { + ioprintf(io,"\n",scene->mNumAnimations); + for (unsigned int i = 0; i < scene->mNumAnimations;++i) { + aiAnimation* anim = scene->mAnimations[i]; + + // anim header + ConvertName(name,anim->mName); + ioprintf(io,"\t\n", + name.data, anim->mDuration, anim->mTicksPerSecond); + + // write bone animation channels + if (anim->mNumChannels) { + ioprintf(io,"\t\t\n",anim->mNumChannels); + for (unsigned int n = 0; n < anim->mNumChannels;++n) { + aiNodeAnim* nd = anim->mChannels[n]; + + // node anim header + ConvertName(name,nd->mNodeName); + ioprintf(io,"\t\t\t\n",name.data); + + if (!shortened) { + // write position keys + if (nd->mNumPositionKeys) { + ioprintf(io,"\t\t\t\t\n",nd->mNumPositionKeys); + for (unsigned int a = 0; a < nd->mNumPositionKeys;++a) { + aiVectorKey* vc = nd->mPositionKeys+a; + ioprintf(io,"\t\t\t\t\t\n" + "\t\t\t\t\t\t%0 8f %0 8f %0 8f\n\t\t\t\t\t\n", + vc->mTime,vc->mValue.x,vc->mValue.y,vc->mValue.z); + } + ioprintf(io,"\t\t\t\t\n"); + } + + // write scaling keys + if (nd->mNumScalingKeys) { + ioprintf(io,"\t\t\t\t\n",nd->mNumScalingKeys); + for (unsigned int a = 0; a < nd->mNumScalingKeys;++a) { + aiVectorKey* vc = nd->mScalingKeys+a; + ioprintf(io,"\t\t\t\t\t\n" + "\t\t\t\t\t\t%0 8f %0 8f %0 8f\n\t\t\t\t\t\n", + vc->mTime,vc->mValue.x,vc->mValue.y,vc->mValue.z); + } + ioprintf(io,"\t\t\t\t\n"); + } + + // write rotation keys + if (nd->mNumRotationKeys) { + ioprintf(io,"\t\t\t\t\n",nd->mNumRotationKeys); + for (unsigned int a = 0; a < nd->mNumRotationKeys;++a) { + aiQuatKey* vc = nd->mRotationKeys+a; + ioprintf(io,"\t\t\t\t\t\n" + "\t\t\t\t\t\t%0 8f %0 8f %0 8f %0 8f\n\t\t\t\t\t\n", + vc->mTime,vc->mValue.x,vc->mValue.y,vc->mValue.z,vc->mValue.w); + } + ioprintf(io,"\t\t\t\t\n"); + } + } + ioprintf(io,"\t\t\t\n"); + } + ioprintf(io,"\t\t\n"); + } + ioprintf(io,"\t\n"); + } + ioprintf(io,"\n"); + } + + // write meshes + if (scene->mNumMeshes) { + ioprintf(io,"\n",scene->mNumMeshes); + for (unsigned int i = 0; i < scene->mNumMeshes;++i) { + aiMesh* mesh = scene->mMeshes[i]; + // const unsigned int width = (unsigned int)std::log10((double)mesh->mNumVertices)+1; + + // mesh header + ioprintf(io,"\t\n", + (mesh->mPrimitiveTypes & aiPrimitiveType_POINT ? "points" : ""), + (mesh->mPrimitiveTypes & aiPrimitiveType_LINE ? "lines" : ""), + (mesh->mPrimitiveTypes & aiPrimitiveType_TRIANGLE ? "triangles" : ""), + (mesh->mPrimitiveTypes & aiPrimitiveType_POLYGON ? "polygons" : ""), + mesh->mMaterialIndex); + + // bones + if (mesh->mNumBones) { + ioprintf(io,"\t\t\n",mesh->mNumBones); + + for (unsigned int n = 0; n < mesh->mNumBones;++n) { + aiBone* bone = mesh->mBones[n]; + + ConvertName(name,bone->mName); + // bone header + ioprintf(io,"\t\t\t\n" + "\t\t\t\t \n" + "\t\t\t\t\t%0 6f %0 6f %0 6f %0 6f\n" + "\t\t\t\t\t%0 6f %0 6f %0 6f %0 6f\n" + "\t\t\t\t\t%0 6f %0 6f %0 6f %0 6f\n" + "\t\t\t\t\t%0 6f %0 6f %0 6f %0 6f\n" + "\t\t\t\t \n", + name.data, + bone->mOffsetMatrix.a1,bone->mOffsetMatrix.a2,bone->mOffsetMatrix.a3,bone->mOffsetMatrix.a4, + bone->mOffsetMatrix.b1,bone->mOffsetMatrix.b2,bone->mOffsetMatrix.b3,bone->mOffsetMatrix.b4, + bone->mOffsetMatrix.c1,bone->mOffsetMatrix.c2,bone->mOffsetMatrix.c3,bone->mOffsetMatrix.c4, + bone->mOffsetMatrix.d1,bone->mOffsetMatrix.d2,bone->mOffsetMatrix.d3,bone->mOffsetMatrix.d4); + + if (!shortened && bone->mNumWeights) { + ioprintf(io,"\t\t\t\t\n",bone->mNumWeights); + + // bone weights + for (unsigned int a = 0; a < bone->mNumWeights;++a) { + aiVertexWeight* wght = bone->mWeights+a; + + ioprintf(io,"\t\t\t\t\t\n\t\t\t\t\t\t%f\n\t\t\t\t\t\n", + wght->mVertexId,wght->mWeight); + } + ioprintf(io,"\t\t\t\t\n"); + } + ioprintf(io,"\t\t\t\n"); + } + ioprintf(io,"\t\t\n"); + } + + // faces + if (!shortened && mesh->mNumFaces) { + ioprintf(io,"\t\t\n",mesh->mNumFaces); + for (unsigned int n = 0; n < mesh->mNumFaces; ++n) { + aiFace& f = mesh->mFaces[n]; + ioprintf(io,"\t\t\t\n" + "\t\t\t\t",f.mNumIndices); + + for (unsigned int j = 0; j < f.mNumIndices;++j) + ioprintf(io,"%u ",f.mIndices[j]); + + ioprintf(io,"\n\t\t\t\n"); + } + ioprintf(io,"\t\t\n"); + } + + // vertex positions + if (mesh->HasPositions()) { + ioprintf(io,"\t\t \n",mesh->mNumVertices); + if (!shortened) { + for (unsigned int n = 0; n < mesh->mNumVertices; ++n) { + ioprintf(io,"\t\t%0 8f %0 8f %0 8f\n", + mesh->mVertices[n].x, + mesh->mVertices[n].y, + mesh->mVertices[n].z); + } + } + ioprintf(io,"\t\t\n"); + } + + // vertex normals + if (mesh->HasNormals()) { + ioprintf(io,"\t\t \n",mesh->mNumVertices); + if (!shortened) { + for (unsigned int n = 0; n < mesh->mNumVertices; ++n) { + ioprintf(io,"\t\t%0 8f %0 8f %0 8f\n", + mesh->mNormals[n].x, + mesh->mNormals[n].y, + mesh->mNormals[n].z); + } + } + ioprintf(io,"\t\t\n"); + } + + // vertex tangents and bitangents + if (mesh->HasTangentsAndBitangents()) { + ioprintf(io,"\t\t \n",mesh->mNumVertices); + if (!shortened) { + for (unsigned int n = 0; n < mesh->mNumVertices; ++n) { + ioprintf(io,"\t\t%0 8f %0 8f %0 8f\n", + mesh->mTangents[n].x, + mesh->mTangents[n].y, + mesh->mTangents[n].z); + } + } + ioprintf(io,"\t\t\n"); + + ioprintf(io,"\t\t \n",mesh->mNumVertices); + if (!shortened) { + for (unsigned int n = 0; n < mesh->mNumVertices; ++n) { + ioprintf(io,"\t\t%0 8f %0 8f %0 8f\n", + mesh->mBitangents[n].x, + mesh->mBitangents[n].y, + mesh->mBitangents[n].z); + } + } + ioprintf(io,"\t\t\n"); + } + + // texture coordinates + for (unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a) { + if (!mesh->mTextureCoords[a]) + break; + + ioprintf(io,"\t\t \n",mesh->mNumVertices, + a,mesh->mNumUVComponents[a]); + + if (!shortened) { + if (mesh->mNumUVComponents[a] == 3) { + for (unsigned int n = 0; n < mesh->mNumVertices; ++n) { + ioprintf(io,"\t\t%0 8f %0 8f %0 8f\n", + mesh->mTextureCoords[a][n].x, + mesh->mTextureCoords[a][n].y, + mesh->mTextureCoords[a][n].z); + } + } + else { + for (unsigned int n = 0; n < mesh->mNumVertices; ++n) { + ioprintf(io,"\t\t%0 8f %0 8f\n", + mesh->mTextureCoords[a][n].x, + mesh->mTextureCoords[a][n].y); + } + } + } + ioprintf(io,"\t\t\n"); + } + + // vertex colors + for (unsigned int a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; ++a) { + if (!mesh->mColors[a]) + break; + ioprintf(io,"\t\t \n",mesh->mNumVertices,a); + if (!shortened) { + for (unsigned int n = 0; n < mesh->mNumVertices; ++n) { + ioprintf(io,"\t\t%0 8f %0 8f %0 8f %0 8f\n", + mesh->mColors[a][n].r, + mesh->mColors[a][n].g, + mesh->mColors[a][n].b, + mesh->mColors[a][n].a); + } + } + ioprintf(io,"\t\t\n"); + } + ioprintf(io,"\t\n"); + } + ioprintf(io,"\n"); + } + ioprintf(io,"\n"); +} + +} // end of namespace AssxmlFileWriter + +void DumpSceneToAssxml( + const char* pFile, const char* cmd, IOSystem* pIOSystem, + const aiScene* pScene, bool shortened) { + std::unique_ptr file(pIOSystem->Open(pFile, "wt")); + if (!file.get()) { + throw std::runtime_error("Unable to open output file " + std::string(pFile) + '\n'); + } + + AssxmlFileWriter::WriteDump(pFile, cmd, pScene, file.get(), shortened); +} + +} // end of namespace Assimp diff --git a/code/Assxml/AssxmlFileWriter.h b/code/Assxml/AssxmlFileWriter.h new file mode 100644 index 000000000..c10a8a5aa --- /dev/null +++ b/code/Assxml/AssxmlFileWriter.h @@ -0,0 +1,65 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2020, assimp team + + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ + +/** @file AssxmlFileWriter.h + * @brief Declaration of Assxml file writer. + */ + +#ifndef AI_ASSXMLFILEWRITER_H_INC +#define AI_ASSXMLFILEWRITER_H_INC + +#include +#include +#include + +namespace Assimp { + +void ASSIMP_API DumpSceneToAssxml( + const char* pFile, + const char* cmd, + IOSystem* pIOSystem, + const aiScene* pScene, + bool shortened); + +} + +#endif // AI_ASSXMLFILEWRITER_H_INC diff --git a/code/B3D/B3DImporter.cpp b/code/B3D/B3DImporter.cpp index c9eb89ebc..07336df65 100644 --- a/code/B3D/B3DImporter.cpp +++ b/code/B3D/B3DImporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/B3D/B3DImporter.h b/code/B3D/B3DImporter.h index d52dac34a..f0568dd16 100644 --- a/code/B3D/B3DImporter.h +++ b/code/B3D/B3DImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/BVH/BVHLoader.cpp b/code/BVH/BVHLoader.cpp index cd9ab0843..1110754c2 100644 --- a/code/BVH/BVHLoader.cpp +++ b/code/BVH/BVHLoader.cpp @@ -4,7 +4,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/BVH/BVHLoader.h b/code/BVH/BVHLoader.h index 33b4e2453..93a3e5e83 100644 --- a/code/BVH/BVHLoader.h +++ b/code/BVH/BVHLoader.h @@ -4,7 +4,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Blender/BlenderBMesh.cpp b/code/Blender/BlenderBMesh.cpp index 8a13819a6..039302e12 100644 --- a/code/Blender/BlenderBMesh.cpp +++ b/code/Blender/BlenderBMesh.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2013, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/Blender/BlenderBMesh.h b/code/Blender/BlenderBMesh.h index 5b65fb503..893128606 100644 --- a/code/Blender/BlenderBMesh.h +++ b/code/Blender/BlenderBMesh.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2013, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/Blender/BlenderDNA.cpp b/code/Blender/BlenderDNA.cpp index f274e02f9..53fb84824 100644 --- a/code/Blender/BlenderDNA.cpp +++ b/code/Blender/BlenderDNA.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Blender/BlenderDNA.h b/code/Blender/BlenderDNA.h index 375d0c4bf..16ce960e2 100644 --- a/code/Blender/BlenderDNA.h +++ b/code/Blender/BlenderDNA.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Blender/BlenderDNA.inl b/code/Blender/BlenderDNA.inl index 65bc1374c..fd9993008 100644 --- a/code/Blender/BlenderDNA.inl +++ b/code/Blender/BlenderDNA.inl @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Blender/BlenderIntermediate.h b/code/Blender/BlenderIntermediate.h index 95fdf0f03..2c480b848 100644 --- a/code/Blender/BlenderIntermediate.h +++ b/code/Blender/BlenderIntermediate.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Blender/BlenderLoader.cpp b/code/Blender/BlenderLoader.cpp index d39cb9699..93e6d1589 100644 --- a/code/Blender/BlenderLoader.cpp +++ b/code/Blender/BlenderLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Blender/BlenderLoader.h b/code/Blender/BlenderLoader.h index d85a82842..8110ac946 100644 --- a/code/Blender/BlenderLoader.h +++ b/code/Blender/BlenderLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Blender/BlenderModifier.cpp b/code/Blender/BlenderModifier.cpp index cc7acc929..6f8a5d7ee 100644 --- a/code/Blender/BlenderModifier.cpp +++ b/code/Blender/BlenderModifier.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Blender/BlenderModifier.h b/code/Blender/BlenderModifier.h index c260ba1f6..ad6fad68d 100644 --- a/code/Blender/BlenderModifier.h +++ b/code/Blender/BlenderModifier.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Blender/BlenderScene.cpp b/code/Blender/BlenderScene.cpp index 39c2793d5..1391a2833 100644 --- a/code/Blender/BlenderScene.cpp +++ b/code/Blender/BlenderScene.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (ASSIMP) ---------------------------------------------------------------------- -Copyright (c) 2006-2016, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/Blender/BlenderScene.h b/code/Blender/BlenderScene.h index dd3f1444c..afa168d49 100644 --- a/code/Blender/BlenderScene.h +++ b/code/Blender/BlenderScene.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Blender/BlenderSceneGen.h b/code/Blender/BlenderSceneGen.h index ce94d0dc2..0c93d17a3 100644 --- a/code/Blender/BlenderSceneGen.h +++ b/code/Blender/BlenderSceneGen.h @@ -2,7 +2,7 @@ Open Asset Import Library (ASSIMP) ---------------------------------------------------------------------- -Copyright (c) 2006-2016, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/Blender/BlenderTessellator.cpp b/code/Blender/BlenderTessellator.cpp index d98c2e865..3c1cd6ea8 100644 --- a/code/Blender/BlenderTessellator.cpp +++ b/code/Blender/BlenderTessellator.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Blender/BlenderTessellator.h b/code/Blender/BlenderTessellator.h index 518e56c72..63ea1f828 100644 --- a/code/Blender/BlenderTessellator.h +++ b/code/Blender/BlenderTessellator.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/C4D/C4DImporter.cpp b/code/C4D/C4DImporter.cpp index 6e5b7d39b..24fd6f622 100644 --- a/code/C4D/C4DImporter.cpp +++ b/code/C4D/C4DImporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/C4D/C4DImporter.h b/code/C4D/C4DImporter.h index f3b1351f6..f9406c3e0 100644 --- a/code/C4D/C4DImporter.h +++ b/code/C4D/C4DImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/CApi/AssimpCExport.cpp b/code/CApi/AssimpCExport.cpp index 7557edcfc..137cc2894 100644 --- a/code/CApi/AssimpCExport.cpp +++ b/code/CApi/AssimpCExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/CApi/CInterfaceIOWrapper.cpp b/code/CApi/CInterfaceIOWrapper.cpp index 5a3a49565..91dd07f37 100644 --- a/code/CApi/CInterfaceIOWrapper.cpp +++ b/code/CApi/CInterfaceIOWrapper.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/CApi/CInterfaceIOWrapper.h b/code/CApi/CInterfaceIOWrapper.h index 216232030..298847494 100644 --- a/code/CApi/CInterfaceIOWrapper.h +++ b/code/CApi/CInterfaceIOWrapper.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 342433e46..5278509e8 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -1,7 +1,7 @@ # Open Asset Import Library (assimp) # ---------------------------------------------------------------------- # -# Copyright (c) 2006-2019, assimp team +# Copyright (c) 2006-2020, assimp team # # All rights reserved. # @@ -66,6 +66,7 @@ SET( PUBLIC_HEADERS ${HEADER_PATH}/color4.h ${HEADER_PATH}/color4.inl ${CMAKE_CURRENT_BINARY_DIR}/../include/assimp/config.h + ${HEADER_PATH}/commonMetaData.h ${HEADER_PATH}/defs.h ${HEADER_PATH}/Defines.h ${HEADER_PATH}/cfileio.h @@ -330,11 +331,15 @@ ADD_ASSIMP_IMPORTER( ASSBIN ADD_ASSIMP_EXPORTER( ASSBIN Assbin/AssbinExporter.h Assbin/AssbinExporter.cpp + Assbin/AssbinFileWriter.h + Assbin/AssbinFileWriter.cpp ) ADD_ASSIMP_EXPORTER( ASSXML Assxml/AssxmlExporter.h Assxml/AssxmlExporter.cpp + Assxml/AssxmlFileWriter.h + Assxml/AssxmlFileWriter.cpp ) ADD_ASSIMP_IMPORTER( B3D @@ -348,6 +353,7 @@ ADD_ASSIMP_IMPORTER( BVH ) ADD_ASSIMP_IMPORTER( COLLADA + Collada/ColladaHelper.cpp Collada/ColladaHelper.h Collada/ColladaLoader.cpp Collada/ColladaLoader.h @@ -1211,10 +1217,6 @@ SET_TARGET_PROPERTIES( assimp PROPERTIES ) if (APPLE) - SET_TARGET_PROPERTIES( assimp PROPERTIES - INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${ASSIMP_LIB_INSTALL_DIR}" - ) - if (BUILD_FRAMEWORK) SET_TARGET_PROPERTIES( assimp PROPERTIES FRAMEWORK TRUE diff --git a/code/COB/COBLoader.cpp b/code/COB/COBLoader.cpp index 19e3cd59e..8e7c81192 100644 --- a/code/COB/COBLoader.cpp +++ b/code/COB/COBLoader.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -250,7 +250,7 @@ aiNode* COBImporter::BuildNodes(const Node& root,const Scene& scin,aiScene* fill const Mesh& ndmesh = (const Mesh&)(root); if (ndmesh.vertex_positions.size() && ndmesh.texture_coords.size()) { - typedef std::pair Entry; + typedef std::pair Entry; for(const Entry& reflist : ndmesh.temp_map) { { // create mesh size_t n = 0; diff --git a/code/COB/COBLoader.h b/code/COB/COBLoader.h index 40fed324b..8b3110a32 100644 --- a/code/COB/COBLoader.h +++ b/code/COB/COBLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/COB/COBScene.h b/code/COB/COBScene.h index 90349be70..87f4f4570 100644 --- a/code/COB/COBScene.h +++ b/code/COB/COBScene.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/CSM/CSMLoader.cpp b/code/CSM/CSMLoader.cpp index 9dbb38467..fbabea12e 100644 --- a/code/CSM/CSMLoader.cpp +++ b/code/CSM/CSMLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team @@ -178,7 +178,7 @@ void CSMImporter::InternReadFile( const std::string& pFile, *ot++ = *buffer++; *ot = '\0'; - nda->mNodeName.length = (size_t)(ot-nda->mNodeName.data); + nda->mNodeName.length = (ai_uint32)(ot-nda->mNodeName.data); } anim->mNumChannels = static_cast(anims_temp.size()); diff --git a/code/CSM/CSMLoader.h b/code/CSM/CSMLoader.h index 31a814b52..907c7aa43 100644 --- a/code/CSM/CSMLoader.h +++ b/code/CSM/CSMLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Collada/ColladaExporter.cpp b/code/Collada/ColladaExporter.cpp index a93dfa59a..99cdc097b 100644 --- a/code/Collada/ColladaExporter.cpp +++ b/code/Collada/ColladaExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -45,6 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "ColladaExporter.h" #include +#include #include #include #include @@ -277,7 +278,7 @@ void ColladaExporter::WriteHeader() { mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; } - if (nullptr == meta || !meta->Get("AuthoringTool", value)) { + if (nullptr == meta || !meta->Get(AI_METADATA_SOURCE_GENERATOR, value)) { mOutput << startstr << "" << "Assimp Exporter" << "" << endstr; } else { mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; @@ -287,7 +288,7 @@ void ColladaExporter::WriteHeader() { if (meta->Get("Comments", value)) { mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; } - if (meta->Get("Copyright", value)) { + if (meta->Get(AI_METADATA_SOURCE_COPYRIGHT, value)) { mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; } if (meta->Get("SourceData", value)) { diff --git a/code/Collada/ColladaExporter.h b/code/Collada/ColladaExporter.h index 0b4fa59a3..f6c66e279 100644 --- a/code/Collada/ColladaExporter.h +++ b/code/Collada/ColladaExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Collada/ColladaHelper.cpp b/code/Collada/ColladaHelper.cpp new file mode 100644 index 000000000..6f1fed366 --- /dev/null +++ b/code/Collada/ColladaHelper.cpp @@ -0,0 +1,107 @@ +/** Helper structures for the Collada loader */ + +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2020, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the +following conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- +*/ + +#include "ColladaHelper.h" + +#include +#include + +namespace Assimp { +namespace Collada { + +const MetaKeyPairVector MakeColladaAssimpMetaKeys() { + MetaKeyPairVector result; + result.emplace_back("authoring_tool", AI_METADATA_SOURCE_GENERATOR); + result.emplace_back("copyright", AI_METADATA_SOURCE_COPYRIGHT); + return result; +}; + +const MetaKeyPairVector &GetColladaAssimpMetaKeys() { + static const MetaKeyPairVector result = MakeColladaAssimpMetaKeys(); + return result; +} + +const MetaKeyPairVector MakeColladaAssimpMetaKeysCamelCase() { + MetaKeyPairVector result = MakeColladaAssimpMetaKeys(); + for (auto &val : result) + { + ToCamelCase(val.first); + } + return result; +}; + +const MetaKeyPairVector &GetColladaAssimpMetaKeysCamelCase() +{ + static const MetaKeyPairVector result = MakeColladaAssimpMetaKeysCamelCase(); + return result; +} + +// ------------------------------------------------------------------------------------------------ +// Convert underscore_separated to CamelCase: "authoring_tool" becomes "AuthoringTool" +void ToCamelCase(std::string &text) +{ + if (text.empty()) + return; + // Capitalise first character + auto it = text.begin(); + (*it) = ToUpper(*it); + ++it; + for (/*started above*/ ; it != text.end(); /*iterated below*/) + { + if ((*it) == '_') + { + it = text.erase(it); + if (it != text.end()) + (*it) = ToUpper(*it); + } + else + { + // Make lower case + (*it) = ToLower(*it); + ++it; + } + } +} + +} // namespace Collada +} // namespace Assimp diff --git a/code/Collada/ColladaHelper.h b/code/Collada/ColladaHelper.h index b7d47da15..c6e2e7ddd 100644 --- a/code/Collada/ColladaHelper.h +++ b/code/Collada/ColladaHelper.h @@ -4,7 +4,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -47,6 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include #include #include #include @@ -104,6 +105,17 @@ enum MorphMethod Relative }; +/** Common metadata keys as */ +typedef std::pair MetaKeyPair; +typedef std::vector MetaKeyPairVector; + +// Collada as lower_case (native) +const MetaKeyPairVector &GetColladaAssimpMetaKeys(); +// Collada as CamelCase (used by Assimp for consistency) +const MetaKeyPairVector &GetColladaAssimpMetaKeysCamelCase(); + +/** Convert underscore_separated to CamelCase "authoring_tool" becomes "AuthoringTool" */ +void ToCamelCase(std::string &text); /** Contains all data for one of the different transformation types */ struct Transform @@ -647,23 +659,37 @@ struct Animation void CombineSingleChannelAnimationsRecursively(Animation *pParent) { + std::set childrenTargets; + bool childrenAnimationsHaveDifferentChannels = true; + for (std::vector::iterator it = pParent->mSubAnims.begin(); it != pParent->mSubAnims.end();) { Animation *anim = *it; - CombineSingleChannelAnimationsRecursively(anim); - if (anim->mChannels.size() == 1) + if (childrenAnimationsHaveDifferentChannels && anim->mChannels.size() == 1 && + childrenTargets.find(anim->mChannels[0].mTarget) == childrenTargets.end()) { + childrenTargets.insert(anim->mChannels[0].mTarget); + } else { + childrenAnimationsHaveDifferentChannels = false; + } + + ++it; + } + + // We only want to combine animations if they have different channels + if (childrenAnimationsHaveDifferentChannels) + { + for (std::vector::iterator it = pParent->mSubAnims.begin(); it != pParent->mSubAnims.end();) { + Animation *anim = *it; + pParent->mChannels.push_back(anim->mChannels[0]); it = pParent->mSubAnims.erase(it); delete anim; - } - else - { - ++it; + continue; } } } diff --git a/code/Collada/ColladaLoader.cpp b/code/Collada/ColladaLoader.cpp index 37529bc98..b78fc0e3b 100644 --- a/code/Collada/ColladaLoader.cpp +++ b/code/Collada/ColladaLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -963,18 +963,38 @@ void ColladaLoader::StoreAnimations( aiScene* pScene, const ColladaParser& pPars // catch special case: many animations with the same length, each affecting only a single node. // we need to unite all those single-node-anims to a proper combined animation - for( size_t a = 0; a < mAnims.size(); ++a) { + for(size_t a = 0; a < mAnims.size(); ++a) { aiAnimation* templateAnim = mAnims[a]; - if( templateAnim->mNumChannels == 1) { + + if (templateAnim->mNumChannels == 1) { // search for other single-channel-anims with the same duration std::vector collectedAnimIndices; for( size_t b = a+1; b < mAnims.size(); ++b) { aiAnimation* other = mAnims[b]; if (other->mNumChannels == 1 && other->mDuration == templateAnim->mDuration && other->mTicksPerSecond == templateAnim->mTicksPerSecond) - collectedAnimIndices.push_back(b); + collectedAnimIndices.push_back(b); } + // We only want to combine the animations if they have different channels + std::set animTargets; + animTargets.insert(templateAnim->mChannels[0]->mNodeName.C_Str()); + bool collectedAnimationsHaveDifferentChannels = true; + for (size_t b = 0; b < collectedAnimIndices.size(); ++b) + { + aiAnimation* srcAnimation = mAnims[collectedAnimIndices[b]]; + std::string channelName = std::string(srcAnimation->mChannels[0]->mNodeName.C_Str()); + if (animTargets.find(channelName) == animTargets.end()) { + animTargets.insert(channelName); + } else { + collectedAnimationsHaveDifferentChannels = false; + break; + } + } + + if (!collectedAnimationsHaveDifferentChannels) + continue; + // if there are other animations which fit the template anim, combine all channels into a single anim if (!collectedAnimIndices.empty()) { diff --git a/code/Collada/ColladaLoader.h b/code/Collada/ColladaLoader.h index d8d3f4f52..198b7a215 100644 --- a/code/Collada/ColladaLoader.h +++ b/code/Collada/ColladaLoader.h @@ -4,7 +4,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Collada/ColladaParser.cpp b/code/Collada/ColladaParser.cpp index e2e6626c3..d0f71d95a 100644 --- a/code/Collada/ColladaParser.cpp +++ b/code/Collada/ColladaParser.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team @@ -50,6 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include "ColladaParser.h" +#include #include #include #include @@ -249,6 +250,9 @@ void ColladaParser::UriDecodePath(aiString& ss) bool ColladaParser::ReadBoolFromTextContent() { const char* cur = GetTextContent(); + if ( nullptr == cur) { + return false; + } return (!ASSIMP_strincmp(cur, "true", 4) || '0' != *cur); } @@ -257,6 +261,9 @@ bool ColladaParser::ReadBoolFromTextContent() ai_real ColladaParser::ReadFloatFromTextContent() { const char* cur = GetTextContent(); + if ( nullptr == cur ) { + return 0.0; + } return fast_atof(cur); } @@ -276,6 +283,11 @@ void ColladaParser::ReadContents() if (attrib != -1) { const char* version = mReader->getAttributeValue(attrib); + // Store declared format version string + aiString v; + v.Set(version); + mAssetMetaData.emplace(AI_METADATA_SOURCE_FORMAT_VERSION, v ); + if (!::strncmp(version, "1.5", 3)) { mFormat = FV_1_5_n; ASSIMP_LOG_DEBUG("Collada schema version is 1.5.n"); @@ -434,23 +446,39 @@ void ColladaParser::ReadContributorInfo() } } +static bool FindCommonKey(const std::string &collada_key, const MetaKeyPairVector &key_renaming, size_t &found_index) { + for (size_t i = 0; i < key_renaming.size(); ++i) { + if (key_renaming[i].first == collada_key) { + found_index = i; + return true; + } + } + found_index = std::numeric_limits::max(); + return false; +} + // ------------------------------------------------------------------------------------------------ // Reads a single string metadata item -void ColladaParser::ReadMetaDataItem(StringMetaData &metadata) -{ - // Metadata such as created, keywords, subject etc - const char* key_char = mReader->getNodeName(); - if (key_char != nullptr) - { +void ColladaParser::ReadMetaDataItem(StringMetaData &metadata) { + const Collada::MetaKeyPairVector &key_renaming = GetColladaAssimpMetaKeysCamelCase(); + // Metadata such as created, keywords, subject etc + const char *key_char = mReader->getNodeName(); + if (key_char != nullptr) { const std::string key_str(key_char); - const char* value_char = TestTextContent(); - if (value_char != nullptr) - { - std::string camel_key_str = key_str; - ToCamelCase(camel_key_str); + const char *value_char = TestTextContent(); + if (value_char != nullptr) { aiString aistr; - aistr.Set(value_char); - metadata.emplace(camel_key_str, aistr); + aistr.Set(value_char); + + std::string camel_key_str(key_str); + ToCamelCase(camel_key_str); + + size_t found_index; + if (FindCommonKey(camel_key_str, key_renaming, found_index)) { + metadata.emplace(key_renaming[found_index].second, aistr); + } else { + metadata.emplace(camel_key_str, aistr); + } } TestClosing(key_str.c_str()); } @@ -458,27 +486,6 @@ void ColladaParser::ReadMetaDataItem(StringMetaData &metadata) SkipElement(); } -// ------------------------------------------------------------------------------------------------ -// Convert underscore_seperated to CamelCase: "authoring_tool" becomes "AuthoringTool" -void ColladaParser::ToCamelCase(std::string &text) -{ - if (text.empty()) - return; - // Capitalise first character - text[0] = ToUpper(text[0]); - for (auto it = text.begin(); it != text.end(); /*iterated below*/) - { - if ((*it) == '_') - { - it = text.erase(it); - if (it != text.end()) - (*it) = ToUpper(*it); - } - else - ++it; - } -} - // ------------------------------------------------------------------------------------------------ // Reads the animation clips void ColladaParser::ReadAnimationClipLibrary() diff --git a/code/Collada/ColladaParser.h b/code/Collada/ColladaParser.h index 4e8c8fccf..d1e812bd2 100644 --- a/code/Collada/ColladaParser.h +++ b/code/Collada/ColladaParser.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- - Copyright (c) 2006-2019, assimp team + Copyright (c) 2006-2020, assimp team All rights reserved. @@ -94,12 +94,9 @@ namespace Assimp /** Reads contributor information such as author and legal blah */ void ReadContributorInfo(); - /** Reads generic metadata into provided map */ + /** Reads generic metadata into provided map and renames keys for Assimp */ void ReadMetaDataItem(StringMetaData &metadata); - /** Convert underscore_seperated to CamelCase "authoring_tool" becomes "AuthoringTool" */ - static void ToCamelCase(std::string &text); - /** Reads the animation library */ void ReadAnimationLibrary(); diff --git a/code/Common/Assimp.cpp b/code/Common/Assimp.cpp index 178b2c01d..66588f0bc 100644 --- a/code/Common/Assimp.cpp +++ b/code/Common/Assimp.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Common/BaseImporter.cpp b/code/Common/BaseImporter.cpp index 5c1e60554..660a6a965 100644 --- a/code/Common/BaseImporter.cpp +++ b/code/Common/BaseImporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Common/BaseProcess.cpp b/code/Common/BaseProcess.cpp index e247be418..974af68db 100644 --- a/code/Common/BaseProcess.cpp +++ b/code/Common/BaseProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Common/BaseProcess.h b/code/Common/BaseProcess.h index 4d5c7a76b..a7e48bba3 100644 --- a/code/Common/BaseProcess.h +++ b/code/Common/BaseProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Common/Bitmap.cpp b/code/Common/Bitmap.cpp index b22b71ea9..7d8225704 100644 --- a/code/Common/Bitmap.cpp +++ b/code/Common/Bitmap.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Common/CreateAnimMesh.cpp b/code/Common/CreateAnimMesh.cpp index 98b60e531..7317dc45b 100644 --- a/code/Common/CreateAnimMesh.cpp +++ b/code/Common/CreateAnimMesh.cpp @@ -4,7 +4,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- Copyright (C) 2016 The Qt Company Ltd. -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Common/DefaultIOStream.cpp b/code/Common/DefaultIOStream.cpp index 829b44731..205f19e37 100644 --- a/code/Common/DefaultIOStream.cpp +++ b/code/Common/DefaultIOStream.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Common/DefaultIOSystem.cpp b/code/Common/DefaultIOSystem.cpp index 6fdc24dd8..0343cb289 100644 --- a/code/Common/DefaultIOSystem.cpp +++ b/code/Common/DefaultIOSystem.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Common/DefaultLogger.cpp b/code/Common/DefaultLogger.cpp index eee53bd7c..adb9ba160 100644 --- a/code/Common/DefaultLogger.cpp +++ b/code/Common/DefaultLogger.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Common/DefaultProgressHandler.h b/code/Common/DefaultProgressHandler.h index bd2cce00b..ebf7f118c 100644 --- a/code/Common/DefaultProgressHandler.h +++ b/code/Common/DefaultProgressHandler.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Common/Exporter.cpp b/code/Common/Exporter.cpp index 784c803b0..9f9a33b58 100644 --- a/code/Common/Exporter.cpp +++ b/code/Common/Exporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Common/FileLogStream.h b/code/Common/FileLogStream.h index 740c50319..ecff03a7e 100644 --- a/code/Common/FileLogStream.h +++ b/code/Common/FileLogStream.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Common/FileSystemFilter.h b/code/Common/FileSystemFilter.h index 9923cdbdd..1440cf97d 100644 --- a/code/Common/FileSystemFilter.h +++ b/code/Common/FileSystemFilter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2008, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/Common/Importer.cpp b/code/Common/Importer.cpp index 9564f6ab7..5601298f1 100644 --- a/code/Common/Importer.cpp +++ b/code/Common/Importer.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Common/Importer.h b/code/Common/Importer.h index a439d99c2..c31f67caa 100644 --- a/code/Common/Importer.h +++ b/code/Common/Importer.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Common/ImporterRegistry.cpp b/code/Common/ImporterRegistry.cpp index b9f28f035..41aa21979 100644 --- a/code/Common/ImporterRegistry.cpp +++ b/code/Common/ImporterRegistry.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Common/PolyTools.h b/code/Common/PolyTools.h index fbbda0e7d..1b8972877 100644 --- a/code/Common/PolyTools.h +++ b/code/Common/PolyTools.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Common/PostStepRegistry.cpp b/code/Common/PostStepRegistry.cpp index 8ff4af040..21bd2af95 100644 --- a/code/Common/PostStepRegistry.cpp +++ b/code/Common/PostStepRegistry.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Common/RemoveComments.cpp b/code/Common/RemoveComments.cpp index 91700a769..f7e735c16 100644 --- a/code/Common/RemoveComments.cpp +++ b/code/Common/RemoveComments.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Common/SGSpatialSort.cpp b/code/Common/SGSpatialSort.cpp index 120070b0a..35ffaae58 100644 --- a/code/Common/SGSpatialSort.cpp +++ b/code/Common/SGSpatialSort.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Common/SceneCombiner.cpp b/code/Common/SceneCombiner.cpp index f7b13cc95..29b6082a8 100644 --- a/code/Common/SceneCombiner.cpp +++ b/code/Common/SceneCombiner.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -1312,7 +1312,6 @@ void SceneCombiner::Copy(aiMetadata** _dest, const aiMetadata* src) { aiMetadata* dest = *_dest = aiMetadata::Alloc( src->mNumProperties ); std::copy(src->mKeys, src->mKeys + src->mNumProperties, dest->mKeys); - dest->mValues = new aiMetadataEntry[src->mNumProperties]; for (unsigned int i = 0; i < src->mNumProperties; ++i) { aiMetadataEntry& in = src->mValues[i]; aiMetadataEntry& out = dest->mValues[i]; diff --git a/code/Common/ScenePreprocessor.cpp b/code/Common/ScenePreprocessor.cpp index 432a3d766..606590519 100644 --- a/code/Common/ScenePreprocessor.cpp +++ b/code/Common/ScenePreprocessor.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -217,6 +217,7 @@ void ScenePreprocessor::ProcessAnimation (aiAnimation* anim) // No rotation keys? Generate a dummy track if (!channel->mNumRotationKeys) { + ai_assert(!channel->mRotationKeys); channel->mNumRotationKeys = 1; channel->mRotationKeys = new aiQuatKey[1]; aiQuatKey& q = channel->mRotationKeys[0]; @@ -225,10 +226,13 @@ void ScenePreprocessor::ProcessAnimation (aiAnimation* anim) q.mValue = rotation; ASSIMP_LOG_DEBUG("ScenePreprocessor: Dummy rotation track has been generated"); + } else { + ai_assert(channel->mRotationKeys); } // No scaling keys? Generate a dummy track if (!channel->mNumScalingKeys) { + ai_assert(!channel->mScalingKeys); channel->mNumScalingKeys = 1; channel->mScalingKeys = new aiVectorKey[1]; aiVectorKey& q = channel->mScalingKeys[0]; @@ -237,10 +241,13 @@ void ScenePreprocessor::ProcessAnimation (aiAnimation* anim) q.mValue = scaling; ASSIMP_LOG_DEBUG("ScenePreprocessor: Dummy scaling track has been generated"); + } else { + ai_assert(channel->mScalingKeys); } // No position keys? Generate a dummy track if (!channel->mNumPositionKeys) { + ai_assert(!channel->mPositionKeys); channel->mNumPositionKeys = 1; channel->mPositionKeys = new aiVectorKey[1]; aiVectorKey& q = channel->mPositionKeys[0]; @@ -249,6 +256,8 @@ void ScenePreprocessor::ProcessAnimation (aiAnimation* anim) q.mValue = position; ASSIMP_LOG_DEBUG("ScenePreprocessor: Dummy position track has been generated"); + } else { + ai_assert(channel->mPositionKeys); } } } diff --git a/code/Common/ScenePreprocessor.h b/code/Common/ScenePreprocessor.h index 3f4c8d7c3..e059d1c95 100644 --- a/code/Common/ScenePreprocessor.h +++ b/code/Common/ScenePreprocessor.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Common/ScenePrivate.h b/code/Common/ScenePrivate.h index f336aafc9..f66f48856 100644 --- a/code/Common/ScenePrivate.h +++ b/code/Common/ScenePrivate.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Common/SkeletonMeshBuilder.cpp b/code/Common/SkeletonMeshBuilder.cpp index 06cfe034e..724359f99 100644 --- a/code/Common/SkeletonMeshBuilder.cpp +++ b/code/Common/SkeletonMeshBuilder.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Common/SpatialSort.cpp b/code/Common/SpatialSort.cpp index a4f3a4e4b..604b086b7 100644 --- a/code/Common/SpatialSort.cpp +++ b/code/Common/SpatialSort.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Common/SplitByBoneCountProcess.cpp b/code/Common/SplitByBoneCountProcess.cpp index 2ef66a9af..b472cb359 100644 --- a/code/Common/SplitByBoneCountProcess.cpp +++ b/code/Common/SplitByBoneCountProcess.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Common/SplitByBoneCountProcess.h b/code/Common/SplitByBoneCountProcess.h index 6c904a9df..7185d0330 100644 --- a/code/Common/SplitByBoneCountProcess.h +++ b/code/Common/SplitByBoneCountProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Common/StandardShapes.cpp b/code/Common/StandardShapes.cpp index 2e5100130..d474c6129 100644 --- a/code/Common/StandardShapes.cpp +++ b/code/Common/StandardShapes.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Common/StdOStreamLogStream.h b/code/Common/StdOStreamLogStream.h index 893e261a2..4f5999775 100644 --- a/code/Common/StdOStreamLogStream.h +++ b/code/Common/StdOStreamLogStream.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Common/Subdivision.cpp b/code/Common/Subdivision.cpp index 60c54939f..08408f867 100644 --- a/code/Common/Subdivision.cpp +++ b/code/Common/Subdivision.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Common/TargetAnimation.cpp b/code/Common/TargetAnimation.cpp index b8062499f..3c61d2176 100644 --- a/code/Common/TargetAnimation.cpp +++ b/code/Common/TargetAnimation.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Common/TargetAnimation.h b/code/Common/TargetAnimation.h index 91634ab5a..5b9c1881d 100644 --- a/code/Common/TargetAnimation.h +++ b/code/Common/TargetAnimation.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Common/Version.cpp b/code/Common/Version.cpp index ea4c996f0..f04d12233 100644 --- a/code/Common/Version.cpp +++ b/code/Common/Version.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -55,7 +55,7 @@ static const char* LEGAL_INFORMATION = "Open Asset Import Library (Assimp).\n" "A free C/C++ library to import various 3D file formats into applications\n\n" -"(c) 2006-2019, assimp team\n" +"(c) 2006-2020, assimp team\n" "License under the terms and conditions of the 3-clause BSD license\n" "http://assimp.org\n" ; diff --git a/code/Common/VertexTriangleAdjacency.cpp b/code/Common/VertexTriangleAdjacency.cpp index 7cfd1a350..e588dc2a4 100644 --- a/code/Common/VertexTriangleAdjacency.cpp +++ b/code/Common/VertexTriangleAdjacency.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team @@ -58,7 +58,7 @@ VertexTriangleAdjacency::VertexTriangleAdjacency(aiFace *pcFaces, { // compute the number of referenced vertices if it wasn't specified by the caller const aiFace* const pcFaceEnd = pcFaces + iNumFaces; - if (!iNumVertices) { + if (0 == iNumVertices) { for (aiFace* pcFace = pcFaces; pcFace != pcFaceEnd; ++pcFace) { ai_assert( nullptr != pcFace ); ai_assert(3 == pcFace->mNumIndices); @@ -68,7 +68,7 @@ VertexTriangleAdjacency::VertexTriangleAdjacency(aiFace *pcFaces, } } - mNumVertices = iNumVertices; + mNumVertices = iNumVertices + 1; unsigned int* pi; diff --git a/code/Common/VertexTriangleAdjacency.h b/code/Common/VertexTriangleAdjacency.h index f3be47612..2226fc1c4 100644 --- a/code/Common/VertexTriangleAdjacency.h +++ b/code/Common/VertexTriangleAdjacency.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Common/Win32DebugLogStream.h b/code/Common/Win32DebugLogStream.h index a6063a261..3a9d89c73 100644 --- a/code/Common/Win32DebugLogStream.h +++ b/code/Common/Win32DebugLogStream.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Common/ZipArchiveIOSystem.cpp b/code/Common/ZipArchiveIOSystem.cpp index 7c37a05f9..e83d3e50d 100644 --- a/code/Common/ZipArchiveIOSystem.cpp +++ b/code/Common/ZipArchiveIOSystem.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Common/assbin_chunks.h b/code/Common/assbin_chunks.h index 15e4af5e7..822df5198 100644 --- a/code/Common/assbin_chunks.h +++ b/code/Common/assbin_chunks.h @@ -37,7 +37,7 @@ The ASSBIN file format is composed of chunks to represent the hierarchical aiSce This makes the format extensible and allows backward-compatibility with future data structure versions. The <root>/code/assbin_chunks.h header contains some magic constants for use by stand-alone ASSBIN loaders. Also, Assimp's own file writer can be found -in <root>/tools/assimp_cmd/WriteDumb.cpp (yes, the 'b' is no typo ...). +in <root>/tools/assimp_cmd/WriteDump.cpp (yes, the 'b' is no typo ...). @verbatim diff --git a/code/Common/scene.cpp b/code/Common/scene.cpp index d15619acf..f56562b1c 100644 --- a/code/Common/scene.cpp +++ b/code/Common/scene.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Common/simd.cpp b/code/Common/simd.cpp index 04615f408..305445970 100644 --- a/code/Common/simd.cpp +++ b/code/Common/simd.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Common/simd.h b/code/Common/simd.h index 3eecdd458..17856fe72 100644 --- a/code/Common/simd.h +++ b/code/Common/simd.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/DXF/DXFHelper.h b/code/DXF/DXFHelper.h index 0ec8e130b..8140d00c6 100644 --- a/code/DXF/DXFHelper.h +++ b/code/DXF/DXFHelper.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/DXF/DXFLoader.cpp b/code/DXF/DXFLoader.cpp index baf315485..ea877a484 100644 --- a/code/DXF/DXFLoader.cpp +++ b/code/DXF/DXFLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/DXF/DXFLoader.h b/code/DXF/DXFLoader.h index 044cf6bcb..5c4f1787e 100644 --- a/code/DXF/DXFLoader.h +++ b/code/DXF/DXFLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXAnimation.cpp b/code/FBX/FBXAnimation.cpp index 874914431..9a54f61a0 100644 --- a/code/FBX/FBXAnimation.cpp +++ b/code/FBX/FBXAnimation.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXBinaryTokenizer.cpp b/code/FBX/FBXBinaryTokenizer.cpp index a4a2bc8e7..7faa0518b 100644 --- a/code/FBX/FBXBinaryTokenizer.cpp +++ b/code/FBX/FBXBinaryTokenizer.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXCommon.h b/code/FBX/FBXCommon.h index b28601c74..7f70eb784 100644 --- a/code/FBX/FBXCommon.h +++ b/code/FBX/FBXCommon.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXCompileConfig.h b/code/FBX/FBXCompileConfig.h index 03536a182..5cdaa6960 100644 --- a/code/FBX/FBXCompileConfig.h +++ b/code/FBX/FBXCompileConfig.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXConverter.cpp b/code/FBX/FBXConverter.cpp index 5b34868ba..22616a480 100644 --- a/code/FBX/FBXConverter.cpp +++ b/code/FBX/FBXConverter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -1564,7 +1564,7 @@ namespace Assimp { bone_map.clear(); } - catch (std::exception&e) { + catch (std::exception&) { std::for_each(bones.begin(), bones.end(), Util::delete_fun()); throw; } diff --git a/code/FBX/FBXConverter.h b/code/FBX/FBXConverter.h index d47416223..c5ad47059 100644 --- a/code/FBX/FBXConverter.h +++ b/code/FBX/FBXConverter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXDeformer.cpp b/code/FBX/FBXDeformer.cpp index 692755345..4b76cd0fa 100644 --- a/code/FBX/FBXDeformer.cpp +++ b/code/FBX/FBXDeformer.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXDocument.cpp b/code/FBX/FBXDocument.cpp index 506fd978d..ddb971b3f 100644 --- a/code/FBX/FBXDocument.cpp +++ b/code/FBX/FBXDocument.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXDocument.h b/code/FBX/FBXDocument.h index a60d7d9ef..8984b3df7 100644 --- a/code/FBX/FBXDocument.h +++ b/code/FBX/FBXDocument.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXDocumentUtil.cpp b/code/FBX/FBXDocumentUtil.cpp index f84691479..7178e9f26 100644 --- a/code/FBX/FBXDocumentUtil.cpp +++ b/code/FBX/FBXDocumentUtil.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXDocumentUtil.h b/code/FBX/FBXDocumentUtil.h index 2450109e5..2d76ee031 100644 --- a/code/FBX/FBXDocumentUtil.h +++ b/code/FBX/FBXDocumentUtil.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/FBX/FBXExportNode.cpp b/code/FBX/FBXExportNode.cpp index 9b29995cc..53aa719f4 100644 --- a/code/FBX/FBXExportNode.cpp +++ b/code/FBX/FBXExportNode.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXExportNode.h b/code/FBX/FBXExportNode.h index ef3bc781a..2e8f491a1 100644 --- a/code/FBX/FBXExportNode.h +++ b/code/FBX/FBXExportNode.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXExportProperty.cpp b/code/FBX/FBXExportProperty.cpp index f2a63b72b..11ee35003 100644 --- a/code/FBX/FBXExportProperty.cpp +++ b/code/FBX/FBXExportProperty.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXExportProperty.h b/code/FBX/FBXExportProperty.h index d692fe6ee..6baae8b69 100644 --- a/code/FBX/FBXExportProperty.h +++ b/code/FBX/FBXExportProperty.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXExporter.cpp b/code/FBX/FBXExporter.cpp index 413d1d6c8..594951e78 100644 --- a/code/FBX/FBXExporter.cpp +++ b/code/FBX/FBXExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXExporter.h b/code/FBX/FBXExporter.h index 1ae727eda..eb8bfaf3b 100644 --- a/code/FBX/FBXExporter.h +++ b/code/FBX/FBXExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXImportSettings.h b/code/FBX/FBXImportSettings.h index 1a4c80f8b..974931b4c 100644 --- a/code/FBX/FBXImportSettings.h +++ b/code/FBX/FBXImportSettings.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXImporter.cpp b/code/FBX/FBXImporter.cpp index afcc1ddc7..571f60883 100644 --- a/code/FBX/FBXImporter.cpp +++ b/code/FBX/FBXImporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXImporter.h b/code/FBX/FBXImporter.h index c365b2cdd..63375e40d 100644 --- a/code/FBX/FBXImporter.h +++ b/code/FBX/FBXImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXMaterial.cpp b/code/FBX/FBXMaterial.cpp index f43a8b84b..88ac9db16 100644 --- a/code/FBX/FBXMaterial.cpp +++ b/code/FBX/FBXMaterial.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXMeshGeometry.cpp b/code/FBX/FBXMeshGeometry.cpp index 1386e2383..2f2782182 100644 --- a/code/FBX/FBXMeshGeometry.cpp +++ b/code/FBX/FBXMeshGeometry.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -448,6 +448,12 @@ void ResolveVertexDataArray(std::vector& data_out, const Scope& source, std::vector tempData; ParseVectorDataArray(tempData, GetRequiredElement(source, dataElementName)); + if (tempData.size() != vertex_count) { + FBXImporter::LogError(Formatter::format("length of input data unexpected for ByVertice mapping: ") + << tempData.size() << ", expected " << vertex_count); + return; + } + data_out.resize(vertex_count); for (size_t i = 0, e = tempData.size(); i < e; ++i) { @@ -461,10 +467,17 @@ void ResolveVertexDataArray(std::vector& data_out, const Scope& source, std::vector tempData; ParseVectorDataArray(tempData, GetRequiredElement(source, dataElementName)); - data_out.resize(vertex_count); - std::vector uvIndices; ParseVectorDataArray(uvIndices,GetRequiredElement(source,indexDataElementName)); + + if (uvIndices.size() != vertex_count) { + FBXImporter::LogError(Formatter::format("length of input data unexpected for ByVertice mapping: ") + << uvIndices.size() << ", expected " << vertex_count); + return; + } + + data_out.resize(vertex_count); + for (size_t i = 0, e = uvIndices.size(); i < e; ++i) { const unsigned int istart = mapping_offsets[i], iend = istart + mapping_counts[i]; @@ -493,16 +506,17 @@ void ResolveVertexDataArray(std::vector& data_out, const Scope& source, std::vector tempData; ParseVectorDataArray(tempData, GetRequiredElement(source, dataElementName)); - data_out.resize(vertex_count); - std::vector uvIndices; ParseVectorDataArray(uvIndices,GetRequiredElement(source,indexDataElementName)); if (uvIndices.size() != vertex_count) { - FBXImporter::LogError("length of input data unexpected for ByPolygonVertex mapping"); + FBXImporter::LogError(Formatter::format("length of input data unexpected for ByPolygonVertex mapping: ") + << uvIndices.size() << ", expected " << vertex_count); return; } + data_out.resize(vertex_count); + const T empty; unsigned int next = 0; for(int i : uvIndices) { diff --git a/code/FBX/FBXMeshGeometry.h b/code/FBX/FBXMeshGeometry.h index d6d451217..97265e4b2 100644 --- a/code/FBX/FBXMeshGeometry.h +++ b/code/FBX/FBXMeshGeometry.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXModel.cpp b/code/FBX/FBXModel.cpp index 589af36ac..e34f3a610 100644 --- a/code/FBX/FBXModel.cpp +++ b/code/FBX/FBXModel.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXNodeAttribute.cpp b/code/FBX/FBXNodeAttribute.cpp index b72e5637e..2ebf917e3 100644 --- a/code/FBX/FBXNodeAttribute.cpp +++ b/code/FBX/FBXNodeAttribute.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXParser.cpp b/code/FBX/FBXParser.cpp index 4a9346040..215ff7484 100644 --- a/code/FBX/FBXParser.cpp +++ b/code/FBX/FBXParser.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXParser.h b/code/FBX/FBXParser.h index 7b0cf7203..5d8d00307 100644 --- a/code/FBX/FBXParser.h +++ b/code/FBX/FBXParser.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXProperties.cpp b/code/FBX/FBXProperties.cpp index 8d7036b6a..f6b804894 100644 --- a/code/FBX/FBXProperties.cpp +++ b/code/FBX/FBXProperties.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXProperties.h b/code/FBX/FBXProperties.h index 58755542f..209d5e940 100644 --- a/code/FBX/FBXProperties.h +++ b/code/FBX/FBXProperties.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXTokenizer.cpp b/code/FBX/FBXTokenizer.cpp index 252cce355..831c40061 100644 --- a/code/FBX/FBXTokenizer.cpp +++ b/code/FBX/FBXTokenizer.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXTokenizer.h b/code/FBX/FBXTokenizer.h index afa588a47..cadc82770 100644 --- a/code/FBX/FBXTokenizer.h +++ b/code/FBX/FBXTokenizer.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXUtil.cpp b/code/FBX/FBXUtil.cpp index c10e057c8..50dd78a4c 100644 --- a/code/FBX/FBXUtil.cpp +++ b/code/FBX/FBXUtil.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/FBX/FBXUtil.h b/code/FBX/FBXUtil.h index b63441885..77bb0ad30 100644 --- a/code/FBX/FBXUtil.h +++ b/code/FBX/FBXUtil.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/HMP/HMPFileData.h b/code/HMP/HMPFileData.h index ab4100174..bad8dde5c 100644 --- a/code/HMP/HMPFileData.h +++ b/code/HMP/HMPFileData.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/HMP/HMPLoader.cpp b/code/HMP/HMPLoader.cpp index d5469181e..0d1334fdd 100644 --- a/code/HMP/HMPLoader.cpp +++ b/code/HMP/HMPLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/HMP/HMPLoader.h b/code/HMP/HMPLoader.h index 421826c91..0371a608b 100644 --- a/code/HMP/HMPLoader.h +++ b/code/HMP/HMPLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/HMP/HalfLifeFileData.h b/code/HMP/HalfLifeFileData.h index ef328edf8..d7db1476c 100644 --- a/code/HMP/HalfLifeFileData.h +++ b/code/HMP/HalfLifeFileData.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Importer/IFC/IFCBoolean.cpp b/code/Importer/IFC/IFCBoolean.cpp index 10e7bf3af..01fd43cd2 100644 --- a/code/Importer/IFC/IFCBoolean.cpp +++ b/code/Importer/IFC/IFCBoolean.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2010, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/Importer/IFC/IFCCurve.cpp b/code/Importer/IFC/IFCCurve.cpp index a817b4f9f..b16df9c5c 100644 --- a/code/Importer/IFC/IFCCurve.cpp +++ b/code/Importer/IFC/IFCCurve.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -323,7 +323,7 @@ public: // oh well. bool have_param = false, have_point = false; IfcVector3 point; - for(const Entry sel :entity.Trim1) { + for(const Entry& sel :entity.Trim1) { if (const ::Assimp::STEP::EXPRESS::REAL* const r = sel->ToPtr<::Assimp::STEP::EXPRESS::REAL>()) { range.first = *r; have_param = true; @@ -340,7 +340,7 @@ public: } } have_param = false, have_point = false; - for(const Entry sel :entity.Trim2) { + for(const Entry& sel :entity.Trim2) { if (const ::Assimp::STEP::EXPRESS::REAL* const r = sel->ToPtr<::Assimp::STEP::EXPRESS::REAL>()) { range.second = *r; have_param = true; diff --git a/code/Importer/IFC/IFCGeometry.cpp b/code/Importer/IFC/IFCGeometry.cpp index 7949f9a58..bb4d74758 100644 --- a/code/Importer/IFC/IFCGeometry.cpp +++ b/code/Importer/IFC/IFCGeometry.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2010, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/Importer/IFC/IFCLoader.cpp b/code/Importer/IFC/IFCLoader.cpp index 5c705c256..5dd19f320 100644 --- a/code/Importer/IFC/IFCLoader.cpp +++ b/code/Importer/IFC/IFCLoader.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Importer/IFC/IFCLoader.h b/code/Importer/IFC/IFCLoader.h index 678c60343..4abfe00f1 100644 --- a/code/Importer/IFC/IFCLoader.h +++ b/code/Importer/IFC/IFCLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Importer/IFC/IFCMaterial.cpp b/code/Importer/IFC/IFCMaterial.cpp index 5fda0a1de..832712cd4 100644 --- a/code/Importer/IFC/IFCMaterial.cpp +++ b/code/Importer/IFC/IFCMaterial.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Importer/IFC/IFCOpenings.cpp b/code/Importer/IFC/IFCOpenings.cpp index d6c40b383..2c6754287 100644 --- a/code/Importer/IFC/IFCOpenings.cpp +++ b/code/Importer/IFC/IFCOpenings.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2010, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/Importer/IFC/IFCProfile.cpp b/code/Importer/IFC/IFCProfile.cpp index daafc9afe..a1a1b3967 100644 --- a/code/Importer/IFC/IFCProfile.cpp +++ b/code/Importer/IFC/IFCProfile.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Importer/IFC/IFCReaderGen1_2x3.cpp b/code/Importer/IFC/IFCReaderGen1_2x3.cpp index f4dbed1d1..58ff47113 100644 --- a/code/Importer/IFC/IFCReaderGen1_2x3.cpp +++ b/code/Importer/IFC/IFCReaderGen1_2x3.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (ASSIMP) ---------------------------------------------------------------------- -Copyright (c) 2006-2010, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/Importer/IFC/IFCReaderGen2_2x3.cpp b/code/Importer/IFC/IFCReaderGen2_2x3.cpp index 7dabe278e..e6687014d 100644 --- a/code/Importer/IFC/IFCReaderGen2_2x3.cpp +++ b/code/Importer/IFC/IFCReaderGen2_2x3.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (ASSIMP) ---------------------------------------------------------------------- -Copyright (c) 2006-2010, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/Importer/IFC/IFCReaderGen_2x3.h b/code/Importer/IFC/IFCReaderGen_2x3.h index 8b39ccdc2..4605b94cf 100644 --- a/code/Importer/IFC/IFCReaderGen_2x3.h +++ b/code/Importer/IFC/IFCReaderGen_2x3.h @@ -2,7 +2,7 @@ Open Asset Import Library (ASSIMP) ---------------------------------------------------------------------- -Copyright (c) 2006-2010, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/Importer/IFC/IFCReaderGen_4.cpp b/code/Importer/IFC/IFCReaderGen_4.cpp index fdefedb18..9eb3e2446 100644 --- a/code/Importer/IFC/IFCReaderGen_4.cpp +++ b/code/Importer/IFC/IFCReaderGen_4.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (ASSIMP) ---------------------------------------------------------------------- -Copyright (c) 2006-2010, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/Importer/IFC/IFCReaderGen_4.h b/code/Importer/IFC/IFCReaderGen_4.h index ccfcb6ea0..0f184cd02 100644 --- a/code/Importer/IFC/IFCReaderGen_4.h +++ b/code/Importer/IFC/IFCReaderGen_4.h @@ -2,7 +2,7 @@ Open Asset Import Library (ASSIMP) ---------------------------------------------------------------------- -Copyright (c) 2006-2010, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/Importer/IFC/IFCUtil.cpp b/code/Importer/IFC/IFCUtil.cpp index f6bca91f5..3557b4baa 100644 --- a/code/Importer/IFC/IFCUtil.cpp +++ b/code/Importer/IFC/IFCUtil.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Importer/IFC/IFCUtil.h b/code/Importer/IFC/IFCUtil.h index 32ae1e07f..cf8c94293 100644 --- a/code/Importer/IFC/IFCUtil.h +++ b/code/Importer/IFC/IFCUtil.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Importer/STEPParser/STEPFileEncoding.cpp b/code/Importer/STEPParser/STEPFileEncoding.cpp index 101dcdfd7..d917c28f3 100644 --- a/code/Importer/STEPParser/STEPFileEncoding.cpp +++ b/code/Importer/STEPParser/STEPFileEncoding.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Importer/STEPParser/STEPFileEncoding.h b/code/Importer/STEPParser/STEPFileEncoding.h index 09f16ba33..a076d1ce9 100644 --- a/code/Importer/STEPParser/STEPFileEncoding.h +++ b/code/Importer/STEPParser/STEPFileEncoding.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Importer/STEPParser/STEPFileReader.cpp b/code/Importer/STEPParser/STEPFileReader.cpp index f099d2be7..72f882d6e 100644 --- a/code/Importer/STEPParser/STEPFileReader.cpp +++ b/code/Importer/STEPParser/STEPFileReader.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Importer/STEPParser/STEPFileReader.h b/code/Importer/STEPParser/STEPFileReader.h index 9c4b77241..62292792a 100644 --- a/code/Importer/STEPParser/STEPFileReader.h +++ b/code/Importer/STEPParser/STEPFileReader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Importer/StepFile/StepFileGen1.cpp b/code/Importer/StepFile/StepFileGen1.cpp index 50c54818e..234300700 100644 --- a/code/Importer/StepFile/StepFileGen1.cpp +++ b/code/Importer/StepFile/StepFileGen1.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (ASSIMP) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/Importer/StepFile/StepFileGen2.cpp b/code/Importer/StepFile/StepFileGen2.cpp index eca09e4e1..a80bb69ef 100644 --- a/code/Importer/StepFile/StepFileGen2.cpp +++ b/code/Importer/StepFile/StepFileGen2.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (ASSIMP) ---------------------------------------------------------------------- -Copyright (c) 2006-2010, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/Importer/StepFile/StepFileGen3.cpp b/code/Importer/StepFile/StepFileGen3.cpp index d8d81141f..2f25683a8 100644 --- a/code/Importer/StepFile/StepFileGen3.cpp +++ b/code/Importer/StepFile/StepFileGen3.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (ASSIMP) ---------------------------------------------------------------------- -Copyright (c) 2006-2010, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/Importer/StepFile/StepFileImporter.cpp b/code/Importer/StepFile/StepFileImporter.cpp index 26c456ac9..28744c785 100644 --- a/code/Importer/StepFile/StepFileImporter.cpp +++ b/code/Importer/StepFile/StepFileImporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Importer/StepFile/StepFileImporter.h b/code/Importer/StepFile/StepFileImporter.h index 70f65fdcf..c6ac08bb6 100644 --- a/code/Importer/StepFile/StepFileImporter.h +++ b/code/Importer/StepFile/StepFileImporter.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Importer/StepFile/StepReaderGen.h b/code/Importer/StepFile/StepReaderGen.h index 9eb86c332..cb1034e2b 100644 --- a/code/Importer/StepFile/StepReaderGen.h +++ b/code/Importer/StepFile/StepReaderGen.h @@ -2,7 +2,7 @@ Open Asset Import Library (ASSIMP) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/Irr/IRRLoader.cpp b/code/Irr/IRRLoader.cpp index e94fd85a4..4361d578a 100644 --- a/code/Irr/IRRLoader.cpp +++ b/code/Irr/IRRLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Irr/IRRLoader.h b/code/Irr/IRRLoader.h index b3ad81a7d..fc6f77031 100644 --- a/code/Irr/IRRLoader.h +++ b/code/Irr/IRRLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Irr/IRRMeshLoader.cpp b/code/Irr/IRRMeshLoader.cpp index 057218464..13db70e91 100644 --- a/code/Irr/IRRMeshLoader.cpp +++ b/code/Irr/IRRMeshLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Irr/IRRMeshLoader.h b/code/Irr/IRRMeshLoader.h index d8b42d78d..f0d249f71 100644 --- a/code/Irr/IRRMeshLoader.h +++ b/code/Irr/IRRMeshLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Irr/IRRShared.cpp b/code/Irr/IRRShared.cpp index ecac031ab..5dacc2ae1 100644 --- a/code/Irr/IRRShared.cpp +++ b/code/Irr/IRRShared.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/LWO/LWOAnimation.cpp b/code/LWO/LWOAnimation.cpp index 3a0d2c392..ae9c4c13b 100644 --- a/code/LWO/LWOAnimation.cpp +++ b/code/LWO/LWOAnimation.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/LWO/LWOAnimation.h b/code/LWO/LWOAnimation.h index dd29695cc..a46787965 100644 --- a/code/LWO/LWOAnimation.h +++ b/code/LWO/LWOAnimation.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/LWO/LWOBLoader.cpp b/code/LWO/LWOBLoader.cpp index b24957072..fe542df1b 100644 --- a/code/LWO/LWOBLoader.cpp +++ b/code/LWO/LWOBLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/LWO/LWOFileData.h b/code/LWO/LWOFileData.h index 7d1f6b1df..33fac8c39 100644 --- a/code/LWO/LWOFileData.h +++ b/code/LWO/LWOFileData.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/LWO/LWOLoader.cpp b/code/LWO/LWOLoader.cpp index 242538056..cb581f7f5 100644 --- a/code/LWO/LWOLoader.cpp +++ b/code/LWO/LWOLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/LWO/LWOLoader.h b/code/LWO/LWOLoader.h index 05b958fd2..680f82923 100644 --- a/code/LWO/LWOLoader.h +++ b/code/LWO/LWOLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/LWO/LWOMaterial.cpp b/code/LWO/LWOMaterial.cpp index b54c21c26..b2304a6be 100644 --- a/code/LWO/LWOMaterial.cpp +++ b/code/LWO/LWOMaterial.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/LWS/LWSLoader.cpp b/code/LWS/LWSLoader.cpp index b52cafa6d..4a9cec4ec 100644 --- a/code/LWS/LWSLoader.cpp +++ b/code/LWS/LWSLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/LWS/LWSLoader.h b/code/LWS/LWSLoader.h index eed0491f3..c1321af37 100644 --- a/code/LWS/LWSLoader.h +++ b/code/LWS/LWSLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/M3D/M3DExporter.cpp b/code/M3D/M3DExporter.cpp index fbb03a591..08a0e4ad8 100644 --- a/code/M3D/M3DExporter.cpp +++ b/code/M3D/M3DExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team Copyright (c) 2019 bzt All rights reserved. diff --git a/code/M3D/M3DExporter.h b/code/M3D/M3DExporter.h index fce89b9de..40fce44d0 100644 --- a/code/M3D/M3DExporter.h +++ b/code/M3D/M3DExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team Copyright (c) 2019 bzt All rights reserved. diff --git a/code/M3D/M3DImporter.cpp b/code/M3D/M3DImporter.cpp index a77e75a27..c34c82515 100644 --- a/code/M3D/M3DImporter.cpp +++ b/code/M3D/M3DImporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team Copyright (c) 2019 bzt All rights reserved. diff --git a/code/M3D/M3DImporter.h b/code/M3D/M3DImporter.h index e8e3a65ed..5c9d4fad8 100644 --- a/code/M3D/M3DImporter.h +++ b/code/M3D/M3DImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team Copyright (c) 2019 bzt All rights reserved. diff --git a/code/M3D/M3DMaterials.h b/code/M3D/M3DMaterials.h index 4aeba59e4..469ddf52b 100644 --- a/code/M3D/M3DMaterials.h +++ b/code/M3D/M3DMaterials.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team Copyright (c) 2019 bzt All rights reserved. diff --git a/code/M3D/M3DWrapper.cpp b/code/M3D/M3DWrapper.cpp index 28eda845f..6ab59b2f0 100644 --- a/code/M3D/M3DWrapper.cpp +++ b/code/M3D/M3DWrapper.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team Copyright (c) 2019 bzt All rights reserved. diff --git a/code/M3D/M3DWrapper.h b/code/M3D/M3DWrapper.h index b4f90ff1f..bf3ab7bc9 100644 --- a/code/M3D/M3DWrapper.h +++ b/code/M3D/M3DWrapper.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team Copyright (c) 2019 bzt All rights reserved. diff --git a/code/MD2/MD2FileData.h b/code/MD2/MD2FileData.h index 9fcb8b0e2..911cd4b98 100644 --- a/code/MD2/MD2FileData.h +++ b/code/MD2/MD2FileData.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MD2/MD2Loader.cpp b/code/MD2/MD2Loader.cpp index 7023c0fa3..473ab99bc 100644 --- a/code/MD2/MD2Loader.cpp +++ b/code/MD2/MD2Loader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/MD2/MD2Loader.h b/code/MD2/MD2Loader.h index a3863f366..cbebc90a4 100644 --- a/code/MD2/MD2Loader.h +++ b/code/MD2/MD2Loader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MD2/MD2NormalTable.h b/code/MD2/MD2NormalTable.h index f82b57683..c5c790872 100644 --- a/code/MD2/MD2NormalTable.h +++ b/code/MD2/MD2NormalTable.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MD3/MD3FileData.h b/code/MD3/MD3FileData.h index 2acd6631f..a98af199c 100644 --- a/code/MD3/MD3FileData.h +++ b/code/MD3/MD3FileData.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MD3/MD3Loader.cpp b/code/MD3/MD3Loader.cpp index 1e78b6e05..2051ecdda 100644 --- a/code/MD3/MD3Loader.cpp +++ b/code/MD3/MD3Loader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team @@ -973,7 +973,7 @@ void MD3Importer::InternReadFile( const std::string& pFile, aiScene* pScene, IOS AI_SWAP2( pcVertices[i].Z ); AI_SWAP4( pcUVs[i].U ); - AI_SWAP4( pcUVs[i].U ); + AI_SWAP4( pcUVs[i].V ); } for (uint32_t i = 0; i < pcSurfaces->NUM_TRIANGLES;++i) { AI_SWAP4(pcTriangles[i].INDEXES[0]); diff --git a/code/MD3/MD3Loader.h b/code/MD3/MD3Loader.h index 01b840228..8d8304345 100644 --- a/code/MD3/MD3Loader.h +++ b/code/MD3/MD3Loader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MD4/MD4FileData.h b/code/MD4/MD4FileData.h index ed3dc65e7..880df3230 100644 --- a/code/MD4/MD4FileData.h +++ b/code/MD4/MD4FileData.h @@ -2,7 +2,7 @@ Open Asset Import Library (ASSIMP) ---------------------------------------------------------------------- -Copyright (c) 2006-2010, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/MD5/MD5Loader.cpp b/code/MD5/MD5Loader.cpp index a4aed8d70..8c41794e7 100644 --- a/code/MD5/MD5Loader.cpp +++ b/code/MD5/MD5Loader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/MD5/MD5Loader.h b/code/MD5/MD5Loader.h index e15cc3fb9..196ffb69a 100644 --- a/code/MD5/MD5Loader.h +++ b/code/MD5/MD5Loader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MD5/MD5Parser.cpp b/code/MD5/MD5Parser.cpp index 37490212f..0d3b9c74a 100644 --- a/code/MD5/MD5Parser.cpp +++ b/code/MD5/MD5Parser.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/MD5/MD5Parser.h b/code/MD5/MD5Parser.h index f7ff5303f..692cb72ba 100644 --- a/code/MD5/MD5Parser.h +++ b/code/MD5/MD5Parser.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MDC/MDCFileData.h b/code/MDC/MDCFileData.h index 052473158..9ec73c170 100644 --- a/code/MDC/MDCFileData.h +++ b/code/MDC/MDCFileData.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MDC/MDCLoader.cpp b/code/MDC/MDCLoader.cpp index 084ec6024..db4cdef54 100644 --- a/code/MDC/MDCLoader.cpp +++ b/code/MDC/MDCLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team @@ -355,7 +355,7 @@ void MDCImporter::InternReadFile( // swap all texture coordinates for (unsigned int i = 0; i < pcSurface->ulNumVertices;++i) { - AI_SWAP4( pcUVs->v ); + AI_SWAP4( pcUVs->u ); AI_SWAP4( pcUVs->v ); } diff --git a/code/MDC/MDCLoader.h b/code/MDC/MDCLoader.h index a21b8a55a..abd23bb19 100644 --- a/code/MDC/MDCLoader.h +++ b/code/MDC/MDCLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MDL/HalfLife/HL1FileData.h b/code/MDL/HalfLife/HL1FileData.h index 4248b1237..a3cbb3439 100644 --- a/code/MDL/HalfLife/HL1FileData.h +++ b/code/MDL/HalfLife/HL1FileData.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MDL/HalfLife/HL1ImportDefinitions.h b/code/MDL/HalfLife/HL1ImportDefinitions.h index f70f40699..29b1cdceb 100644 --- a/code/MDL/HalfLife/HL1ImportDefinitions.h +++ b/code/MDL/HalfLife/HL1ImportDefinitions.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MDL/HalfLife/HL1ImportSettings.h b/code/MDL/HalfLife/HL1ImportSettings.h index 229303e2c..50be1f366 100644 --- a/code/MDL/HalfLife/HL1ImportSettings.h +++ b/code/MDL/HalfLife/HL1ImportSettings.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MDL/HalfLife/HL1MDLLoader.cpp b/code/MDL/HalfLife/HL1MDLLoader.cpp index 785183950..aa77c08c5 100644 --- a/code/MDL/HalfLife/HL1MDLLoader.cpp +++ b/code/MDL/HalfLife/HL1MDLLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -124,11 +124,23 @@ void HL1MDLLoader::release_resources() { delete[] anim_headers_; anim_headers_ = nullptr; } + + // Root has some children nodes. so let's proceed them + if (!rootnode_children_.empty()) { + // Here, it means that the nodes were not added to the + // scene root node. We still have to delete them. + for (auto it = rootnode_children_.begin(); it != rootnode_children_.end(); ++it) { + if (*it) { + delete *it; + } + } + // Ensure this happens only once. + rootnode_children_.clear(); + } } // ------------------------------------------------------------------------------------------------ void HL1MDLLoader::load_file() { - try { header_ = (const Header_HL1 *)buffer_; validate_header(header_, false); @@ -138,8 +150,9 @@ void HL1MDLLoader::load_file() { load_texture_file(); - if (import_settings_.read_animations) + if (import_settings_.read_animations) { load_sequence_groups_files(); + } read_textures(); read_skins(); @@ -155,29 +168,43 @@ void HL1MDLLoader::load_file() { read_sequence_transitions(); } - if (import_settings_.read_attachments) + if (import_settings_.read_attachments) { read_attachments(); + } - if (import_settings_.read_hitboxes) + if (import_settings_.read_hitboxes) { read_hitboxes(); + } - if (import_settings_.read_bone_controllers) + if (import_settings_.read_bone_controllers) { read_bone_controllers(); + } read_global_info(); + if (!header_->numbodyparts) { + // This could be an MDL external texture file. In this case, + // add this flag to allow the scene to be loaded even if it + // has no meshes. + scene_->mFlags |= AI_SCENE_FLAGS_INCOMPLETE; + } + // Append children to root node. if (rootnode_children_.size()) { scene_->mRootNode->addChildren( static_cast(rootnode_children_.size()), rootnode_children_.data()); + + // Clear the list of nodes so they will not be destroyed + // when resources are released. + rootnode_children_.clear(); } release_resources(); - } catch (const std::exception &e) { + } catch (...) { release_resources(); - throw e; + throw; } } @@ -185,46 +212,43 @@ void HL1MDLLoader::load_file() { void HL1MDLLoader::validate_header(const Header_HL1 *header, bool is_texture_header) { if (is_texture_header) { // Every single Half-Life model is assumed to have at least one texture. - if (!header->numtextures) + if (!header->numtextures) { throw DeadlyImportError(MDL_HALFLIFE_LOG_HEADER "There are no textures in the file"); + } - if (header->numtextures > AI_MDL_HL1_MAX_TEXTURES) + if (header->numtextures > AI_MDL_HL1_MAX_TEXTURES) { log_warning_limit_exceeded(header->numtextures, "textures"); + } - if (header->numskinfamilies > AI_MDL_HL1_MAX_SKIN_FAMILIES) + if (header->numskinfamilies > AI_MDL_HL1_MAX_SKIN_FAMILIES) { log_warning_limit_exceeded(header->numskinfamilies, "skin families"); + } } else { - // Every single Half-Life model is assumed to have at least one bodypart. - if (!header->numbodyparts) - throw DeadlyImportError(MDL_HALFLIFE_LOG_HEADER "Model has no bodyparts"); - // Every single Half-Life model is assumed to have at least one bone. - if (!header->numbones) - throw DeadlyImportError(MDL_HALFLIFE_LOG_HEADER "Model has no bones"); - - // Every single Half-Life model is assumed to have at least one sequence group, - // which is the "default" sequence group. - if (!header->numseqgroups) - throw DeadlyImportError(MDL_HALFLIFE_LOG_HEADER "Model has no sequence groups"); - - if (header->numbodyparts > AI_MDL_HL1_MAX_BODYPARTS) + if (header->numbodyparts > AI_MDL_HL1_MAX_BODYPARTS) { log_warning_limit_exceeded(header->numbodyparts, "bodyparts"); + } - if (header->numbones > AI_MDL_HL1_MAX_BONES) + if (header->numbones > AI_MDL_HL1_MAX_BONES) { log_warning_limit_exceeded(header->numbones, "bones"); + } - if (header->numbonecontrollers > AI_MDL_HL1_MAX_BONE_CONTROLLERS) + if (header->numbonecontrollers > AI_MDL_HL1_MAX_BONE_CONTROLLERS) { log_warning_limit_exceeded(header->numbonecontrollers, "bone controllers"); + } - if (header->numseq > AI_MDL_HL1_MAX_SEQUENCES) + if (header->numseq > AI_MDL_HL1_MAX_SEQUENCES) { log_warning_limit_exceeded(header->numseq, "sequences"); + } - if (header->numseqgroups > AI_MDL_HL1_MAX_SEQUENCE_GROUPS) + if (header->numseqgroups > AI_MDL_HL1_MAX_SEQUENCE_GROUPS) { log_warning_limit_exceeded(header->numseqgroups, "sequence groups"); + } - if (header->numattachments > AI_MDL_HL1_MAX_ATTACHMENTS) + if (header->numattachments > AI_MDL_HL1_MAX_ATTACHMENTS) { log_warning_limit_exceeded(header->numattachments, "attachments"); + } } } @@ -256,8 +280,7 @@ void HL1MDLLoader::load_texture_file() { load_file_into_buffer(texture_file_path, texture_buffer_); } else { - /* Model has no external texture file. This means the texture - is stored inside the main MDL file. */ + // Model has no external texture file. This means the texture is stored inside the main MDL file. texture_buffer_ = const_cast(buffer_); } @@ -284,16 +307,17 @@ void HL1MDLLoader::load_texture_file() { */ void HL1MDLLoader::load_sequence_groups_files() { - if (header_->numseqgroups <= 1) + if (header_->numseqgroups <= 1) { return; + } num_sequence_groups_ = header_->numseqgroups; anim_buffers_ = new unsigned char *[num_sequence_groups_]; anim_headers_ = new SequenceHeader_HL1 *[num_sequence_groups_]; for (int i = 0; i < num_sequence_groups_; ++i) { - anim_buffers_[i] = NULL; - anim_headers_[i] = NULL; + anim_buffers_[i] = nullptr; + anim_headers_[i] = nullptr; } std::string file_path_without_extension = @@ -327,28 +351,31 @@ void HL1MDLLoader::read_texture(const Texture_HL1 *ptexture, aiColor3D &last_palette_color) { int outwidth, outheight; int i, j; - int row1[256], row2[256], col1[256], col2[256]; + static const size_t BuffenLen = 256; + int row1[BuffenLen], row2[BuffenLen], col1[BuffenLen], col2[BuffenLen]; unsigned char *pix1, *pix2, *pix3, *pix4; // convert texture to power of 2 for (outwidth = 1; outwidth < ptexture->width; outwidth <<= 1) ; - if (outwidth > 256) - outwidth = 256; + if ( outwidth > static_cast(BuffenLen)) { + outwidth = BuffenLen; + } for (outheight = 1; outheight < ptexture->height; outheight <<= 1) ; - if (outheight > 256) - outheight = 256; + if (static_cast(outheight) > BuffenLen) { + outheight = BuffenLen; + } pResult->mFilename = ptexture->name; pResult->mWidth = outwidth; pResult->mHeight = outheight; - pResult->achFormatHint[0] = 'b'; + pResult->achFormatHint[0] = 'r'; pResult->achFormatHint[1] = 'g'; - pResult->achFormatHint[2] = 'r'; + pResult->achFormatHint[2] = 'b'; pResult->achFormatHint[3] = 'a'; pResult->achFormatHint[4] = '8'; pResult->achFormatHint[5] = '8'; @@ -440,8 +467,9 @@ void HL1MDLLoader::read_textures() { // ------------------------------------------------------------------------------------------------ void HL1MDLLoader::read_skins() { // Read skins, if any. - if (texture_header_->numskinfamilies <= 1) + if (texture_header_->numskinfamilies <= 1) { return; + } // Pointer to base texture index. short *default_skin_ptr = (short *)((uint8_t *)texture_header_ + texture_header_->skinindex); @@ -462,11 +490,16 @@ void HL1MDLLoader::read_skins() { // ------------------------------------------------------------------------------------------------ void HL1MDLLoader::read_bones() { + if (!header_->numbones) { + return; + } + const Bone_HL1 *pbone = (const Bone_HL1 *)((uint8_t *)header_ + header_->boneindex); std::vector unique_bones_names(header_->numbones); - for (int i = 0; i < header_->numbones; ++i) + for (int i = 0; i < header_->numbones; ++i) { unique_bones_names[i] = pbone[i].name; + } // Ensure bones have unique names. unique_name_generator_.set_template_name("Bone"); @@ -551,6 +584,9 @@ void HL1MDLLoader::read_bones() { triangles, respectively (3 indices per face). */ void HL1MDLLoader::read_meshes() { + if (!header_->numbodyparts) { + return; + } int total_verts = 0; int total_triangles = 0; @@ -583,14 +619,17 @@ void HL1MDLLoader::read_meshes() { } // Display limit infos. - if (total_verts > AI_MDL_HL1_MAX_VERTICES) + if (total_verts > AI_MDL_HL1_MAX_VERTICES) { log_warning_limit_exceeded(total_verts, "vertices"); + } - if (scene_->mNumMeshes > AI_MDL_HL1_MAX_MESHES) + if (scene_->mNumMeshes > AI_MDL_HL1_MAX_MESHES) { log_warning_limit_exceeded(scene_->mNumMeshes, "meshes"); + } - if (total_models_ > AI_MDL_HL1_MAX_MODELS) + if (total_models_ > AI_MDL_HL1_MAX_MODELS) { log_warning_limit_exceeded(total_models_, "models"); + } // Ensure bodyparts have unique names. unique_name_generator_.set_template_name("Bodypart"); @@ -917,14 +956,16 @@ void HL1MDLLoader::read_meshes() { } } - if (total_triangles > AI_MDL_HL1_MAX_TRIANGLES) + if (total_triangles > AI_MDL_HL1_MAX_TRIANGLES) { log_warning_limit_exceeded(total_triangles, "triangles"); + } } // ------------------------------------------------------------------------------------------------ void HL1MDLLoader::read_animations() { - if (!header_->numseq) + if (!header_->numseq) { return; + } const SequenceDesc_HL1 *pseqdesc = (const SequenceDesc_HL1 *)((uint8_t *)header_ + header_->seqindex); const SequenceGroup_HL1 *pseqgroup = nullptr; @@ -959,10 +1000,11 @@ void HL1MDLLoader::read_animations() { for (int sequence = 0; sequence < header_->numseq; ++sequence, ++pseqdesc) { pseqgroup = (const SequenceGroup_HL1 *)((uint8_t *)header_ + header_->seqgroupindex) + pseqdesc->seqgroup; - if (pseqdesc->seqgroup == 0) + if (pseqdesc->seqgroup == 0) { panim = (const AnimValueOffset_HL1 *)((uint8_t *)header_ + pseqgroup->unused2 + pseqdesc->animindex); - else + } else { panim = (const AnimValueOffset_HL1 *)((uint8_t *)anim_headers_[pseqdesc->seqgroup] + pseqdesc->animindex); + } for (int blend = 0; blend < pseqdesc->numblends; ++blend, ++scene_animations_ptr) { @@ -1025,6 +1067,9 @@ void HL1MDLLoader::read_animations() { // ------------------------------------------------------------------------------------------------ void HL1MDLLoader::read_sequence_groups_info() { + if (!header_->numseqgroups) { + return; + } aiNode *sequence_groups_node = new aiNode(AI_MDL_HL1_NODE_SEQUENCE_GROUPS); rootnode_children_.push_back(sequence_groups_node); @@ -1035,8 +1080,9 @@ void HL1MDLLoader::read_sequence_groups_info() { const SequenceGroup_HL1 *pseqgroup = (const SequenceGroup_HL1 *)((uint8_t *)header_ + header_->seqgroupindex); unique_sequence_groups_names_.resize(header_->numseqgroups); - for (int i = 0; i < header_->numseqgroups; ++i) + for (int i = 0; i < header_->numseqgroups; ++i) { unique_sequence_groups_names_[i] = pseqgroup[i].label; + } // Ensure sequence groups have unique names. unique_name_generator_.set_template_name("SequenceGroup"); @@ -1059,8 +1105,9 @@ void HL1MDLLoader::read_sequence_groups_info() { // ------------------------------------------------------------------------------------------------ void HL1MDLLoader::read_sequence_infos() { - if (!header_->numseq) + if (!header_->numseq) { return; + } const SequenceDesc_HL1 *pseqdesc = (const SequenceDesc_HL1 *)((uint8_t *)header_ + header_->seqindex); @@ -1163,8 +1210,9 @@ void HL1MDLLoader::read_sequence_infos() { // ------------------------------------------------------------------------------------------------ void HL1MDLLoader::read_sequence_transitions() { - if (!header_->numtransitions) + if (!header_->numtransitions) { return; + } // Read sequence transition graph. aiNode *transition_graph_node = new aiNode(AI_MDL_HL1_NODE_SEQUENCE_TRANSITION_GRAPH); @@ -1177,8 +1225,9 @@ void HL1MDLLoader::read_sequence_transitions() { } void HL1MDLLoader::read_attachments() { - if (!header_->numattachments) + if (!header_->numattachments) { return; + } const Attachment_HL1 *pattach = (const Attachment_HL1 *)((uint8_t *)header_ + header_->attachmentindex); @@ -1200,8 +1249,9 @@ void HL1MDLLoader::read_attachments() { // ------------------------------------------------------------------------------------------------ void HL1MDLLoader::read_hitboxes() { - if (!header_->numhitboxes) + if (!header_->numhitboxes) { return; + } const Hitbox_HL1 *phitbox = (const Hitbox_HL1 *)((uint8_t *)header_ + header_->hitboxindex); @@ -1226,8 +1276,9 @@ void HL1MDLLoader::read_hitboxes() { // ------------------------------------------------------------------------------------------------ void HL1MDLLoader::read_bone_controllers() { - if (!header_->numbonecontrollers) + if (!header_->numbonecontrollers) { return; + } const BoneController_HL1 *pbonecontroller = (const BoneController_HL1 *)((uint8_t *)header_ + header_->bonecontrollerindex); @@ -1306,10 +1357,11 @@ void HL1MDLLoader::extract_anim_value( } // Bah, missing blend! - if (panimvalue->num.valid > k) + if (panimvalue->num.valid > k) { value = panimvalue[k + 1].value * bone_scale; - else + } else { value = panimvalue[panimvalue->num.valid].value * bone_scale; + } } // ------------------------------------------------------------------------------------------------ diff --git a/code/MDL/HalfLife/HL1MDLLoader.h b/code/MDL/HalfLife/HL1MDLLoader.h index 8e356235f..c4293259c 100644 --- a/code/MDL/HalfLife/HL1MDLLoader.h +++ b/code/MDL/HalfLife/HL1MDLLoader.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MDL/HalfLife/HL1MeshTrivert.h b/code/MDL/HalfLife/HL1MeshTrivert.h index 38bd371a0..b61765663 100644 --- a/code/MDL/HalfLife/HL1MeshTrivert.h +++ b/code/MDL/HalfLife/HL1MeshTrivert.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MDL/HalfLife/HalfLifeMDLBaseHeader.h b/code/MDL/HalfLife/HalfLifeMDLBaseHeader.h index 964ade4ae..f26f8735d 100644 --- a/code/MDL/HalfLife/HalfLifeMDLBaseHeader.h +++ b/code/MDL/HalfLife/HalfLifeMDLBaseHeader.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MDL/HalfLife/LogFunctions.h b/code/MDL/HalfLife/LogFunctions.h index db82a2604..5e18a8df7 100644 --- a/code/MDL/HalfLife/LogFunctions.h +++ b/code/MDL/HalfLife/LogFunctions.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MDL/HalfLife/UniqueNameGenerator.cpp b/code/MDL/HalfLife/UniqueNameGenerator.cpp index 1efc3238c..417a6baef 100644 --- a/code/MDL/HalfLife/UniqueNameGenerator.cpp +++ b/code/MDL/HalfLife/UniqueNameGenerator.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MDL/HalfLife/UniqueNameGenerator.h b/code/MDL/HalfLife/UniqueNameGenerator.h index 1da21f724..131a46dc4 100644 --- a/code/MDL/HalfLife/UniqueNameGenerator.h +++ b/code/MDL/HalfLife/UniqueNameGenerator.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MDL/MDLDefaultColorMap.h b/code/MDL/MDLDefaultColorMap.h index 58f642884..8c60d1b58 100644 --- a/code/MDL/MDLDefaultColorMap.h +++ b/code/MDL/MDLDefaultColorMap.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MDL/MDLFileData.h b/code/MDL/MDLFileData.h index f33a57731..8ccaf90a2 100644 --- a/code/MDL/MDLFileData.h +++ b/code/MDL/MDLFileData.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MDL/MDLLoader.cpp b/code/MDL/MDLLoader.cpp index 027c03cbd..11c6e3ecb 100644 --- a/code/MDL/MDLLoader.cpp +++ b/code/MDL/MDLLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -179,93 +179,104 @@ void MDLImporter::InternReadFile( const std::string& pFile, } // This should work for all other types of MDL files, too ... - // the quake header is one of the smallest, afaik + // the HL1 sequence group header is one of the smallest, afaik iFileSize = (unsigned int)file->FileSize(); - if( iFileSize < sizeof(MDL::Header)) { + if( iFileSize < sizeof(MDL::HalfLife::SequenceHeader_HL1)) { throw DeadlyImportError( "MDL File is too small."); } - - // Allocate storage and copy the contents of the file to a memory buffer - mBuffer =new unsigned char[iFileSize+1]; - file->Read( (void*)mBuffer, 1, iFileSize); - - // Append a binary zero to the end of the buffer. - // this is just for safety that string parsing routines - // find the end of the buffer ... - mBuffer[iFileSize] = '\0'; - const uint32_t iMagicWord = *((uint32_t*)mBuffer); - - // Determine the file subtype and call the appropriate member function - - // Original Quake1 format - if (AI_MDL_MAGIC_NUMBER_BE == iMagicWord || AI_MDL_MAGIC_NUMBER_LE == iMagicWord) { - ASSIMP_LOG_DEBUG("MDL subtype: Quake 1, magic word is IDPO"); - iGSFileVersion = 0; - InternReadFile_Quake1(); - } - // GameStudio A MDL2 format - used by some test models that come with 3DGS - else if (AI_MDL_MAGIC_NUMBER_BE_GS3 == iMagicWord || AI_MDL_MAGIC_NUMBER_LE_GS3 == iMagicWord) { - ASSIMP_LOG_DEBUG("MDL subtype: 3D GameStudio A2, magic word is MDL2"); - iGSFileVersion = 2; - InternReadFile_Quake1(); - } - // GameStudio A4 MDL3 format - else if (AI_MDL_MAGIC_NUMBER_BE_GS4 == iMagicWord || AI_MDL_MAGIC_NUMBER_LE_GS4 == iMagicWord) { - ASSIMP_LOG_DEBUG("MDL subtype: 3D GameStudio A4, magic word is MDL3"); - iGSFileVersion = 3; - InternReadFile_3DGS_MDL345(); - } - // GameStudio A5+ MDL4 format - else if (AI_MDL_MAGIC_NUMBER_BE_GS5a == iMagicWord || AI_MDL_MAGIC_NUMBER_LE_GS5a == iMagicWord) { - ASSIMP_LOG_DEBUG("MDL subtype: 3D GameStudio A4, magic word is MDL4"); - iGSFileVersion = 4; - InternReadFile_3DGS_MDL345(); - } - // GameStudio A5+ MDL5 format - else if (AI_MDL_MAGIC_NUMBER_BE_GS5b == iMagicWord || AI_MDL_MAGIC_NUMBER_LE_GS5b == iMagicWord) { - ASSIMP_LOG_DEBUG("MDL subtype: 3D GameStudio A5, magic word is MDL5"); - iGSFileVersion = 5; - InternReadFile_3DGS_MDL345(); - } - // GameStudio A7 MDL7 format - else if (AI_MDL_MAGIC_NUMBER_BE_GS7 == iMagicWord || AI_MDL_MAGIC_NUMBER_LE_GS7 == iMagicWord) { - ASSIMP_LOG_DEBUG("MDL subtype: 3D GameStudio A7, magic word is MDL7"); - iGSFileVersion = 7; - InternReadFile_3DGS_MDL7(); - } - // IDST/IDSQ Format (CS:S/HL^2, etc ...) - else if (AI_MDL_MAGIC_NUMBER_BE_HL2a == iMagicWord || AI_MDL_MAGIC_NUMBER_LE_HL2a == iMagicWord || - AI_MDL_MAGIC_NUMBER_BE_HL2b == iMagicWord || AI_MDL_MAGIC_NUMBER_LE_HL2b == iMagicWord) - { - iGSFileVersion = 0; - - HalfLife::HalfLifeMDLBaseHeader *pHeader = (HalfLife::HalfLifeMDLBaseHeader *)mBuffer; - if (pHeader->version == AI_MDL_HL1_VERSION) - { - ASSIMP_LOG_DEBUG("MDL subtype: Half-Life 1/Goldsrc Engine, magic word is IDST/IDSQ"); - InternReadFile_HL1(pFile, iMagicWord); + + // delete the file buffer and cleanup. + auto DeleteBufferAndCleanup = [&]() { + if (mBuffer) { + delete [] mBuffer; + mBuffer = nullptr; } - else - { - ASSIMP_LOG_DEBUG("MDL subtype: Source(tm) Engine, magic word is IDST/IDSQ"); - InternReadFile_HL2(); + AI_DEBUG_INVALIDATE_PTR(pIOHandler); + AI_DEBUG_INVALIDATE_PTR(pScene); + }; + + try { + // Allocate storage and copy the contents of the file to a memory buffer + mBuffer = new unsigned char[iFileSize+1]; + file->Read( (void*)mBuffer, 1, iFileSize); + + // Append a binary zero to the end of the buffer. + // this is just for safety that string parsing routines + // find the end of the buffer ... + mBuffer[iFileSize] = '\0'; + const uint32_t iMagicWord = *((uint32_t*)mBuffer); + + // Determine the file subtype and call the appropriate member function + + // Original Quake1 format + if (AI_MDL_MAGIC_NUMBER_BE == iMagicWord || AI_MDL_MAGIC_NUMBER_LE == iMagicWord) { + ASSIMP_LOG_DEBUG("MDL subtype: Quake 1, magic word is IDPO"); + iGSFileVersion = 0; + InternReadFile_Quake1(); } - } - else { - // print the magic word to the log file - throw DeadlyImportError( "Unknown MDL subformat " + pFile + - ". Magic word (" + std::string((char*)&iMagicWord,4) + ") is not known"); - } + // GameStudio A MDL2 format - used by some test models that come with 3DGS + else if (AI_MDL_MAGIC_NUMBER_BE_GS3 == iMagicWord || AI_MDL_MAGIC_NUMBER_LE_GS3 == iMagicWord) { + ASSIMP_LOG_DEBUG("MDL subtype: 3D GameStudio A2, magic word is MDL2"); + iGSFileVersion = 2; + InternReadFile_Quake1(); + } + // GameStudio A4 MDL3 format + else if (AI_MDL_MAGIC_NUMBER_BE_GS4 == iMagicWord || AI_MDL_MAGIC_NUMBER_LE_GS4 == iMagicWord) { + ASSIMP_LOG_DEBUG("MDL subtype: 3D GameStudio A4, magic word is MDL3"); + iGSFileVersion = 3; + InternReadFile_3DGS_MDL345(); + } + // GameStudio A5+ MDL4 format + else if (AI_MDL_MAGIC_NUMBER_BE_GS5a == iMagicWord || AI_MDL_MAGIC_NUMBER_LE_GS5a == iMagicWord) { + ASSIMP_LOG_DEBUG("MDL subtype: 3D GameStudio A4, magic word is MDL4"); + iGSFileVersion = 4; + InternReadFile_3DGS_MDL345(); + } + // GameStudio A5+ MDL5 format + else if (AI_MDL_MAGIC_NUMBER_BE_GS5b == iMagicWord || AI_MDL_MAGIC_NUMBER_LE_GS5b == iMagicWord) { + ASSIMP_LOG_DEBUG("MDL subtype: 3D GameStudio A5, magic word is MDL5"); + iGSFileVersion = 5; + InternReadFile_3DGS_MDL345(); + } + // GameStudio A7 MDL7 format + else if (AI_MDL_MAGIC_NUMBER_BE_GS7 == iMagicWord || AI_MDL_MAGIC_NUMBER_LE_GS7 == iMagicWord) { + ASSIMP_LOG_DEBUG("MDL subtype: 3D GameStudio A7, magic word is MDL7"); + iGSFileVersion = 7; + InternReadFile_3DGS_MDL7(); + } + // IDST/IDSQ Format (CS:S/HL^2, etc ...) + else if (AI_MDL_MAGIC_NUMBER_BE_HL2a == iMagicWord || AI_MDL_MAGIC_NUMBER_LE_HL2a == iMagicWord || + AI_MDL_MAGIC_NUMBER_BE_HL2b == iMagicWord || AI_MDL_MAGIC_NUMBER_LE_HL2b == iMagicWord) + { + iGSFileVersion = 0; - // Now rotate the whole scene 90 degrees around the x axis to convert to internal coordinate system - pScene->mRootNode->mTransformation = aiMatrix4x4(1.f,0.f,0.f,0.f, - 0.f,0.f,1.f,0.f,0.f,-1.f,0.f,0.f,0.f,0.f,0.f,1.f); + HalfLife::HalfLifeMDLBaseHeader *pHeader = (HalfLife::HalfLifeMDLBaseHeader *)mBuffer; + if (pHeader->version == AI_MDL_HL1_VERSION) + { + ASSIMP_LOG_DEBUG("MDL subtype: Half-Life 1/Goldsrc Engine, magic word is IDST/IDSQ"); + InternReadFile_HL1(pFile, iMagicWord); + } + else + { + ASSIMP_LOG_DEBUG("MDL subtype: Source(tm) Engine, magic word is IDST/IDSQ"); + InternReadFile_HL2(); + } + } + else { + // print the magic word to the log file + throw DeadlyImportError( "Unknown MDL subformat " + pFile + + ". Magic word (" + std::string((char*)&iMagicWord,4) + ") is not known"); + } - // delete the file buffer and cleanup - delete [] mBuffer; - mBuffer= nullptr; - AI_DEBUG_INVALIDATE_PTR(pIOHandler); - AI_DEBUG_INVALIDATE_PTR(pScene); + // Now rotate the whole scene 90 degrees around the x axis to convert to internal coordinate system + pScene->mRootNode->mTransformation = aiMatrix4x4(1.f,0.f,0.f,0.f, + 0.f,0.f,1.f,0.f,0.f,-1.f,0.f,0.f,0.f,0.f,0.f,1.f); + + DeleteBufferAndCleanup(); + } catch(...) { + DeleteBufferAndCleanup(); + throw; + } } // ------------------------------------------------------------------------------------------------ @@ -1410,11 +1421,11 @@ void MDLImporter::InternReadFile_3DGS_MDL7( ) avOutList[i].reserve(3); // buffer to held the names of all groups in the file - const size_t buffersize( AI_MDL7_MAX_GROUPNAMESIZE*pcHeader->groups_num ); - char* aszGroupNameBuffer = new char[ buffersize ]; + const size_t buffersize(AI_MDL7_MAX_GROUPNAMESIZE*pcHeader->groups_num); + char* aszGroupNameBuffer = new char[ buffersize ]; // read all groups - for (unsigned int iGroup = 0; iGroup < (unsigned int)pcHeader->groups_num;++iGroup) { + for (unsigned int iGroup = 0; iGroup < (unsigned int)pcHeader->groups_num; ++iGroup) { MDL::IntGroupInfo_MDL7 groupInfo((BE_NCONST MDL::Group_MDL7*)szCurrent,iGroup); szCurrent = (const unsigned char*)(groupInfo.pcGroup+1); @@ -1575,7 +1586,7 @@ void MDLImporter::InternReadFile_3DGS_MDL7( ) const size_t maxSize(buffersize - (i*AI_MDL7_MAX_GROUPNAMESIZE)); pcNode->mName.length = ai_snprintf(szBuffer, maxSize, "Group_%u", p); } else { - pcNode->mName.length = ::strlen(szBuffer); + pcNode->mName.length = (ai_uint32)::strlen(szBuffer); } ::strncpy(pcNode->mName.data,szBuffer,MAXLEN-1); ++p; diff --git a/code/MDL/MDLLoader.h b/code/MDL/MDLLoader.h index 35e78d9ec..0bb78a2b1 100644 --- a/code/MDL/MDLLoader.h +++ b/code/MDL/MDLLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MDL/MDLMaterialLoader.cpp b/code/MDL/MDLMaterialLoader.cpp index 0a196761f..38ff5bbb1 100644 --- a/code/MDL/MDLMaterialLoader.cpp +++ b/code/MDL/MDLMaterialLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team @@ -541,7 +541,7 @@ void MDLImporter::ParseSkinLump_3DGS_MDL7( size_t iLen2 = iLen+1; iLen2 = iLen2 > MAXLEN ? MAXLEN : iLen2; memcpy(szFile.data,(const char*)szCurrent,iLen2); - szFile.length = iLen; + szFile.length = (ai_uint32)iLen; szCurrent += iLen2; @@ -710,7 +710,7 @@ void MDLImporter::ParseSkinLump_3DGS_MDL7( aiString szFile; const size_t iLen = strlen((const char*)szCurrent); ::memcpy(szFile.data,(const char*)szCurrent,iLen+1); - szFile.length = iLen; + szFile.length = (ai_uint32)iLen; pcMatOut->AddProperty(&szFile,AI_MATKEY_TEXTURE_DIFFUSE(0)); @@ -831,7 +831,7 @@ void MDLImporter::ParseSkinLump_3DGS_MDL7( aiString szFile; ::memcpy(szFile.data,pcSkin->texture_name,sizeof(pcSkin->texture_name)); szFile.data[sizeof(pcSkin->texture_name)] = '\0'; - szFile.length = ::strlen(szFile.data); + szFile.length = (ai_uint32)::strlen(szFile.data); pcMatOut->AddProperty(&szFile,AI_MATKEY_NAME); } diff --git a/code/MMD/MMDCpp14.h b/code/MMD/MMDCpp14.h index 638b0bfd2..779b6c288 100644 --- a/code/MMD/MMDCpp14.h +++ b/code/MMD/MMDCpp14.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MMD/MMDImporter.cpp b/code/MMD/MMDImporter.cpp index e7744e4cd..3cc618633 100644 --- a/code/MMD/MMDImporter.cpp +++ b/code/MMD/MMDImporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2016, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MMD/MMDImporter.h b/code/MMD/MMDImporter.h index 4ee94eeb0..1cc91c782 100644 --- a/code/MMD/MMDImporter.h +++ b/code/MMD/MMDImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2016, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/MMD/MMDPmdParser.h b/code/MMD/MMDPmdParser.h index d2f2224aa..dad9ed4bc 100644 --- a/code/MMD/MMDPmdParser.h +++ b/code/MMD/MMDPmdParser.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MMD/MMDPmxParser.cpp b/code/MMD/MMDPmxParser.cpp index 80f0986dd..6421f38cb 100644 --- a/code/MMD/MMDPmxParser.cpp +++ b/code/MMD/MMDPmxParser.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MMD/MMDPmxParser.h b/code/MMD/MMDPmxParser.h index cf523a129..9c9fb3ad7 100644 --- a/code/MMD/MMDPmxParser.h +++ b/code/MMD/MMDPmxParser.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MMD/MMDVmdParser.h b/code/MMD/MMDVmdParser.h index 947c3a242..7d15e32d4 100644 --- a/code/MMD/MMDVmdParser.h +++ b/code/MMD/MMDVmdParser.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/MS3D/MS3DLoader.cpp b/code/MS3D/MS3DLoader.cpp index c0d0eddbe..5a29df2ee 100644 --- a/code/MS3D/MS3DLoader.cpp +++ b/code/MS3D/MS3DLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/MS3D/MS3DLoader.h b/code/MS3D/MS3DLoader.h index 3e39dc79f..522664b9a 100644 --- a/code/MS3D/MS3DLoader.h +++ b/code/MS3D/MS3DLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Material/MaterialSystem.cpp b/code/Material/MaterialSystem.cpp index aa3df9ac2..1c034e55f 100644 --- a/code/Material/MaterialSystem.cpp +++ b/code/Material/MaterialSystem.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -504,7 +504,7 @@ aiReturn aiMaterial::AddBinaryProperty (const void* pInput, pcNew->mData = new char[pSizeInBytes]; memcpy (pcNew->mData,pInput,pSizeInBytes); - pcNew->mKey.length = ::strlen(pKey); + pcNew->mKey.length = (ai_uint32)::strlen(pKey); ai_assert ( MAXLEN > pcNew->mKey.length); strcpy( pcNew->mKey.data, pKey ); diff --git a/code/Material/MaterialSystem.h b/code/Material/MaterialSystem.h index 67d53578c..6df9818a3 100644 --- a/code/Material/MaterialSystem.h +++ b/code/Material/MaterialSystem.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/NDO/NDOLoader.cpp b/code/NDO/NDOLoader.cpp index d33f40c75..efb942b9c 100644 --- a/code/NDO/NDOLoader.cpp +++ b/code/NDO/NDOLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/NDO/NDOLoader.h b/code/NDO/NDOLoader.h index f2212edab..4d3f47b25 100644 --- a/code/NDO/NDOLoader.h +++ b/code/NDO/NDOLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2008, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/code/NFF/NFFLoader.cpp b/code/NFF/NFFLoader.cpp index 10a7d1aff..ca10f7a03 100644 --- a/code/NFF/NFFLoader.cpp +++ b/code/NFF/NFFLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/NFF/NFFLoader.h b/code/NFF/NFFLoader.h index bc4840e14..02f0f82d5 100644 --- a/code/NFF/NFFLoader.h +++ b/code/NFF/NFFLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/OFF/OFFLoader.cpp b/code/OFF/OFFLoader.cpp index afd44a539..79f006fca 100644 --- a/code/OFF/OFFLoader.cpp +++ b/code/OFF/OFFLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/OFF/OFFLoader.h b/code/OFF/OFFLoader.h index 3fca77e1b..f0f40d9d5 100644 --- a/code/OFF/OFFLoader.h +++ b/code/OFF/OFFLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Obj/ObjExporter.cpp b/code/Obj/ObjExporter.cpp index 0a0dbd62c..56eb4d9b8 100644 --- a/code/Obj/ObjExporter.cpp +++ b/code/Obj/ObjExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Obj/ObjExporter.h b/code/Obj/ObjExporter.h index 0d2b48d6b..3a46da780 100644 --- a/code/Obj/ObjExporter.h +++ b/code/Obj/ObjExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Obj/ObjFileData.h b/code/Obj/ObjFileData.h index a2d9f2cc7..985a49a42 100644 --- a/code/Obj/ObjFileData.h +++ b/code/Obj/ObjFileData.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Obj/ObjFileImporter.cpp b/code/Obj/ObjFileImporter.cpp index 26cc6d1f9..7e2df0fc5 100644 --- a/code/Obj/ObjFileImporter.cpp +++ b/code/Obj/ObjFileImporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Obj/ObjFileImporter.h b/code/Obj/ObjFileImporter.h index 0df2ef731..87b724837 100644 --- a/code/Obj/ObjFileImporter.h +++ b/code/Obj/ObjFileImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Obj/ObjFileMtlImporter.cpp b/code/Obj/ObjFileMtlImporter.cpp index dd9cc3ce2..cdd60f03c 100644 --- a/code/Obj/ObjFileMtlImporter.cpp +++ b/code/Obj/ObjFileMtlImporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Obj/ObjFileMtlImporter.h b/code/Obj/ObjFileMtlImporter.h index 731952359..2a7fcba7b 100644 --- a/code/Obj/ObjFileMtlImporter.h +++ b/code/Obj/ObjFileMtlImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Obj/ObjFileParser.cpp b/code/Obj/ObjFileParser.cpp index 699aafe6a..7e3b11b23 100644 --- a/code/Obj/ObjFileParser.cpp +++ b/code/Obj/ObjFileParser.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Obj/ObjFileParser.h b/code/Obj/ObjFileParser.h index 7d1b806ce..124527413 100644 --- a/code/Obj/ObjFileParser.h +++ b/code/Obj/ObjFileParser.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Obj/ObjTools.h b/code/Obj/ObjTools.h index 3f4c41033..331277333 100644 --- a/code/Obj/ObjTools.h +++ b/code/Obj/ObjTools.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Ogre/OgreBinarySerializer.cpp b/code/Ogre/OgreBinarySerializer.cpp index 589e69c7e..c7b7e0b5e 100644 --- a/code/Ogre/OgreBinarySerializer.cpp +++ b/code/Ogre/OgreBinarySerializer.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Ogre/OgreBinarySerializer.h b/code/Ogre/OgreBinarySerializer.h index 8bab00ce9..0b88641aa 100644 --- a/code/Ogre/OgreBinarySerializer.h +++ b/code/Ogre/OgreBinarySerializer.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Ogre/OgreImporter.cpp b/code/Ogre/OgreImporter.cpp index c2c328a47..6ef9aa462 100644 --- a/code/Ogre/OgreImporter.cpp +++ b/code/Ogre/OgreImporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Ogre/OgreImporter.h b/code/Ogre/OgreImporter.h index 321d58763..ad614b4f4 100644 --- a/code/Ogre/OgreImporter.h +++ b/code/Ogre/OgreImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Ogre/OgreMaterial.cpp b/code/Ogre/OgreMaterial.cpp index 47cb17eb0..6f2e62958 100644 --- a/code/Ogre/OgreMaterial.cpp +++ b/code/Ogre/OgreMaterial.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Ogre/OgreParsingUtils.h b/code/Ogre/OgreParsingUtils.h index 8786521e4..3fbfd5c31 100644 --- a/code/Ogre/OgreParsingUtils.h +++ b/code/Ogre/OgreParsingUtils.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Ogre/OgreStructs.cpp b/code/Ogre/OgreStructs.cpp index 7962202c1..69cfae1cd 100644 --- a/code/Ogre/OgreStructs.cpp +++ b/code/Ogre/OgreStructs.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Ogre/OgreStructs.h b/code/Ogre/OgreStructs.h index 6ea211e10..2a1121dab 100644 --- a/code/Ogre/OgreStructs.h +++ b/code/Ogre/OgreStructs.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Ogre/OgreXmlSerializer.cpp b/code/Ogre/OgreXmlSerializer.cpp index 19fd3ad61..a93f1b207 100644 --- a/code/Ogre/OgreXmlSerializer.cpp +++ b/code/Ogre/OgreXmlSerializer.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Ogre/OgreXmlSerializer.h b/code/Ogre/OgreXmlSerializer.h index 7e5e83fec..e81599f9c 100644 --- a/code/Ogre/OgreXmlSerializer.h +++ b/code/Ogre/OgreXmlSerializer.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/OpenGEX/OpenGEXExporter.cpp b/code/OpenGEX/OpenGEXExporter.cpp index 635174185..164a191a2 100644 --- a/code/OpenGEX/OpenGEXExporter.cpp +++ b/code/OpenGEX/OpenGEXExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/OpenGEX/OpenGEXExporter.h b/code/OpenGEX/OpenGEXExporter.h index b9b54c208..4e4798f2c 100644 --- a/code/OpenGEX/OpenGEXExporter.h +++ b/code/OpenGEX/OpenGEXExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/OpenGEX/OpenGEXImporter.cpp b/code/OpenGEX/OpenGEXImporter.cpp index 07d3efd5e..4ee746716 100644 --- a/code/OpenGEX/OpenGEXImporter.cpp +++ b/code/OpenGEX/OpenGEXImporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/OpenGEX/OpenGEXImporter.h b/code/OpenGEX/OpenGEXImporter.h index 22b5cabef..98f7a3e89 100644 --- a/code/OpenGEX/OpenGEXImporter.h +++ b/code/OpenGEX/OpenGEXImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/OpenGEX/OpenGEXStructs.h b/code/OpenGEX/OpenGEXStructs.h index 2c83e8660..7b0b65c1d 100644 --- a/code/OpenGEX/OpenGEXStructs.h +++ b/code/OpenGEX/OpenGEXStructs.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Ply/PlyExporter.cpp b/code/Ply/PlyExporter.cpp index 5e21a88ac..28ff0c602 100644 --- a/code/Ply/PlyExporter.cpp +++ b/code/Ply/PlyExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -373,10 +373,11 @@ void PlyExporter::WriteMeshIndices(const aiMesh* m, unsigned int offset) { for (unsigned int i = 0; i < m->mNumFaces; ++i) { const aiFace& f = m->mFaces[i]; - mOutput << f.mNumIndices << " "; + mOutput << f.mNumIndices; for(unsigned int c = 0; c < f.mNumIndices; ++c) { - mOutput << (f.mIndices[c] + offset) << (c == f.mNumIndices-1 ? endl : " "); + mOutput << " " << (f.mIndices[c] + offset); } + mOutput << endl; } } diff --git a/code/Ply/PlyExporter.h b/code/Ply/PlyExporter.h index b82498cbd..dc53497f6 100644 --- a/code/Ply/PlyExporter.h +++ b/code/Ply/PlyExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Ply/PlyLoader.cpp b/code/Ply/PlyLoader.cpp index ca1ec22f8..cd52b74f2 100644 --- a/code/Ply/PlyLoader.cpp +++ b/code/Ply/PlyLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Ply/PlyLoader.h b/code/Ply/PlyLoader.h index 201c463b2..41620e6b0 100644 --- a/code/Ply/PlyLoader.h +++ b/code/Ply/PlyLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Ply/PlyParser.cpp b/code/Ply/PlyParser.cpp index 2a6f00ad6..d47ca5b6f 100644 --- a/code/Ply/PlyParser.cpp +++ b/code/Ply/PlyParser.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Ply/PlyParser.h b/code/Ply/PlyParser.h index a11b411d1..e05490649 100644 --- a/code/Ply/PlyParser.h +++ b/code/Ply/PlyParser.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/ArmaturePopulate.cpp b/code/PostProcessing/ArmaturePopulate.cpp index 75daeb6b5..c339bebe0 100644 --- a/code/PostProcessing/ArmaturePopulate.cpp +++ b/code/PostProcessing/ArmaturePopulate.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/ArmaturePopulate.h b/code/PostProcessing/ArmaturePopulate.h index aa1ad7c80..8985e1d1d 100644 --- a/code/PostProcessing/ArmaturePopulate.h +++ b/code/PostProcessing/ArmaturePopulate.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/CalcTangentsProcess.cpp b/code/PostProcessing/CalcTangentsProcess.cpp index a3f7dd255..4af335d2f 100644 --- a/code/PostProcessing/CalcTangentsProcess.cpp +++ b/code/PostProcessing/CalcTangentsProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/PostProcessing/CalcTangentsProcess.h b/code/PostProcessing/CalcTangentsProcess.h index 3568a624f..bdd5ca7fa 100644 --- a/code/PostProcessing/CalcTangentsProcess.h +++ b/code/PostProcessing/CalcTangentsProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/ComputeUVMappingProcess.cpp b/code/PostProcessing/ComputeUVMappingProcess.cpp index df4d44337..1ebf798bd 100644 --- a/code/PostProcessing/ComputeUVMappingProcess.cpp +++ b/code/PostProcessing/ComputeUVMappingProcess.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/ComputeUVMappingProcess.h b/code/PostProcessing/ComputeUVMappingProcess.h index a6d36e06e..b4ad0f501 100644 --- a/code/PostProcessing/ComputeUVMappingProcess.h +++ b/code/PostProcessing/ComputeUVMappingProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/ConvertToLHProcess.cpp b/code/PostProcessing/ConvertToLHProcess.cpp index b7cd4f0bc..6ca73f10e 100644 --- a/code/PostProcessing/ConvertToLHProcess.cpp +++ b/code/PostProcessing/ConvertToLHProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/PostProcessing/ConvertToLHProcess.h b/code/PostProcessing/ConvertToLHProcess.h index 0c4a3a091..de984a105 100644 --- a/code/PostProcessing/ConvertToLHProcess.h +++ b/code/PostProcessing/ConvertToLHProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/DeboneProcess.cpp b/code/PostProcessing/DeboneProcess.cpp index 83b8336bc..9d6313f71 100644 --- a/code/PostProcessing/DeboneProcess.cpp +++ b/code/PostProcessing/DeboneProcess.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/DeboneProcess.h b/code/PostProcessing/DeboneProcess.h index 8b64c2acc..31955f2bd 100644 --- a/code/PostProcessing/DeboneProcess.h +++ b/code/PostProcessing/DeboneProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/DropFaceNormalsProcess.cpp b/code/PostProcessing/DropFaceNormalsProcess.cpp index b11615bb8..1d7cf33b0 100644 --- a/code/PostProcessing/DropFaceNormalsProcess.cpp +++ b/code/PostProcessing/DropFaceNormalsProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/PostProcessing/DropFaceNormalsProcess.h b/code/PostProcessing/DropFaceNormalsProcess.h index c710c5a5e..b9e942d55 100644 --- a/code/PostProcessing/DropFaceNormalsProcess.h +++ b/code/PostProcessing/DropFaceNormalsProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/EmbedTexturesProcess.cpp b/code/PostProcessing/EmbedTexturesProcess.cpp index 739382a05..b187acf53 100644 --- a/code/PostProcessing/EmbedTexturesProcess.cpp +++ b/code/PostProcessing/EmbedTexturesProcess.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -128,7 +128,8 @@ bool EmbedTexturesProcess::addTexture(aiScene* pScene, std::string path) const { auto oldTextures = pScene->mTextures; pScene->mTextures = new aiTexture*[pScene->mNumTextures]; ::memmove(pScene->mTextures, oldTextures, sizeof(aiTexture*) * (pScene->mNumTextures - 1u)); - + delete [] oldTextures; + // Add the new texture auto pTexture = new aiTexture; pTexture->mHeight = 0; // Means that this is still compressed diff --git a/code/PostProcessing/EmbedTexturesProcess.h b/code/PostProcessing/EmbedTexturesProcess.h index 3c4b2eab4..bbe2656f5 100644 --- a/code/PostProcessing/EmbedTexturesProcess.h +++ b/code/PostProcessing/EmbedTexturesProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/FindDegenerates.cpp b/code/PostProcessing/FindDegenerates.cpp index 50fac46db..dfdfec6cc 100644 --- a/code/PostProcessing/FindDegenerates.cpp +++ b/code/PostProcessing/FindDegenerates.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/PostProcessing/FindDegenerates.h b/code/PostProcessing/FindDegenerates.h index 7a15e77cf..1edaab657 100644 --- a/code/PostProcessing/FindDegenerates.h +++ b/code/PostProcessing/FindDegenerates.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/FindInstancesProcess.cpp b/code/PostProcessing/FindInstancesProcess.cpp index 64907458a..9a4c6f53b 100644 --- a/code/PostProcessing/FindInstancesProcess.cpp +++ b/code/PostProcessing/FindInstancesProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/PostProcessing/FindInstancesProcess.h b/code/PostProcessing/FindInstancesProcess.h index 64b838d7c..dcac4bf83 100644 --- a/code/PostProcessing/FindInstancesProcess.h +++ b/code/PostProcessing/FindInstancesProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/FindInvalidDataProcess.cpp b/code/PostProcessing/FindInvalidDataProcess.cpp index 016884c6e..c557d7f70 100644 --- a/code/PostProcessing/FindInvalidDataProcess.cpp +++ b/code/PostProcessing/FindInvalidDataProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/PostProcessing/FindInvalidDataProcess.h b/code/PostProcessing/FindInvalidDataProcess.h index ce7375f34..50a2fe04c 100644 --- a/code/PostProcessing/FindInvalidDataProcess.h +++ b/code/PostProcessing/FindInvalidDataProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/FixNormalsStep.cpp b/code/PostProcessing/FixNormalsStep.cpp index bbbe6899b..bb2aa06cc 100644 --- a/code/PostProcessing/FixNormalsStep.cpp +++ b/code/PostProcessing/FixNormalsStep.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/PostProcessing/FixNormalsStep.h b/code/PostProcessing/FixNormalsStep.h index f60ce596a..c022d0364 100644 --- a/code/PostProcessing/FixNormalsStep.h +++ b/code/PostProcessing/FixNormalsStep.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/GenBoundingBoxesProcess.cpp b/code/PostProcessing/GenBoundingBoxesProcess.cpp index c013454fc..bfe016cf2 100644 --- a/code/PostProcessing/GenBoundingBoxesProcess.cpp +++ b/code/PostProcessing/GenBoundingBoxesProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/GenBoundingBoxesProcess.h b/code/PostProcessing/GenBoundingBoxesProcess.h index 4b43c82a4..d93489a5b 100644 --- a/code/PostProcessing/GenBoundingBoxesProcess.h +++ b/code/PostProcessing/GenBoundingBoxesProcess.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/GenFaceNormalsProcess.cpp b/code/PostProcessing/GenFaceNormalsProcess.cpp index 028334dec..08a1d9aae 100644 --- a/code/PostProcessing/GenFaceNormalsProcess.cpp +++ b/code/PostProcessing/GenFaceNormalsProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/PostProcessing/GenFaceNormalsProcess.h b/code/PostProcessing/GenFaceNormalsProcess.h index c641fd635..6e872af3a 100644 --- a/code/PostProcessing/GenFaceNormalsProcess.h +++ b/code/PostProcessing/GenFaceNormalsProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/GenVertexNormalsProcess.cpp b/code/PostProcessing/GenVertexNormalsProcess.cpp index 3f6c2f86b..1df333410 100644 --- a/code/PostProcessing/GenVertexNormalsProcess.cpp +++ b/code/PostProcessing/GenVertexNormalsProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/PostProcessing/GenVertexNormalsProcess.h b/code/PostProcessing/GenVertexNormalsProcess.h index 2ceee17e8..38104b3bf 100644 --- a/code/PostProcessing/GenVertexNormalsProcess.h +++ b/code/PostProcessing/GenVertexNormalsProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/ImproveCacheLocality.cpp b/code/PostProcessing/ImproveCacheLocality.cpp index d0a016fa4..d72d15d3a 100644 --- a/code/PostProcessing/ImproveCacheLocality.cpp +++ b/code/PostProcessing/ImproveCacheLocality.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/PostProcessing/ImproveCacheLocality.h b/code/PostProcessing/ImproveCacheLocality.h index de25ecd9f..73e11f57b 100644 --- a/code/PostProcessing/ImproveCacheLocality.h +++ b/code/PostProcessing/ImproveCacheLocality.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/JoinVerticesProcess.cpp b/code/PostProcessing/JoinVerticesProcess.cpp index f121fc60d..070c9636f 100644 --- a/code/PostProcessing/JoinVerticesProcess.cpp +++ b/code/PostProcessing/JoinVerticesProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/PostProcessing/JoinVerticesProcess.h b/code/PostProcessing/JoinVerticesProcess.h index e017ae62d..76e7cf061 100644 --- a/code/PostProcessing/JoinVerticesProcess.h +++ b/code/PostProcessing/JoinVerticesProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/LimitBoneWeightsProcess.cpp b/code/PostProcessing/LimitBoneWeightsProcess.cpp index d560f1928..1f1abfabb 100644 --- a/code/PostProcessing/LimitBoneWeightsProcess.cpp +++ b/code/PostProcessing/LimitBoneWeightsProcess.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/LimitBoneWeightsProcess.h b/code/PostProcessing/LimitBoneWeightsProcess.h index 73c2a68d5..8bc321a3c 100644 --- a/code/PostProcessing/LimitBoneWeightsProcess.h +++ b/code/PostProcessing/LimitBoneWeightsProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/MakeVerboseFormat.cpp b/code/PostProcessing/MakeVerboseFormat.cpp index 41f50a5ba..88bdb3124 100644 --- a/code/PostProcessing/MakeVerboseFormat.cpp +++ b/code/PostProcessing/MakeVerboseFormat.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/PostProcessing/MakeVerboseFormat.h b/code/PostProcessing/MakeVerboseFormat.h index 8565d5933..699cce30b 100644 --- a/code/PostProcessing/MakeVerboseFormat.h +++ b/code/PostProcessing/MakeVerboseFormat.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/OptimizeGraph.cpp b/code/PostProcessing/OptimizeGraph.cpp index 43bd7a3ee..f3996c275 100644 --- a/code/PostProcessing/OptimizeGraph.cpp +++ b/code/PostProcessing/OptimizeGraph.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/OptimizeGraph.h b/code/PostProcessing/OptimizeGraph.h index d2a6de9a2..34f70854f 100644 --- a/code/PostProcessing/OptimizeGraph.h +++ b/code/PostProcessing/OptimizeGraph.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/OptimizeMeshes.cpp b/code/PostProcessing/OptimizeMeshes.cpp index 3f6765f6c..983d8001f 100644 --- a/code/PostProcessing/OptimizeMeshes.cpp +++ b/code/PostProcessing/OptimizeMeshes.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/PostProcessing/OptimizeMeshes.h b/code/PostProcessing/OptimizeMeshes.h index dec4ab52d..50dfe2957 100644 --- a/code/PostProcessing/OptimizeMeshes.h +++ b/code/PostProcessing/OptimizeMeshes.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/PretransformVertices.cpp b/code/PostProcessing/PretransformVertices.cpp index fb6b458d8..293a5c0ea 100644 --- a/code/PostProcessing/PretransformVertices.cpp +++ b/code/PostProcessing/PretransformVertices.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/PostProcessing/PretransformVertices.h b/code/PostProcessing/PretransformVertices.h index 7898f6ae3..4a958def4 100644 --- a/code/PostProcessing/PretransformVertices.h +++ b/code/PostProcessing/PretransformVertices.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/ProcessHelper.cpp b/code/PostProcessing/ProcessHelper.cpp index 59869fdff..41444afd8 100644 --- a/code/PostProcessing/ProcessHelper.cpp +++ b/code/PostProcessing/ProcessHelper.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/ProcessHelper.h b/code/PostProcessing/ProcessHelper.h index 0afcc4142..7ff3a9c5f 100644 --- a/code/PostProcessing/ProcessHelper.h +++ b/code/PostProcessing/ProcessHelper.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/RemoveRedundantMaterials.cpp b/code/PostProcessing/RemoveRedundantMaterials.cpp index 49ec8f5c4..0c4280410 100644 --- a/code/PostProcessing/RemoveRedundantMaterials.cpp +++ b/code/PostProcessing/RemoveRedundantMaterials.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/PostProcessing/RemoveRedundantMaterials.h b/code/PostProcessing/RemoveRedundantMaterials.h index 1f32a0abf..4b4f346c8 100644 --- a/code/PostProcessing/RemoveRedundantMaterials.h +++ b/code/PostProcessing/RemoveRedundantMaterials.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/RemoveVCProcess.cpp b/code/PostProcessing/RemoveVCProcess.cpp index 99fd47a3a..5ff5b55fa 100644 --- a/code/PostProcessing/RemoveVCProcess.cpp +++ b/code/PostProcessing/RemoveVCProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/PostProcessing/RemoveVCProcess.h b/code/PostProcessing/RemoveVCProcess.h index 7bb21a833..458b37ee0 100644 --- a/code/PostProcessing/RemoveVCProcess.h +++ b/code/PostProcessing/RemoveVCProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/ScaleProcess.cpp b/code/PostProcessing/ScaleProcess.cpp index ac770c41f..66714928b 100644 --- a/code/PostProcessing/ScaleProcess.cpp +++ b/code/PostProcessing/ScaleProcess.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/ScaleProcess.h b/code/PostProcessing/ScaleProcess.h index 468a21673..9cc664c6a 100644 --- a/code/PostProcessing/ScaleProcess.h +++ b/code/PostProcessing/ScaleProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/SortByPTypeProcess.cpp b/code/PostProcessing/SortByPTypeProcess.cpp index be8405a17..c1b08c5a7 100644 --- a/code/PostProcessing/SortByPTypeProcess.cpp +++ b/code/PostProcessing/SortByPTypeProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/PostProcessing/SortByPTypeProcess.h b/code/PostProcessing/SortByPTypeProcess.h index 1d7ccfc15..5135139ed 100644 --- a/code/PostProcessing/SortByPTypeProcess.h +++ b/code/PostProcessing/SortByPTypeProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/SplitLargeMeshes.cpp b/code/PostProcessing/SplitLargeMeshes.cpp index 1797b28d5..70960f4a8 100644 --- a/code/PostProcessing/SplitLargeMeshes.cpp +++ b/code/PostProcessing/SplitLargeMeshes.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/SplitLargeMeshes.h b/code/PostProcessing/SplitLargeMeshes.h index 3f90576ea..fa6f77b2d 100644 --- a/code/PostProcessing/SplitLargeMeshes.h +++ b/code/PostProcessing/SplitLargeMeshes.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/TextureTransform.cpp b/code/PostProcessing/TextureTransform.cpp index 8ae2ba721..cebbd8042 100644 --- a/code/PostProcessing/TextureTransform.cpp +++ b/code/PostProcessing/TextureTransform.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/TextureTransform.h b/code/PostProcessing/TextureTransform.h index 2a5d623d7..2f6fc3edc 100644 --- a/code/PostProcessing/TextureTransform.h +++ b/code/PostProcessing/TextureTransform.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/TriangulateProcess.cpp b/code/PostProcessing/TriangulateProcess.cpp index 1040836bb..64cc63bbd 100644 --- a/code/PostProcessing/TriangulateProcess.cpp +++ b/code/PostProcessing/TriangulateProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/TriangulateProcess.h b/code/PostProcessing/TriangulateProcess.h index 916b5103d..388952eb5 100644 --- a/code/PostProcessing/TriangulateProcess.h +++ b/code/PostProcessing/TriangulateProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/PostProcessing/ValidateDataStructure.cpp b/code/PostProcessing/ValidateDataStructure.cpp index 1dc217663..a812efb0b 100644 --- a/code/PostProcessing/ValidateDataStructure.cpp +++ b/code/PostProcessing/ValidateDataStructure.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team @@ -798,7 +798,7 @@ void ValidateDSProcess::Validate( const aiTexture* pTexture) if (!pTexture->mWidth) { ReportError("aiTexture::mWidth is zero (compressed texture)"); } - if ('\0' != pTexture->achFormatHint[3]) { + if ('\0' != pTexture->achFormatHint[HINTMAXTEXTURELEN - 1]) { ReportWarning("aiTexture::achFormatHint must be zero-terminated"); } else if ('.' == pTexture->achFormatHint[0]) { diff --git a/code/PostProcessing/ValidateDataStructure.h b/code/PostProcessing/ValidateDataStructure.h index 7b309c925..4b5503ae0 100644 --- a/code/PostProcessing/ValidateDataStructure.h +++ b/code/PostProcessing/ValidateDataStructure.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Q3BSP/Q3BSPFileData.h b/code/Q3BSP/Q3BSPFileData.h index 4e05bebf1..099253392 100644 --- a/code/Q3BSP/Q3BSPFileData.h +++ b/code/Q3BSP/Q3BSPFileData.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Q3BSP/Q3BSPFileImporter.cpp b/code/Q3BSP/Q3BSPFileImporter.cpp index 4add00a07..15f574214 100644 --- a/code/Q3BSP/Q3BSPFileImporter.cpp +++ b/code/Q3BSP/Q3BSPFileImporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -616,7 +616,7 @@ bool Q3BSPFileImporter::importTextureFromArchive( const Q3BSP::Q3BSPModel *model // We'll leave it up to the user to figure out which extension the file has. aiString name; strncpy( name.data, pTexture->strName, sizeof name.data ); - name.length = strlen( name.data ); + name.length = (ai_uint32)strlen( name.data ); pMatHelper->AddProperty( &name, AI_MATKEY_TEXTURE_DIFFUSE( 0 ) ); } } diff --git a/code/Q3BSP/Q3BSPFileImporter.h b/code/Q3BSP/Q3BSPFileImporter.h index ee21fa48e..619f30863 100644 --- a/code/Q3BSP/Q3BSPFileImporter.h +++ b/code/Q3BSP/Q3BSPFileImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Q3BSP/Q3BSPFileParser.cpp b/code/Q3BSP/Q3BSPFileParser.cpp index bed2efe53..73f5ec7b8 100644 --- a/code/Q3BSP/Q3BSPFileParser.cpp +++ b/code/Q3BSP/Q3BSPFileParser.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Q3BSP/Q3BSPFileParser.h b/code/Q3BSP/Q3BSPFileParser.h index fd73f5e10..eab87c76c 100644 --- a/code/Q3BSP/Q3BSPFileParser.h +++ b/code/Q3BSP/Q3BSPFileParser.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Q3D/Q3DLoader.cpp b/code/Q3D/Q3DLoader.cpp index b8c8de716..f68d2ac32 100644 --- a/code/Q3D/Q3DLoader.cpp +++ b/code/Q3D/Q3DLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Q3D/Q3DLoader.h b/code/Q3D/Q3DLoader.h index 954d3105c..f1118eec7 100644 --- a/code/Q3D/Q3DLoader.h +++ b/code/Q3D/Q3DLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Raw/RawLoader.cpp b/code/Raw/RawLoader.cpp index d0da247e4..092323cc0 100644 --- a/code/Raw/RawLoader.cpp +++ b/code/Raw/RawLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Raw/RawLoader.h b/code/Raw/RawLoader.h index 8bfe8ef98..7f5926bd3 100644 --- a/code/Raw/RawLoader.h +++ b/code/Raw/RawLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/SIB/SIBImporter.cpp b/code/SIB/SIBImporter.cpp index 20cdc8009..ac5646412 100644 --- a/code/SIB/SIBImporter.cpp +++ b/code/SIB/SIBImporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/SIB/SIBImporter.h b/code/SIB/SIBImporter.h index bb88c2255..2918a1197 100644 --- a/code/SIB/SIBImporter.h +++ b/code/SIB/SIBImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/SMD/SMDLoader.cpp b/code/SMD/SMDLoader.cpp index 7eb6b18d1..b7c98d68f 100644 --- a/code/SMD/SMDLoader.cpp +++ b/code/SMD/SMDLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -616,7 +616,7 @@ void SMDImporter::CreateOutputMaterials() { if (aszTextures[iMat].length()) { ::strncpy(szName.data, aszTextures[iMat].c_str(),MAXLEN-1); - szName.length = aszTextures[iMat].length(); + szName.length = (ai_uint32)aszTextures[iMat].length(); pcMat->AddProperty(&szName,AI_MATKEY_TEXTURE_DIFFUSE(0)); } } diff --git a/code/SMD/SMDLoader.h b/code/SMD/SMDLoader.h index 85dac97d1..85dafdebc 100644 --- a/code/SMD/SMDLoader.h +++ b/code/SMD/SMDLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/STL/STLExporter.cpp b/code/STL/STLExporter.cpp index 43bc752ae..06723cdba 100644 --- a/code/STL/STLExporter.cpp +++ b/code/STL/STLExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/STL/STLExporter.h b/code/STL/STLExporter.h index cb5238e60..92fd8a8ab 100644 --- a/code/STL/STLExporter.h +++ b/code/STL/STLExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/STL/STLLoader.cpp b/code/STL/STLLoader.cpp index 199a84a44..8155d5def 100644 --- a/code/STL/STLLoader.cpp +++ b/code/STL/STLLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/STL/STLLoader.h b/code/STL/STLLoader.h index ca1011cb8..d2f4d6e9c 100644 --- a/code/STL/STLLoader.h +++ b/code/STL/STLLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Step/STEPFile.h b/code/Step/STEPFile.h index d99b34b3c..040a4fa21 100644 --- a/code/Step/STEPFile.h +++ b/code/Step/STEPFile.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Step/StepExporter.cpp b/code/Step/StepExporter.cpp index 70035d9ea..56aedb96c 100644 --- a/code/Step/StepExporter.cpp +++ b/code/Step/StepExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Step/StepExporter.h b/code/Step/StepExporter.h index f96a0d2b5..683533854 100644 --- a/code/Step/StepExporter.h +++ b/code/Step/StepExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Terragen/TerragenLoader.cpp b/code/Terragen/TerragenLoader.cpp index 9b0873c68..d4a268a29 100644 --- a/code/Terragen/TerragenLoader.cpp +++ b/code/Terragen/TerragenLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/Terragen/TerragenLoader.h b/code/Terragen/TerragenLoader.h index a478c0dcd..81823fc74 100644 --- a/code/Terragen/TerragenLoader.h +++ b/code/Terragen/TerragenLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/Unreal/UnrealLoader.cpp b/code/Unreal/UnrealLoader.cpp index 0bd4650d0..d165d7d24 100644 --- a/code/Unreal/UnrealLoader.cpp +++ b/code/Unreal/UnrealLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team @@ -403,7 +403,7 @@ void UnrealImporter::InternReadFile( const std::string& pFile, // set color and name mat->AddProperty(&color,1,AI_MATKEY_COLOR_DIFFUSE); - s.length = ::strlen(s.data); + s.length = (ai_uint32)::strlen(s.data); mat->AddProperty(&s,AI_MATKEY_NAME); // set texture, if any diff --git a/code/Unreal/UnrealLoader.h b/code/Unreal/UnrealLoader.h index 678aaa76b..c00dfd34e 100644 --- a/code/Unreal/UnrealLoader.h +++ b/code/Unreal/UnrealLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/X/XFileExporter.cpp b/code/X/XFileExporter.cpp index ae9fd58fc..5b1c49eab 100644 --- a/code/X/XFileExporter.cpp +++ b/code/X/XFileExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/X/XFileExporter.h b/code/X/XFileExporter.h index 322440af8..42cadc407 100644 --- a/code/X/XFileExporter.h +++ b/code/X/XFileExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/X/XFileHelper.h b/code/X/XFileHelper.h index 0365280f0..461331921 100644 --- a/code/X/XFileHelper.h +++ b/code/X/XFileHelper.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/X/XFileImporter.cpp b/code/X/XFileImporter.cpp index be7256d5c..9b90c9da3 100644 --- a/code/X/XFileImporter.cpp +++ b/code/X/XFileImporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -211,7 +211,7 @@ aiNode* XFileImporter::CreateNodes( aiScene* pScene, aiNode* pParent, const XFil // create node aiNode* node = new aiNode; - node->mName.length = pNode->mName.length(); + node->mName.length = (ai_uint32)pNode->mName.length(); node->mParent = pParent; memcpy( node->mName.data, pNode->mName.c_str(), pNode->mName.length()); node->mName.data[node->mName.length] = 0; @@ -513,30 +513,36 @@ void XFileImporter::CreateAnimations( aiScene* pScene, const XFile::Scene* pData } else { // separate key sequences for position, rotation, scaling nbone->mNumPositionKeys = (unsigned int)bone->mPosKeys.size(); - nbone->mPositionKeys = new aiVectorKey[nbone->mNumPositionKeys]; - for( unsigned int c = 0; c < nbone->mNumPositionKeys; ++c ) { - aiVector3D pos = bone->mPosKeys[c].mValue; + if (nbone->mNumPositionKeys != 0) { + nbone->mPositionKeys = new aiVectorKey[nbone->mNumPositionKeys]; + for( unsigned int c = 0; c < nbone->mNumPositionKeys; ++c ) { + aiVector3D pos = bone->mPosKeys[c].mValue; - nbone->mPositionKeys[c].mTime = bone->mPosKeys[c].mTime; - nbone->mPositionKeys[c].mValue = pos; + nbone->mPositionKeys[c].mTime = bone->mPosKeys[c].mTime; + nbone->mPositionKeys[c].mValue = pos; + } } // rotation nbone->mNumRotationKeys = (unsigned int)bone->mRotKeys.size(); - nbone->mRotationKeys = new aiQuatKey[nbone->mNumRotationKeys]; - for( unsigned int c = 0; c < nbone->mNumRotationKeys; ++c ) { - aiMatrix3x3 rotmat = bone->mRotKeys[c].mValue.GetMatrix(); + if (nbone->mNumRotationKeys != 0) { + nbone->mRotationKeys = new aiQuatKey[nbone->mNumRotationKeys]; + for( unsigned int c = 0; c < nbone->mNumRotationKeys; ++c ) { + aiMatrix3x3 rotmat = bone->mRotKeys[c].mValue.GetMatrix(); - nbone->mRotationKeys[c].mTime = bone->mRotKeys[c].mTime; - nbone->mRotationKeys[c].mValue = aiQuaternion( rotmat); - nbone->mRotationKeys[c].mValue.w *= -1.0f; // needs quat inversion + nbone->mRotationKeys[c].mTime = bone->mRotKeys[c].mTime; + nbone->mRotationKeys[c].mValue = aiQuaternion( rotmat); + nbone->mRotationKeys[c].mValue.w *= -1.0f; // needs quat inversion + } } // scaling nbone->mNumScalingKeys = (unsigned int)bone->mScaleKeys.size(); - nbone->mScalingKeys = new aiVectorKey[nbone->mNumScalingKeys]; - for( unsigned int c = 0; c < nbone->mNumScalingKeys; c++) - nbone->mScalingKeys[c] = bone->mScaleKeys[c]; + if (nbone->mNumScalingKeys != 0) { + nbone->mScalingKeys = new aiVectorKey[nbone->mNumScalingKeys]; + for( unsigned int c = 0; c < nbone->mNumScalingKeys; c++) + nbone->mScalingKeys[c] = bone->mScaleKeys[c]; + } // longest lasting key sequence determines duration if( bone->mPosKeys.size() > 0) diff --git a/code/X/XFileImporter.h b/code/X/XFileImporter.h index 7d12b6fdf..31abb6c0f 100644 --- a/code/X/XFileImporter.h +++ b/code/X/XFileImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/X/XFileParser.cpp b/code/X/XFileParser.cpp index 8fcf87cf6..8847119c4 100644 --- a/code/X/XFileParser.cpp +++ b/code/X/XFileParser.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/code/X/XFileParser.h b/code/X/XFileParser.h index 993bae6a1..ea7aca266 100644 --- a/code/X/XFileParser.h +++ b/code/X/XFileParser.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/X3D/FIReader.cpp b/code/X3D/FIReader.cpp index 9bb2c69f6..359643440 100644 --- a/code/X3D/FIReader.cpp +++ b/code/X3D/FIReader.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/X3D/FIReader.hpp b/code/X3D/FIReader.hpp index 2c92239ac..e8b6c2f3a 100644 --- a/code/X3D/FIReader.hpp +++ b/code/X3D/FIReader.hpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/X3D/X3DImporter.cpp b/code/X3D/X3DImporter.cpp index 367d84fcf..c9f9a6b6d 100644 --- a/code/X3D/X3DImporter.cpp +++ b/code/X3D/X3DImporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/X3D/X3DImporter.hpp b/code/X3D/X3DImporter.hpp index a4afc1463..737a7f160 100644 --- a/code/X3D/X3DImporter.hpp +++ b/code/X3D/X3DImporter.hpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/X3D/X3DImporter_Geometry2D.cpp b/code/X3D/X3DImporter_Geometry2D.cpp index 350fd6c40..5879c3d50 100644 --- a/code/X3D/X3DImporter_Geometry2D.cpp +++ b/code/X3D/X3DImporter_Geometry2D.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/X3D/X3DImporter_Geometry3D.cpp b/code/X3D/X3DImporter_Geometry3D.cpp index e12cbd3ab..a6bad981a 100644 --- a/code/X3D/X3DImporter_Geometry3D.cpp +++ b/code/X3D/X3DImporter_Geometry3D.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/X3D/X3DImporter_Group.cpp b/code/X3D/X3DImporter_Group.cpp index de3610caf..d78778928 100644 --- a/code/X3D/X3DImporter_Group.cpp +++ b/code/X3D/X3DImporter_Group.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/X3D/X3DImporter_Light.cpp b/code/X3D/X3DImporter_Light.cpp index 842fffc04..5a482adcd 100644 --- a/code/X3D/X3DImporter_Light.cpp +++ b/code/X3D/X3DImporter_Light.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/X3D/X3DImporter_Macro.hpp b/code/X3D/X3DImporter_Macro.hpp index a6aca33fb..2463c7762 100644 --- a/code/X3D/X3DImporter_Macro.hpp +++ b/code/X3D/X3DImporter_Macro.hpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/X3D/X3DImporter_Metadata.cpp b/code/X3D/X3DImporter_Metadata.cpp index f888ac2b9..126eddb4c 100644 --- a/code/X3D/X3DImporter_Metadata.cpp +++ b/code/X3D/X3DImporter_Metadata.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/X3D/X3DImporter_Networking.cpp b/code/X3D/X3DImporter_Networking.cpp index a7a200675..688362ab9 100644 --- a/code/X3D/X3DImporter_Networking.cpp +++ b/code/X3D/X3DImporter_Networking.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/X3D/X3DImporter_Node.hpp b/code/X3D/X3DImporter_Node.hpp index 85208223d..ebc5200c3 100644 --- a/code/X3D/X3DImporter_Node.hpp +++ b/code/X3D/X3DImporter_Node.hpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/X3D/X3DImporter_Postprocess.cpp b/code/X3D/X3DImporter_Postprocess.cpp index 539563fcf..a8bc1a00c 100644 --- a/code/X3D/X3DImporter_Postprocess.cpp +++ b/code/X3D/X3DImporter_Postprocess.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/X3D/X3DImporter_Rendering.cpp b/code/X3D/X3DImporter_Rendering.cpp index 6e95c9441..a574d5549 100644 --- a/code/X3D/X3DImporter_Rendering.cpp +++ b/code/X3D/X3DImporter_Rendering.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/X3D/X3DImporter_Shape.cpp b/code/X3D/X3DImporter_Shape.cpp index 126d5905a..189ed145d 100644 --- a/code/X3D/X3DImporter_Shape.cpp +++ b/code/X3D/X3DImporter_Shape.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/X3D/X3DImporter_Texturing.cpp b/code/X3D/X3DImporter_Texturing.cpp index 2eaf3e6bc..0f8c75c41 100644 --- a/code/X3D/X3DImporter_Texturing.cpp +++ b/code/X3D/X3DImporter_Texturing.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/X3D/X3DVocabulary.cpp b/code/X3D/X3DVocabulary.cpp index c6ee113b3..b985a0d14 100644 --- a/code/X3D/X3DVocabulary.cpp +++ b/code/X3D/X3DVocabulary.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/XGL/XGLLoader.cpp b/code/XGL/XGLLoader.cpp index 32cfd72ca..403205e03 100644 --- a/code/XGL/XGLLoader.cpp +++ b/code/XGL/XGLLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team @@ -685,7 +685,7 @@ bool XGLImporter::ReadMesh(TempScope& scope) } // finally extract output meshes and add them to the scope - typedef std::pair pairt; + typedef std::pair pairt; for(const pairt& p : bymat) { aiMesh* const m = ToOutputMesh(p.second); scope.meshes_linear.push_back(m); diff --git a/code/XGL/XGLLoader.h b/code/XGL/XGLLoader.h index bba2a643c..f227c5f0f 100644 --- a/code/XGL/XGLLoader.h +++ b/code/XGL/XGLLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/glTF/glTFAsset.h b/code/glTF/glTFAsset.h index 38b0951da..d0b72703e 100644 --- a/code/glTF/glTFAsset.h +++ b/code/glTF/glTFAsset.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/glTF/glTFAsset.inl b/code/glTF/glTFAsset.inl index 500d49fcb..00456edbf 100644 --- a/code/glTF/glTFAsset.inl +++ b/code/glTF/glTFAsset.inl @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -688,7 +688,9 @@ inline void Image::SetData(uint8_t* data, size_t length, Asset& r) bufferView->byteOffset = b->AppendData(data, length); } else { // text file: will be stored as a data uri - this->mData.reset(data); + uint8_t *temp = new uint8_t[length]; + memcpy(temp, data, length); + this->mData.reset(temp); this->mDataLength = length; } } diff --git a/code/glTF/glTFAssetWriter.h b/code/glTF/glTFAssetWriter.h index 03aee7d4c..f166ee532 100644 --- a/code/glTF/glTFAssetWriter.h +++ b/code/glTF/glTFAssetWriter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/glTF/glTFAssetWriter.inl b/code/glTF/glTFAssetWriter.inl index a3c99a9a8..784264488 100644 --- a/code/glTF/glTFAssetWriter.inl +++ b/code/glTF/glTFAssetWriter.inl @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -627,6 +627,9 @@ namespace glTF { asset.SetObject(); asset.AddMember("version", Value(mAsset.asset.version, mAl).Move(), mAl); asset.AddMember("generator", Value(mAsset.asset.generator, mAl).Move(), mAl); + if (!mAsset.asset.copyright.empty()) + asset.AddMember("copyright", Value(mAsset.asset.copyright, mAl).Move(), mAl); + mDoc.AddMember("asset", asset, mAl); } diff --git a/code/glTF/glTFCommon.cpp b/code/glTF/glTFCommon.cpp index cd03224e4..9fac8de2d 100644 --- a/code/glTF/glTFCommon.cpp +++ b/code/glTF/glTFCommon.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/glTF/glTFCommon.h b/code/glTF/glTFCommon.h index b2e28d580..d942b4ba8 100644 --- a/code/glTF/glTFCommon.h +++ b/code/glTF/glTFCommon.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/glTF/glTFExporter.cpp b/code/glTF/glTFExporter.cpp index 3faa1a84b..3caea7de9 100644 --- a/code/glTF/glTFExporter.cpp +++ b/code/glTF/glTFExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -46,6 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "glTF/glTFAssetWriter.h" #include "PostProcessing/SplitLargeMeshes.h" +#include #include #include #include @@ -99,17 +100,16 @@ glTFExporter::glTFExporter(const char* filename, IOSystem* pIOSystem, const aiSc { aiScene* sceneCopy_tmp; SceneCombiner::CopyScene(&sceneCopy_tmp, pScene); - aiScene *sceneCopy(sceneCopy_tmp); SplitLargeMeshesProcess_Triangle tri_splitter; tri_splitter.SetLimit(0xffff); - tri_splitter.Execute(sceneCopy); + tri_splitter.Execute(sceneCopy_tmp); SplitLargeMeshesProcess_Vertex vert_splitter; vert_splitter.SetLimit(0xffff); - vert_splitter.Execute(sceneCopy); + vert_splitter.Execute(sceneCopy_tmp); - mScene = sceneCopy; + mScene.reset(sceneCopy_tmp); mAsset.reset( new glTF::Asset( pIOSystem ) ); @@ -869,10 +869,16 @@ void glTFExporter::ExportMetadata() asset.version = "1.0"; char buffer[256]; - ai_snprintf(buffer, 256, "Open Asset Import Library (assimp v%d.%d.%d)", + ai_snprintf(buffer, 256, "Open Asset Import Library (assimp v%d.%d.%x)", aiGetVersionMajor(), aiGetVersionMinor(), aiGetVersionRevision()); asset.generator = buffer; + + // Copyright + aiString copyright_str; + if (mScene->mMetaData != nullptr && mScene->mMetaData->Get(AI_METADATA_SOURCE_COPYRIGHT, copyright_str)) { + asset.copyright = copyright_str.C_Str(); + } } inline void ExtractAnimationData(Asset& mAsset, std::string& animId, Ref& animRef, Ref& buffer, const aiNodeAnim* nodeChannel, float ticksPerSecond) diff --git a/code/glTF/glTFExporter.h b/code/glTF/glTFExporter.h index d6c2e7f04..415992314 100644 --- a/code/glTF/glTFExporter.h +++ b/code/glTF/glTFExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -90,7 +90,7 @@ namespace Assimp const char* mFilename; IOSystem* mIOSystem; - const aiScene* mScene; + std::shared_ptr mScene; const ExportProperties* mProperties; std::map mTexturesByPath; diff --git a/code/glTF/glTFImporter.cpp b/code/glTF/glTFImporter.cpp index 59e7d9b92..45c0e42a9 100644 --- a/code/glTF/glTFImporter.cpp +++ b/code/glTF/glTFImporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -703,7 +703,8 @@ void glTFImporter::ImportCommonMetadata(glTF::Asset& a) ai_assert(mScene->mMetaData == nullptr); const bool hasVersion = !a.asset.version.empty(); const bool hasGenerator = !a.asset.generator.empty(); - if (hasVersion || hasGenerator) + const bool hasCopyright = !a.asset.copyright.empty(); + if (hasVersion || hasGenerator || hasCopyright) { mScene->mMetaData = new aiMetadata; if (hasVersion) @@ -714,6 +715,10 @@ void glTFImporter::ImportCommonMetadata(glTF::Asset& a) { mScene->mMetaData->Add(AI_METADATA_SOURCE_GENERATOR, aiString(a.asset.generator)); } + if (hasCopyright) + { + mScene->mMetaData->Add(AI_METADATA_SOURCE_COPYRIGHT, aiString(a.asset.copyright)); + } } } diff --git a/code/glTF/glTFImporter.h b/code/glTF/glTFImporter.h index 84d74009b..a1e746808 100644 --- a/code/glTF/glTFImporter.h +++ b/code/glTF/glTFImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/glTF2/glTF2Asset.h b/code/glTF2/glTF2Asset.h index ee8818b56..53774de7a 100644 --- a/code/glTF2/glTF2Asset.h +++ b/code/glTF2/glTF2Asset.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/glTF2/glTF2Asset.inl b/code/glTF2/glTF2Asset.inl index e55857be1..35ecfa62d 100644 --- a/code/glTF2/glTF2Asset.inl +++ b/code/glTF2/glTF2Asset.inl @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -752,6 +752,7 @@ inline uint8_t* Image::StealData() return mData.release(); } +// Never take over the ownership of data whenever binary or not inline void Image::SetData(uint8_t* data, size_t length, Asset& r) { Ref b = r.GetBodyBuffer(); @@ -764,8 +765,10 @@ inline void Image::SetData(uint8_t* data, size_t length, Asset& r) bufferView->byteOffset = b->AppendData(data, length); } else { // text file: will be stored as a data uri - this->mData.reset(data); - this->mDataLength = length; + uint8_t *temp = new uint8_t[length]; + memcpy(temp, data, length); + this->mData.reset(temp); + this->mDataLength = length; } } diff --git a/code/glTF2/glTF2AssetWriter.h b/code/glTF2/glTF2AssetWriter.h index 928b6e71b..784ab2ea5 100644 --- a/code/glTF2/glTF2AssetWriter.h +++ b/code/glTF2/glTF2AssetWriter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/glTF2/glTF2AssetWriter.inl b/code/glTF2/glTF2AssetWriter.inl index 8ba4aa10b..02c14980d 100644 --- a/code/glTF2/glTF2AssetWriter.inl +++ b/code/glTF2/glTF2AssetWriter.inl @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -720,6 +720,8 @@ namespace glTF2 { asset.SetObject(); asset.AddMember("version", Value(mAsset.asset.version, mAl).Move(), mAl); asset.AddMember("generator", Value(mAsset.asset.generator, mAl).Move(), mAl); + if (!mAsset.asset.copyright.empty()) + asset.AddMember("copyright", Value(mAsset.asset.copyright, mAl).Move(), mAl); mDoc.AddMember("asset", asset, mAl); } diff --git a/code/glTF2/glTF2Exporter.cpp b/code/glTF2/glTF2Exporter.cpp index f85803b52..7a7d581cb 100644 --- a/code/glTF2/glTF2Exporter.cpp +++ b/code/glTF2/glTF2Exporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -46,6 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "glTF2/glTF2AssetWriter.h" #include "PostProcessing/SplitLargeMeshes.h" +#include #include #include #include @@ -351,10 +352,8 @@ void glTF2Exporter::GetMatTex(const aiMaterial* mat, Ref& texture, aiTe if (path[0] == '*') { // embedded aiTexture* tex = mScene->mTextures[atoi(&path[1])]; - // copy data since lifetime control is handed over to the asset - uint8_t* data = new uint8_t[tex->mWidth]; - memcpy(data, tex->pcData, tex->mWidth); - texture->source->SetData(data, tex->mWidth, *mAsset); + // The asset has its own buffer, see Image::SetData + texture->source->SetData(reinterpret_cast (tex->pcData), tex->mWidth, *mAsset); if (tex->achFormatHint[0]) { std::string mimeType = "image/"; @@ -992,10 +991,16 @@ void glTF2Exporter::ExportMetadata() asset.version = "2.0"; char buffer[256]; - ai_snprintf(buffer, 256, "Open Asset Import Library (assimp v%d.%d.%d)", + ai_snprintf(buffer, 256, "Open Asset Import Library (assimp v%d.%d.%x)", aiGetVersionMajor(), aiGetVersionMinor(), aiGetVersionRevision()); asset.generator = buffer; + + // Copyright + aiString copyright_str; + if (mScene->mMetaData != nullptr && mScene->mMetaData->Get(AI_METADATA_SOURCE_COPYRIGHT, copyright_str)) { + asset.copyright = copyright_str.C_Str(); + } } inline Ref GetSamplerInputRef(Asset& asset, std::string& animId, Ref& buffer, std::vector& times) diff --git a/code/glTF2/glTF2Exporter.h b/code/glTF2/glTF2Exporter.h index b527c4bc9..421a4806e 100644 --- a/code/glTF2/glTF2Exporter.h +++ b/code/glTF2/glTF2Exporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/glTF2/glTF2Importer.cpp b/code/glTF2/glTF2Importer.cpp index 72c5ec373..e5052d4d6 100644 --- a/code/glTF2/glTF2Importer.cpp +++ b/code/glTF2/glTF2Importer.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -139,45 +139,6 @@ static aiTextureMapMode ConvertWrappingMode(SamplerWrap gltfWrapMode) { } } -/*static void CopyValue(const glTF2::vec3& v, aiColor3D& out) -{ - out.r = v[0]; out.g = v[1]; out.b = v[2]; -} - - -static void CopyValue(const glTF2::vec4& v, aiColor4D& out) -{ - out.r = v[0]; out.g = v[1]; out.b = v[2]; out.a = v[3]; -}*/ - -/*static void CopyValue(const glTF2::vec4& v, aiColor3D& out) -{ - out.r = v[0]; out.g = v[1]; out.b = v[2]; -}*/ - -/*static void CopyValue(const glTF2::vec3& v, aiColor4D& out) -{ - out.r = v[0]; out.g = v[1]; out.b = v[2]; out.a = 1.0; -} - -static void CopyValue(const glTF2::vec3& v, aiVector3D& out) -{ - out.x = v[0]; out.y = v[1]; out.z = v[2]; -} - -static void CopyValue(const glTF2::vec4& v, aiQuaternion& out) -{ - out.x = v[0]; out.y = v[1]; out.z = v[2]; out.w = v[3]; -}*/ - -/*static void CopyValue(const glTF2::mat4& v, aiMatrix4x4& o) -{ - o.a1 = v[ 0]; o.b1 = v[ 1]; o.c1 = v[ 2]; o.d1 = v[ 3]; - o.a2 = v[ 4]; o.b2 = v[ 5]; o.c2 = v[ 6]; o.d2 = v[ 7]; - o.a3 = v[ 8]; o.b3 = v[ 9]; o.c3 = v[10]; o.d3 = v[11]; - o.a4 = v[12]; o.b4 = v[13]; o.c4 = v[14]; o.d4 = v[15]; -}*/ - inline void SetMaterialColorProperty(Asset & /*r*/, vec4 &prop, aiMaterial *mat, const char *pKey, unsigned int type, unsigned int idx) { aiColor4D col; CopyValue(prop, col); @@ -218,8 +179,8 @@ inline void SetMaterialTextureProperty(std::vector &embeddedTexIdxs, Asset // coordinate of the actual meshes during import. const ai_real rcos(cos(-transform.mRotation)); const ai_real rsin(sin(-transform.mRotation)); - transform.mTranslation.x = (0.5 * transform.mScaling.x) * (-rcos + rsin + 1) + prop.TextureTransformExt_t.offset[0]; - transform.mTranslation.y = ((0.5 * transform.mScaling.y) * (rsin + rcos - 1)) + 1 - transform.mScaling.y - prop.TextureTransformExt_t.offset[1];; + transform.mTranslation.x = (static_cast( 0.5 ) * transform.mScaling.x) * (-rcos + rsin + 1) + prop.TextureTransformExt_t.offset[0]; + transform.mTranslation.y = ((static_cast( 0.5 ) * transform.mScaling.y) * (rsin + rcos - 1)) + 1 - transform.mScaling.y - prop.TextureTransformExt_t.offset[1];; mat->AddProperty(&transform, 1, _AI_MATKEY_UVTRANSFORM_BASE, texType, texSlot); } @@ -512,7 +473,7 @@ void glTF2Importer::ImportMeshes(glTF2::Asset &r) { } } - aiFace *faces = 0; + aiFace *faces = nullptr; size_t nFaces = 0; if (prim.indices) { @@ -674,7 +635,7 @@ void glTF2Importer::ImportMeshes(glTF2::Asset &r) { } } - if (faces) { + if (nullptr != faces) { aim->mFaces = faces; aim->mNumFaces = static_cast(nFaces); ai_assert(CheckValidFacesIndices(faces, static_cast(nFaces), aim->mNumVertices)); @@ -981,7 +942,9 @@ aiNode *ImportNode(aiScene *pScene, glTF2::Asset &r, std::vector & } void glTF2Importer::ImportNodes(glTF2::Asset &r) { - if (!r.scene) return; + if (!r.scene) { + return; + } std::vector> rootNodes = r.scene->nodes; @@ -1292,7 +1255,9 @@ void glTF2Importer::ImportEmbeddedTextures(glTF2::Asset &r) { if (!img.mimeType.empty()) { const char *ext = strchr(img.mimeType.c_str(), '/') + 1; if (ext) { - if (strcmp(ext, "jpeg") == 0) ext = "jpg"; + if (strcmp(ext, "jpeg") == 0) { + ext = "jpg"; + } size_t len = strlen(ext); if (len <= 3) { @@ -1307,17 +1272,18 @@ void glTF2Importer::ImportCommonMetadata(glTF2::Asset& a) { ai_assert(mScene->mMetaData == nullptr); const bool hasVersion = !a.asset.version.empty(); const bool hasGenerator = !a.asset.generator.empty(); - if (hasVersion || hasGenerator) - { + const bool hasCopyright = !a.asset.copyright.empty(); + if (hasVersion || hasGenerator || hasCopyright) { mScene->mMetaData = new aiMetadata; - if (hasVersion) - { + if (hasVersion) { mScene->mMetaData->Add(AI_METADATA_SOURCE_FORMAT_VERSION, aiString(a.asset.version)); } - if (hasGenerator) - { + if (hasGenerator) { mScene->mMetaData->Add(AI_METADATA_SOURCE_GENERATOR, aiString(a.asset.generator)); } + if (hasCopyright) { + mScene->mMetaData->Add(AI_METADATA_SOURCE_COPYRIGHT, aiString(a.asset.copyright)); + } } } diff --git a/code/glTF2/glTF2Importer.h b/code/glTF2/glTF2Importer.h index e62c38d21..5a093a662 100644 --- a/code/glTF2/glTF2Importer.h +++ b/code/glTF2/glTF2Importer.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/code/res/assimp.rc b/code/res/assimp.rc index daecf9cf5..9ae821b4b 100644 --- a/code/res/assimp.rc +++ b/code/res/assimp.rc @@ -52,7 +52,7 @@ BEGIN VALUE "FileDescription", "Open Asset Import Library" VALUE "FileVersion", VER_FILEVERSION VALUE "InternalName", "assimp " - VALUE "LegalCopyright", "Copyright (C) 2006-2019" + VALUE "LegalCopyright", "Copyright (C) 2006-2020" VALUE "OriginalFilename", VER_ORIGINAL_FILENAME_STR VALUE "ProductName", "Open Asset Import Library" VALUE "ProductVersion", VER_FILEVERSION_STR diff --git a/doc/Preamble.txt b/doc/Preamble.txt index 102b2792d..11759eabd 100644 --- a/doc/Preamble.txt +++ b/doc/Preamble.txt @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2017, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/BaseImporter.h b/include/assimp/BaseImporter.h index ad8a3dafd..7cf835174 100644 --- a/include/assimp/BaseImporter.h +++ b/include/assimp/BaseImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/Bitmap.h b/include/assimp/Bitmap.h index 4c3f5a437..d0d94a6eb 100644 --- a/include/assimp/Bitmap.h +++ b/include/assimp/Bitmap.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/BlobIOSystem.h b/include/assimp/BlobIOSystem.h index d005e5c11..30d9b1ac3 100644 --- a/include/assimp/BlobIOSystem.h +++ b/include/assimp/BlobIOSystem.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/ByteSwapper.h b/include/assimp/ByteSwapper.h index 3f14c471a..7af78b61c 100644 --- a/include/assimp/ByteSwapper.h +++ b/include/assimp/ByteSwapper.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/CreateAnimMesh.h b/include/assimp/CreateAnimMesh.h index 1266d1de1..01a118ba3 100644 --- a/include/assimp/CreateAnimMesh.h +++ b/include/assimp/CreateAnimMesh.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/DefaultIOStream.h b/include/assimp/DefaultIOStream.h index c6d382c1b..05780def7 100644 --- a/include/assimp/DefaultIOStream.h +++ b/include/assimp/DefaultIOStream.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/DefaultIOSystem.h b/include/assimp/DefaultIOSystem.h index 46f6d447c..75dd97e7f 100644 --- a/include/assimp/DefaultIOSystem.h +++ b/include/assimp/DefaultIOSystem.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/DefaultLogger.hpp b/include/assimp/DefaultLogger.hpp index 1946e250a..789072a7c 100644 --- a/include/assimp/DefaultLogger.hpp +++ b/include/assimp/DefaultLogger.hpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/Defines.h b/include/assimp/Defines.h index be3e2fafd..959e4b1fb 100644 --- a/include/assimp/Defines.h +++ b/include/assimp/Defines.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/include/assimp/Exceptional.h b/include/assimp/Exceptional.h index f0d23d0f3..dcd5e2b2e 100644 --- a/include/assimp/Exceptional.h +++ b/include/assimp/Exceptional.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2008, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/include/assimp/Exporter.hpp b/include/assimp/Exporter.hpp index 20e7c6c6f..dc6661c11 100644 --- a/include/assimp/Exporter.hpp +++ b/include/assimp/Exporter.hpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/GenericProperty.h b/include/assimp/GenericProperty.h index 7796d595b..30f4988f9 100644 --- a/include/assimp/GenericProperty.h +++ b/include/assimp/GenericProperty.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/Hash.h b/include/assimp/Hash.h index 905644078..7c360b474 100644 --- a/include/assimp/Hash.h +++ b/include/assimp/Hash.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/IOStream.hpp b/include/assimp/IOStream.hpp index 39932cd94..c3271d007 100644 --- a/include/assimp/IOStream.hpp +++ b/include/assimp/IOStream.hpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/IOStreamBuffer.h b/include/assimp/IOStreamBuffer.h index 97c84b23e..6ca9be84a 100644 --- a/include/assimp/IOStreamBuffer.h +++ b/include/assimp/IOStreamBuffer.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/IOSystem.hpp b/include/assimp/IOSystem.hpp index f1fb3b0c2..291cd938f 100644 --- a/include/assimp/IOSystem.hpp +++ b/include/assimp/IOSystem.hpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/Importer.hpp b/include/assimp/Importer.hpp index bf449a9a2..7ec4f519c 100644 --- a/include/assimp/Importer.hpp +++ b/include/assimp/Importer.hpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/LineSplitter.h b/include/assimp/LineSplitter.h index 2fa61cba7..869585d92 100644 --- a/include/assimp/LineSplitter.h +++ b/include/assimp/LineSplitter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/LogAux.h b/include/assimp/LogAux.h index bcead78dd..2265ff19c 100644 --- a/include/assimp/LogAux.h +++ b/include/assimp/LogAux.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/LogStream.hpp b/include/assimp/LogStream.hpp index d0281e2d0..243f13ee6 100644 --- a/include/assimp/LogStream.hpp +++ b/include/assimp/LogStream.hpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/Logger.hpp b/include/assimp/Logger.hpp index 89cade6c3..a0b798564 100644 --- a/include/assimp/Logger.hpp +++ b/include/assimp/Logger.hpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/MathFunctions.h b/include/assimp/MathFunctions.h index b6c5872a7..1880ce0a9 100644 --- a/include/assimp/MathFunctions.h +++ b/include/assimp/MathFunctions.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2016, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/MemoryIOWrapper.h b/include/assimp/MemoryIOWrapper.h index 5598d4fc5..2ad80cc85 100644 --- a/include/assimp/MemoryIOWrapper.h +++ b/include/assimp/MemoryIOWrapper.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/NullLogger.hpp b/include/assimp/NullLogger.hpp index c45d01bd4..7effca83a 100644 --- a/include/assimp/NullLogger.hpp +++ b/include/assimp/NullLogger.hpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/ParsingUtils.h b/include/assimp/ParsingUtils.h index 302560124..736952e26 100644 --- a/include/assimp/ParsingUtils.h +++ b/include/assimp/ParsingUtils.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/Profiler.h b/include/assimp/Profiler.h index 624029be9..ee6c5545f 100644 --- a/include/assimp/Profiler.h +++ b/include/assimp/Profiler.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/ProgressHandler.hpp b/include/assimp/ProgressHandler.hpp index 8991a6461..45d3f57cd 100644 --- a/include/assimp/ProgressHandler.hpp +++ b/include/assimp/ProgressHandler.hpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/RemoveComments.h b/include/assimp/RemoveComments.h index f12942053..5bb958257 100644 --- a/include/assimp/RemoveComments.h +++ b/include/assimp/RemoveComments.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/SGSpatialSort.h b/include/assimp/SGSpatialSort.h index fdb5ce817..9afe38f85 100644 --- a/include/assimp/SGSpatialSort.h +++ b/include/assimp/SGSpatialSort.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/SceneCombiner.h b/include/assimp/SceneCombiner.h index 0683c1e05..40aad0890 100644 --- a/include/assimp/SceneCombiner.h +++ b/include/assimp/SceneCombiner.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/SkeletonMeshBuilder.h b/include/assimp/SkeletonMeshBuilder.h index ad979a33f..8e1a9830f 100644 --- a/include/assimp/SkeletonMeshBuilder.h +++ b/include/assimp/SkeletonMeshBuilder.h @@ -4,7 +4,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/SmoothingGroups.h b/include/assimp/SmoothingGroups.h index c1a93947f..5d37f1bb5 100644 --- a/include/assimp/SmoothingGroups.h +++ b/include/assimp/SmoothingGroups.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/SmoothingGroups.inl b/include/assimp/SmoothingGroups.inl index 37ea083db..417ca4312 100644 --- a/include/assimp/SmoothingGroups.inl +++ b/include/assimp/SmoothingGroups.inl @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/SpatialSort.h b/include/assimp/SpatialSort.h index 9f9354315..c2d8bbbf8 100644 --- a/include/assimp/SpatialSort.h +++ b/include/assimp/SpatialSort.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/StandardShapes.h b/include/assimp/StandardShapes.h index c594cb63f..79bdae859 100644 --- a/include/assimp/StandardShapes.h +++ b/include/assimp/StandardShapes.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/StreamReader.h b/include/assimp/StreamReader.h index cb24f1595..4cad96f6e 100644 --- a/include/assimp/StreamReader.h +++ b/include/assimp/StreamReader.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/StreamWriter.h b/include/assimp/StreamWriter.h index 489e8adfe..de889b9f0 100644 --- a/include/assimp/StreamWriter.h +++ b/include/assimp/StreamWriter.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/StringComparison.h b/include/assimp/StringComparison.h index d3ca3e971..d7b8972e3 100644 --- a/include/assimp/StringComparison.h +++ b/include/assimp/StringComparison.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/StringUtils.h b/include/assimp/StringUtils.h index af481f819..31410a9fb 100644 --- a/include/assimp/StringUtils.h +++ b/include/assimp/StringUtils.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/Subdivision.h b/include/assimp/Subdivision.h index e9450267e..9a8bb9fd3 100644 --- a/include/assimp/Subdivision.h +++ b/include/assimp/Subdivision.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/TinyFormatter.h b/include/assimp/TinyFormatter.h index 6227e42c5..3c6ca66c6 100644 --- a/include/assimp/TinyFormatter.h +++ b/include/assimp/TinyFormatter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/Vertex.h b/include/assimp/Vertex.h index 5e63db5fe..5d4242cbd 100644 --- a/include/assimp/Vertex.h +++ b/include/assimp/Vertex.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/XMLTools.h b/include/assimp/XMLTools.h index 95f12cdeb..845851308 100644 --- a/include/assimp/XMLTools.h +++ b/include/assimp/XMLTools.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/ZipArchiveIOSystem.h b/include/assimp/ZipArchiveIOSystem.h index 516ea84de..b0541fa59 100644 --- a/include/assimp/ZipArchiveIOSystem.h +++ b/include/assimp/ZipArchiveIOSystem.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/aabb.h b/include/assimp/aabb.h index 83bb62256..27a142c8e 100644 --- a/include/assimp/aabb.h +++ b/include/assimp/aabb.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/ai_assert.h b/include/assimp/ai_assert.h index 2b32b01d3..f430e4ad3 100644 --- a/include/assimp/ai_assert.h +++ b/include/assimp/ai_assert.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/anim.h b/include/assimp/anim.h index e208b11ad..a7af1034f 100644 --- a/include/assimp/anim.h +++ b/include/assimp/anim.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/camera.h b/include/assimp/camera.h index adb749ff5..2001a9354 100644 --- a/include/assimp/camera.h +++ b/include/assimp/camera.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/cexport.h b/include/assimp/cexport.h index cbc0253d5..959d4377e 100644 --- a/include/assimp/cexport.h +++ b/include/assimp/cexport.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/cfileio.h b/include/assimp/cfileio.h index be90999d8..627c700ad 100644 --- a/include/assimp/cfileio.h +++ b/include/assimp/cfileio.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/cimport.h b/include/assimp/cimport.h index 66b1c9a17..dab60584b 100644 --- a/include/assimp/cimport.h +++ b/include/assimp/cimport.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/color4.h b/include/assimp/color4.h index fa86128f4..505a3510c 100644 --- a/include/assimp/color4.h +++ b/include/assimp/color4.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/color4.inl b/include/assimp/color4.inl index d4a2a9810..964b8fbf9 100644 --- a/include/assimp/color4.inl +++ b/include/assimp/color4.inl @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/commonMetaData.h b/include/assimp/commonMetaData.h index 1e176725e..f3f7d170a 100644 --- a/include/assimp/commonMetaData.h +++ b/include/assimp/commonMetaData.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team @@ -60,4 +60,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /// Not all formats add this metadata. #define AI_METADATA_SOURCE_GENERATOR "SourceAsset_Generator" +/// Scene metadata holding the source asset copyright statement, if available. +/// Not all formats add this metadata. +#define AI_METADATA_SOURCE_COPYRIGHT "SourceAsset_Copyright" + #endif diff --git a/include/assimp/config.h.in b/include/assimp/config.h.in index 76682b0eb..e2f2a3888 100644 --- a/include/assimp/config.h.in +++ b/include/assimp/config.h.in @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/defs.h b/include/assimp/defs.h index d8fc98179..8e300e968 100644 --- a/include/assimp/defs.h +++ b/include/assimp/defs.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/importerdesc.h b/include/assimp/importerdesc.h index 0a6919c1a..e0f22a9d6 100644 --- a/include/assimp/importerdesc.h +++ b/include/assimp/importerdesc.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/irrXMLWrapper.h b/include/assimp/irrXMLWrapper.h index 77cfd5e47..65a7be298 100644 --- a/include/assimp/irrXMLWrapper.h +++ b/include/assimp/irrXMLWrapper.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/light.h b/include/assimp/light.h index bdb2368c4..84f2f7d0a 100644 --- a/include/assimp/light.h +++ b/include/assimp/light.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/material.h b/include/assimp/material.h index 19a7c6970..6c864e3d4 100644 --- a/include/assimp/material.h +++ b/include/assimp/material.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/material.inl b/include/assimp/material.inl index 8ae6b88d3..759134441 100644 --- a/include/assimp/material.inl +++ b/include/assimp/material.inl @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/matrix3x3.h b/include/assimp/matrix3x3.h index 2c26cf92b..f9880ab9e 100644 --- a/include/assimp/matrix3x3.h +++ b/include/assimp/matrix3x3.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/matrix3x3.inl b/include/assimp/matrix3x3.inl index 1ce8c9691..b11e036b1 100644 --- a/include/assimp/matrix3x3.inl +++ b/include/assimp/matrix3x3.inl @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/matrix4x4.h b/include/assimp/matrix4x4.h index 8fc216f66..456d285e6 100644 --- a/include/assimp/matrix4x4.h +++ b/include/assimp/matrix4x4.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/matrix4x4.inl b/include/assimp/matrix4x4.inl index 84079974f..e8a3c5305 100644 --- a/include/assimp/matrix4x4.inl +++ b/include/assimp/matrix4x4.inl @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/mesh.h b/include/assimp/mesh.h index fbf2a857a..8fd8c7f87 100644 --- a/include/assimp/mesh.h +++ b/include/assimp/mesh.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/metadata.h b/include/assimp/metadata.h index f3a5321d3..bddd04b1e 100644 --- a/include/assimp/metadata.h +++ b/include/assimp/metadata.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/pbrmaterial.h b/include/assimp/pbrmaterial.h index 892a6347f..cac4ab56b 100644 --- a/include/assimp/pbrmaterial.h +++ b/include/assimp/pbrmaterial.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/port/AndroidJNI/AndroidJNIIOSystem.h b/include/assimp/port/AndroidJNI/AndroidJNIIOSystem.h index 41d800487..01505d571 100644 --- a/include/assimp/port/AndroidJNI/AndroidJNIIOSystem.h +++ b/include/assimp/port/AndroidJNI/AndroidJNIIOSystem.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2016, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/include/assimp/postprocess.h b/include/assimp/postprocess.h index 4b6732e80..9997f0d60 100644 --- a/include/assimp/postprocess.h +++ b/include/assimp/postprocess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/qnan.h b/include/assimp/qnan.h index 06780da5b..5ca80601d 100644 --- a/include/assimp/qnan.h +++ b/include/assimp/qnan.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/quaternion.h b/include/assimp/quaternion.h index ae45959b4..fd9abfd21 100644 --- a/include/assimp/quaternion.h +++ b/include/assimp/quaternion.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/include/assimp/quaternion.inl b/include/assimp/quaternion.inl index 3ce514d1b..e8bdb9aeb 100644 --- a/include/assimp/quaternion.inl +++ b/include/assimp/quaternion.inl @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/scene.h b/include/assimp/scene.h index b76709eb1..93d04eee6 100644 --- a/include/assimp/scene.h +++ b/include/assimp/scene.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/texture.h b/include/assimp/texture.h index 0867659f4..5a4486431 100644 --- a/include/assimp/texture.h +++ b/include/assimp/texture.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -207,8 +207,7 @@ struct aiTexture { , mHeight(0) , pcData(nullptr) , mFilename() { - achFormatHint[0] = achFormatHint[1] = 0; - achFormatHint[2] = achFormatHint[3] = 0; + memset(achFormatHint, 0, sizeof(achFormatHint)); } // Destruction diff --git a/include/assimp/types.h b/include/assimp/types.h index e32cae331..1f47dad8f 100644 --- a/include/assimp/types.h +++ b/include/assimp/types.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/vector2.h b/include/assimp/vector2.h index c8b1ebbbc..a23e32e63 100644 --- a/include/assimp/vector2.h +++ b/include/assimp/vector2.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/vector2.inl b/include/assimp/vector2.inl index 4bbf432ff..19dbce291 100644 --- a/include/assimp/vector2.inl +++ b/include/assimp/vector2.inl @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/vector3.h b/include/assimp/vector3.h index fffeb12ad..8d3c82cf8 100644 --- a/include/assimp/vector3.h +++ b/include/assimp/vector3.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/vector3.inl b/include/assimp/vector3.inl index 6682d3b32..2765115a2 100644 --- a/include/assimp/vector3.inl +++ b/include/assimp/vector3.inl @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/include/assimp/version.h b/include/assimp/version.h index 90645a38f..6709eaf39 100644 --- a/include/assimp/version.h +++ b/include/assimp/version.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/packaging/windows-innosetup/LICENSE.rtf b/packaging/windows-innosetup/LICENSE.rtf index 48b00deab..d2e700fcd 100644 Binary files a/packaging/windows-innosetup/LICENSE.rtf and b/packaging/windows-innosetup/LICENSE.rtf differ diff --git a/port/AndroidJNI/AndroidJNIIOSystem.cpp b/port/AndroidJNI/AndroidJNIIOSystem.cpp index e276ea59f..db499a20b 100644 --- a/port/AndroidJNI/AndroidJNIIOSystem.cpp +++ b/port/AndroidJNI/AndroidJNIIOSystem.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2016, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/PyAssimp/gen/materialgen.py b/port/PyAssimp/gen/materialgen.py index d60bf4bc2..ef32d8e1c 100644 --- a/port/PyAssimp/gen/materialgen.py +++ b/port/PyAssimp/gen/materialgen.py @@ -5,7 +5,7 @@ # Open Asset Import Library (ASSIMP) # --------------------------------------------------------------------------- # -# Copyright (c) 2006-2010, ASSIMP Development Team +# Copyright (c) 2006-2020, ASSIMP Development Team # # All rights reserved. # diff --git a/port/PyAssimp/gen/structsgen.py b/port/PyAssimp/gen/structsgen.py index f2ee95eb5..f34ec1975 100644 --- a/port/PyAssimp/gen/structsgen.py +++ b/port/PyAssimp/gen/structsgen.py @@ -5,7 +5,7 @@ # Open Asset Import Library (ASSIMP) # --------------------------------------------------------------------------- # -# Copyright (c) 2006-2010, ASSIMP Development Team +# Copyright (c) 2006-2020, ASSIMP Development Team # # All rights reserved. # diff --git a/port/dAssimp/assimp/animation.d b/port/dAssimp/assimp/animation.d index fb716ee73..9a36940d6 100644 --- a/port/dAssimp/assimp/animation.d +++ b/port/dAssimp/assimp/animation.d @@ -3,7 +3,7 @@ Open Asset Import Library (ASSIMP) --------------------------------------------------------------------------- -Copyright (c) 2006-2009, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. diff --git a/port/dAssimp/assimp/api.d b/port/dAssimp/assimp/api.d index 9399b7f9d..bc7a15796 100644 --- a/port/dAssimp/assimp/api.d +++ b/port/dAssimp/assimp/api.d @@ -3,7 +3,7 @@ Open Asset Import Library (ASSIMP) --------------------------------------------------------------------------- -Copyright (c) 2006-2009, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. diff --git a/port/dAssimp/assimp/assimp.d b/port/dAssimp/assimp/assimp.d index f0474bebf..a147ee2eb 100644 --- a/port/dAssimp/assimp/assimp.d +++ b/port/dAssimp/assimp/assimp.d @@ -3,7 +3,7 @@ Open Asset Import Library (ASSIMP) --------------------------------------------------------------------------- -Copyright (c) 2006-2009, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. diff --git a/port/dAssimp/assimp/camera.d b/port/dAssimp/assimp/camera.d index 8a2c3c0b8..5567be2cc 100644 --- a/port/dAssimp/assimp/camera.d +++ b/port/dAssimp/assimp/camera.d @@ -3,7 +3,7 @@ Open Asset Import Library (ASSIMP) --------------------------------------------------------------------------- -Copyright (c) 2006-2009, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. diff --git a/port/dAssimp/assimp/config.d b/port/dAssimp/assimp/config.d index 9f8d222c7..761156b41 100644 --- a/port/dAssimp/assimp/config.d +++ b/port/dAssimp/assimp/config.d @@ -3,7 +3,7 @@ Open Asset Import Library (ASSIMP) --------------------------------------------------------------------------- -Copyright (c) 2006-2009, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. diff --git a/port/dAssimp/assimp/fileIO.d b/port/dAssimp/assimp/fileIO.d index d893016d8..108d883f0 100644 --- a/port/dAssimp/assimp/fileIO.d +++ b/port/dAssimp/assimp/fileIO.d @@ -3,7 +3,7 @@ Open Asset Import Library (ASSIMP) --------------------------------------------------------------------------- -Copyright (c) 2006-2009, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. diff --git a/port/dAssimp/assimp/light.d b/port/dAssimp/assimp/light.d index 8d782396d..0842d67c9 100644 --- a/port/dAssimp/assimp/light.d +++ b/port/dAssimp/assimp/light.d @@ -3,7 +3,7 @@ Open Asset Import Library (ASSIMP) --------------------------------------------------------------------------- -Copyright (c) 2006-2009, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. diff --git a/port/dAssimp/assimp/loader.d b/port/dAssimp/assimp/loader.d index 76fd44adf..279f0a7b2 100644 --- a/port/dAssimp/assimp/loader.d +++ b/port/dAssimp/assimp/loader.d @@ -3,7 +3,7 @@ Open Asset Import Library (ASSIMP) --------------------------------------------------------------------------- -Copyright (c) 2006-2009, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. diff --git a/port/dAssimp/assimp/material.d b/port/dAssimp/assimp/material.d index e0c480b24..f0eae8610 100644 --- a/port/dAssimp/assimp/material.d +++ b/port/dAssimp/assimp/material.d @@ -3,7 +3,7 @@ Open Asset Import Library (ASSIMP) --------------------------------------------------------------------------- -Copyright (c) 2006-2009, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. diff --git a/port/dAssimp/assimp/math.d b/port/dAssimp/assimp/math.d index f3cff743f..057bbd5f2 100644 --- a/port/dAssimp/assimp/math.d +++ b/port/dAssimp/assimp/math.d @@ -3,7 +3,7 @@ Open Asset Import Library (ASSIMP) --------------------------------------------------------------------------- -Copyright (c) 2006-2009, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. diff --git a/port/dAssimp/assimp/mesh.d b/port/dAssimp/assimp/mesh.d index da6193631..48162b705 100644 --- a/port/dAssimp/assimp/mesh.d +++ b/port/dAssimp/assimp/mesh.d @@ -3,7 +3,7 @@ Open Asset Import Library (ASSIMP) --------------------------------------------------------------------------- -Copyright (c) 2006-2009, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. diff --git a/port/dAssimp/assimp/postprocess.d b/port/dAssimp/assimp/postprocess.d index a720a8c63..343bb36dd 100644 --- a/port/dAssimp/assimp/postprocess.d +++ b/port/dAssimp/assimp/postprocess.d @@ -3,7 +3,7 @@ Open Asset Import Library (ASSIMP) --------------------------------------------------------------------------- -Copyright (c) 2006-2009, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. diff --git a/port/dAssimp/assimp/scene.d b/port/dAssimp/assimp/scene.d index ab545b192..deee75ae4 100644 --- a/port/dAssimp/assimp/scene.d +++ b/port/dAssimp/assimp/scene.d @@ -3,7 +3,7 @@ Open Asset Import Library (ASSIMP) --------------------------------------------------------------------------- -Copyright (c) 2006-2009, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. diff --git a/port/dAssimp/assimp/texture.d b/port/dAssimp/assimp/texture.d index 0f46ff551..83453b984 100644 --- a/port/dAssimp/assimp/texture.d +++ b/port/dAssimp/assimp/texture.d @@ -3,7 +3,7 @@ Open Asset Import Library (ASSIMP) --------------------------------------------------------------------------- -Copyright (c) 2006-2009, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. diff --git a/port/dAssimp/assimp/types.d b/port/dAssimp/assimp/types.d index d3c0b53de..5aa4d5410 100644 --- a/port/dAssimp/assimp/types.d +++ b/port/dAssimp/assimp/types.d @@ -3,7 +3,7 @@ Open Asset Import Library (ASSIMP) --------------------------------------------------------------------------- -Copyright (c) 2006-2009, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. diff --git a/port/dAssimp/assimp/versionInfo.d b/port/dAssimp/assimp/versionInfo.d index 498115524..5a7e9b9fd 100644 --- a/port/dAssimp/assimp/versionInfo.d +++ b/port/dAssimp/assimp/versionInfo.d @@ -3,7 +3,7 @@ Open Asset Import Library (ASSIMP) --------------------------------------------------------------------------- -Copyright (c) 2006-2009, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiAnimBehavior.java b/port/jassimp/jassimp/src/jassimp/AiAnimBehavior.java index 7dd3fb560..ae4f04a69 100644 --- a/port/jassimp/jassimp/src/jassimp/AiAnimBehavior.java +++ b/port/jassimp/jassimp/src/jassimp/AiAnimBehavior.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiAnimation.java b/port/jassimp/jassimp/src/jassimp/AiAnimation.java index 777d2a9fe..239820aaf 100644 --- a/port/jassimp/jassimp/src/jassimp/AiAnimation.java +++ b/port/jassimp/jassimp/src/jassimp/AiAnimation.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiBlendMode.java b/port/jassimp/jassimp/src/jassimp/AiBlendMode.java index 941ace11e..78cc5a5ed 100644 --- a/port/jassimp/jassimp/src/jassimp/AiBlendMode.java +++ b/port/jassimp/jassimp/src/jassimp/AiBlendMode.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiBone.java b/port/jassimp/jassimp/src/jassimp/AiBone.java index 1e6d49beb..eaaf481ff 100644 --- a/port/jassimp/jassimp/src/jassimp/AiBone.java +++ b/port/jassimp/jassimp/src/jassimp/AiBone.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiBoneWeight.java b/port/jassimp/jassimp/src/jassimp/AiBoneWeight.java index 7d1d74bcc..7d7a183d0 100644 --- a/port/jassimp/jassimp/src/jassimp/AiBoneWeight.java +++ b/port/jassimp/jassimp/src/jassimp/AiBoneWeight.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiBuiltInWrapperProvider.java b/port/jassimp/jassimp/src/jassimp/AiBuiltInWrapperProvider.java index 64fad515a..ebc23c0ae 100644 --- a/port/jassimp/jassimp/src/jassimp/AiBuiltInWrapperProvider.java +++ b/port/jassimp/jassimp/src/jassimp/AiBuiltInWrapperProvider.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiCamera.java b/port/jassimp/jassimp/src/jassimp/AiCamera.java index 6378210f7..4445c34fc 100644 --- a/port/jassimp/jassimp/src/jassimp/AiCamera.java +++ b/port/jassimp/jassimp/src/jassimp/AiCamera.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiClassLoaderIOSystem.java b/port/jassimp/jassimp/src/jassimp/AiClassLoaderIOSystem.java index 95afc2e02..687e9f37a 100644 --- a/port/jassimp/jassimp/src/jassimp/AiClassLoaderIOSystem.java +++ b/port/jassimp/jassimp/src/jassimp/AiClassLoaderIOSystem.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2017, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiColor.java b/port/jassimp/jassimp/src/jassimp/AiColor.java index 6befeecbd..5cea22a9e 100644 --- a/port/jassimp/jassimp/src/jassimp/AiColor.java +++ b/port/jassimp/jassimp/src/jassimp/AiColor.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiIOStream.java b/port/jassimp/jassimp/src/jassimp/AiIOStream.java index 6625b3740..71405e685 100644 --- a/port/jassimp/jassimp/src/jassimp/AiIOStream.java +++ b/port/jassimp/jassimp/src/jassimp/AiIOStream.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2017, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiIOSystem.java b/port/jassimp/jassimp/src/jassimp/AiIOSystem.java index 213f95a12..7e15ee033 100644 --- a/port/jassimp/jassimp/src/jassimp/AiIOSystem.java +++ b/port/jassimp/jassimp/src/jassimp/AiIOSystem.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2017, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiInputStreamIOStream.java b/port/jassimp/jassimp/src/jassimp/AiInputStreamIOStream.java index 0db1ea211..64aa40afb 100644 --- a/port/jassimp/jassimp/src/jassimp/AiInputStreamIOStream.java +++ b/port/jassimp/jassimp/src/jassimp/AiInputStreamIOStream.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2017, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiLight.java b/port/jassimp/jassimp/src/jassimp/AiLight.java index 0b1dd2f67..e0a93dbef 100644 --- a/port/jassimp/jassimp/src/jassimp/AiLight.java +++ b/port/jassimp/jassimp/src/jassimp/AiLight.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiLightType.java b/port/jassimp/jassimp/src/jassimp/AiLightType.java index ec3c39b02..33fd72284 100644 --- a/port/jassimp/jassimp/src/jassimp/AiLightType.java +++ b/port/jassimp/jassimp/src/jassimp/AiLightType.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiMaterial.java b/port/jassimp/jassimp/src/jassimp/AiMaterial.java index 8582d881a..b571f1428 100644 --- a/port/jassimp/jassimp/src/jassimp/AiMaterial.java +++ b/port/jassimp/jassimp/src/jassimp/AiMaterial.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiMatrix4f.java b/port/jassimp/jassimp/src/jassimp/AiMatrix4f.java index 19640888d..f78c951bf 100644 --- a/port/jassimp/jassimp/src/jassimp/AiMatrix4f.java +++ b/port/jassimp/jassimp/src/jassimp/AiMatrix4f.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiMesh.java b/port/jassimp/jassimp/src/jassimp/AiMesh.java index 3f4a29760..eb2ff3c5c 100644 --- a/port/jassimp/jassimp/src/jassimp/AiMesh.java +++ b/port/jassimp/jassimp/src/jassimp/AiMesh.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiMeshAnim.java b/port/jassimp/jassimp/src/jassimp/AiMeshAnim.java index bbccc71ac..7c893e065 100644 --- a/port/jassimp/jassimp/src/jassimp/AiMeshAnim.java +++ b/port/jassimp/jassimp/src/jassimp/AiMeshAnim.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiMetadataEntry.java b/port/jassimp/jassimp/src/jassimp/AiMetadataEntry.java index dbdf1aae8..76e66640f 100644 --- a/port/jassimp/jassimp/src/jassimp/AiMetadataEntry.java +++ b/port/jassimp/jassimp/src/jassimp/AiMetadataEntry.java @@ -4,7 +4,7 @@ package jassimp; Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiNode.java b/port/jassimp/jassimp/src/jassimp/AiNode.java index e585e0449..54baf9ccf 100644 --- a/port/jassimp/jassimp/src/jassimp/AiNode.java +++ b/port/jassimp/jassimp/src/jassimp/AiNode.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiNodeAnim.java b/port/jassimp/jassimp/src/jassimp/AiNodeAnim.java index fb317a5b1..b07c7ce05 100644 --- a/port/jassimp/jassimp/src/jassimp/AiNodeAnim.java +++ b/port/jassimp/jassimp/src/jassimp/AiNodeAnim.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2015, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiPostProcessSteps.java b/port/jassimp/jassimp/src/jassimp/AiPostProcessSteps.java index 905229190..7bb617b2c 100644 --- a/port/jassimp/jassimp/src/jassimp/AiPostProcessSteps.java +++ b/port/jassimp/jassimp/src/jassimp/AiPostProcessSteps.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiPrimitiveType.java b/port/jassimp/jassimp/src/jassimp/AiPrimitiveType.java index bb8f9041d..af8aa284d 100644 --- a/port/jassimp/jassimp/src/jassimp/AiPrimitiveType.java +++ b/port/jassimp/jassimp/src/jassimp/AiPrimitiveType.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiProgressHandler.java b/port/jassimp/jassimp/src/jassimp/AiProgressHandler.java index 5512942d9..7998d1bcc 100644 --- a/port/jassimp/jassimp/src/jassimp/AiProgressHandler.java +++ b/port/jassimp/jassimp/src/jassimp/AiProgressHandler.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiQuaternion.java b/port/jassimp/jassimp/src/jassimp/AiQuaternion.java index 00630e644..af10e6f91 100644 --- a/port/jassimp/jassimp/src/jassimp/AiQuaternion.java +++ b/port/jassimp/jassimp/src/jassimp/AiQuaternion.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiScene.java b/port/jassimp/jassimp/src/jassimp/AiScene.java index f13348dec..b4eed2ff7 100644 --- a/port/jassimp/jassimp/src/jassimp/AiScene.java +++ b/port/jassimp/jassimp/src/jassimp/AiScene.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiSceneFlag.java b/port/jassimp/jassimp/src/jassimp/AiSceneFlag.java index af3ee5d5f..772b495f5 100644 --- a/port/jassimp/jassimp/src/jassimp/AiSceneFlag.java +++ b/port/jassimp/jassimp/src/jassimp/AiSceneFlag.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiShadingMode.java b/port/jassimp/jassimp/src/jassimp/AiShadingMode.java index af90f98a1..fbf65738f 100644 --- a/port/jassimp/jassimp/src/jassimp/AiShadingMode.java +++ b/port/jassimp/jassimp/src/jassimp/AiShadingMode.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiTextureInfo.java b/port/jassimp/jassimp/src/jassimp/AiTextureInfo.java index bfa09397b..509230363 100644 --- a/port/jassimp/jassimp/src/jassimp/AiTextureInfo.java +++ b/port/jassimp/jassimp/src/jassimp/AiTextureInfo.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiTextureMapMode.java b/port/jassimp/jassimp/src/jassimp/AiTextureMapMode.java index df75c58c2..c08ca10cb 100644 --- a/port/jassimp/jassimp/src/jassimp/AiTextureMapMode.java +++ b/port/jassimp/jassimp/src/jassimp/AiTextureMapMode.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiTextureMapping.java b/port/jassimp/jassimp/src/jassimp/AiTextureMapping.java index 3112ba4bd..48c219d9c 100644 --- a/port/jassimp/jassimp/src/jassimp/AiTextureMapping.java +++ b/port/jassimp/jassimp/src/jassimp/AiTextureMapping.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiTextureOp.java b/port/jassimp/jassimp/src/jassimp/AiTextureOp.java index d928167ca..df87d968e 100644 --- a/port/jassimp/jassimp/src/jassimp/AiTextureOp.java +++ b/port/jassimp/jassimp/src/jassimp/AiTextureOp.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiTextureType.java b/port/jassimp/jassimp/src/jassimp/AiTextureType.java index 8756c18ee..85b559c30 100644 --- a/port/jassimp/jassimp/src/jassimp/AiTextureType.java +++ b/port/jassimp/jassimp/src/jassimp/AiTextureType.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiVector.java b/port/jassimp/jassimp/src/jassimp/AiVector.java index 3136f3888..440be20d6 100644 --- a/port/jassimp/jassimp/src/jassimp/AiVector.java +++ b/port/jassimp/jassimp/src/jassimp/AiVector.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/AiWrapperProvider.java b/port/jassimp/jassimp/src/jassimp/AiWrapperProvider.java index e916ad260..a29f9d18f 100644 --- a/port/jassimp/jassimp/src/jassimp/AiWrapperProvider.java +++ b/port/jassimp/jassimp/src/jassimp/AiWrapperProvider.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/JaiDebug.java b/port/jassimp/jassimp/src/jassimp/JaiDebug.java index f74a8967b..0ed112a1b 100644 --- a/port/jassimp/jassimp/src/jassimp/JaiDebug.java +++ b/port/jassimp/jassimp/src/jassimp/JaiDebug.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/Jassimp.java b/port/jassimp/jassimp/src/jassimp/Jassimp.java index c33f95c0a..4610fb191 100644 --- a/port/jassimp/jassimp/src/jassimp/Jassimp.java +++ b/port/jassimp/jassimp/src/jassimp/Jassimp.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/JassimpConfig.java b/port/jassimp/jassimp/src/jassimp/JassimpConfig.java index 8370bb9f0..7591f0e95 100644 --- a/port/jassimp/jassimp/src/jassimp/JassimpConfig.java +++ b/port/jassimp/jassimp/src/jassimp/JassimpConfig.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/JassimpLibraryLoader.java b/port/jassimp/jassimp/src/jassimp/JassimpLibraryLoader.java index c299706b7..d87cc820c 100644 --- a/port/jassimp/jassimp/src/jassimp/JassimpLibraryLoader.java +++ b/port/jassimp/jassimp/src/jassimp/JassimpLibraryLoader.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/port/jassimp/jassimp/src/jassimp/package-info.java b/port/jassimp/jassimp/src/jassimp/package-info.java index fa2883824..7ec8c884f 100644 --- a/port/jassimp/jassimp/src/jassimp/package-info.java +++ b/port/jassimp/jassimp/src/jassimp/package-info.java @@ -3,7 +3,7 @@ Open Asset Import Library - Java Binding (jassimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/scripts/BlenderImporter/BlenderScene.cpp.template b/scripts/BlenderImporter/BlenderScene.cpp.template index 1dda00919..391528127 100644 --- a/scripts/BlenderImporter/BlenderScene.cpp.template +++ b/scripts/BlenderImporter/BlenderScene.cpp.template @@ -2,7 +2,7 @@ Open Asset Import Library (ASSIMP) ---------------------------------------------------------------------- -Copyright (c) 2006-2016, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/scripts/BlenderImporter/BlenderSceneGen.h.template b/scripts/BlenderImporter/BlenderSceneGen.h.template index 562b5bb72..f5b71c40c 100644 --- a/scripts/BlenderImporter/BlenderSceneGen.h.template +++ b/scripts/BlenderImporter/BlenderSceneGen.h.template @@ -2,7 +2,7 @@ Open Asset Import Library (ASSIMP) ---------------------------------------------------------------------- -Copyright (c) 2006-2016, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/scripts/BlenderImporter/genblenddna.py b/scripts/BlenderImporter/genblenddna.py index cca595eca..56e1b9894 100644 --- a/scripts/BlenderImporter/genblenddna.py +++ b/scripts/BlenderImporter/genblenddna.py @@ -5,7 +5,7 @@ # Open Asset Import Library (ASSIMP) # --------------------------------------------------------------------------- # -# Copyright (c) 2006-2016, ASSIMP Development Team +# Copyright (c) 2006-2020, ASSIMP Development Team # # All rights reserved. # diff --git a/scripts/StepImporter/CppGenerator.py b/scripts/StepImporter/CppGenerator.py index b9dba9902..b6c8ed542 100644 --- a/scripts/StepImporter/CppGenerator.py +++ b/scripts/StepImporter/CppGenerator.py @@ -5,7 +5,7 @@ # Open Asset Import Library (ASSIMP) # --------------------------------------------------------------------------- # -# Copyright (c) 2006-2018, ASSIMP Development Team +# Copyright (c) 2006-2020, ASSIMP Development Team # # All rights reserved. # diff --git a/scripts/StepImporter/ExpressReader.py b/scripts/StepImporter/ExpressReader.py index c2a39e70b..9cb3b72ad 100644 --- a/scripts/StepImporter/ExpressReader.py +++ b/scripts/StepImporter/ExpressReader.py @@ -5,7 +5,7 @@ # Open Asset Import Library (ASSIMP) # --------------------------------------------------------------------------- # -# Copyright (c) 2006-2010, ASSIMP Development Team +# Copyright (c) 2006-2020, ASSIMP Development Team # # All rights reserved. # diff --git a/scripts/StepImporter/IFCReaderGen.cpp.template b/scripts/StepImporter/IFCReaderGen.cpp.template index 562b69807..de1063de2 100644 --- a/scripts/StepImporter/IFCReaderGen.cpp.template +++ b/scripts/StepImporter/IFCReaderGen.cpp.template @@ -2,7 +2,7 @@ Open Asset Import Library (ASSIMP) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/scripts/StepImporter/IFCReaderGen.h.template b/scripts/StepImporter/IFCReaderGen.h.template index abef2a1ab..2cad1542a 100644 --- a/scripts/StepImporter/IFCReaderGen.h.template +++ b/scripts/StepImporter/IFCReaderGen.h.template @@ -2,7 +2,7 @@ Open Asset Import Library (ASSIMP) ---------------------------------------------------------------------- -Copyright (c) 2006-2010, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/scripts/StepImporter/StepReaderGen.cpp.template b/scripts/StepImporter/StepReaderGen.cpp.template index f3240c099..5bb9bb98f 100644 --- a/scripts/StepImporter/StepReaderGen.cpp.template +++ b/scripts/StepImporter/StepReaderGen.cpp.template @@ -2,7 +2,7 @@ Open Asset Import Library (ASSIMP) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/scripts/StepImporter/StepReaderGen.h.template b/scripts/StepImporter/StepReaderGen.h.template index 7d4d77ef4..51ba55093 100644 --- a/scripts/StepImporter/StepReaderGen.h.template +++ b/scripts/StepImporter/StepReaderGen.h.template @@ -2,7 +2,7 @@ Open Asset Import Library (ASSIMP) ---------------------------------------------------------------------- -Copyright (c) 2006-2019, ASSIMP Development Team +Copyright (c) 2006-2020, ASSIMP Development Team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/scripts/StepImporter/extract_step_token.py b/scripts/StepImporter/extract_step_token.py index c7f89537a..106cf58a9 100644 --- a/scripts/StepImporter/extract_step_token.py +++ b/scripts/StepImporter/extract_step_token.py @@ -5,7 +5,7 @@ # Open Asset Import Library (ASSIMP) # --------------------------------------------------------------------------- # -# Copyright (c) 2006-2018, ASSIMP Development Team +# Copyright (c) 2006-2020, ASSIMP Development Team # # All rights reserved. # diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 2429ab25d..8624a065f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,7 +1,7 @@ # Open Asset Import Library (assimp) # ---------------------------------------------------------------------- # -# Copyright (c) 2006-2019, assimp team +# Copyright (c) 2006-2020, assimp team # All rights reserved. @@ -128,6 +128,9 @@ SET( IMPORTERS unit/ImportExport/utOFFImportExport.cpp unit/ImportExport/utNFFImportExport.cpp unit/ImportExport/utXGLImportExport.cpp + unit/ImportExport/utMD2Importer.cpp + unit/ImportExport/utMD3Importer.cpp + unit/ImportExport/utMD5Importer.cpp unit/ImportExport/utMDLImporter.cpp unit/ImportExport/MDL/MDLHL1TestFiles.h unit/ImportExport/MDL/utMDLImporter_HL1_ImportSettings.cpp diff --git a/test/models-nonbsd/3DS/m_rifl.bmp b/test/models-nonbsd/3DS/m_rifl.bmp index bb27dadb2..fc1d8c281 100644 Binary files a/test/models-nonbsd/3DS/m_rifl.bmp and b/test/models-nonbsd/3DS/m_rifl.bmp differ diff --git a/test/models-nonbsd/3DS/pyramob.3DS b/test/models-nonbsd/3DS/pyramob.3DS index f4f5af4f3..c880bdf43 100644 Binary files a/test/models-nonbsd/3DS/pyramob.3DS and b/test/models-nonbsd/3DS/pyramob.3DS differ diff --git a/test/models-nonbsd/AMF/3_bananas.amf.7z b/test/models-nonbsd/AMF/3_bananas.amf.7z index 9d035c592..c2b6785a3 100644 Binary files a/test/models-nonbsd/AMF/3_bananas.amf.7z and b/test/models-nonbsd/AMF/3_bananas.amf.7z differ diff --git a/test/models-nonbsd/AMF/screenshot_3_bananas.jpeg b/test/models-nonbsd/AMF/screenshot_3_bananas.jpeg index faa2cac85..976fcb03b 100644 Binary files a/test/models-nonbsd/AMF/screenshot_3_bananas.jpeg and b/test/models-nonbsd/AMF/screenshot_3_bananas.jpeg differ diff --git a/test/models-nonbsd/B3D/turtle1.png b/test/models-nonbsd/B3D/turtle1.png index fbdcfb5b7..42c43db31 100644 Binary files a/test/models-nonbsd/B3D/turtle1.png and b/test/models-nonbsd/B3D/turtle1.png differ diff --git a/test/models-nonbsd/BLEND/Bob.blend b/test/models-nonbsd/BLEND/Bob.blend index b73177ccb..3c784e8f8 100644 Binary files a/test/models-nonbsd/BLEND/Bob.blend and b/test/models-nonbsd/BLEND/Bob.blend differ diff --git a/test/models-nonbsd/BLEND/fleurOptonl.blend b/test/models-nonbsd/BLEND/fleurOptonl.blend index 19276f543..b8b3e3def 100644 Binary files a/test/models-nonbsd/BLEND/fleurOptonl.blend and b/test/models-nonbsd/BLEND/fleurOptonl.blend differ diff --git a/test/models-nonbsd/FBX/2013_ASCII/duck_sample.jpg b/test/models-nonbsd/FBX/2013_ASCII/duck_sample.jpg index 953d3e5fc..9ce7a59ca 100644 Binary files a/test/models-nonbsd/FBX/2013_ASCII/duck_sample.jpg and b/test/models-nonbsd/FBX/2013_ASCII/duck_sample.jpg differ diff --git a/test/models-nonbsd/FBX/2013_ASCII/m_rifl.bmp b/test/models-nonbsd/FBX/2013_ASCII/m_rifl.bmp index bb27dadb2..fc1d8c281 100644 Binary files a/test/models-nonbsd/FBX/2013_ASCII/m_rifl.bmp and b/test/models-nonbsd/FBX/2013_ASCII/m_rifl.bmp differ diff --git a/test/models-nonbsd/FBX/2013_BINARY/Granate.fbx b/test/models-nonbsd/FBX/2013_BINARY/Granate.fbx index d1efbf2f6..1e25c223b 100644 Binary files a/test/models-nonbsd/FBX/2013_BINARY/Granate.fbx and b/test/models-nonbsd/FBX/2013_BINARY/Granate.fbx differ diff --git a/test/models-nonbsd/FBX/2013_BINARY/duck.fbx b/test/models-nonbsd/FBX/2013_BINARY/duck.fbx index 8c3ac3fdb..9ce23ab40 100644 Binary files a/test/models-nonbsd/FBX/2013_BINARY/duck.fbx and b/test/models-nonbsd/FBX/2013_BINARY/duck.fbx differ diff --git a/test/models-nonbsd/FBX/2013_BINARY/jeep1.fbx b/test/models-nonbsd/FBX/2013_BINARY/jeep1.fbx index 33607b993..8d35f7f16 100644 Binary files a/test/models-nonbsd/FBX/2013_BINARY/jeep1.fbx and b/test/models-nonbsd/FBX/2013_BINARY/jeep1.fbx differ diff --git a/test/models-nonbsd/FBX/2013_BINARY/kwxport_test_vcolors.fbx b/test/models-nonbsd/FBX/2013_BINARY/kwxport_test_vcolors.fbx index 686d273ec..f3cd463e2 100644 Binary files a/test/models-nonbsd/FBX/2013_BINARY/kwxport_test_vcolors.fbx and b/test/models-nonbsd/FBX/2013_BINARY/kwxport_test_vcolors.fbx differ diff --git a/test/models-nonbsd/FBX/2013_BINARY/mar_rifle.fbx b/test/models-nonbsd/FBX/2013_BINARY/mar_rifle.fbx index 5e5d05118..96431196c 100644 Binary files a/test/models-nonbsd/FBX/2013_BINARY/mar_rifle.fbx and b/test/models-nonbsd/FBX/2013_BINARY/mar_rifle.fbx differ diff --git a/test/models-nonbsd/FBX/2013_BINARY/pyramob.fbx b/test/models-nonbsd/FBX/2013_BINARY/pyramob.fbx index 29bd64df9..4b67a23eb 100644 Binary files a/test/models-nonbsd/FBX/2013_BINARY/pyramob.fbx and b/test/models-nonbsd/FBX/2013_BINARY/pyramob.fbx differ diff --git a/test/models-nonbsd/HMP/terrain_withtexture.hmp b/test/models-nonbsd/HMP/terrain_withtexture.hmp index aa4a2e129..b78b32917 100644 Binary files a/test/models-nonbsd/HMP/terrain_withtexture.hmp and b/test/models-nonbsd/HMP/terrain_withtexture.hmp differ diff --git a/test/models-nonbsd/IRR/skybox/default_skybox3.jpg b/test/models-nonbsd/IRR/skybox/default_skybox3.jpg index c7dfe7c70..e8107ff99 100644 Binary files a/test/models-nonbsd/IRR/skybox/default_skybox3.jpg and b/test/models-nonbsd/IRR/skybox/default_skybox3.jpg differ diff --git a/test/models-nonbsd/IRR/skybox/default_skyboxdn.jpg b/test/models-nonbsd/IRR/skybox/default_skyboxdn.jpg index 8eb987084..af66a6176 100644 Binary files a/test/models-nonbsd/IRR/skybox/default_skyboxdn.jpg and b/test/models-nonbsd/IRR/skybox/default_skyboxdn.jpg differ diff --git a/test/models-nonbsd/IRR/skybox/default_skyboxup.jpg b/test/models-nonbsd/IRR/skybox/default_skyboxup.jpg index 730e5ec3e..7959709fa 100644 Binary files a/test/models-nonbsd/IRR/skybox/default_skyboxup.jpg and b/test/models-nonbsd/IRR/skybox/default_skyboxup.jpg differ diff --git a/test/models-nonbsd/LWO/LWO2/LWSReferences/QuickDraw--Chasis.lwo b/test/models-nonbsd/LWO/LWO2/LWSReferences/QuickDraw--Chasis.lwo index d8fbd397b..056ad233c 100644 Binary files a/test/models-nonbsd/LWO/LWO2/LWSReferences/QuickDraw--Chasis.lwo and b/test/models-nonbsd/LWO/LWO2/LWSReferences/QuickDraw--Chasis.lwo differ diff --git a/test/models-nonbsd/MD2/dolphin.md2 b/test/models-nonbsd/MD2/dolphin.md2 index 81827b66a..af716d579 100644 Binary files a/test/models-nonbsd/MD2/dolphin.md2 and b/test/models-nonbsd/MD2/dolphin.md2 differ diff --git a/test/models-nonbsd/MD2/horse.md2 b/test/models-nonbsd/MD2/horse.md2 index 9f977677a..885841344 100644 Binary files a/test/models-nonbsd/MD2/horse.md2 and b/test/models-nonbsd/MD2/horse.md2 differ diff --git a/test/models-nonbsd/MD3/q3root/models/mapobjects/kt_kubalwagon/euro_frnt_2.tga b/test/models-nonbsd/MD3/q3root/models/mapobjects/kt_kubalwagon/euro_frnt_2.tga index 3bb9f5097..47ff6d620 100644 Binary files a/test/models-nonbsd/MD3/q3root/models/mapobjects/kt_kubalwagon/euro_frnt_2.tga and b/test/models-nonbsd/MD3/q3root/models/mapobjects/kt_kubalwagon/euro_frnt_2.tga differ diff --git a/test/models-nonbsd/MD3/q3root/models/mapobjects/kt_kubalwagon/european_fnt.tga b/test/models-nonbsd/MD3/q3root/models/mapobjects/kt_kubalwagon/european_fnt.tga index 292ff31c6..0621ca3a4 100644 Binary files a/test/models-nonbsd/MD3/q3root/models/mapobjects/kt_kubalwagon/european_fnt.tga and b/test/models-nonbsd/MD3/q3root/models/mapobjects/kt_kubalwagon/european_fnt.tga differ diff --git a/test/models-nonbsd/MD3/water_can.tga b/test/models-nonbsd/MD3/water_can.tga index 794665a6d..0d7a1cbc5 100644 Binary files a/test/models-nonbsd/MD3/water_can.tga and b/test/models-nonbsd/MD3/water_can.tga differ diff --git a/test/models-nonbsd/MD5/guard1_body.png b/test/models-nonbsd/MD5/guard1_body.png index 908b51f83..2eb3f2caa 100644 Binary files a/test/models-nonbsd/MD5/guard1_body.png and b/test/models-nonbsd/MD5/guard1_body.png differ diff --git a/test/models-nonbsd/MD5/guard1_face.png b/test/models-nonbsd/MD5/guard1_face.png index 282f5906f..b7e17d375 100644 Binary files a/test/models-nonbsd/MD5/guard1_face.png and b/test/models-nonbsd/MD5/guard1_face.png differ diff --git a/test/models-nonbsd/MD5/guard1_helmet.png b/test/models-nonbsd/MD5/guard1_helmet.png index 081a0498f..166d790fd 100644 Binary files a/test/models-nonbsd/MD5/guard1_helmet.png and b/test/models-nonbsd/MD5/guard1_helmet.png differ diff --git a/test/models-nonbsd/MD5/iron_grill.png b/test/models-nonbsd/MD5/iron_grill.png index 3c30c53c8..53a3bbbcc 100644 Binary files a/test/models-nonbsd/MD5/iron_grill.png and b/test/models-nonbsd/MD5/iron_grill.png differ diff --git a/test/models-nonbsd/MD5/round_grill.png b/test/models-nonbsd/MD5/round_grill.png index a35cbdfa6..502a1d782 100644 Binary files a/test/models-nonbsd/MD5/round_grill.png and b/test/models-nonbsd/MD5/round_grill.png differ diff --git a/test/models-nonbsd/MDL/MDL7 (3DGS A7)/branchD_texture.png b/test/models-nonbsd/MDL/MDL7 (3DGS A7)/branchD_texture.png index 5d7888411..a1782dc6b 100644 Binary files a/test/models-nonbsd/MDL/MDL7 (3DGS A7)/branchD_texture.png and b/test/models-nonbsd/MDL/MDL7 (3DGS A7)/branchD_texture.png differ diff --git a/test/models-nonbsd/Ogre/OgreSDK/fish.jpg b/test/models-nonbsd/Ogre/OgreSDK/fish.jpg index 122bd8382..04cbf2f83 100644 Binary files a/test/models-nonbsd/Ogre/OgreSDK/fish.jpg and b/test/models-nonbsd/Ogre/OgreSDK/fish.jpg differ diff --git a/test/models/3DS/CWALL02.jpg b/test/models/3DS/CWALL02.jpg index 72ca82824..93364a0bd 100644 Binary files a/test/models/3DS/CWALL02.jpg and b/test/models/3DS/CWALL02.jpg differ diff --git a/test/models/3DS/IMAGE2.jpg b/test/models/3DS/IMAGE2.jpg index 66ba54bec..d7ce7a64c 100644 Binary files a/test/models/3DS/IMAGE2.jpg and b/test/models/3DS/IMAGE2.jpg differ diff --git a/test/models/3DS/UVTransformTest/UVTransformTestImg.png b/test/models/3DS/UVTransformTest/UVTransformTestImg.png index 906750840..020da1772 100644 Binary files a/test/models/3DS/UVTransformTest/UVTransformTestImg.png and b/test/models/3DS/UVTransformTest/UVTransformTestImg.png differ diff --git a/test/models/3DS/test.png b/test/models/3DS/test.png index e5725bbbd..501fcdecf 100644 Binary files a/test/models/3DS/test.png and b/test/models/3DS/test.png differ diff --git a/test/models/COB/dwarf.cob b/test/models/COB/dwarf.cob index 718d0c786..1e6e1ddd7 100644 Binary files a/test/models/COB/dwarf.cob and b/test/models/COB/dwarf.cob differ diff --git a/test/models/Collada/duck_sample.jpg b/test/models/Collada/duck_sample.jpg index 953d3e5fc..9ce7a59ca 100644 Binary files a/test/models/Collada/duck_sample.jpg and b/test/models/Collada/duck_sample.jpg differ diff --git a/test/models/Collada/lights.dae b/test/models/Collada/lights.dae index 9e040aac6..03507116c 100644 --- a/test/models/Collada/lights.dae +++ b/test/models/Collada/lights.dae @@ -4,6 +4,7 @@ Blender User Blender 2.74.0 commit date:2015-03-31, commit time:13:39, hash:000dfc0 + BSD 2015-05-17T21:55:44 2015-05-17T21:55:44 diff --git a/test/models/Collada/teapots_reference.png b/test/models/Collada/teapots_reference.png index ef01c8601..c7db36213 100644 Binary files a/test/models/Collada/teapots_reference.png and b/test/models/Collada/teapots_reference.png differ diff --git a/test/models/IRRMesh/1.png b/test/models/IRRMesh/1.png index cba123d13..e7200658b 100644 Binary files a/test/models/IRRMesh/1.png and b/test/models/IRRMesh/1.png differ diff --git a/test/models/LWO/LWO2/MappingModes/earthCylindric.jpg b/test/models/LWO/LWO2/MappingModes/earthCylindric.jpg index e1bf47eaf..da9688b44 100644 Binary files a/test/models/LWO/LWO2/MappingModes/earthCylindric.jpg and b/test/models/LWO/LWO2/MappingModes/earthCylindric.jpg differ diff --git a/test/models/LWO/LWO2/MappingModes/earthSpherical.jpg b/test/models/LWO/LWO2/MappingModes/earthSpherical.jpg index 9c9a13e4e..3419e8071 100644 Binary files a/test/models/LWO/LWO2/MappingModes/earthSpherical.jpg and b/test/models/LWO/LWO2/MappingModes/earthSpherical.jpg differ diff --git a/test/models/LWO/LWO2/boxuv.png b/test/models/LWO/LWO2/boxuv.png index 1fb26e97a..9da32691e 100644 Binary files a/test/models/LWO/LWO2/boxuv.png and b/test/models/LWO/LWO2/boxuv.png differ diff --git a/test/models/LWO/LWO2/uvtest.png b/test/models/LWO/LWO2/uvtest.png index d4a2fcb3d..1701d737b 100644 Binary files a/test/models/LWO/LWO2/uvtest.png and b/test/models/LWO/LWO2/uvtest.png differ diff --git a/test/models/MD2/faerie2.bmp b/test/models/MD2/faerie2.bmp index ef372415f..56a486a6c 100644 Binary files a/test/models/MD2/faerie2.bmp and b/test/models/MD2/faerie2.bmp differ diff --git a/test/models/MD2/sydney.bmp b/test/models/MD2/sydney.bmp index 1c2d21675..2f14a5a03 100644 Binary files a/test/models/MD2/sydney.bmp and b/test/models/MD2/sydney.bmp differ diff --git a/test/models/MS3D/Wuson.ms3d b/test/models/MS3D/Wuson.ms3d index e78cbaa58..2fc79ac82 100644 Binary files a/test/models/MS3D/Wuson.ms3d and b/test/models/MS3D/Wuson.ms3d differ diff --git a/test/models/Ogre/TheThing/Reference.JPG b/test/models/Ogre/TheThing/Reference.JPG index 29aa07a8a..6eebcc841 100644 Binary files a/test/models/Ogre/TheThing/Reference.JPG and b/test/models/Ogre/TheThing/Reference.JPG differ diff --git a/test/models/Q3D/WusonOrange.q3o b/test/models/Q3D/WusonOrange.q3o index 9f99fd0e4..78394d799 100644 Binary files a/test/models/Q3D/WusonOrange.q3o and b/test/models/Q3D/WusonOrange.q3o differ diff --git a/test/models/Q3D/WusonOrange.q3s b/test/models/Q3D/WusonOrange.q3s index 0014ae84e..e2daabd4f 100644 Binary files a/test/models/Q3D/WusonOrange.q3s and b/test/models/Q3D/WusonOrange.q3s differ diff --git a/test/models/ReferenceImages/MappingModes/cylindrical.png b/test/models/ReferenceImages/MappingModes/cylindrical.png index a6e008fb6..a1ad5979b 100644 Binary files a/test/models/ReferenceImages/MappingModes/cylindrical.png and b/test/models/ReferenceImages/MappingModes/cylindrical.png differ diff --git a/test/models/ReferenceImages/MappingModes/spherical.png b/test/models/ReferenceImages/MappingModes/spherical.png index 0a3d52b8b..c6d589832 100644 Binary files a/test/models/ReferenceImages/MappingModes/spherical.png and b/test/models/ReferenceImages/MappingModes/spherical.png differ diff --git a/test/models/ReferenceImages/UVTransform/UVTransform_Normal.png b/test/models/ReferenceImages/UVTransform/UVTransform_Normal.png index 3f3f5d69e..b8f6f54f1 100644 Binary files a/test/models/ReferenceImages/UVTransform/UVTransform_Normal.png and b/test/models/ReferenceImages/UVTransform/UVTransform_Normal.png differ diff --git a/test/models/ReferenceImages/UVTransform/UVTransform_OffsetUV0.5-clampUV.png b/test/models/ReferenceImages/UVTransform/UVTransform_OffsetUV0.5-clampUV.png index 8599de676..aa07d1270 100644 Binary files a/test/models/ReferenceImages/UVTransform/UVTransform_OffsetUV0.5-clampUV.png and b/test/models/ReferenceImages/UVTransform/UVTransform_OffsetUV0.5-clampUV.png differ diff --git a/test/models/ReferenceImages/UVTransform/UVTransform_OffsetUV0.5-mirrorUV.png b/test/models/ReferenceImages/UVTransform/UVTransform_OffsetUV0.5-mirrorUV.png index 96bae703c..447d30c32 100644 Binary files a/test/models/ReferenceImages/UVTransform/UVTransform_OffsetUV0.5-mirrorUV.png and b/test/models/ReferenceImages/UVTransform/UVTransform_OffsetUV0.5-mirrorUV.png differ diff --git a/test/models/ReferenceImages/UVTransform/UVTransform_OffsetUV0.5.png b/test/models/ReferenceImages/UVTransform/UVTransform_OffsetUV0.5.png index da2c67fe1..c8c1d69e0 100644 Binary files a/test/models/ReferenceImages/UVTransform/UVTransform_OffsetUV0.5.png and b/test/models/ReferenceImages/UVTransform/UVTransform_OffsetUV0.5.png differ diff --git a/test/models/ReferenceImages/UVTransform/UVTransform_ScaleUV1-2_OffsetUV0-0.9_Rotate-72.png b/test/models/ReferenceImages/UVTransform/UVTransform_ScaleUV1-2_OffsetUV0-0.9_Rotate-72.png index 39a23001c..4645a5668 100644 Binary files a/test/models/ReferenceImages/UVTransform/UVTransform_ScaleUV1-2_OffsetUV0-0.9_Rotate-72.png and b/test/models/ReferenceImages/UVTransform/UVTransform_ScaleUV1-2_OffsetUV0-0.9_Rotate-72.png differ diff --git a/test/models/ReferenceImages/UVTransform/UVTransform_ScaleUV1-2_OffsetUV0-0.9_Rotate-72_mirrorU.png b/test/models/ReferenceImages/UVTransform/UVTransform_ScaleUV1-2_OffsetUV0-0.9_Rotate-72_mirrorU.png index dd22c1e97..9fdc6daab 100644 Binary files a/test/models/ReferenceImages/UVTransform/UVTransform_ScaleUV1-2_OffsetUV0-0.9_Rotate-72_mirrorU.png and b/test/models/ReferenceImages/UVTransform/UVTransform_ScaleUV1-2_OffsetUV0-0.9_Rotate-72_mirrorU.png differ diff --git a/test/models/ReferenceImages/UVTransform/UVTransform_ScaleUV10-2_OffsetUV10-mirrorUV.png b/test/models/ReferenceImages/UVTransform/UVTransform_ScaleUV10-2_OffsetUV10-mirrorUV.png index 317d4a62c..3e32f1bd5 100644 Binary files a/test/models/ReferenceImages/UVTransform/UVTransform_ScaleUV10-2_OffsetUV10-mirrorUV.png and b/test/models/ReferenceImages/UVTransform/UVTransform_ScaleUV10-2_OffsetUV10-mirrorUV.png differ diff --git a/test/models/ReferenceImages/UVTransform/UVTransform_ScaleUV2x.png b/test/models/ReferenceImages/UVTransform/UVTransform_ScaleUV2x.png index af08afde6..fe9926e41 100644 Binary files a/test/models/ReferenceImages/UVTransform/UVTransform_ScaleUV2x.png and b/test/models/ReferenceImages/UVTransform/UVTransform_ScaleUV2x.png differ diff --git a/test/models/ReferenceImages/UVTransform/UVTransform_ScaleUV2x_Rotate45.png b/test/models/ReferenceImages/UVTransform/UVTransform_ScaleUV2x_Rotate45.png index 9210d2a9c..ac15908c3 100644 Binary files a/test/models/ReferenceImages/UVTransform/UVTransform_ScaleUV2x_Rotate45.png and b/test/models/ReferenceImages/UVTransform/UVTransform_ScaleUV2x_Rotate45.png differ diff --git a/test/models/SIB/This Way Up.png b/test/models/SIB/This Way Up.png index 9cac59ab5..87c8ba1dc 100644 Binary files a/test/models/SIB/This Way Up.png and b/test/models/SIB/This Way Up.png differ diff --git a/test/models/SIB/UV Mapping.png b/test/models/SIB/UV Mapping.png index 952a51d74..3d8e235d4 100644 Binary files a/test/models/SIB/UV Mapping.png and b/test/models/SIB/UV Mapping.png differ diff --git a/test/models/STL/3DSMaxExport.STL b/test/models/STL/3DSMaxExport.STL index d420fd6e7..2576dbb7b 100644 Binary files a/test/models/STL/3DSMaxExport.STL and b/test/models/STL/3DSMaxExport.STL differ diff --git a/test/models/TER/RealisticTerrain_Large.ter b/test/models/TER/RealisticTerrain_Large.ter index d8613d1c5..f51986ac8 100644 Binary files a/test/models/TER/RealisticTerrain_Large.ter and b/test/models/TER/RealisticTerrain_Large.ter differ diff --git a/test/models/X/bottom.tga b/test/models/X/bottom.tga index 5a10ffaae..4d6fd56e6 100644 Binary files a/test/models/X/bottom.tga and b/test/models/X/bottom.tga differ diff --git a/test/models/X/fromtruespace_bin32.x b/test/models/X/fromtruespace_bin32.x index d09fc1564..0333a1a5d 100644 Binary files a/test/models/X/fromtruespace_bin32.x and b/test/models/X/fromtruespace_bin32.x differ diff --git a/test/models/X/test.png b/test/models/X/test.png index e5725bbbd..501fcdecf 100644 Binary files a/test/models/X/test.png and b/test/models/X/test.png differ diff --git a/test/models/X/top.tga b/test/models/X/top.tga index de7292fcf..16691cd1d 100644 Binary files a/test/models/X/top.tga and b/test/models/X/top.tga differ diff --git a/test/models/XGL/Spider_ascii.zgl b/test/models/XGL/Spider_ascii.zgl index 218322dc6..3816eae87 100644 Binary files a/test/models/XGL/Spider_ascii.zgl and b/test/models/XGL/Spider_ascii.zgl differ diff --git a/test/models/glTF/BoxTextured-glTF-MaterialsCommon/CesiumLogoFlat.png b/test/models/glTF/BoxTextured-glTF-MaterialsCommon/CesiumLogoFlat.png index c76b4d1a3..88bada374 100644 Binary files a/test/models/glTF/BoxTextured-glTF-MaterialsCommon/CesiumLogoFlat.png and b/test/models/glTF/BoxTextured-glTF-MaterialsCommon/CesiumLogoFlat.png differ diff --git a/test/models/glTF/BoxTextured-glTF/CesiumLogoFlat.png b/test/models/glTF/BoxTextured-glTF/CesiumLogoFlat.png index c76b4d1a3..88bada374 100644 Binary files a/test/models/glTF/BoxTextured-glTF/CesiumLogoFlat.png and b/test/models/glTF/BoxTextured-glTF/CesiumLogoFlat.png differ diff --git a/test/models/glTF/CesiumMilkTruck/CesiumMilkTruck.png b/test/models/glTF/CesiumMilkTruck/CesiumMilkTruck.png index 1bed7057f..ba7a47c7f 100644 Binary files a/test/models/glTF/CesiumMilkTruck/CesiumMilkTruck.png and b/test/models/glTF/CesiumMilkTruck/CesiumMilkTruck.png differ diff --git a/test/models/glTF2/BoxTextured-glTF-Binary/BoxTextured.glb b/test/models/glTF2/BoxTextured-glTF-Binary/BoxTextured.glb index 19b5546b0..03cd2acf9 100644 Binary files a/test/models/glTF2/BoxTextured-glTF-Binary/BoxTextured.glb and b/test/models/glTF2/BoxTextured-glTF-Binary/BoxTextured.glb differ diff --git a/test/models/glTF2/BoxTextured-glTF-pbrSpecularGlossiness/CesiumLogoFlat.png b/test/models/glTF2/BoxTextured-glTF-pbrSpecularGlossiness/CesiumLogoFlat.png index 8b906c7aa..45d502ed2 100644 Binary files a/test/models/glTF2/BoxTextured-glTF-pbrSpecularGlossiness/CesiumLogoFlat.png and b/test/models/glTF2/BoxTextured-glTF-pbrSpecularGlossiness/CesiumLogoFlat.png differ diff --git a/test/models/glTF2/BoxTextured-glTF-techniqueWebGL/CesiumLogoFlat.png b/test/models/glTF2/BoxTextured-glTF-techniqueWebGL/CesiumLogoFlat.png index 8b906c7aa..45d502ed2 100644 Binary files a/test/models/glTF2/BoxTextured-glTF-techniqueWebGL/CesiumLogoFlat.png and b/test/models/glTF2/BoxTextured-glTF-techniqueWebGL/CesiumLogoFlat.png differ diff --git a/test/models/glTF2/BoxTextured-glTF/CesiumLogoFlat.png b/test/models/glTF2/BoxTextured-glTF/CesiumLogoFlat.png index 8b906c7aa..45d502ed2 100644 Binary files a/test/models/glTF2/BoxTextured-glTF/CesiumLogoFlat.png and b/test/models/glTF2/BoxTextured-glTF/CesiumLogoFlat.png differ diff --git a/test/regression/ai_regression_ui.py b/test/regression/ai_regression_ui.py index 063b51510..30c9b6883 100644 --- a/test/regression/ai_regression_ui.py +++ b/test/regression/ai_regression_ui.py @@ -5,7 +5,7 @@ # Open Asset Import Library (ASSIMP) # --------------------------------------------------------------------------- # -# Copyright (c) 2006-2016, ASSIMP Development Team +# Copyright (c) 2006-2020, ASSIMP Development Team # # All rights reserved. # diff --git a/test/regression/gen_db.py b/test/regression/gen_db.py index ab4e31c72..a704c3a8e 100644 --- a/test/regression/gen_db.py +++ b/test/regression/gen_db.py @@ -5,7 +5,7 @@ # Open Asset Import Library (ASSIMP) # --------------------------------------------------------------------------- # -# Copyright (c) 2006-2010, ASSIMP Development Team +# Copyright (c) 2006-2020, ASSIMP Development Team # # All rights reserved. # diff --git a/test/regression/result_checker.py b/test/regression/result_checker.py index 0155660bc..19772f8af 100644 --- a/test/regression/result_checker.py +++ b/test/regression/result_checker.py @@ -5,7 +5,7 @@ # Open Asset Import Library (ASSIMP) # --------------------------------------------------------------------------- # -# Copyright (c) 2006-2016, ASSIMP Development Team +# Copyright (c) 2006-2020, ASSIMP Development Team # # All rights reserved. # diff --git a/test/regression/run.py b/test/regression/run.py index 1ff46fb17..151d7a82e 100755 --- a/test/regression/run.py +++ b/test/regression/run.py @@ -5,7 +5,7 @@ # Open Asset Import Library (ASSIMP) # --------------------------------------------------------------------------- # -# Copyright (c) 2006-2010, ASSIMP Development Team +# Copyright (c) 2006-2020, ASSIMP Development Team # # All rights reserved. # diff --git a/test/regression/settings.py b/test/regression/settings.py index ad7e67a13..9d0a03664 100644 --- a/test/regression/settings.py +++ b/test/regression/settings.py @@ -5,7 +5,7 @@ # Open Asset Import Library (ASSIMP) # --------------------------------------------------------------------------- # -# Copyright (c) 2006-2010, ASSIMP Development Team +# Copyright (c) 2006-2020, ASSIMP Development Team # # All rights reserved. # diff --git a/test/regression/utils.py b/test/regression/utils.py index 7c759b795..f2c0c26f2 100644 --- a/test/regression/utils.py +++ b/test/regression/utils.py @@ -5,7 +5,7 @@ # Open Asset Import Library (ASSIMP) # --------------------------------------------------------------------------- # -# Copyright (c) 2006-2010, ASSIMP Development Team +# Copyright (c) 2006-2020, ASSIMP Development Team # # All rights reserved. # diff --git a/test/unit/AbstractImportExportBase.cpp b/test/unit/AbstractImportExportBase.cpp index bf89fa5d4..1e3e13fb3 100644 --- a/test/unit/AbstractImportExportBase.cpp +++ b/test/unit/AbstractImportExportBase.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/AbstractImportExportBase.h b/test/unit/AbstractImportExportBase.h index d6ae37d60..72530aedc 100644 --- a/test/unit/AbstractImportExportBase.h +++ b/test/unit/AbstractImportExportBase.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/test/unit/AssimpAPITest.cpp b/test/unit/AssimpAPITest.cpp index 3e1d97314..c30f6f384 100644 --- a/test/unit/AssimpAPITest.cpp +++ b/test/unit/AssimpAPITest.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/Common/utLineSplitter.cpp b/test/unit/Common/utLineSplitter.cpp index 2aa581add..15965904c 100644 --- a/test/unit/Common/utLineSplitter.cpp +++ b/test/unit/Common/utLineSplitter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/ImportExport/MDL/MDLHL1TestFiles.h b/test/unit/ImportExport/MDL/MDLHL1TestFiles.h index b4766b5e5..8a60c501a 100644 --- a/test/unit/ImportExport/MDL/MDLHL1TestFiles.h +++ b/test/unit/ImportExport/MDL/MDLHL1TestFiles.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/ImportExport/MDL/utMDLImporter_HL1_ImportSettings.cpp b/test/unit/ImportExport/MDL/utMDLImporter_HL1_ImportSettings.cpp index eaf6e4eca..6411126cb 100644 --- a/test/unit/ImportExport/MDL/utMDLImporter_HL1_ImportSettings.cpp +++ b/test/unit/ImportExport/MDL/utMDLImporter_HL1_ImportSettings.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/ImportExport/MDL/utMDLImporter_HL1_Materials.cpp b/test/unit/ImportExport/MDL/utMDLImporter_HL1_Materials.cpp index df008e115..79be7c280 100644 --- a/test/unit/ImportExport/MDL/utMDLImporter_HL1_Materials.cpp +++ b/test/unit/ImportExport/MDL/utMDLImporter_HL1_Materials.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/ImportExport/MDL/utMDLImporter_HL1_Nodes.cpp b/test/unit/ImportExport/MDL/utMDLImporter_HL1_Nodes.cpp index 9b20b2caa..50e188833 100644 --- a/test/unit/ImportExport/MDL/utMDLImporter_HL1_Nodes.cpp +++ b/test/unit/ImportExport/MDL/utMDLImporter_HL1_Nodes.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/ImportExport/utAssjsonImportExport.cpp b/test/unit/ImportExport/utAssjsonImportExport.cpp index 82dbf8b57..def7808c3 100644 --- a/test/unit/ImportExport/utAssjsonImportExport.cpp +++ b/test/unit/ImportExport/utAssjsonImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/test/unit/ImportExport/utCOBImportExport.cpp b/test/unit/ImportExport/utCOBImportExport.cpp index d80757e53..691ff9f3c 100644 --- a/test/unit/ImportExport/utCOBImportExport.cpp +++ b/test/unit/ImportExport/utCOBImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team @@ -43,22 +43,68 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "UnitTestPCH.h" #include "SceneDiffer.h" -#include "AbstractImportExportBase.h" #include #include using namespace Assimp; -class utCOBImportExport : public AbstractImportExportBase { -public: - virtual bool importerTest() { - Assimp::Importer importer; - const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/COB/molecule.cob", aiProcess_ValidateDataStructure); - return nullptr != scene; - } -}; -TEST_F(utCOBImportExport, importAMFFromFileTest) { - EXPECT_TRUE(importerTest()); +TEST(utCOBImporter, importDwarfASCII) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/COB/dwarf_ascii.cob", aiProcess_ValidateDataStructure); + // FIXME: this is wrong, it should succeed + // change to ASSERT_NE after it's been fixed + ASSERT_EQ(nullptr, scene); +} + + +TEST(utCOBImporter, importDwarf) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/COB/dwarf.cob", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utCOBImporter, importMoleculeASCII) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/COB/molecule_ascii.cob", aiProcess_ValidateDataStructure); + // FIXME: this is wrong, it should succeed + // change to ASSERT_NE after it's been fixed + ASSERT_EQ(nullptr, scene); +} + + +TEST(utCOBImporter, importMolecule) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/COB/molecule.cob", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utCOBImporter, importSpider43ASCII) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/COB/spider_4_3_ascii.cob", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utCOBImporter, importSpider43) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/COB/spider_4_3.cob", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utCOBImporter, importSpider66ASCII) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/COB/spider_6_6_ascii.cob", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utCOBImporter, importSpider66) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/COB/spider_6_6.cob", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); } diff --git a/test/unit/ImportExport/utExporter.cpp b/test/unit/ImportExport/utExporter.cpp index 43e711cb3..1ad1ec613 100644 --- a/test/unit/ImportExport/utExporter.cpp +++ b/test/unit/ImportExport/utExporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/ImportExport/utMD2Importer.cpp b/test/unit/ImportExport/utMD2Importer.cpp new file mode 100644 index 000000000..9bafd881c --- /dev/null +++ b/test/unit/ImportExport/utMD2Importer.cpp @@ -0,0 +1,87 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2020, assimp team + + + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ + +#include "UnitTestPCH.h" + +#include +#include +#include + + +using namespace Assimp; + + + +TEST(utMD2Importer, importFaerie) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/MD2/faerie.md2", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utMD2Importer, importSydney) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/MD2/sydney.md2", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utMD2Importer, importDolphin) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_NONBSD_DIR "/MD2/dolphin.md2", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utMD2Importer, importFlag) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_NONBSD_DIR "/MD2/flag.md2", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utMD2Importer, importHorse) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_NONBSD_DIR "/MD2/horse.md2", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} diff --git a/test/unit/ImportExport/utMD3Importer.cpp b/test/unit/ImportExport/utMD3Importer.cpp new file mode 100644 index 000000000..212fb6338 --- /dev/null +++ b/test/unit/ImportExport/utMD3Importer.cpp @@ -0,0 +1,73 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2020, assimp team + + + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ + +#include "UnitTestPCH.h" + +#include +#include +#include + + +using namespace Assimp; + + + +TEST(utMD3Importer, importWatercan) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_NONBSD_DIR "/MD3/watercan.md3", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utMD3Importer, importWatercan_dmg) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_NONBSD_DIR "/MD3/watercan_dmg.md3", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utMD3Importer, importEuropean_fnt_v2) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_NONBSD_DIR "/MD3/q3root/models/mapobjects/kt_kubalwagon/european_fnt_v2.md3", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} diff --git a/test/unit/ImportExport/utMD5Importer.cpp b/test/unit/ImportExport/utMD5Importer.cpp new file mode 100644 index 000000000..941d20e9d --- /dev/null +++ b/test/unit/ImportExport/utMD5Importer.cpp @@ -0,0 +1,80 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2020, assimp team + + + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above +copyright notice, this list of conditions and the +following disclaimer. + +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the +following disclaimer in the documentation and/or other +materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its +contributors may be used to endorse or promote products +derived from this software without specific prior +written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ + +#include "UnitTestPCH.h" + +#include +#include +#include + + +using namespace Assimp; + + + +TEST(utMD5Importer, importEmpty) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/MD5/invalid/empty.md5mesh", aiProcess_ValidateDataStructure); + ASSERT_EQ(nullptr, scene); +} + + +TEST(utMD5Importer, importSimpleCube) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/MD5/SimpleCube.md5mesh", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utMD5Importer, importBoarMan) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_NONBSD_DIR "/MD5/BoarMan.md5mesh", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utMD5Importer, importBob) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_NONBSD_DIR "/MD5/Bob.md5mesh", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} diff --git a/test/unit/ImportExport/utMDLImporter.cpp b/test/unit/ImportExport/utMDLImporter.cpp index 4c7149f54..b9a850175 100644 --- a/test/unit/ImportExport/utMDLImporter.cpp +++ b/test/unit/ImportExport/utMDLImporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team @@ -57,13 +57,24 @@ public: virtual bool importerTest() { Assimp::Importer importer; - const aiScene *scene = importer.ReadFile(MDL_HL1_FILE_MAN, 0); - EXPECT_NE(nullptr, scene); + importerTest_HL1(&importer); // Add further MDL tests... return true; } + +private: + void importerTest_HL1(Assimp::Importer* const importer) { + const aiScene *scene = importer->ReadFile(MDL_HL1_FILE_MAN, 0); + EXPECT_NE(nullptr, scene); + + // Test that the importer can directly load an HL1 MDL external texture file. + scene = importer->ReadFile(ASSIMP_TEST_MDL_HL1_MODELS_DIR "manT.mdl", aiProcess_ValidateDataStructure); + EXPECT_NE(nullptr, scene); + EXPECT_NE(0u, scene->mNumTextures); + EXPECT_NE(0u, scene->mNumMaterials); + } }; TEST_F(utMDLImporter, importMDLFromFileTest) { diff --git a/test/unit/ImportExport/utNFFImportExport.cpp b/test/unit/ImportExport/utNFFImportExport.cpp index d2fc1df5f..f4d4b3f6a 100644 --- a/test/unit/ImportExport/utNFFImportExport.cpp +++ b/test/unit/ImportExport/utNFFImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/ImportExport/utOFFImportExport.cpp b/test/unit/ImportExport/utOFFImportExport.cpp index eadd48b12..e642d64a2 100644 --- a/test/unit/ImportExport/utOFFImportExport.cpp +++ b/test/unit/ImportExport/utOFFImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/ImportExport/utOgreImportExport.cpp b/test/unit/ImportExport/utOgreImportExport.cpp index 608d0b068..812bde7ce 100644 --- a/test/unit/ImportExport/utOgreImportExport.cpp +++ b/test/unit/ImportExport/utOgreImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/ImportExport/utQ3BSPFileImportExport.cpp b/test/unit/ImportExport/utQ3BSPFileImportExport.cpp index 70d89f1d2..7cb02b3ea 100644 --- a/test/unit/ImportExport/utQ3BSPFileImportExport.cpp +++ b/test/unit/ImportExport/utQ3BSPFileImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/ImportExport/utXGLImportExport.cpp b/test/unit/ImportExport/utXGLImportExport.cpp index 89e780e20..32303a0cb 100644 --- a/test/unit/ImportExport/utXGLImportExport.cpp +++ b/test/unit/ImportExport/utXGLImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team @@ -42,22 +42,64 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "UnitTestPCH.h" -#include "AbstractImportExportBase.h" #include #include + using namespace Assimp; -class utXGLImportExport : public AbstractImportExportBase { -public: - virtual bool importerTest() { - Assimp::Importer importer; - const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/XGL/sample_official.xgl", 0); - return true; - return nullptr != scene; - } -}; -TEST_F(utXGLImportExport, importXGLFromFileTest) { - EXPECT_TRUE(importerTest()); +TEST(utXGLImporter, importBCN_Epileptic) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/XGL/BCN_Epileptic.zgl", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utXGLImporter, importCubesWithAlpha) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/XGL/cubes_with_alpha.zgl", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utXGLImporter, importSample_official) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/XGL/sample_official.xgl", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utXGLImporter, importSample_official_asxml) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/XGL/sample_official_asxml.xml", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utXGLImporter, importSphereWithMatGloss) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/XGL/sphere_with_mat_gloss_10pc.zgl", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utXGLImporter, importSpiderASCII) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/XGL/Spider_ascii.zgl", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utXGLImporter, importWuson) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/XGL/Wuson.zgl", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utXGLImporter, importWusonDXF) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/XGL/wuson_dxf.zgl", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); } diff --git a/test/unit/SceneDiffer.cpp b/test/unit/SceneDiffer.cpp index 684d9fee6..5a9184954 100644 --- a/test/unit/SceneDiffer.cpp +++ b/test/unit/SceneDiffer.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/SceneDiffer.h b/test/unit/SceneDiffer.h index 2a8bdae33..98f7ddcdc 100644 --- a/test/unit/SceneDiffer.h +++ b/test/unit/SceneDiffer.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/TestIOStream.h b/test/unit/TestIOStream.h index 3dbfc45e3..2f7280e2f 100644 --- a/test/unit/TestIOStream.h +++ b/test/unit/TestIOStream.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2016, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/test/unit/TestIOSystem.h b/test/unit/TestIOSystem.h index 5749df45b..25e7bc738 100644 --- a/test/unit/TestIOSystem.h +++ b/test/unit/TestIOSystem.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/test/unit/TestModelFactory.h b/test/unit/TestModelFactory.h index 0e48fb744..9a31a87a6 100644 --- a/test/unit/TestModelFactory.h +++ b/test/unit/TestModelFactory.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/UTLogStream.h b/test/unit/UTLogStream.h index e679249df..b02dbac54 100644 --- a/test/unit/UTLogStream.h +++ b/test/unit/UTLogStream.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/test/unit/UnitTestFileGenerator.h b/test/unit/UnitTestFileGenerator.h index 2e4aede0f..91d69357f 100644 --- a/test/unit/UnitTestFileGenerator.h +++ b/test/unit/UnitTestFileGenerator.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2017, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/test/unit/UnitTestPCH.h b/test/unit/UnitTestPCH.h index 0d5f08992..d47371292 100644 --- a/test/unit/UnitTestPCH.h +++ b/test/unit/UnitTestPCH.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2017, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/test/unit/ut3DImportExport.cpp b/test/unit/ut3DImportExport.cpp index a3a3197cc..4588289e2 100644 --- a/test/unit/ut3DImportExport.cpp +++ b/test/unit/ut3DImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team @@ -42,23 +42,30 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "UnitTestPCH.h" -#include "SceneDiffer.h" -#include "AbstractImportExportBase.h" #include #include + using namespace Assimp; -class ut3DImportExport : public AbstractImportExportBase { -public: - virtual bool importerTest() { - Assimp::Importer importer; - const aiScene *scene = importer.ReadFile( ASSIMP_TEST_MODELS_DIR "/3D/box_a.3d", aiProcess_ValidateDataStructure ); - return nullptr != scene; - } -}; -TEST_F( ut3DImportExport, import3DFromFileTest ) { - EXPECT_TRUE( importerTest() ); +TEST(ut3DImportExport, importBoxA) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/3D/box_a.3d", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(ut3DImportExport, importBoxD) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/3D/box_d.3d", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(ut3DImportExport, importBoxUC) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/3D/box.uc", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); } diff --git a/test/unit/ut3DSImportExport.cpp b/test/unit/ut3DSImportExport.cpp index edec1d793..dce3ef88e 100644 --- a/test/unit/ut3DSImportExport.cpp +++ b/test/unit/ut3DSImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utACImportExport.cpp b/test/unit/utACImportExport.cpp index 192de16a0..9846cffe1 100644 --- a/test/unit/utACImportExport.cpp +++ b/test/unit/utACImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team @@ -42,23 +42,81 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "UnitTestPCH.h" -#include "SceneDiffer.h" -#include "AbstractImportExportBase.h" #include #include + using namespace Assimp; -class utACImportExport : public AbstractImportExportBase { -public: - virtual bool importerTest() { - Assimp::Importer importer; - const aiScene *scene = importer.ReadFile( ASSIMP_TEST_MODELS_DIR "/AC/Wuson.ac", aiProcess_ValidateDataStructure ); - return nullptr != scene; - } -}; -TEST_F( utACImportExport, importACFromFileTest ) { - EXPECT_TRUE( importerTest() ); +TEST(utACImportExport, importClosedLine) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/AC/closedLine.ac", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); } + + +TEST(utACImportExport, importNoSurfaces) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/AC/nosurfaces.ac", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utACImportExport, importOpenLine) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/AC/openLine.ac", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utACImportExport, importSampleSubdiv) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/AC/sample_subdiv.ac", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utACImportExport, importSphereWithLight) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/AC/SphereWithLight.ac", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utACImportExport, importSphereWithLightUTF16) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/AC/SphereWithLight_UTF16LE.ac", aiProcess_ValidateDataStructure); + // FIXME: this is probably wrong, loading the file should succeed + ASSERT_EQ(nullptr, scene); +} + + +TEST(utACImportExport, importSphereWithLightUTF8BOM) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/AC/SphereWithLight_UTF8BOM.ac", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utACImportExport, importSphereWithLightUvScaling4X) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/AC/SphereWithLightUvScaling4X.ac", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utACImportExport, importWuson) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/AC/Wuson.ac", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utACImportExport, testFormatDetection) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/AC/TestFormatDetection", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + diff --git a/test/unit/utAMFImportExport.cpp b/test/unit/utAMFImportExport.cpp index 6eb0b4418..4c783db35 100644 --- a/test/unit/utAMFImportExport.cpp +++ b/test/unit/utAMFImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/test/unit/utASEImportExport.cpp b/test/unit/utASEImportExport.cpp index 313f0f83a..01bed091f 100644 --- a/test/unit/utASEImportExport.cpp +++ b/test/unit/utASEImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/test/unit/utAnim.cpp b/test/unit/utAnim.cpp index 7d4cff7d1..752b403fc 100644 --- a/test/unit/utAnim.cpp +++ b/test/unit/utAnim.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/test/unit/utArmaturePopulate.cpp b/test/unit/utArmaturePopulate.cpp index 8eb577d61..e70ed053a 100644 --- a/test/unit/utArmaturePopulate.cpp +++ b/test/unit/utArmaturePopulate.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utAssbinImportExport.cpp b/test/unit/utAssbinImportExport.cpp index 42504df56..b8839e4fe 100644 --- a/test/unit/utAssbinImportExport.cpp +++ b/test/unit/utAssbinImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/test/unit/utB3DImportExport.cpp b/test/unit/utB3DImportExport.cpp index ea75b1939..93b08d8a2 100644 --- a/test/unit/utB3DImportExport.cpp +++ b/test/unit/utB3DImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/test/unit/utBVHImportExport.cpp b/test/unit/utBVHImportExport.cpp index c4ed43cf8..137bcd376 100644 --- a/test/unit/utBVHImportExport.cpp +++ b/test/unit/utBVHImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utBatchLoader.cpp b/test/unit/utBatchLoader.cpp index 36dcbf288..c73508bf0 100644 --- a/test/unit/utBatchLoader.cpp +++ b/test/unit/utBatchLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utBlendImportAreaLight.cpp b/test/unit/utBlendImportAreaLight.cpp index a259294aa..8d9c98d62 100644 --- a/test/unit/utBlendImportAreaLight.cpp +++ b/test/unit/utBlendImportAreaLight.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utBlendImportMaterials.cpp b/test/unit/utBlendImportMaterials.cpp index 151c614c0..d0676b026 100644 --- a/test/unit/utBlendImportMaterials.cpp +++ b/test/unit/utBlendImportMaterials.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utBlenderImportExport.cpp b/test/unit/utBlenderImportExport.cpp index b2d268497..e9a356d79 100644 --- a/test/unit/utBlenderImportExport.cpp +++ b/test/unit/utBlenderImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team @@ -60,3 +60,175 @@ public: TEST_F( utBlenderImporterExporter, importBlenFromFileTest ) { EXPECT_TRUE( importerTest() ); } + + +TEST( utBlenderImporter, import4cubes ) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/4Cubes4Mats_248.blend", aiProcess_ValidateDataStructure); + // FIXME: this is probably not right, loading this should succeed + ASSERT_EQ(nullptr, scene); +} + + +TEST( utBlenderImporter, import269_regress1 ) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/blender_269_regress1.blend", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST( utBlenderImporter, importBlenderDefault248 ) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderDefault_248.blend", aiProcess_ValidateDataStructure); + // FIXME: this is probably not right, loading this should succeed + ASSERT_EQ(nullptr, scene); +} + + +TEST( utBlenderImporter, importBlenderDefault250 ) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderDefault_250.blend", aiProcess_ValidateDataStructure); + // FIXME: this is probably not right, loading this should succeed + ASSERT_EQ(nullptr, scene); +} + + +TEST( utBlenderImporter, importBlenderDefault250Compressed ) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderDefault_250_Compressed.blend", aiProcess_ValidateDataStructure); + // FIXME: this is probably not right, loading this should succeed + ASSERT_EQ(nullptr, scene); +} + + +TEST( utBlenderImporter, importBlenderDefault262 ) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderDefault_262.blend", aiProcess_ValidateDataStructure); + // FIXME: this is probably not right, loading this should succeed + ASSERT_EQ(nullptr, scene); +} + + +TEST( utBlenderImporter, importBlenderDefault269 ) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderDefault_269.blend", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST( utBlenderImporter, importBlenderDefault271 ) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderDefault_271.blend", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST( utBlenderImporter, importCubeHierarchy_248 ) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/CubeHierarchy_248.blend", aiProcess_ValidateDataStructure); + // FIXME: this is probably not right, loading this should succeed + ASSERT_EQ(nullptr, scene); +} + + +TEST( utBlenderImporter, importHuman ) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/HUMAN.blend", aiProcess_ValidateDataStructure); + // FIXME: this is probably not right, loading this should succeed + ASSERT_EQ(nullptr, scene); +} + + +TEST( utBlenderImporter, importMirroredCube_252 ) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/MirroredCube_252.blend", aiProcess_ValidateDataStructure); + // FIXME: this is probably not right, loading this should succeed + ASSERT_EQ(nullptr, scene); +} + + +TEST( utBlenderImporter, importNoisyTexturedCube_VoronoiGlob_248 ) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/NoisyTexturedCube_VoronoiGlob_248.blend", aiProcess_ValidateDataStructure); + // FIXME: this is probably not right, loading this should succeed + ASSERT_EQ(nullptr, scene); +} + + +TEST( utBlenderImporter, importSmoothVsSolidCube_248 ) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/SmoothVsSolidCube_248.blend", aiProcess_ValidateDataStructure); + // FIXME: this is probably not right, loading this should succeed + ASSERT_EQ(nullptr, scene); +} + + +TEST( utBlenderImporter, importSuzanne_248 ) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/Suzanne_248.blend", aiProcess_ValidateDataStructure); + // FIXME: this is probably not right, loading this should succeed + ASSERT_EQ(nullptr, scene); +} + + +TEST( utBlenderImporter, importSuzanneSubdiv_252 ) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/SuzanneSubdiv_252.blend", aiProcess_ValidateDataStructure); + // FIXME: this is probably not right, loading this should succeed + ASSERT_EQ(nullptr, scene); +} + + +TEST( utBlenderImporter, importTexturedCube_ImageGlob_248 ) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/TexturedCube_ImageGlob_248.blend", aiProcess_ValidateDataStructure); + // FIXME: this is probably not right, loading this should succeed + ASSERT_EQ(nullptr, scene); +} + + +TEST( utBlenderImporter, importTexturedPlane_ImageUv_248 ) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/TexturedPlane_ImageUv_248.blend", aiProcess_ValidateDataStructure); + // FIXME: this is probably not right, loading this should succeed + ASSERT_EQ(nullptr, scene); +} + + +TEST( utBlenderImporter, importTexturedPlane_ImageUvPacked_248 ) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/TexturedPlane_ImageUvPacked_248.blend", aiProcess_ValidateDataStructure); + // FIXME: this is probably not right, loading this should succeed + ASSERT_EQ(nullptr, scene); +} + + +TEST( utBlenderImporter, importTorusLightsCams_250_compressed ) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/TorusLightsCams_250_compressed.blend", aiProcess_ValidateDataStructure); + // FIXME: this is probably not right, loading this should succeed + ASSERT_EQ(nullptr, scene); +} + + +TEST( utBlenderImporter, import_yxa_1 ) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/yxa_1.blend", aiProcess_ValidateDataStructure); + // FIXME: this is probably not right, loading this should succeed + ASSERT_EQ(nullptr, scene); +} + + +TEST( utBlenderImporter, importBob ) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_NONBSD_DIR "/BLEND/Bob.blend", aiProcess_ValidateDataStructure); + // FIXME: this is probably not right, loading this should succeed + ASSERT_EQ(nullptr, scene); +} + + +TEST( utBlenderImporter, importFleurOptonl ) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_NONBSD_DIR "/BLEND/fleurOptonl.blend", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} diff --git a/test/unit/utBlenderIntermediate.cpp b/test/unit/utBlenderIntermediate.cpp index 30f29017d..201d18e91 100644 --- a/test/unit/utBlenderIntermediate.cpp +++ b/test/unit/utBlenderIntermediate.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utBlenderWork.cpp b/test/unit/utBlenderWork.cpp index c0e3347ab..eb3208fe6 100644 --- a/test/unit/utBlenderWork.cpp +++ b/test/unit/utBlenderWork.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/test/unit/utCSMImportExport.cpp b/test/unit/utCSMImportExport.cpp index 7f6ae0f4e..e1b32fb6e 100644 --- a/test/unit/utCSMImportExport.cpp +++ b/test/unit/utCSMImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utColladaExportCamera.cpp b/test/unit/utColladaExportCamera.cpp index ff84422e5..954c19bca 100644 --- a/test/unit/utColladaExportCamera.cpp +++ b/test/unit/utColladaExportCamera.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utColladaExportLight.cpp b/test/unit/utColladaExportLight.cpp index 502cecf3a..10b10852f 100644 --- a/test/unit/utColladaExportLight.cpp +++ b/test/unit/utColladaExportLight.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team @@ -43,6 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "UnitTestPCH.h" #include +#include #include #include #include @@ -75,7 +76,7 @@ TEST_F(ColladaExportLight, testExportLight) const char* file = "lightsExp.dae"; const aiScene* pTest = im->ReadFile(ASSIMP_TEST_MODELS_DIR "/Collada/lights.dae", aiProcess_ValidateDataStructure); - ASSERT_TRUE(pTest!=NULL); + ASSERT_NE(pTest, nullptr); ASSERT_TRUE(pTest->HasLights()); const unsigned int origNumLights( pTest->mNumLights ); @@ -86,15 +87,63 @@ TEST_F(ColladaExportLight, testExportLight) origLights[ i ] = *(pTest->mLights[ i ]); } - EXPECT_EQ(AI_SUCCESS,ex->Export(pTest,"collada",file)); + // Common metadata + // Confirm was loaded by the Collada importer + aiString origImporter; + EXPECT_TRUE(pTest->mMetaData->Get(AI_METADATA_SOURCE_FORMAT, origImporter)) << "No importer format metadata"; + EXPECT_STREQ("Collada Importer", origImporter.C_Str()); + + aiString origGenerator; + EXPECT_TRUE(pTest->mMetaData->Get(AI_METADATA_SOURCE_GENERATOR, origGenerator)) << "No generator metadata"; + EXPECT_EQ(strncmp(origGenerator.C_Str(), "Blender", 7), 0) << "AI_METADATA_SOURCE_GENERATOR was: " << origGenerator.C_Str(); + + aiString origCopyright; + EXPECT_TRUE(pTest->mMetaData->Get(AI_METADATA_SOURCE_COPYRIGHT, origCopyright)) << "No copyright metadata"; + EXPECT_STREQ("BSD", origCopyright.C_Str()); + + aiString origCreated; + EXPECT_TRUE(pTest->mMetaData->Get("Created", origCreated)) << "No created metadata"; + EXPECT_STREQ("2015-05-17T21:55:44", origCreated.C_Str()); + + aiString origModified; + EXPECT_TRUE(pTest->mMetaData->Get("Modified", origModified)) << "No modified metadata"; + EXPECT_STREQ("2015-05-17T21:55:44", origModified.C_Str()); + + EXPECT_EQ(AI_SUCCESS, ex->Export(pTest, "collada", file)); + + // Drop the pointer as about to become invalid + pTest = nullptr; const aiScene* imported = im->ReadFile(file, aiProcess_ValidateDataStructure); - ASSERT_TRUE(imported!=NULL); + ASSERT_TRUE(imported != NULL); + // Check common metadata survived roundtrip + aiString readImporter; + EXPECT_TRUE(imported->mMetaData->Get(AI_METADATA_SOURCE_FORMAT, readImporter)) << "No importer format metadata after export"; + EXPECT_STREQ(origImporter.C_Str(), readImporter.C_Str()) << "Assimp Importer Format changed"; + + aiString readGenerator; + EXPECT_TRUE(imported->mMetaData->Get(AI_METADATA_SOURCE_GENERATOR, readGenerator)) << "No generator metadata"; + EXPECT_STREQ(origGenerator.C_Str(), readGenerator.C_Str()) << "Generator changed"; + + aiString readCopyright; + EXPECT_TRUE(imported->mMetaData->Get(AI_METADATA_SOURCE_COPYRIGHT, readCopyright)) << "No copyright metadata"; + EXPECT_STREQ(origCopyright.C_Str(), readCopyright.C_Str()) << "Copyright changed"; + + aiString readCreated; + EXPECT_TRUE(imported->mMetaData->Get("Created", readCreated)) << "No created metadata"; + EXPECT_STREQ(origCreated.C_Str(), readCreated.C_Str()) << "Created date changed"; + + aiString readModified; + EXPECT_TRUE(imported->mMetaData->Get("Modified", readModified)) << "No modified metadata"; + EXPECT_STRNE(origModified.C_Str(), readModified.C_Str()) << "Modified date did not change"; + EXPECT_GT(readModified.length, ai_uint32(18)) << "Modified date too short"; + + // Lights EXPECT_TRUE(imported->HasLights()); - EXPECT_EQ( origNumLights,imported->mNumLights ); - for(size_t i=0; i< origNumLights; i++) { + EXPECT_EQ(origNumLights, imported->mNumLights); + for(size_t i=0; i < origNumLights; i++) { const aiLight *orig = &origLights[ i ]; const aiLight *read = imported->mLights[i]; EXPECT_EQ( 0,strncmp(origNames[ i ].c_str(),read->mName.C_Str(), origNames[ i ].size() ) ); diff --git a/test/unit/utColladaImportExport.cpp b/test/unit/utColladaImportExport.cpp index 8bce3a3dd..870c015b5 100644 --- a/test/unit/utColladaImportExport.cpp +++ b/test/unit/utColladaImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team @@ -40,76 +40,91 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------- */ -#include "UnitTestPCH.h" #include "AbstractImportExportBase.h" +#include "UnitTestPCH.h" -#include -#include +#include #include +#include +#include using namespace Assimp; class utColladaImportExport : public AbstractImportExportBase { public: - virtual bool importerTest() { - Assimp::Importer importer; - const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/Collada/duck.dae", aiProcess_ValidateDataStructure); - if (scene == nullptr) - return false; + virtual bool importerTest() { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/Collada/duck.dae", aiProcess_ValidateDataStructure); + if (scene == nullptr) + return false; - // Expected number of items - EXPECT_EQ(scene->mNumMeshes, 1u); - EXPECT_EQ(scene->mNumMaterials, 1u); - EXPECT_EQ(scene->mNumAnimations, 0u); - EXPECT_EQ(scene->mNumTextures, 0u); - EXPECT_EQ(scene->mNumLights, 1u); - EXPECT_EQ(scene->mNumCameras, 1u); + // Expected number of items + EXPECT_EQ(scene->mNumMeshes, 1u); + EXPECT_EQ(scene->mNumMaterials, 1u); + EXPECT_EQ(scene->mNumAnimations, 0u); + EXPECT_EQ(scene->mNumTextures, 0u); + EXPECT_EQ(scene->mNumLights, 1u); + EXPECT_EQ(scene->mNumCameras, 1u); - return true; - } + // Expected common metadata + aiString value; + EXPECT_TRUE(scene->mMetaData->Get(AI_METADATA_SOURCE_FORMAT, value)) << "No importer format metadata"; + EXPECT_STREQ("Collada Importer", value.C_Str()); + + EXPECT_TRUE(scene->mMetaData->Get(AI_METADATA_SOURCE_FORMAT_VERSION, value)) << "No format version metadata"; + EXPECT_STREQ("1.4.1", value.C_Str()); + + EXPECT_TRUE(scene->mMetaData->Get(AI_METADATA_SOURCE_GENERATOR, value)) << "No generator metadata"; + EXPECT_EQ(strncmp(value.C_Str(), "Maya 8.0", 8), 0) << "AI_METADATA_SOURCE_GENERATOR was: " << value.C_Str(); + + EXPECT_TRUE(scene->mMetaData->Get(AI_METADATA_SOURCE_COPYRIGHT, value)) << "No copyright metadata"; + EXPECT_EQ(strncmp(value.C_Str(), "Copyright 2006", 14), 0) << "AI_METADATA_SOURCE_COPYRIGHT was: " << value.C_Str(); + + return true; + } }; TEST_F(utColladaImportExport, importBlenFromFileTest) { - EXPECT_TRUE(importerTest()); + EXPECT_TRUE(importerTest()); } class utColladaZaeImportExport : public AbstractImportExportBase { public: - virtual bool importerTest() { - { - Assimp::Importer importer; - const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/Collada/duck.zae", aiProcess_ValidateDataStructure); - if (scene == nullptr) - return false; + virtual bool importerTest() { + { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/Collada/duck.zae", aiProcess_ValidateDataStructure); + if (scene == nullptr) + return false; - // Expected number of items - EXPECT_EQ(scene->mNumMeshes, 1u); - EXPECT_EQ(scene->mNumMaterials, 1u); - EXPECT_EQ(scene->mNumAnimations, 0u); - EXPECT_EQ(scene->mNumTextures, 1u); - EXPECT_EQ(scene->mNumLights, 1u); - EXPECT_EQ(scene->mNumCameras, 1u); - } + // Expected number of items + EXPECT_EQ(scene->mNumMeshes, 1u); + EXPECT_EQ(scene->mNumMaterials, 1u); + EXPECT_EQ(scene->mNumAnimations, 0u); + EXPECT_EQ(scene->mNumTextures, 1u); + EXPECT_EQ(scene->mNumLights, 1u); + EXPECT_EQ(scene->mNumCameras, 1u); + } - { - Assimp::Importer importer; - const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/Collada/duck_nomanifest.zae", aiProcess_ValidateDataStructure); - if (scene == nullptr) - return false; + { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/Collada/duck_nomanifest.zae", aiProcess_ValidateDataStructure); + if (scene == nullptr) + return false; - // Expected number of items - EXPECT_EQ(scene->mNumMeshes, 1u); - EXPECT_EQ(scene->mNumMaterials, 1u); - EXPECT_EQ(scene->mNumAnimations, 0u); - EXPECT_EQ(scene->mNumTextures, 1u); - EXPECT_EQ(scene->mNumLights, 1u); - EXPECT_EQ(scene->mNumCameras, 1u); - } + // Expected number of items + EXPECT_EQ(scene->mNumMeshes, 1u); + EXPECT_EQ(scene->mNumMaterials, 1u); + EXPECT_EQ(scene->mNumAnimations, 0u); + EXPECT_EQ(scene->mNumTextures, 1u); + EXPECT_EQ(scene->mNumLights, 1u); + EXPECT_EQ(scene->mNumCameras, 1u); + } - return true; - } + return true; + } }; TEST_F(utColladaZaeImportExport, importBlenFromFileTest) { - EXPECT_TRUE(importerTest()); + EXPECT_TRUE(importerTest()); } diff --git a/test/unit/utD3MFImportExport.cpp b/test/unit/utD3MFImportExport.cpp index c9b17d898..a1f3e4c95 100644 --- a/test/unit/utD3MFImportExport.cpp +++ b/test/unit/utD3MFImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utDXFImporterExporter.cpp b/test/unit/utDXFImporterExporter.cpp index af57ffc79..922ee29b2 100644 --- a/test/unit/utDXFImporterExporter.cpp +++ b/test/unit/utDXFImporterExporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utDefaultIOStream.cpp b/test/unit/utDefaultIOStream.cpp index bfc82a620..fb65a4960 100644 --- a/test/unit/utDefaultIOStream.cpp +++ b/test/unit/utDefaultIOStream.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utFBXImporterExporter.cpp b/test/unit/utFBXImporterExporter.cpp index fd350850f..ab35ab768 100644 --- a/test/unit/utFBXImporterExporter.cpp +++ b/test/unit/utFBXImporterExporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utFastAtof.cpp b/test/unit/utFastAtof.cpp index ef1e72202..3eefbe3c3 100644 --- a/test/unit/utFastAtof.cpp +++ b/test/unit/utFastAtof.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utFindDegenerates.cpp b/test/unit/utFindDegenerates.cpp index 064031f34..d645655c0 100644 --- a/test/unit/utFindDegenerates.cpp +++ b/test/unit/utFindDegenerates.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/test/unit/utFindInvalidData.cpp b/test/unit/utFindInvalidData.cpp index 7c70a71a9..4b91104a5 100644 --- a/test/unit/utFindInvalidData.cpp +++ b/test/unit/utFindInvalidData.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/test/unit/utFixInfacingNormals.cpp b/test/unit/utFixInfacingNormals.cpp index 40b962dcb..d23064eab 100644 --- a/test/unit/utFixInfacingNormals.cpp +++ b/test/unit/utFixInfacingNormals.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utGenBoundingBoxesProcess.cpp b/test/unit/utGenBoundingBoxesProcess.cpp index 2c2f831bc..946bced84 100644 --- a/test/unit/utGenBoundingBoxesProcess.cpp +++ b/test/unit/utGenBoundingBoxesProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/test/unit/utGenNormals.cpp b/test/unit/utGenNormals.cpp index 36f0b18bc..a51e81db6 100644 --- a/test/unit/utGenNormals.cpp +++ b/test/unit/utGenNormals.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utHMPImportExport.cpp b/test/unit/utHMPImportExport.cpp index 35f4583aa..899eea66c 100644 --- a/test/unit/utHMPImportExport.cpp +++ b/test/unit/utHMPImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utIFCImportExport.cpp b/test/unit/utIFCImportExport.cpp index 3f7cf7c8c..6e8862a2a 100644 --- a/test/unit/utIFCImportExport.cpp +++ b/test/unit/utIFCImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utIOStreamBuffer.cpp b/test/unit/utIOStreamBuffer.cpp index 6c6153135..10982b313 100644 --- a/test/unit/utIOStreamBuffer.cpp +++ b/test/unit/utIOStreamBuffer.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utIOSystem.cpp b/test/unit/utIOSystem.cpp index 80165fe79..c7bd6dc13 100644 --- a/test/unit/utIOSystem.cpp +++ b/test/unit/utIOSystem.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utImporter.cpp b/test/unit/utImporter.cpp index 3e88e3ff4..305d25339 100644 --- a/test/unit/utImporter.cpp +++ b/test/unit/utImporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utImproveCacheLocality.cpp b/test/unit/utImproveCacheLocality.cpp index 8564bb01d..66ce0d6d8 100644 --- a/test/unit/utImproveCacheLocality.cpp +++ b/test/unit/utImproveCacheLocality.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utIssues.cpp b/test/unit/utIssues.cpp index 0e30fa182..19d1815cb 100644 --- a/test/unit/utIssues.cpp +++ b/test/unit/utIssues.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utJoinVertices.cpp b/test/unit/utJoinVertices.cpp index 215b0dd90..e04e3af0d 100644 --- a/test/unit/utJoinVertices.cpp +++ b/test/unit/utJoinVertices.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/test/unit/utLWOImportExport.cpp b/test/unit/utLWOImportExport.cpp index c8655b664..8d970e465 100644 --- a/test/unit/utLWOImportExport.cpp +++ b/test/unit/utLWOImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utLWSImportExport.cpp b/test/unit/utLWSImportExport.cpp index b04424b48..e0e8b57cd 100644 --- a/test/unit/utLWSImportExport.cpp +++ b/test/unit/utLWSImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utLimitBoneWeights.cpp b/test/unit/utLimitBoneWeights.cpp index 927a9e37c..9dbd75836 100644 --- a/test/unit/utLimitBoneWeights.cpp +++ b/test/unit/utLimitBoneWeights.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/test/unit/utM3DImportExport.cpp b/test/unit/utM3DImportExport.cpp index 31028235d..29a4786b1 100644 --- a/test/unit/utM3DImportExport.cpp +++ b/test/unit/utM3DImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utMDCImportExport.cpp b/test/unit/utMDCImportExport.cpp index 30a4cfad1..fc4d6445c 100644 --- a/test/unit/utMDCImportExport.cpp +++ b/test/unit/utMDCImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utMaterialSystem.cpp b/test/unit/utMaterialSystem.cpp index 701b933e7..ff8960381 100644 --- a/test/unit/utMaterialSystem.cpp +++ b/test/unit/utMaterialSystem.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utMatrix3x3.cpp b/test/unit/utMatrix3x3.cpp index bff8ca1cd..dfd6d95b4 100644 --- a/test/unit/utMatrix3x3.cpp +++ b/test/unit/utMatrix3x3.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utMatrix4x4.cpp b/test/unit/utMatrix4x4.cpp index e94bf500c..8c060ffd5 100644 --- a/test/unit/utMatrix4x4.cpp +++ b/test/unit/utMatrix4x4.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utMetadata.cpp b/test/unit/utMetadata.cpp index 64b7dfe4c..a605107db 100644 --- a/test/unit/utMetadata.cpp +++ b/test/unit/utMetadata.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utNoBoostTest.cpp b/test/unit/utNoBoostTest.cpp index 51ad70ec0..cb6c391ed 100644 --- a/test/unit/utNoBoostTest.cpp +++ b/test/unit/utNoBoostTest.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2016, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/test/unit/utObjImportExport.cpp b/test/unit/utObjImportExport.cpp index b6cb72623..ba084ceb4 100644 --- a/test/unit/utObjImportExport.cpp +++ b/test/unit/utObjImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utObjTools.cpp b/test/unit/utObjTools.cpp index 2de45d962..1fc282808 100644 --- a/test/unit/utObjTools.cpp +++ b/test/unit/utObjTools.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utOpenGEXImportExport.cpp b/test/unit/utOpenGEXImportExport.cpp index 4e154f50f..bc3662997 100644 --- a/test/unit/utOpenGEXImportExport.cpp +++ b/test/unit/utOpenGEXImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utPLYImportExport.cpp b/test/unit/utPLYImportExport.cpp index 17d1b28de..6c3dd19f8 100644 --- a/test/unit/utPLYImportExport.cpp +++ b/test/unit/utPLYImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/test/unit/utPMXImporter.cpp b/test/unit/utPMXImporter.cpp index 62d3b0707..d70c4c64e 100644 --- a/test/unit/utPMXImporter.cpp +++ b/test/unit/utPMXImporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2016, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/test/unit/utPretransformVertices.cpp b/test/unit/utPretransformVertices.cpp index 0839740ac..0cfa6fabb 100644 --- a/test/unit/utPretransformVertices.cpp +++ b/test/unit/utPretransformVertices.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utProfiler.cpp b/test/unit/utProfiler.cpp index b86f1952c..5b5871135 100644 --- a/test/unit/utProfiler.cpp +++ b/test/unit/utProfiler.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utQ3DImportExport.cpp b/test/unit/utQ3DImportExport.cpp index 51fa4b70a..eefc5e774 100644 --- a/test/unit/utQ3DImportExport.cpp +++ b/test/unit/utQ3DImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utRemoveComments.cpp b/test/unit/utRemoveComments.cpp index cd3175f5a..1fdccf514 100644 --- a/test/unit/utRemoveComments.cpp +++ b/test/unit/utRemoveComments.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utRemoveComponent.cpp b/test/unit/utRemoveComponent.cpp index a1ae7ef47..f6633f6ab 100644 --- a/test/unit/utRemoveComponent.cpp +++ b/test/unit/utRemoveComponent.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utRemoveRedundantMaterials.cpp b/test/unit/utRemoveRedundantMaterials.cpp index 7810afbef..d5c729224 100644 --- a/test/unit/utRemoveRedundantMaterials.cpp +++ b/test/unit/utRemoveRedundantMaterials.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utRemoveVCProcess.cpp b/test/unit/utRemoveVCProcess.cpp index 8db5941d0..a84f84187 100644 --- a/test/unit/utRemoveVCProcess.cpp +++ b/test/unit/utRemoveVCProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utSIBImporter.cpp b/test/unit/utSIBImporter.cpp index 582baef64..2cc0f0f8c 100644 --- a/test/unit/utSIBImporter.cpp +++ b/test/unit/utSIBImporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utSMDImportExport.cpp b/test/unit/utSMDImportExport.cpp index dae490508..464182a2d 100644 --- a/test/unit/utSMDImportExport.cpp +++ b/test/unit/utSMDImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utSTLImportExport.cpp b/test/unit/utSTLImportExport.cpp index 0f90aacf9..371c78cdd 100644 --- a/test/unit/utSTLImportExport.cpp +++ b/test/unit/utSTLImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utScaleProcess.cpp b/test/unit/utScaleProcess.cpp index fd2773c24..68ef21bf3 100644 --- a/test/unit/utScaleProcess.cpp +++ b/test/unit/utScaleProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utScene.cpp b/test/unit/utScene.cpp index 8d630ce35..e989db7cb 100644 --- a/test/unit/utScene.cpp +++ b/test/unit/utScene.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2016, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/test/unit/utSceneCombiner.cpp b/test/unit/utSceneCombiner.cpp index e9be598e1..93b415cc7 100644 --- a/test/unit/utSceneCombiner.cpp +++ b/test/unit/utSceneCombiner.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utScenePreprocessor.cpp b/test/unit/utScenePreprocessor.cpp index 7233e1379..b5387caca 100644 --- a/test/unit/utScenePreprocessor.cpp +++ b/test/unit/utScenePreprocessor.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utSharedPPData.cpp b/test/unit/utSharedPPData.cpp index 53008a27a..43333d8e6 100644 --- a/test/unit/utSharedPPData.cpp +++ b/test/unit/utSharedPPData.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utSimd.cpp b/test/unit/utSimd.cpp index d6bd9fe90..58ce6b70e 100644 --- a/test/unit/utSimd.cpp +++ b/test/unit/utSimd.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/test/unit/utSortByPType.cpp b/test/unit/utSortByPType.cpp index fb637b004..390de2009 100644 --- a/test/unit/utSortByPType.cpp +++ b/test/unit/utSortByPType.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utSplitLargeMeshes.cpp b/test/unit/utSplitLargeMeshes.cpp index fb3f2a037..7f3578b62 100644 --- a/test/unit/utSplitLargeMeshes.cpp +++ b/test/unit/utSplitLargeMeshes.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utStringUtils.cpp b/test/unit/utStringUtils.cpp index 3791e8622..c5493c502 100644 --- a/test/unit/utStringUtils.cpp +++ b/test/unit/utStringUtils.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utTargetAnimation.cpp b/test/unit/utTargetAnimation.cpp index bbcacd2cb..52ccaaf08 100644 --- a/test/unit/utTargetAnimation.cpp +++ b/test/unit/utTargetAnimation.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utTextureTransform.cpp b/test/unit/utTextureTransform.cpp index bbcacd2cb..52ccaaf08 100644 --- a/test/unit/utTextureTransform.cpp +++ b/test/unit/utTextureTransform.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utTriangulate.cpp b/test/unit/utTriangulate.cpp index c65e24a95..c05c8f8d2 100644 --- a/test/unit/utTriangulate.cpp +++ b/test/unit/utTriangulate.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utTypes.cpp b/test/unit/utTypes.cpp index 6289c75e7..0e3c0a92f 100644 --- a/test/unit/utTypes.cpp +++ b/test/unit/utTypes.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utValidateDataStructure.cpp b/test/unit/utValidateDataStructure.cpp index 61fc93dd7..099c54d3a 100644 --- a/test/unit/utValidateDataStructure.cpp +++ b/test/unit/utValidateDataStructure.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utVector3.cpp b/test/unit/utVector3.cpp index adeb70615..414a2a7b5 100644 --- a/test/unit/utVector3.cpp +++ b/test/unit/utVector3.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/test/unit/utVersion.cpp b/test/unit/utVersion.cpp index 66e832baa..aa75a26d8 100644 --- a/test/unit/utVersion.cpp +++ b/test/unit/utVersion.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -48,7 +48,7 @@ TEST_F( utVersion, aiGetLegalStringTest ) { EXPECT_NE( lv, nullptr ); std::string text( lv ); - size_t pos( text.find( std::string( "2019" ) ) ); + size_t pos( text.find( std::string( "2020" ) ) ); EXPECT_NE( pos, std::string::npos ); } diff --git a/test/unit/utVertexTriangleAdjacency.cpp b/test/unit/utVertexTriangleAdjacency.cpp index e48d3521e..0cf09a931 100644 --- a/test/unit/utVertexTriangleAdjacency.cpp +++ b/test/unit/utVertexTriangleAdjacency.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utX3DImportExport.cpp b/test/unit/utX3DImportExport.cpp index 2aa0ae3cc..b09311bcb 100644 --- a/test/unit/utX3DImportExport.cpp +++ b/test/unit/utX3DImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/test/unit/utXImporterExporter.cpp b/test/unit/utXImporterExporter.cpp index 53e156bcc..1d9a065ce 100644 --- a/test/unit/utXImporterExporter.cpp +++ b/test/unit/utXImporterExporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team @@ -67,3 +67,73 @@ TEST_F( utXImporterExporter, heap_overflow_in_tokenizer ) { Assimp::Importer importer; EXPECT_NO_THROW( importer.ReadFile( ASSIMP_TEST_MODELS_DIR "/X/OV_GetNextToken", 0 ) ); } + + +TEST(utXImporter, importAnimTest) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/X/anim_test.x", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utXImporter, importBCNEpileptic) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/X/BCN_Epileptic.X", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utXImporter, importFromTrueSpaceBin32) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/X/fromtruespace_bin32.x", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utXImporter, import_kwxport_test_cubewithvcolors) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/X/kwxport_test_cubewithvcolors.x", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utXImporter, importTestCubeBinary) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/X/test_cube_binary.x", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utXImporter, importTestCubeCompressed) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/X/test_cube_compressed.x", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utXImporter, importTestCubeText) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/X/test_cube_text.x", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utXImporter, importTestWuson) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/X/Testwuson.X", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utXImporter, TestFormatDetection) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/X/TestFormatDetection", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} + + +TEST(utXImporter, importDwarf) { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_NONBSD_DIR "/X/dwarf.x", aiProcess_ValidateDataStructure); + ASSERT_NE(nullptr, scene); +} diff --git a/test/unit/utglTF2ImportExport.cpp b/test/unit/utglTF2ImportExport.cpp index 2073a0003..8b91577f6 100644 --- a/test/unit/utglTF2ImportExport.cpp +++ b/test/unit/utglTF2ImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/test/unit/utglTFImportExport.cpp b/test/unit/utglTFImportExport.cpp index 321d58354..fe2491d66 100644 --- a/test/unit/utglTFImportExport.cpp +++ b/test/unit/utglTFImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/tools/assimp_cmd/CMakeLists.txt b/tools/assimp_cmd/CMakeLists.txt index 5ea4e1a24..fcf36c356 100644 --- a/tools/assimp_cmd/CMakeLists.txt +++ b/tools/assimp_cmd/CMakeLists.txt @@ -1,7 +1,7 @@ # Open Asset Import Library (assimp) # ---------------------------------------------------------------------- # -# Copyright (c) 2006-2019, assimp team +# Copyright (c) 2006-2020, assimp team # All rights reserved. @@ -54,7 +54,7 @@ ADD_EXECUTABLE( assimp_cmd Main.cpp Main.h resource.h - WriteDumb.cpp + WriteDump.cpp Info.cpp Export.cpp ) diff --git a/tools/assimp_cmd/CompareDump.cpp b/tools/assimp_cmd/CompareDump.cpp index db7e3aada..282097016 100644 --- a/tools/assimp_cmd/CompareDump.cpp +++ b/tools/assimp_cmd/CompareDump.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team @@ -800,6 +800,10 @@ void CompareOnTheFlyTexture(comparer_context& comp) { comp.cmp("achFormatHint[1]"); comp.cmp("achFormatHint[2]"); comp.cmp("achFormatHint[3]"); + comp.cmp("achFormatHint[4]"); + comp.cmp("achFormatHint[5]"); + comp.cmp("achFormatHint[6]"); + comp.cmp("achFormatHint[7]"); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -881,19 +885,19 @@ int Assimp_CompareDump (const char* const* params, unsigned int num) // --help if ((num == 1 && !strcmp( params[0], "-h")) || !strcmp( params[0], "--help") || !strcmp( params[0], "-?") ) { printf("%s",AICMD_MSG_CMPDUMP_HELP); - return 0; + return AssimpCmdError::Success; } // assimp cmpdump actual expected if (num < 2) { std::cout << "assimp cmpdump: Invalid number of arguments. " "See \'assimp cmpdump --help\'\r\n" << std::endl; - return 1; + return AssimpCmdError::InvalidNumberOfArguments; } if(!strcmp(params[0],params[1])) { std::cout << "assimp cmpdump: same file, same content." << std::endl; - return 0; + return AssimpCmdError::Success; } class file_ptr @@ -920,13 +924,13 @@ int Assimp_CompareDump (const char* const* params, unsigned int num) if (!actual) { std::cout << "assimp cmpdump: Failure reading ACTUAL data from " << params[0] << std::endl; - return -5; + return AssimpCmdError::FailedToLoadInputFile; } file_ptr expected(fopen(params[1],"rb")); if (!expected) { std::cout << "assimp cmpdump: Failure reading EXPECT data from " << params[1] << std::endl; - return -6; + return AssimpCmdCompareDumpError::FailedToLoadExpectedInputFile; } comparer_context comp(actual,expected); @@ -936,17 +940,17 @@ int Assimp_CompareDump (const char* const* params, unsigned int num) } catch(const compare_fails_exception& ex) { printf("%s",ex.what()); - return -1; + return AssimpCmdCompareDumpError::FileComparaisonFailure; } catch(...) { // we don't bother checking too rigourously here, so // we might end up here ... std::cout << "Unknown failure, are the input files well-defined?"; - return -3; + return AssimpCmdCompareDumpError::UnknownFailure; } std::cout << "Success (totally " << std::dec << comp.get_num_chunks() << " chunks)" << std::endl; - return 0; + return AssimpCmdError::Success; } diff --git a/tools/assimp_cmd/Export.cpp b/tools/assimp_cmd/Export.cpp index e29936e38..65653c558 100644 --- a/tools/assimp_cmd/Export.cpp +++ b/tools/assimp_cmd/Export.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team @@ -76,13 +76,13 @@ int Assimp_Export(const char* const* params, unsigned int num) const char* const invalid = "assimp export: Invalid number of arguments. See \'assimp export --help\'\n"; if (num < 1) { printf(invalid); - return 1; + return AssimpCmdError::InvalidNumberOfArguments; } // --help if (!strcmp( params[0], "-h") || !strcmp( params[0], "--help") || !strcmp( params[0], "-?") ) { printf("%s",AICMD_MSG_EXPORT_HELP_E); - return 0; + return AssimpCmdError::Success; } std::string in = std::string(params[0]); @@ -156,7 +156,7 @@ int Assimp_Export(const char* const* params, unsigned int num) // import the model const aiScene* scene = ImportModel(import,in); if (!scene) { - return -39; + return AssimpCmdExportError::FailedToImportModel; } // derive the final file name @@ -164,10 +164,10 @@ int Assimp_Export(const char* const* params, unsigned int num) // and call the export routine if(!ExportModel(scene, import, out,e->id)) { - return -25; + return AssimpCmdExportError::FailedToExportModel; } printf("assimp export: wrote output file: %s\n",out.c_str()); - return 0; + return AssimpCmdError::Success; } #endif // no export diff --git a/tools/assimp_cmd/ImageExtractor.cpp b/tools/assimp_cmd/ImageExtractor.cpp index a587ab434..62fa94f59 100644 --- a/tools/assimp_cmd/ImageExtractor.cpp +++ b/tools/assimp_cmd/ImageExtractor.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team @@ -219,9 +219,9 @@ int DoExport(const aiTexture* tx, FILE* p, const std::string& extension, } else { printf("assimp extract: No available texture encoder found for %s\n", extension.c_str()); - return 1; + return AssimpCmdExtractError::NoAvailableTextureEncoderFound; } - return 0; + return AssimpCmdError::Success; } // ----------------------------------------------------------------------------------- @@ -232,13 +232,13 @@ int Assimp_Extract (const char* const* params, unsigned int num) // assimp extract in out [options] if (num < 1) { printf(invalid); - return 1; + return AssimpCmdError::InvalidNumberOfArguments; } // --help if (!strcmp( params[0], "-h") || !strcmp( params[0], "--help") || !strcmp( params[0], "-?") ) { printf("%s",AICMD_MSG_DUMP_HELP_E); - return 0; + return AssimpCmdError::Success; } @@ -308,7 +308,7 @@ int Assimp_Extract (const char* const* params, unsigned int num) const aiScene* scene = ImportModel(import,in); if (!scene) { printf("assimp extract: Unable to load input file %s\n",in.c_str()); - return 5; + return AssimpCmdError::FailedToLoadInputFile; } // get the texture(s) to be exported @@ -318,7 +318,7 @@ int Assimp_Extract (const char* const* params, unsigned int num) if (texIdx >= scene->mNumTextures) { ::printf("assimp extract: Texture %i requested, but there are just %i textures\n", texIdx, scene->mNumTextures); - return 6; + return AssimpCmdExtractError::TextureIndexIsOutOfRange; } } else { @@ -358,12 +358,14 @@ int Assimp_Extract (const char* const* params, unsigned int num) FILE* p = ::fopen(out_cpy.c_str(),"wb"); if (!p) { printf("assimp extract: Unable to open output file %s\n",out_cpy.c_str()); - return 7; + return AssimpCmdError::FailedToOpenOutputFile; } int m; if (!tex->mHeight) { - m = (1 != fwrite(tex->pcData,tex->mWidth,1,p)); + m = (1 != fwrite(tex->pcData,tex->mWidth,1,p)) + ? static_cast(AssimpCmdError::Success) + : static_cast(AssimpCmdExtractError::FailedToExportCompressedTexture); } else m = DoExport(tex,p,extension,flags); ::fclose(p); @@ -372,5 +374,5 @@ int Assimp_Extract (const char* const* params, unsigned int num) if (texIdx != 0xffffffff) return m; } - return 0; + return AssimpCmdError::Success; } diff --git a/tools/assimp_cmd/Info.cpp b/tools/assimp_cmd/Info.cpp index d730b9308..1594235f9 100644 --- a/tools/assimp_cmd/Info.cpp +++ b/tools/assimp_cmd/Info.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team @@ -283,14 +283,14 @@ int Assimp_Info (const char* const* params, unsigned int num) { // --help if (!strcmp( params[0],"-h")||!strcmp( params[0],"--help")||!strcmp( params[0],"-?") ) { printf("%s",AICMD_MSG_INFO_HELP_E); - return 0; + return AssimpCmdError::Success; } // asssimp info [-r] if (num < 1) { printf("assimp info: Invalid number of arguments. " "See \'assimp info --help\'\n"); - return 1; + return AssimpCmdError::InvalidNumberOfArguments; } const std::string in = std::string(params[0]); @@ -314,7 +314,7 @@ int Assimp_Info (const char* const* params, unsigned int num) { // Verbose and silent at the same time are not allowed if ( verbose && silent ) { printf("assimp info: Invalid arguments, verbose and silent at the same time are forbitten. "); - return 1; + return AssimpCmdInfoError::InvalidCombinaisonOfArguments; } // Parse post-processing flags unless -r was specified @@ -333,7 +333,7 @@ int Assimp_Info (const char* const* params, unsigned int num) { if (!scene) { printf("assimp info: Unable to load input file %s\n", in.c_str()); - return 5; + return AssimpCmdError::FailedToLoadInputFile; } aiMemoryInfo mem; @@ -391,7 +391,7 @@ int Assimp_Info (const char* const* params, unsigned int num) { if (silent) { printf("\n"); - return 0; + return AssimpCmdError::Success; } // meshes @@ -473,5 +473,5 @@ int Assimp_Info (const char* const* params, unsigned int num) { PrintHierarchy(scene->mRootNode,"",verbose); printf("\n"); - return 0; + return AssimpCmdError::Success; } diff --git a/tools/assimp_cmd/Main.cpp b/tools/assimp_cmd/Main.cpp index 9173a756b..1037bd73c 100644 --- a/tools/assimp_cmd/Main.cpp +++ b/tools/assimp_cmd/Main.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team @@ -85,7 +85,7 @@ int main (int argc, char* argv[]) { if (argc <= 1) { printf("assimp: No command specified. Use \'assimp help\' for a detailed command list\n"); - return 0; + return AssimpCmdError::Success; } // assimp version @@ -102,7 +102,7 @@ int main (int argc, char* argv[]) (flags & ASSIMP_CFLAGS_STLPORT ? "-stlport " : ""), aiGetVersionRevision()); - return 0; + return AssimpCmdError::Success; } // assimp help @@ -110,7 +110,7 @@ int main (int argc, char* argv[]) // because people could try them intuitively) if (!strcmp(argv[1], "help") || !strcmp(argv[1], "--help") || !strcmp(argv[1], "-h")) { printf("%s",AICMD_MSG_HELP); - return 0; + return AssimpCmdError::Success; } // assimp cmpdump @@ -137,7 +137,7 @@ int main (int argc, char* argv[]) imp.GetExtensionList(s); printf("%s\n",s.data); - return 0; + return AssimpCmdError::Success; } #ifndef ASSIMP_BUILD_NO_EXPORT @@ -155,7 +155,7 @@ int main (int argc, char* argv[]) } printf("%s\n",s.data); - return 0; + return AssimpCmdError::Success; } @@ -166,19 +166,19 @@ int main (int argc, char* argv[]) if (argc<3) { printf("Expected file format id\n"); - return -11; + return AssimpCmdError::NoFileFormatSpecified; } for(size_t i = 0, end = exp.GetExportFormatCount(); i < end; ++i) { const aiExportFormatDesc* const e = exp.GetExportFormatDescription(i); if (!strcmp(e->id,argv[2])) { printf("%s\n%s\n%s\n",e->id,e->fileExtension,e->description); - return 0; + return AssimpCmdError::Success; } } printf("Unknown file format id: \'%s\'\n",argv[2]); - return -12; + return AssimpCmdError::UnknownFileFormat; } // assimp export @@ -194,11 +194,11 @@ int main (int argc, char* argv[]) if (! strcmp(argv[1], "knowext")) { if (argc<3) { printf("Expected file extension"); - return -10; + return AssimpCmdError::NoFileExtensionSpecified; } const bool b = imp.IsExtensionSupported(argv[2]); printf("File extension \'%s\' is %sknown\n",argv[2],(b?"":"not ")); - return b?0:-1; + return b? AssimpCmdError::Success : AssimpCmdError::UnknownFileExtension; } // assimp info @@ -228,7 +228,7 @@ int main (int argc, char* argv[]) } printf("Unrecognized command. Use \'assimp help\' for a detailed command list\n"); - return 1; + return AssimpCmdError::UnrecognizedCommand; } @@ -505,7 +505,7 @@ int ProcessStandardArguments( fill.log = true; } - return 0; + return AssimpCmdError::Success; } // ------------------------------------------------------------------------------ @@ -517,5 +517,5 @@ int Assimp_TestBatchLoad ( globalImporter->ReadFile(params[i],aiProcessPreset_TargetRealtime_MaxQuality); // we're totally silent. scene destructs automatically. } - return 0; + return AssimpCmdError::Success; } diff --git a/tools/assimp_cmd/Main.h b/tools/assimp_cmd/Main.h index 5dc4f7d28..ecc65345d 100644 --- a/tools/assimp_cmd/Main.h +++ b/tools/assimp_cmd/Main.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. @@ -114,13 +114,32 @@ struct ImportData { bool log; }; +/// \enum AssimpCmdError +/// \brief General error codes used among assimp_cmd's utilities. +enum AssimpCmdError { + Success = 0, + InvalidNumberOfArguments, + UnrecognizedCommand, + FailedToLoadInputFile, + FailedToOpenOutputFile, + NoFileFormatSpecified, + UnknownFileFormat, + NoFileExtensionSpecified, + UnknownFileExtension, + ExceptionWasRaised, + + // Add new error codes here... + + LastAssimpCmdError, // Must be last. +}; + // ------------------------------------------------------------------------------ /** Process standard arguments * * @param fill Filled by function * @param params Command line parameters to be processed * @param num NUmber of params - * @return 0 for success */ + * @return An #AssimpCmdError value. */ int ProcessStandardArguments(ImportData& fill, const char* const* params, unsigned int num); @@ -149,45 +168,90 @@ bool ExportModel(const aiScene* pOut, // ------------------------------------------------------------------------------ /** assimp_dump utility - * @param params Command line parameters to 'assimp dumb' + * @param params Command line parameters to 'assimp dump' * @param Number of params - * @return 0 for success*/ + * @return An #AssimpCmdError value.*/ int Assimp_Dump ( const char* const* params, unsigned int num); +/// \enum AssimpCmdExportError +/// \brief Error codes used by the 'Export' utility. +enum AssimpCmdExportError { + FailedToImportModel = AssimpCmdError::LastAssimpCmdError, + FailedToExportModel, + + // Add new error codes here... + + LastAssimpCmdExportError, // Must be last. +}; + // ------------------------------------------------------------------------------ /** assimp_export utility * @param params Command line parameters to 'assimp export' * @param Number of params - * @return 0 for success*/ + * @return Either an #AssimpCmdError or #AssimpCmdExportError value. */ int Assimp_Export ( const char* const* params, unsigned int num); +/// \enum AssimpCmdExtractError +/// \brief Error codes used by the 'Image Extractor' utility. +enum AssimpCmdExtractError { + TextureIndexIsOutOfRange = AssimpCmdError::LastAssimpCmdError, + NoAvailableTextureEncoderFound, + FailedToExportCompressedTexture, + + // Add new error codes here... + + LastAssimpCmdExtractError, // Must be last. +}; + // ------------------------------------------------------------------------------ /** assimp_extract utility * @param params Command line parameters to 'assimp extract' * @param Number of params - * @return 0 for success*/ + * @return Either an #AssimpCmdError or #AssimpCmdExtractError value. */ int Assimp_Extract ( const char* const* params, unsigned int num); +/// \enum AssimpCmdCompareDumpError +/// \brief Error codes used by the 'Compare Dump' utility. +enum AssimpCmdCompareDumpError { + FailedToLoadExpectedInputFile = AssimpCmdError::LastAssimpCmdError, + FileComparaisonFailure, + UnknownFailure, + + // Add new error codes here... + + LastAssimpCmdCompareDumpError, // Must be last. +}; + // ------------------------------------------------------------------------------ /** assimp_cmpdump utility * @param params Command line parameters to 'assimp cmpdump' * @param Number of params - * @return 0 for success*/ + * @return Either an #AssimpCmdError or #AssimpCmdCompareDumpError. */ int Assimp_CompareDump ( const char* const* params, unsigned int num); +/// \enum AssimpCmdInfoError +/// \brief Error codes used by the 'Info' utility. +enum AssimpCmdInfoError { + InvalidCombinaisonOfArguments = AssimpCmdError::LastAssimpCmdError, + + // Add new error codes here... + + LastAssimpCmdInfoError, // Must be last. +}; + // ------------------------------------------------------------------------------ /** @brief assimp info utility * @param params Command line parameters to 'assimp info' * @param Number of params - * @return 0 for success */ + * @return Either an #AssimpCmdError or #AssimpCmdInfoError value. */ int Assimp_Info ( const char* const* params, unsigned int num); @@ -196,7 +260,7 @@ int Assimp_Info ( /** @brief assimp testbatchload utility * @param params Command line parameters to 'assimp testbatchload' * @param Number of params - * @return 0 for success */ + * @return An #AssimpCmdError value. */ int Assimp_TestBatchLoad ( const char* const* params, unsigned int num); diff --git a/tools/assimp_cmd/WriteDumb.cpp b/tools/assimp_cmd/WriteDumb.cpp deleted file mode 100644 index 559bf08c6..000000000 --- a/tools/assimp_cmd/WriteDumb.cpp +++ /dev/null @@ -1,1430 +0,0 @@ -/* ---------------------------------------------------------------------------- -Open Asset Import Library (assimp) ---------------------------------------------------------------------------- - -Copyright (c) 2006-2019, assimp team - - - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the following -conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------------- -*/ - -/** @file WriteTextDumb.cpp - * @brief Implementation of the 'assimp dump' utility - */ - -#include "Main.h" -#include "PostProcessing/ProcessHelper.h" - -const char* AICMD_MSG_DUMP_HELP = -"assimp dump [] [-b] [-s] [-z] [common parameters]\n" -"\t -b Binary output \n" -"\t -s Shortened \n" -"\t -z Compressed \n" -"\t[See the assimp_cmd docs for a full list of all common parameters] \n" -"\t -cfast Fast post processing preset, runs just a few important steps \n" -"\t -cdefault Default post processing: runs all recommended steps\n" -"\t -cfull Fires almost all post processing steps \n" -; - -#include "Common/assbin_chunks.h" - -FILE* out = NULL; -bool shortened = false; - -// ----------------------------------------------------------------------------------- -// Compress a binary dump file (beginning at offset head_size) -void CompressBinaryDump(const char* file, unsigned int head_size) -{ - // for simplicity ... copy the file into memory again and compress it there - FILE* p = fopen(file,"r"); - fseek(p,0,SEEK_END); - const uint32_t size = ftell(p); - fseek(p,0,SEEK_SET); - - if (size uint32_t Write(const T&); - -// ----------------------------------------------------------------------------------- -// Serialize an aiString -template <> -inline uint32_t Write(const aiString& s) -{ - const uint32_t s2 = (uint32_t)s.length; - fwrite(&s,4,1,out); - fwrite(s.data,s2,1,out); - return s2+4; -} - -// ----------------------------------------------------------------------------------- -// Serialize an unsigned int as uint32_t -template <> -inline uint32_t Write(const unsigned int& w) -{ - const uint32_t t = (uint32_t)w; - if (w > t) { - // this shouldn't happen, integers in Assimp data structures never exceed 2^32 - printf("loss of data due to 64 -> 32 bit integer conversion"); - } - - fwrite(&t,4,1,out); - return 4; -} - -// ----------------------------------------------------------------------------------- -// Serialize an unsigned int as uint16_t -template <> -inline uint32_t Write(const uint16_t& w) -{ - fwrite(&w,2,1,out); - return 2; -} - -// ----------------------------------------------------------------------------------- -// Serialize a float -template <> -inline uint32_t Write(const float& f) -{ - static_assert(sizeof(float)==4, "sizeof(float)==4"); - fwrite(&f,4,1,out); - return 4; -} - -// ----------------------------------------------------------------------------------- -// Serialize a double -template <> -inline uint32_t Write(const double& f) -{ - static_assert(sizeof(double)==8, "sizeof(double)==8"); - fwrite(&f,8,1,out); - return 8; -} - -// ----------------------------------------------------------------------------------- -// Serialize a vec3 -template <> -inline uint32_t Write(const aiVector3D& v) -{ - uint32_t t = Write(v.x); - t += Write(v.y); - t += Write(v.z); - return t; -} - -// ----------------------------------------------------------------------------------- -// Serialize a color value -template <> -inline uint32_t Write(const aiColor3D& v) -{ - uint32_t t = Write(v.r); - t += Write(v.g); - t += Write(v.b); - return t; -} - -// ----------------------------------------------------------------------------------- -// Serialize a color value -template <> -inline uint32_t Write(const aiColor4D& v) -{ - uint32_t t = Write(v.r); - t += Write(v.g); - t += Write(v.b); - t += Write(v.a); - return t; -} - -// ----------------------------------------------------------------------------------- -// Serialize a quaternion -template <> -inline uint32_t Write(const aiQuaternion& v) -{ - uint32_t t = Write(v.w); - t += Write(v.x); - t += Write(v.y); - t += Write(v.z); - ai_assert(t == 16); - return 16; -} - - -// ----------------------------------------------------------------------------------- -// Serialize a vertex weight -template <> -inline uint32_t Write(const aiVertexWeight& v) -{ - uint32_t t = Write(v.mVertexId); - return t+Write(v.mWeight); -} - -// ----------------------------------------------------------------------------------- -// Serialize a mat4x4 -template <> -inline uint32_t Write(const aiMatrix4x4& m) -{ - for (unsigned int i = 0; i < 4;++i) { - for (unsigned int i2 = 0; i2 < 4;++i2) { - Write(m[i][i2]); - } - } - return 64; -} - -// ----------------------------------------------------------------------------------- -// Serialize an aiVectorKey -template <> -inline uint32_t Write(const aiVectorKey& v) -{ - const uint32_t t = Write(v.mTime); - return t + Write(v.mValue); -} - -// ----------------------------------------------------------------------------------- -// Serialize an aiQuatKey -template <> -inline uint32_t Write(const aiQuatKey& v) -{ - const uint32_t t = Write(v.mTime); - return t + Write(v.mValue); -} - -// ----------------------------------------------------------------------------------- -// Write the min/max values of an array of Ts to the file -template -inline uint32_t WriteBounds(const T* in, unsigned int size) -{ - T minc,maxc; - Assimp::ArrayBounds(in,size,minc,maxc); - - const uint32_t t = Write(minc); - return t + Write(maxc); -} - - - -// ----------------------------------------------------------------------------------- -void ChangeInteger(uint32_t ofs,uint32_t n) -{ - const uint32_t cur = ftell(out); - int retCode; - retCode = fseek(out, ofs, SEEK_SET); - ai_assert(0 == retCode); - fwrite(&n, 4, 1, out); - retCode = fseek(out, cur, SEEK_SET); - ai_assert(0 == retCode); -} - -// ----------------------------------------------------------------------------------- -uint32_t WriteBinaryNode(const aiNode* node) -{ - uint32_t len = 0, old = WriteMagic(ASSBIN_CHUNK_AINODE); - len += Write(node->mName); - len += Write(node->mTransformation); - len += Write(node->mNumChildren); - len += Write(node->mNumMeshes); - - for (unsigned int i = 0; i < node->mNumMeshes;++i) { - len += Write(node->mMeshes[i]); - } - - for (unsigned int i = 0; i < node->mNumChildren;++i) { - len += WriteBinaryNode(node->mChildren[i])+8; - } - - ChangeInteger(old,len); - return len; -} - -// ----------------------------------------------------------------------------------- -uint32_t WriteBinaryTexture(const aiTexture* tex) -{ - uint32_t len = 0, old = WriteMagic(ASSBIN_CHUNK_AITEXTURE); - - len += Write(tex->mWidth); - len += Write(tex->mHeight); - len += static_cast(fwrite(tex->achFormatHint,1,4,out)); - - if(!shortened) { - if (!tex->mHeight) { - len += static_cast(fwrite(tex->pcData,1,tex->mWidth,out)); - } - else { - len += static_cast(fwrite(tex->pcData,1,tex->mWidth*tex->mHeight*4,out)); - } - } - - ChangeInteger(old,len); - return len; -} - -// ----------------------------------------------------------------------------------- -uint32_t WriteBinaryBone(const aiBone* b) -{ - uint32_t len = 0, old = WriteMagic(ASSBIN_CHUNK_AIBONE); - - len += Write(b->mName); - len += Write(b->mNumWeights); - len += Write(b->mOffsetMatrix); - - // for the moment we write dumb min/max values for the bones, too. - // maybe I'll add a better, hash-like solution later - if (shortened) { - len += WriteBounds(b->mWeights,b->mNumWeights); - } // else write as usual - else len += static_cast(fwrite(b->mWeights,1,b->mNumWeights*sizeof(aiVertexWeight),out)); - - ChangeInteger(old,len); - return len; -} - -// ----------------------------------------------------------------------------------- -uint32_t WriteBinaryMesh(const aiMesh* mesh) -{ - uint32_t len = 0, old = WriteMagic(ASSBIN_CHUNK_AIMESH); - - len += Write(mesh->mPrimitiveTypes); - len += Write(mesh->mNumVertices); - len += Write(mesh->mNumFaces); - len += Write(mesh->mNumBones); - len += Write(mesh->mMaterialIndex); - - // first of all, write bits for all existent vertex components - unsigned int c = 0; - if (mesh->mVertices) { - c |= ASSBIN_MESH_HAS_POSITIONS; - } - if (mesh->mNormals) { - c |= ASSBIN_MESH_HAS_NORMALS; - } - if (mesh->mTangents && mesh->mBitangents) { - c |= ASSBIN_MESH_HAS_TANGENTS_AND_BITANGENTS; - } - for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_TEXTURECOORDS;++n) { - if (!mesh->mTextureCoords[n]) { - break; - } - c |= ASSBIN_MESH_HAS_TEXCOORD(n); - } - for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_COLOR_SETS;++n) { - if (!mesh->mColors[n]) { - break; - } - c |= ASSBIN_MESH_HAS_COLOR(n); - } - len += Write(c); - - aiVector3D minVec, maxVec; - if (mesh->mVertices) { - if (shortened) { - len += WriteBounds(mesh->mVertices,mesh->mNumVertices); - } // else write as usual - else len += static_cast(fwrite(mesh->mVertices,1,12*mesh->mNumVertices,out)); - } - if (mesh->mNormals) { - if (shortened) { - len += WriteBounds(mesh->mNormals,mesh->mNumVertices); - } // else write as usual - else len += static_cast(fwrite(mesh->mNormals,1,12*mesh->mNumVertices,out)); - } - if (mesh->mTangents && mesh->mBitangents) { - if (shortened) { - len += WriteBounds(mesh->mTangents,mesh->mNumVertices); - len += WriteBounds(mesh->mBitangents,mesh->mNumVertices); - } // else write as usual - else { - len += static_cast(fwrite(mesh->mTangents,1,12*mesh->mNumVertices,out)); - len += static_cast(fwrite(mesh->mBitangents,1,12*mesh->mNumVertices,out)); - } - } - for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_COLOR_SETS;++n) { - if (!mesh->mColors[n]) - break; - - if (shortened) { - len += WriteBounds(mesh->mColors[n],mesh->mNumVertices); - } // else write as usual - else len += static_cast(fwrite(mesh->mColors[n],16*mesh->mNumVertices,1,out)); - } - for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_TEXTURECOORDS;++n) { - if (!mesh->mTextureCoords[n]) - break; - - // write number of UV components - len += Write(mesh->mNumUVComponents[n]); - - if (shortened) { - len += WriteBounds(mesh->mTextureCoords[n],mesh->mNumVertices); - } // else write as usual - else len += static_cast(fwrite(mesh->mTextureCoords[n],12*mesh->mNumVertices,1,out)); - } - - // write faces. There are no floating-point calculations involved - // in these, so we can write a simple hash over the face data - // to the dump file. We generate a single 32 Bit hash for 512 faces - // using Assimp's standard hashing function. - if (shortened) { - unsigned int processed = 0; - for (unsigned int job;(job = std::min(mesh->mNumFaces-processed,512u));processed += job) { - - uint32_t hash = 0; - for (unsigned int a = 0; a < job;++a) { - - const aiFace& f = mesh->mFaces[processed+a]; - uint32_t tmp = f.mNumIndices; - hash = SuperFastHash(reinterpret_cast(&tmp),sizeof tmp,hash); - for (unsigned int i = 0; i < f.mNumIndices; ++i) { - static_assert(AI_MAX_VERTICES <= 0xffffffff, "AI_MAX_VERTICES <= 0xffffffff"); - tmp = static_cast( f.mIndices[i] ); - hash = SuperFastHash(reinterpret_cast(&tmp),sizeof tmp,hash); - } - } - len += Write(hash); - } - } - else // else write as usual - { - // if there are less than 2^16 vertices, we can simply use 16 bit integers ... - for (unsigned int i = 0; i < mesh->mNumFaces;++i) { - const aiFace& f = mesh->mFaces[i]; - - static_assert(AI_MAX_FACE_INDICES <= 0xffff, "AI_MAX_FACE_INDICES <= 0xffff"); - len += Write(f.mNumIndices); - - for (unsigned int a = 0; a < f.mNumIndices;++a) { - if (mesh->mNumVertices < (1u<<16)) { - len += Write(f.mIndices[a]); - } - else len += Write(f.mIndices[a]); - } - } - } - - // write bones - if (mesh->mNumBones) { - for (unsigned int a = 0; a < mesh->mNumBones;++a) { - const aiBone* b = mesh->mBones[a]; - len += WriteBinaryBone(b)+8; - } - } - - ChangeInteger(old,len); - return len; -} - -// ----------------------------------------------------------------------------------- -uint32_t WriteBinaryMaterialProperty(const aiMaterialProperty* prop) -{ - uint32_t len = 0, old = WriteMagic(ASSBIN_CHUNK_AIMATERIALPROPERTY); - - len += Write(prop->mKey); - len += Write(prop->mSemantic); - len += Write(prop->mIndex); - - len += Write(prop->mDataLength); - len += Write((unsigned int)prop->mType); - len += static_cast(fwrite(prop->mData,1,prop->mDataLength,out)); - - ChangeInteger(old,len); - return len; -} - -// ----------------------------------------------------------------------------------- -uint32_t WriteBinaryMaterial(const aiMaterial* mat) -{ - uint32_t len = 0, old = WriteMagic(ASSBIN_CHUNK_AIMATERIAL); - - len += Write(mat->mNumProperties); - for (unsigned int i = 0; i < mat->mNumProperties;++i) { - len += WriteBinaryMaterialProperty(mat->mProperties[i])+8; - } - - ChangeInteger(old,len); - return len; -} - -// ----------------------------------------------------------------------------------- -uint32_t WriteBinaryNodeAnim(const aiNodeAnim* nd) -{ - uint32_t len = 0, old = WriteMagic(ASSBIN_CHUNK_AINODEANIM); - - len += Write(nd->mNodeName); - len += Write(nd->mNumPositionKeys); - len += Write(nd->mNumRotationKeys); - len += Write(nd->mNumScalingKeys); - len += Write(nd->mPreState); - len += Write(nd->mPostState); - - if (nd->mPositionKeys) { - if (shortened) { - len += WriteBounds(nd->mPositionKeys,nd->mNumPositionKeys); - - } // else write as usual - else len += static_cast(fwrite(nd->mPositionKeys,1,nd->mNumPositionKeys*sizeof(aiVectorKey),out)); - } - if (nd->mRotationKeys) { - if (shortened) { - len += WriteBounds(nd->mRotationKeys,nd->mNumRotationKeys); - - } // else write as usual - else len += static_cast(fwrite(nd->mRotationKeys,1,nd->mNumRotationKeys*sizeof(aiQuatKey),out)); - } - if (nd->mScalingKeys) { - if (shortened) { - len += WriteBounds(nd->mScalingKeys,nd->mNumScalingKeys); - - } // else write as usual - else len += static_cast(fwrite(nd->mScalingKeys,1,nd->mNumScalingKeys*sizeof(aiVectorKey),out)); - } - - ChangeInteger(old,len); - return len; -} - - -// ----------------------------------------------------------------------------------- -uint32_t WriteBinaryAnim(const aiAnimation* anim) -{ - uint32_t len = 0, old = WriteMagic(ASSBIN_CHUNK_AIANIMATION); - - len += Write (anim->mName); - len += Write (anim->mDuration); - len += Write (anim->mTicksPerSecond); - len += Write(anim->mNumChannels); - - for (unsigned int a = 0; a < anim->mNumChannels;++a) { - const aiNodeAnim* nd = anim->mChannels[a]; - len += WriteBinaryNodeAnim(nd)+8; - } - - ChangeInteger(old,len); - return len; -} - -// ----------------------------------------------------------------------------------- -uint32_t WriteBinaryLight(const aiLight* l) -{ - uint32_t len = 0, old = WriteMagic(ASSBIN_CHUNK_AILIGHT); - - len += Write(l->mName); - len += Write(l->mType); - - if (l->mType != aiLightSource_DIRECTIONAL) { - len += Write(l->mAttenuationConstant); - len += Write(l->mAttenuationLinear); - len += Write(l->mAttenuationQuadratic); - } - - len += Write(l->mColorDiffuse); - len += Write(l->mColorSpecular); - len += Write(l->mColorAmbient); - - if (l->mType == aiLightSource_SPOT) { - len += Write(l->mAngleInnerCone); - len += Write(l->mAngleOuterCone); - } - - ChangeInteger(old,len); - return len; -} - -// ----------------------------------------------------------------------------------- -uint32_t WriteBinaryCamera(const aiCamera* cam) -{ - uint32_t len = 0, old = WriteMagic(ASSBIN_CHUNK_AICAMERA); - - len += Write(cam->mName); - len += Write(cam->mPosition); - len += Write(cam->mLookAt); - len += Write(cam->mUp); - len += Write(cam->mHorizontalFOV); - len += Write(cam->mClipPlaneNear); - len += Write(cam->mClipPlaneFar); - len += Write(cam->mAspect); - - ChangeInteger(old,len); - return len; -} - -// ----------------------------------------------------------------------------------- -uint32_t WriteBinaryScene(const aiScene* scene) -{ - uint32_t len = 0, old = WriteMagic(ASSBIN_CHUNK_AISCENE); - - // basic scene information - len += Write(scene->mFlags); - len += Write(scene->mNumMeshes); - len += Write(scene->mNumMaterials); - len += Write(scene->mNumAnimations); - len += Write(scene->mNumTextures); - len += Write(scene->mNumLights); - len += Write(scene->mNumCameras); - - // write node graph - len += WriteBinaryNode(scene->mRootNode)+8; - - // write all meshes - for (unsigned int i = 0; i < scene->mNumMeshes;++i) { - const aiMesh* mesh = scene->mMeshes[i]; - len += WriteBinaryMesh(mesh)+8; - } - - // write materials - for (unsigned int i = 0; i< scene->mNumMaterials; ++i) { - const aiMaterial* mat = scene->mMaterials[i]; - len += WriteBinaryMaterial(mat)+8; - } - - // write all animations - for (unsigned int i = 0; i < scene->mNumAnimations;++i) { - const aiAnimation* anim = scene->mAnimations[i]; - len += WriteBinaryAnim(anim)+8; - } - - - // write all textures - for (unsigned int i = 0; i < scene->mNumTextures;++i) { - const aiTexture* mesh = scene->mTextures[i]; - len += WriteBinaryTexture(mesh)+8; - } - - // write lights - for (unsigned int i = 0; i < scene->mNumLights;++i) { - const aiLight* l = scene->mLights[i]; - len += WriteBinaryLight(l)+8; - } - - // write cameras - for (unsigned int i = 0; i < scene->mNumCameras;++i) { - const aiCamera* cam = scene->mCameras[i]; - len += WriteBinaryCamera(cam)+8; - } - - ChangeInteger(old,len); - return len; -} - -// ----------------------------------------------------------------------------------- -// Write a binary model dump -void WriteBinaryDump(const aiScene* scene, FILE* _out, const char* src, const char* cmd, - bool _shortened, bool compressed, ImportData& /*imp*/) -{ - out = _out; - shortened = _shortened; - - time_t tt = time(NULL); -#if _WIN32 - tm* p = gmtime(&tt); -#else - struct tm now; - tm* p = gmtime_r(&tt, &now); -#endif - ai_assert(nullptr != p); - - // header - fprintf(out,"ASSIMP.binary-dump.%s",asctime(p)); - // == 44 bytes - - Write(ASSBIN_VERSION_MAJOR); - Write(ASSBIN_VERSION_MINOR); - Write(aiGetVersionRevision()); - Write(aiGetCompileFlags()); - Write(shortened); - Write(compressed); - // == 20 bytes - - { - char buff[256] = { 0 }; - strncpy(buff,src,256); - buff[255] = 0; - fwrite(buff,256,1,out); - } - - { - char buff[128] = { 0 }; - strncpy(buff,cmd,128); - buff[127] = 0; - fwrite(buff,128,1,out); - } - - // leave 64 bytes free for future extensions - { - char buff[64]; - memset(buff,0xcd,64); - fwrite(buff,64,1,out); - } - // == 435 bytes - - // ==== total header size: 512 bytes - ai_assert(ftell(out)==ASSBIN_HEADER_LENGTH); - - // Up to here the data is uncompressed. For compressed files, the rest - // is compressed using standard DEFLATE from zlib. - WriteBinaryScene(scene); -} - -// ----------------------------------------------------------------------------------- -// Convert a name to standard XML format -void ConvertName(aiString& out, const aiString& in) -{ - out.length = 0; - for (unsigned int i = 0; i < in.length; ++i) { - switch (in.data[i]) { - case '<': - out.Append("<");break; - case '>': - out.Append(">");break; - case '&': - out.Append("&");break; - case '\"': - out.Append(""");break; - case '\'': - out.Append("'");break; - default: - out.data[out.length++] = in.data[i]; - } - } - out.data[out.length] = 0; -} - -// ----------------------------------------------------------------------------------- -// Write a single node as text dump -void WriteNode(const aiNode* node, FILE* out, unsigned int depth) -{ - char prefix[512]; - for (unsigned int i = 0; i < depth;++i) - prefix[i] = '\t'; - prefix[depth] = '\0'; - - const aiMatrix4x4& m = node->mTransformation; - - aiString name; - ConvertName(name,node->mName); - fprintf(out,"%s \n" - "%s\t \n" - "%s\t\t%0 6f %0 6f %0 6f %0 6f\n" - "%s\t\t%0 6f %0 6f %0 6f %0 6f\n" - "%s\t\t%0 6f %0 6f %0 6f %0 6f\n" - "%s\t\t%0 6f %0 6f %0 6f %0 6f\n" - "%s\t \n", - prefix,name.data,prefix, - prefix,m.a1,m.a2,m.a3,m.a4, - prefix,m.b1,m.b2,m.b3,m.b4, - prefix,m.c1,m.c2,m.c3,m.c4, - prefix,m.d1,m.d2,m.d3,m.d4,prefix); - - if (node->mNumMeshes) { - fprintf(out, "%s\t\n%s\t", - prefix,node->mNumMeshes,prefix); - - for (unsigned int i = 0; i < node->mNumMeshes;++i) { - fprintf(out,"%u ",node->mMeshes[i]); - } - fprintf(out,"\n%s\t\n",prefix); - } - - if (node->mNumChildren) { - fprintf(out,"%s\t\n", - prefix,node->mNumChildren); - - for (unsigned int i = 0; i < node->mNumChildren;++i) { - WriteNode(node->mChildren[i],out,depth+2); - } - fprintf(out,"%s\t\n",prefix); - } - fprintf(out,"%s\n",prefix); -} - - -// ------------------------------------------------------------------------------- -const char* TextureTypeToString(aiTextureType in) -{ - switch (in) - { - case aiTextureType_NONE: - return "n/a"; - case aiTextureType_DIFFUSE: - return "Diffuse"; - case aiTextureType_SPECULAR: - return "Specular"; - case aiTextureType_AMBIENT: - return "Ambient"; - case aiTextureType_EMISSIVE: - return "Emissive"; - case aiTextureType_OPACITY: - return "Opacity"; - case aiTextureType_NORMALS: - return "Normals"; - case aiTextureType_HEIGHT: - return "Height"; - case aiTextureType_SHININESS: - return "Shininess"; - case aiTextureType_DISPLACEMENT: - return "Displacement"; - case aiTextureType_LIGHTMAP: - return "Lightmap"; - case aiTextureType_REFLECTION: - return "Reflection"; - case aiTextureType_UNKNOWN: - return "Unknown"; - default: - break; - } - ai_assert(false); - return "BUG"; -} - - -// ----------------------------------------------------------------------------------- -// Some chuncks of text will need to be encoded for XML -// http://stackoverflow.com/questions/5665231/most-efficient-way-to-escape-xml-html-in-c-string#5665377 -static std::string encodeXML(const std::string& data) { - std::string buffer; - buffer.reserve(data.size()); - for(size_t pos = 0; pos != data.size(); ++pos) { - switch(data[pos]) { - case '&': buffer.append("&"); break; - case '\"': buffer.append("""); break; - case '\'': buffer.append("'"); break; - case '<': buffer.append("<"); break; - case '>': buffer.append(">"); break; - default: buffer.append(&data[pos], 1); break; - } - } - return buffer; -} - - - -// ----------------------------------------------------------------------------------- -// Write a text model dump -void WriteDump(const aiScene* scene, FILE* out, const char* src, const char* cmd, bool shortened) -{ - time_t tt = ::time(NULL); -#if _WIN32 - tm* p = gmtime(&tt); -#else - struct tm now; - tm* p = gmtime_r(&tt, &now); -#endif - ai_assert(nullptr != p); - - std::string c = cmd; - std::string::size_type s; - - // https://sourceforge.net/tracker/?func=detail&aid=3167364&group_id=226462&atid=1067632 - // -- not allowed in XML comments - while((s = c.find("--")) != std::string::npos) { - c[s] = '?'; - } - aiString name; - - // write header - fprintf(out, - "\n" - "\n\n" - - "" - " \n\n" - "\n", - - aiGetVersionMajor(),aiGetVersionMinor(),aiGetVersionRevision(),src,c.c_str(),asctime(p), - scene->mFlags, - 0 /*globalImporter->GetEffectivePostProcessing()*/); - - // write the node graph - WriteNode(scene->mRootNode, out, 0); - -#if 0 - // write cameras - for (unsigned int i = 0; i < scene->mNumCameras;++i) { - aiCamera* cam = scene->mCameras[i]; - ConvertName(name,cam->mName); - - // camera header - fprintf(out,"\t\n" - "\t\t %0 8f %0 8f %0 8f \n" - "\t\t %0 8f %0 8f %0 8f \n" - "\t\t %0 8f %0 8f %0 8f \n" - "\t\t %f \n" - "\t\t %f \n" - "\t\t %f \n" - "\t\t %f \n" - "\t\n", - name.data, - cam->mUp.x,cam->mUp.y,cam->mUp.z, - cam->mLookAt.x,cam->mLookAt.y,cam->mLookAt.z, - cam->mPosition.x,cam->mPosition.y,cam->mPosition.z, - cam->mHorizontalFOV,cam->mAspect,cam->mClipPlaneNear,cam->mClipPlaneFar,i); - } - - // write lights - for (unsigned int i = 0; i < scene->mNumLights;++i) { - aiLight* l = scene->mLights[i]; - ConvertName(name,l->mName); - - // light header - fprintf(out,"\t type=\"%s\"\n" - "\t\t %0 8f %0 8f %0 8f \n" - "\t\t %0 8f %0 8f %0 8f \n" - "\t\t %0 8f %0 8f %0 8f \n", - name.data, - (l->mType == aiLightSource_DIRECTIONAL ? "directional" : - (l->mType == aiLightSource_POINT ? "point" : "spot" )), - l->mColorDiffuse.r, l->mColorDiffuse.g, l->mColorDiffuse.b, - l->mColorSpecular.r,l->mColorSpecular.g,l->mColorSpecular.b, - l->mColorAmbient.r, l->mColorAmbient.g, l->mColorAmbient.b); - - if (l->mType != aiLightSource_DIRECTIONAL) { - fprintf(out, - "\t\t %0 8f %0 8f %0 8f \n" - "\t\t %f \n" - "\t\t %f \n" - "\t\t %f \n", - l->mPosition.x,l->mPosition.y,l->mPosition.z, - l->mAttenuationConstant,l->mAttenuationLinear,l->mAttenuationQuadratic); - } - - if (l->mType != aiLightSource_POINT) { - fprintf(out, - "\t\t %0 8f %0 8f %0 8f \n", - l->mDirection.x,l->mDirection.y,l->mDirection.z); - } - - if (l->mType == aiLightSource_SPOT) { - fprintf(out, - "\t\t %f \n" - "\t\t %f \n", - l->mAngleOuterCone,l->mAngleInnerCone); - } - fprintf(out,"\t\n"); - } -#endif - - // write textures - if (scene->mNumTextures) { - fprintf(out,"\n",scene->mNumTextures); - for (unsigned int i = 0; i < scene->mNumTextures;++i) { - aiTexture* tex = scene->mTextures[i]; - bool compressed = (tex->mHeight == 0); - - // mesh header - fprintf(out,"\t \n", - (compressed ? -1 : tex->mWidth),(compressed ? -1 : tex->mHeight), - (compressed ? "true" : "false")); - - if (compressed) { - fprintf(out,"\t\t \n",tex->mWidth); - - if (!shortened) { - for (unsigned int n = 0; n < tex->mWidth;++n) { - fprintf(out,"\t\t\t%2x",reinterpret_cast(tex->pcData)[n]); - if (n && !(n % 50)) { - fprintf(out,"\n"); - } - } - } - } - else if (!shortened){ - fprintf(out,"\t\t \n",tex->mWidth*tex->mHeight*4); - - // const unsigned int width = (unsigned int)log10((double)std::max(tex->mHeight,tex->mWidth))+1; - for (unsigned int y = 0; y < tex->mHeight;++y) { - for (unsigned int x = 0; x < tex->mWidth;++x) { - aiTexel* tx = tex->pcData + y*tex->mWidth+x; - unsigned int r = tx->r,g=tx->g,b=tx->b,a=tx->a; - fprintf(out,"\t\t\t%2x %2x %2x %2x",r,g,b,a); - - // group by four for readibility - if (0 == (x+y*tex->mWidth) % 4) - fprintf(out,"\n"); - } - } - } - fprintf(out,"\t\t\n\t\n"); - } - fprintf(out,"\n"); - } - - // write materials - if (scene->mNumMaterials) { - fprintf(out,"\n",scene->mNumMaterials); - for (unsigned int i = 0; i< scene->mNumMaterials; ++i) { - const aiMaterial* mat = scene->mMaterials[i]; - - fprintf(out,"\t\n"); - fprintf(out,"\t\t\n",mat->mNumProperties); - for (unsigned int n = 0; n < mat->mNumProperties;++n) { - - const aiMaterialProperty* prop = mat->mProperties[n]; - const char* sz = ""; - if (prop->mType == aiPTI_Float) { - sz = "float"; - } - else if (prop->mType == aiPTI_Integer) { - sz = "integer"; - } - else if (prop->mType == aiPTI_String) { - sz = "string"; - } - else if (prop->mType == aiPTI_Buffer) { - sz = "binary_buffer"; - } - - fprintf(out,"\t\t\tmKey.data, sz, - ::TextureTypeToString((aiTextureType)prop->mSemantic),prop->mIndex); - - if (prop->mType == aiPTI_Float) { - fprintf(out," size=\"%i\">\n\t\t\t\t", - static_cast(prop->mDataLength/sizeof(float))); - - for (unsigned int p = 0; p < prop->mDataLength/sizeof(float);++p) { - fprintf(out,"%f ",*((float*)(prop->mData+p*sizeof(float)))); - } - } - else if (prop->mType == aiPTI_Integer) { - fprintf(out," size=\"%i\">\n\t\t\t\t", - static_cast(prop->mDataLength/sizeof(int))); - - for (unsigned int p = 0; p < prop->mDataLength/sizeof(int);++p) { - fprintf(out,"%i ",*((int*)(prop->mData+p*sizeof(int)))); - } - } - else if (prop->mType == aiPTI_Buffer) { - fprintf(out," size=\"%i\">\n\t\t\t\t", - static_cast(prop->mDataLength)); - - for (unsigned int p = 0; p < prop->mDataLength;++p) { - fprintf(out,"%2x ",prop->mData[p]); - if (p && 0 == p%30) { - fprintf(out,"\n\t\t\t\t"); - } - } - } - else if (prop->mType == aiPTI_String) { - fprintf(out,">\n\t\t\t\t\"%s\"",encodeXML(prop->mData+4).c_str() /* skip length */); - } - fprintf(out,"\n\t\t\t\n"); - } - fprintf(out,"\t\t\n"); - fprintf(out,"\t\n"); - } - fprintf(out,"\n"); - } - - // write animations - if (scene->mNumAnimations) { - fprintf(out,"\n",scene->mNumAnimations); - for (unsigned int i = 0; i < scene->mNumAnimations;++i) { - aiAnimation* anim = scene->mAnimations[i]; - - // anim header - ConvertName(name,anim->mName); - fprintf(out,"\t\n", - name.data, anim->mDuration, anim->mTicksPerSecond); - - // write bone animation channels - if (anim->mNumChannels) { - fprintf(out,"\t\t\n",anim->mNumChannels); - for (unsigned int n = 0; n < anim->mNumChannels;++n) { - aiNodeAnim* nd = anim->mChannels[n]; - - // node anim header - ConvertName(name,nd->mNodeName); - fprintf(out,"\t\t\t\n",name.data); - - if (!shortened) { - // write position keys - if (nd->mNumPositionKeys) { - fprintf(out,"\t\t\t\t\n",nd->mNumPositionKeys); - for (unsigned int a = 0; a < nd->mNumPositionKeys;++a) { - aiVectorKey* vc = nd->mPositionKeys+a; - fprintf(out,"\t\t\t\t\t\n" - "\t\t\t\t\t\t%0 8f %0 8f %0 8f\n\t\t\t\t\t\n", - vc->mTime,vc->mValue.x,vc->mValue.y,vc->mValue.z); - } - fprintf(out,"\t\t\t\t\n"); - } - - // write scaling keys - if (nd->mNumScalingKeys) { - fprintf(out,"\t\t\t\t\n",nd->mNumScalingKeys); - for (unsigned int a = 0; a < nd->mNumScalingKeys;++a) { - aiVectorKey* vc = nd->mScalingKeys+a; - fprintf(out,"\t\t\t\t\t\n" - "\t\t\t\t\t\t%0 8f %0 8f %0 8f\n\t\t\t\t\t\n", - vc->mTime,vc->mValue.x,vc->mValue.y,vc->mValue.z); - } - fprintf(out,"\t\t\t\t\n"); - } - - // write rotation keys - if (nd->mNumRotationKeys) { - fprintf(out,"\t\t\t\t\n",nd->mNumRotationKeys); - for (unsigned int a = 0; a < nd->mNumRotationKeys;++a) { - aiQuatKey* vc = nd->mRotationKeys+a; - fprintf(out,"\t\t\t\t\t\n" - "\t\t\t\t\t\t%0 8f %0 8f %0 8f %0 8f\n\t\t\t\t\t\n", - vc->mTime,vc->mValue.x,vc->mValue.y,vc->mValue.z,vc->mValue.w); - } - fprintf(out,"\t\t\t\t\n"); - } - } - fprintf(out,"\t\t\t\n"); - } - fprintf(out,"\t\t\n"); - } - fprintf(out,"\t\n"); - } - fprintf(out,"\n"); - } - - // write meshes - if (scene->mNumMeshes) { - fprintf(out,"\n",scene->mNumMeshes); - for (unsigned int i = 0; i < scene->mNumMeshes;++i) { - aiMesh* mesh = scene->mMeshes[i]; - // const unsigned int width = (unsigned int)log10((double)mesh->mNumVertices)+1; - - // mesh header - fprintf(out,"\t\n", - (mesh->mPrimitiveTypes & aiPrimitiveType_POINT ? "points" : ""), - (mesh->mPrimitiveTypes & aiPrimitiveType_LINE ? "lines" : ""), - (mesh->mPrimitiveTypes & aiPrimitiveType_TRIANGLE ? "triangles" : ""), - (mesh->mPrimitiveTypes & aiPrimitiveType_POLYGON ? "polygons" : ""), - mesh->mMaterialIndex); - - // bones - if (mesh->mNumBones) { - fprintf(out,"\t\t\n",mesh->mNumBones); - - for (unsigned int n = 0; n < mesh->mNumBones;++n) { - aiBone* bone = mesh->mBones[n]; - - ConvertName(name,bone->mName); - // bone header - fprintf(out,"\t\t\t\n" - "\t\t\t\t \n" - "\t\t\t\t\t%0 6f %0 6f %0 6f %0 6f\n" - "\t\t\t\t\t%0 6f %0 6f %0 6f %0 6f\n" - "\t\t\t\t\t%0 6f %0 6f %0 6f %0 6f\n" - "\t\t\t\t\t%0 6f %0 6f %0 6f %0 6f\n" - "\t\t\t\t \n", - name.data, - bone->mOffsetMatrix.a1,bone->mOffsetMatrix.a2,bone->mOffsetMatrix.a3,bone->mOffsetMatrix.a4, - bone->mOffsetMatrix.b1,bone->mOffsetMatrix.b2,bone->mOffsetMatrix.b3,bone->mOffsetMatrix.b4, - bone->mOffsetMatrix.c1,bone->mOffsetMatrix.c2,bone->mOffsetMatrix.c3,bone->mOffsetMatrix.c4, - bone->mOffsetMatrix.d1,bone->mOffsetMatrix.d2,bone->mOffsetMatrix.d3,bone->mOffsetMatrix.d4); - - if (!shortened && bone->mNumWeights) { - fprintf(out,"\t\t\t\t\n",bone->mNumWeights); - - // bone weights - for (unsigned int a = 0; a < bone->mNumWeights;++a) { - aiVertexWeight* wght = bone->mWeights+a; - - fprintf(out,"\t\t\t\t\t\n\t\t\t\t\t\t%f\n\t\t\t\t\t\n", - wght->mVertexId,wght->mWeight); - } - fprintf(out,"\t\t\t\t\n"); - } - fprintf(out,"\t\t\t\n"); - } - fprintf(out,"\t\t\n"); - } - - // faces - if (!shortened && mesh->mNumFaces) { - fprintf(out,"\t\t\n",mesh->mNumFaces); - for (unsigned int n = 0; n < mesh->mNumFaces; ++n) { - aiFace& f = mesh->mFaces[n]; - fprintf(out,"\t\t\t\n" - "\t\t\t\t",f.mNumIndices); - - for (unsigned int j = 0; j < f.mNumIndices;++j) - fprintf(out,"%u ",f.mIndices[j]); - - fprintf(out,"\n\t\t\t\n"); - } - fprintf(out,"\t\t\n"); - } - - // vertex positions - if (mesh->HasPositions()) { - fprintf(out,"\t\t \n",mesh->mNumVertices); - if (!shortened) { - for (unsigned int n = 0; n < mesh->mNumVertices; ++n) { - fprintf(out,"\t\t%0 8f %0 8f %0 8f\n", - mesh->mVertices[n].x, - mesh->mVertices[n].y, - mesh->mVertices[n].z); - } - } - fprintf(out,"\t\t\n"); - } - - // vertex normals - if (mesh->HasNormals()) { - fprintf(out,"\t\t \n",mesh->mNumVertices); - if (!shortened) { - for (unsigned int n = 0; n < mesh->mNumVertices; ++n) { - fprintf(out,"\t\t%0 8f %0 8f %0 8f\n", - mesh->mNormals[n].x, - mesh->mNormals[n].y, - mesh->mNormals[n].z); - } - } - else { - } - fprintf(out,"\t\t\n"); - } - - // vertex tangents and bitangents - if (mesh->HasTangentsAndBitangents()) { - fprintf(out,"\t\t \n",mesh->mNumVertices); - if (!shortened) { - for (unsigned int n = 0; n < mesh->mNumVertices; ++n) { - fprintf(out,"\t\t%0 8f %0 8f %0 8f\n", - mesh->mTangents[n].x, - mesh->mTangents[n].y, - mesh->mTangents[n].z); - } - } - fprintf(out,"\t\t\n"); - - fprintf(out,"\t\t \n",mesh->mNumVertices); - if (!shortened) { - for (unsigned int n = 0; n < mesh->mNumVertices; ++n) { - fprintf(out,"\t\t%0 8f %0 8f %0 8f\n", - mesh->mBitangents[n].x, - mesh->mBitangents[n].y, - mesh->mBitangents[n].z); - } - } - fprintf(out,"\t\t\n"); - } - - // texture coordinates - for (unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a) { - if (!mesh->mTextureCoords[a]) - break; - - fprintf(out,"\t\t \n",mesh->mNumVertices, - a,mesh->mNumUVComponents[a]); - - if (!shortened) { - if (mesh->mNumUVComponents[a] == 3) { - for (unsigned int n = 0; n < mesh->mNumVertices; ++n) { - fprintf(out,"\t\t%0 8f %0 8f %0 8f\n", - mesh->mTextureCoords[a][n].x, - mesh->mTextureCoords[a][n].y, - mesh->mTextureCoords[a][n].z); - } - } - else { - for (unsigned int n = 0; n < mesh->mNumVertices; ++n) { - fprintf(out,"\t\t%0 8f %0 8f\n", - mesh->mTextureCoords[a][n].x, - mesh->mTextureCoords[a][n].y); - } - } - } - fprintf(out,"\t\t\n"); - } - - // vertex colors - for (unsigned int a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; ++a) { - if (!mesh->mColors[a]) - break; - fprintf(out,"\t\t \n",mesh->mNumVertices,a); - if (!shortened) { - for (unsigned int n = 0; n < mesh->mNumVertices; ++n) { - fprintf(out,"\t\t%0 8f %0 8f %0 8f %0 8f\n", - mesh->mColors[a][n].r, - mesh->mColors[a][n].g, - mesh->mColors[a][n].b, - mesh->mColors[a][n].a); - } - } - fprintf(out,"\t\t\n"); - } - fprintf(out,"\t\n"); - } - fprintf(out,"\n"); - } - fprintf(out,"\n"); -} - - -// ----------------------------------------------------------------------------------- -int Assimp_Dump (const char* const* params, unsigned int num) -{ - const char* fail = "assimp dump: Invalid number of arguments. " - "See \'assimp dump --help\'\r\n"; - - // --help - if (!strcmp( params[0], "-h") || !strcmp( params[0], "--help") || !strcmp( params[0], "-?") ) { - printf("%s",AICMD_MSG_DUMP_HELP); - return 0; - } - - // asssimp dump in out [options] - if (num < 1) { - printf("%s", fail); - return 1; - } - - std::string in = std::string(params[0]); - std::string out = (num > 1 ? std::string(params[1]) : std::string("-")); - - // store full command line - std::string cmd; - for (unsigned int i = (out[0] == '-' ? 1 : 2); i < num;++i) { - if (!params[i])continue; - cmd.append(params[i]); - cmd.append(" "); - } - - // get import flags - ImportData import; - ProcessStandardArguments(import,params+1,num-1); - - bool binary = false, shortened = false,compressed=false; - - // process other flags - for (unsigned int i = 1; i < num;++i) { - if (!params[i])continue; - if (!strcmp( params[i], "-b") || !strcmp( params[i], "--binary")) { - binary = true; - } - else if (!strcmp( params[i], "-s") || !strcmp( params[i], "--short")) { - shortened = true; - } - else if (!strcmp( params[i], "-z") || !strcmp( params[i], "--compressed")) { - compressed = true; - } -#if 0 - else if (i > 2 || params[i][0] == '-') { - ::printf("Unknown parameter: %s\n",params[i]); - return 10; - } -#endif - } - - if (out[0] == '-') { - // take file name from input file - std::string::size_type s = in.find_last_of('.'); - if (s == std::string::npos) { - s = in.length(); - } - - out = in.substr(0,s); - out.append((binary ? ".assbin" : ".assxml")); - if (shortened && binary) { - out.append(".regress"); - } - } - - // import the main model - const aiScene* scene = ImportModel(import,in); - if (!scene) { - printf("assimp dump: Unable to load input file %s\n",in.c_str()); - return 5; - } - - // open the output file and build the dump - FILE* o = ::fopen(out.c_str(),(binary ? "wb" : "wt")); - if (!o) { - printf("assimp dump: Unable to open output file %s\n",out.c_str()); - return 12; - } - - if (binary) { - WriteBinaryDump (scene,o,in.c_str(),cmd.c_str(),shortened,compressed,import); - } - else WriteDump (scene,o,in.c_str(),cmd.c_str(),shortened); - fclose(o); - - if (compressed && binary) { - CompressBinaryDump(out.c_str(),ASSBIN_HEADER_LENGTH); - } - - printf("assimp dump: Wrote output dump %s\n",out.c_str()); - return 0; -} - diff --git a/tools/assimp_cmd/WriteDump.cpp b/tools/assimp_cmd/WriteDump.cpp new file mode 100644 index 000000000..67d1a0e76 --- /dev/null +++ b/tools/assimp_cmd/WriteDump.cpp @@ -0,0 +1,210 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2020, assimp team + + + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ + +/** @file WriteDump.cpp + * @brief Implementation of the 'assimp dump' utility + */ + +#include "Main.h" +#include "PostProcessing/ProcessHelper.h" + +const char* AICMD_MSG_DUMP_HELP = +"assimp dump [] [-b] [-s] [-z] [common parameters]\n" +"\t -b Binary output \n" +"\t -s Shortened \n" +"\t -z Compressed \n" +"\t[See the assimp_cmd docs for a full list of all common parameters] \n" +"\t -cfast Fast post processing preset, runs just a few important steps \n" +"\t -cdefault Default post processing: runs all recommended steps\n" +"\t -cfull Fires almost all post processing steps \n" +; + +#include "Common/assbin_chunks.h" +#include +#include +#include + +#include + +FILE* out = NULL; +bool shortened = false; + +// ------------------------------------------------------------------------------- +const char* TextureTypeToString(aiTextureType in) +{ + switch (in) + { + case aiTextureType_NONE: + return "n/a"; + case aiTextureType_DIFFUSE: + return "Diffuse"; + case aiTextureType_SPECULAR: + return "Specular"; + case aiTextureType_AMBIENT: + return "Ambient"; + case aiTextureType_EMISSIVE: + return "Emissive"; + case aiTextureType_OPACITY: + return "Opacity"; + case aiTextureType_NORMALS: + return "Normals"; + case aiTextureType_HEIGHT: + return "Height"; + case aiTextureType_SHININESS: + return "Shininess"; + case aiTextureType_DISPLACEMENT: + return "Displacement"; + case aiTextureType_LIGHTMAP: + return "Lightmap"; + case aiTextureType_REFLECTION: + return "Reflection"; + case aiTextureType_UNKNOWN: + return "Unknown"; + default: + break; + } + ai_assert(false); + return "BUG"; +} + +// ----------------------------------------------------------------------------------- +int Assimp_Dump (const char* const* params, unsigned int num) +{ + const char* fail = "assimp dump: Invalid number of arguments. " + "See \'assimp dump --help\'\r\n"; + + // --help + if (!strcmp( params[0], "-h") || !strcmp( params[0], "--help") || !strcmp( params[0], "-?") ) { + printf("%s",AICMD_MSG_DUMP_HELP); + return AssimpCmdError::Success; + } + + // asssimp dump in out [options] + if (num < 1) { + printf("%s", fail); + return AssimpCmdError::InvalidNumberOfArguments; + } + + std::string in = std::string(params[0]); + std::string out = (num > 1 ? std::string(params[1]) : std::string("-")); + + // store full command line + std::string cmd; + for (unsigned int i = (out[0] == '-' ? 1 : 2); i < num;++i) { + if (!params[i])continue; + cmd.append(params[i]); + cmd.append(" "); + } + + // get import flags + ImportData import; + ProcessStandardArguments(import,params+1,num-1); + + bool binary = false, shortened = false,compressed=false; + + // process other flags + for (unsigned int i = 1; i < num;++i) { + if (!params[i])continue; + if (!strcmp( params[i], "-b") || !strcmp( params[i], "--binary")) { + binary = true; + } + else if (!strcmp( params[i], "-s") || !strcmp( params[i], "--short")) { + shortened = true; + } + else if (!strcmp( params[i], "-z") || !strcmp( params[i], "--compressed")) { + compressed = true; + } +#if 0 + else if (i > 2 || params[i][0] == '-') { + ::printf("Unknown parameter: %s\n",params[i]); + return 10; + } +#endif + } + + if (out[0] == '-') { + // take file name from input file + std::string::size_type s = in.find_last_of('.'); + if (s == std::string::npos) { + s = in.length(); + } + + out = in.substr(0,s); + out.append((binary ? ".assbin" : ".assxml")); + if (shortened && binary) { + out.append(".regress"); + } + } + + // import the main model + const aiScene* scene = ImportModel(import,in); + if (!scene) { + printf("assimp dump: Unable to load input file %s\n",in.c_str()); + return AssimpCmdError::FailedToLoadInputFile; + } + + try { + // Dump the main model, using the appropriate method. + std::unique_ptr pIOSystem(new DefaultIOSystem()); + if (binary) { + DumpSceneToAssbin(out.c_str(), cmd.c_str(), pIOSystem.get(), + scene, shortened, compressed); + } + else { + DumpSceneToAssxml(out.c_str(), cmd.c_str(), pIOSystem.get(), + scene, shortened); + } + } + catch (const std::exception& e) { + printf("%s", ("assimp dump: " + std::string(e.what())).c_str()); + return AssimpCmdError::ExceptionWasRaised; + } + catch (...) { + printf("assimp dump: An unknown exception occured.\n"); + return AssimpCmdError::ExceptionWasRaised; + } + + printf("assimp dump: Wrote output dump %s\n",out.c_str()); + return AssimpCmdError::Success; +} + diff --git a/tools/assimp_view/AnimEvaluator.cpp b/tools/assimp_view/AnimEvaluator.cpp index 9d9481a77..710950fe2 100644 --- a/tools/assimp_view/AnimEvaluator.cpp +++ b/tools/assimp_view/AnimEvaluator.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/tools/assimp_view/AnimEvaluator.h b/tools/assimp_view/AnimEvaluator.h index 1b4d54186..9267853e1 100644 --- a/tools/assimp_view/AnimEvaluator.h +++ b/tools/assimp_view/AnimEvaluator.h @@ -4,7 +4,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/tools/assimp_view/AssetHelper.h b/tools/assimp_view/AssetHelper.h index f71d8f510..7731e44e5 100644 --- a/tools/assimp_view/AssetHelper.h +++ b/tools/assimp_view/AssetHelper.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/tools/assimp_view/Background.cpp b/tools/assimp_view/Background.cpp index b356a245b..e5f4e2b96 100644 --- a/tools/assimp_view/Background.cpp +++ b/tools/assimp_view/Background.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/tools/assimp_view/Background.h b/tools/assimp_view/Background.h index 54b21676f..bbefd1065 100644 --- a/tools/assimp_view/Background.h +++ b/tools/assimp_view/Background.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2015, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/tools/assimp_view/CMakeLists.txt b/tools/assimp_view/CMakeLists.txt index 8112c19e8..001444e0e 100644 --- a/tools/assimp_view/CMakeLists.txt +++ b/tools/assimp_view/CMakeLists.txt @@ -1,7 +1,7 @@ # Open Asset Import Library (assimp) # ---------------------------------------------------------------------- # -# Copyright (c) 2006-2019, assimp team +# Copyright (c) 2006-2020, assimp team # All rights reserved. diff --git a/tools/assimp_view/Camera.h b/tools/assimp_view/Camera.h index fa9308ed5..dd82af029 100644 --- a/tools/assimp_view/Camera.h +++ b/tools/assimp_view/Camera.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/tools/assimp_view/Display.cpp b/tools/assimp_view/Display.cpp index ab29c1d3e..f66f6bc92 100644 --- a/tools/assimp_view/Display.cpp +++ b/tools/assimp_view/Display.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/tools/assimp_view/Display.h b/tools/assimp_view/Display.h index 3382d38bb..f52e65e42 100644 --- a/tools/assimp_view/Display.h +++ b/tools/assimp_view/Display.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/tools/assimp_view/HelpDialog.cpp b/tools/assimp_view/HelpDialog.cpp index 1a9f08f5f..70b2ac866 100644 --- a/tools/assimp_view/HelpDialog.cpp +++ b/tools/assimp_view/HelpDialog.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/tools/assimp_view/Input.cpp b/tools/assimp_view/Input.cpp index 88e04b437..505433404 100644 --- a/tools/assimp_view/Input.cpp +++ b/tools/assimp_view/Input.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/tools/assimp_view/LogDisplay.cpp b/tools/assimp_view/LogDisplay.cpp index d24b9bf20..ff5ed8680 100644 --- a/tools/assimp_view/LogDisplay.cpp +++ b/tools/assimp_view/LogDisplay.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/tools/assimp_view/LogDisplay.h b/tools/assimp_view/LogDisplay.h index a6dd69fc2..e0878b841 100644 --- a/tools/assimp_view/LogDisplay.h +++ b/tools/assimp_view/LogDisplay.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/tools/assimp_view/LogWindow.cpp b/tools/assimp_view/LogWindow.cpp index ca9b88f95..ff6e71038 100644 --- a/tools/assimp_view/LogWindow.cpp +++ b/tools/assimp_view/LogWindow.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/tools/assimp_view/LogWindow.h b/tools/assimp_view/LogWindow.h index 5248139da..671d8be8f 100644 --- a/tools/assimp_view/LogWindow.h +++ b/tools/assimp_view/LogWindow.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/tools/assimp_view/Material.cpp b/tools/assimp_view/Material.cpp index 2c5316d81..0d504e9fb 100644 --- a/tools/assimp_view/Material.cpp +++ b/tools/assimp_view/Material.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/tools/assimp_view/MaterialManager.h b/tools/assimp_view/MaterialManager.h index 17e133821..fb3fcb38f 100644 --- a/tools/assimp_view/MaterialManager.h +++ b/tools/assimp_view/MaterialManager.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/tools/assimp_view/MeshRenderer.cpp b/tools/assimp_view/MeshRenderer.cpp index dfa249735..27bc6704f 100644 --- a/tools/assimp_view/MeshRenderer.cpp +++ b/tools/assimp_view/MeshRenderer.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/tools/assimp_view/MeshRenderer.h b/tools/assimp_view/MeshRenderer.h index e9da93f6b..38cfa6326 100644 --- a/tools/assimp_view/MeshRenderer.h +++ b/tools/assimp_view/MeshRenderer.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/tools/assimp_view/MessageProc.cpp b/tools/assimp_view/MessageProc.cpp index cbd8b2f1a..3000e557b 100644 --- a/tools/assimp_view/MessageProc.cpp +++ b/tools/assimp_view/MessageProc.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/tools/assimp_view/Normals.cpp b/tools/assimp_view/Normals.cpp index 0ebd3dd5b..35e89e5b1 100644 --- a/tools/assimp_view/Normals.cpp +++ b/tools/assimp_view/Normals.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/tools/assimp_view/RenderOptions.h b/tools/assimp_view/RenderOptions.h index 73468f11a..bd9e8a871 100644 --- a/tools/assimp_view/RenderOptions.h +++ b/tools/assimp_view/RenderOptions.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/tools/assimp_view/SceneAnimator.cpp b/tools/assimp_view/SceneAnimator.cpp index 86fe46a9c..b6f95329d 100644 --- a/tools/assimp_view/SceneAnimator.cpp +++ b/tools/assimp_view/SceneAnimator.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/tools/assimp_view/SceneAnimator.h b/tools/assimp_view/SceneAnimator.h index 00d9832b6..956edb3e3 100644 --- a/tools/assimp_view/SceneAnimator.h +++ b/tools/assimp_view/SceneAnimator.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/tools/assimp_view/Shaders.cpp b/tools/assimp_view/Shaders.cpp index 49ec5320d..f129b7cc6 100644 --- a/tools/assimp_view/Shaders.cpp +++ b/tools/assimp_view/Shaders.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/tools/assimp_view/Shaders.h b/tools/assimp_view/Shaders.h index 59a45ce13..506daa70b 100644 --- a/tools/assimp_view/Shaders.h +++ b/tools/assimp_view/Shaders.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. diff --git a/tools/assimp_view/assimp_view.cpp b/tools/assimp_view/assimp_view.cpp index 1bcdce967..b8f13b092 100644 --- a/tools/assimp_view/assimp_view.cpp +++ b/tools/assimp_view/assimp_view.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/tools/assimp_view/assimp_view.h b/tools/assimp_view/assimp_view.h index a32a62d04..3c519bb92 100644 --- a/tools/assimp_view/assimp_view.h +++ b/tools/assimp_view/assimp_view.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2019, assimp team +Copyright (c) 2006-2020, assimp team diff --git a/tools/assimp_view/assimp_view.rc b/tools/assimp_view/assimp_view.rc index aca323b09..48d7c3697 100644 --- a/tools/assimp_view/assimp_view.rc +++ b/tools/assimp_view/assimp_view.rc @@ -43,7 +43,7 @@ FONT 9, "Courier New", 400, 0, 0x0 BEGIN LTEXT "Open Asset Import Library (Assimp)",IDC_STATIC,30,14,144,9 LTEXT "A free C/C++ library to read various well-known 3D model formats into a straightforward in-memory format for easy processing by applications. Licensed under a 3-clause BSD license and totally awesome.",IDC_STATIC,31,34,204,24 - LTEXT "(c) 2008-2009. Assimp Development Team. See the CREDITS file for a list of all contributors.",IDC_STATIC,30,65,204,23 + LTEXT "(c) 2008-2020. Assimp Development Team. See the CREDITS file for a list of all contributors.",IDC_STATIC,30,65,204,23 CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,27,282,1 LTEXT "http://assimp.sourceforge.net http://www.zfx.info",IDC_STATIC,31,101,127,22 DEFPUSHBUTTON "Love this library",IDOK,186,110,84,14 diff --git a/tools/coverity/assimp_modeling.cpp b/tools/coverity/assimp_modeling.cpp index cc09284f4..aeb83a259 100644 --- a/tools/coverity/assimp_modeling.cpp +++ b/tools/coverity/assimp_modeling.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2015, assimp team +Copyright (c) 2006-2020, assimp team All rights reserved. Redistribution and use of this software in source and binary forms,