From 4aed69c6f107beb154aaa6c0eb59d1a4844691a7 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 21 Nov 2016 19:36:54 +0100 Subject: [PATCH 01/78] Fix merge errors. --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e6eb005e3..45342a05b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,10 @@ before_install: - sudo apt-get update -qq -<<<<<<< HEAD - sudo apt-get install cmake env: global: - secure: "lZ7pHQvl5dpZWzBQAaIMf0wqrvtcZ4wiZKeIZjf83TEsflW8+z0uTpIuN30ZV6Glth/Sq1OhLnTP5+N57fZU/1ebA5twHdvP4bS5CIUUg71/CXQZNl36xeaqvxsG/xRrdpKOsPdjAOsQ9KPTQulsX43XDLS7CasMiLvYOpqKcPc=" -======= - sudo apt-get install cmake python3 - if [ $LINUX ]; then sudo apt-get install -qq freeglut3-dev libxmu-dev libxi-dev ; fi - echo -e "#ifndef A_R_H_INC\n#define A_R_H_INC\n#define GitVersion ${TRAVIS_JOB_ID}\n#define GitBranch \"${TRAVIS_BRANCH}\"\n#endif // A_R_H_INC" > revision.h @@ -66,3 +64,4 @@ addons: build_command_prepend: "cmake . -DASSIMP_ENABLE_BOOST_WORKAROUND=YES" build_command: "make" branch_pattern: coverity_scan + From 350619a17f37e319a25a958aef42f5f4ec755a6a Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 22 Nov 2016 07:28:00 +0100 Subject: [PATCH 02/78] Old coverity scan config. --- .travis.yml | 45 ++++----------------------------------------- 1 file changed, 4 insertions(+), 41 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2e10890e3..ea8ed55a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,65 +1,28 @@ before_install: - sudo apt-get update -qq - sudo apt-get install cmake - - sudo apt-get install cmake python3 - - if [ $LINUX ]; then sudo apt-get install -qq freeglut3-dev libxmu-dev libxi-dev ; fi - - echo -e "#ifndef A_R_H_INC\n#define A_R_H_INC\n#define GitVersion ${TRAVIS_JOB_ID}\n#define GitBranch \"${TRAVIS_BRANCH}\"\n#endif // A_R_H_INC" > revision.h - # install latest LCOV (1.9 was failing) - - cd ${TRAVIS_BUILD_DIR} - - wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz - - tar xf lcov_1.11.orig.tar.gz - - sudo make -C lcov-1.11/ install - - gem install coveralls-lcov - - lcov --version - - g++ --version - -branches: - only: - - master env: global: - 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} - matrix: - - LINUX=1 TRAVIS_NO_EXPORT=YES ENABLE_COVERALLS=ON - - LINUX=1 TRAVIS_NO_EXPORT=NO ENABLE_COVERALLS=OFF - - LINUX=1 SHARED_BUILD=ON ENABLE_COVERALLS=OFF - - LINUX=1 SHARED_BUILD=OFF ENABLE_COVERALLS=OFF - - ANDROID=1 language: cpp - + compiler: - gcc - clang -install: - - if [ $ANDROID ]; then wget -c http://dl.google.com/android/ndk/android-ndk-${PV}-${PLATF}.tar.bz2 && tar xf android-ndk-${PV}-${PLATF}.tar.bz2 ; fi - before_script: - - cd ${TRAVIS_BUILD_DIR} - # init coverage to 0 (optional) - - lcov --directory . --zerocounters + cmake . -DASSIMP_ENABLE_BOOST_WORKAROUND=YES script: - - export COVERALLS_SERVICE_NAME=travis-ci - - export COVERALLS_REPO_TOKEN=abc12345 - - . ./.travis.sh - -after_success: - - cd ${TRAVIS_BUILD_DIR} - - lcov --directory . --capture --output-file coverage.info - - lcov --remove coverage.info '/usr/*' 'contrib/*' 'test/*' --output-file coverage.info - - lcov --list coverage.info - - coveralls-lcov --source-encoding=ISO-8859-1 --repo-token=${COVERALLS_TOKEN} coverage.info + make addons: coverity_scan: project: name: "assimp/assimp" notification_email: kim.kulling@googlemail.com - build_command_prepend: "cmake" + build_command_prepend: "cmake . -DASSIMP_ENABLE_BOOST_WORKAROUND=YES" build_command: "make" branch_pattern: coverity_scan - From ef30abfbcd65b3cdc66294242192767b459f1d1f Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 22 Nov 2016 07:43:51 +0100 Subject: [PATCH 03/78] Use old config. --- .travis.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index ea8ed55a6..2ee456327 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,12 @@ -before_install: - - sudo apt-get update -qq - - sudo apt-get install cmake - env: global: - secure: "lZ7pHQvl5dpZWzBQAaIMf0wqrvtcZ4wiZKeIZjf83TEsflW8+z0uTpIuN30ZV6Glth/Sq1OhLnTP5+N57fZU/1ebA5twHdvP4bS5CIUUg71/CXQZNl36xeaqvxsG/xRrdpKOsPdjAOsQ9KPTQulsX43XDLS7CasMiLvYOpqKcPc=" +before_install: + - sudo apt-get update -qq + - sudo apt-get install cmake + - echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca- + language: cpp compiler: @@ -13,7 +14,7 @@ compiler: - clang before_script: - cmake . -DASSIMP_ENABLE_BOOST_WORKAROUND=YES + cmake . script: make @@ -23,6 +24,6 @@ addons: project: name: "assimp/assimp" notification_email: kim.kulling@googlemail.com - build_command_prepend: "cmake . -DASSIMP_ENABLE_BOOST_WORKAROUND=YES" - build_command: "make" + build_command_prepend: "cmake ." + build_command: "make -j4" branch_pattern: coverity_scan From c27f35a6fdddcc4ba2a7dbf7595e8b9a4d98bcbc Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 28 Jun 2017 20:18:37 +0200 Subject: [PATCH 04/78] Update .travis.yml remove dead code. --- .travis.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index a00e0ce70..fbef08285 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,11 +23,6 @@ env: - LINUX=1 TRAVIS_NO_EXPORT=NO ENABLE_COVERALLS=OFF - LINUX=1 SHARED_BUILD=ON ENABLE_COVERALLS=OFF - LINUX=1 SHARED_BUILD=OFF ENABLE_COVERALLS=OFF - #exclude: - # - os: linux - # compiler: clang - # - os: osx - # compiler: gcc compiler: - gcc From 7b15ec0b64be14811cee20f81922a4fef5af94bc Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 1 Jul 2017 11:02:03 +0200 Subject: [PATCH 05/78] pyassimp: update readme. --- port/PyAssimp/README.md | 188 ++++++++++++++++++++-------------------- 1 file changed, 94 insertions(+), 94 deletions(-) diff --git a/port/PyAssimp/README.md b/port/PyAssimp/README.md index 0000f9386..37ecdb65d 100644 --- a/port/PyAssimp/README.md +++ b/port/PyAssimp/README.md @@ -1,94 +1,94 @@ -PyAssimp Readme -=============== - -A simple Python wrapper for Assimp using `ctypes` to access the library. -Requires Python >= 2.6. - -Python 3 support is mostly here, but not well tested. - -Note that pyassimp is not complete. Many ASSIMP features are missing. - -USAGE ------ - -### Complete example: 3D viewer - -`pyassimp` comes with a simple 3D viewer that shows how to load and display a 3D -model using a shader-based OpenGL pipeline. - -![Screenshot](3d_viewer_screenshot.png) - -To use it, from within `/port/PyAssimp`: - -``` -$ cd scripts -$ python ./3D-viewer -``` - -You can use this code as starting point in your applications. - -### Writing your own code - -To get started with `pyassimp`, examine the simpler `sample.py` script in `scripts/`, -which illustrates the basic usage. All Assimp data structures are wrapped using -`ctypes`. All the data+length fields in Assimp's data structures (such as -`aiMesh::mNumVertices`, `aiMesh::mVertices`) are replaced by simple python -lists, so you can call `len()` on them to get their respective size and access -members using `[]`. - -For example, to load a file named `hello.3ds` and print the first -vertex of the first mesh, you would do (proper error handling -substituted by assertions ...): - -```python - -from pyassimp import * -scene = load('hello.3ds') - -assert len(scene.meshes) -mesh = scene.meshes[0] - -assert len(mesh.vertices) -print(mesh.vertices[0]) - -# don't forget this one, or you will leak! -release(scene) - -``` - -Another example to list the 'top nodes' in a -scene: - -```python - -from pyassimp import * -scene = load('hello.3ds') - -for c in scene.rootnode.children: - print(str(c)) - -release(scene) - -``` - -INSTALL -------- - -Install `pyassimp` by running: - -``` -$ python setup.py install -``` - -PyAssimp requires a assimp dynamic library (`DLL` on windows, -`.so` on linux, `.dynlib` on macOS) in order to work. The default search directories -are: - -- the current directory -- on linux additionally: `/usr/lib`, `/usr/local/lib`, - `/usr/lib/x86_64-linux-gnu` - -To build that library, refer to the Assimp master `INSTALL` -instructions. To look in more places, edit `./pyassimp/helper.py`. -There's an `additional_dirs` list waiting for your entries. - +PyAssimp Readme +=============== + +A simple Python wrapper for Assimp using `ctypes` to access the library. +Requires Python >= 2.6. + +Python 3 support is mostly here, but not well tested. + +Note that pyassimp is not complete. Many ASSIMP features are missing. + +USAGE +----- + +### Complete example: 3D viewer + +`pyassimp` comes with a simple 3D viewer that shows how to load and display a 3D +model using a shader-based OpenGL pipeline. + +![Screenshot](3d_viewer_screenshot.png) + +To use it, from within `/port/PyAssimp`: + +``` +$ cd scripts +$ python ./3D-viewer +``` + +You can use this code as starting point in your applications. + +### Writing your own code + +To get started with `pyassimp`, examine the simpler `sample.py` script in `scripts/`, +which illustrates the basic usage. All Assimp data structures are wrapped using +`ctypes`. All the data+length fields in Assimp's data structures (such as +`aiMesh::mNumVertices`, `aiMesh::mVertices`) are replaced by simple python +lists, so you can call `len()` on them to get their respective size and access +members using `[]`. + +For example, to load a file named `hello.3ds` and print the first +vertex of the first mesh, you would do (proper error handling +substituted by assertions ...): + +```python + +from pyassimp import * +scene = load('hello.3ds') + +assert len(scene.meshes) +mesh = scene.meshes[0] + +assert len(mesh.vertices) +print(mesh.vertices[0]) + +# don't forget this one, or you will leak! +release(scene) + +``` + +Another example to list the 'top nodes' in a +scene: + +```python + +from pyassimp import * +scene = load('hello.3ds') + +for c in scene.rootnode.children: + print(str(c)) + +release(scene) + +``` + +INSTALL +------- + +Install `pyassimp` by running: + +``` +$ python setup.py install +``` + +PyAssimp requires a assimp dynamic library (`DLL` on windows, +`.so` on linux, `.dynlib` on macOS) in order to work. The default search directories +are: + +- the current directory +- on linux additionally: `/usr/lib`, `/usr/local/lib`, + `/usr/lib/x86_64-linux-gnu` + +To build that library, refer to the Assimp master `INSTALL` +instructions. To look in more places, edit `./pyassimp/helper.py`. +There's an `additional_dirs` list waiting for your entries. + From 0e6cbdba3e74b425aa490b3612c09ddec70b05aa Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 1 Jul 2017 11:33:17 +0200 Subject: [PATCH 06/78] back to 3.3.1 version with build on 4 cpus. --- .travis.yml | 41 ++++++++--------------------------------- 1 file changed, 8 insertions(+), 33 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5c88ecb39..0c16c6c41 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,54 +1,29 @@ sudo: required -language: cpp - before_install: - - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get update -qq && sudo apt-get install cmake && sudo apt-get install cmake python3 && sudo apt-get install -qq freeglut3-dev libxmu-dev libxi-dev ; echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca- ; fi - - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install cmake python3 homebrew/x11/freeglut; fi - - echo -e "#ifndef A_R_H_INC\n#define A_R_H_INC\n#define GitVersion ${TRAVIS_JOB_ID}\n#define GitBranch \"${TRAVIS_BRANCH}\"\n#endif // A_R_H_INC" > revision.h - # install latest LCOV (1.9 was failing) - - if [ "$TRAVIS_OS_NAME" = "linux" ]; then cd ${TRAVIS_BUILD_DIR} && wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz && tar xf lcov_1.11.orig.tar.gz && sudo make -C lcov-1.11/ install && gem install coveralls-lcov && lcov --version && g++ --version ; fi - -branches: - only: - - master - -osx_image: xcode8.3 + - sudo apt-get update -qq + - sudo apt-get install cmake + - sudo apt-get install -qq freeglut3-dev libxmu-dev libxi-dev env: global: - # COVERITY_SCAN_TOKEN - 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} - matrix: - - LINUX=1 TRAVIS_NO_EXPORT=YES ENABLE_COVERALLS=ON - - LINUX=1 TRAVIS_NO_EXPORT=NO ENABLE_COVERALLS=OFF - - LINUX=1 SHARED_BUILD=ON ENABLE_COVERALLS=OFF - - LINUX=1 SHARED_BUILD=OFF ENABLE_COVERALLS=OFF +language: cpp + compiler: - gcc - - clang before_script: - # init coverage to 0 (optional) - - if [ "$TRAVIS_OS_NAME" = "linux" ]; then cd ${TRAVIS_BUILD_DIR} && lcov --directory . --zerocounters ; fi + cmake . -DASSIMP_ENABLE_BOOST_WORKAROUND=YES script: - - export COVERALLS_SERVICE_NAME=travis-ci - - export COVERALLS_REPO_TOKEN=abc12345 - - . ./.travis.sh -os: - - linux - - osx - -after_success: - - if [ "$TRAVIS_OS_NAME" = "linux" ]; then cd ${TRAVIS_BUILD_DIR} && lcov --directory . --capture --output-file coverage.info && lcov --remove coverage.info '/usr/*' 'contrib/*' 'test/*' --output-file coverage.info && lcov --list coverage.info && coveralls-lcov --source-encoding=ISO-8859-1 --repo-token=${COVERALLS_TOKEN} coverage.info ; fi + make addons: coverity_scan: project: name: "assimp/assimp" notification_email: kim.kulling@googlemail.com - build_command_prepend: "cmake ." + build_command_prepend: "cmake . -DASSIMP_ENABLE_BOOST_WORKAROUND=YES" build_command: "make -j4" branch_pattern: coverity_scan From bb66af544a6e177cdf5a8d6e27dd105c947375fd Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 2 Dec 2018 13:08:47 +0100 Subject: [PATCH 07/78] closes https://github.com/assimp/assimp/issues/2228: prepare pull-request. --- code/OFFLoader.cpp | 240 +++++++++++++++++++++++++++++++-------------- 1 file changed, 165 insertions(+), 75 deletions(-) diff --git a/code/OFFLoader.cpp b/code/OFFLoader.cpp index 81f9c9916..977b1b36c 100644 --- a/code/OFFLoader.cpp +++ b/code/OFFLoader.cpp @@ -106,15 +106,23 @@ const aiImporterDesc* OFFImporter::GetInfo () const return &desc; } + +// skip blank space, lines and comments +static void NextToken(const char **car, const char* end) { + SkipSpacesAndLineEnd(car); + while (*car < end && (**car == '#' || **car == '\n' || **car == '\r')) { + SkipLine(car); + SkipSpacesAndLineEnd(car); + } +} + // ------------------------------------------------------------------------------------------------ // Imports the given file into the given scene structure. -void OFFImporter::InternReadFile( const std::string& pFile, - aiScene* pScene, IOSystem* pIOHandler) -{ +void OFFImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler) { std::unique_ptr file( pIOHandler->Open( pFile, "rb")); // Check whether we can read from the file - if( file.get() == NULL) { + if( file.get() == nullptr) { throw DeadlyImportError( "Failed to open OFF file " + pFile + "."); } @@ -123,15 +131,61 @@ void OFFImporter::InternReadFile( const std::string& pFile, TextFileToBuffer(file.get(),mBuffer2); const char* buffer = &mBuffer2[0]; - char line[4096]; - GetNextLine(buffer,line); - if ('O' == line[0]) { - GetNextLine(buffer,line); // skip the 'OFF' line + // Proper OFF header parser. We only implement normal loading for now. + bool hasTexCoord = false, hasNormals = false, hasColors = false; + bool hasHomogenous = false, hasDimension = false; + unsigned int dimensions = 3; + const char* car = buffer; + const char* end = buffer + mBuffer2.size(); + NextToken(&car, end); + + if (car < end - 2 && car[0] == 'S' && car[1] == 'T') { + hasTexCoord = true; car += 2; + } + if (car < end - 1 && car[0] == 'C') { + hasColors = true; car++; + } + if (car < end- 1 && car[0] == 'N') { + hasNormals = true; car++; + } + if (car < end - 1 && car[0] == '4') { + hasHomogenous = true; car++; + } + if (car < end - 1 && car[0] == 'n') { + hasDimension = true; car++; + } + if (car < end - 3 && car[0] == 'O' && car[1] == 'F' && car[2] == 'F') { + car += 3; + NextToken(&car, end); + } else { + // in case there is no OFF header (which is allowed by the + // specification...), then we might have unintentionally read an + // additional dimension from the primitive count fields + dimensions = 3; + hasHomogenous = false; + NextToken(&car, end); + + // at this point the next token should be an integer number + if (car >= end - 1 || *car < '0' || *car > '9') { + throw DeadlyImportError("OFF: Header is invalid"); + } + } + if (hasDimension) { + dimensions = strtoul10(car, &car); + NextToken(&car, end); + } + if (dimensions > 3) { + throw DeadlyImportError + ("OFF: Number of vertex coordinates higher than 3 unsupported"); } - const char* sz = line; SkipSpaces(&sz); - const unsigned int numVertices = strtoul10(sz,&sz);SkipSpaces(&sz); - const unsigned int numFaces = strtoul10(sz,&sz); + NextToken(&car, end); + const unsigned int numVertices = strtoul10(car, &car); + NextToken(&car, end); + const unsigned int numFaces = strtoul10(car, &car); + NextToken(&car, end); + strtoul10(car, &car); // skip edge count + NextToken(&car, end); if (!numVertices) { throw DeadlyImportError("OFF: There are no valid vertices"); @@ -147,91 +201,127 @@ void OFFImporter::InternReadFile( const std::string& pFile, pScene->mMeshes[0] = mesh; mesh->mNumFaces = numFaces; - aiFace* faces = new aiFace [mesh->mNumFaces]; + aiFace* faces = new aiFace[mesh->mNumFaces]; mesh->mFaces = faces; - std::vector tempPositions(numVertices); + mesh->mNumVertices = numVertices; + mesh->mVertices = new aiVector3D[numVertices]; + mesh->mNormals = hasNormals ? new aiVector3D[numVertices] : nullptr; + mesh->mColors[0] = hasColors ? new aiColor4D[numVertices] : nullptr; + + if (hasTexCoord) { + mesh->mNumUVComponents[0] = 2; + mesh->mTextureCoords[0] = new aiVector3D[numVertices]; + } + char line[4096]; + buffer = car; + const char *sz = car; // now read all vertex lines - for (unsigned int i = 0; i< numVertices;++i) - { - if(!GetNextLine(buffer,line)) - { + for (unsigned int i = 0; i < numVertices; ++i) { + if(!GetNextLine(buffer, line)) { ASSIMP_LOG_ERROR("OFF: The number of verts in the header is incorrect"); break; } - aiVector3D& v = tempPositions[i]; + aiVector3D& v = mesh->mVertices[i]; + sz = line; - sz = line; SkipSpaces(&sz); - sz = fast_atoreal_move(sz,(ai_real&)v.x); SkipSpaces(&sz); - sz = fast_atoreal_move(sz,(ai_real&)v.y); SkipSpaces(&sz); - fast_atoreal_move(sz,(ai_real&)v.z); + // helper array to write a for loop over possible dimension values + ai_real* vec[3] = {&v.x, &v.y, &v.z}; + + // stop at dimensions: this allows loading 1D or 2D coordinate vertices + for (unsigned int dim = 0; dim < dimensions; ++dim ) { + SkipSpaces(&sz); + sz = fast_atoreal_move(sz, *vec[dim]); + } + + // if has homogenous coordinate, divide others by this one + if (hasHomogenous) { + SkipSpaces(&sz); + ai_real w = 1.; + sz = fast_atoreal_move(sz, w); + for (unsigned int dim = 0; dim < dimensions; ++dim ) { + *(vec[dim]) /= w; + } + } + + // read optional normals + if (hasNormals) { + aiVector3D& n = mesh->mNormals[i]; + SkipSpaces(&sz); + sz = fast_atoreal_move(sz,(ai_real&)n.x); + SkipSpaces(&sz); + sz = fast_atoreal_move(sz,(ai_real&)n.y); + SkipSpaces(&sz); + fast_atoreal_move(sz,(ai_real&)n.z); + } + + // reading colors is a pain because the specification says it can be + // integers or floats, and any number of them between 1 and 4 included, + // until the next comment or end of line + // in theory should be testing type ! + if (hasColors) { + aiColor4D& c = mesh->mColors[0][i]; + SkipSpaces(&sz); + sz = fast_atoreal_move(sz,(ai_real&)c.r); + if (*sz != '#' && *sz != '\n' && *sz != '\r') { + SkipSpaces(&sz); + sz = fast_atoreal_move(sz,(ai_real&)c.g); + } else { + c.g = 0.; + } + if (*sz != '#' && *sz != '\n' && *sz != '\r') { + SkipSpaces(&sz); + sz = fast_atoreal_move(sz,(ai_real&)c.b); + } else { + c.b = 0.; + } + if (*sz != '#' && *sz != '\n' && *sz != '\r') { + SkipSpaces(&sz); + sz = fast_atoreal_move(sz,(ai_real&)c.a); + } else { + c.a = 1.; + } + } + if (hasTexCoord) { + aiVector3D& t = mesh->mTextureCoords[0][i]; + SkipSpaces(&sz); + sz = fast_atoreal_move(sz,(ai_real&)t.x); + SkipSpaces(&sz); + fast_atoreal_move(sz,(ai_real&)t.y); + } } - - // First find out how many vertices we'll need - const char* old = buffer; - for (unsigned int i = 0; i< mesh->mNumFaces;++i) - { - if(!GetNextLine(buffer,line)) - { + // load faces with their indices + faces = mesh->mFaces; + for (unsigned int i = 0; i < numFaces; ++i ) { + if(!GetNextLine(buffer,line)) { ASSIMP_LOG_ERROR("OFF: The number of faces in the header is incorrect"); break; } - sz = line;SkipSpaces(&sz); - faces->mNumIndices = strtoul10(sz,&sz); - if(!(faces->mNumIndices) || faces->mNumIndices > 9) - { - ASSIMP_LOG_ERROR("OFF: Faces with zero indices aren't allowed"); + unsigned int idx; + sz = line; SkipSpaces(&sz); + idx = strtoul10(sz,&sz); + if(!idx || idx > 9) { + ASSIMP_LOG_ERROR("OFF: Faces with zero indices aren't allowed"); --mesh->mNumFaces; continue; - } - mesh->mNumVertices += faces->mNumIndices; - ++faces; - } - - if (!mesh->mNumVertices) - throw DeadlyImportError("OFF: There are no valid faces"); - - // allocate storage for the output vertices - std::vector verts; - verts.reserve(mesh->mNumVertices); - - // second: now parse all face indices - buffer = old; - faces = mesh->mFaces; - for (unsigned int i = 0, p = 0; i< mesh->mNumFaces;) - { - if(!GetNextLine(buffer,line))break; - - unsigned int idx; - sz = line;SkipSpaces(&sz); - idx = strtoul10(sz,&sz); - if(!(idx) || idx > 9) - continue; - - faces->mIndices = new unsigned int [faces->mNumIndices]; - for (unsigned int m = 0; m < faces->mNumIndices;++m) - { + } + faces->mNumIndices = idx; + faces->mIndices = new unsigned int[faces->mNumIndices]; + for (unsigned int m = 0; m < faces->mNumIndices;++m) { SkipSpaces(&sz); idx = strtoul10(sz,&sz); - if ((idx) >= numVertices) - { + if (idx >= numVertices) { ASSIMP_LOG_ERROR("OFF: Vertex index is out of range"); - idx = numVertices-1; + idx = numVertices - 1; } - faces->mIndices[m] = p++; - verts.push_back(tempPositions[idx]); + faces->mIndices[m] = idx; } ++i; ++faces; } - - if (mesh->mNumVertices != verts.size()) { - throw DeadlyImportError("OFF: Vertex count mismatch"); - } - mesh->mVertices = new aiVector3D[verts.size()]; - memcpy(mesh->mVertices, &verts[0], verts.size() * sizeof(aiVector3D)); + // generate the output node graph pScene->mRootNode = new aiNode(); pScene->mRootNode->mName.Set(""); @@ -248,8 +338,8 @@ void OFFImporter::InternReadFile( const std::string& pFile, pcMat->AddProperty(&clr,1,AI_MATKEY_COLOR_DIFFUSE); pScene->mMaterials[0] = pcMat; - const int twosided =1; - pcMat->AddProperty(&twosided,1,AI_MATKEY_TWOSIDED); + const int twosided = 1; + pcMat->AddProperty(&twosided, 1, AI_MATKEY_TWOSIDED); } #endif // !! ASSIMP_BUILD_NO_OFF_IMPORTER From 30d3c8c6a37a3b098702dfb714fe8e5e2abbfa5e Mon Sep 17 00:00:00 2001 From: sfalexrog Date: Mon, 3 Dec 2018 23:22:34 +0300 Subject: [PATCH 08/78] Fix CMake target alias typo --- code/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index f34aac5c9..6b8d3d322 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -923,7 +923,7 @@ IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER) ENDIF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER) ADD_LIBRARY( assimp ${assimp_src} ) -ADD_LIBRARY(assimp::asimp ALIAS assimp) +ADD_LIBRARY(assimp::assimp ALIAS assimp) TARGET_INCLUDE_DIRECTORIES ( assimp PUBLIC $ From ce91f5c88890cc635986ccc52afb56d375efed5d Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 3 Dec 2018 21:24:06 +0100 Subject: [PATCH 09/78] Off-Importer: introduce unittest. --- code/OFFLoader.cpp | 2 +- code/glTF2Importer.cpp | 14 +++-- test/CMakeLists.txt | 2 + test/unit/ImportExport/utOFFImportExport.cpp | 63 ++++++++++++++++++++ test/unit/utObjTools.cpp | 1 - 5 files changed, 76 insertions(+), 6 deletions(-) create mode 100644 test/unit/ImportExport/utOFFImportExport.cpp diff --git a/code/OFFLoader.cpp b/code/OFFLoader.cpp index 977b1b36c..a72e6d9d4 100644 --- a/code/OFFLoader.cpp +++ b/code/OFFLoader.cpp @@ -294,7 +294,7 @@ void OFFImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOS // load faces with their indices faces = mesh->mFaces; - for (unsigned int i = 0; i < numFaces; ++i ) { + for (unsigned int i = 0; i < numFaces; ) { if(!GetNextLine(buffer,line)) { ASSIMP_LOG_ERROR("OFF: The number of faces in the header is incorrect"); break; diff --git a/code/glTF2Importer.cpp b/code/glTF2Importer.cpp index ff9fd4269..f6a664e5e 100755 --- a/code/glTF2Importer.cpp +++ b/code/glTF2Importer.cpp @@ -1024,20 +1024,26 @@ void glTF2Importer::ImportAnimations(glTF2::Asset& r) } // Use the latest keyframe for the duration of the animation - unsigned int maxDuration = 0; + double maxDuration = 0; for (unsigned int j = 0; j < ai_anim->mNumChannels; ++j) { auto chan = ai_anim->mChannels[j]; if (chan->mNumPositionKeys) { auto lastPosKey = chan->mPositionKeys[chan->mNumPositionKeys - 1]; - if (lastPosKey.mTime > maxDuration) maxDuration = lastPosKey.mTime; + if (lastPosKey.mTime > maxDuration) { + maxDuration = lastPosKey.mTime; + } } if (chan->mNumRotationKeys) { auto lastRotKey = chan->mRotationKeys[chan->mNumRotationKeys - 1]; - if (lastRotKey.mTime > maxDuration) maxDuration = lastRotKey.mTime; + if (lastRotKey.mTime > maxDuration) { + maxDuration = lastRotKey.mTime; + } } if (chan->mNumScalingKeys) { auto lastScaleKey = chan->mScalingKeys[chan->mNumScalingKeys - 1]; - if (lastScaleKey.mTime > maxDuration) maxDuration = lastScaleKey.mTime; + if (lastScaleKey.mTime > maxDuration) { + maxDuration = lastScaleKey.mTime; + } } } ai_anim->mDuration = maxDuration; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 01c8daa09..7e2aec270 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -49,6 +49,7 @@ INCLUDE_DIRECTORIES( if (MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING") endif() + # Add the temporary output directories to the library path to make sure the # Assimp library can be found, even if it is not installed system-wide yet. LINK_DIRECTORIES( ${Assimp_BINARY_DIR} ${AssetImporter_BINARY_DIR}/lib ) @@ -121,6 +122,7 @@ SET( IMPORTERS unit/ImportExport/utCOBImportExport.cpp unit/ImportExport/utOgreImportExport.cpp unit/ImportExport/utQ3BSPFileImportExport.cpp + unit/ImportExport/utOFFImportExport.cpp ) SET( MATERIAL diff --git a/test/unit/ImportExport/utOFFImportExport.cpp b/test/unit/ImportExport/utOFFImportExport.cpp new file mode 100644 index 000000000..a355beab6 --- /dev/null +++ b/test/unit/ImportExport/utOFFImportExport.cpp @@ -0,0 +1,63 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2018, 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 "SceneDiffer.h" +#include "AbstractImportExportBase.h" +#include +#include +#include +#include + +class utOFFImportExport : public AbstractImportExportBase { +protected: + virtual bool importerTest() { + ::Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/OFF/Cube.off", aiProcess_ValidateDataStructure); + return nullptr != scene; + } +}; + +TEST_F(utOFFImportExport, importOFFFromFileTest) { + EXPECT_TRUE(importerTest()); +} diff --git a/test/unit/utObjTools.cpp b/test/unit/utObjTools.cpp index 093244eb1..6604dfd59 100644 --- a/test/unit/utObjTools.cpp +++ b/test/unit/utObjTools.cpp @@ -115,4 +115,3 @@ TEST_F( utObjTools, countComponents_TwoLines_Success ) { size_t numComps = test_parser.testGetNumComponentsInDataDefinition(); EXPECT_EQ( 3U, numComps ); } - From b506d35999edcec448b71fa3545f937b9f04dcc2 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 3 Dec 2018 21:53:54 +0100 Subject: [PATCH 10/78] closes https://github.com/assimp/assimp/issues/2247: change include folder from debian package from /usr/lib/include to /usr/include --- assimp.pc.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assimp.pc.in b/assimp.pc.in index 02cf59dc4..c659e19f2 100644 --- a/assimp.pc.in +++ b/assimp.pc.in @@ -1,7 +1,7 @@ prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=@CMAKE_INSTALL_PREFIX@/ libdir=@CMAKE_INSTALL_PREFIX@/@ASSIMP_LIB_INSTALL_DIR@ -includedir=@CMAKE_INSTALL_PREFIX@/@ASSIMP_INCLUDE_INSTALL_DIR@ +includedir=@CMAKE_INSTALL_PREFIX@/../include/@ASSIMP_INCLUDE_INSTALL_DIR@ Name: @CMAKE_PROJECT_NAME@ Description: Import various well-known 3D model formats in an uniform manner. From 8b6c6613f9b1408f43f2e411789401966941624d Mon Sep 17 00:00:00 2001 From: twhittock Date: Tue, 4 Dec 2018 14:44:49 +0000 Subject: [PATCH 11/78] collada export: Use Camera local coordinate system Fixes #2255 --- code/ColladaExporter.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/code/ColladaExporter.cpp b/code/ColladaExporter.cpp index 96421a532..0d5bdd46d 100644 --- a/code/ColladaExporter.cpp +++ b/code/ColladaExporter.cpp @@ -1533,7 +1533,23 @@ void ColladaExporter::WriteNode( const aiScene* pScene, aiNode* pNode) // write transformation - we can directly put the matrix there // TODO: (thom) decompose into scale - rot - quad to allow addressing it by animations afterwards - const aiMatrix4x4& mat = pNode->mTransformation; + aiMatrix4x4 mat = pNode->mTransformation; + + // If this node is a Camera node, the camera coordinate system needs to be multiplied in. + // When importing from Collada, the mLookAt is set to 0, 0, -1, and the node transform is unchanged. + // When importing from a different format, mLookAt is set to 0, 0, 1. Therefore, the local camera + // coordinate system must be changed to matche the Collada specification. + for (size_t i = 0; imNumCameras; i++){ + if (mScene->mCameras[i]->mName == pNode->mName){ + aiMatrix4x4 sourceView; + mScene->mCameras[i]->GetCameraMatrix(sourceView); + + aiMatrix4x4 colladaView; + colladaView.a1 = colladaView.c3 = -1; // move into -z space. + mat *= (sourceView * colladaView); + break; + } + } // customized, sid should be 'matrix' to match with loader code. //mOutput << startstr << ""; From af323de74127ded5e66337bdf585dfe4e19c3d45 Mon Sep 17 00:00:00 2001 From: sfalexrog Date: Tue, 4 Dec 2018 23:28:50 +0300 Subject: [PATCH 12/78] Use ADD_ASSIMP_IMPORTER for STEP importer --- code/CMakeLists.txt | 3 +-- code/Importer/StepFile/StepFileGen1.cpp | 2 +- code/Importer/StepFile/StepFileImporter.cpp | 4 ++-- code/Importer/StepFile/StepFileImporter.h | 4 ++-- code/ImporterRegistry.cpp | 4 ++-- scripts/StepImporter/StepReaderGen.cpp.template | 2 +- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 6b8d3d322..e29467164 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -727,7 +727,7 @@ ADD_ASSIMP_IMPORTER( MMD MMDVmdParser.h ) -SET( Step_SRCS +ADD_ASSIMP_IMPORTER( STEP STEPFile.h Importer/StepFile/StepFileImporter.h Importer/StepFile/StepFileImporter.cpp @@ -738,7 +738,6 @@ SET( Step_SRCS StepExporter.h StepExporter.cpp ) -SOURCE_GROUP( Step FILES ${Step_SRCS}) SET( Exporter_SRCS Exporter.cpp diff --git a/code/Importer/StepFile/StepFileGen1.cpp b/code/Importer/StepFile/StepFileGen1.cpp index 32df66c17..50c54818e 100644 --- a/code/Importer/StepFile/StepFileGen1.cpp +++ b/code/Importer/StepFile/StepFileGen1.cpp @@ -40,7 +40,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** MACHINE-GENERATED by scripts/ICFImporter/CppGenerator.py */ -#ifndef ASSIMP_BUILD_NO_STEPFILE_IMPORTER +#ifndef ASSIMP_BUILD_NO_STEP_IMPORTER #include "code/Importer/StepFile/StepReaderGen.h" diff --git a/code/Importer/StepFile/StepFileImporter.cpp b/code/Importer/StepFile/StepFileImporter.cpp index 9bfaf7051..edfe30754 100644 --- a/code/Importer/StepFile/StepFileImporter.cpp +++ b/code/Importer/StepFile/StepFileImporter.cpp @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------- */ -#ifndef ASSIMP_BUILD_NO_STEPFILE_IMPORTER +#ifndef ASSIMP_BUILD_NO_STEP_IMPORTER #include "StepFileImporter.h" #include "../../Importer/STEPParser/STEPFileReader.h" @@ -110,5 +110,5 @@ void StepFileImporter::InternReadFile(const std::string &file, aiScene* pScene, } // Namespace StepFile } // Namespace Assimp -#endif // ASSIMP_BUILD_NO_STEPFILE_IMPORTER +#endif // ASSIMP_BUILD_NO_STEP_IMPORTER diff --git a/code/Importer/StepFile/StepFileImporter.h b/code/Importer/StepFile/StepFileImporter.h index 7314a54f3..68d5a09ad 100644 --- a/code/Importer/StepFile/StepFileImporter.h +++ b/code/Importer/StepFile/StepFileImporter.h @@ -43,7 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #pragma once -#ifndef ASSIMP_BUILD_NO_STEPFILE_IMPORTER +#ifndef ASSIMP_BUILD_NO_STEP_IMPORTER #include @@ -66,4 +66,4 @@ private: } // Namespace StepFile } // Namespace Assimp -#endif // ASSIMP_BUILD_NO_STEPFILE_IMPORTER +#endif // ASSIMP_BUILD_NO_STEP_IMPORTER diff --git a/code/ImporterRegistry.cpp b/code/ImporterRegistry.cpp index d3ae53c7d..e6cf8299e 100644 --- a/code/ImporterRegistry.cpp +++ b/code/ImporterRegistry.cpp @@ -197,7 +197,7 @@ corresponding preprocessor flag to selectively disable formats. #ifndef ASSIMP_BUILD_NO_MMD_IMPORTER # include "MMDImporter.h" #endif -#ifndef ASSIMP_BUILD_NO_STEPFILE_IMPORTER +#ifndef ASSIMP_BUILD_NO_STEP_IMPORTER # include "Importer/StepFile/StepFileImporter.h" #endif @@ -355,7 +355,7 @@ void GetImporterInstanceList(std::vector< BaseImporter* >& out) #ifndef ASSIMP_BUILD_NO_MMD_IMPORTER out.push_back( new MMDImporter() ); #endif -#ifndef ASSIMP_BUILD_NO_STEPFILE_IMPORTER +#ifndef ASSIMP_BUILD_NO_STEP_IMPORTER out.push_back(new StepFile::StepFileImporter()); #endif } diff --git a/scripts/StepImporter/StepReaderGen.cpp.template b/scripts/StepImporter/StepReaderGen.cpp.template index 343c43019..91705f7a4 100644 --- a/scripts/StepImporter/StepReaderGen.cpp.template +++ b/scripts/StepImporter/StepReaderGen.cpp.template @@ -40,7 +40,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** MACHINE-GENERATED by scripts/ICFImporter/CppGenerator.py */ -#ifndef ASSIMP_BUILD_NO_STEPFILE_IMPORTER +#ifndef ASSIMP_BUILD_NO_STEP_IMPORTER #include "code/Importer/StepFile/StepReaderGen.h" From bb9e3c3593ad58cbe7e333aa2877aab28f36b8a3 Mon Sep 17 00:00:00 2001 From: tirichards Date: Wed, 5 Dec 2018 14:46:56 -0800 Subject: [PATCH 13/78] Fix failed assimp validation for glTF2 sample animations --- code/glTF2Importer.cpp | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/code/glTF2Importer.cpp b/code/glTF2Importer.cpp index f6a664e5e..be319d1da 100755 --- a/code/glTF2Importer.cpp +++ b/code/glTF2Importer.cpp @@ -826,15 +826,29 @@ aiNode* ImportNode(aiScene* pScene, glTF2::Asset& r, std::vector& aiBone* bone = new aiBone(); Ref joint = node.skin->jointNames[i]; - bone->mName = joint->name; + if (!joint->name.empty()) { + bone->mName = joint->name; + } else { + // Assimp expects each bone to have a unique name. + static const std::string kDefaultName = "bone_"; + char postfix[10] = {0}; + ASSIMP_itoa10(postfix, i); + bone->mName = (kDefaultName + postfix); + } GetNodeTransform(bone->mOffsetMatrix, *joint); std::vector& weights = weighting[i]; bone->mNumWeights = weights.size(); if (bone->mNumWeights > 0) { - bone->mWeights = new aiVertexWeight[bone->mNumWeights]; - memcpy(bone->mWeights, weights.data(), bone->mNumWeights * sizeof(aiVertexWeight)); + bone->mWeights = new aiVertexWeight[bone->mNumWeights]; + memcpy(bone->mWeights, weights.data(), bone->mNumWeights * sizeof(aiVertexWeight)); + } else { + // Assimp expects all bones to have at least 1 weight. + bone->mWeights = new aiVertexWeight[1]; + bone->mNumWeights = 1; + bone->mWeights->mVertexId = 0; + bone->mWeights->mWeight = 0.f; } mesh->mBones[i] = bone; } @@ -1022,7 +1036,7 @@ void glTF2Importer::ImportAnimations(glTF2::Asset& r) ++j; } } - + // Use the latest keyframe for the duration of the animation double maxDuration = 0; for (unsigned int j = 0; j < ai_anim->mNumChannels; ++j) { @@ -1047,7 +1061,7 @@ void glTF2Importer::ImportAnimations(glTF2::Asset& r) } } ai_anim->mDuration = maxDuration; - + mScene->mAnimations[i] = ai_anim; } } From f63caf894e8cd5eee6dbfe0fd4c25895ec5ffdcd Mon Sep 17 00:00:00 2001 From: Paul Arden Date: Thu, 6 Dec 2018 12:56:02 +1100 Subject: [PATCH 14/78] Add check for NULL texcoord values. --- code/glTF2Importer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/glTF2Importer.cpp b/code/glTF2Importer.cpp index 740935601..34f8cfcee 100755 --- a/code/glTF2Importer.cpp +++ b/code/glTF2Importer.cpp @@ -437,6 +437,12 @@ void glTF2Importer::ImportMeshes(glTF2::Asset& r) } for (size_t tc = 0; tc < attr.texcoord.size() && tc < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++tc) { + if (!attr.texcoord[tc]) { + DefaultLogger::get()->warn("NULL texcoord encountered in mesh \"" + mesh.name + + "\" and will be ignored"); + continue; + } + if (attr.texcoord[tc]->count != aim->mNumVertices) { DefaultLogger::get()->warn("Texcoord stream size in mesh \"" + mesh.name + "\" does not match the vertex count"); From b5ebd24688b237abc7ea448b388b005bb0016ce3 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 10 Dec 2018 22:07:26 +0100 Subject: [PATCH 15/78] closes https://github.com/assimp/assimp/issues/817: use emmisive factor instead of color. --- code/FBXConverter.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/code/FBXConverter.cpp b/code/FBXConverter.cpp index 0cbe04d8f..7dd9f94b4 100644 --- a/code/FBXConverter.cpp +++ b/code/FBXConverter.cpp @@ -1559,8 +1559,7 @@ void FBXConverter::TrySetTextureProperties( aiMaterial* out_mat, const TextureMa } const Texture* const tex = ( *it ).second; - if ( tex != 0 ) - { + if ( tex != nullptr ) { aiString path = GetTexturePath(tex); out_mat->AddProperty( &path, _AI_MATKEY_TEXTURE_BASE, target, 0 ); @@ -1794,10 +1793,9 @@ void FBXConverter::SetTextureProperties( aiMaterial* out_mat, const TextureMap& { TrySetTextureProperties( out_mat, textures, "DiffuseColor", aiTextureType_DIFFUSE, mesh ); TrySetTextureProperties( out_mat, textures, "AmbientColor", aiTextureType_AMBIENT, mesh ); - TrySetTextureProperties( out_mat, textures, "EmissiveColor", aiTextureType_EMISSIVE, mesh ); - TrySetTextureProperties( out_mat, textures, "SpecularColor", aiTextureType_SPECULAR, mesh ); + TrySetTextureProperties( out_mat, textures, "EmissiveFactor", aiTextureType_EMISSIVE, mesh ); TrySetTextureProperties( out_mat, textures, "SpecularFactor", aiTextureType_SPECULAR, mesh); - TrySetTextureProperties( out_mat, textures, "TransparentColor", aiTextureType_OPACITY, mesh ); + TrySetTextureProperties( out_mat, textures, "TransparencyFactor", aiTextureType_OPACITY, mesh ); TrySetTextureProperties( out_mat, textures, "ReflectionColor", aiTextureType_REFLECTION, mesh ); TrySetTextureProperties( out_mat, textures, "DisplacementColor", aiTextureType_DISPLACEMENT, mesh ); TrySetTextureProperties( out_mat, textures, "NormalMap", aiTextureType_NORMALS, mesh ); @@ -1809,10 +1807,9 @@ void FBXConverter::SetTextureProperties( aiMaterial* out_mat, const LayeredTextu { TrySetTextureProperties( out_mat, layeredTextures, "DiffuseColor", aiTextureType_DIFFUSE, mesh ); TrySetTextureProperties( out_mat, layeredTextures, "AmbientColor", aiTextureType_AMBIENT, mesh ); - TrySetTextureProperties( out_mat, layeredTextures, "EmissiveColor", aiTextureType_EMISSIVE, mesh ); - TrySetTextureProperties( out_mat, layeredTextures, "SpecularColor", aiTextureType_SPECULAR, mesh ); + TrySetTextureProperties( out_mat, layeredTextures, "EmissiveFactor", aiTextureType_EMISSIVE, mesh ); TrySetTextureProperties( out_mat, layeredTextures, "SpecularFactor", aiTextureType_SPECULAR, mesh); - TrySetTextureProperties( out_mat, layeredTextures, "TransparentColor", aiTextureType_OPACITY, mesh ); + TrySetTextureProperties( out_mat, layeredTextures, "TransparencyFactor", aiTextureType_OPACITY, mesh ); TrySetTextureProperties( out_mat, layeredTextures, "ReflectionColor", aiTextureType_REFLECTION, mesh ); TrySetTextureProperties( out_mat, layeredTextures, "DisplacementColor", aiTextureType_DISPLACEMENT, mesh ); TrySetTextureProperties( out_mat, layeredTextures, "NormalMap", aiTextureType_NORMALS, mesh ); From 95d9c16a3b18ad3fcf28337766c518e4817a4aae Mon Sep 17 00:00:00 2001 From: Alexandre Avenel Date: Sat, 8 Dec 2018 22:00:23 +0100 Subject: [PATCH 16/78] Add minimal unit-test for LWO file format --- test/CMakeLists.txt | 1 + test/unit/utLWOImportExport.cpp | 81 +++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 test/unit/utLWOImportExport.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7e2aec270..82d320bed 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -81,6 +81,7 @@ SET( COMMON SET( IMPORTERS unit/utLWSImportExport.cpp + unit/utLWOImportExport.cpp unit/utSMDImportExport.cpp unit/utglTFImportExport.cpp unit/utglTF2ImportExport.cpp diff --git a/test/unit/utLWOImportExport.cpp b/test/unit/utLWOImportExport.cpp new file mode 100644 index 000000000..7e03ee2e4 --- /dev/null +++ b/test/unit/utLWOImportExport.cpp @@ -0,0 +1,81 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2018, 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 "AbstractImportExportBase.h" +#include +#include +#include + +using namespace Assimp; + + +class utLWOImportExport : public AbstractImportExportBase { +public: + virtual bool importerTest() { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile( ASSIMP_TEST_MODELS_DIR "/LWO/LWO2/boxuv.lwo", aiProcess_ValidateDataStructure); + + EXPECT_EQ(1u, scene->mNumMeshes); + EXPECT_NE(nullptr, scene->mMeshes[0]); + EXPECT_EQ(24u, scene->mMeshes[0]->mNumVertices); + + //This test model is using n-gons, so 6 faces instead of 12 tris + EXPECT_EQ(6u, scene->mMeshes[0]->mNumFaces); + EXPECT_EQ(aiPrimitiveType_POLYGON, scene->mMeshes[0]->mPrimitiveTypes); + EXPECT_EQ(true, scene->mMeshes[0]->HasTextureCoords(0)); + + return nullptr != scene; + } +}; + +TEST_F( utLWOImportExport, importLWObox_uv ) { + EXPECT_TRUE( importerTest() ); +} + +TEST_F(utLWOImportExport, importLWOformatdetection) { + ::Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/LWO/LWO2/formatDetection", aiProcess_ValidateDataStructure); + + EXPECT_NE(nullptr, scene); +} + From b25975af481550b4bd291db8ba8350ab16c1eb1c Mon Sep 17 00:00:00 2001 From: Alexandre Avenel Date: Sat, 8 Dec 2018 22:52:23 +0100 Subject: [PATCH 17/78] Add unit-test for STL format auto detection --- test/unit/utSTLImportExport.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/unit/utSTLImportExport.cpp b/test/unit/utSTLImportExport.cpp index ee62253fd..77602a882 100644 --- a/test/unit/utSTLImportExport.cpp +++ b/test/unit/utSTLImportExport.cpp @@ -80,6 +80,12 @@ TEST_F(utSTLImporterExporter, test_multiple) { EXPECT_NE(nullptr, scene2); } +TEST_F(utSTLImporterExporter, importSTLformatdetection) { + ::Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/STL/formatDetection", aiProcess_ValidateDataStructure); + + EXPECT_NE(nullptr, scene); +} TEST_F( utSTLImporterExporter, test_with_two_solids ) { Assimp::Importer importer; From b226982a3c60c732605576dd587ebe7c1e24a166 Mon Sep 17 00:00:00 2001 From: Alexandre Avenel Date: Sun, 9 Dec 2018 18:11:22 +0100 Subject: [PATCH 18/78] Add formatDetection unit-test for 3DS importer --- test/unit/ut3DSImportExport.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/unit/ut3DSImportExport.cpp b/test/unit/ut3DSImportExport.cpp index b40694132..0f91e0f7d 100644 --- a/test/unit/ut3DSImportExport.cpp +++ b/test/unit/ut3DSImportExport.cpp @@ -66,3 +66,11 @@ public: TEST_F( ut3DSImportExport, import3DSFromFileTest ) { EXPECT_TRUE( importerTest() ); } + +TEST_F( ut3DSImportExport, import3DSformatdetection) { + ::Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/3DS/testFormatDetection", aiProcess_ValidateDataStructure); + + EXPECT_NE(nullptr, scene); +} + From b71b7982b5012d5a233b519511d9f33bd272447c Mon Sep 17 00:00:00 2001 From: Alexandre Avenel Date: Sat, 8 Dec 2018 22:58:24 +0100 Subject: [PATCH 19/78] Add silent flag to assimp cmd Add a new command line flag to assimp cmd in order to only display minimal info when loading a file. This is especially useful for quick profiling/fuzzing. --- tools/assimp_cmd/Info.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/assimp_cmd/Info.cpp b/tools/assimp_cmd/Info.cpp index ae858bfe8..d6d3de804 100644 --- a/tools/assimp_cmd/Info.cpp +++ b/tools/assimp_cmd/Info.cpp @@ -54,7 +54,8 @@ const char* AICMD_MSG_INFO_HELP_E = "assimp info [-r] [-v]\n" "\tPrint basic structure of a 3D model\n" "\t-r,--raw: No postprocessing, do a raw import\n" -"\t-v,--verbose: Print verbose info such as node transform data\n"; +"\t-v,--verbose: Print verbose info such as node transform data\n" +"\t-s, --silent: Print only minimal info\n"; const std::string TREE_BRANCH_ASCII = "|-"; const std::string TREE_BRANCH_UTF8 = "\xe2\x94\x9c\xe2\x95\xb4"; @@ -305,6 +306,7 @@ int Assimp_Info (const char* const* params, unsigned int num) // get -r and -v arguments bool raw = false; bool verbose = false; + bool silent = false; for(unsigned int i = 1; i < num; ++i) { if (!strcmp(params[i],"--raw")||!strcmp(params[i],"-r")) { raw = true; @@ -312,6 +314,9 @@ int Assimp_Info (const char* const* params, unsigned int num) if (!strcmp(params[i],"--verbose")||!strcmp(params[i],"-v")) { verbose = true; } + if (!strcmp(params[i], "--silent") || !strcmp(params[i], "-s")) { + silent = true; + } } // do maximum post-processing unless -r was specified @@ -380,6 +385,12 @@ int Assimp_Info (const char* const* params, unsigned int num) ) ; + if (silent) + { + printf("\n"); + return 0; + } + // meshes if (scene->mNumMeshes) { printf("\nMeshes: (name) [vertices / bones / faces | primitive_types]\n"); From 3c1d6a3f874b3298f1fd6b8487a03e2f1d92f9ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Iraolagoit=C3=ADa?= Date: Wed, 19 Dec 2018 20:28:43 -0300 Subject: [PATCH 20/78] Fix animations import in gltf2 --- code/glTF2Importer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/glTF2Importer.cpp b/code/glTF2Importer.cpp index 67c26bf62..107281a33 100755 --- a/code/glTF2Importer.cpp +++ b/code/glTF2Importer.cpp @@ -1033,12 +1033,12 @@ void glTF2Importer::ImportAnimations(glTF2::Asset& r) std::unordered_map samplers = GatherSamplers(anim); - ai_anim->mNumChannels = r.skins[0].jointNames.size(); + ai_anim->mNumChannels = samplers.size(); if (ai_anim->mNumChannels > 0) { ai_anim->mChannels = new aiNodeAnim*[ai_anim->mNumChannels]; int j = 0; - for (auto& iter : r.skins[0].jointNames) { - ai_anim->mChannels[j] = CreateNodeAnim(r, *iter, samplers[iter.GetIndex()]); + for (auto& iter : samplers) { + ai_anim->mChannels[j] = CreateNodeAnim(r, r.nodes[iter.first], iter.second); ++j; } } From 7ce8c9778b56a59912668a2ef9aa8729202c8809 Mon Sep 17 00:00:00 2001 From: Maxim Petrovsky Date: Thu, 20 Dec 2018 16:50:38 +0200 Subject: [PATCH 21/78] added arm64e to iOS build script added arm64e iOS cmake file --- port/iOS/IPHONEOS_ARM64E_TOOLCHAIN.cmake | 17 +++++++++++++++++ port/iOS/build.sh | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 port/iOS/IPHONEOS_ARM64E_TOOLCHAIN.cmake diff --git a/port/iOS/IPHONEOS_ARM64E_TOOLCHAIN.cmake b/port/iOS/IPHONEOS_ARM64E_TOOLCHAIN.cmake new file mode 100644 index 000000000..0cf2b6b66 --- /dev/null +++ b/port/iOS/IPHONEOS_ARM64E_TOOLCHAIN.cmake @@ -0,0 +1,17 @@ +INCLUDE(CMakeForceCompiler) + +SET (CMAKE_CROSSCOMPILING TRUE) +SET (CMAKE_SYSTEM_NAME "Darwin") +SET (CMAKE_SYSTEM_PROCESSOR "arm64e") +SET (IOS TRUE) + +SET (IOS_SDK_DEVICE iPhoneOS) + +SET (SDKVER "${IOS_SDK_VERSION}") +SET (DEVROOT "${XCODE_ROOT_DIR}/Platforms/${IOS_SDK_DEVICE}.platform/Developer") + + +SET (CMAKE_FIND_ROOT_PATH "${SDKROOT}" "${DEVROOT}") +SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) \ No newline at end of file diff --git a/port/iOS/build.sh b/port/iOS/build.sh index 288c9c4a4..f118c45c1 100755 --- a/port/iOS/build.sh +++ b/port/iOS/build.sh @@ -31,7 +31,7 @@ TOOLCHAIN=$XCODE_ROOT_DIR/Toolchains/XcodeDefault.xctoolchain CMAKE_C_COMPILER=$(xcrun -find cc) CMAKE_CXX_COMPILER=$(xcrun -find c++) -BUILD_ARCHS_DEVICE="arm64 armv7s armv7" +BUILD_ARCHS_DEVICE="arm64e arm64 armv7s armv7" BUILD_ARCHS_SIMULATOR="x86_64 i386" BUILD_ARCHS_ALL=($BUILD_ARCHS_DEVICE $BUILD_ARCHS_SIMULATOR) From b4c427912f1f4875cdcb524b1a6a6fbc5fe33bdd Mon Sep 17 00:00:00 2001 From: Maxim Petrovsky Date: Thu, 20 Dec 2018 16:51:01 +0200 Subject: [PATCH 22/78] added bitcode ios --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 645d92689..a97174de4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,6 +119,7 @@ IF (IOS) IF (NOT CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE "Release") ENDIF (NOT CMAKE_BUILD_TYPE) + ADD_DEFINITIONS(-DENABLE_BITCODE) ENDIF (IOS) # Use subset of Windows.h @@ -126,6 +127,7 @@ if (WIN32) ADD_DEFINITIONS( -DWIN32_LEAN_AND_MEAN ) endif() + IF(MSVC) OPTION( ASSIMP_INSTALL_PDB "Install MSVC debug files." From 194b59b3b21050f6516725e5b18d76829504a863 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 22 Dec 2018 09:12:10 +0100 Subject: [PATCH 23/78] Update Info.cpp Add a simple check to avoid verbose + silent mode together, --- tools/assimp_cmd/Info.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/assimp_cmd/Info.cpp b/tools/assimp_cmd/Info.cpp index d6d3de804..050dbf989 100644 --- a/tools/assimp_cmd/Info.cpp +++ b/tools/assimp_cmd/Info.cpp @@ -319,6 +319,12 @@ 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; + } + // do maximum post-processing unless -r was specified ImportData import; if (!raw) { From a65535343050fa2dac18f150bffdedde528f9bd8 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 22 Dec 2018 11:20:31 +0100 Subject: [PATCH 24/78] Update Readme.md Add issue solution time-tracking. --- Readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Readme.md b/Readme.md index 1ba026d5a..6bffbdcee 100644 --- a/Readme.md +++ b/Readme.md @@ -10,6 +10,7 @@ A library to import and export various 3d-model-formats including scene-post-pro [![Coverage Status](https://coveralls.io/repos/github/assimp/assimp/badge.svg?branch=master)](https://coveralls.io/github/assimp/assimp?branch=master) [![Join the chat at https://gitter.im/assimp/assimp](https://badges.gitter.im/assimp/assimp.svg)](https://gitter.im/assimp/assimp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/assimp/assimp.svg)](http://isitmaintained.com/project/assimp/assimp "Average time to resolve an issue")
APIs are provided for C and C++. There are various bindings to other languages (C#, Java, Python, Delphi, D). Assimp also runs on Android and iOS. From 1a32558d47b2cf87e83f87f5f85bc0daec23fc32 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 22 Dec 2018 15:17:10 +0100 Subject: [PATCH 25/78] Update Readme.md Add codacy badge. --- Readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Readme.md b/Readme.md index 6bffbdcee..7f42fb75c 100644 --- a/Readme.md +++ b/Readme.md @@ -11,6 +11,7 @@ A library to import and export various 3d-model-formats including scene-post-pro [![Coverage Status](https://coveralls.io/repos/github/assimp/assimp/badge.svg?branch=master)](https://coveralls.io/github/assimp/assimp?branch=master) [![Join the chat at https://gitter.im/assimp/assimp](https://badges.gitter.im/assimp/assimp.svg)](https://gitter.im/assimp/assimp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/assimp/assimp.svg)](http://isitmaintained.com/project/assimp/assimp "Average time to resolve an issue") +[![Codacy Badge](https://api.codacy.com/project/badge/Grade/5be56faac64f46fc941ac890fb4febef)](https://www.codacy.com/app/kimkulling/assimp?utm_source=github.com&utm_medium=referral&utm_content=assimp/assimp&utm_campaign=Badge_Grade)
APIs are provided for C and C++. There are various bindings to other languages (C#, Java, Python, Delphi, D). Assimp also runs on Android and iOS. From e5f6a72eccafcfab85339372876dbef244d3ead7 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 22 Dec 2018 21:04:52 +0100 Subject: [PATCH 26/78] Update .travis.yml make coverity scan looking for master. --- .travis.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index e768c530c..6fefa694e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,10 +33,6 @@ env: matrix: include: - # disabled until clang 5.0 analyzer issues are fixed - # - os: linux - # compiler: clang - # env: ANALYZE=ON - os: linux compiler: clang env: ASAN=ON @@ -51,7 +47,6 @@ matrix: env: ANALYZE=ON - os: linux compiler: gcc -# env: DISABLE_EXPORTERS=YES ENABLE_COVERALLS=ON env: ENABLE_COVERALLS=ON - os: linux compiler: gcc @@ -79,4 +74,4 @@ addons: notification_email: kim.kulling@googlemail.com build_command_prepend: "cmake" build_command: "make" - branch_pattern: coverity_scan + branch_pattern: master From 3087ebb93a7e45d3fcfd53f58c912816660c7cc8 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 23 Dec 2018 11:57:32 +0100 Subject: [PATCH 27/78] JAssimp: fix simple code analysis issues. --- .../jassimp/src/jassimp/AiAnimation.java | 46 +++-- port/jassimp/jassimp/src/jassimp/AiBone.java | 39 ++-- port/jassimp/jassimp/src/jassimp/AiColor.java | 22 +-- .../jassimp/src/jassimp/AiMaterial.java | 26 ++- port/jassimp/jassimp/src/jassimp/AiMesh.java | 178 ++++++++---------- port/jassimp/jassimp/src/jassimp/AiNode.java | 59 +++--- .../jassimp/src/jassimp/AiQuaternion.java | 25 ++- port/jassimp/jassimp/src/jassimp/Jassimp.java | 90 +++++---- 8 files changed, 230 insertions(+), 255 deletions(-) diff --git a/port/jassimp/jassimp/src/jassimp/AiAnimation.java b/port/jassimp/jassimp/src/jassimp/AiAnimation.java index fca3bc53d..777d2a9fe 100644 --- a/port/jassimp/jassimp/src/jassimp/AiAnimation.java +++ b/port/jassimp/jassimp/src/jassimp/AiAnimation.java @@ -54,6 +54,26 @@ import java.util.List; * {@link AiMesh} for a description and comparison of these APIs. */ public final class AiAnimation { + /** + * Name. + */ + private final String m_name; + + /** + * Duration. + */ + private final double m_duration; + + /** + * Ticks per second. + */ + private final double m_ticksPerSecond; + + /** + * Bone animation channels. + */ + private final List m_nodeAnims = new ArrayList(); + /** * Constructor. * @@ -151,29 +171,5 @@ public final class AiAnimation { */ public List getMeshChannels() { throw new UnsupportedOperationException("not implemented yet"); - } - - - /** - * Name. - */ - private final String m_name; - - - /** - * Duration. - */ - private final double m_duration; - - - /** - * Ticks per second. - */ - private final double m_ticksPerSecond; - - - /** - * Bone animation channels. - */ - private final List m_nodeAnims = new ArrayList(); + } } \ No newline at end of file diff --git a/port/jassimp/jassimp/src/jassimp/AiBone.java b/port/jassimp/jassimp/src/jassimp/AiBone.java index 87c4b8199..1e6d49beb 100644 --- a/port/jassimp/jassimp/src/jassimp/AiBone.java +++ b/port/jassimp/jassimp/src/jassimp/AiBone.java @@ -55,6 +55,24 @@ import java.util.List; * writable and may be modified. */ public final class AiBone { + /** + * Name of the bone. + */ + private String m_name; + + + /** + * Bone weights. + */ + private final List m_boneWeights = + new ArrayList(); + + + /** + * Offset matrix. + */ + private Object m_offsetMatrix; + /** * Constructor. */ @@ -114,24 +132,5 @@ public final class AiBone { AiWrapperProvider wrapperProvider) { return (M4) m_offsetMatrix; - } - - - /** - * Name of the bone. - */ - private String m_name; - - - /** - * Bone weights. - */ - private final List m_boneWeights = - new ArrayList(); - - - /** - * Offset matrix. - */ - private Object m_offsetMatrix; + } } diff --git a/port/jassimp/jassimp/src/jassimp/AiColor.java b/port/jassimp/jassimp/src/jassimp/AiColor.java index 25eb251d6..6befeecbd 100644 --- a/port/jassimp/jassimp/src/jassimp/AiColor.java +++ b/port/jassimp/jassimp/src/jassimp/AiColor.java @@ -50,6 +50,16 @@ import java.nio.ByteBuffer; * modify the underlying mesh. */ public final class AiColor { + /** + * Wrapped buffer. + */ + private final ByteBuffer m_buffer; + + /** + * Offset into m_buffer. + */ + private final int m_offset; + /** * Constructor. * @@ -147,16 +157,4 @@ public final class AiColor { return "[" + getRed() + ", " + getGreen() + ", " + getBlue() + ", " + getAlpha() + "]"; } - - - /** - * Wrapped buffer. - */ - private final ByteBuffer m_buffer; - - - /** - * Offset into m_buffer. - */ - private final int m_offset; } diff --git a/port/jassimp/jassimp/src/jassimp/AiMaterial.java b/port/jassimp/jassimp/src/jassimp/AiMaterial.java index 7a9abc0d3..6ba7665fb 100644 --- a/port/jassimp/jassimp/src/jassimp/AiMaterial.java +++ b/port/jassimp/jassimp/src/jassimp/AiMaterial.java @@ -70,6 +70,17 @@ import java.util.Set; * properties (i.e., properties starting with TEX_). */ public final class AiMaterial { + /** + * List of properties. + */ + private final List m_properties = new ArrayList(); + + /** + * Number of textures for each type. + */ + private final Map m_numTextures = + new EnumMap(AiTextureType.class); + /** * Enumerates all supported material properties. */ @@ -1185,18 +1196,5 @@ public final class AiMaterial { @SuppressWarnings("unused") private void setTextureNumber(int type, int number) { m_numTextures.put(AiTextureType.fromRawValue(type), number); - } - - - /** - * List of properties. - */ - private final List m_properties = new ArrayList(); - - - /** - * Number of textures for each type. - */ - private final Map m_numTextures = - new EnumMap(AiTextureType.class); + } } diff --git a/port/jassimp/jassimp/src/jassimp/AiMesh.java b/port/jassimp/jassimp/src/jassimp/AiMesh.java index b6a478d18..3f4a29760 100644 --- a/port/jassimp/jassimp/src/jassimp/AiMesh.java +++ b/port/jassimp/jassimp/src/jassimp/AiMesh.java @@ -153,6 +153,89 @@ public final class AiMesh { private final int SIZEOF_V3D = Jassimp.NATIVE_AIVEKTOR3D_SIZE; + /** + * The primitive types used by this mesh. + */ + private final Set m_primitiveTypes = + EnumSet.noneOf(AiPrimitiveType.class); + + + /** + * Number of vertices in this mesh. + */ + private int m_numVertices = 0; + + + /** + * Number of faces in this mesh. + */ + private int m_numFaces = 0; + + /** + * Material used by this mesh. + */ + private int m_materialIndex = -1; + + /** + * The name of the mesh. + */ + private String m_name = ""; + + /** + * Buffer for vertex position data. + */ + private ByteBuffer m_vertices = null; + + /** + * Buffer for faces/ indices. + */ + private ByteBuffer m_faces = null; + + + /** + * Index structure for m_faces.

+ * + * Only used by meshes that are not pure triangular + */ + private ByteBuffer m_faceOffsets = null; + + /** + * Buffer for normals. + */ + private ByteBuffer m_normals = null; + + /** + * Buffer for tangents. + */ + private ByteBuffer m_tangents = null; + + /** + * Buffer for bitangents. + */ + private ByteBuffer m_bitangents = null; + + /** + * Vertex colors. + */ + private ByteBuffer[] m_colorsets = + new ByteBuffer[JassimpConfig.MAX_NUMBER_COLORSETS]; + + /** + * Number of UV components for each texture coordinate set. + */ + private int[] m_numUVComponents = new int[JassimpConfig.MAX_NUMBER_TEXCOORDS]; + + /** + * Texture coordinates. + */ + private ByteBuffer[] m_texcoords = + new ByteBuffer[JassimpConfig.MAX_NUMBER_TEXCOORDS]; + + /** + * Bones. + */ + private final List m_bones = new ArrayList(); + /** * This class is instantiated via JNI, no accessible constructor. */ @@ -1335,99 +1418,4 @@ public final class AiMesh { } } // }} - - - /** - * The primitive types used by this mesh. - */ - private final Set m_primitiveTypes = - EnumSet.noneOf(AiPrimitiveType.class); - - - /** - * Number of vertices in this mesh. - */ - private int m_numVertices = 0; - - - /** - * Number of faces in this mesh. - */ - private int m_numFaces = 0; - - - /** - * Material used by this mesh. - */ - private int m_materialIndex = -1; - - - /** - * The name of the mesh. - */ - private String m_name = ""; - - - /** - * Buffer for vertex position data. - */ - private ByteBuffer m_vertices = null; - - - /** - * Buffer for faces/ indices. - */ - private ByteBuffer m_faces = null; - - - /** - * Index structure for m_faces.

- * - * Only used by meshes that are not pure triangular - */ - private ByteBuffer m_faceOffsets = null; - - - /** - * Buffer for normals. - */ - private ByteBuffer m_normals = null; - - - /** - * Buffer for tangents. - */ - private ByteBuffer m_tangents = null; - - - /** - * Buffer for bitangents. - */ - private ByteBuffer m_bitangents = null; - - - /** - * Vertex colors. - */ - private ByteBuffer[] m_colorsets = - new ByteBuffer[JassimpConfig.MAX_NUMBER_COLORSETS]; - - - /** - * Number of UV components for each texture coordinate set. - */ - private int[] m_numUVComponents = new int[JassimpConfig.MAX_NUMBER_TEXCOORDS]; - - - /** - * Texture coordinates. - */ - private ByteBuffer[] m_texcoords = - new ByteBuffer[JassimpConfig.MAX_NUMBER_TEXCOORDS]; - - - /** - * Bones. - */ - private final List m_bones = new ArrayList(); } diff --git a/port/jassimp/jassimp/src/jassimp/AiNode.java b/port/jassimp/jassimp/src/jassimp/AiNode.java index 9345b7af4..e585e0449 100644 --- a/port/jassimp/jassimp/src/jassimp/AiNode.java +++ b/port/jassimp/jassimp/src/jassimp/AiNode.java @@ -55,6 +55,34 @@ import java.util.Map; * the imported scene consists of only a single root node without children. */ public final class AiNode { + /** + * Parent node. + */ + private final AiNode m_parent; + + + /** + * Mesh references. + */ + private final int[] m_meshReferences; + + + /** + * List of children. + */ + private final List m_children = new ArrayList(); + + /** + * List of metadata entries. + */ + private final Map m_metaData = new HashMap(); + + + /** + * Buffer for transformation matrix. + */ + private final Object m_transformationMatrix; + /** * Constructor. * @@ -214,34 +242,5 @@ public final class AiNode { /** * Name. */ - private final String m_name; - - - /** - * Parent node. - */ - private final AiNode m_parent; - - - /** - * Mesh references. - */ - private final int[] m_meshReferences; - - - /** - * List of children. - */ - private final List m_children = new ArrayList(); - - /** - * List of metadata entries. - */ - private final Map m_metaData = new HashMap(); - - - /** - * Buffer for transformation matrix. - */ - private final Object m_transformationMatrix; + private final String m_name; } diff --git a/port/jassimp/jassimp/src/jassimp/AiQuaternion.java b/port/jassimp/jassimp/src/jassimp/AiQuaternion.java index de162631b..00630e644 100644 --- a/port/jassimp/jassimp/src/jassimp/AiQuaternion.java +++ b/port/jassimp/jassimp/src/jassimp/AiQuaternion.java @@ -50,6 +50,17 @@ import java.nio.ByteBuffer; * modify the underlying mesh/animation. */ public final class AiQuaternion { + /** + * Wrapped buffer. + */ + private final ByteBuffer m_buffer; + + + /** + * Offset into m_buffer. + */ + private final int m_offset; + /** * Constructor. * @@ -150,17 +161,5 @@ public final class AiQuaternion { public String toString() { return "[" + getX() + ", " + getY() + ", " + getZ() + ", " + getW() + "]"; - } - - - /** - * Wrapped buffer. - */ - private final ByteBuffer m_buffer; - - - /** - * Offset into m_buffer. - */ - private final int m_offset; + } } \ No newline at end of file diff --git a/port/jassimp/jassimp/src/jassimp/Jassimp.java b/port/jassimp/jassimp/src/jassimp/Jassimp.java index d1b4aae4e..34dbfabc9 100644 --- a/port/jassimp/jassimp/src/jassimp/Jassimp.java +++ b/port/jassimp/jassimp/src/jassimp/Jassimp.java @@ -60,6 +60,44 @@ import java.util.Set; */ public final class Jassimp { + /** + * The native interface. + * + * @param filename the file to load + * @param postProcessing post processing flags + * @return the loaded scene, or null if an error occurred + * @throws IOException if an error occurs + */ + private static native AiScene aiImportFile(String filename, + long postProcessing, AiIOSystem ioSystem) throws IOException; + + + /** + * The active wrapper provider. + */ + private static AiWrapperProvider s_wrapperProvider = + new AiBuiltInWrapperProvider(); + + + /** + * The library loader to load the native library. + */ + private static JassimpLibraryLoader s_libraryLoader = + new JassimpLibraryLoader(); + + /** + * Status flag if the library is loaded. + * + * Volatile to avoid problems with double checked locking. + * + */ + private static volatile boolean s_libraryLoaded = false; + + /** + * Lock for library loading. + */ + private static final Object s_libraryLoadingLock = new Object(); + /** * The default wrapper provider using built in types. */ @@ -222,7 +260,7 @@ public final class Jassimp { * @param data the matrix data * @return the wrapped matrix */ - static Object wrapMatrix(float[] data) { + private static Object wrapMatrix(float[] data) { return s_wrapperProvider.wrapMatrix4f(data); } @@ -237,7 +275,7 @@ public final class Jassimp { * @param blue blue component * @return the wrapped color */ - static Object wrapColor3(float red, float green, float blue) { + private static Object wrapColor3(float red, float green, float blue) { return wrapColor4(red, green, blue, 1.0f); } @@ -253,7 +291,7 @@ public final class Jassimp { * @param alpha alpha component * @return the wrapped color */ - static Object wrapColor4(float red, float green, float blue, float alpha) { + private static Object wrapColor4(float red, float green, float blue, float alpha) { ByteBuffer temp = ByteBuffer.allocate(4 * 4); temp.putFloat(red); temp.putFloat(green); @@ -274,7 +312,7 @@ public final class Jassimp { * @param z z component * @return the wrapped vector */ - static Object wrapVec3(float x, float y, float z) { + private static Object wrapVec3(float x, float y, float z) { ByteBuffer temp = ByteBuffer.allocate(3 * 4); temp.putFloat(x); temp.putFloat(y); @@ -295,7 +333,7 @@ public final class Jassimp { * @param name the name of the node * @return the wrapped matrix */ - static Object wrapSceneNode(Object parent, Object matrix, int[] meshRefs, + private static Object wrapSceneNode(Object parent, Object matrix, int[] meshRefs, String name) { return s_wrapperProvider.wrapSceneNode(parent, matrix, meshRefs, name); @@ -327,48 +365,9 @@ public final class Jassimp { s_libraryLoaded = true; } } - } } - - /** - * The native interface. - * - * @param filename the file to load - * @param postProcessing post processing flags - * @return the loaded scene, or null if an error occurred - * @throws IOException if an error occurs - */ - private static native AiScene aiImportFile(String filename, - long postProcessing, AiIOSystem ioSystem) throws IOException; - - - /** - * The active wrapper provider. - */ - private static AiWrapperProvider s_wrapperProvider = - new AiBuiltInWrapperProvider(); - - - /** - * The library loader to load the native library. - */ - private static JassimpLibraryLoader s_libraryLoader = - new JassimpLibraryLoader(); - - /** - * Status flag if the library is loaded. - * - * Volatile to avoid problems with double checked locking. - * - */ - private static volatile boolean s_libraryLoaded = false; - - /** - * Lock for library loading. - */ - private static final Object s_libraryLoadingLock = new Object(); - + /** * Pure static class, no accessible constructor. */ @@ -384,5 +383,4 @@ public final class Jassimp { public static int NATIVE_UINT_SIZE; public static int NATIVE_DOUBLE_SIZE; public static int NATIVE_LONG_SIZE; - } From f73dd52956ff35cf6af54f668eab5400b540c2ca Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 23 Dec 2018 11:58:48 +0100 Subject: [PATCH 28/78] Fix next finding. --- port/jassimp/jassimp/src/jassimp/AiSceneFlag.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/port/jassimp/jassimp/src/jassimp/AiSceneFlag.java b/port/jassimp/jassimp/src/jassimp/AiSceneFlag.java index 7f7e01ea9..4c7dd6072 100644 --- a/port/jassimp/jassimp/src/jassimp/AiSceneFlag.java +++ b/port/jassimp/jassimp/src/jassimp/AiSceneFlag.java @@ -47,6 +47,11 @@ import java.util.Set; * Status flags for {@link AiScene}s. */ public enum AiSceneFlag { + /** + * The mapped c/c++ integer enum value. + */ + private final int m_rawValue; + /** * Specifies that the scene data structure that was imported is not * complete.

@@ -143,11 +148,5 @@ public enum AiSceneFlag { */ private AiSceneFlag(int rawValue) { m_rawValue = rawValue; - } - - - /** - * The mapped c/c++ integer enum value. - */ - private final int m_rawValue; + } } From e9d1330eddbd4d02174a7d06baf35e0e5b556ba5 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 23 Dec 2018 12:01:08 +0100 Subject: [PATCH 29/78] Fix next finding. --- .../src/jassimp/AiClassLoaderIOSystem.java | 6 +- .../jassimp/src/jassimp/AiMaterial.java | 61 +++++++++---------- 2 files changed, 32 insertions(+), 35 deletions(-) diff --git a/port/jassimp/jassimp/src/jassimp/AiClassLoaderIOSystem.java b/port/jassimp/jassimp/src/jassimp/AiClassLoaderIOSystem.java index e14a87f77..95afc2e02 100644 --- a/port/jassimp/jassimp/src/jassimp/AiClassLoaderIOSystem.java +++ b/port/jassimp/jassimp/src/jassimp/AiClassLoaderIOSystem.java @@ -139,10 +139,8 @@ public class AiClassLoaderIOSystem implements AiIOSystem { return false; } - else - { - return true; - } + + return true; } diff --git a/port/jassimp/jassimp/src/jassimp/AiMaterial.java b/port/jassimp/jassimp/src/jassimp/AiMaterial.java index 6ba7665fb..bf077dff3 100644 --- a/port/jassimp/jassimp/src/jassimp/AiMaterial.java +++ b/port/jassimp/jassimp/src/jassimp/AiMaterial.java @@ -328,7 +328,36 @@ public final class AiMaterial { * properties easily. */ public static final class Property { + /** + * Key. + */ + private final String m_key; + + /** + * Semantic. + */ + private final int m_semantic; + + + /** + * Index. + */ + private final int m_index; + + + /** + * Type. + */ + private final PropertyType m_type; + + + /** + * Data. + */ + private final Object m_data; + + /** * Constructor. * * @param key @@ -428,39 +457,9 @@ public final class AiMaterial { * * @return the data */ - Object getData() { + private Object getData() { return m_data; } - - - /** - * Key. - */ - private final String m_key; - - - /** - * Semantic. - */ - private final int m_semantic; - - - /** - * Index. - */ - private final int m_index; - - - /** - * Type. - */ - private final PropertyType m_type; - - - /** - * Data. - */ - private final Object m_data; } From 7eee959d55ce0f6f5d0765038a789b168ddc6eac Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 23 Dec 2018 13:12:57 +0100 Subject: [PATCH 30/78] Review: fix wrong interpretation of methods for JNI. --- port/jassimp/jassimp/src/jassimp/Jassimp.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/port/jassimp/jassimp/src/jassimp/Jassimp.java b/port/jassimp/jassimp/src/jassimp/Jassimp.java index 34dbfabc9..ac072a331 100644 --- a/port/jassimp/jassimp/src/jassimp/Jassimp.java +++ b/port/jassimp/jassimp/src/jassimp/Jassimp.java @@ -260,7 +260,7 @@ public final class Jassimp { * @param data the matrix data * @return the wrapped matrix */ - private static Object wrapMatrix(float[] data) { + static Object wrapMatrix(float[] data) { return s_wrapperProvider.wrapMatrix4f(data); } @@ -275,7 +275,7 @@ public final class Jassimp { * @param blue blue component * @return the wrapped color */ - private static Object wrapColor3(float red, float green, float blue) { + static Object wrapColor3(float red, float green, float blue) { return wrapColor4(red, green, blue, 1.0f); } @@ -291,7 +291,7 @@ public final class Jassimp { * @param alpha alpha component * @return the wrapped color */ - private static Object wrapColor4(float red, float green, float blue, float alpha) { + static Object wrapColor4(float red, float green, float blue, float alpha) { ByteBuffer temp = ByteBuffer.allocate(4 * 4); temp.putFloat(red); temp.putFloat(green); @@ -312,7 +312,7 @@ public final class Jassimp { * @param z z component * @return the wrapped vector */ - private static Object wrapVec3(float x, float y, float z) { + static Object wrapVec3(float x, float y, float z) { ByteBuffer temp = ByteBuffer.allocate(3 * 4); temp.putFloat(x); temp.putFloat(y); From 6631f7877a6406d9701e90343c43a1f92f5c1a5f Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 23 Dec 2018 13:37:03 +0100 Subject: [PATCH 31/78] Update Jassimp.java Fix another misinterpretation from the JNI-interface. --- port/jassimp/jassimp/src/jassimp/Jassimp.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/port/jassimp/jassimp/src/jassimp/Jassimp.java b/port/jassimp/jassimp/src/jassimp/Jassimp.java index ac072a331..727570a5b 100644 --- a/port/jassimp/jassimp/src/jassimp/Jassimp.java +++ b/port/jassimp/jassimp/src/jassimp/Jassimp.java @@ -333,7 +333,7 @@ public final class Jassimp { * @param name the name of the node * @return the wrapped matrix */ - private static Object wrapSceneNode(Object parent, Object matrix, int[] meshRefs, + static Object wrapSceneNode(Object parent, Object matrix, int[] meshRefs, String name) { return s_wrapperProvider.wrapSceneNode(parent, matrix, meshRefs, name); From b3c2fdc11dda34861ec1eadb6280cfac65e88478 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 23 Dec 2018 14:28:40 +0100 Subject: [PATCH 32/78] python: fix review findings. --- port/PyAssimp/pyassimp/core.py | 15 +++++------ port/PyAssimp/scripts/3d_viewer_py3.py | 36 ++++++++++++-------------- 2 files changed, 22 insertions(+), 29 deletions(-) diff --git a/port/PyAssimp/pyassimp/core.py b/port/PyAssimp/pyassimp/core.py index 64dd351a7..25821ff9b 100644 --- a/port/PyAssimp/pyassimp/core.py +++ b/port/PyAssimp/pyassimp/core.py @@ -29,7 +29,6 @@ from . import structs from . import helper from . import postprocess from .errors import AssimpError -from .formats import available_formats class AssimpLib(object): """ @@ -300,14 +299,12 @@ def load(filename, ''' if hasattr(filename, 'read'): - ''' - This is the case where a file object has been passed to load. - It is calling the following function: - const aiScene* aiImportFileFromMemory(const char* pBuffer, - unsigned int pLength, - unsigned int pFlags, - const char* pHint) - ''' + # This is the case where a file object has been passed to load. + # It is calling the following function: + # const aiScene* aiImportFileFromMemory(const char* pBuffer, + # unsigned int pLength, + # unsigned int pFlags, + # const char* pHint) if file_type == None: raise AssimpError('File type must be specified when passing file objects!') data = filename.read() diff --git a/port/PyAssimp/scripts/3d_viewer_py3.py b/port/PyAssimp/scripts/3d_viewer_py3.py index 4c88edc7b..477b1a103 100755 --- a/port/PyAssimp/scripts/3d_viewer_py3.py +++ b/port/PyAssimp/scripts/3d_viewer_py3.py @@ -1177,6 +1177,22 @@ class PyAssimp3DViewer: return True def controls_3d(self, dx, dy, zooming_one_shot=False): + """ Orbiting the camera is implemented the following way: + + - the rotation is split into a rotation around the *world* Z axis + (controlled by the horizontal mouse motion along X) and a + rotation around the *X* axis of the camera (pitch) *shifted to + the focal origin* (the world origin for now). This is controlled + by the vertical motion of the mouse (Y axis). + - as a result, the resulting transformation of the camera in the + world frame C' is: + C' = (T · Rx · T⁻¹ · (Rz · C)⁻¹)⁻¹ + where: + - C is the original camera transformation in the world frame, + - Rz is the rotation along the Z axis (in the world frame) + - T is the translation camera -> world (ie, the inverse of the + translation part of C + - Rx is the rotation around X in the (translated) camera frame """ CAMERA_TRANSLATION_FACTOR = 0.01 CAMERA_ROTATION_FACTOR = 0.01 @@ -1188,26 +1204,6 @@ class PyAssimp3DViewer: distance = numpy.linalg.norm(self.focal_point - current_pos) if self.is_rotating: - """ Orbiting the camera is implemented the following way: - - - the rotation is split into a rotation around the *world* Z axis - (controlled by the horizontal mouse motion along X) and a - rotation around the *X* axis of the camera (pitch) *shifted to - the focal origin* (the world origin for now). This is controlled - by the vertical motion of the mouse (Y axis). - - - as a result, the resulting transformation of the camera in the - world frame C' is: - C' = (T · Rx · T⁻¹ · (Rz · C)⁻¹)⁻¹ - - where: - - C is the original camera transformation in the world frame, - - Rz is the rotation along the Z axis (in the world frame) - - T is the translation camera -> world (ie, the inverse of the - translation part of C - - Rx is the rotation around X in the (translated) camera frame - """ - rotation_camera_x = dy * CAMERA_ROTATION_FACTOR rotation_world_z = dx * CAMERA_ROTATION_FACTOR world_z_rotation = transformations.euler_matrix(0, 0, rotation_world_z) From 49cce86f5f7f237e33fe13c23fad2fd9319f2fb7 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 26 Dec 2018 13:40:22 +0100 Subject: [PATCH 33/78] Testing: improve test coverage: --- test/CMakeLists.txt | 2 + test/unit/ImportExport/utNFFImportExport.cpp | 63 ++++++++++++++++++++ test/unit/ImportExport/utXGLImportExport.cpp | 63 ++++++++++++++++++++ 3 files changed, 128 insertions(+) create mode 100644 test/unit/ImportExport/utNFFImportExport.cpp create mode 100644 test/unit/ImportExport/utXGLImportExport.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 82d320bed..210d95550 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -124,6 +124,8 @@ SET( IMPORTERS unit/ImportExport/utOgreImportExport.cpp unit/ImportExport/utQ3BSPFileImportExport.cpp unit/ImportExport/utOFFImportExport.cpp + unit/ImportExport/utNFFImportExport.cpp + unit/ImportExport/utXGLImportExport.cpp ) SET( MATERIAL diff --git a/test/unit/ImportExport/utNFFImportExport.cpp b/test/unit/ImportExport/utNFFImportExport.cpp new file mode 100644 index 000000000..aca9e0392 --- /dev/null +++ b/test/unit/ImportExport/utNFFImportExport.cpp @@ -0,0 +1,63 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2018, 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 "AbstractImportExportBase.h" +#include +#include + +using namespace Assimp; + +class utNFFImportExport : public AbstractImportExportBase { +public: + virtual bool importerTest() { + Assimp::Importer importer; + const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/NFF/NFF/ManyEarthsNotJustOne.nff", 0); + return true; + return nullptr != scene; + } +}; + +TEST_F(utNFFImportExport, importNFFFromFileTest) { + EXPECT_TRUE(importerTest()); +} diff --git a/test/unit/ImportExport/utXGLImportExport.cpp b/test/unit/ImportExport/utXGLImportExport.cpp new file mode 100644 index 000000000..8f82ba48d --- /dev/null +++ b/test/unit/ImportExport/utXGLImportExport.cpp @@ -0,0 +1,63 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2018, 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 "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()); +} From bc97e45d3939c5ada3031b54485b17a347326252 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 26 Dec 2018 18:22:29 +0100 Subject: [PATCH 34/78] Update .travis.yml revert name of branch --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6fefa694e..e222db23f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -74,4 +74,4 @@ addons: notification_email: kim.kulling@googlemail.com build_command_prepend: "cmake" build_command: "make" - branch_pattern: master + branch_pattern: coverity_scan From 4c6db68d34906d6686683ce382dd49c327ab118a Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Thu, 27 Dec 2018 22:28:23 +0100 Subject: [PATCH 35/78] Coverity-findings --- code/FBXExportNode.h | 19 ++++++++++++++++--- code/FBXExporter.cpp | 16 +++++++++------- code/XGLLoader.cpp | 10 ++++------ code/glTF2AssetWriter.inl | 3 +++ code/glTF2Exporter.cpp | 5 ++++- 5 files changed, 36 insertions(+), 17 deletions(-) diff --git a/code/FBXExportNode.h b/code/FBXExportNode.h index 5ddd8c77b..b9cd5156f 100644 --- a/code/FBXExportNode.h +++ b/code/FBXExportNode.h @@ -70,14 +70,27 @@ public: // public data members bool force_has_children = false; public: // constructors + /// The default class constructor. Node() = default; - Node(const std::string& n) : name(n) {} + + /// The class constructor with the name. + Node(const std::string& n) + : name(n) + , properties() + , children() + , force_has_children( false ) { + // empty + } // convenience template to construct with properties directly template Node(const std::string& n, const More... more) - : name(n) - { AddProperties(more...); } + : name(n) + , properties() + , children() + , force_has_children(false) { + AddProperties(more...); + } public: // functions to add properties or children // add a single property to the node diff --git a/code/FBXExporter.cpp b/code/FBXExporter.cpp index 037520641..2e153dde0 100644 --- a/code/FBXExporter.cpp +++ b/code/FBXExporter.cpp @@ -131,13 +131,15 @@ namespace Assimp { } // end of namespace Assimp -FBXExporter::FBXExporter ( - const aiScene* pScene, - const ExportProperties* pProperties -) - : mScene(pScene) - , mProperties(pProperties) -{ +FBXExporter::FBXExporter ( const aiScene* pScene, const ExportProperties* pProperties ) +: binary(false) +, mScene(pScene) +, mProperties(pProperties) +, outfile() +, connections() +, mesh_uids() +, material_uids() +, node_uids() { // will probably need to determine UIDs, connections, etc here. // basically anything that needs to be known // before we start writing sections to the stream. diff --git a/code/XGLLoader.cpp b/code/XGLLoader.cpp index 0706ffd55..196f20e90 100644 --- a/code/XGLLoader.cpp +++ b/code/XGLLoader.cpp @@ -731,11 +731,10 @@ unsigned int XGLImporter::ResolveMaterialRef(TempScope& scope) } // ------------------------------------------------------------------------------------------------ -void XGLImporter::ReadMaterial(TempScope& scope) -{ +void XGLImporter::ReadMaterial(TempScope& scope) { const unsigned int mat_id = ReadIDAttr(); - std::unique_ptr mat(new aiMaterial()); + aiMaterial *mat(new aiMaterial ); while (ReadElementUpToClosing("mat")) { const std::string& s = GetElementName(); if (s == "amb") { @@ -764,11 +763,10 @@ void XGLImporter::ReadMaterial(TempScope& scope) } } - scope.materials[mat_id] = mat.get(); - scope.materials_linear.push_back(mat.release()); + scope.materials[mat_id] = mat; + scope.materials_linear.push_back(mat); } - // ---------------------------------------------------------------------------------------------- void XGLImporter::ReadFaceVertex(const TempMesh& t, TempFace& out) { diff --git a/code/glTF2AssetWriter.inl b/code/glTF2AssetWriter.inl index 50d855aaa..75726fd08 100644 --- a/code/glTF2AssetWriter.inl +++ b/code/glTF2AssetWriter.inl @@ -744,6 +744,9 @@ namespace glTF2 { if (!(dict = FindArray(*container, d.mDictId))) { container->AddMember(StringRef(d.mDictId), Value().SetArray().Move(), mDoc.GetAllocator()); dict = FindArray(*container, d.mDictId); + if (nullptr == dict) { + return; + } } for (size_t i = 0; i < d.mObjs.size(); ++i) { diff --git a/code/glTF2Exporter.cpp b/code/glTF2Exporter.cpp index 40db27264..2c6bab2e0 100644 --- a/code/glTF2Exporter.cpp +++ b/code/glTF2Exporter.cpp @@ -643,11 +643,12 @@ void ExportSkin(Asset& mAsset, const aiMesh* aimesh, Ref& meshRef, Ref buf = vertexJointAccessor->bufferView->buffer; uint8_t* arrys = new uint8_t[bytesLen]; unsigned int i = 0; + uint8_t* data = new uint8_t[s_bytesPerComp]; for ( unsigned int j = 0; j <= bytesLen; j += bytesPerComp ){ size_t len_p = offset + j; float f_value = *(float *)&buf->GetPointer()[len_p]; unsigned short c = static_cast(f_value); - uint8_t* data = new uint8_t[s_bytesPerComp]; + ::memset(data, 0, s_bytesPerComp * sizeof(uint8_t)); data = (uint8_t*)&c; memcpy(&arrys[i*s_bytesPerComp], data, s_bytesPerComp); ++i; @@ -657,6 +658,8 @@ void ExportSkin(Asset& mAsset, const aiMesh* aimesh, Ref& meshRef, RefbufferView->byteLength = s_bytesLen; p.attributes.joint.push_back( vertexJointAccessor ); + delete[] arrys; + delete[] data; } Ref vertexWeightAccessor = ExportData(mAsset, skinRef->id, bufferRef, aimesh->mNumVertices, vertexWeightData, AttribType::VEC4, AttribType::VEC4, ComponentType_FLOAT); From 859153e3e6ac053934dd6a689b9ecefacecfb07b Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 28 Dec 2018 01:44:56 +0100 Subject: [PATCH 36/78] more fixes for coverity-findings. --- code/ColladaLoader.cpp | 33 +++++++++++++++++-------------- test/unit/utPLYImportExport.cpp | 3 +++ test/unit/utglTF2ImportExport.cpp | 5 +++-- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/code/ColladaLoader.cpp b/code/ColladaLoader.cpp index d86985a29..ab896c000 100644 --- a/code/ColladaLoader.cpp +++ b/code/ColladaLoader.cpp @@ -85,24 +85,27 @@ static const aiImporterDesc desc = { // ------------------------------------------------------------------------------------------------ // Constructor to be privately used by Importer ColladaLoader::ColladaLoader() - : mFileName() - , mMeshIndexByID() - , mMaterialIndexByName() - , mMeshes() - , newMats() - , mCameras() - , mLights() - , mTextures() - , mAnims() - , noSkeletonMesh( false ) - , ignoreUpDirection(false) - , mNodeNameCounter( 0 ) -{} +: mFileName() +, mMeshIndexByID() +, mMaterialIndexByName() +, mMeshes() +, newMats() +, mCameras() +, mLights() +, mTextures() +, mAnims() +, noSkeletonMesh( false ) +, ignoreUpDirection(false) +, useColladaName( false ) +, mNodeNameCounter( 0 ) { + // empty +} // ------------------------------------------------------------------------------------------------ // Destructor, private as well -ColladaLoader::~ColladaLoader() -{} +ColladaLoader::~ColladaLoader() { + // empty +} // ------------------------------------------------------------------------------------------------ // Returns whether the class can handle the format of the given file. diff --git a/test/unit/utPLYImportExport.cpp b/test/unit/utPLYImportExport.cpp index 5aabe0805..540996b21 100644 --- a/test/unit/utPLYImportExport.cpp +++ b/test/unit/utPLYImportExport.cpp @@ -56,6 +56,9 @@ public: const aiScene *scene = importer.ReadFile( ASSIMP_TEST_MODELS_DIR "/PLY/cube.ply", aiProcess_ValidateDataStructure); EXPECT_EQ( 1u, scene->mNumMeshes ); EXPECT_NE( nullptr, scene->mMeshes[0] ); + if (nullptr == scene->mMeshes[0]) { + return false; + } EXPECT_EQ( 8u, scene->mMeshes[0]->mNumVertices ); EXPECT_EQ( 6u, scene->mMeshes[0]->mNumFaces ); diff --git a/test/unit/utglTF2ImportExport.cpp b/test/unit/utglTF2ImportExport.cpp index 264580aad..08fa9d989 100644 --- a/test/unit/utglTF2ImportExport.cpp +++ b/test/unit/utglTF2ImportExport.cpp @@ -356,11 +356,12 @@ std::vector ReadFile(const char* name) { } ::fseek(p, 0, SEEK_END); - const auto size = ::ftell(p); + const size_t size = ::ftell(p); ::fseek(p, 0, SEEK_SET); ret.resize(size); - ::fread(&ret[0], 1, size, p); + const size_t readSize = ::fread(&ret[0], 1, size, p); + EXPECT_EQ(readSize, size); ::fclose(p); return ret; From db202584ab55328de2488e5ad5f6208f2d7aae29 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 28 Dec 2018 01:45:47 +0100 Subject: [PATCH 37/78] remove dead code. --- code/ColladaExporter.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/code/ColladaExporter.cpp b/code/ColladaExporter.cpp index 0d5bdd46d..9d66741eb 100644 --- a/code/ColladaExporter.cpp +++ b/code/ColladaExporter.cpp @@ -1500,24 +1500,18 @@ void ColladaExporter::WriteNode( const aiScene* pScene, aiNode* pNode) // otherwise it is a normal node (NODE) const char * node_type; bool is_joint, is_skeleton_root = false; - if (NULL == findBone(pScene, pNode->mName.C_Str())) { + if (nullptr == findBone(pScene, pNode->mName.C_Str())) { node_type = "NODE"; is_joint = false; } else { node_type = "JOINT"; is_joint = true; - if(!pNode->mParent || NULL == findBone(pScene, pNode->mParent->mName.C_Str())) + if (!pNode->mParent || nullptr == findBone(pScene, pNode->mParent->mName.C_Str())) { is_skeleton_root = true; + } } const std::string node_name_escaped = XMLEscape(pNode->mName.data); - /* // customized, Note! the id field is crucial for inter-xml look up, it cannot be replaced with sid ?! - mOutput << startstr - << " Date: Fri, 28 Dec 2018 11:17:27 +0100 Subject: [PATCH 38/78] fix more findings. --- code/SceneCombiner.cpp | 6 +++++- code/XGLLoader.cpp | 6 +++--- code/glTF2Asset.h | 6 +++++- code/glTF2Importer.cpp | 6 ++++++ 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/code/SceneCombiner.cpp b/code/SceneCombiner.cpp index 883447372..2271194ca 100644 --- a/code/SceneCombiner.cpp +++ b/code/SceneCombiner.cpp @@ -738,7 +738,11 @@ void SceneCombiner::MergeBones(aiMesh* out,std::vector::const_iterator // And copy the final weights - adjust the vertex IDs by the // face index offset of the corresponding mesh. - for (std::vector< BoneSrcIndex >::const_iterator wmit = (*boneIt).pSrcBones.begin(); wmit != wend; ++wmit) { + for (std::vector< BoneSrcIndex >::const_iterator wmit = (*boneIt).pSrcBones.begin(); wmit != (*boneIt).pSrcBones.end(); ++wmit) { + if (wmit == wend) { + break; + } + aiBone* pip = (*wmit).first; for (unsigned int mp = 0; mp < pip->mNumWeights;++mp,++avw) { const aiVertexWeight& vfi = pip->mWeights[mp]; diff --git a/code/XGLLoader.cpp b/code/XGLLoader.cpp index 196f20e90..2dfd51284 100644 --- a/code/XGLLoader.cpp +++ b/code/XGLLoader.cpp @@ -370,7 +370,7 @@ aiLight* XGLImporter::ReadDirectionalLight() // ------------------------------------------------------------------------------------------------ aiNode* XGLImporter::ReadObject(TempScope& scope, bool skipFirst, const char* closetag) { - std::unique_ptr nd(new aiNode()); + aiNode *nd = new aiNode; std::vector children; std::vector meshes; @@ -453,11 +453,11 @@ aiNode* XGLImporter::ReadObject(TempScope& scope, bool skipFirst, const char* cl nd->mChildren = new aiNode*[nd->mNumChildren](); for(unsigned int i = 0; i < nd->mNumChildren; ++i) { nd->mChildren[i] = children[i]; - children[i]->mParent = nd.get(); + children[i]->mParent = nd; } } - return nd.release(); + return nd; } // ------------------------------------------------------------------------------------------------ diff --git a/code/glTF2Asset.h b/code/glTF2Asset.h index 92be82f3b..6672dd7a9 100644 --- a/code/glTF2Asset.h +++ b/code/glTF2Asset.h @@ -656,7 +656,11 @@ namespace glTF2 } ortographic; } cameraProperties; - Camera() {} + Camera() + : type(Perspective) + , cameraProperties() { + // empty + } void Read(Value& obj, Asset& r); }; diff --git a/code/glTF2Importer.cpp b/code/glTF2Importer.cpp index 107281a33..20c28f498 100755 --- a/code/glTF2Importer.cpp +++ b/code/glTF2Importer.cpp @@ -763,6 +763,12 @@ static void BuildVertexWeightMapping(Mesh::Primitive& primitive, std::vectorExtractData(indices16); } + // + if (nullptr == indices8 && nullptr == indices16) { + // Something went completely wrong! + ai_assert(false); + return; + } for (int i = 0; i < num_vertices; ++i) { for (int j = 0; j < 4; ++j) { From f5e94a2840ae2a03310cfab51d668f1ba9d9c45f Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 29 Dec 2018 21:27:20 +0100 Subject: [PATCH 39/78] Add a check for the resule of a dynamic cast. --- code/BlenderCustomData.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/BlenderCustomData.cpp b/code/BlenderCustomData.cpp index 682186618..6561eaf22 100644 --- a/code/BlenderCustomData.cpp +++ b/code/BlenderCustomData.cpp @@ -28,7 +28,11 @@ namespace Assimp { #define IMPL_STRUCT_READ(ty) \ bool read##ty(ElemBase *v, const size_t cnt, const FileDatabase &db) { \ - return read(db.dna[#ty], dynamic_cast(v), cnt, db); \ + ty *ptr = dynamic_cast(v); \ + if (nullptr == ptr) { \ + return false; \ + } \ + return read(db.dna[#ty], ptr, cnt, db); \ } #define IMPL_STRUCT_CREATE(ty) \ From e09428c95b457c0389766ee7dc69ac82bdd8e33f Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 29 Dec 2018 21:29:42 +0100 Subject: [PATCH 40/78] eremove useless assertion test. --- code/FBXExporter.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/code/FBXExporter.cpp b/code/FBXExporter.cpp index 2e153dde0..ce00deee3 100644 --- a/code/FBXExporter.cpp +++ b/code/FBXExporter.cpp @@ -2446,7 +2446,6 @@ void FBXExporter::WriteAnimationCurve( // TODO: keyattr flags and data (STUB for now) n.AddChild("KeyAttrFlags", std::vector{0}); n.AddChild("KeyAttrDataFloat", std::vector{0,0,0,0}); - ai_assert(static_cast(times.size()) <= std::numeric_limits::max()); n.AddChild( "KeyAttrRefCount", std::vector{static_cast(times.size())} From 69ea55d1808c8f3cfe3624a3d2cae792f5e87d03 Mon Sep 17 00:00:00 2001 From: carasuca Date: Sun, 30 Dec 2018 02:59:49 +0100 Subject: [PATCH 41/78] Fix: except `SyntaxError` for py3 viewer Following https://www.python.org/dev/peps/pep-3110/ --- port/PyAssimp/scripts/3d_viewer_py3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/port/PyAssimp/scripts/3d_viewer_py3.py b/port/PyAssimp/scripts/3d_viewer_py3.py index 477b1a103..fcee63717 100755 --- a/port/PyAssimp/scripts/3d_viewer_py3.py +++ b/port/PyAssimp/scripts/3d_viewer_py3.py @@ -468,7 +468,7 @@ class PyAssimp3DViewer: try: self.set_shaders_v130() self.prepare_shaders() - except RuntimeError, message: + except RuntimeError as message: sys.stderr.write("%s\n" % message) sys.stdout.write("Could not compile shaders in version 1.30, trying version 1.20\n") From f6cbb26d9c3947313e49deeac5674928dada8c1d Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 30 Dec 2018 10:30:12 +0100 Subject: [PATCH 42/78] Fix unnecessary allocation. --- code/glTF2Exporter.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/code/glTF2Exporter.cpp b/code/glTF2Exporter.cpp index 2c6bab2e0..774eedc1e 100644 --- a/code/glTF2Exporter.cpp +++ b/code/glTF2Exporter.cpp @@ -643,14 +643,11 @@ void ExportSkin(Asset& mAsset, const aiMesh* aimesh, Ref& meshRef, Ref buf = vertexJointAccessor->bufferView->buffer; uint8_t* arrys = new uint8_t[bytesLen]; unsigned int i = 0; - uint8_t* data = new uint8_t[s_bytesPerComp]; for ( unsigned int j = 0; j <= bytesLen; j += bytesPerComp ){ size_t len_p = offset + j; float f_value = *(float *)&buf->GetPointer()[len_p]; unsigned short c = static_cast(f_value); - ::memset(data, 0, s_bytesPerComp * sizeof(uint8_t)); - data = (uint8_t*)&c; - memcpy(&arrys[i*s_bytesPerComp], data, s_bytesPerComp); + memcpy(&arrys[i*s_bytesPerComp], &c, s_bytesPerComp); ++i; } buf->ReplaceData_joint(offset, bytesLen, arrys, bytesLen); @@ -659,7 +656,6 @@ void ExportSkin(Asset& mAsset, const aiMesh* aimesh, Ref& meshRef, Ref vertexWeightAccessor = ExportData(mAsset, skinRef->id, bufferRef, aimesh->mNumVertices, vertexWeightData, AttribType::VEC4, AttribType::VEC4, ComponentType_FLOAT); From 8912bb333cbed8a5f20af3f21c7bed2be3a0c43e Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 30 Dec 2018 10:33:21 +0100 Subject: [PATCH 43/78] Fix memory leak. --- code/glTF2Exporter.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/code/glTF2Exporter.cpp b/code/glTF2Exporter.cpp index 774eedc1e..d513dc45d 100644 --- a/code/glTF2Exporter.cpp +++ b/code/glTF2Exporter.cpp @@ -658,7 +658,8 @@ void ExportSkin(Asset& mAsset, const aiMesh* aimesh, Ref& meshRef, Ref vertexWeightAccessor = ExportData(mAsset, skinRef->id, bufferRef, aimesh->mNumVertices, vertexWeightData, AttribType::VEC4, AttribType::VEC4, ComponentType_FLOAT); + Ref vertexWeightAccessor = ExportData(mAsset, skinRef->id, bufferRef, aimesh->mNumVertices, + vertexWeightData, AttribType::VEC4, AttribType::VEC4, ComponentType_FLOAT); if ( vertexWeightAccessor ) { p.attributes.weight.push_back( vertexWeightAccessor ); } @@ -747,8 +748,7 @@ void glTF2Exporter::ExportMeshes() } /*************** Vertex colors ****************/ - for (unsigned int indexColorChannel = 0; indexColorChannel < aim->GetNumColorChannels(); ++indexColorChannel) - { + for (unsigned int indexColorChannel = 0; indexColorChannel < aim->GetNumColorChannels(); ++indexColorChannel) { Ref c = ExportData(*mAsset, meshId, b, aim->mNumVertices, aim->mColors[indexColorChannel], AttribType::VEC4, AttribType::VEC4, ComponentType_FLOAT, false); if (c) p.attributes.color.push_back(c); @@ -794,8 +794,12 @@ void glTF2Exporter::ExportMeshes() CopyValue(inverseBindMatricesData[idx_joint], invBindMatrixData[idx_joint]); } - Ref invBindMatrixAccessor = ExportData(*mAsset, skinName, b, static_cast(inverseBindMatricesData.size()), invBindMatrixData, AttribType::MAT4, AttribType::MAT4, ComponentType_FLOAT); - if (invBindMatrixAccessor) skinRef->inverseBindMatrices = invBindMatrixAccessor; + Ref invBindMatrixAccessor = ExportData(*mAsset, skinName, b, + static_cast(inverseBindMatricesData.size()), + invBindMatrixData, AttribType::MAT4, AttribType::MAT4, ComponentType_FLOAT); + if (invBindMatrixAccessor) { + skinRef->inverseBindMatrices = invBindMatrixAccessor; + } // Identity Matrix =====> skinRef->bindShapeMatrix // Temporary. Hard-coded identity matrix here @@ -823,10 +827,11 @@ void glTF2Exporter::ExportMeshes() meshNode->skeletons.push_back(rootJoint); meshNode->skin = skinRef; } + delete[] invBindMatrixData; } } -//merges a node's multiple meshes (with one primitive each) into one mesh with multiple primitives +// Merges a node's multiple meshes (with one primitive each) into one mesh with multiple primitives void glTF2Exporter::MergeMeshes() { for (unsigned int n = 0; n < mAsset->nodes.Size(); ++n) { From a8fda890797fe0625c75446263f9f9f9c2b9ea70 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 30 Dec 2018 10:36:23 +0100 Subject: [PATCH 44/78] remove unique_ptr ina local function / method. --- code/Importer/IFC/IFCLoader.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/code/Importer/IFC/IFCLoader.cpp b/code/Importer/IFC/IFCLoader.cpp index 473355538..01cb39773 100644 --- a/code/Importer/IFC/IFCLoader.cpp +++ b/code/Importer/IFC/IFCLoader.cpp @@ -659,8 +659,8 @@ void ProcessMetadata(uint64_t relDefinesByPropertiesID, ConversionData& conv, Me } // ------------------------------------------------------------------------------------------------ -aiNode* ProcessSpatialStructure(aiNode* parent, const Schema_2x3::IfcProduct& el, ConversionData& conv, std::vector* collect_openings = NULL) -{ +aiNode* ProcessSpatialStructure(aiNode* parent, const Schema_2x3::IfcProduct& el, ConversionData& conv, + std::vector* collect_openings = nullptr ) { const STEP::DB::RefMap& refs = conv.db.GetRefs(); // skip over space and annotation nodes - usually, these have no meaning in Assimp's context @@ -675,12 +675,12 @@ aiNode* ProcessSpatialStructure(aiNode* parent, const Schema_2x3::IfcProduct& el if(conv.settings.skipAnnotations) { if(el.ToPtr()) { IFCImporter::LogDebug("skipping IfcAnnotation entity due to importer settings"); - return NULL; + return nullptr; } } // add an output node for this spatial structure - std::unique_ptr nd(new aiNode()); + aiNode *nd(new aiNode ); nd->mName.Set(el.GetClassName()+"_"+(el.Name?el.Name.Get():"Unnamed")+"_"+el.GlobalId); nd->mParent = parent; @@ -693,8 +693,7 @@ aiNode* ProcessSpatialStructure(aiNode* parent, const Schema_2x3::IfcProduct& el if (children.first==children.second) { // handles single property set ProcessMetadata((*children.first).second, conv, properties); - } - else { + } else { // handles multiple property sets (currently all property sets are merged, // which may not be the best solution in the long run) for (STEP::DB::RefMap::const_iterator it=children.first; it!=children.second; ++it) { @@ -751,7 +750,7 @@ aiNode* ProcessSpatialStructure(aiNode* parent, const Schema_2x3::IfcProduct& el continue; } - aiNode* const ndnew = ProcessSpatialStructure(nd.get(),pro,conv,NULL); + aiNode* const ndnew = ProcessSpatialStructure(nd,pro,conv,nullptr); if(ndnew) { subnodes.push_back( ndnew ); } @@ -765,7 +764,7 @@ aiNode* ProcessSpatialStructure(aiNode* parent, const Schema_2x3::IfcProduct& el // move opening elements to a separate node since they are semantically different than elements that are just 'contained' std::unique_ptr nd_aggr(new aiNode()); nd_aggr->mName.Set("$RelVoidsElement"); - nd_aggr->mParent = nd.get(); + nd_aggr->mParent = nd; nd_aggr->mTransformation = nd->mTransformation; @@ -810,7 +809,7 @@ aiNode* ProcessSpatialStructure(aiNode* parent, const Schema_2x3::IfcProduct& el // move aggregate elements to a separate node since they are semantically different than elements that are just 'contained' std::unique_ptr nd_aggr(new aiNode()); nd_aggr->mName.Set("$RelAggregates"); - nd_aggr->mParent = nd.get(); + nd_aggr->mParent = nd; nd_aggr->mTransformation = nd->mTransformation; @@ -835,8 +834,8 @@ aiNode* ProcessSpatialStructure(aiNode* parent, const Schema_2x3::IfcProduct& el } if (!skipGeometry) { - ProcessProductRepresentation(el,nd.get(),subnodes,conv); - conv.apply_openings = conv.collect_openings = NULL; + ProcessProductRepresentation(el, nd, subnodes, conv); + conv.apply_openings = conv.collect_openings = nullptr; } if (subnodes.size()) { @@ -846,8 +845,7 @@ aiNode* ProcessSpatialStructure(aiNode* parent, const Schema_2x3::IfcProduct& el nd2->mParent = nd.get(); } } - } - catch(...) { + } catch(...) { // it hurts, but I don't want to pull boost::ptr_vector into -noboost only for these few spots here std::for_each(subnodes.begin(),subnodes.end(),delete_fun()); throw; @@ -855,7 +853,7 @@ aiNode* ProcessSpatialStructure(aiNode* parent, const Schema_2x3::IfcProduct& el ai_assert(conv.already_processed.find(el.GetID()) != conv.already_processed.end()); conv.already_processed.erase(conv.already_processed.find(el.GetID())); - return nd.release(); + return nd; } // ------------------------------------------------------------------------------------------------ From 281c1913678f130ec04fb8ee5d49975efc12a01b Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 30 Dec 2018 10:44:43 +0100 Subject: [PATCH 45/78] fix streamreader::end definition for iterators. --- code/Importer/IFC/IFCLoader.cpp | 2 +- include/assimp/StreamReader.h | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/code/Importer/IFC/IFCLoader.cpp b/code/Importer/IFC/IFCLoader.cpp index 01cb39773..97c514d44 100644 --- a/code/Importer/IFC/IFCLoader.cpp +++ b/code/Importer/IFC/IFCLoader.cpp @@ -842,7 +842,7 @@ aiNode* ProcessSpatialStructure(aiNode* parent, const Schema_2x3::IfcProduct& el nd->mChildren = new aiNode*[subnodes.size()](); for(aiNode* nd2 : subnodes) { nd->mChildren[nd->mNumChildren++] = nd2; - nd2->mParent = nd.get(); + nd2->mParent = nd; } } } catch(...) { diff --git a/include/assimp/StreamReader.h b/include/assimp/StreamReader.h index b01ee4b66..4e5d2ddfa 100644 --- a/include/assimp/StreamReader.h +++ b/include/assimp/StreamReader.h @@ -48,11 +48,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_STREAMREADER_H_INCLUDED #define AI_STREAMREADER_H_INCLUDED +#include +#include + #include "ByteSwapper.h" #include "Exceptional.h" #include -#include -#include namespace Assimp { @@ -314,7 +315,7 @@ private: const size_t read = stream->Read(current,1,s); // (read < s) can only happen if the stream was opened in text mode, in which case FileSize() is not reliable ai_assert(read <= s); - end = limit = &buffer[read]; + end = limit = &buffer[read-1] + 1; } private: From 7c23a6c5ca9b7dcf7b2acbfe17b7e0fe0c45dd2c Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 30 Dec 2018 11:41:58 +0100 Subject: [PATCH 46/78] fix review findings. --- port/PyAssimp/README.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/port/PyAssimp/README.md b/port/PyAssimp/README.md index 37ecdb65d..22c9b2625 100644 --- a/port/PyAssimp/README.md +++ b/port/PyAssimp/README.md @@ -76,19 +76,16 @@ INSTALL Install `pyassimp` by running: -``` +```console $ python setup.py install ``` PyAssimp requires a assimp dynamic library (`DLL` on windows, -`.so` on linux, `.dynlib` on macOS) in order to work. The default search directories -are: - -- the current directory -- on linux additionally: `/usr/lib`, `/usr/local/lib`, - `/usr/lib/x86_64-linux-gnu` +`.so` on linux, `.dynlib` on macOS) in order to work. The default search directories are: + - the current directory + - on linux additionally: `/usr/lib`, `/usr/local/lib`, + `/usr/lib/x86_64-linux-gnu` To build that library, refer to the Assimp master `INSTALL` instructions. To look in more places, edit `./pyassimp/helper.py`. There's an `additional_dirs` list waiting for your entries. - From ba80410c486a20cc0280c441dc405876e6351464 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 30 Dec 2018 15:56:42 +0100 Subject: [PATCH 47/78] fix review findings. --- port/PyAssimp/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/port/PyAssimp/README.md b/port/PyAssimp/README.md index 22c9b2625..b2ec6491e 100644 --- a/port/PyAssimp/README.md +++ b/port/PyAssimp/README.md @@ -82,9 +82,9 @@ $ python setup.py install PyAssimp requires a assimp dynamic library (`DLL` on windows, `.so` on linux, `.dynlib` on macOS) in order to work. The default search directories are: - - the current directory - - on linux additionally: `/usr/lib`, `/usr/local/lib`, - `/usr/lib/x86_64-linux-gnu` +- the current directory +- on linux additionally: `/usr/lib`, `/usr/local/lib`, + `/usr/lib/x86_64-linux-gnu` To build that library, refer to the Assimp master `INSTALL` instructions. To look in more places, edit `./pyassimp/helper.py`. From 35d69c360c890e09407d46c49184275d96bca88b Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 30 Dec 2018 15:59:15 +0100 Subject: [PATCH 48/78] fix out-of-bound access. --- code/Q3DLoader.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/code/Q3DLoader.cpp b/code/Q3DLoader.cpp index f1165dc2c..1aa7cb72f 100644 --- a/code/Q3DLoader.cpp +++ b/code/Q3DLoader.cpp @@ -302,13 +302,14 @@ void Q3DImporter::InternReadFile( const std::string& pFile, case 't': pScene->mNumTextures = numTextures; - if (!numTextures)break; - pScene->mTextures = new aiTexture*[pScene->mNumTextures]; + if (!numTextures) { + break; + } + pScene->mTextures = new aiTexture*[pScene->mNumTextures]; // to make sure we won't crash if we leave through an exception ::memset(pScene->mTextures,0,sizeof(void*)*pScene->mNumTextures); - for (unsigned int i = 0; i < pScene->mNumTextures; ++i) - { - aiTexture* tex = pScene->mTextures[i] = new aiTexture(); + for (unsigned int i = 0; i < pScene->mNumTextures; ++i) { + aiTexture* tex = pScene->mTextures[i] = new aiTexture; // skip the texture name while (stream.GetI1()); @@ -317,15 +318,16 @@ void Q3DImporter::InternReadFile( const std::string& pFile, tex->mWidth = (unsigned int)stream.GetI4(); tex->mHeight = (unsigned int)stream.GetI4(); - if (!tex->mWidth || !tex->mHeight) + if (!tex->mWidth || !tex->mHeight) { throw DeadlyImportError("Quick3D: Invalid texture. Width or height is zero"); + } unsigned int mul = tex->mWidth * tex->mHeight; aiTexel* begin = tex->pcData = new aiTexel[mul]; - aiTexel* const end = & begin [mul]; + aiTexel* const end = & begin[mul-1] +1; - for (;begin != end; ++begin) - { + + for (;begin != end; ++begin) { begin->r = stream.GetI1(); begin->g = stream.GetI1(); begin->b = stream.GetI1(); From b42d959418a3969ed9858567c68eb752831282d3 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 30 Dec 2018 16:02:22 +0100 Subject: [PATCH 49/78] fix review warning: wrapper object used after free. --- code/glTFExporter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/glTFExporter.cpp b/code/glTFExporter.cpp index 29a88af8b..5d00c9178 100644 --- a/code/glTFExporter.cpp +++ b/code/glTFExporter.cpp @@ -101,17 +101,17 @@ glTFExporter::glTFExporter(const char* filename, IOSystem* pIOSystem, const aiSc { aiScene* sceneCopy_tmp; SceneCombiner::CopyScene(&sceneCopy_tmp, pScene); - std::unique_ptr sceneCopy(sceneCopy_tmp); + aiScene *sceneCopy(sceneCopy_tmp); SplitLargeMeshesProcess_Triangle tri_splitter; tri_splitter.SetLimit(0xffff); - tri_splitter.Execute(sceneCopy.get()); + tri_splitter.Execute(sceneCopy); SplitLargeMeshesProcess_Vertex vert_splitter; vert_splitter.SetLimit(0xffff); - vert_splitter.Execute(sceneCopy.get()); + vert_splitter.Execute(sceneCopy); - mScene = sceneCopy.get(); + mScene = sceneCopy; mAsset.reset( new glTF::Asset( pIOSystem ) ); From 3596c822a5d27077275c0b961bce4d48ec1a849d Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 30 Dec 2018 16:04:49 +0100 Subject: [PATCH 50/78] fix review finding: Wrapper object use after free. --- code/STLLoader.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/code/STLLoader.cpp b/code/STLLoader.cpp index fb866bb7a..f8c4bb7db 100644 --- a/code/STLLoader.cpp +++ b/code/STLLoader.cpp @@ -182,7 +182,7 @@ void STLImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOS std::unique_ptr file( pIOHandler->Open( pFile, "rb")); // Check whether we can read from the file - if( file.get() == NULL) { + if( file.get() == nullptr) { throw DeadlyImportError( "Failed to open STL file " + pFile + "."); } @@ -190,11 +190,11 @@ void STLImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOS // allocate storage and copy the contents of the file to a memory buffer // (terminate it with zero) - std::vector mBuffer2; - TextFileToBuffer(file.get(),mBuffer2); + std::vector buffer2; + TextFileToBuffer(file.get(),buffer2); this->pScene = pScene; - this->mBuffer = &mBuffer2[0]; + this->mBuffer = &buffer2[0]; // the default vertex color is light gray. clrColorDefault.r = clrColorDefault.g = clrColorDefault.b = clrColorDefault.a = (ai_real) 0.6; @@ -231,6 +231,8 @@ void STLImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOS pScene->mNumMaterials = 1; pScene->mMaterials = new aiMaterial*[1]; pScene->mMaterials[0] = pcMat; + + mBuffer = nullptr; } // ------------------------------------------------------------------------------------------------ From 92bb0febdfd06bc2187cfe2a4a7c0004ac7b56f0 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 30 Dec 2018 16:11:39 +0100 Subject: [PATCH 51/78] fix review finding: fix resource leak. --- code/IRRLoader.cpp | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/code/IRRLoader.cpp b/code/IRRLoader.cpp index 0640b0d66..9432eff61 100644 --- a/code/IRRLoader.cpp +++ b/code/IRRLoader.cpp @@ -89,14 +89,16 @@ static const aiImporterDesc desc = { // ------------------------------------------------------------------------------------------------ // Constructor to be privately used by Importer IRRImporter::IRRImporter() - : fps(), - configSpeedFlag() -{} +: fps() +, configSpeedFlag(){ + // empty +} // ------------------------------------------------------------------------------------------------ // Destructor, private as well -IRRImporter::~IRRImporter() -{} +IRRImporter::~IRRImporter() { + // empty +} // ------------------------------------------------------------------------------------------------ // Returns whether the class can handle the format of the given file. @@ -107,9 +109,9 @@ bool IRRImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool } else if (extension == "xml" || checkSig) { /* If CanRead() is called in order to check whether we * support a specific file extension in general pIOHandler - * might be NULL and it's our duty to return true here. + * might be nullptr and it's our duty to return true here. */ - if ( nullptr == pIOHandler ) { + if (nullptr == pIOHandler ) { return true; } const char* tokens[] = {"irr_scene"}; @@ -290,8 +292,8 @@ void IRRImporter::CopyMaterial(std::vector& materials, // ------------------------------------------------------------------------------------------------ -inline int ClampSpline(int idx, int size) -{ +inline +int ClampSpline(int idx, int size) { return ( idx<0 ? size+idx : ( idx>=size ? idx-size : idx ) ); } @@ -310,7 +312,7 @@ inline void FindSuitableMultiple(int& angle) // ------------------------------------------------------------------------------------------------ void IRRImporter::ComputeAnimations(Node* root, aiNode* real, std::vector& anims) { - ai_assert(NULL != root && NULL != real); + ai_assert(nullptr != root && nullptr != real); // XXX totally WIP - doesn't produce proper results, need to evaluate // whether there's any use for Irrlicht's proprietary scene format @@ -521,7 +523,8 @@ void IRRImporter::ComputeAnimations(Node* root, aiNode* real, std::vector file( pIOHandler->Open( pFile)); // Check whether we can read from the file - if( file.get() == NULL) - throw DeadlyImportError( "Failed to open IRR file " + pFile + ""); + if (file.get() == nullptr) { + throw DeadlyImportError("Failed to open IRR file " + pFile + ""); + } // Construct the irrXML parser CIrrXML_IOStreamReader st(file.get()); @@ -914,14 +918,14 @@ void IRRImporter::InternReadFile( const std::string& pFile, // The root node of the scene Node* root = new Node(Node::DUMMY); - root->parent = NULL; + root->parent = nullptr; root->name = ""; // Current node parent Node* curParent = root; // Scenegraph node we're currently working on - Node* curNode = NULL; + Node* curNode = nullptr; // List of output cameras std::vector cameras; @@ -1048,7 +1052,7 @@ void IRRImporter::InternReadFile( const std::string& pFile, continue; } - Animator* curAnim = NULL; + Animator* curAnim = nullptr; // Materials can occur for nearly any type of node if (inMaterials && curNode->type != Node::DUMMY) { @@ -1353,7 +1357,7 @@ void IRRImporter::InternReadFile( const std::string& pFile, } else curParent = curParent->parent; } - else curNode = NULL; + else curNode = nullptr; } // clear all flags else if (!ASSIMP_stricmp(reader->getNodeName(),"materials")) { @@ -1479,7 +1483,8 @@ void IRRImporter::InternReadFile( const std::string& pFile, /* Finished ... everything destructs automatically and all * temporary scenes have already been deleted by MergeScenes() */ - return; + + delete root; } #endif // !! ASSIMP_BUILD_NO_IRR_IMPORTER From ae31be1e23b4732347b2177316796832509dd5a2 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 30 Dec 2018 17:06:50 +0100 Subject: [PATCH 52/78] next try. --- port/PyAssimp/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/port/PyAssimp/README.md b/port/PyAssimp/README.md index b2ec6491e..d64d72763 100644 --- a/port/PyAssimp/README.md +++ b/port/PyAssimp/README.md @@ -20,7 +20,7 @@ model using a shader-based OpenGL pipeline. To use it, from within `/port/PyAssimp`: -``` +```console $ cd scripts $ python ./3D-viewer ``` @@ -82,9 +82,9 @@ $ python setup.py install PyAssimp requires a assimp dynamic library (`DLL` on windows, `.so` on linux, `.dynlib` on macOS) in order to work. The default search directories are: -- the current directory -- on linux additionally: `/usr/lib`, `/usr/local/lib`, - `/usr/lib/x86_64-linux-gnu` + - the current directory + - on linux additionally: `/usr/lib`, `/usr/local/lib`, + `/usr/lib/x86_64-linux-gnu` To build that library, refer to the Assimp master `INSTALL` instructions. To look in more places, edit `./pyassimp/helper.py`. From 425a784b23de2104827b61f7aea4cd664d3d0bf0 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 31 Dec 2018 12:16:20 +0100 Subject: [PATCH 53/78] fix finding: possible override. --- code/EmbedTexturesProcess.cpp | 6 +++++- include/assimp/texture.h | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/code/EmbedTexturesProcess.cpp b/code/EmbedTexturesProcess.cpp index ebe7a0897..ed9b79232 100644 --- a/code/EmbedTexturesProcess.cpp +++ b/code/EmbedTexturesProcess.cpp @@ -138,7 +138,11 @@ bool EmbedTexturesProcess::addTexture(aiScene* pScene, std::string path) const { auto extension = path.substr(path.find_last_of('.') + 1u); std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower); if (extension == "jpeg") extension = "jpg"; - strcpy(pTexture->achFormatHint, extension.c_str()); + size_t len = extension.size(); + if (len > HINTMAXTEXTURELEN -1) { + len = HINTMAXTEXTURELEN - 1; + } + strncpy(pTexture->achFormatHint, extension.c_str(), len); pScene->mTextures[textureId] = pTexture; diff --git a/include/assimp/texture.h b/include/assimp/texture.h index 5be7229ec..575f5754f 100644 --- a/include/assimp/texture.h +++ b/include/assimp/texture.h @@ -117,6 +117,8 @@ struct aiTexel #include "./Compiler/poppack1.h" +#define HINTMAXTEXTURELEN 9 + // -------------------------------------------------------------------------------- /** Helper structure to describe an embedded texture * @@ -166,7 +168,7 @@ struct aiTexture { * E.g. 'dds\\0', 'pcx\\0', 'jpg\\0'. All characters are lower-case. * The fourth character will always be '\\0'. */ - char achFormatHint[9];// 8 for string + 1 for terminator. + char achFormatHint[ HINTMAXTEXTURELEN ];// 8 for string + 1 for terminator. /** Data of the texture. * From c63b1a1fd539ed6bd2024e5d0867f4edbc0a4d61 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 31 Dec 2018 14:47:54 +0100 Subject: [PATCH 54/78] fix review finding: dereference after null-check. --- code/EmbedTexturesProcess.cpp | 16 +++++++++------- code/Q3BSPFileImporter.cpp | 3 +-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/code/EmbedTexturesProcess.cpp b/code/EmbedTexturesProcess.cpp index ed9b79232..a6dd8457e 100644 --- a/code/EmbedTexturesProcess.cpp +++ b/code/EmbedTexturesProcess.cpp @@ -124,26 +124,28 @@ bool EmbedTexturesProcess::addTexture(aiScene* pScene, std::string path) const { file.read(reinterpret_cast(imageContent), imageSize); // Enlarging the textures table - auto textureId = pScene->mNumTextures++; + unsigned int textureId = pScene->mNumTextures++; auto oldTextures = pScene->mTextures; pScene->mTextures = new aiTexture*[pScene->mNumTextures]; - memmove(pScene->mTextures, oldTextures, sizeof(aiTexture*) * (pScene->mNumTextures - 1u)); + ::memmove(pScene->mTextures, oldTextures, sizeof(aiTexture*) * (pScene->mNumTextures - 1u)); // Add the new texture - auto pTexture = new aiTexture(); + auto pTexture = new aiTexture; pTexture->mHeight = 0; // Means that this is still compressed pTexture->mWidth = static_cast(imageSize); pTexture->pcData = imageContent; auto extension = path.substr(path.find_last_of('.') + 1u); std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower); - if (extension == "jpeg") extension = "jpg"; + if (extension == "jpeg") { + extension = "jpg"; + } + size_t len = extension.size(); - if (len > HINTMAXTEXTURELEN -1) { + if (len > HINTMAXTEXTURELEN -1 ) { len = HINTMAXTEXTURELEN - 1; } - strncpy(pTexture->achFormatHint, extension.c_str(), len); - + ::strncpy(pTexture->achFormatHint, extension.c_str(), len); pScene->mTextures[textureId] = pTexture; return true; diff --git a/code/Q3BSPFileImporter.cpp b/code/Q3BSPFileImporter.cpp index 58fbef985..8b9e3c037 100644 --- a/code/Q3BSPFileImporter.cpp +++ b/code/Q3BSPFileImporter.cpp @@ -400,6 +400,7 @@ void Q3BSPFileImporter::createTriangleTopology( const Q3BSP::Q3BSPModel *pModel, if (nullptr != m_pCurrentFace) { m_pCurrentFace->mNumIndices = 3; m_pCurrentFace->mIndices = new unsigned int[3]; + m_pCurrentFace->mIndices[ idx ] = vertIdx; } } @@ -409,9 +410,7 @@ void Q3BSPFileImporter::createTriangleTopology( const Q3BSP::Q3BSPModel *pModel, pMesh->mTextureCoords[ 0 ][ vertIdx ].Set( pVertex->vTexCoord.x, pVertex->vTexCoord.y, 0.0f ); pMesh->mTextureCoords[ 1 ][ vertIdx ].Set( pVertex->vLightmap.x, pVertex->vLightmap.y, 0.0f ); - m_pCurrentFace->mIndices[ idx ] = vertIdx; vertIdx++; - idx++; } } From b59d931486c3ceb1ea819d42cade6c646fa98ad4 Mon Sep 17 00:00:00 2001 From: Arkeon Date: Wed, 2 Jan 2019 14:56:38 +0100 Subject: [PATCH 55/78] Correction on clipper crash on some IFC files when points are empty --- contrib/clipper/clipper.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/contrib/clipper/clipper.cpp b/contrib/clipper/clipper.cpp index 074f22b21..857cd1c3e 100644 --- a/contrib/clipper/clipper.cpp +++ b/contrib/clipper/clipper.cpp @@ -371,6 +371,9 @@ inline bool PointsEqual( const IntPoint &pt1, const IntPoint &pt2) bool Orientation(OutRec *outRec, bool UseFullInt64Range) { + if (!outRec->pts) + return 0.0; + //first make sure bottomPt is correctly assigned ... OutPt *opBottom = outRec->pts, *op = outRec->pts->next; while (op != outRec->pts) @@ -434,6 +437,9 @@ double Area(const Polygon &poly) double Area(const OutRec &outRec, bool UseFullInt64Range) { + if (!outRec.pts) + return 0.0; + OutPt *op = outRec.pts; if (UseFullInt64Range) { Int128 a(0); @@ -3085,9 +3091,9 @@ void Clipper::JoinCommonEdges(bool fixHoleLinkages) FixupOutPolygon(*outRec1); FixupOutPolygon(*outRec2); - if (Orientation(outRec1, m_UseFullRange) != (Area(*outRec1, m_UseFullRange) > 0)) + if (outRec1->pts && (Orientation(outRec1, m_UseFullRange) != (Area(*outRec1, m_UseFullRange) > 0))) DisposeBottomPt(*outRec1); - if (Orientation(outRec2, m_UseFullRange) != (Area(*outRec2, m_UseFullRange) > 0)) + if (outRec2->pts && (Orientation(outRec2, m_UseFullRange) != (Area(*outRec2, m_UseFullRange) > 0))) DisposeBottomPt(*outRec2); } else From 35a044bda37b2bad50a41746622c746acd139631 Mon Sep 17 00:00:00 2001 From: rickomax Date: Sun, 6 Jan 2019 16:37:30 -0200 Subject: [PATCH 56/78] Various additions/fixes (FBX blend-shapes support added) Added animMesh name assignment at ColladaLoader Fixed animMesh post-processing on ConvertToLhProcess (blend-shapes weren't being affected by post-processing) Added WindowsStore define. This is used to change some incompatible WinRT methods Added FBX blend-shapes and blend-shapes animations support Added Maya FBX specific texture slots parsing Added extra FBX metadata parsing Added GLTF2 vertex color parsing Fixed IFC-Loader zip-buffer reading rountine Fixed OBJ file parsing line-breaker bug Fixed IOStreamBuffer cache over-read bug Added mName field to aiAnimMesh Reverted EmissiveFactor, TransparencyFactor and SpecularFactor assignment on FBXConverter. Really, the commit #817 breaks a lot of old code. --- code/CMakeLists.txt | 3 + code/ColladaLoader.cpp | 7 +- code/ConvertToLHProcess.cpp | 66 +- code/DefaultIOSystem.cpp | 12 + code/FBXAnimation.cpp | 4 +- code/FBXConverter.cpp | 5952 ++++++++++++++++--------------- code/FBXConverter.h | 10 + code/FBXDeformer.cpp | 47 + code/FBXDocument.cpp | 9 + code/FBXDocument.h | 43 + code/FBXMeshGeometry.cpp | 47 +- code/FBXMeshGeometry.h | 34 +- code/Importer/IFC/IFCLoader.cpp | 17 +- code/ObjFileParser.cpp | 2 +- code/glTF2Importer.cpp | 13 +- include/assimp/IOStreamBuffer.h | 5 +- include/assimp/mesh.h | 5 +- 17 files changed, 3372 insertions(+), 2904 deletions(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index e29467164..043599aca 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -966,6 +966,9 @@ if( MSVC ) set(LIBRARY_SUFFIX "${ASSIMP_LIBRARY_SUFFIX}-${MSVC_PREFIX}-mt" CACHE STRING "the suffix for the assimp windows library") endif() +if (${CMAKE_SYSTEM_NAME} MATCHES "WindowsStore") + set(WindowsStore TRUE) +endif() SET_TARGET_PROPERTIES( assimp PROPERTIES VERSION ${ASSIMP_VERSION} SOVERSION ${ASSIMP_SOVERSION} # use full version diff --git a/code/ColladaLoader.cpp b/code/ColladaLoader.cpp index ab896c000..af04e9a16 100644 --- a/code/ColladaLoader.cpp +++ b/code/ColladaLoader.cpp @@ -728,8 +728,11 @@ aiMesh* ColladaLoader::CreateMesh( const ColladaParser& pParser, const Collada:: std::vector animMeshes; for (unsigned int i = 0; i < targetMeshes.size(); i++) { - aiAnimMesh *animMesh = aiCreateAnimMesh(targetMeshes.at(i)); - animMesh->mWeight = targetWeights[i]; + aiMesh* targetMesh = targetMeshes.at(i); + aiAnimMesh *animMesh = aiCreateAnimMesh(targetMesh); + float weight = targetWeights[i]; + animMesh->mWeight = weight == 0 ? 1.0f : weight; + animMesh->mName = targetMesh->mName; animMeshes.push_back(animMesh); } dstMesh->mMethod = (method == Collada::Relative) diff --git a/code/ConvertToLHProcess.cpp b/code/ConvertToLHProcess.cpp index 9cb45cc69..1831739ac 100644 --- a/code/ConvertToLHProcess.cpp +++ b/code/ConvertToLHProcess.cpp @@ -166,8 +166,9 @@ void MakeLeftHandedProcess::ProcessMesh( aiMesh* pMesh) { for( size_t a = 0; a < pMesh->mNumVertices; ++a) { pMesh->mVertices[a].z *= -1.0f; - if( pMesh->HasNormals()) + if (pMesh->HasNormals()) { pMesh->mNormals[a].z *= -1.0f; + } if( pMesh->HasTangentsAndBitangents()) { pMesh->mTangents[a].z *= -1.0f; @@ -175,6 +176,23 @@ void MakeLeftHandedProcess::ProcessMesh( aiMesh* pMesh) { } } + // mirror anim meshes positions, normals and stuff along the Z axis + for (size_t m = 0; m < pMesh->mNumAnimMeshes; ++m) + { + for (size_t a = 0; a < pMesh->mAnimMeshes[m]->mNumVertices; ++a) + { + pMesh->mAnimMeshes[m]->mVertices[a].z *= -1.0f; + if (pMesh->mAnimMeshes[m]->HasNormals()) { + pMesh->mAnimMeshes[m]->mNormals[a].z *= -1.0f; + } + if (pMesh->mAnimMeshes[m]->HasTangentsAndBitangents()) + { + pMesh->mAnimMeshes[m]->mTangents[a].z *= -1.0f; + pMesh->mAnimMeshes[m]->mBitangents[a].z *= -1.0f; + } + } + } + // mirror offset matrices of all bones for( size_t a = 0; a < pMesh->mNumBones; ++a) { @@ -346,8 +364,50 @@ void FlipWindingOrderProcess::ProcessMesh( aiMesh* pMesh) for( unsigned int a = 0; a < pMesh->mNumFaces; a++) { aiFace& face = pMesh->mFaces[a]; - for( unsigned int b = 0; b < face.mNumIndices / 2; b++) - std::swap( face.mIndices[b], face.mIndices[ face.mNumIndices - 1 - b]); + for (unsigned int b = 0; b < face.mNumIndices / 2; b++) { + std::swap(face.mIndices[b], face.mIndices[face.mNumIndices - 1 - b]); + } + } + + // invert the order of all components in this mesh anim meshes + for (unsigned int m = 0; m < pMesh->mNumAnimMeshes; m++) { + aiAnimMesh* animMesh = pMesh->mAnimMeshes[m]; + unsigned int numVertices = animMesh->mNumVertices; + if (animMesh->HasPositions()) { + for (unsigned int a = 0; a < numVertices; a++) + { + std::swap(animMesh->mVertices[a], animMesh->mVertices[numVertices - 1 - a]); + } + } + if (animMesh->HasNormals()) { + for (unsigned int a = 0; a < numVertices; a++) + { + std::swap(animMesh->mNormals[a], animMesh->mNormals[numVertices - 1 - a]); + } + } + for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; i++) { + if (animMesh->HasTextureCoords(i)) { + for (unsigned int a = 0; a < numVertices; a++) + { + std::swap(animMesh->mTextureCoords[i][a], animMesh->mTextureCoords[i][numVertices - 1 - a]); + } + } + } + if (animMesh->HasTangentsAndBitangents()) { + for (unsigned int a = 0; a < numVertices; a++) + { + std::swap(animMesh->mTangents[a], animMesh->mTangents[numVertices - 1 - a]); + std::swap(animMesh->mBitangents[a], animMesh->mBitangents[numVertices - 1 - a]); + } + } + for (unsigned int v = 0; v < AI_MAX_NUMBER_OF_COLOR_SETS; v++) { + if (animMesh->HasVertexColors(v)) { + for (unsigned int a = 0; a < numVertices; a++) + { + std::swap(animMesh->mColors[v][a], animMesh->mColors[v][numVertices - 1 - a]); + } + } + } } } diff --git a/code/DefaultIOSystem.cpp b/code/DefaultIOSystem.cpp index 58afe475c..67fd82f17 100644 --- a/code/DefaultIOSystem.cpp +++ b/code/DefaultIOSystem.cpp @@ -76,6 +76,7 @@ bool DefaultIOSystem::Exists( const char* pFile) const #ifdef _WIN32 wchar_t fileName16[PATHLIMIT]; +#ifndef WindowsStore bool isUnicode = IsTextUnicode(pFile, static_cast(strlen(pFile)), NULL) != 0; if (isUnicode) { @@ -85,12 +86,15 @@ bool DefaultIOSystem::Exists( const char* pFile) const return false; } } else { +#endif FILE* file = ::fopen(pFile, "rb"); if (!file) return false; ::fclose(file); +#ifndef WindowsStore } +#endif #else FILE* file = ::fopen( pFile, "rb"); if( !file) @@ -110,14 +114,18 @@ IOStream* DefaultIOSystem::Open( const char* strFile, const char* strMode) FILE* file; #ifdef _WIN32 wchar_t fileName16[PATHLIMIT]; +#ifndef WindowsStore bool isUnicode = IsTextUnicode(strFile, static_cast(strlen(strFile)), NULL) != 0; if (isUnicode) { MultiByteToWideChar(CP_UTF8, MB_PRECOMPOSED, strFile, -1, fileName16, PATHLIMIT); std::string mode8(strMode); file = ::_wfopen(fileName16, std::wstring(mode8.begin(), mode8.end()).c_str()); } else { +#endif file = ::fopen(strFile, strMode); +#ifndef WindowsStore } +#endif #else file = ::fopen(strFile, strMode); #endif @@ -158,6 +166,7 @@ inline static void MakeAbsolutePath (const char* in, char* _out) { ai_assert(in && _out); #if defined( _MSC_VER ) || defined( __MINGW32__ ) +#ifndef WindowsStore bool isUnicode = IsTextUnicode(in, static_cast(strlen(in)), NULL) != 0; if (isUnicode) { wchar_t out16[PATHLIMIT]; @@ -175,6 +184,7 @@ inline static void MakeAbsolutePath (const char* in, char* _out) } } else { +#endif char* ret = :: _fullpath(_out, in, PATHLIMIT); if (!ret) { // preserve the input path, maybe someone else is able to fix @@ -182,7 +192,9 @@ inline static void MakeAbsolutePath (const char* in, char* _out) ASSIMP_LOG_WARN_F("Invalid path: ", std::string(in)); strcpy(_out, in); } +#ifndef WindowsStore } +#endif #else // use realpath char* ret = realpath(in, _out); diff --git a/code/FBXAnimation.cpp b/code/FBXAnimation.cpp index 24ab9b14b..871d62578 100644 --- a/code/FBXAnimation.cpp +++ b/code/FBXAnimation.cpp @@ -105,8 +105,8 @@ AnimationCurveNode::AnimationCurveNode(uint64_t id, const Element& element, cons const Scope& sc = GetRequiredScope(element); // find target node - const char* whitelist[] = {"Model","NodeAttribute"}; - const std::vector& conns = doc.GetConnectionsBySourceSequenced(ID(),whitelist,2); + const char* whitelist[] = {"Model","NodeAttribute","Deformer"}; + const std::vector& conns = doc.GetConnectionsBySourceSequenced(ID(),whitelist,3); for(const Connection* con : conns) { diff --git a/code/FBXConverter.cpp b/code/FBXConverter.cpp index 7dd9f94b4..cd9ad0966 100644 --- a/code/FBXConverter.cpp +++ b/code/FBXConverter.cpp @@ -53,10 +53,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "FBXUtil.h" #include "FBXProperties.h" #include "FBXImporter.h" + #include #include +#include + #include #include #include @@ -65,3025 +68,3214 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include namespace Assimp { -namespace FBX { + namespace FBX { -using namespace Util; + using namespace Util; #define MAGIC_NODE_TAG "_$AssimpFbx$" #define CONVERT_FBX_TIME(time) static_cast(time) / 46186158000L -FBXConverter::FBXConverter( aiScene* out, const Document& doc ) -: defaultMaterialIndex() -, out( out ) -, doc( doc ) { - // animations need to be converted first since this will - // populate the node_anim_chain_bits map, which is needed - // to determine which nodes need to be generated. - ConvertAnimations(); - ConvertRootNode(); + FBXConverter::FBXConverter(aiScene* out, const Document& doc) + : defaultMaterialIndex() + , out(out) + , doc(doc) { + // animations need to be converted first since this will + // populate the node_anim_chain_bits map, which is needed + // to determine which nodes need to be generated. + ConvertAnimations(); + ConvertRootNode(); - if ( doc.Settings().readAllMaterials ) { - // unfortunately this means we have to evaluate all objects - for( const ObjectMap::value_type& v : doc.Objects() ) { + if (doc.Settings().readAllMaterials) { + // unfortunately this means we have to evaluate all objects + for (const ObjectMap::value_type& v : doc.Objects()) { - const Object* ob = v.second->Get(); - if ( !ob ) { - continue; + const Object* ob = v.second->Get(); + if (!ob) { + continue; + } + + const Material* mat = dynamic_cast(ob); + if (mat) { + + if (materials_converted.find(mat) == materials_converted.end()) { + ConvertMaterial(*mat, 0); + } + } + } } - const Material* mat = dynamic_cast( ob ); - if ( mat ) { + ConvertGlobalSettings(); + TransferDataToScene(); - if ( materials_converted.find( mat ) == materials_converted.end() ) { - ConvertMaterial( *mat, 0 ); - } + // if we didn't read any meshes set the AI_SCENE_FLAGS_INCOMPLETE + // to make sure the scene passes assimp's validation. FBX files + // need not contain geometry (i.e. camera animations, raw armatures). + if (out->mNumMeshes == 0) { + out->mFlags |= AI_SCENE_FLAGS_INCOMPLETE; } } - } - - ConvertGlobalSettings(); - TransferDataToScene(); - - // if we didn't read any meshes set the AI_SCENE_FLAGS_INCOMPLETE - // to make sure the scene passes assimp's validation. FBX files - // need not contain geometry (i.e. camera animations, raw armatures). - if ( out->mNumMeshes == 0 ) { - out->mFlags |= AI_SCENE_FLAGS_INCOMPLETE; - } -} -FBXConverter::~FBXConverter() { - std::for_each( meshes.begin(), meshes.end(), Util::delete_fun() ); - std::for_each( materials.begin(), materials.end(), Util::delete_fun() ); - std::for_each( animations.begin(), animations.end(), Util::delete_fun() ); - std::for_each( lights.begin(), lights.end(), Util::delete_fun() ); - std::for_each( cameras.begin(), cameras.end(), Util::delete_fun() ); - std::for_each( textures.begin(), textures.end(), Util::delete_fun() ); -} + FBXConverter::~FBXConverter() { + std::for_each(meshes.begin(), meshes.end(), Util::delete_fun()); + std::for_each(materials.begin(), materials.end(), Util::delete_fun()); + std::for_each(animations.begin(), animations.end(), Util::delete_fun()); + std::for_each(lights.begin(), lights.end(), Util::delete_fun()); + std::for_each(cameras.begin(), cameras.end(), Util::delete_fun()); + std::for_each(textures.begin(), textures.end(), Util::delete_fun()); + } -void FBXConverter::ConvertRootNode() { - out->mRootNode = new aiNode(); - out->mRootNode->mName.Set( "RootNode" ); + void FBXConverter::ConvertRootNode() { + out->mRootNode = new aiNode(); + out->mRootNode->mName.Set("RootNode"); - // root has ID 0 - ConvertNodes( 0L, *out->mRootNode ); -} + // root has ID 0 + ConvertNodes(0L, *out->mRootNode); + } -void FBXConverter::ConvertNodes( uint64_t id, aiNode& parent, const aiMatrix4x4& parent_transform ) { - const std::vector& conns = doc.GetConnectionsByDestinationSequenced( id, "Model" ); + void FBXConverter::ConvertNodes(uint64_t id, aiNode& parent, const aiMatrix4x4& parent_transform) { + const std::vector& conns = doc.GetConnectionsByDestinationSequenced(id, "Model"); - std::vector nodes; - nodes.reserve( conns.size() ); + std::vector nodes; + nodes.reserve(conns.size()); - std::vector nodes_chain; - std::vector post_nodes_chain; + std::vector nodes_chain; + std::vector post_nodes_chain; - try { - for( const Connection* con : conns ) { + try { + for (const Connection* con : conns) { - // ignore object-property links - if ( con->PropertyName().length() ) { - continue; - } - - const Object* const object = con->SourceObject(); - if ( nullptr == object ) { - FBXImporter::LogWarn( "failed to convert source object for Model link" ); - continue; - } - - const Model* const model = dynamic_cast( object ); - - if ( nullptr != model ) { - nodes_chain.clear(); - post_nodes_chain.clear(); - - aiMatrix4x4 new_abs_transform = parent_transform; - - // even though there is only a single input node, the design of - // assimp (or rather: the complicated transformation chain that - // is employed by fbx) means that we may need multiple aiNode's - // to represent a fbx node's transformation. - GenerateTransformationNodeChain( *model, nodes_chain, post_nodes_chain ); - - ai_assert( nodes_chain.size() ); - - std::string original_name = FixNodeName( model->Name() ); - - // check if any of the nodes in the chain has the name the fbx node - // is supposed to have. If there is none, add another node to - // preserve the name - people might have scripts etc. that rely - // on specific node names. - aiNode* name_carrier = NULL; - for( aiNode* prenode : nodes_chain ) { - if ( !strcmp( prenode->mName.C_Str(), original_name.c_str() ) ) { - name_carrier = prenode; - break; - } - } - - if ( !name_carrier ) { - std::string old_original_name = original_name; - GetUniqueName(old_original_name, original_name); - nodes_chain.push_back( new aiNode( original_name ) ); - } else { - original_name = nodes_chain.back()->mName.C_Str(); - } - - //setup metadata on newest node - SetupNodeMetadata( *model, *nodes_chain.back() ); - - // link all nodes in a row - aiNode* last_parent = &parent; - for( aiNode* prenode : nodes_chain ) { - ai_assert( prenode ); - - if ( last_parent != &parent ) { - last_parent->mNumChildren = 1; - last_parent->mChildren = new aiNode*[ 1 ]; - last_parent->mChildren[ 0 ] = prenode; + // ignore object-property links + if (con->PropertyName().length()) { + continue; } - prenode->mParent = last_parent; - last_parent = prenode; + const Object* const object = con->SourceObject(); + if (nullptr == object) { + FBXImporter::LogWarn("failed to convert source object for Model link"); + continue; + } - new_abs_transform *= prenode->mTransformation; - } + const Model* const model = dynamic_cast(object); - // attach geometry - ConvertModel( *model, *nodes_chain.back(), new_abs_transform ); + if (nullptr != model) { + nodes_chain.clear(); + post_nodes_chain.clear(); - // check if there will be any child nodes - const std::vector& child_conns - = doc.GetConnectionsByDestinationSequenced( model->ID(), "Model" ); + aiMatrix4x4 new_abs_transform = parent_transform; - // if so, link the geometric transform inverse nodes - // before we attach any child nodes - if (child_conns.size()) { - for( aiNode* postnode : post_nodes_chain ) { - ai_assert( postnode ); + // even though there is only a single input node, the design of + // assimp (or rather: the complicated transformation chain that + // is employed by fbx) means that we may need multiple aiNode's + // to represent a fbx node's transformation. + GenerateTransformationNodeChain(*model, nodes_chain, post_nodes_chain); - if ( last_parent != &parent ) { - last_parent->mNumChildren = 1; - last_parent->mChildren = new aiNode*[ 1 ]; - last_parent->mChildren[ 0 ] = postnode; + ai_assert(nodes_chain.size()); + + std::string original_name = FixNodeName(model->Name()); + + // check if any of the nodes in the chain has the name the fbx node + // is supposed to have. If there is none, add another node to + // preserve the name - people might have scripts etc. that rely + // on specific node names. + aiNode* name_carrier = NULL; + for (aiNode* prenode : nodes_chain) { + if (!strcmp(prenode->mName.C_Str(), original_name.c_str())) { + name_carrier = prenode; + break; + } } - postnode->mParent = last_parent; - last_parent = postnode; - - new_abs_transform *= postnode->mTransformation; - } - } else { - // free the nodes we allocated as we don't need them - Util::delete_fun deleter; - std::for_each( - post_nodes_chain.begin(), - post_nodes_chain.end(), - deleter - ); - } - - // attach sub-nodes (if any) - ConvertNodes( model->ID(), *last_parent, new_abs_transform ); - - if ( doc.Settings().readLights ) { - ConvertLights( *model, original_name ); - } - - if ( doc.Settings().readCameras ) { - ConvertCameras( *model, original_name ); - } - - nodes.push_back( nodes_chain.front() ); - nodes_chain.clear(); - } - } - - if ( nodes.size() ) { - parent.mChildren = new aiNode*[ nodes.size() ](); - parent.mNumChildren = static_cast( nodes.size() ); - - std::swap_ranges( nodes.begin(), nodes.end(), parent.mChildren ); - } - } - catch ( std::exception& ) { - Util::delete_fun deleter; - std::for_each( nodes.begin(), nodes.end(), deleter ); - std::for_each( nodes_chain.begin(), nodes_chain.end(), deleter ); - std::for_each( post_nodes_chain.begin(), post_nodes_chain.end(), deleter ); - } -} - - -void FBXConverter::ConvertLights( const Model& model, const std::string &orig_name ) { - const std::vector& node_attrs = model.GetAttributes(); - for( const NodeAttribute* attr : node_attrs ) { - const Light* const light = dynamic_cast( attr ); - if ( light ) { - ConvertLight( *light, orig_name ); - } - } -} - -void FBXConverter::ConvertCameras( const Model& model, const std::string &orig_name ) { - const std::vector& node_attrs = model.GetAttributes(); - for( const NodeAttribute* attr : node_attrs ) { - const Camera* const cam = dynamic_cast( attr ); - if ( cam ) { - ConvertCamera( *cam, orig_name ); - } - } -} - -void FBXConverter::ConvertLight( const Light& light, const std::string &orig_name ) { - lights.push_back( new aiLight() ); - aiLight* const out_light = lights.back(); - - out_light->mName.Set( orig_name ); - - const float intensity = light.Intensity() / 100.0f; - const aiVector3D& col = light.Color(); - - out_light->mColorDiffuse = aiColor3D( col.x, col.y, col.z ); - out_light->mColorDiffuse.r *= intensity; - out_light->mColorDiffuse.g *= intensity; - out_light->mColorDiffuse.b *= intensity; - - out_light->mColorSpecular = out_light->mColorDiffuse; - - //lights are defined along negative y direction - out_light->mPosition = aiVector3D(0.0f); - out_light->mDirection = aiVector3D(0.0f, -1.0f, 0.0f); - out_light->mUp = aiVector3D(0.0f, 0.0f, -1.0f); - - switch ( light.LightType() ) - { - case Light::Type_Point: - out_light->mType = aiLightSource_POINT; - break; - - case Light::Type_Directional: - out_light->mType = aiLightSource_DIRECTIONAL; - break; - - case Light::Type_Spot: - out_light->mType = aiLightSource_SPOT; - out_light->mAngleOuterCone = AI_DEG_TO_RAD( light.OuterAngle() ); - out_light->mAngleInnerCone = AI_DEG_TO_RAD( light.InnerAngle() ); - break; - - case Light::Type_Area: - FBXImporter::LogWarn( "cannot represent area light, set to UNDEFINED" ); - out_light->mType = aiLightSource_UNDEFINED; - break; - - case Light::Type_Volume: - FBXImporter::LogWarn( "cannot represent volume light, set to UNDEFINED" ); - out_light->mType = aiLightSource_UNDEFINED; - break; - default: - ai_assert( false ); - } - - float decay = light.DecayStart(); - switch ( light.DecayType() ) - { - case Light::Decay_None: - out_light->mAttenuationConstant = decay; - out_light->mAttenuationLinear = 0.0f; - out_light->mAttenuationQuadratic = 0.0f; - break; - case Light::Decay_Linear: - out_light->mAttenuationConstant = 0.0f; - out_light->mAttenuationLinear = 2.0f / decay; - out_light->mAttenuationQuadratic = 0.0f; - break; - case Light::Decay_Quadratic: - out_light->mAttenuationConstant = 0.0f; - out_light->mAttenuationLinear = 0.0f; - out_light->mAttenuationQuadratic = 2.0f / (decay * decay); - break; - case Light::Decay_Cubic: - FBXImporter::LogWarn( "cannot represent cubic attenuation, set to Quadratic" ); - out_light->mAttenuationQuadratic = 1.0f; - break; - default: - ai_assert( false ); - } -} - -void FBXConverter::ConvertCamera( const Camera& cam, const std::string &orig_name ) -{ - cameras.push_back( new aiCamera() ); - aiCamera* const out_camera = cameras.back(); - - out_camera->mName.Set( orig_name ); - - out_camera->mAspect = cam.AspectWidth() / cam.AspectHeight(); - - //cameras are defined along positive x direction - out_camera->mPosition = cam.Position(); - out_camera->mLookAt = ( cam.InterestPosition() - out_camera->mPosition ).Normalize(); - out_camera->mUp = cam.UpVector(); - - out_camera->mHorizontalFOV = AI_DEG_TO_RAD( cam.FieldOfView() ); - out_camera->mClipPlaneNear = cam.NearPlane(); - out_camera->mClipPlaneFar = cam.FarPlane(); -} - -void FBXConverter::GetUniqueName( const std::string &name, std::string &uniqueName ) -{ - int i = 0; - uniqueName = name; - while (mNodeNames.find(uniqueName) != mNodeNames.end()) - { - ++i; - std::stringstream ext; - ext << name << std::setfill('0') << std::setw(3) << i; - uniqueName = ext.str(); - } - mNodeNames.insert(uniqueName); -} - - -const char* FBXConverter::NameTransformationComp( TransformationComp comp ) { - switch ( comp ) { - case TransformationComp_Translation: - return "Translation"; - case TransformationComp_RotationOffset: - return "RotationOffset"; - case TransformationComp_RotationPivot: - return "RotationPivot"; - case TransformationComp_PreRotation: - return "PreRotation"; - case TransformationComp_Rotation: - return "Rotation"; - case TransformationComp_PostRotation: - return "PostRotation"; - case TransformationComp_RotationPivotInverse: - return "RotationPivotInverse"; - case TransformationComp_ScalingOffset: - return "ScalingOffset"; - case TransformationComp_ScalingPivot: - return "ScalingPivot"; - case TransformationComp_Scaling: - return "Scaling"; - case TransformationComp_ScalingPivotInverse: - return "ScalingPivotInverse"; - case TransformationComp_GeometricScaling: - return "GeometricScaling"; - case TransformationComp_GeometricRotation: - return "GeometricRotation"; - case TransformationComp_GeometricTranslation: - return "GeometricTranslation"; - case TransformationComp_GeometricScalingInverse: - return "GeometricScalingInverse"; - case TransformationComp_GeometricRotationInverse: - return "GeometricRotationInverse"; - case TransformationComp_GeometricTranslationInverse: - return "GeometricTranslationInverse"; - case TransformationComp_MAXIMUM: // this is to silence compiler warnings - default: - break; - } - - ai_assert( false ); - - return nullptr; -} - -const char* FBXConverter::NameTransformationCompProperty( TransformationComp comp ) { - switch ( comp ) { - case TransformationComp_Translation: - return "Lcl Translation"; - case TransformationComp_RotationOffset: - return "RotationOffset"; - case TransformationComp_RotationPivot: - return "RotationPivot"; - case TransformationComp_PreRotation: - return "PreRotation"; - case TransformationComp_Rotation: - return "Lcl Rotation"; - case TransformationComp_PostRotation: - return "PostRotation"; - case TransformationComp_RotationPivotInverse: - return "RotationPivotInverse"; - case TransformationComp_ScalingOffset: - return "ScalingOffset"; - case TransformationComp_ScalingPivot: - return "ScalingPivot"; - case TransformationComp_Scaling: - return "Lcl Scaling"; - case TransformationComp_ScalingPivotInverse: - return "ScalingPivotInverse"; - case TransformationComp_GeometricScaling: - return "GeometricScaling"; - case TransformationComp_GeometricRotation: - return "GeometricRotation"; - case TransformationComp_GeometricTranslation: - return "GeometricTranslation"; - case TransformationComp_GeometricScalingInverse: - return "GeometricScalingInverse"; - case TransformationComp_GeometricRotationInverse: - return "GeometricRotationInverse"; - case TransformationComp_GeometricTranslationInverse: - return "GeometricTranslationInverse"; - case TransformationComp_MAXIMUM: // this is to silence compiler warnings - break; - } - - ai_assert( false ); - - return nullptr; -} - -aiVector3D FBXConverter::TransformationCompDefaultValue( TransformationComp comp ) -{ - // XXX a neat way to solve the never-ending special cases for scaling - // would be to do everything in log space! - return comp == TransformationComp_Scaling ? aiVector3D( 1.f, 1.f, 1.f ) : aiVector3D(); -} - -void FBXConverter::GetRotationMatrix( Model::RotOrder mode, const aiVector3D& rotation, aiMatrix4x4& out ) -{ - if ( mode == Model::RotOrder_SphericXYZ ) { - FBXImporter::LogError( "Unsupported RotationMode: SphericXYZ" ); - out = aiMatrix4x4(); - return; - } - - const float angle_epsilon = 1e-6f; - - out = aiMatrix4x4(); - - bool is_id[ 3 ] = { true, true, true }; - - aiMatrix4x4 temp[ 3 ]; - if ( std::fabs( rotation.z ) > angle_epsilon ) { - aiMatrix4x4::RotationZ( AI_DEG_TO_RAD( rotation.z ), temp[ 2 ] ); - is_id[ 2 ] = false; - } - if ( std::fabs( rotation.y ) > angle_epsilon ) { - aiMatrix4x4::RotationY( AI_DEG_TO_RAD( rotation.y ), temp[ 1 ] ); - is_id[ 1 ] = false; - } - if ( std::fabs( rotation.x ) > angle_epsilon ) { - aiMatrix4x4::RotationX( AI_DEG_TO_RAD( rotation.x ), temp[ 0 ] ); - is_id[ 0 ] = false; - } - - int order[ 3 ] = { -1, -1, -1 }; - - // note: rotation order is inverted since we're left multiplying as is usual in assimp - switch ( mode ) - { - case Model::RotOrder_EulerXYZ: - order[ 0 ] = 2; - order[ 1 ] = 1; - order[ 2 ] = 0; - break; - - case Model::RotOrder_EulerXZY: - order[ 0 ] = 1; - order[ 1 ] = 2; - order[ 2 ] = 0; - break; - - case Model::RotOrder_EulerYZX: - order[ 0 ] = 0; - order[ 1 ] = 2; - order[ 2 ] = 1; - break; - - case Model::RotOrder_EulerYXZ: - order[ 0 ] = 2; - order[ 1 ] = 0; - order[ 2 ] = 1; - break; - - case Model::RotOrder_EulerZXY: - order[ 0 ] = 1; - order[ 1 ] = 0; - order[ 2 ] = 2; - break; - - case Model::RotOrder_EulerZYX: - order[ 0 ] = 0; - order[ 1 ] = 1; - order[ 2 ] = 2; - break; - - default: - ai_assert( false ); - break; - } - - ai_assert( order[ 0 ] >= 0 ); - ai_assert( order[ 0 ] <= 2 ); - ai_assert( order[ 1 ] >= 0 ); - ai_assert( order[ 1 ] <= 2 ); - ai_assert( order[ 2 ] >= 0 ); - ai_assert( order[ 2 ] <= 2 ); - - if ( !is_id[ order[ 0 ] ] ) { - out = temp[ order[ 0 ] ]; - } - - if ( !is_id[ order[ 1 ] ] ) { - out = out * temp[ order[ 1 ] ]; - } - - if ( !is_id[ order[ 2 ] ] ) { - out = out * temp[ order[ 2 ] ]; - } -} - -bool FBXConverter::NeedsComplexTransformationChain( const Model& model ) -{ - const PropertyTable& props = model.Props(); - bool ok; - - const float zero_epsilon = 1e-6f; - const aiVector3D all_ones(1.0f, 1.0f, 1.0f); - for ( size_t i = 0; i < TransformationComp_MAXIMUM; ++i ) { - const TransformationComp comp = static_cast< TransformationComp >( i ); - - if ( comp == TransformationComp_Rotation || comp == TransformationComp_Scaling || comp == TransformationComp_Translation ) { - continue; - } - - bool scale_compare = ( comp == TransformationComp_GeometricScaling || comp == TransformationComp_Scaling ); - - const aiVector3D& v = PropertyGet( props, NameTransformationCompProperty( comp ), ok ); - if ( ok && scale_compare ) { - if ( (v - all_ones).SquareLength() > zero_epsilon ) { - return true; - } - } else if ( ok ) { - if ( v.SquareLength() > zero_epsilon ) { - return true; - } - } - } - - return false; -} - -std::string FBXConverter::NameTransformationChainNode( const std::string& name, TransformationComp comp ) -{ - return name + std::string( MAGIC_NODE_TAG ) + "_" + NameTransformationComp( comp ); -} - -void FBXConverter::GenerateTransformationNodeChain( const Model& model, std::vector& output_nodes, - std::vector& post_output_nodes ) { - const PropertyTable& props = model.Props(); - const Model::RotOrder rot = model.RotationOrder(); - - bool ok; - - aiMatrix4x4 chain[ TransformationComp_MAXIMUM ]; - std::fill_n( chain, static_cast( TransformationComp_MAXIMUM ), aiMatrix4x4() ); - - // generate transformation matrices for all the different transformation components - const float zero_epsilon = 1e-6f; - const aiVector3D all_ones(1.0f, 1.0f, 1.0f); - bool is_complex = false; - - const aiVector3D& PreRotation = PropertyGet( props, "PreRotation", ok ); - if ( ok && PreRotation.SquareLength() > zero_epsilon ) { - is_complex = true; - - GetRotationMatrix( Model::RotOrder::RotOrder_EulerXYZ, PreRotation, chain[ TransformationComp_PreRotation ] ); - } - - const aiVector3D& PostRotation = PropertyGet( props, "PostRotation", ok ); - if ( ok && PostRotation.SquareLength() > zero_epsilon ) { - is_complex = true; - - GetRotationMatrix( Model::RotOrder::RotOrder_EulerXYZ, PostRotation, chain[ TransformationComp_PostRotation ] ); - } - - const aiVector3D& RotationPivot = PropertyGet( props, "RotationPivot", ok ); - if ( ok && RotationPivot.SquareLength() > zero_epsilon ) { - is_complex = true; - - aiMatrix4x4::Translation( RotationPivot, chain[ TransformationComp_RotationPivot ] ); - aiMatrix4x4::Translation( -RotationPivot, chain[ TransformationComp_RotationPivotInverse ] ); - } - - const aiVector3D& RotationOffset = PropertyGet( props, "RotationOffset", ok ); - if ( ok && RotationOffset.SquareLength() > zero_epsilon ) { - is_complex = true; - - aiMatrix4x4::Translation( RotationOffset, chain[ TransformationComp_RotationOffset ] ); - } - - const aiVector3D& ScalingOffset = PropertyGet( props, "ScalingOffset", ok ); - if ( ok && ScalingOffset.SquareLength() > zero_epsilon ) { - is_complex = true; - - aiMatrix4x4::Translation( ScalingOffset, chain[ TransformationComp_ScalingOffset ] ); - } - - const aiVector3D& ScalingPivot = PropertyGet( props, "ScalingPivot", ok ); - if ( ok && ScalingPivot.SquareLength() > zero_epsilon ) { - is_complex = true; - - aiMatrix4x4::Translation( ScalingPivot, chain[ TransformationComp_ScalingPivot ] ); - aiMatrix4x4::Translation( -ScalingPivot, chain[ TransformationComp_ScalingPivotInverse ] ); - } - - const aiVector3D& Translation = PropertyGet( props, "Lcl Translation", ok ); - if ( ok && Translation.SquareLength() > zero_epsilon ) { - aiMatrix4x4::Translation( Translation, chain[ TransformationComp_Translation ] ); - } - - const aiVector3D& Scaling = PropertyGet( props, "Lcl Scaling", ok ); - if ( ok && (Scaling - all_ones).SquareLength() > zero_epsilon ) { - aiMatrix4x4::Scaling( Scaling, chain[ TransformationComp_Scaling ] ); - } - - const aiVector3D& Rotation = PropertyGet( props, "Lcl Rotation", ok ); - if ( ok && Rotation.SquareLength() > zero_epsilon ) { - GetRotationMatrix( rot, Rotation, chain[ TransformationComp_Rotation ] ); - } - - const aiVector3D& GeometricScaling = PropertyGet( props, "GeometricScaling", ok ); - if ( ok && (GeometricScaling - all_ones).SquareLength() > zero_epsilon ) { - is_complex = true; - aiMatrix4x4::Scaling( GeometricScaling, chain[ TransformationComp_GeometricScaling ] ); - aiVector3D GeometricScalingInverse = GeometricScaling; - bool canscale = true; - for (unsigned int i = 0; i < 3; ++i) { - if ( std::fabs( GeometricScalingInverse[i] ) > zero_epsilon ) { - GeometricScalingInverse[i] = 1.0f / GeometricScaling[i]; - } else { - FBXImporter::LogError( "cannot invert geometric scaling matrix with a 0.0 scale component" ); - canscale = false; - break; - } - } - if (canscale) { - aiMatrix4x4::Scaling( GeometricScalingInverse, chain[ TransformationComp_GeometricScalingInverse ] ); - } - } - - const aiVector3D& GeometricRotation = PropertyGet( props, "GeometricRotation", ok ); - if ( ok && GeometricRotation.SquareLength() > zero_epsilon ) { - is_complex = true; - GetRotationMatrix( rot, GeometricRotation, chain[ TransformationComp_GeometricRotation ] ); - GetRotationMatrix( rot, GeometricRotation, chain[ TransformationComp_GeometricRotationInverse ] ); - chain[ TransformationComp_GeometricRotationInverse ].Inverse(); - } - - const aiVector3D& GeometricTranslation = PropertyGet( props, "GeometricTranslation", ok ); - if ( ok && GeometricTranslation.SquareLength() > zero_epsilon ) { - is_complex = true; - aiMatrix4x4::Translation( GeometricTranslation, chain[ TransformationComp_GeometricTranslation ] ); - aiMatrix4x4::Translation( -GeometricTranslation, chain[ TransformationComp_GeometricTranslationInverse ] ); - } - - // is_complex needs to be consistent with NeedsComplexTransformationChain() - // or the interplay between this code and the animation converter would - // not be guaranteed. - ai_assert( NeedsComplexTransformationChain( model ) == is_complex ); - - std::string name = FixNodeName( model.Name() ); - - // now, if we have more than just Translation, Scaling and Rotation, - // we need to generate a full node chain to accommodate for assimp's - // lack to express pivots and offsets. - if ( is_complex && doc.Settings().preservePivots ) { - FBXImporter::LogInfo( "generating full transformation chain for node: " + name ); - - // query the anim_chain_bits dictionary to find out which chain elements - // have associated node animation channels. These can not be dropped - // even if they have identity transform in bind pose. - NodeAnimBitMap::const_iterator it = node_anim_chain_bits.find( name ); - const unsigned int anim_chain_bitmask = ( it == node_anim_chain_bits.end() ? 0 : ( *it ).second ); - - unsigned int bit = 0x1; - for ( size_t i = 0; i < TransformationComp_MAXIMUM; ++i, bit <<= 1 ) { - const TransformationComp comp = static_cast( i ); - - if ( chain[ i ].IsIdentity() && ( anim_chain_bitmask & bit ) == 0 ) { - continue; - } - - if ( comp == TransformationComp_PostRotation ) { - chain[ i ] = chain[ i ].Inverse(); - } - - aiNode* nd = new aiNode(); - nd->mName.Set( NameTransformationChainNode( name, comp ) ); - nd->mTransformation = chain[ i ]; - - // geometric inverses go in a post-node chain - if ( comp == TransformationComp_GeometricScalingInverse || - comp == TransformationComp_GeometricRotationInverse || - comp == TransformationComp_GeometricTranslationInverse - ) { - post_output_nodes.push_back( nd ); - } else { - output_nodes.push_back( nd ); - } - } - - ai_assert( output_nodes.size() ); - return; - } - - // else, we can just multiply the matrices together - aiNode* nd = new aiNode(); - output_nodes.push_back( nd ); - std::string uniqueName; - GetUniqueName( name, uniqueName ); - - nd->mName.Set( uniqueName ); - - for (const auto &transform : chain) { - nd->mTransformation = nd->mTransformation * transform; - } -} - -void FBXConverter::SetupNodeMetadata( const Model& model, aiNode& nd ) -{ - const PropertyTable& props = model.Props(); - DirectPropertyMap unparsedProperties = props.GetUnparsedProperties(); - - // create metadata on node - const std::size_t numStaticMetaData = 2; - aiMetadata* data = aiMetadata::Alloc( static_cast(unparsedProperties.size() + numStaticMetaData) ); - nd.mMetaData = data; - int index = 0; - - // find user defined properties (3ds Max) - data->Set( index++, "UserProperties", aiString( PropertyGet( props, "UDP3DSMAX", "" ) ) ); - // preserve the info that a node was marked as Null node in the original file. - data->Set( index++, "IsNull", model.IsNull() ? true : false ); - - // add unparsed properties to the node's metadata - for( const DirectPropertyMap::value_type& prop : unparsedProperties ) { - // Interpret the property as a concrete type - if ( const TypedProperty* interpreted = prop.second->As >() ) { - data->Set( index++, prop.first, interpreted->Value() ); - } else if ( const TypedProperty* interpreted = prop.second->As >() ) { - data->Set( index++, prop.first, interpreted->Value() ); - } else if ( const TypedProperty* interpreted = prop.second->As >() ) { - data->Set( index++, prop.first, interpreted->Value() ); - } else if ( const TypedProperty* interpreted = prop.second->As >() ) { - data->Set( index++, prop.first, interpreted->Value() ); - } else if ( const TypedProperty* interpreted = prop.second->As >() ) { - data->Set( index++, prop.first, aiString( interpreted->Value() ) ); - } else if ( const TypedProperty* interpreted = prop.second->As >() ) { - data->Set( index++, prop.first, interpreted->Value() ); - } else { - ai_assert( false ); - } - } -} - -void FBXConverter::ConvertModel( const Model& model, aiNode& nd, const aiMatrix4x4& node_global_transform ) -{ - const std::vector& geos = model.GetGeometry(); - - std::vector meshes; - meshes.reserve( geos.size() ); - - for( const Geometry* geo : geos ) { - - const MeshGeometry* const mesh = dynamic_cast< const MeshGeometry* >( geo ); - if ( mesh ) { - const std::vector& indices = ConvertMesh( *mesh, model, node_global_transform, nd); - std::copy( indices.begin(), indices.end(), std::back_inserter( meshes ) ); - } - else { - FBXImporter::LogWarn( "ignoring unrecognized geometry: " + geo->Name() ); - } - } - - if ( meshes.size() ) { - nd.mMeshes = new unsigned int[ meshes.size() ](); - nd.mNumMeshes = static_cast< unsigned int >( meshes.size() ); - - std::swap_ranges( meshes.begin(), meshes.end(), nd.mMeshes ); - } -} - -std::vector FBXConverter::ConvertMesh( const MeshGeometry& mesh, const Model& model, - const aiMatrix4x4& node_global_transform, aiNode& nd) -{ - std::vector temp; - - MeshMap::const_iterator it = meshes_converted.find( &mesh ); - if ( it != meshes_converted.end() ) { - std::copy( ( *it ).second.begin(), ( *it ).second.end(), std::back_inserter( temp ) ); - return temp; - } - - const std::vector& vertices = mesh.GetVertices(); - const std::vector& faces = mesh.GetFaceIndexCounts(); - if ( vertices.empty() || faces.empty() ) { - FBXImporter::LogWarn( "ignoring empty geometry: " + mesh.Name() ); - return temp; - } - - // one material per mesh maps easily to aiMesh. Multiple material - // meshes need to be split. - const MatIndexArray& mindices = mesh.GetMaterialIndices(); - if ( doc.Settings().readMaterials && !mindices.empty() ) { - const MatIndexArray::value_type base = mindices[ 0 ]; - for( MatIndexArray::value_type index : mindices ) { - if ( index != base ) { - return ConvertMeshMultiMaterial( mesh, model, node_global_transform, nd); - } - } - } - - // faster code-path, just copy the data - temp.push_back( ConvertMeshSingleMaterial( mesh, model, node_global_transform, nd) ); - return temp; -} - -aiMesh* FBXConverter::SetupEmptyMesh( const MeshGeometry& mesh, aiNode& nd) -{ - aiMesh* const out_mesh = new aiMesh(); - meshes.push_back( out_mesh ); - meshes_converted[ &mesh ].push_back( static_cast( meshes.size() - 1 ) ); - - // set name - std::string name = mesh.Name(); - if ( name.substr( 0, 10 ) == "Geometry::" ) { - name = name.substr( 10 ); - } - - if ( name.length() ) { - out_mesh->mName.Set( name ); - } - else - { - out_mesh->mName = nd.mName; - } - - return out_mesh; -} - -unsigned int FBXConverter::ConvertMeshSingleMaterial( const MeshGeometry& mesh, const Model& model, - const aiMatrix4x4& node_global_transform, aiNode& nd) -{ - const MatIndexArray& mindices = mesh.GetMaterialIndices(); - aiMesh* const out_mesh = SetupEmptyMesh(mesh, nd); - - const std::vector& vertices = mesh.GetVertices(); - const std::vector& faces = mesh.GetFaceIndexCounts(); - - // copy vertices - out_mesh->mNumVertices = static_cast( vertices.size() ); - out_mesh->mVertices = new aiVector3D[ vertices.size() ]; - std::copy( vertices.begin(), vertices.end(), out_mesh->mVertices ); - - // generate dummy faces - out_mesh->mNumFaces = static_cast( faces.size() ); - aiFace* fac = out_mesh->mFaces = new aiFace[ faces.size() ](); - - unsigned int cursor = 0; - for( unsigned int pcount : faces ) { - aiFace& f = *fac++; - f.mNumIndices = pcount; - f.mIndices = new unsigned int[ pcount ]; - switch ( pcount ) - { - case 1: - out_mesh->mPrimitiveTypes |= aiPrimitiveType_POINT; - break; - case 2: - out_mesh->mPrimitiveTypes |= aiPrimitiveType_LINE; - break; - case 3: - out_mesh->mPrimitiveTypes |= aiPrimitiveType_TRIANGLE; - break; - default: - out_mesh->mPrimitiveTypes |= aiPrimitiveType_POLYGON; - break; - } - for ( unsigned int i = 0; i < pcount; ++i ) { - f.mIndices[ i ] = cursor++; - } - } - - // copy normals - const std::vector& normals = mesh.GetNormals(); - if ( normals.size() ) { - ai_assert( normals.size() == vertices.size() ); - - out_mesh->mNormals = new aiVector3D[ vertices.size() ]; - std::copy( normals.begin(), normals.end(), out_mesh->mNormals ); - } - - // copy tangents - assimp requires both tangents and bitangents (binormals) - // to be present, or neither of them. Compute binormals from normals - // and tangents if needed. - const std::vector& tangents = mesh.GetTangents(); - const std::vector* binormals = &mesh.GetBinormals(); - - if ( tangents.size() ) { - std::vector tempBinormals; - if ( !binormals->size() ) { - if ( normals.size() ) { - tempBinormals.resize( normals.size() ); - for ( unsigned int i = 0; i < tangents.size(); ++i ) { - tempBinormals[ i ] = normals[ i ] ^ tangents[ i ]; - } - - binormals = &tempBinormals; - } - else { - binormals = NULL; - } - } - - if ( binormals ) { - ai_assert( tangents.size() == vertices.size() ); - ai_assert( binormals->size() == vertices.size() ); - - out_mesh->mTangents = new aiVector3D[ vertices.size() ]; - std::copy( tangents.begin(), tangents.end(), out_mesh->mTangents ); - - out_mesh->mBitangents = new aiVector3D[ vertices.size() ]; - std::copy( binormals->begin(), binormals->end(), out_mesh->mBitangents ); - } - } - - // copy texture coords - for ( unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i ) { - const std::vector& uvs = mesh.GetTextureCoords( i ); - if ( uvs.empty() ) { - break; - } - - aiVector3D* out_uv = out_mesh->mTextureCoords[ i ] = new aiVector3D[ vertices.size() ]; - for( const aiVector2D& v : uvs ) { - *out_uv++ = aiVector3D( v.x, v.y, 0.0f ); - } - - out_mesh->mNumUVComponents[ i ] = 2; - } - - // copy vertex colors - for ( unsigned int i = 0; i < AI_MAX_NUMBER_OF_COLOR_SETS; ++i ) { - const std::vector& colors = mesh.GetVertexColors( i ); - if ( colors.empty() ) { - break; - } - - out_mesh->mColors[ i ] = new aiColor4D[ vertices.size() ]; - std::copy( colors.begin(), colors.end(), out_mesh->mColors[ i ] ); - } - - if ( !doc.Settings().readMaterials || mindices.empty() ) { - FBXImporter::LogError( "no material assigned to mesh, setting default material" ); - out_mesh->mMaterialIndex = GetDefaultMaterial(); - } - else { - ConvertMaterialForMesh( out_mesh, model, mesh, mindices[ 0 ] ); - } - - if ( doc.Settings().readWeights && mesh.DeformerSkin() != NULL ) { - ConvertWeights( out_mesh, model, mesh, node_global_transform, NO_MATERIAL_SEPARATION ); - } - - return static_cast( meshes.size() - 1 ); -} - -std::vector FBXConverter::ConvertMeshMultiMaterial( const MeshGeometry& mesh, const Model& model, - const aiMatrix4x4& node_global_transform, aiNode& nd) -{ - const MatIndexArray& mindices = mesh.GetMaterialIndices(); - ai_assert( mindices.size() ); - - std::set had; - std::vector indices; - - for( MatIndexArray::value_type index : mindices ) { - if ( had.find( index ) == had.end() ) { - - indices.push_back( ConvertMeshMultiMaterial( mesh, model, index, node_global_transform, nd) ); - had.insert( index ); - } - } - - return indices; -} - -unsigned int FBXConverter::ConvertMeshMultiMaterial( const MeshGeometry& mesh, const Model& model, - MatIndexArray::value_type index, - const aiMatrix4x4& node_global_transform, - aiNode& nd) -{ - aiMesh* const out_mesh = SetupEmptyMesh(mesh, nd); - - const MatIndexArray& mindices = mesh.GetMaterialIndices(); - const std::vector& vertices = mesh.GetVertices(); - const std::vector& faces = mesh.GetFaceIndexCounts(); - - const bool process_weights = doc.Settings().readWeights && mesh.DeformerSkin() != NULL; - - unsigned int count_faces = 0; - unsigned int count_vertices = 0; - - // count faces - std::vector::const_iterator itf = faces.begin(); - for ( MatIndexArray::const_iterator it = mindices.begin(), - end = mindices.end(); it != end; ++it, ++itf ) - { - if ( ( *it ) != index ) { - continue; - } - ++count_faces; - count_vertices += *itf; - } - - ai_assert( count_faces ); - ai_assert( count_vertices ); - - // mapping from output indices to DOM indexing, needed to resolve weights - std::vector reverseMapping; - - if ( process_weights ) { - reverseMapping.resize( count_vertices ); - } - - // allocate output data arrays, but don't fill them yet - out_mesh->mNumVertices = count_vertices; - out_mesh->mVertices = new aiVector3D[ count_vertices ]; - - out_mesh->mNumFaces = count_faces; - aiFace* fac = out_mesh->mFaces = new aiFace[ count_faces ](); - - - // allocate normals - const std::vector& normals = mesh.GetNormals(); - if ( normals.size() ) { - ai_assert( normals.size() == vertices.size() ); - out_mesh->mNormals = new aiVector3D[ vertices.size() ]; - } - - // allocate tangents, binormals. - const std::vector& tangents = mesh.GetTangents(); - const std::vector* binormals = &mesh.GetBinormals(); - std::vector tempBinormals; - - if ( tangents.size() ) { - if ( !binormals->size() ) { - if ( normals.size() ) { - // XXX this computes the binormals for the entire mesh, not only - // the part for which we need them. - tempBinormals.resize( normals.size() ); - for ( unsigned int i = 0; i < tangents.size(); ++i ) { - tempBinormals[ i ] = normals[ i ] ^ tangents[ i ]; - } - - binormals = &tempBinormals; - } - else { - binormals = NULL; - } - } - - if ( binormals ) { - ai_assert( tangents.size() == vertices.size() && binormals->size() == vertices.size() ); - - out_mesh->mTangents = new aiVector3D[ vertices.size() ]; - out_mesh->mBitangents = new aiVector3D[ vertices.size() ]; - } - } - - // allocate texture coords - unsigned int num_uvs = 0; - for ( unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i, ++num_uvs ) { - const std::vector& uvs = mesh.GetTextureCoords( i ); - if ( uvs.empty() ) { - break; - } - - out_mesh->mTextureCoords[ i ] = new aiVector3D[ vertices.size() ]; - out_mesh->mNumUVComponents[ i ] = 2; - } - - // allocate vertex colors - unsigned int num_vcs = 0; - for ( unsigned int i = 0; i < AI_MAX_NUMBER_OF_COLOR_SETS; ++i, ++num_vcs ) { - const std::vector& colors = mesh.GetVertexColors( i ); - if ( colors.empty() ) { - break; - } - - out_mesh->mColors[ i ] = new aiColor4D[ vertices.size() ]; - } - - unsigned int cursor = 0, in_cursor = 0; - - itf = faces.begin(); - for ( MatIndexArray::const_iterator it = mindices.begin(), - end = mindices.end(); it != end; ++it, ++itf ) - { - const unsigned int pcount = *itf; - if ( ( *it ) != index ) { - in_cursor += pcount; - continue; - } - - aiFace& f = *fac++; - - f.mNumIndices = pcount; - f.mIndices = new unsigned int[ pcount ]; - switch ( pcount ) - { - case 1: - out_mesh->mPrimitiveTypes |= aiPrimitiveType_POINT; - break; - case 2: - out_mesh->mPrimitiveTypes |= aiPrimitiveType_LINE; - break; - case 3: - out_mesh->mPrimitiveTypes |= aiPrimitiveType_TRIANGLE; - break; - default: - out_mesh->mPrimitiveTypes |= aiPrimitiveType_POLYGON; - break; - } - for ( unsigned int i = 0; i < pcount; ++i, ++cursor, ++in_cursor ) { - f.mIndices[ i ] = cursor; - - if ( reverseMapping.size() ) { - reverseMapping[ cursor ] = in_cursor; - } - - out_mesh->mVertices[ cursor ] = vertices[ in_cursor ]; - - if ( out_mesh->mNormals ) { - out_mesh->mNormals[ cursor ] = normals[ in_cursor ]; - } - - if ( out_mesh->mTangents ) { - out_mesh->mTangents[ cursor ] = tangents[ in_cursor ]; - out_mesh->mBitangents[ cursor ] = ( *binormals )[ in_cursor ]; - } - - for ( unsigned int j = 0; j < num_uvs; ++j ) { - const std::vector& uvs = mesh.GetTextureCoords( j ); - out_mesh->mTextureCoords[ j ][ cursor ] = aiVector3D( uvs[ in_cursor ].x, uvs[ in_cursor ].y, 0.0f ); - } - - for ( unsigned int j = 0; j < num_vcs; ++j ) { - const std::vector& cols = mesh.GetVertexColors( j ); - out_mesh->mColors[ j ][ cursor ] = cols[ in_cursor ]; - } - } - } - - ConvertMaterialForMesh( out_mesh, model, mesh, index ); - - if ( process_weights ) { - ConvertWeights( out_mesh, model, mesh, node_global_transform, index, &reverseMapping ); - } - - return static_cast( meshes.size() - 1 ); -} - -void FBXConverter::ConvertWeights( aiMesh* out, const Model& model, const MeshGeometry& geo, - const aiMatrix4x4& node_global_transform , - unsigned int materialIndex, - std::vector* outputVertStartIndices ) -{ - ai_assert( geo.DeformerSkin() ); - - std::vector out_indices; - std::vector index_out_indices; - std::vector count_out_indices; - - const Skin& sk = *geo.DeformerSkin(); - - std::vector bones; - bones.reserve( sk.Clusters().size() ); - - const bool no_mat_check = materialIndex == NO_MATERIAL_SEPARATION; - ai_assert( no_mat_check || outputVertStartIndices ); - - try { - - for( const Cluster* cluster : sk.Clusters() ) { - ai_assert( cluster ); - - const WeightIndexArray& indices = cluster->GetIndices(); - - if ( indices.empty() ) { - continue; - } - - const MatIndexArray& mats = geo.GetMaterialIndices(); - - bool ok = false; - - const size_t no_index_sentinel = std::numeric_limits::max(); - - count_out_indices.clear(); - index_out_indices.clear(); - out_indices.clear(); - - // now check if *any* of these weights is contained in the output mesh, - // taking notes so we don't need to do it twice. - for( WeightIndexArray::value_type index : indices ) { - - unsigned int count = 0; - const unsigned int* const out_idx = geo.ToOutputVertexIndex( index, count ); - // ToOutputVertexIndex only returns NULL if index is out of bounds - // which should never happen - ai_assert( out_idx != NULL ); - - index_out_indices.push_back( no_index_sentinel ); - count_out_indices.push_back( 0 ); - - for ( unsigned int i = 0; i < count; ++i ) { - if ( no_mat_check || static_cast( mats[ geo.FaceForVertexIndex( out_idx[ i ] ) ] ) == materialIndex ) { - - if ( index_out_indices.back() == no_index_sentinel ) { - index_out_indices.back() = out_indices.size(); - - } - - if ( no_mat_check ) { - out_indices.push_back( out_idx[ i ] ); + if (!name_carrier) { + std::string old_original_name = original_name; + GetUniqueName(old_original_name, original_name); + nodes_chain.push_back(new aiNode(original_name)); } else { - // this extra lookup is in O(logn), so the entire algorithm becomes O(nlogn) - const std::vector::iterator it = std::lower_bound( - outputVertStartIndices->begin(), - outputVertStartIndices->end(), - out_idx[ i ] - ); - - out_indices.push_back( std::distance( outputVertStartIndices->begin(), it ) ); + original_name = nodes_chain.back()->mName.C_Str(); } - ++count_out_indices.back(); - ok = true; - } - } - } + //setup metadata on newest node + SetupNodeMetadata(*model, *nodes_chain.back()); - // if we found at least one, generate the output bones - // XXX this could be heavily simplified by collecting the bone - // data in a single step. - if ( ok ) { - ConvertCluster( bones, model, *cluster, out_indices, index_out_indices, - count_out_indices, node_global_transform ); - } - } - } - catch ( std::exception& ) { - std::for_each( bones.begin(), bones.end(), Util::delete_fun() ); - throw; - } + // link all nodes in a row + aiNode* last_parent = &parent; + for (aiNode* prenode : nodes_chain) { + ai_assert(prenode); - if ( bones.empty() ) { - return; - } - - out->mBones = new aiBone*[ bones.size() ](); - out->mNumBones = static_cast( bones.size() ); - - std::swap_ranges( bones.begin(), bones.end(), out->mBones ); -} - -void FBXConverter::ConvertCluster( std::vector& bones, const Model& /*model*/, const Cluster& cl, - std::vector& out_indices, - std::vector& index_out_indices, - std::vector& count_out_indices, - const aiMatrix4x4& node_global_transform ) -{ - - aiBone* const bone = new aiBone(); - bones.push_back( bone ); - - bone->mName = FixNodeName( cl.TargetNode()->Name() ); - - bone->mOffsetMatrix = cl.TransformLink(); - bone->mOffsetMatrix.Inverse(); - - bone->mOffsetMatrix = bone->mOffsetMatrix * node_global_transform; - - bone->mNumWeights = static_cast( out_indices.size() ); - aiVertexWeight* cursor = bone->mWeights = new aiVertexWeight[ out_indices.size() ]; - - const size_t no_index_sentinel = std::numeric_limits::max(); - const WeightArray& weights = cl.GetWeights(); - - const size_t c = index_out_indices.size(); - for ( size_t i = 0; i < c; ++i ) { - const size_t index_index = index_out_indices[ i ]; - - if ( index_index == no_index_sentinel ) { - continue; - } - - const size_t cc = count_out_indices[ i ]; - for ( size_t j = 0; j < cc; ++j ) { - aiVertexWeight& out_weight = *cursor++; - - out_weight.mVertexId = static_cast( out_indices[ index_index + j ] ); - out_weight.mWeight = weights[ i ]; - } - } -} - -void FBXConverter::ConvertMaterialForMesh( aiMesh* out, const Model& model, const MeshGeometry& geo, - MatIndexArray::value_type materialIndex ) -{ - // locate source materials for this mesh - const std::vector& mats = model.GetMaterials(); - if ( static_cast( materialIndex ) >= mats.size() || materialIndex < 0 ) { - FBXImporter::LogError( "material index out of bounds, setting default material" ); - out->mMaterialIndex = GetDefaultMaterial(); - return; - } - - const Material* const mat = mats[ materialIndex ]; - MaterialMap::const_iterator it = materials_converted.find( mat ); - if ( it != materials_converted.end() ) { - out->mMaterialIndex = ( *it ).second; - return; - } - - out->mMaterialIndex = ConvertMaterial( *mat, &geo ); - materials_converted[ mat ] = out->mMaterialIndex; -} - -unsigned int FBXConverter::GetDefaultMaterial() -{ - if ( defaultMaterialIndex ) { - return defaultMaterialIndex - 1; - } - - aiMaterial* out_mat = new aiMaterial(); - materials.push_back( out_mat ); - - const aiColor3D diffuse = aiColor3D( 0.8f, 0.8f, 0.8f ); - out_mat->AddProperty( &diffuse, 1, AI_MATKEY_COLOR_DIFFUSE ); - - aiString s; - s.Set( AI_DEFAULT_MATERIAL_NAME ); - - out_mat->AddProperty( &s, AI_MATKEY_NAME ); - - defaultMaterialIndex = static_cast< unsigned int >( materials.size() ); - return defaultMaterialIndex - 1; -} - - -unsigned int FBXConverter::ConvertMaterial( const Material& material, const MeshGeometry* const mesh ) -{ - const PropertyTable& props = material.Props(); - - // generate empty output material - aiMaterial* out_mat = new aiMaterial(); - materials_converted[ &material ] = static_cast( materials.size() ); - - materials.push_back( out_mat ); - - aiString str; - - // strip Material:: prefix - std::string name = material.Name(); - if ( name.substr( 0, 10 ) == "Material::" ) { - name = name.substr( 10 ); - } - - // set material name if not empty - this could happen - // and there should be no key for it in this case. - if ( name.length() ) { - str.Set( name ); - out_mat->AddProperty( &str, AI_MATKEY_NAME ); - } - - // shading stuff and colors - SetShadingPropertiesCommon( out_mat, props ); - - // texture assignments - SetTextureProperties( out_mat, material.Textures(), mesh ); - SetTextureProperties( out_mat, material.LayeredTextures(), mesh ); - - return static_cast( materials.size() - 1 ); -} - -unsigned int FBXConverter::ConvertVideo( const Video& video ) -{ - // generate empty output texture - aiTexture* out_tex = new aiTexture(); - textures.push_back( out_tex ); - - // assuming the texture is compressed - out_tex->mWidth = static_cast( video.ContentLength() ); // total data size - out_tex->mHeight = 0; // fixed to 0 - - // steal the data from the Video to avoid an additional copy - out_tex->pcData = reinterpret_cast( const_cast( video ).RelinquishContent() ); - - // try to extract a hint from the file extension - const std::string& filename = video.FileName().empty() ? video.RelativeFilename() : video.FileName(); - std::string ext = BaseImporter::GetExtension( filename ); - - if ( ext == "jpeg" ) { - ext = "jpg"; - } - - if ( ext.size() <= 3 ) { - memcpy( out_tex->achFormatHint, ext.c_str(), ext.size() ); - } - - out_tex->mFilename.Set(video.FileName().c_str()); - - return static_cast( textures.size() - 1 ); -} - -aiString FBXConverter::GetTexturePath(const Texture* tex) -{ - aiString path; - path.Set(tex->RelativeFilename()); - - const Video* media = tex->Media(); - if (media != nullptr) { - bool textureReady = false; //tells if our texture is ready (if it was loaded or if it was found) - unsigned int index; - - VideoMap::const_iterator it = textures_converted.find(media); - if (it != textures_converted.end()) { - index = (*it).second; - textureReady = true; - } - else { - if (media->ContentLength() > 0) { - index = ConvertVideo(*media); - textures_converted[media] = index; - textureReady = true; - } - } - - // setup texture reference string (copied from ColladaLoader::FindFilenameForEffectTexture), if the texture is ready - if (doc.Settings().useLegacyEmbeddedTextureNaming) { - if (textureReady) { - // TODO: check the possibility of using the flag "AI_CONFIG_IMPORT_FBX_EMBEDDED_TEXTURES_LEGACY_NAMING" - // In FBX files textures are now stored internally by Assimp with their filename included - // Now Assimp can lookup through the loaded textures after all data is processed - // We need to load all textures before referencing them, as FBX file format order may reference a texture before loading it - // This may occur on this case too, it has to be studied - path.data[0] = '*'; - path.length = 1 + ASSIMP_itoa10(path.data + 1, MAXLEN - 1, index); - } - } - } - - return path; -} - -void FBXConverter::TrySetTextureProperties( aiMaterial* out_mat, const TextureMap& textures, - const std::string& propName, - aiTextureType target, const MeshGeometry* const mesh ) -{ - TextureMap::const_iterator it = textures.find( propName ); - if ( it == textures.end() ) { - return; - } - - const Texture* const tex = ( *it ).second; - if ( tex != nullptr ) { - aiString path = GetTexturePath(tex); - out_mat->AddProperty( &path, _AI_MATKEY_TEXTURE_BASE, target, 0 ); - - aiUVTransform uvTrafo; - // XXX handle all kinds of UV transformations - uvTrafo.mScaling = tex->UVScaling(); - uvTrafo.mTranslation = tex->UVTranslation(); - out_mat->AddProperty( &uvTrafo, 1, _AI_MATKEY_UVTRANSFORM_BASE, target, 0 ); - - const PropertyTable& props = tex->Props(); - - int uvIndex = 0; - - bool ok; - const std::string& uvSet = PropertyGet( props, "UVSet", ok ); - if ( ok ) { - // "default" is the name which usually appears in the FbxFileTexture template - if ( uvSet != "default" && uvSet.length() ) { - // this is a bit awkward - we need to find a mesh that uses this - // material and scan its UV channels for the given UV name because - // assimp references UV channels by index, not by name. - - // XXX: the case that UV channels may appear in different orders - // in meshes is unhandled. A possible solution would be to sort - // the UV channels alphabetically, but this would have the side - // effect that the primary (first) UV channel would sometimes - // be moved, causing trouble when users read only the first - // UV channel and ignore UV channel assignments altogether. - - const unsigned int matIndex = static_cast( std::distance( materials.begin(), - std::find( materials.begin(), materials.end(), out_mat ) - ) ); - - - uvIndex = -1; - if ( !mesh ) - { - for( const MeshMap::value_type& v : meshes_converted ) { - const MeshGeometry* const mesh = dynamic_cast ( v.first ); - if ( !mesh ) { - continue; - } - - const MatIndexArray& mats = mesh->GetMaterialIndices(); - if ( std::find( mats.begin(), mats.end(), matIndex ) == mats.end() ) { - continue; - } - - int index = -1; - for ( unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i ) { - if ( mesh->GetTextureCoords( i ).empty() ) { - break; + if (last_parent != &parent) { + last_parent->mNumChildren = 1; + last_parent->mChildren = new aiNode*[1]; + last_parent->mChildren[0] = prenode; } - const std::string& name = mesh->GetTextureCoordChannelName( i ); - if ( name == uvSet ) { - index = static_cast( i ); - break; - } - } - if ( index == -1 ) { - FBXImporter::LogWarn( "did not find UV channel named " + uvSet + " in a mesh using this material" ); - continue; + + prenode->mParent = last_parent; + last_parent = prenode; + + new_abs_transform *= prenode->mTransformation; } - if ( uvIndex == -1 ) { - uvIndex = index; + // attach geometry + ConvertModel(*model, *nodes_chain.back(), new_abs_transform); + + // check if there will be any child nodes + const std::vector& child_conns + = doc.GetConnectionsByDestinationSequenced(model->ID(), "Model"); + + // if so, link the geometric transform inverse nodes + // before we attach any child nodes + if (child_conns.size()) { + for (aiNode* postnode : post_nodes_chain) { + ai_assert(postnode); + + if (last_parent != &parent) { + last_parent->mNumChildren = 1; + last_parent->mChildren = new aiNode*[1]; + last_parent->mChildren[0] = postnode; + } + + postnode->mParent = last_parent; + last_parent = postnode; + + new_abs_transform *= postnode->mTransformation; + } } else { - FBXImporter::LogWarn( "the UV channel named " + uvSet + - " appears at different positions in meshes, results will be wrong" ); + // free the nodes we allocated as we don't need them + Util::delete_fun deleter; + std::for_each( + post_nodes_chain.begin(), + post_nodes_chain.end(), + deleter + ); } - } - } - else - { - int index = -1; - for ( unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i ) { - if ( mesh->GetTextureCoords( i ).empty() ) { - break; - } - const std::string& name = mesh->GetTextureCoordChannelName( i ); - if ( name == uvSet ) { - index = static_cast( i ); - break; - } - } - if ( index == -1 ) { - FBXImporter::LogWarn( "did not find UV channel named " + uvSet + " in a mesh using this material" ); - } - if ( uvIndex == -1 ) { - uvIndex = index; + // attach sub-nodes (if any) + ConvertNodes(model->ID(), *last_parent, new_abs_transform); + + if (doc.Settings().readLights) { + ConvertLights(*model, original_name); + } + + if (doc.Settings().readCameras) { + ConvertCameras(*model, original_name); + } + + nodes.push_back(nodes_chain.front()); + nodes_chain.clear(); } } - if ( uvIndex == -1 ) { - FBXImporter::LogWarn( "failed to resolve UV channel " + uvSet + ", using first UV channel" ); - uvIndex = 0; + if (nodes.size()) { + parent.mChildren = new aiNode*[nodes.size()](); + parent.mNumChildren = static_cast(nodes.size()); + + std::swap_ranges(nodes.begin(), nodes.end(), parent.mChildren); + } + } + catch (std::exception&) { + Util::delete_fun deleter; + std::for_each(nodes.begin(), nodes.end(), deleter); + std::for_each(nodes_chain.begin(), nodes_chain.end(), deleter); + std::for_each(post_nodes_chain.begin(), post_nodes_chain.end(), deleter); + } + } + + + void FBXConverter::ConvertLights(const Model& model, const std::string &orig_name) { + const std::vector& node_attrs = model.GetAttributes(); + for (const NodeAttribute* attr : node_attrs) { + const Light* const light = dynamic_cast(attr); + if (light) { + ConvertLight(*light, orig_name); } } } - out_mat->AddProperty( &uvIndex, 1, _AI_MATKEY_UVWSRC_BASE, target, 0 ); - } -} - -void FBXConverter::TrySetTextureProperties( aiMaterial* out_mat, const LayeredTextureMap& layeredTextures, - const std::string& propName, - aiTextureType target, const MeshGeometry* const mesh ) { - LayeredTextureMap::const_iterator it = layeredTextures.find( propName ); - if ( it == layeredTextures.end() ) { - return; - } - - int texCount = (*it).second->textureCount(); - - // Set the blend mode for layered textures - int blendmode= (*it).second->GetBlendMode(); - out_mat->AddProperty(&blendmode,1,_AI_MATKEY_TEXOP_BASE,target,0); - - for(int texIndex = 0; texIndex < texCount; texIndex++){ - - const Texture* const tex = ( *it ).second->getTexture(texIndex); - - aiString path = GetTexturePath(tex); - out_mat->AddProperty( &path, _AI_MATKEY_TEXTURE_BASE, target, texIndex ); - - aiUVTransform uvTrafo; - // XXX handle all kinds of UV transformations - uvTrafo.mScaling = tex->UVScaling(); - uvTrafo.mTranslation = tex->UVTranslation(); - out_mat->AddProperty( &uvTrafo, 1, _AI_MATKEY_UVTRANSFORM_BASE, target, texIndex ); - - const PropertyTable& props = tex->Props(); - - int uvIndex = 0; - - bool ok; - const std::string& uvSet = PropertyGet( props, "UVSet", ok ); - if ( ok ) { - // "default" is the name which usually appears in the FbxFileTexture template - if ( uvSet != "default" && uvSet.length() ) { - // this is a bit awkward - we need to find a mesh that uses this - // material and scan its UV channels for the given UV name because - // assimp references UV channels by index, not by name. - - // XXX: the case that UV channels may appear in different orders - // in meshes is unhandled. A possible solution would be to sort - // the UV channels alphabetically, but this would have the side - // effect that the primary (first) UV channel would sometimes - // be moved, causing trouble when users read only the first - // UV channel and ignore UV channel assignments altogether. - - const unsigned int matIndex = static_cast( std::distance( materials.begin(), - std::find( materials.begin(), materials.end(), out_mat ) - ) ); - - uvIndex = -1; - if ( !mesh ) - { - for( const MeshMap::value_type& v : meshes_converted ) { - const MeshGeometry* const mesh = dynamic_cast ( v.first ); - if ( !mesh ) { - continue; - } - - const MatIndexArray& mats = mesh->GetMaterialIndices(); - if ( std::find( mats.begin(), mats.end(), matIndex ) == mats.end() ) { - continue; - } - - int index = -1; - for ( unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i ) { - if ( mesh->GetTextureCoords( i ).empty() ) { - break; - } - const std::string& name = mesh->GetTextureCoordChannelName( i ); - if ( name == uvSet ) { - index = static_cast( i ); - break; - } - } - if ( index == -1 ) { - FBXImporter::LogWarn( "did not find UV channel named " + uvSet + " in a mesh using this material" ); - continue; - } - - if ( uvIndex == -1 ) { - uvIndex = index; - } - else { - FBXImporter::LogWarn( "the UV channel named " + uvSet + - " appears at different positions in meshes, results will be wrong" ); - } - } - } - else - { - int index = -1; - for ( unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i ) { - if ( mesh->GetTextureCoords( i ).empty() ) { - break; - } - const std::string& name = mesh->GetTextureCoordChannelName( i ); - if ( name == uvSet ) { - index = static_cast( i ); - break; - } - } - if ( index == -1 ) { - FBXImporter::LogWarn( "did not find UV channel named " + uvSet + " in a mesh using this material" ); - } - - if ( uvIndex == -1 ) { - uvIndex = index; - } - } - - if ( uvIndex == -1 ) { - FBXImporter::LogWarn( "failed to resolve UV channel " + uvSet + ", using first UV channel" ); - uvIndex = 0; + void FBXConverter::ConvertCameras(const Model& model, const std::string &orig_name) { + const std::vector& node_attrs = model.GetAttributes(); + for (const NodeAttribute* attr : node_attrs) { + const Camera* const cam = dynamic_cast(attr); + if (cam) { + ConvertCamera(*cam, orig_name); } } } - out_mat->AddProperty( &uvIndex, 1, _AI_MATKEY_UVWSRC_BASE, target, texIndex ); - } -} + void FBXConverter::ConvertLight(const Light& light, const std::string &orig_name) { + lights.push_back(new aiLight()); + aiLight* const out_light = lights.back(); -void FBXConverter::SetTextureProperties( aiMaterial* out_mat, const TextureMap& textures, const MeshGeometry* const mesh ) -{ - TrySetTextureProperties( out_mat, textures, "DiffuseColor", aiTextureType_DIFFUSE, mesh ); - TrySetTextureProperties( out_mat, textures, "AmbientColor", aiTextureType_AMBIENT, mesh ); - TrySetTextureProperties( out_mat, textures, "EmissiveFactor", aiTextureType_EMISSIVE, mesh ); - TrySetTextureProperties( out_mat, textures, "SpecularFactor", aiTextureType_SPECULAR, mesh); - TrySetTextureProperties( out_mat, textures, "TransparencyFactor", aiTextureType_OPACITY, mesh ); - TrySetTextureProperties( out_mat, textures, "ReflectionColor", aiTextureType_REFLECTION, mesh ); - TrySetTextureProperties( out_mat, textures, "DisplacementColor", aiTextureType_DISPLACEMENT, mesh ); - TrySetTextureProperties( out_mat, textures, "NormalMap", aiTextureType_NORMALS, mesh ); - TrySetTextureProperties( out_mat, textures, "Bump", aiTextureType_HEIGHT, mesh ); - TrySetTextureProperties( out_mat, textures, "ShininessExponent", aiTextureType_SHININESS, mesh ); -} + out_light->mName.Set(orig_name); -void FBXConverter::SetTextureProperties( aiMaterial* out_mat, const LayeredTextureMap& layeredTextures, const MeshGeometry* const mesh ) -{ - TrySetTextureProperties( out_mat, layeredTextures, "DiffuseColor", aiTextureType_DIFFUSE, mesh ); - TrySetTextureProperties( out_mat, layeredTextures, "AmbientColor", aiTextureType_AMBIENT, mesh ); - TrySetTextureProperties( out_mat, layeredTextures, "EmissiveFactor", aiTextureType_EMISSIVE, mesh ); - TrySetTextureProperties( out_mat, layeredTextures, "SpecularFactor", aiTextureType_SPECULAR, mesh); - TrySetTextureProperties( out_mat, layeredTextures, "TransparencyFactor", aiTextureType_OPACITY, mesh ); - TrySetTextureProperties( out_mat, layeredTextures, "ReflectionColor", aiTextureType_REFLECTION, mesh ); - TrySetTextureProperties( out_mat, layeredTextures, "DisplacementColor", aiTextureType_DISPLACEMENT, mesh ); - TrySetTextureProperties( out_mat, layeredTextures, "NormalMap", aiTextureType_NORMALS, mesh ); - TrySetTextureProperties( out_mat, layeredTextures, "Bump", aiTextureType_HEIGHT, mesh ); - TrySetTextureProperties( out_mat, layeredTextures, "ShininessExponent", aiTextureType_SHININESS, mesh ); -} + const float intensity = light.Intensity() / 100.0f; + const aiVector3D& col = light.Color(); -aiColor3D FBXConverter::GetColorPropertyFactored( const PropertyTable& props, const std::string& colorName, - const std::string& factorName, bool& result, bool useTemplate ) -{ - result = true; + out_light->mColorDiffuse = aiColor3D(col.x, col.y, col.z); + out_light->mColorDiffuse.r *= intensity; + out_light->mColorDiffuse.g *= intensity; + out_light->mColorDiffuse.b *= intensity; - bool ok; - aiVector3D BaseColor = PropertyGet( props, colorName, ok, useTemplate ); - if ( ! ok ) { - result = false; - return aiColor3D( 0.0f, 0.0f, 0.0f ); - } + out_light->mColorSpecular = out_light->mColorDiffuse; - // if no factor name, return the colour as is - if ( factorName.empty() ) { - return aiColor3D( BaseColor.x, BaseColor.y, BaseColor.z ); - } + //lights are defined along negative y direction + out_light->mPosition = aiVector3D(0.0f); + out_light->mDirection = aiVector3D(0.0f, -1.0f, 0.0f); + out_light->mUp = aiVector3D(0.0f, 0.0f, -1.0f); - // otherwise it should be multiplied by the factor, if found. - float factor = PropertyGet( props, factorName, ok, useTemplate ); - if ( ok ) { - BaseColor *= factor; - } - return aiColor3D( BaseColor.x, BaseColor.y, BaseColor.z ); -} - -aiColor3D FBXConverter::GetColorPropertyFromMaterial( const PropertyTable& props, const std::string& baseName, - bool& result ) -{ - return GetColorPropertyFactored( props, baseName + "Color", baseName + "Factor", result, true ); -} - -aiColor3D FBXConverter::GetColorProperty( const PropertyTable& props, const std::string& colorName, - bool& result, bool useTemplate ) -{ - result = true; - bool ok; - const aiVector3D& ColorVec = PropertyGet( props, colorName, ok, useTemplate ); - if ( ! ok ) { - result = false; - return aiColor3D( 0.0f, 0.0f, 0.0f ); - } - return aiColor3D( ColorVec.x, ColorVec.y, ColorVec.z ); -} - -void FBXConverter::SetShadingPropertiesCommon( aiMaterial* out_mat, const PropertyTable& props ) -{ - // Set shading properties. - // Modern FBX Files have two separate systems for defining these, - // with only the more comprehensive one described in the property template. - // Likely the other values are a legacy system, - // which is still always exported by the official FBX SDK. - // - // Blender's FBX import and export mostly ignore this legacy system, - // and as we only support recent versions of FBX anyway, we can do the same. - bool ok; - - const aiColor3D& Diffuse = GetColorPropertyFromMaterial( props, "Diffuse", ok ); - if ( ok ) { - out_mat->AddProperty( &Diffuse, 1, AI_MATKEY_COLOR_DIFFUSE ); - } - - const aiColor3D& Emissive = GetColorPropertyFromMaterial( props, "Emissive", ok ); - if ( ok ) { - out_mat->AddProperty( &Emissive, 1, AI_MATKEY_COLOR_EMISSIVE ); - } - - const aiColor3D& Ambient = GetColorPropertyFromMaterial( props, "Ambient", ok ); - if ( ok ) { - out_mat->AddProperty( &Ambient, 1, AI_MATKEY_COLOR_AMBIENT ); - } - - // we store specular factor as SHININESS_STRENGTH, so just get the color - const aiColor3D& Specular = GetColorProperty( props, "SpecularColor", ok, true ); - if ( ok ) { - out_mat->AddProperty( &Specular, 1, AI_MATKEY_COLOR_SPECULAR ); - } - - // and also try to get SHININESS_STRENGTH - const float SpecularFactor = PropertyGet( props, "SpecularFactor", ok, true ); - if ( ok ) { - out_mat->AddProperty( &SpecularFactor, 1, AI_MATKEY_SHININESS_STRENGTH ); - } - - // and the specular exponent - const float ShininessExponent = PropertyGet( props, "ShininessExponent", ok ); - if ( ok ) { - out_mat->AddProperty( &ShininessExponent, 1, AI_MATKEY_SHININESS ); - } - - // TransparentColor / TransparencyFactor... gee thanks FBX :rolleyes: - const aiColor3D& Transparent = GetColorPropertyFactored( props, "TransparentColor", "TransparencyFactor", ok ); - float CalculatedOpacity = 1.0f; - if ( ok ) { - out_mat->AddProperty( &Transparent, 1, AI_MATKEY_COLOR_TRANSPARENT ); - // as calculated by FBX SDK 2017: - CalculatedOpacity = 1.0f - ((Transparent.r + Transparent.g + Transparent.b) / 3.0f); - } - - // use of TransparencyFactor is inconsistent. - // Maya always stores it as 1.0, - // so we can't use it to set AI_MATKEY_OPACITY. - // Blender is more sensible and stores it as the alpha value. - // However both the FBX SDK and Blender always write an additional - // legacy "Opacity" field, so we can try to use that. - // - // If we can't find it, - // we can fall back to the value which the FBX SDK calculates - // from transparency colour (RGB) and factor (F) as - // 1.0 - F*((R+G+B)/3). - // - // There's no consistent way to interpret this opacity value, - // so it's up to clients to do the correct thing. - const float Opacity = PropertyGet( props, "Opacity", ok ); - if ( ok ) { - out_mat->AddProperty( &Opacity, 1, AI_MATKEY_OPACITY ); - } - else if ( CalculatedOpacity != 1.0 ) { - out_mat->AddProperty( &CalculatedOpacity, 1, AI_MATKEY_OPACITY ); - } - - // reflection color and factor are stored separately - const aiColor3D& Reflection = GetColorProperty( props, "ReflectionColor", ok, true ); - if ( ok ) { - out_mat->AddProperty( &Reflection, 1, AI_MATKEY_COLOR_REFLECTIVE ); - } - - float ReflectionFactor = PropertyGet( props, "ReflectionFactor", ok, true ); - if ( ok ) { - out_mat->AddProperty( &ReflectionFactor, 1, AI_MATKEY_REFLECTIVITY ); - } - - const float BumpFactor = PropertyGet(props, "BumpFactor", ok); - if (ok) { - out_mat->AddProperty(&BumpFactor, 1, AI_MATKEY_BUMPSCALING); - } - - const float DispFactor = PropertyGet(props, "DisplacementFactor", ok); - if (ok) { - out_mat->AddProperty(&DispFactor, 1, "$mat.displacementscaling", 0, 0); - } -} - - -double FBXConverter::FrameRateToDouble( FileGlobalSettings::FrameRate fp, double customFPSVal ) { - switch ( fp ) { - case FileGlobalSettings::FrameRate_DEFAULT: - return 1.0; - - case FileGlobalSettings::FrameRate_120: - return 120.0; - - case FileGlobalSettings::FrameRate_100: - return 100.0; - - case FileGlobalSettings::FrameRate_60: - return 60.0; - - case FileGlobalSettings::FrameRate_50: - return 50.0; - - case FileGlobalSettings::FrameRate_48: - return 48.0; - - case FileGlobalSettings::FrameRate_30: - case FileGlobalSettings::FrameRate_30_DROP: - return 30.0; - - case FileGlobalSettings::FrameRate_NTSC_DROP_FRAME: - case FileGlobalSettings::FrameRate_NTSC_FULL_FRAME: - return 29.9700262; - - case FileGlobalSettings::FrameRate_PAL: - return 25.0; - - case FileGlobalSettings::FrameRate_CINEMA: - return 24.0; - - case FileGlobalSettings::FrameRate_1000: - return 1000.0; - - case FileGlobalSettings::FrameRate_CINEMA_ND: - return 23.976; - - case FileGlobalSettings::FrameRate_CUSTOM: - return customFPSVal; - - case FileGlobalSettings::FrameRate_MAX: // this is to silence compiler warnings - break; - } - - ai_assert( false ); - - return -1.0f; -} - - -void FBXConverter::ConvertAnimations() -{ - // first of all determine framerate - const FileGlobalSettings::FrameRate fps = doc.GlobalSettings().TimeMode(); - const float custom = doc.GlobalSettings().CustomFrameRate(); - anim_fps = FrameRateToDouble( fps, custom ); - - const std::vector& animations = doc.AnimationStacks(); - for( const AnimationStack* stack : animations ) { - ConvertAnimationStack( *stack ); - } -} - -std::string FBXConverter::FixNodeName( const std::string& name ) { - // strip Model:: prefix, avoiding ambiguities (i.e. don't strip if - // this causes ambiguities, well possible between empty identifiers, - // such as "Model::" and ""). Make sure the behaviour is consistent - // across multiple calls to FixNodeName(). - if ( name.substr( 0, 7 ) == "Model::" ) { - std::string temp = name.substr( 7 ); - return temp; - } - - return name; -} - -void FBXConverter::ConvertAnimationStack( const AnimationStack& st ) -{ - const AnimationLayerList& layers = st.Layers(); - if ( layers.empty() ) { - return; - } - - aiAnimation* const anim = new aiAnimation(); - animations.push_back( anim ); - - // strip AnimationStack:: prefix - std::string name = st.Name(); - if ( name.substr( 0, 16 ) == "AnimationStack::" ) { - name = name.substr( 16 ); - } - else if ( name.substr( 0, 11 ) == "AnimStack::" ) { - name = name.substr( 11 ); - } - - anim->mName.Set( name ); - - // need to find all nodes for which we need to generate node animations - - // it may happen that we need to merge multiple layers, though. - NodeMap node_map; - - // reverse mapping from curves to layers, much faster than querying - // the FBX DOM for it. - LayerMap layer_map; - - const char* prop_whitelist[] = { - "Lcl Scaling", - "Lcl Rotation", - "Lcl Translation" - }; - - for( const AnimationLayer* layer : layers ) { - ai_assert( layer ); - - const AnimationCurveNodeList& nodes = layer->Nodes( prop_whitelist, 3 ); - for( const AnimationCurveNode* node : nodes ) { - ai_assert( node ); - - const Model* const model = dynamic_cast( node->Target() ); - // this can happen - it could also be a NodeAttribute (i.e. for camera animations) - if ( !model ) { - continue; - } - - const std::string& name = FixNodeName( model->Name() ); - node_map[ name ].push_back( node ); - - layer_map[ node ] = layer; - } - } - - // generate node animations - std::vector node_anims; - - double min_time = 1e10; - double max_time = -1e10; - - int64_t start_time = st.LocalStart(); - int64_t stop_time = st.LocalStop(); - bool has_local_startstop = start_time != 0 || stop_time != 0; - if ( !has_local_startstop ) { - // no time range given, so accept every keyframe and use the actual min/max time - // the numbers are INT64_MIN/MAX, the 20000 is for safety because GenerateNodeAnimations uses an epsilon of 10000 - start_time = -9223372036854775807ll + 20000; - stop_time = 9223372036854775807ll - 20000; - } - - try { - for( const NodeMap::value_type& kv : node_map ) { - GenerateNodeAnimations( node_anims, - kv.first, - kv.second, - layer_map, - start_time, stop_time, - max_time, - min_time ); - } - } - catch ( std::exception& ) { - std::for_each( node_anims.begin(), node_anims.end(), Util::delete_fun() ); - throw; - } - - if ( node_anims.size() ) { - anim->mChannels = new aiNodeAnim*[ node_anims.size() ](); - anim->mNumChannels = static_cast( node_anims.size() ); - - std::swap_ranges( node_anims.begin(), node_anims.end(), anim->mChannels ); - } - else { - // empty animations would fail validation, so drop them - delete anim; - animations.pop_back(); - FBXImporter::LogInfo( "ignoring empty AnimationStack (using IK?): " + name ); - return; - } - - double start_time_fps = has_local_startstop ? (CONVERT_FBX_TIME(start_time) * anim_fps) : min_time; - double stop_time_fps = has_local_startstop ? (CONVERT_FBX_TIME(stop_time) * anim_fps) : max_time; - - // adjust relative timing for animation - for ( unsigned int c = 0; c < anim->mNumChannels; c++ ) { - aiNodeAnim* channel = anim->mChannels[ c ]; - for ( uint32_t i = 0; i < channel->mNumPositionKeys; i++ ) - channel->mPositionKeys[ i ].mTime -= start_time_fps; - for ( uint32_t i = 0; i < channel->mNumRotationKeys; i++ ) - channel->mRotationKeys[ i ].mTime -= start_time_fps; - for ( uint32_t i = 0; i < channel->mNumScalingKeys; i++ ) - channel->mScalingKeys[ i ].mTime -= start_time_fps; - } - - // for some mysterious reason, mDuration is simply the maximum key -- the - // validator always assumes animations to start at zero. - anim->mDuration = stop_time_fps - start_time_fps; - anim->mTicksPerSecond = anim_fps; -} - -#ifdef ASSIMP_BUILD_DEBUG -// ------------------------------------------------------------------------------------------------ -// sanity check whether the input is ok -static void validateAnimCurveNodes( const std::vector& curves, - bool strictMode ) { - const Object* target( NULL ); - for( const AnimationCurveNode* node : curves ) { - if ( !target ) { - target = node->Target(); - } - if ( node->Target() != target ) { - FBXImporter::LogWarn( "Node target is nullptr type." ); - } - if ( strictMode ) { - ai_assert( node->Target() == target ); - } - } -} -#endif // ASSIMP_BUILD_DEBUG - -// ------------------------------------------------------------------------------------------------ -void FBXConverter::GenerateNodeAnimations( std::vector& node_anims, - const std::string& fixed_name, - const std::vector& curves, - const LayerMap& layer_map, - int64_t start, int64_t stop, - double& max_time, - double& min_time ) -{ - - NodeMap node_property_map; - ai_assert( curves.size() ); - -#ifdef ASSIMP_BUILD_DEBUG - validateAnimCurveNodes( curves, doc.Settings().strictMode ); -#endif - const AnimationCurveNode* curve_node = NULL; - for( const AnimationCurveNode* node : curves ) { - ai_assert( node ); - - if ( node->TargetProperty().empty() ) { - FBXImporter::LogWarn( "target property for animation curve not set: " + node->Name() ); - continue; - } - - curve_node = node; - if ( node->Curves().empty() ) { - FBXImporter::LogWarn( "no animation curves assigned to AnimationCurveNode: " + node->Name() ); - continue; - } - - node_property_map[ node->TargetProperty() ].push_back( node ); - } - - ai_assert( curve_node ); - ai_assert( curve_node->TargetAsModel() ); - - const Model& target = *curve_node->TargetAsModel(); - - // check for all possible transformation components - NodeMap::const_iterator chain[ TransformationComp_MAXIMUM ]; - - bool has_any = false; - bool has_complex = false; - - for ( size_t i = 0; i < TransformationComp_MAXIMUM; ++i ) { - const TransformationComp comp = static_cast( i ); - - // inverse pivots don't exist in the input, we just generate them - if ( comp == TransformationComp_RotationPivotInverse || comp == TransformationComp_ScalingPivotInverse ) { - chain[ i ] = node_property_map.end(); - continue; - } - - chain[ i ] = node_property_map.find( NameTransformationCompProperty( comp ) ); - if ( chain[ i ] != node_property_map.end() ) { - - // check if this curves contains redundant information by looking - // up the corresponding node's transformation chain. - if ( doc.Settings().optimizeEmptyAnimationCurves && - IsRedundantAnimationData( target, comp, ( *chain[ i ] ).second ) ) { - - FBXImporter::LogDebug( "dropping redundant animation channel for node " + target.Name() ); - continue; - } - - has_any = true; - - if ( comp != TransformationComp_Rotation && comp != TransformationComp_Scaling && comp != TransformationComp_Translation ) + switch (light.LightType()) { - has_complex = true; - } - } - } - - if ( !has_any ) { - FBXImporter::LogWarn( "ignoring node animation, did not find any transformation key frames" ); - return; - } - - // this needs to play nicely with GenerateTransformationNodeChain() which will - // be invoked _later_ (animations come first). If this node has only rotation, - // scaling and translation _and_ there are no animated other components either, - // we can use a single node and also a single node animation channel. - if ( !has_complex && !NeedsComplexTransformationChain( target ) ) { - - aiNodeAnim* const nd = GenerateSimpleNodeAnim( fixed_name, target, chain, - node_property_map.end(), - layer_map, - start, stop, - max_time, - min_time, - true // input is TRS order, assimp is SRT - ); - - ai_assert( nd ); - if ( nd->mNumPositionKeys == 0 && nd->mNumRotationKeys == 0 && nd->mNumScalingKeys == 0 ) { - delete nd; - } - else { - node_anims.push_back( nd ); - } - return; - } - - // otherwise, things get gruesome and we need separate animation channels - // for each part of the transformation chain. Remember which channels - // we generated and pass this information to the node conversion - // code to avoid nodes that have identity transform, but non-identity - // animations, being dropped. - unsigned int flags = 0, bit = 0x1; - for ( size_t i = 0; i < TransformationComp_MAXIMUM; ++i, bit <<= 1 ) { - const TransformationComp comp = static_cast( i ); - - if ( chain[ i ] != node_property_map.end() ) { - flags |= bit; - - ai_assert( comp != TransformationComp_RotationPivotInverse ); - ai_assert( comp != TransformationComp_ScalingPivotInverse ); - - const std::string& chain_name = NameTransformationChainNode( fixed_name, comp ); - - aiNodeAnim* na = nullptr; - switch ( comp ) - { - case TransformationComp_Rotation: - case TransformationComp_PreRotation: - case TransformationComp_PostRotation: - case TransformationComp_GeometricRotation: - na = GenerateRotationNodeAnim( chain_name, - target, - ( *chain[ i ] ).second, - layer_map, - start, stop, - max_time, - min_time ); - + case Light::Type_Point: + out_light->mType = aiLightSource_POINT; break; - case TransformationComp_RotationOffset: - case TransformationComp_RotationPivot: - case TransformationComp_ScalingOffset: - case TransformationComp_ScalingPivot: + case Light::Type_Directional: + out_light->mType = aiLightSource_DIRECTIONAL; + break; + + case Light::Type_Spot: + out_light->mType = aiLightSource_SPOT; + out_light->mAngleOuterCone = AI_DEG_TO_RAD(light.OuterAngle()); + out_light->mAngleInnerCone = AI_DEG_TO_RAD(light.InnerAngle()); + break; + + case Light::Type_Area: + FBXImporter::LogWarn("cannot represent area light, set to UNDEFINED"); + out_light->mType = aiLightSource_UNDEFINED; + break; + + case Light::Type_Volume: + FBXImporter::LogWarn("cannot represent volume light, set to UNDEFINED"); + out_light->mType = aiLightSource_UNDEFINED; + break; + default: + ai_assert(false); + } + + float decay = light.DecayStart(); + switch (light.DecayType()) + { + case Light::Decay_None: + out_light->mAttenuationConstant = decay; + out_light->mAttenuationLinear = 0.0f; + out_light->mAttenuationQuadratic = 0.0f; + break; + case Light::Decay_Linear: + out_light->mAttenuationConstant = 0.0f; + out_light->mAttenuationLinear = 2.0f / decay; + out_light->mAttenuationQuadratic = 0.0f; + break; + case Light::Decay_Quadratic: + out_light->mAttenuationConstant = 0.0f; + out_light->mAttenuationLinear = 0.0f; + out_light->mAttenuationQuadratic = 2.0f / (decay * decay); + break; + case Light::Decay_Cubic: + FBXImporter::LogWarn("cannot represent cubic attenuation, set to Quadratic"); + out_light->mAttenuationQuadratic = 1.0f; + break; + default: + ai_assert(false); + } + } + + void FBXConverter::ConvertCamera(const Camera& cam, const std::string &orig_name) + { + cameras.push_back(new aiCamera()); + aiCamera* const out_camera = cameras.back(); + + out_camera->mName.Set(orig_name); + + out_camera->mAspect = cam.AspectWidth() / cam.AspectHeight(); + + //cameras are defined along positive x direction + out_camera->mPosition = cam.Position(); + out_camera->mLookAt = (cam.InterestPosition() - out_camera->mPosition).Normalize(); + out_camera->mUp = cam.UpVector(); + + out_camera->mHorizontalFOV = AI_DEG_TO_RAD(cam.FieldOfView()); + out_camera->mClipPlaneNear = cam.NearPlane(); + out_camera->mClipPlaneFar = cam.FarPlane(); + } + + void FBXConverter::GetUniqueName(const std::string &name, std::string &uniqueName) + { + int i = 0; + uniqueName = name; + while (mNodeNames.find(uniqueName) != mNodeNames.end()) + { + ++i; + std::stringstream ext; + ext << name << std::setfill('0') << std::setw(3) << i; + uniqueName = ext.str(); + } + mNodeNames.insert(uniqueName); + } + + + const char* FBXConverter::NameTransformationComp(TransformationComp comp) { + switch (comp) { case TransformationComp_Translation: + return "Translation"; + case TransformationComp_RotationOffset: + return "RotationOffset"; + case TransformationComp_RotationPivot: + return "RotationPivot"; + case TransformationComp_PreRotation: + return "PreRotation"; + case TransformationComp_Rotation: + return "Rotation"; + case TransformationComp_PostRotation: + return "PostRotation"; + case TransformationComp_RotationPivotInverse: + return "RotationPivotInverse"; + case TransformationComp_ScalingOffset: + return "ScalingOffset"; + case TransformationComp_ScalingPivot: + return "ScalingPivot"; + case TransformationComp_Scaling: + return "Scaling"; + case TransformationComp_ScalingPivotInverse: + return "ScalingPivotInverse"; + case TransformationComp_GeometricScaling: + return "GeometricScaling"; + case TransformationComp_GeometricRotation: + return "GeometricRotation"; case TransformationComp_GeometricTranslation: - na = GenerateTranslationNodeAnim( chain_name, - target, - ( *chain[ i ] ).second, - layer_map, - start, stop, - max_time, - min_time ); + return "GeometricTranslation"; + case TransformationComp_GeometricScalingInverse: + return "GeometricScalingInverse"; + case TransformationComp_GeometricRotationInverse: + return "GeometricRotationInverse"; + case TransformationComp_GeometricTranslationInverse: + return "GeometricTranslationInverse"; + case TransformationComp_MAXIMUM: // this is to silence compiler warnings + default: + break; + } - // pivoting requires us to generate an implicit inverse channel to undo the pivot translation - if ( comp == TransformationComp_RotationPivot ) { - const std::string& invName = NameTransformationChainNode( fixed_name, - TransformationComp_RotationPivotInverse ); + ai_assert(false); - aiNodeAnim* const inv = GenerateTranslationNodeAnim( invName, - target, - ( *chain[ i ] ).second, - layer_map, - start, stop, - max_time, - min_time, - true ); + return nullptr; + } - ai_assert( inv ); - if ( inv->mNumPositionKeys == 0 && inv->mNumRotationKeys == 0 && inv->mNumScalingKeys == 0 ) { - delete inv; - } - else { - node_anims.push_back( inv ); - } + const char* FBXConverter::NameTransformationCompProperty(TransformationComp comp) { + switch (comp) { + case TransformationComp_Translation: + return "Lcl Translation"; + case TransformationComp_RotationOffset: + return "RotationOffset"; + case TransformationComp_RotationPivot: + return "RotationPivot"; + case TransformationComp_PreRotation: + return "PreRotation"; + case TransformationComp_Rotation: + return "Lcl Rotation"; + case TransformationComp_PostRotation: + return "PostRotation"; + case TransformationComp_RotationPivotInverse: + return "RotationPivotInverse"; + case TransformationComp_ScalingOffset: + return "ScalingOffset"; + case TransformationComp_ScalingPivot: + return "ScalingPivot"; + case TransformationComp_Scaling: + return "Lcl Scaling"; + case TransformationComp_ScalingPivotInverse: + return "ScalingPivotInverse"; + case TransformationComp_GeometricScaling: + return "GeometricScaling"; + case TransformationComp_GeometricRotation: + return "GeometricRotation"; + case TransformationComp_GeometricTranslation: + return "GeometricTranslation"; + case TransformationComp_GeometricScalingInverse: + return "GeometricScalingInverse"; + case TransformationComp_GeometricRotationInverse: + return "GeometricRotationInverse"; + case TransformationComp_GeometricTranslationInverse: + return "GeometricTranslationInverse"; + case TransformationComp_MAXIMUM: // this is to silence compiler warnings + break; + } - ai_assert( TransformationComp_RotationPivotInverse > i ); - flags |= bit << ( TransformationComp_RotationPivotInverse - i ); - } - else if ( comp == TransformationComp_ScalingPivot ) { - const std::string& invName = NameTransformationChainNode( fixed_name, - TransformationComp_ScalingPivotInverse ); + ai_assert(false); - aiNodeAnim* const inv = GenerateTranslationNodeAnim( invName, - target, - ( *chain[ i ] ).second, - layer_map, - start, stop, - max_time, - min_time, - true ); + return nullptr; + } - ai_assert( inv ); - if ( inv->mNumPositionKeys == 0 && inv->mNumRotationKeys == 0 && inv->mNumScalingKeys == 0 ) { - delete inv; - } - else { - node_anims.push_back( inv ); - } + aiVector3D FBXConverter::TransformationCompDefaultValue(TransformationComp comp) + { + // XXX a neat way to solve the never-ending special cases for scaling + // would be to do everything in log space! + return comp == TransformationComp_Scaling ? aiVector3D(1.f, 1.f, 1.f) : aiVector3D(); + } - ai_assert( TransformationComp_RotationPivotInverse > i ); - flags |= bit << ( TransformationComp_RotationPivotInverse - i ); - } + void FBXConverter::GetRotationMatrix(Model::RotOrder mode, const aiVector3D& rotation, aiMatrix4x4& out) + { + if (mode == Model::RotOrder_SphericXYZ) { + FBXImporter::LogError("Unsupported RotationMode: SphericXYZ"); + out = aiMatrix4x4(); + return; + } + const float angle_epsilon = 1e-6f; + + out = aiMatrix4x4(); + + bool is_id[3] = { true, true, true }; + + aiMatrix4x4 temp[3]; + if (std::fabs(rotation.z) > angle_epsilon) { + aiMatrix4x4::RotationZ(AI_DEG_TO_RAD(rotation.z), temp[2]); + is_id[2] = false; + } + if (std::fabs(rotation.y) > angle_epsilon) { + aiMatrix4x4::RotationY(AI_DEG_TO_RAD(rotation.y), temp[1]); + is_id[1] = false; + } + if (std::fabs(rotation.x) > angle_epsilon) { + aiMatrix4x4::RotationX(AI_DEG_TO_RAD(rotation.x), temp[0]); + is_id[0] = false; + } + + int order[3] = { -1, -1, -1 }; + + // note: rotation order is inverted since we're left multiplying as is usual in assimp + switch (mode) + { + case Model::RotOrder_EulerXYZ: + order[0] = 2; + order[1] = 1; + order[2] = 0; break; - case TransformationComp_Scaling: - case TransformationComp_GeometricScaling: - na = GenerateScalingNodeAnim( chain_name, - target, - ( *chain[ i ] ).second, - layer_map, - start, stop, - max_time, - min_time ); + case Model::RotOrder_EulerXZY: + order[0] = 1; + order[1] = 2; + order[2] = 0; + break; + case Model::RotOrder_EulerYZX: + order[0] = 0; + order[1] = 2; + order[2] = 1; + break; + + case Model::RotOrder_EulerYXZ: + order[0] = 2; + order[1] = 0; + order[2] = 1; + break; + + case Model::RotOrder_EulerZXY: + order[0] = 1; + order[1] = 0; + order[2] = 2; + break; + + case Model::RotOrder_EulerZYX: + order[0] = 0; + order[1] = 1; + order[2] = 2; break; default: - ai_assert( false ); + ai_assert(false); + break; } - ai_assert( na ); - if ( na->mNumPositionKeys == 0 && na->mNumRotationKeys == 0 && na->mNumScalingKeys == 0 ) { - delete na; + ai_assert(order[0] >= 0); + ai_assert(order[0] <= 2); + ai_assert(order[1] >= 0); + ai_assert(order[1] <= 2); + ai_assert(order[2] >= 0); + ai_assert(order[2] <= 2); + + if (!is_id[order[0]]) { + out = temp[order[0]]; } - else { - node_anims.push_back( na ); + + if (!is_id[order[1]]) { + out = out * temp[order[1]]; } - continue; - } - } - node_anim_chain_bits[ fixed_name ] = flags; -} - -bool FBXConverter::IsRedundantAnimationData( const Model& target, - TransformationComp comp, - const std::vector& curves ) { - ai_assert( curves.size() ); - - // look for animation nodes with - // * sub channels for all relevant components set - // * one key/value pair per component - // * combined values match up the corresponding value in the bind pose node transformation - // only such nodes are 'redundant' for this function. - - if ( curves.size() > 1 ) { - return false; - } - - const AnimationCurveNode& nd = *curves.front(); - const AnimationCurveMap& sub_curves = nd.Curves(); - - const AnimationCurveMap::const_iterator dx = sub_curves.find( "d|X" ); - const AnimationCurveMap::const_iterator dy = sub_curves.find( "d|Y" ); - const AnimationCurveMap::const_iterator dz = sub_curves.find( "d|Z" ); - - if ( dx == sub_curves.end() || dy == sub_curves.end() || dz == sub_curves.end() ) { - return false; - } - - const KeyValueList& vx = ( *dx ).second->GetValues(); - const KeyValueList& vy = ( *dy ).second->GetValues(); - const KeyValueList& vz = ( *dz ).second->GetValues(); - - if ( vx.size() != 1 || vy.size() != 1 || vz.size() != 1 ) { - return false; - } - - const aiVector3D dyn_val = aiVector3D( vx[ 0 ], vy[ 0 ], vz[ 0 ] ); - const aiVector3D& static_val = PropertyGet( target.Props(), - NameTransformationCompProperty( comp ), - TransformationCompDefaultValue( comp ) - ); - - const float epsilon = 1e-6f; - return ( dyn_val - static_val ).SquareLength() < epsilon; -} - - -aiNodeAnim* FBXConverter::GenerateRotationNodeAnim( const std::string& name, - const Model& target, - const std::vector& curves, - const LayerMap& layer_map, - int64_t start, int64_t stop, - double& max_time, - double& min_time ) -{ - std::unique_ptr na( new aiNodeAnim() ); - na->mNodeName.Set( name ); - - ConvertRotationKeys( na.get(), curves, layer_map, start, stop, max_time, min_time, target.RotationOrder() ); - - // dummy scaling key - na->mScalingKeys = new aiVectorKey[ 1 ]; - na->mNumScalingKeys = 1; - - na->mScalingKeys[ 0 ].mTime = 0.; - na->mScalingKeys[ 0 ].mValue = aiVector3D( 1.0f, 1.0f, 1.0f ); - - // dummy position key - na->mPositionKeys = new aiVectorKey[ 1 ]; - na->mNumPositionKeys = 1; - - na->mPositionKeys[ 0 ].mTime = 0.; - na->mPositionKeys[ 0 ].mValue = aiVector3D(); - - return na.release(); -} - -aiNodeAnim* FBXConverter::GenerateScalingNodeAnim( const std::string& name, - const Model& /*target*/, - const std::vector& curves, - const LayerMap& layer_map, - int64_t start, int64_t stop, - double& max_time, - double& min_time ) -{ - std::unique_ptr na( new aiNodeAnim() ); - na->mNodeName.Set( name ); - - ConvertScaleKeys( na.get(), curves, layer_map, start, stop, max_time, min_time ); - - // dummy rotation key - na->mRotationKeys = new aiQuatKey[ 1 ]; - na->mNumRotationKeys = 1; - - na->mRotationKeys[ 0 ].mTime = 0.; - na->mRotationKeys[ 0 ].mValue = aiQuaternion(); - - // dummy position key - na->mPositionKeys = new aiVectorKey[ 1 ]; - na->mNumPositionKeys = 1; - - na->mPositionKeys[ 0 ].mTime = 0.; - na->mPositionKeys[ 0 ].mValue = aiVector3D(); - - return na.release(); -} - -aiNodeAnim* FBXConverter::GenerateTranslationNodeAnim( const std::string& name, - const Model& /*target*/, - const std::vector& curves, - const LayerMap& layer_map, - int64_t start, int64_t stop, - double& max_time, - double& min_time, - bool inverse ) { - std::unique_ptr na( new aiNodeAnim() ); - na->mNodeName.Set( name ); - - ConvertTranslationKeys( na.get(), curves, layer_map, start, stop, max_time, min_time ); - - if ( inverse ) { - for ( unsigned int i = 0; i < na->mNumPositionKeys; ++i ) { - na->mPositionKeys[ i ].mValue *= -1.0f; - } - } - - // dummy scaling key - na->mScalingKeys = new aiVectorKey[ 1 ]; - na->mNumScalingKeys = 1; - - na->mScalingKeys[ 0 ].mTime = 0.; - na->mScalingKeys[ 0 ].mValue = aiVector3D( 1.0f, 1.0f, 1.0f ); - - // dummy rotation key - na->mRotationKeys = new aiQuatKey[ 1 ]; - na->mNumRotationKeys = 1; - - na->mRotationKeys[ 0 ].mTime = 0.; - na->mRotationKeys[ 0 ].mValue = aiQuaternion(); - - return na.release(); -} - -aiNodeAnim* FBXConverter::GenerateSimpleNodeAnim( const std::string& name, - const Model& target, - NodeMap::const_iterator chain[ TransformationComp_MAXIMUM ], - NodeMap::const_iterator iter_end, - const LayerMap& layer_map, - int64_t start, int64_t stop, - double& max_time, - double& min_time, - bool reverse_order ) - -{ - std::unique_ptr na( new aiNodeAnim() ); - na->mNodeName.Set( name ); - - const PropertyTable& props = target.Props(); - - // need to convert from TRS order to SRT? - if ( reverse_order ) { - - aiVector3D def_scale = PropertyGet( props, "Lcl Scaling", aiVector3D( 1.f, 1.f, 1.f ) ); - aiVector3D def_translate = PropertyGet( props, "Lcl Translation", aiVector3D( 0.f, 0.f, 0.f ) ); - aiVector3D def_rot = PropertyGet( props, "Lcl Rotation", aiVector3D( 0.f, 0.f, 0.f ) ); - - KeyFrameListList scaling; - KeyFrameListList translation; - KeyFrameListList rotation; - - if ( chain[ TransformationComp_Scaling ] != iter_end ) { - scaling = GetKeyframeList( ( *chain[ TransformationComp_Scaling ] ).second, start, stop ); + if (!is_id[order[2]]) { + out = out * temp[order[2]]; + } } - if ( chain[ TransformationComp_Translation ] != iter_end ) { - translation = GetKeyframeList( ( *chain[ TransformationComp_Translation ] ).second, start, stop ); - } - - if ( chain[ TransformationComp_Rotation ] != iter_end ) { - rotation = GetKeyframeList( ( *chain[ TransformationComp_Rotation ] ).second, start, stop ); - } - - KeyFrameListList joined; - joined.insert( joined.end(), scaling.begin(), scaling.end() ); - joined.insert( joined.end(), translation.begin(), translation.end() ); - joined.insert( joined.end(), rotation.begin(), rotation.end() ); - - const KeyTimeList& times = GetKeyTimeList( joined ); - - aiQuatKey* out_quat = new aiQuatKey[ times.size() ]; - aiVectorKey* out_scale = new aiVectorKey[ times.size() ]; - aiVectorKey* out_translation = new aiVectorKey[ times.size() ]; - - if ( times.size() ) + bool FBXConverter::NeedsComplexTransformationChain(const Model& model) { - ConvertTransformOrder_TRStoSRT( out_quat, out_scale, out_translation, - scaling, - translation, - rotation, - times, - max_time, - min_time, - target.RotationOrder(), - def_scale, - def_translate, - def_rot ); - } + const PropertyTable& props = model.Props(); + bool ok; - // XXX remove duplicates / redundant keys which this operation did - // likely produce if not all three channels were equally dense. + const float zero_epsilon = 1e-6f; + const aiVector3D all_ones(1.0f, 1.0f, 1.0f); + for (size_t i = 0; i < TransformationComp_MAXIMUM; ++i) { + const TransformationComp comp = static_cast(i); - na->mNumScalingKeys = static_cast( times.size() ); - na->mNumRotationKeys = na->mNumScalingKeys; - na->mNumPositionKeys = na->mNumScalingKeys; + if (comp == TransformationComp_Rotation || comp == TransformationComp_Scaling || comp == TransformationComp_Translation) { + continue; + } - na->mScalingKeys = out_scale; - na->mRotationKeys = out_quat; - na->mPositionKeys = out_translation; - } - else { + bool scale_compare = (comp == TransformationComp_GeometricScaling || comp == TransformationComp_Scaling); - // if a particular transformation is not given, grab it from - // the corresponding node to meet the semantics of aiNodeAnim, - // which requires all of rotation, scaling and translation - // to be set. - if ( chain[ TransformationComp_Scaling ] != iter_end ) { - ConvertScaleKeys( na.get(), ( *chain[ TransformationComp_Scaling ] ).second, - layer_map, - start, stop, - max_time, - min_time ); - } - else { - na->mScalingKeys = new aiVectorKey[ 1 ]; - na->mNumScalingKeys = 1; - - na->mScalingKeys[ 0 ].mTime = 0.; - na->mScalingKeys[ 0 ].mValue = PropertyGet( props, "Lcl Scaling", - aiVector3D( 1.f, 1.f, 1.f ) ); - } - - if ( chain[ TransformationComp_Rotation ] != iter_end ) { - ConvertRotationKeys( na.get(), ( *chain[ TransformationComp_Rotation ] ).second, - layer_map, - start, stop, - max_time, - min_time, - target.RotationOrder() ); - } - else { - na->mRotationKeys = new aiQuatKey[ 1 ]; - na->mNumRotationKeys = 1; - - na->mRotationKeys[ 0 ].mTime = 0.; - na->mRotationKeys[ 0 ].mValue = EulerToQuaternion( - PropertyGet( props, "Lcl Rotation", aiVector3D( 0.f, 0.f, 0.f ) ), - target.RotationOrder() ); - } - - if ( chain[ TransformationComp_Translation ] != iter_end ) { - ConvertTranslationKeys( na.get(), ( *chain[ TransformationComp_Translation ] ).second, - layer_map, - start, stop, - max_time, - min_time ); - } - else { - na->mPositionKeys = new aiVectorKey[ 1 ]; - na->mNumPositionKeys = 1; - - na->mPositionKeys[ 0 ].mTime = 0.; - na->mPositionKeys[ 0 ].mValue = PropertyGet( props, "Lcl Translation", - aiVector3D( 0.f, 0.f, 0.f ) ); - } - - } - return na.release(); -} - -FBXConverter::KeyFrameListList FBXConverter::GetKeyframeList( const std::vector& nodes, int64_t start, int64_t stop ) -{ - KeyFrameListList inputs; - inputs.reserve( nodes.size() * 3 ); - - //give some breathing room for rounding errors - int64_t adj_start = start - 10000; - int64_t adj_stop = stop + 10000; - - for( const AnimationCurveNode* node : nodes ) { - ai_assert( node ); - - const AnimationCurveMap& curves = node->Curves(); - for( const AnimationCurveMap::value_type& kv : curves ) { - - unsigned int mapto; - if ( kv.first == "d|X" ) { - mapto = 0; - } - else if ( kv.first == "d|Y" ) { - mapto = 1; - } - else if ( kv.first == "d|Z" ) { - mapto = 2; - } - else { - FBXImporter::LogWarn( "ignoring scale animation curve, did not recognize target component" ); - continue; - } - - const AnimationCurve* const curve = kv.second; - ai_assert( curve->GetKeys().size() == curve->GetValues().size() && curve->GetKeys().size() ); - - //get values within the start/stop time window - std::shared_ptr Keys( new KeyTimeList() ); - std::shared_ptr Values( new KeyValueList() ); - const size_t count = curve->GetKeys().size(); - Keys->reserve( count ); - Values->reserve( count ); - for (size_t n = 0; n < count; n++ ) - { - int64_t k = curve->GetKeys().at( n ); - if ( k >= adj_start && k <= adj_stop ) - { - Keys->push_back( k ); - Values->push_back( curve->GetValues().at( n ) ); + const aiVector3D& v = PropertyGet(props, NameTransformationCompProperty(comp), ok); + if (ok && scale_compare) { + if ((v - all_ones).SquareLength() > zero_epsilon) { + return true; + } + } + else if (ok) { + if (v.SquareLength() > zero_epsilon) { + return true; + } } } - inputs.push_back( std::make_tuple( Keys, Values, mapto ) ); - } - } - return inputs; // pray for NRVO :-) -} - - -KeyTimeList FBXConverter::GetKeyTimeList( const KeyFrameListList& inputs ) { - ai_assert( !inputs.empty() ); - - // reserve some space upfront - it is likely that the key-frame lists - // have matching time values, so max(of all key-frame lists) should - // be a good estimate. - KeyTimeList keys; - - size_t estimate = 0; - for( const KeyFrameList& kfl : inputs ) { - estimate = std::max( estimate, std::get<0>(kfl)->size() ); - } - - keys.reserve( estimate ); - - std::vector next_pos; - next_pos.resize( inputs.size(), 0 ); - - const size_t count = inputs.size(); - while ( true ) { - - int64_t min_tick = std::numeric_limits::max(); - for ( size_t i = 0; i < count; ++i ) { - const KeyFrameList& kfl = inputs[ i ]; - - if ( std::get<0>(kfl)->size() > next_pos[ i ] && std::get<0>(kfl)->at( next_pos[ i ] ) < min_tick ) { - min_tick = std::get<0>(kfl)->at( next_pos[ i ] ); - } + return false; } - if ( min_tick == std::numeric_limits::max() ) { - break; - } - keys.push_back( min_tick ); - - for ( size_t i = 0; i < count; ++i ) { - const KeyFrameList& kfl = inputs[ i ]; - - - while ( std::get<0>(kfl)->size() > next_pos[ i ] && std::get<0>(kfl)->at( next_pos[ i ] ) == min_tick ) { - ++next_pos[ i ]; - } - } - } - - return keys; -} - -void FBXConverter::InterpolateKeys( aiVectorKey* valOut, const KeyTimeList& keys, const KeyFrameListList& inputs, - const aiVector3D& def_value, - double& max_time, - double& min_time ) { - ai_assert( !keys.empty() ); - ai_assert( nullptr != valOut ); - - std::vector next_pos; - const size_t count( inputs.size() ); - - next_pos.resize( inputs.size(), 0 ); - - for( KeyTimeList::value_type time : keys ) { - ai_real result[ 3 ] = { def_value.x, def_value.y, def_value.z }; - - for ( size_t i = 0; i < count; ++i ) { - const KeyFrameList& kfl = inputs[ i ]; - - const size_t ksize = std::get<0>(kfl)->size(); - if (ksize == 0) { - continue; - } - if ( ksize > next_pos[ i ] && std::get<0>(kfl)->at( next_pos[ i ] ) == time ) { - ++next_pos[ i ]; - } - - const size_t id0 = next_pos[ i ]>0 ? next_pos[ i ] - 1 : 0; - const size_t id1 = next_pos[ i ] == ksize ? ksize - 1 : next_pos[ i ]; - - // use lerp for interpolation - const KeyValueList::value_type valueA = std::get<1>(kfl)->at( id0 ); - const KeyValueList::value_type valueB = std::get<1>(kfl)->at( id1 ); - - const KeyTimeList::value_type timeA = std::get<0>(kfl)->at( id0 ); - const KeyTimeList::value_type timeB = std::get<0>(kfl)->at( id1 ); - - const ai_real factor = timeB == timeA ? ai_real(0.) : static_cast( ( time - timeA ) ) / ( timeB - timeA ); - const ai_real interpValue = static_cast( valueA + ( valueB - valueA ) * factor ); - - result[ std::get<2>(kfl) ] = interpValue; - } - - // magic value to convert fbx times to seconds - valOut->mTime = CONVERT_FBX_TIME( time ) * anim_fps; - - min_time = std::min( min_time, valOut->mTime ); - max_time = std::max( max_time, valOut->mTime ); - - valOut->mValue.x = result[ 0 ]; - valOut->mValue.y = result[ 1 ]; - valOut->mValue.z = result[ 2 ]; - - ++valOut; - } -} - -void FBXConverter::InterpolateKeys( aiQuatKey* valOut, const KeyTimeList& keys, const KeyFrameListList& inputs, - const aiVector3D& def_value, - double& maxTime, - double& minTime, - Model::RotOrder order ) -{ - ai_assert( !keys.empty() ); - ai_assert( nullptr != valOut ); - - std::unique_ptr temp( new aiVectorKey[ keys.size() ] ); - InterpolateKeys( temp.get(), keys, inputs, def_value, maxTime, minTime ); - - aiMatrix4x4 m; - - aiQuaternion lastq; - - for ( size_t i = 0, c = keys.size(); i < c; ++i ) { - - valOut[ i ].mTime = temp[ i ].mTime; - - GetRotationMatrix( order, temp[ i ].mValue, m ); - aiQuaternion quat = aiQuaternion( aiMatrix3x3( m ) ); - - // take shortest path by checking the inner product - // http://www.3dkingdoms.com/weekly/weekly.php?a=36 - if ( quat.x * lastq.x + quat.y * lastq.y + quat.z * lastq.z + quat.w * lastq.w < 0 ) + std::string FBXConverter::NameTransformationChainNode(const std::string& name, TransformationComp comp) { - quat.x = -quat.x; - quat.y = -quat.y; - quat.z = -quat.z; - quat.w = -quat.w; + return name + std::string(MAGIC_NODE_TAG) + "_" + NameTransformationComp(comp); } - lastq = quat; - valOut[ i ].mValue = quat; - } -} + void FBXConverter::GenerateTransformationNodeChain(const Model& model, std::vector& output_nodes, + std::vector& post_output_nodes) { + const PropertyTable& props = model.Props(); + const Model::RotOrder rot = model.RotationOrder(); -void FBXConverter::ConvertTransformOrder_TRStoSRT( aiQuatKey* out_quat, aiVectorKey* out_scale, - aiVectorKey* out_translation, - const KeyFrameListList& scaling, - const KeyFrameListList& translation, - const KeyFrameListList& rotation, - const KeyTimeList& times, - double& maxTime, - double& minTime, - Model::RotOrder order, - const aiVector3D& def_scale, - const aiVector3D& def_translate, - const aiVector3D& def_rotation ) -{ - if ( rotation.size() ) { - InterpolateKeys( out_quat, times, rotation, def_rotation, maxTime, minTime, order ); - } - else { - for ( size_t i = 0; i < times.size(); ++i ) { - out_quat[ i ].mTime = CONVERT_FBX_TIME( times[ i ] ) * anim_fps; - out_quat[ i ].mValue = EulerToQuaternion( def_rotation, order ); + bool ok; + + aiMatrix4x4 chain[TransformationComp_MAXIMUM]; + std::fill_n(chain, static_cast(TransformationComp_MAXIMUM), aiMatrix4x4()); + + // generate transformation matrices for all the different transformation components + const float zero_epsilon = 1e-6f; + const aiVector3D all_ones(1.0f, 1.0f, 1.0f); + bool is_complex = false; + + const aiVector3D& PreRotation = PropertyGet(props, "PreRotation", ok); + if (ok && PreRotation.SquareLength() > zero_epsilon) { + is_complex = true; + + GetRotationMatrix(Model::RotOrder::RotOrder_EulerXYZ, PreRotation, chain[TransformationComp_PreRotation]); + } + + const aiVector3D& PostRotation = PropertyGet(props, "PostRotation", ok); + if (ok && PostRotation.SquareLength() > zero_epsilon) { + is_complex = true; + + GetRotationMatrix(Model::RotOrder::RotOrder_EulerXYZ, PostRotation, chain[TransformationComp_PostRotation]); + } + + const aiVector3D& RotationPivot = PropertyGet(props, "RotationPivot", ok); + if (ok && RotationPivot.SquareLength() > zero_epsilon) { + is_complex = true; + + aiMatrix4x4::Translation(RotationPivot, chain[TransformationComp_RotationPivot]); + aiMatrix4x4::Translation(-RotationPivot, chain[TransformationComp_RotationPivotInverse]); + } + + const aiVector3D& RotationOffset = PropertyGet(props, "RotationOffset", ok); + if (ok && RotationOffset.SquareLength() > zero_epsilon) { + is_complex = true; + + aiMatrix4x4::Translation(RotationOffset, chain[TransformationComp_RotationOffset]); + } + + const aiVector3D& ScalingOffset = PropertyGet(props, "ScalingOffset", ok); + if (ok && ScalingOffset.SquareLength() > zero_epsilon) { + is_complex = true; + + aiMatrix4x4::Translation(ScalingOffset, chain[TransformationComp_ScalingOffset]); + } + + const aiVector3D& ScalingPivot = PropertyGet(props, "ScalingPivot", ok); + if (ok && ScalingPivot.SquareLength() > zero_epsilon) { + is_complex = true; + + aiMatrix4x4::Translation(ScalingPivot, chain[TransformationComp_ScalingPivot]); + aiMatrix4x4::Translation(-ScalingPivot, chain[TransformationComp_ScalingPivotInverse]); + } + + const aiVector3D& Translation = PropertyGet(props, "Lcl Translation", ok); + if (ok && Translation.SquareLength() > zero_epsilon) { + aiMatrix4x4::Translation(Translation, chain[TransformationComp_Translation]); + } + + const aiVector3D& Scaling = PropertyGet(props, "Lcl Scaling", ok); + if (ok && (Scaling - all_ones).SquareLength() > zero_epsilon) { + aiMatrix4x4::Scaling(Scaling, chain[TransformationComp_Scaling]); + } + + const aiVector3D& Rotation = PropertyGet(props, "Lcl Rotation", ok); + if (ok && Rotation.SquareLength() > zero_epsilon) { + GetRotationMatrix(rot, Rotation, chain[TransformationComp_Rotation]); + } + + const aiVector3D& GeometricScaling = PropertyGet(props, "GeometricScaling", ok); + if (ok && (GeometricScaling - all_ones).SquareLength() > zero_epsilon) { + is_complex = true; + aiMatrix4x4::Scaling(GeometricScaling, chain[TransformationComp_GeometricScaling]); + aiVector3D GeometricScalingInverse = GeometricScaling; + bool canscale = true; + for (unsigned int i = 0; i < 3; ++i) { + if (std::fabs(GeometricScalingInverse[i]) > zero_epsilon) { + GeometricScalingInverse[i] = 1.0f / GeometricScaling[i]; + } + else { + FBXImporter::LogError("cannot invert geometric scaling matrix with a 0.0 scale component"); + canscale = false; + break; + } + } + if (canscale) { + aiMatrix4x4::Scaling(GeometricScalingInverse, chain[TransformationComp_GeometricScalingInverse]); + } + } + + const aiVector3D& GeometricRotation = PropertyGet(props, "GeometricRotation", ok); + if (ok && GeometricRotation.SquareLength() > zero_epsilon) { + is_complex = true; + GetRotationMatrix(rot, GeometricRotation, chain[TransformationComp_GeometricRotation]); + GetRotationMatrix(rot, GeometricRotation, chain[TransformationComp_GeometricRotationInverse]); + chain[TransformationComp_GeometricRotationInverse].Inverse(); + } + + const aiVector3D& GeometricTranslation = PropertyGet(props, "GeometricTranslation", ok); + if (ok && GeometricTranslation.SquareLength() > zero_epsilon) { + is_complex = true; + aiMatrix4x4::Translation(GeometricTranslation, chain[TransformationComp_GeometricTranslation]); + aiMatrix4x4::Translation(-GeometricTranslation, chain[TransformationComp_GeometricTranslationInverse]); + } + + // is_complex needs to be consistent with NeedsComplexTransformationChain() + // or the interplay between this code and the animation converter would + // not be guaranteed. + ai_assert(NeedsComplexTransformationChain(model) == is_complex); + + std::string name = FixNodeName(model.Name()); + + // now, if we have more than just Translation, Scaling and Rotation, + // we need to generate a full node chain to accommodate for assimp's + // lack to express pivots and offsets. + if (is_complex && doc.Settings().preservePivots) { + FBXImporter::LogInfo("generating full transformation chain for node: " + name); + + // query the anim_chain_bits dictionary to find out which chain elements + // have associated node animation channels. These can not be dropped + // even if they have identity transform in bind pose. + NodeAnimBitMap::const_iterator it = node_anim_chain_bits.find(name); + const unsigned int anim_chain_bitmask = (it == node_anim_chain_bits.end() ? 0 : (*it).second); + + unsigned int bit = 0x1; + for (size_t i = 0; i < TransformationComp_MAXIMUM; ++i, bit <<= 1) { + const TransformationComp comp = static_cast(i); + + if (chain[i].IsIdentity() && (anim_chain_bitmask & bit) == 0) { + continue; + } + + if (comp == TransformationComp_PostRotation) { + chain[i] = chain[i].Inverse(); + } + + aiNode* nd = new aiNode(); + nd->mName.Set(NameTransformationChainNode(name, comp)); + nd->mTransformation = chain[i]; + + // geometric inverses go in a post-node chain + if (comp == TransformationComp_GeometricScalingInverse || + comp == TransformationComp_GeometricRotationInverse || + comp == TransformationComp_GeometricTranslationInverse + ) { + post_output_nodes.push_back(nd); + } + else { + output_nodes.push_back(nd); + } + } + + ai_assert(output_nodes.size()); + return; + } + + // else, we can just multiply the matrices together + aiNode* nd = new aiNode(); + output_nodes.push_back(nd); + std::string uniqueName; + GetUniqueName(name, uniqueName); + + nd->mName.Set(uniqueName); + + for (const auto &transform : chain) { + nd->mTransformation = nd->mTransformation * transform; + } } - } - if ( scaling.size() ) { - InterpolateKeys( out_scale, times, scaling, def_scale, maxTime, minTime ); - } - else { - for ( size_t i = 0; i < times.size(); ++i ) { - out_scale[ i ].mTime = CONVERT_FBX_TIME( times[ i ] ) * anim_fps; - out_scale[ i ].mValue = def_scale; + void FBXConverter::SetupNodeMetadata(const Model& model, aiNode& nd) + { + const PropertyTable& props = model.Props(); + DirectPropertyMap unparsedProperties = props.GetUnparsedProperties(); + + // create metadata on node + const std::size_t numStaticMetaData = 2; + aiMetadata* data = aiMetadata::Alloc(static_cast(unparsedProperties.size() + numStaticMetaData)); + nd.mMetaData = data; + int index = 0; + + // find user defined properties (3ds Max) + data->Set(index++, "UserProperties", aiString(PropertyGet(props, "UDP3DSMAX", ""))); + // preserve the info that a node was marked as Null node in the original file. + data->Set(index++, "IsNull", model.IsNull() ? true : false); + + // add unparsed properties to the node's metadata + for (const DirectPropertyMap::value_type& prop : unparsedProperties) { + // Interpret the property as a concrete type + if (const TypedProperty* interpreted = prop.second->As >()) { + data->Set(index++, prop.first, interpreted->Value()); + } + else if (const TypedProperty* interpreted = prop.second->As >()) { + data->Set(index++, prop.first, interpreted->Value()); + } + else if (const TypedProperty* interpreted = prop.second->As >()) { + data->Set(index++, prop.first, interpreted->Value()); + } + else if (const TypedProperty* interpreted = prop.second->As >()) { + data->Set(index++, prop.first, interpreted->Value()); + } + else if (const TypedProperty* interpreted = prop.second->As >()) { + data->Set(index++, prop.first, aiString(interpreted->Value())); + } + else if (const TypedProperty* interpreted = prop.second->As >()) { + data->Set(index++, prop.first, interpreted->Value()); + } + else { + ai_assert(false); + } + } } - } - if ( translation.size() ) { - InterpolateKeys( out_translation, times, translation, def_translate, maxTime, minTime ); - } - else { - for ( size_t i = 0; i < times.size(); ++i ) { - out_translation[ i ].mTime = CONVERT_FBX_TIME( times[ i ] ) * anim_fps; - out_translation[ i ].mValue = def_translate; + void FBXConverter::ConvertModel(const Model& model, aiNode& nd, const aiMatrix4x4& node_global_transform) + { + const std::vector& geos = model.GetGeometry(); + + std::vector meshes; + meshes.reserve(geos.size()); + + for (const Geometry* geo : geos) { + + const MeshGeometry* const mesh = dynamic_cast(geo); + if (mesh) { + const std::vector& indices = ConvertMesh(*mesh, model, node_global_transform, nd); + std::copy(indices.begin(), indices.end(), std::back_inserter(meshes)); + } + else { + FBXImporter::LogWarn("ignoring unrecognized geometry: " + geo->Name()); + } + } + + if (meshes.size()) { + nd.mMeshes = new unsigned int[meshes.size()](); + nd.mNumMeshes = static_cast(meshes.size()); + + std::swap_ranges(meshes.begin(), meshes.end(), nd.mMeshes); + } } - } - const size_t count = times.size(); - for ( size_t i = 0; i < count; ++i ) { - aiQuaternion& r = out_quat[ i ].mValue; - aiVector3D& s = out_scale[ i ].mValue; - aiVector3D& t = out_translation[ i ].mValue; + std::vector FBXConverter::ConvertMesh(const MeshGeometry& mesh, const Model& model, + const aiMatrix4x4& node_global_transform, aiNode& nd) + { + std::vector temp; - aiMatrix4x4 mat, temp; - aiMatrix4x4::Translation( t, mat ); - mat *= aiMatrix4x4( r.GetMatrix() ); - mat *= aiMatrix4x4::Scaling( s, temp ); + MeshMap::const_iterator it = meshes_converted.find(&mesh); + if (it != meshes_converted.end()) { + std::copy((*it).second.begin(), (*it).second.end(), std::back_inserter(temp)); + return temp; + } - mat.Decompose( s, r, t ); - } -} + const std::vector& vertices = mesh.GetVertices(); + const std::vector& faces = mesh.GetFaceIndexCounts(); + if (vertices.empty() || faces.empty()) { + FBXImporter::LogWarn("ignoring empty geometry: " + mesh.Name()); + return temp; + } -aiQuaternion FBXConverter::EulerToQuaternion( const aiVector3D& rot, Model::RotOrder order ) -{ - aiMatrix4x4 m; - GetRotationMatrix( order, rot, m ); + // one material per mesh maps easily to aiMesh. Multiple material + // meshes need to be split. + const MatIndexArray& mindices = mesh.GetMaterialIndices(); + if (doc.Settings().readMaterials && !mindices.empty()) { + const MatIndexArray::value_type base = mindices[0]; + for (MatIndexArray::value_type index : mindices) { + if (index != base) { + return ConvertMeshMultiMaterial(mesh, model, node_global_transform, nd); + } + } + } - return aiQuaternion( aiMatrix3x3( m ) ); -} + // faster code-path, just copy the data + temp.push_back(ConvertMeshSingleMaterial(mesh, model, node_global_transform, nd)); + return temp; + } -void FBXConverter::ConvertScaleKeys( aiNodeAnim* na, const std::vector& nodes, const LayerMap& /*layers*/, - int64_t start, int64_t stop, - double& maxTime, - double& minTime ) -{ - ai_assert( nodes.size() ); + aiMesh* FBXConverter::SetupEmptyMesh(const MeshGeometry& mesh, aiNode& nd) + { + aiMesh* const out_mesh = new aiMesh(); + meshes.push_back(out_mesh); + meshes_converted[&mesh].push_back(static_cast(meshes.size() - 1)); - // XXX for now, assume scale should be blended geometrically (i.e. two - // layers should be multiplied with each other). There is a FBX - // property in the layer to specify the behaviour, though. + // set name + std::string name = mesh.Name(); + if (name.substr(0, 10) == "Geometry::") { + name = name.substr(10); + } - const KeyFrameListList& inputs = GetKeyframeList( nodes, start, stop ); - const KeyTimeList& keys = GetKeyTimeList( inputs ); + if (name.length()) { + out_mesh->mName.Set(name); + } + else + { + out_mesh->mName = nd.mName; + } - na->mNumScalingKeys = static_cast( keys.size() ); - na->mScalingKeys = new aiVectorKey[ keys.size() ]; - if ( keys.size() > 0 ) - InterpolateKeys( na->mScalingKeys, keys, inputs, aiVector3D( 1.0f, 1.0f, 1.0f ), maxTime, minTime ); -} + return out_mesh; + } -void FBXConverter::ConvertTranslationKeys( aiNodeAnim* na, const std::vector& nodes, - const LayerMap& /*layers*/, - int64_t start, int64_t stop, - double& maxTime, - double& minTime ) -{ - ai_assert( nodes.size() ); + unsigned int FBXConverter::ConvertMeshSingleMaterial(const MeshGeometry& mesh, const Model& model, + const aiMatrix4x4& node_global_transform, aiNode& nd) + { + const MatIndexArray& mindices = mesh.GetMaterialIndices(); + aiMesh* const out_mesh = SetupEmptyMesh(mesh, nd); - // XXX see notes in ConvertScaleKeys() - const KeyFrameListList& inputs = GetKeyframeList( nodes, start, stop ); - const KeyTimeList& keys = GetKeyTimeList( inputs ); + const std::vector& vertices = mesh.GetVertices(); + const std::vector& faces = mesh.GetFaceIndexCounts(); - na->mNumPositionKeys = static_cast( keys.size() ); - na->mPositionKeys = new aiVectorKey[ keys.size() ]; - if ( keys.size() > 0 ) - InterpolateKeys( na->mPositionKeys, keys, inputs, aiVector3D( 0.0f, 0.0f, 0.0f ), maxTime, minTime ); -} + // copy vertices + out_mesh->mNumVertices = static_cast(vertices.size()); + out_mesh->mVertices = new aiVector3D[vertices.size()]; + std::copy(vertices.begin(), vertices.end(), out_mesh->mVertices); -void FBXConverter::ConvertRotationKeys( aiNodeAnim* na, const std::vector& nodes, - const LayerMap& /*layers*/, - int64_t start, int64_t stop, - double& maxTime, - double& minTime, - Model::RotOrder order ) -{ - ai_assert( nodes.size() ); + // generate dummy faces + out_mesh->mNumFaces = static_cast(faces.size()); + aiFace* fac = out_mesh->mFaces = new aiFace[faces.size()](); - // XXX see notes in ConvertScaleKeys() - const std::vector< KeyFrameList >& inputs = GetKeyframeList( nodes, start, stop ); - const KeyTimeList& keys = GetKeyTimeList( inputs ); + unsigned int cursor = 0; + for (unsigned int pcount : faces) { + aiFace& f = *fac++; + f.mNumIndices = pcount; + f.mIndices = new unsigned int[pcount]; + switch (pcount) + { + case 1: + out_mesh->mPrimitiveTypes |= aiPrimitiveType_POINT; + break; + case 2: + out_mesh->mPrimitiveTypes |= aiPrimitiveType_LINE; + break; + case 3: + out_mesh->mPrimitiveTypes |= aiPrimitiveType_TRIANGLE; + break; + default: + out_mesh->mPrimitiveTypes |= aiPrimitiveType_POLYGON; + break; + } + for (unsigned int i = 0; i < pcount; ++i) { + f.mIndices[i] = cursor++; + } + } - na->mNumRotationKeys = static_cast( keys.size() ); - na->mRotationKeys = new aiQuatKey[ keys.size() ]; - if (!keys.empty()) { - InterpolateKeys(na->mRotationKeys, keys, inputs, aiVector3D(0.0f, 0.0f, 0.0f), maxTime, minTime, order); - } -} + // copy normals + const std::vector& normals = mesh.GetNormals(); + if (normals.size()) { + ai_assert(normals.size() == vertices.size()); -void FBXConverter::ConvertGlobalSettings() { - if (nullptr == out) { - return; - } + out_mesh->mNormals = new aiVector3D[vertices.size()]; + std::copy(normals.begin(), normals.end(), out_mesh->mNormals); + } - out->mMetaData = aiMetadata::Alloc(1); - unsigned int index(0); - const double unitScalFactor(doc.GlobalSettings().UnitScaleFactor()); - out->mMetaData->Set(index, "UnitScaleFactor", unitScalFactor); -} + // copy tangents - assimp requires both tangents and bitangents (binormals) + // to be present, or neither of them. Compute binormals from normals + // and tangents if needed. + const std::vector& tangents = mesh.GetTangents(); + const std::vector* binormals = &mesh.GetBinormals(); -void FBXConverter::TransferDataToScene() -{ - ai_assert( !out->mMeshes ); - ai_assert( !out->mNumMeshes ); + if (tangents.size()) { + std::vector tempBinormals; + if (!binormals->size()) { + if (normals.size()) { + tempBinormals.resize(normals.size()); + for (unsigned int i = 0; i < tangents.size(); ++i) { + tempBinormals[i] = normals[i] ^ tangents[i]; + } - // note: the trailing () ensures initialization with NULL - not - // many C++ users seem to know this, so pointing it out to avoid - // confusion why this code works. + binormals = &tempBinormals; + } + else { + binormals = NULL; + } + } - if ( meshes.size() ) { - out->mMeshes = new aiMesh*[ meshes.size() ](); - out->mNumMeshes = static_cast( meshes.size() ); + if (binormals) { + ai_assert(tangents.size() == vertices.size()); + ai_assert(binormals->size() == vertices.size()); - std::swap_ranges( meshes.begin(), meshes.end(), out->mMeshes ); - } + out_mesh->mTangents = new aiVector3D[vertices.size()]; + std::copy(tangents.begin(), tangents.end(), out_mesh->mTangents); - if ( materials.size() ) { - out->mMaterials = new aiMaterial*[ materials.size() ](); - out->mNumMaterials = static_cast( materials.size() ); + out_mesh->mBitangents = new aiVector3D[vertices.size()]; + std::copy(binormals->begin(), binormals->end(), out_mesh->mBitangents); + } + } - std::swap_ranges( materials.begin(), materials.end(), out->mMaterials ); - } + // copy texture coords + for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) { + const std::vector& uvs = mesh.GetTextureCoords(i); + if (uvs.empty()) { + break; + } - if ( animations.size() ) { - out->mAnimations = new aiAnimation*[ animations.size() ](); - out->mNumAnimations = static_cast( animations.size() ); + aiVector3D* out_uv = out_mesh->mTextureCoords[i] = new aiVector3D[vertices.size()]; + for (const aiVector2D& v : uvs) { + *out_uv++ = aiVector3D(v.x, v.y, 0.0f); + } - std::swap_ranges( animations.begin(), animations.end(), out->mAnimations ); - } + out_mesh->mNumUVComponents[i] = 2; + } - if ( lights.size() ) { - out->mLights = new aiLight*[ lights.size() ](); - out->mNumLights = static_cast( lights.size() ); + // copy vertex colors + for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_COLOR_SETS; ++i) { + const std::vector& colors = mesh.GetVertexColors(i); + if (colors.empty()) { + break; + } - std::swap_ranges( lights.begin(), lights.end(), out->mLights ); - } + out_mesh->mColors[i] = new aiColor4D[vertices.size()]; + std::copy(colors.begin(), colors.end(), out_mesh->mColors[i]); + } - if ( cameras.size() ) { - out->mCameras = new aiCamera*[ cameras.size() ](); - out->mNumCameras = static_cast( cameras.size() ); + if (!doc.Settings().readMaterials || mindices.empty()) { + FBXImporter::LogError("no material assigned to mesh, setting default material"); + out_mesh->mMaterialIndex = GetDefaultMaterial(); + } + else { + ConvertMaterialForMesh(out_mesh, model, mesh, mindices[0]); + } - std::swap_ranges( cameras.begin(), cameras.end(), out->mCameras ); - } + if (doc.Settings().readWeights && mesh.DeformerSkin() != NULL) { + ConvertWeights(out_mesh, model, mesh, node_global_transform, NO_MATERIAL_SEPARATION); + } - if ( textures.size() ) { - out->mTextures = new aiTexture*[ textures.size() ](); - out->mNumTextures = static_cast( textures.size() ); + std::vector animMeshes; + for (const BlendShape* blendShape : mesh.GetBlendShapes()) { + for (const BlendShapeChannel* blendShapeChannel : blendShape->BlendShapeChannels()) { + const std::vector& shapeGeometries = blendShapeChannel->GetShapeGeometries(); + for (size_t i = 0; i < shapeGeometries.size(); i++) { + aiAnimMesh *animMesh = aiCreateAnimMesh(out_mesh); + const ShapeGeometry* shapeGeometry = shapeGeometries.at(i); + const std::vector& vertices = shapeGeometry->GetVertices(); + const std::vector& normals = shapeGeometry->GetNormals(); + const std::vector& indices = shapeGeometry->GetIndices(); + animMesh->mName.Set(FixAnimMeshName(shapeGeometry->Name())); + for (size_t j = 0; j < indices.size(); j++) { + unsigned int index = indices.at(j); + aiVector3D vertex = vertices.at(j); + aiVector3D normal = normals.at(j); + unsigned int count = 0; + const unsigned int* outIndices = mesh.ToOutputVertexIndex(index, count); + for (unsigned int k = 0; k < count; k++) { + unsigned int index = outIndices[k]; + animMesh->mVertices[index] += vertex; + if (animMesh->mNormals != nullptr) { + animMesh->mNormals[index] += normal; + animMesh->mNormals[index].NormalizeSafe(); + } + } + } + animMesh->mWeight = shapeGeometries.size() > 1 ? blendShapeChannel->DeformPercent() / 100.0f : 1.0f; + animMeshes.push_back(animMesh); + } + } + } + size_t numAnimMeshes = animMeshes.size(); + if (numAnimMeshes > 0) { + out_mesh->mNumAnimMeshes = static_cast(numAnimMeshes); + out_mesh->mAnimMeshes = new aiAnimMesh*[numAnimMeshes]; + for (size_t i = 0; i < numAnimMeshes; i++) { + out_mesh->mAnimMeshes[i] = animMeshes.at(i); + } + } + return static_cast(meshes.size() - 1); + } - std::swap_ranges( textures.begin(), textures.end(), out->mTextures ); - } -} + std::vector FBXConverter::ConvertMeshMultiMaterial(const MeshGeometry& mesh, const Model& model, + const aiMatrix4x4& node_global_transform, aiNode& nd) + { + const MatIndexArray& mindices = mesh.GetMaterialIndices(); + ai_assert(mindices.size()); -// ------------------------------------------------------------------------------------------------ -void ConvertToAssimpScene(aiScene* out, const Document& doc) -{ - FBXConverter converter(out,doc); -} + std::set had; + std::vector indices; -} // !FBX + for (MatIndexArray::value_type index : mindices) { + if (had.find(index) == had.end()) { + + indices.push_back(ConvertMeshMultiMaterial(mesh, model, index, node_global_transform, nd)); + had.insert(index); + } + } + + return indices; + } + + unsigned int FBXConverter::ConvertMeshMultiMaterial(const MeshGeometry& mesh, const Model& model, + MatIndexArray::value_type index, + const aiMatrix4x4& node_global_transform, + aiNode& nd) + { + aiMesh* const out_mesh = SetupEmptyMesh(mesh, nd); + + const MatIndexArray& mindices = mesh.GetMaterialIndices(); + const std::vector& vertices = mesh.GetVertices(); + const std::vector& faces = mesh.GetFaceIndexCounts(); + + const bool process_weights = doc.Settings().readWeights && mesh.DeformerSkin() != NULL; + + unsigned int count_faces = 0; + unsigned int count_vertices = 0; + + // count faces + std::vector::const_iterator itf = faces.begin(); + for (MatIndexArray::const_iterator it = mindices.begin(), + end = mindices.end(); it != end; ++it, ++itf) + { + if ((*it) != index) { + continue; + } + ++count_faces; + count_vertices += *itf; + } + + ai_assert(count_faces); + ai_assert(count_vertices); + + // mapping from output indices to DOM indexing, needed to resolve weights + std::vector reverseMapping; + + if (process_weights) { + reverseMapping.resize(count_vertices); + } + + // allocate output data arrays, but don't fill them yet + out_mesh->mNumVertices = count_vertices; + out_mesh->mVertices = new aiVector3D[count_vertices]; + + out_mesh->mNumFaces = count_faces; + aiFace* fac = out_mesh->mFaces = new aiFace[count_faces](); + + + // allocate normals + const std::vector& normals = mesh.GetNormals(); + if (normals.size()) { + ai_assert(normals.size() == vertices.size()); + out_mesh->mNormals = new aiVector3D[vertices.size()]; + } + + // allocate tangents, binormals. + const std::vector& tangents = mesh.GetTangents(); + const std::vector* binormals = &mesh.GetBinormals(); + std::vector tempBinormals; + + if (tangents.size()) { + if (!binormals->size()) { + if (normals.size()) { + // XXX this computes the binormals for the entire mesh, not only + // the part for which we need them. + tempBinormals.resize(normals.size()); + for (unsigned int i = 0; i < tangents.size(); ++i) { + tempBinormals[i] = normals[i] ^ tangents[i]; + } + + binormals = &tempBinormals; + } + else { + binormals = NULL; + } + } + + if (binormals) { + ai_assert(tangents.size() == vertices.size() && binormals->size() == vertices.size()); + + out_mesh->mTangents = new aiVector3D[vertices.size()]; + out_mesh->mBitangents = new aiVector3D[vertices.size()]; + } + } + + // allocate texture coords + unsigned int num_uvs = 0; + for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i, ++num_uvs) { + const std::vector& uvs = mesh.GetTextureCoords(i); + if (uvs.empty()) { + break; + } + + out_mesh->mTextureCoords[i] = new aiVector3D[vertices.size()]; + out_mesh->mNumUVComponents[i] = 2; + } + + // allocate vertex colors + unsigned int num_vcs = 0; + for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_COLOR_SETS; ++i, ++num_vcs) { + const std::vector& colors = mesh.GetVertexColors(i); + if (colors.empty()) { + break; + } + + out_mesh->mColors[i] = new aiColor4D[vertices.size()]; + } + + unsigned int cursor = 0, in_cursor = 0; + + itf = faces.begin(); + for (MatIndexArray::const_iterator it = mindices.begin(), + end = mindices.end(); it != end; ++it, ++itf) + { + const unsigned int pcount = *itf; + if ((*it) != index) { + in_cursor += pcount; + continue; + } + + aiFace& f = *fac++; + + f.mNumIndices = pcount; + f.mIndices = new unsigned int[pcount]; + switch (pcount) + { + case 1: + out_mesh->mPrimitiveTypes |= aiPrimitiveType_POINT; + break; + case 2: + out_mesh->mPrimitiveTypes |= aiPrimitiveType_LINE; + break; + case 3: + out_mesh->mPrimitiveTypes |= aiPrimitiveType_TRIANGLE; + break; + default: + out_mesh->mPrimitiveTypes |= aiPrimitiveType_POLYGON; + break; + } + for (unsigned int i = 0; i < pcount; ++i, ++cursor, ++in_cursor) { + f.mIndices[i] = cursor; + + if (reverseMapping.size()) { + reverseMapping[cursor] = in_cursor; + } + + out_mesh->mVertices[cursor] = vertices[in_cursor]; + + if (out_mesh->mNormals) { + out_mesh->mNormals[cursor] = normals[in_cursor]; + } + + if (out_mesh->mTangents) { + out_mesh->mTangents[cursor] = tangents[in_cursor]; + out_mesh->mBitangents[cursor] = (*binormals)[in_cursor]; + } + + for (unsigned int j = 0; j < num_uvs; ++j) { + const std::vector& uvs = mesh.GetTextureCoords(j); + out_mesh->mTextureCoords[j][cursor] = aiVector3D(uvs[in_cursor].x, uvs[in_cursor].y, 0.0f); + } + + for (unsigned int j = 0; j < num_vcs; ++j) { + const std::vector& cols = mesh.GetVertexColors(j); + out_mesh->mColors[j][cursor] = cols[in_cursor]; + } + } + } + + ConvertMaterialForMesh(out_mesh, model, mesh, index); + + if (process_weights) { + ConvertWeights(out_mesh, model, mesh, node_global_transform, index, &reverseMapping); + } + + return static_cast(meshes.size() - 1); + } + + void FBXConverter::ConvertWeights(aiMesh* out, const Model& model, const MeshGeometry& geo, + const aiMatrix4x4& node_global_transform, + unsigned int materialIndex, + std::vector* outputVertStartIndices) + { + ai_assert(geo.DeformerSkin()); + + std::vector out_indices; + std::vector index_out_indices; + std::vector count_out_indices; + + const Skin& sk = *geo.DeformerSkin(); + + std::vector bones; + bones.reserve(sk.Clusters().size()); + + const bool no_mat_check = materialIndex == NO_MATERIAL_SEPARATION; + ai_assert(no_mat_check || outputVertStartIndices); + + try { + + for (const Cluster* cluster : sk.Clusters()) { + ai_assert(cluster); + + const WeightIndexArray& indices = cluster->GetIndices(); + + if (indices.empty()) { + continue; + } + + const MatIndexArray& mats = geo.GetMaterialIndices(); + + bool ok = false; + + const size_t no_index_sentinel = std::numeric_limits::max(); + + count_out_indices.clear(); + index_out_indices.clear(); + out_indices.clear(); + + // now check if *any* of these weights is contained in the output mesh, + // taking notes so we don't need to do it twice. + for (WeightIndexArray::value_type index : indices) { + + unsigned int count = 0; + const unsigned int* const out_idx = geo.ToOutputVertexIndex(index, count); + // ToOutputVertexIndex only returns NULL if index is out of bounds + // which should never happen + ai_assert(out_idx != NULL); + + index_out_indices.push_back(no_index_sentinel); + count_out_indices.push_back(0); + + for (unsigned int i = 0; i < count; ++i) { + if (no_mat_check || static_cast(mats[geo.FaceForVertexIndex(out_idx[i])]) == materialIndex) { + + if (index_out_indices.back() == no_index_sentinel) { + index_out_indices.back() = out_indices.size(); + + } + + if (no_mat_check) { + out_indices.push_back(out_idx[i]); + } + else { + // this extra lookup is in O(logn), so the entire algorithm becomes O(nlogn) + const std::vector::iterator it = std::lower_bound( + outputVertStartIndices->begin(), + outputVertStartIndices->end(), + out_idx[i] + ); + + out_indices.push_back(std::distance(outputVertStartIndices->begin(), it)); + } + + ++count_out_indices.back(); + ok = true; + } + } + } + + // if we found at least one, generate the output bones + // XXX this could be heavily simplified by collecting the bone + // data in a single step. + if (ok) { + ConvertCluster(bones, model, *cluster, out_indices, index_out_indices, + count_out_indices, node_global_transform); + } + } + } + catch (std::exception&) { + std::for_each(bones.begin(), bones.end(), Util::delete_fun()); + throw; + } + + if (bones.empty()) { + return; + } + + out->mBones = new aiBone*[bones.size()](); + out->mNumBones = static_cast(bones.size()); + + std::swap_ranges(bones.begin(), bones.end(), out->mBones); + } + + void FBXConverter::ConvertCluster(std::vector& bones, const Model& /*model*/, const Cluster& cl, + std::vector& out_indices, + std::vector& index_out_indices, + std::vector& count_out_indices, + const aiMatrix4x4& node_global_transform) + { + + aiBone* const bone = new aiBone(); + bones.push_back(bone); + + bone->mName = FixNodeName(cl.TargetNode()->Name()); + + bone->mOffsetMatrix = cl.TransformLink(); + bone->mOffsetMatrix.Inverse(); + + bone->mOffsetMatrix = bone->mOffsetMatrix * node_global_transform; + + bone->mNumWeights = static_cast(out_indices.size()); + aiVertexWeight* cursor = bone->mWeights = new aiVertexWeight[out_indices.size()]; + + const size_t no_index_sentinel = std::numeric_limits::max(); + const WeightArray& weights = cl.GetWeights(); + + const size_t c = index_out_indices.size(); + for (size_t i = 0; i < c; ++i) { + const size_t index_index = index_out_indices[i]; + + if (index_index == no_index_sentinel) { + continue; + } + + const size_t cc = count_out_indices[i]; + for (size_t j = 0; j < cc; ++j) { + aiVertexWeight& out_weight = *cursor++; + + out_weight.mVertexId = static_cast(out_indices[index_index + j]); + out_weight.mWeight = weights[i]; + } + } + } + + void FBXConverter::ConvertMaterialForMesh(aiMesh* out, const Model& model, const MeshGeometry& geo, + MatIndexArray::value_type materialIndex) + { + // locate source materials for this mesh + const std::vector& mats = model.GetMaterials(); + if (static_cast(materialIndex) >= mats.size() || materialIndex < 0) { + FBXImporter::LogError("material index out of bounds, setting default material"); + out->mMaterialIndex = GetDefaultMaterial(); + return; + } + + const Material* const mat = mats[materialIndex]; + MaterialMap::const_iterator it = materials_converted.find(mat); + if (it != materials_converted.end()) { + out->mMaterialIndex = (*it).second; + return; + } + + out->mMaterialIndex = ConvertMaterial(*mat, &geo); + materials_converted[mat] = out->mMaterialIndex; + } + + unsigned int FBXConverter::GetDefaultMaterial() + { + if (defaultMaterialIndex) { + return defaultMaterialIndex - 1; + } + + aiMaterial* out_mat = new aiMaterial(); + materials.push_back(out_mat); + + const aiColor3D diffuse = aiColor3D(0.8f, 0.8f, 0.8f); + out_mat->AddProperty(&diffuse, 1, AI_MATKEY_COLOR_DIFFUSE); + + aiString s; + s.Set(AI_DEFAULT_MATERIAL_NAME); + + out_mat->AddProperty(&s, AI_MATKEY_NAME); + + defaultMaterialIndex = static_cast(materials.size()); + return defaultMaterialIndex - 1; + } + + + unsigned int FBXConverter::ConvertMaterial(const Material& material, const MeshGeometry* const mesh) + { + const PropertyTable& props = material.Props(); + + // generate empty output material + aiMaterial* out_mat = new aiMaterial(); + materials_converted[&material] = static_cast(materials.size()); + + materials.push_back(out_mat); + + aiString str; + + // strip Material:: prefix + std::string name = material.Name(); + if (name.substr(0, 10) == "Material::") { + name = name.substr(10); + } + + // set material name if not empty - this could happen + // and there should be no key for it in this case. + if (name.length()) { + str.Set(name); + out_mat->AddProperty(&str, AI_MATKEY_NAME); + } + + // shading stuff and colors + SetShadingPropertiesCommon(out_mat, props); + + // texture assignments + SetTextureProperties(out_mat, material.Textures(), mesh); + SetTextureProperties(out_mat, material.LayeredTextures(), mesh); + + return static_cast(materials.size() - 1); + } + + unsigned int FBXConverter::ConvertVideo(const Video& video) + { + // generate empty output texture + aiTexture* out_tex = new aiTexture(); + textures.push_back(out_tex); + + // assuming the texture is compressed + out_tex->mWidth = static_cast(video.ContentLength()); // total data size + out_tex->mHeight = 0; // fixed to 0 + + // steal the data from the Video to avoid an additional copy + out_tex->pcData = reinterpret_cast(const_cast(video).RelinquishContent()); + + // try to extract a hint from the file extension + const std::string& filename = video.FileName().empty() ? video.RelativeFilename() : video.FileName(); + std::string ext = BaseImporter::GetExtension(filename); + + if (ext == "jpeg") { + ext = "jpg"; + } + + if (ext.size() <= 3) { + memcpy(out_tex->achFormatHint, ext.c_str(), ext.size()); + } + + out_tex->mFilename.Set(video.FileName().c_str()); + + return static_cast(textures.size() - 1); + } + + aiString FBXConverter::GetTexturePath(const Texture* tex) + { + aiString path; + path.Set(tex->RelativeFilename()); + + const Video* media = tex->Media(); + if (media != nullptr) { + bool textureReady = false; //tells if our texture is ready (if it was loaded or if it was found) + unsigned int index; + + VideoMap::const_iterator it = textures_converted.find(media); + if (it != textures_converted.end()) { + index = (*it).second; + textureReady = true; + } + else { + if (media->ContentLength() > 0) { + index = ConvertVideo(*media); + textures_converted[media] = index; + textureReady = true; + } + } + + // setup texture reference string (copied from ColladaLoader::FindFilenameForEffectTexture), if the texture is ready + if (doc.Settings().useLegacyEmbeddedTextureNaming) { + if (textureReady) { + // TODO: check the possibility of using the flag "AI_CONFIG_IMPORT_FBX_EMBEDDED_TEXTURES_LEGACY_NAMING" + // In FBX files textures are now stored internally by Assimp with their filename included + // Now Assimp can lookup through the loaded textures after all data is processed + // We need to load all textures before referencing them, as FBX file format order may reference a texture before loading it + // This may occur on this case too, it has to be studied + path.data[0] = '*'; + path.length = 1 + ASSIMP_itoa10(path.data + 1, MAXLEN - 1, index); + } + } + } + + return path; + } + + void FBXConverter::TrySetTextureProperties(aiMaterial* out_mat, const TextureMap& textures, + const std::string& propName, + aiTextureType target, const MeshGeometry* const mesh) + { + TextureMap::const_iterator it = textures.find(propName); + if (it == textures.end()) { + return; + } + + const Texture* const tex = (*it).second; + if (tex != 0) + { + aiString path = GetTexturePath(tex); + out_mat->AddProperty(&path, _AI_MATKEY_TEXTURE_BASE, target, 0); + + aiUVTransform uvTrafo; + // XXX handle all kinds of UV transformations + uvTrafo.mScaling = tex->UVScaling(); + uvTrafo.mTranslation = tex->UVTranslation(); + out_mat->AddProperty(&uvTrafo, 1, _AI_MATKEY_UVTRANSFORM_BASE, target, 0); + + const PropertyTable& props = tex->Props(); + + int uvIndex = 0; + + bool ok; + const std::string& uvSet = PropertyGet(props, "UVSet", ok); + if (ok) { + // "default" is the name which usually appears in the FbxFileTexture template + if (uvSet != "default" && uvSet.length()) { + // this is a bit awkward - we need to find a mesh that uses this + // material and scan its UV channels for the given UV name because + // assimp references UV channels by index, not by name. + + // XXX: the case that UV channels may appear in different orders + // in meshes is unhandled. A possible solution would be to sort + // the UV channels alphabetically, but this would have the side + // effect that the primary (first) UV channel would sometimes + // be moved, causing trouble when users read only the first + // UV channel and ignore UV channel assignments altogether. + + const unsigned int matIndex = static_cast(std::distance(materials.begin(), + std::find(materials.begin(), materials.end(), out_mat) + )); + + + uvIndex = -1; + if (!mesh) + { + for (const MeshMap::value_type& v : meshes_converted) { + const MeshGeometry* const mesh = dynamic_cast (v.first); + if (!mesh) { + continue; + } + + const MatIndexArray& mats = mesh->GetMaterialIndices(); + if (std::find(mats.begin(), mats.end(), matIndex) == mats.end()) { + continue; + } + + int index = -1; + for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) { + if (mesh->GetTextureCoords(i).empty()) { + break; + } + const std::string& name = mesh->GetTextureCoordChannelName(i); + if (name == uvSet) { + index = static_cast(i); + break; + } + } + if (index == -1) { + FBXImporter::LogWarn("did not find UV channel named " + uvSet + " in a mesh using this material"); + continue; + } + + if (uvIndex == -1) { + uvIndex = index; + } + else { + FBXImporter::LogWarn("the UV channel named " + uvSet + + " appears at different positions in meshes, results will be wrong"); + } + } + } + else + { + int index = -1; + for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) { + if (mesh->GetTextureCoords(i).empty()) { + break; + } + const std::string& name = mesh->GetTextureCoordChannelName(i); + if (name == uvSet) { + index = static_cast(i); + break; + } + } + if (index == -1) { + FBXImporter::LogWarn("did not find UV channel named " + uvSet + " in a mesh using this material"); + } + + if (uvIndex == -1) { + uvIndex = index; + } + } + + if (uvIndex == -1) { + FBXImporter::LogWarn("failed to resolve UV channel " + uvSet + ", using first UV channel"); + uvIndex = 0; + } + } + } + + out_mat->AddProperty(&uvIndex, 1, _AI_MATKEY_UVWSRC_BASE, target, 0); + } + } + + void FBXConverter::TrySetTextureProperties(aiMaterial* out_mat, const LayeredTextureMap& layeredTextures, + const std::string& propName, + aiTextureType target, const MeshGeometry* const mesh) { + LayeredTextureMap::const_iterator it = layeredTextures.find(propName); + if (it == layeredTextures.end()) { + return; + } + + int texCount = (*it).second->textureCount(); + + // Set the blend mode for layered textures + int blendmode = (*it).second->GetBlendMode(); + out_mat->AddProperty(&blendmode, 1, _AI_MATKEY_TEXOP_BASE, target, 0); + + for (int texIndex = 0; texIndex < texCount; texIndex++) { + + const Texture* const tex = (*it).second->getTexture(texIndex); + + aiString path = GetTexturePath(tex); + out_mat->AddProperty(&path, _AI_MATKEY_TEXTURE_BASE, target, texIndex); + + aiUVTransform uvTrafo; + // XXX handle all kinds of UV transformations + uvTrafo.mScaling = tex->UVScaling(); + uvTrafo.mTranslation = tex->UVTranslation(); + out_mat->AddProperty(&uvTrafo, 1, _AI_MATKEY_UVTRANSFORM_BASE, target, texIndex); + + const PropertyTable& props = tex->Props(); + + int uvIndex = 0; + + bool ok; + const std::string& uvSet = PropertyGet(props, "UVSet", ok); + if (ok) { + // "default" is the name which usually appears in the FbxFileTexture template + if (uvSet != "default" && uvSet.length()) { + // this is a bit awkward - we need to find a mesh that uses this + // material and scan its UV channels for the given UV name because + // assimp references UV channels by index, not by name. + + // XXX: the case that UV channels may appear in different orders + // in meshes is unhandled. A possible solution would be to sort + // the UV channels alphabetically, but this would have the side + // effect that the primary (first) UV channel would sometimes + // be moved, causing trouble when users read only the first + // UV channel and ignore UV channel assignments altogether. + + const unsigned int matIndex = static_cast(std::distance(materials.begin(), + std::find(materials.begin(), materials.end(), out_mat) + )); + + uvIndex = -1; + if (!mesh) + { + for (const MeshMap::value_type& v : meshes_converted) { + const MeshGeometry* const mesh = dynamic_cast (v.first); + if (!mesh) { + continue; + } + + const MatIndexArray& mats = mesh->GetMaterialIndices(); + if (std::find(mats.begin(), mats.end(), matIndex) == mats.end()) { + continue; + } + + int index = -1; + for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) { + if (mesh->GetTextureCoords(i).empty()) { + break; + } + const std::string& name = mesh->GetTextureCoordChannelName(i); + if (name == uvSet) { + index = static_cast(i); + break; + } + } + if (index == -1) { + FBXImporter::LogWarn("did not find UV channel named " + uvSet + " in a mesh using this material"); + continue; + } + + if (uvIndex == -1) { + uvIndex = index; + } + else { + FBXImporter::LogWarn("the UV channel named " + uvSet + + " appears at different positions in meshes, results will be wrong"); + } + } + } + else + { + int index = -1; + for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) { + if (mesh->GetTextureCoords(i).empty()) { + break; + } + const std::string& name = mesh->GetTextureCoordChannelName(i); + if (name == uvSet) { + index = static_cast(i); + break; + } + } + if (index == -1) { + FBXImporter::LogWarn("did not find UV channel named " + uvSet + " in a mesh using this material"); + } + + if (uvIndex == -1) { + uvIndex = index; + } + } + + if (uvIndex == -1) { + FBXImporter::LogWarn("failed to resolve UV channel " + uvSet + ", using first UV channel"); + uvIndex = 0; + } + } + } + + out_mat->AddProperty(&uvIndex, 1, _AI_MATKEY_UVWSRC_BASE, target, texIndex); + } + } + + void FBXConverter::SetTextureProperties(aiMaterial* out_mat, const TextureMap& textures, const MeshGeometry* const mesh) + { + TrySetTextureProperties(out_mat, textures, "DiffuseColor", aiTextureType_DIFFUSE, mesh); + TrySetTextureProperties(out_mat, textures, "AmbientColor", aiTextureType_AMBIENT, mesh); + TrySetTextureProperties(out_mat, textures, "EmissiveColor", aiTextureType_EMISSIVE, mesh); + TrySetTextureProperties(out_mat, textures, "SpecularColor", aiTextureType_SPECULAR, mesh); + TrySetTextureProperties(out_mat, textures, "SpecularFactor", aiTextureType_SPECULAR, mesh); + TrySetTextureProperties(out_mat, textures, "TransparentColor", aiTextureType_OPACITY, mesh); + TrySetTextureProperties(out_mat, textures, "ReflectionColor", aiTextureType_REFLECTION, mesh); + TrySetTextureProperties(out_mat, textures, "DisplacementColor", aiTextureType_DISPLACEMENT, mesh); + TrySetTextureProperties(out_mat, textures, "NormalMap", aiTextureType_NORMALS, mesh); + TrySetTextureProperties(out_mat, textures, "Bump", aiTextureType_HEIGHT, mesh); + TrySetTextureProperties(out_mat, textures, "ShininessExponent", aiTextureType_SHININESS, mesh); + TrySetTextureProperties( out_mat, textures, "TransparencyFactor", aiTextureType_OPACITY, mesh ); + TrySetTextureProperties( out_mat, textures, "EmissiveFactor", aiTextureType_EMISSIVE, mesh ); + //Maya counterparts + TrySetTextureProperties(out_mat, textures, "Maya|DiffuseTexture", aiTextureType_DIFFUSE, mesh); + TrySetTextureProperties(out_mat, textures, "Maya|NormalTexture", aiTextureType_NORMALS, mesh); + TrySetTextureProperties(out_mat, textures, "Maya|SpecularTexture", aiTextureType_SPECULAR, mesh); + TrySetTextureProperties(out_mat, textures, "Maya|FalloffTexture", aiTextureType_OPACITY, mesh); + TrySetTextureProperties(out_mat, textures, "Maya|ReflectionMapTexture", aiTextureType_REFLECTION, mesh); + } + + void FBXConverter::SetTextureProperties(aiMaterial* out_mat, const LayeredTextureMap& layeredTextures, const MeshGeometry* const mesh) + { + TrySetTextureProperties(out_mat, layeredTextures, "DiffuseColor", aiTextureType_DIFFUSE, mesh); + TrySetTextureProperties(out_mat, layeredTextures, "AmbientColor", aiTextureType_AMBIENT, mesh); + TrySetTextureProperties(out_mat, layeredTextures, "EmissiveColor", aiTextureType_EMISSIVE, mesh); + TrySetTextureProperties(out_mat, layeredTextures, "SpecularColor", aiTextureType_SPECULAR, mesh); + TrySetTextureProperties(out_mat, layeredTextures, "SpecularFactor", aiTextureType_SPECULAR, mesh); + TrySetTextureProperties(out_mat, layeredTextures, "TransparentColor", aiTextureType_OPACITY, mesh); + TrySetTextureProperties(out_mat, layeredTextures, "ReflectionColor", aiTextureType_REFLECTION, mesh); + TrySetTextureProperties(out_mat, layeredTextures, "DisplacementColor", aiTextureType_DISPLACEMENT, mesh); + TrySetTextureProperties(out_mat, layeredTextures, "NormalMap", aiTextureType_NORMALS, mesh); + TrySetTextureProperties(out_mat, layeredTextures, "Bump", aiTextureType_HEIGHT, mesh); + TrySetTextureProperties(out_mat, layeredTextures, "ShininessExponent", aiTextureType_SHININESS, mesh); + TrySetTextureProperties( out_mat, layeredTextures, "EmissiveFactor", aiTextureType_EMISSIVE, mesh ); + TrySetTextureProperties( out_mat, layeredTextures, "TransparencyFactor", aiTextureType_OPACITY, mesh ); + } + + aiColor3D FBXConverter::GetColorPropertyFactored(const PropertyTable& props, const std::string& colorName, + const std::string& factorName, bool& result, bool useTemplate) + { + result = true; + + bool ok; + aiVector3D BaseColor = PropertyGet(props, colorName, ok, useTemplate); + if (!ok) { + result = false; + return aiColor3D(0.0f, 0.0f, 0.0f); + } + + // if no factor name, return the colour as is + if (factorName.empty()) { + return aiColor3D(BaseColor.x, BaseColor.y, BaseColor.z); + } + + // otherwise it should be multiplied by the factor, if found. + float factor = PropertyGet(props, factorName, ok, useTemplate); + if (ok) { + BaseColor *= factor; + } + return aiColor3D(BaseColor.x, BaseColor.y, BaseColor.z); + } + + aiColor3D FBXConverter::GetColorPropertyFromMaterial(const PropertyTable& props, const std::string& baseName, + bool& result) + { + return GetColorPropertyFactored(props, baseName + "Color", baseName + "Factor", result, true); + } + + aiColor3D FBXConverter::GetColorProperty(const PropertyTable& props, const std::string& colorName, + bool& result, bool useTemplate) + { + result = true; + bool ok; + const aiVector3D& ColorVec = PropertyGet(props, colorName, ok, useTemplate); + if (!ok) { + result = false; + return aiColor3D(0.0f, 0.0f, 0.0f); + } + return aiColor3D(ColorVec.x, ColorVec.y, ColorVec.z); + } + + void FBXConverter::SetShadingPropertiesCommon(aiMaterial* out_mat, const PropertyTable& props) + { + // Set shading properties. + // Modern FBX Files have two separate systems for defining these, + // with only the more comprehensive one described in the property template. + // Likely the other values are a legacy system, + // which is still always exported by the official FBX SDK. + // + // Blender's FBX import and export mostly ignore this legacy system, + // and as we only support recent versions of FBX anyway, we can do the same. + bool ok; + + const aiColor3D& Diffuse = GetColorPropertyFromMaterial(props, "Diffuse", ok); + if (ok) { + out_mat->AddProperty(&Diffuse, 1, AI_MATKEY_COLOR_DIFFUSE); + } + + const aiColor3D& Emissive = GetColorPropertyFromMaterial(props, "Emissive", ok); + if (ok) { + out_mat->AddProperty(&Emissive, 1, AI_MATKEY_COLOR_EMISSIVE); + } + + const aiColor3D& Ambient = GetColorPropertyFromMaterial(props, "Ambient", ok); + if (ok) { + out_mat->AddProperty(&Ambient, 1, AI_MATKEY_COLOR_AMBIENT); + } + + // we store specular factor as SHININESS_STRENGTH, so just get the color + const aiColor3D& Specular = GetColorProperty(props, "SpecularColor", ok, true); + if (ok) { + out_mat->AddProperty(&Specular, 1, AI_MATKEY_COLOR_SPECULAR); + } + + // and also try to get SHININESS_STRENGTH + const float SpecularFactor = PropertyGet(props, "SpecularFactor", ok, true); + if (ok) { + out_mat->AddProperty(&SpecularFactor, 1, AI_MATKEY_SHININESS_STRENGTH); + } + + // and the specular exponent + const float ShininessExponent = PropertyGet(props, "ShininessExponent", ok); + if (ok) { + out_mat->AddProperty(&ShininessExponent, 1, AI_MATKEY_SHININESS); + } + + // TransparentColor / TransparencyFactor... gee thanks FBX :rolleyes: + const aiColor3D& Transparent = GetColorPropertyFactored(props, "TransparentColor", "TransparencyFactor", ok); + float CalculatedOpacity = 1.0f; + if (ok) { + out_mat->AddProperty(&Transparent, 1, AI_MATKEY_COLOR_TRANSPARENT); + // as calculated by FBX SDK 2017: + CalculatedOpacity = 1.0f - ((Transparent.r + Transparent.g + Transparent.b) / 3.0f); + } + + // use of TransparencyFactor is inconsistent. + // Maya always stores it as 1.0, + // so we can't use it to set AI_MATKEY_OPACITY. + // Blender is more sensible and stores it as the alpha value. + // However both the FBX SDK and Blender always write an additional + // legacy "Opacity" field, so we can try to use that. + // + // If we can't find it, + // we can fall back to the value which the FBX SDK calculates + // from transparency colour (RGB) and factor (F) as + // 1.0 - F*((R+G+B)/3). + // + // There's no consistent way to interpret this opacity value, + // so it's up to clients to do the correct thing. + const float Opacity = PropertyGet(props, "Opacity", ok); + if (ok) { + out_mat->AddProperty(&Opacity, 1, AI_MATKEY_OPACITY); + } + else if (CalculatedOpacity != 1.0) { + out_mat->AddProperty(&CalculatedOpacity, 1, AI_MATKEY_OPACITY); + } + + // reflection color and factor are stored separately + const aiColor3D& Reflection = GetColorProperty(props, "ReflectionColor", ok, true); + if (ok) { + out_mat->AddProperty(&Reflection, 1, AI_MATKEY_COLOR_REFLECTIVE); + } + + float ReflectionFactor = PropertyGet(props, "ReflectionFactor", ok, true); + if (ok) { + out_mat->AddProperty(&ReflectionFactor, 1, AI_MATKEY_REFLECTIVITY); + } + + const float BumpFactor = PropertyGet(props, "BumpFactor", ok); + if (ok) { + out_mat->AddProperty(&BumpFactor, 1, AI_MATKEY_BUMPSCALING); + } + + const float DispFactor = PropertyGet(props, "DisplacementFactor", ok); + if (ok) { + out_mat->AddProperty(&DispFactor, 1, "$mat.displacementscaling", 0, 0); + } + } + + + double FBXConverter::FrameRateToDouble(FileGlobalSettings::FrameRate fp, double customFPSVal) { + switch (fp) { + case FileGlobalSettings::FrameRate_DEFAULT: + return 1.0; + + case FileGlobalSettings::FrameRate_120: + return 120.0; + + case FileGlobalSettings::FrameRate_100: + return 100.0; + + case FileGlobalSettings::FrameRate_60: + return 60.0; + + case FileGlobalSettings::FrameRate_50: + return 50.0; + + case FileGlobalSettings::FrameRate_48: + return 48.0; + + case FileGlobalSettings::FrameRate_30: + case FileGlobalSettings::FrameRate_30_DROP: + return 30.0; + + case FileGlobalSettings::FrameRate_NTSC_DROP_FRAME: + case FileGlobalSettings::FrameRate_NTSC_FULL_FRAME: + return 29.9700262; + + case FileGlobalSettings::FrameRate_PAL: + return 25.0; + + case FileGlobalSettings::FrameRate_CINEMA: + return 24.0; + + case FileGlobalSettings::FrameRate_1000: + return 1000.0; + + case FileGlobalSettings::FrameRate_CINEMA_ND: + return 23.976; + + case FileGlobalSettings::FrameRate_CUSTOM: + return customFPSVal; + + case FileGlobalSettings::FrameRate_MAX: // this is to silence compiler warnings + break; + } + + ai_assert(false); + + return -1.0f; + } + + + void FBXConverter::ConvertAnimations() + { + // first of all determine framerate + const FileGlobalSettings::FrameRate fps = doc.GlobalSettings().TimeMode(); + const float custom = doc.GlobalSettings().CustomFrameRate(); + anim_fps = FrameRateToDouble(fps, custom); + + const std::vector& animations = doc.AnimationStacks(); + for (const AnimationStack* stack : animations) { + ConvertAnimationStack(*stack); + } + } + + std::string FBXConverter::FixNodeName(const std::string& name) { + // strip Model:: prefix, avoiding ambiguities (i.e. don't strip if + // this causes ambiguities, well possible between empty identifiers, + // such as "Model::" and ""). Make sure the behaviour is consistent + // across multiple calls to FixNodeName(). + if (name.substr(0, 7) == "Model::") { + std::string temp = name.substr(7); + return temp; + } + + return name; + } + + std::string FBXConverter::FixAnimMeshName(const std::string& name) { + if (name.length()) { + size_t indexOf = name.find_first_of("::"); + if (indexOf != std::string::npos && indexOf < name.size() - 2) { + return name.substr(indexOf + 2); + } + } + return name.length() ? name : "AnimMesh"; + } + + void FBXConverter::ConvertAnimationStack(const AnimationStack& st) + { + const AnimationLayerList& layers = st.Layers(); + if (layers.empty()) { + return; + } + + aiAnimation* const anim = new aiAnimation(); + animations.push_back(anim); + + // strip AnimationStack:: prefix + std::string name = st.Name(); + if (name.substr(0, 16) == "AnimationStack::") { + name = name.substr(16); + } + else if (name.substr(0, 11) == "AnimStack::") { + name = name.substr(11); + } + + anim->mName.Set(name); + + // need to find all nodes for which we need to generate node animations - + // it may happen that we need to merge multiple layers, though. + NodeMap node_map; + + // reverse mapping from curves to layers, much faster than querying + // the FBX DOM for it. + LayerMap layer_map; + + const char* prop_whitelist[] = { + "Lcl Scaling", + "Lcl Rotation", + "Lcl Translation", + "DeformPercent" + }; + + std::map morphAnimDatas; + + for (const AnimationLayer* layer : layers) { + ai_assert(layer); + const AnimationCurveNodeList& nodes = layer->Nodes(prop_whitelist, 4); + for (const AnimationCurveNode* node : nodes) { + ai_assert(node); + const Model* const model = dynamic_cast(node->Target()); + if (model) { + const std::string& name = FixNodeName(model->Name()); + node_map[name].push_back(node); + layer_map[node] = layer; + continue; + } + const BlendShapeChannel* const bsc = dynamic_cast(node->Target()); + if (bsc) { + ProcessMorphAnimDatas(&morphAnimDatas, bsc, node); + } + } + } + + // generate node animations + std::vector node_anims; + + double min_time = 1e10; + double max_time = -1e10; + + int64_t start_time = st.LocalStart(); + int64_t stop_time = st.LocalStop(); + bool has_local_startstop = start_time != 0 || stop_time != 0; + if (!has_local_startstop) { + // no time range given, so accept every keyframe and use the actual min/max time + // the numbers are INT64_MIN/MAX, the 20000 is for safety because GenerateNodeAnimations uses an epsilon of 10000 + start_time = -9223372036854775807ll + 20000; + stop_time = 9223372036854775807ll - 20000; + } + + try { + for (const NodeMap::value_type& kv : node_map) { + GenerateNodeAnimations(node_anims, + kv.first, + kv.second, + layer_map, + start_time, stop_time, + max_time, + min_time); + } + } + catch (std::exception&) { + std::for_each(node_anims.begin(), node_anims.end(), Util::delete_fun()); + throw; + } + + if (node_anims.size() || morphAnimDatas.size()) { + if (node_anims.size()) { + anim->mChannels = new aiNodeAnim*[node_anims.size()](); + anim->mNumChannels = static_cast(node_anims.size()); + std::swap_ranges(node_anims.begin(), node_anims.end(), anim->mChannels); + } + if (morphAnimDatas.size()) { + unsigned int numMorphMeshChannels = static_cast(morphAnimDatas.size()); + anim->mMorphMeshChannels = new aiMeshMorphAnim*[numMorphMeshChannels]; + anim->mNumMorphMeshChannels = numMorphMeshChannels; + unsigned int i = 0; + for (auto morphAnimIt : morphAnimDatas) { + morphAnimData* animData = morphAnimIt.second; + unsigned int numKeys = static_cast(animData->size()); + aiMeshMorphAnim* meshMorphAnim = new aiMeshMorphAnim(); + meshMorphAnim->mName.Set(morphAnimIt.first); + meshMorphAnim->mNumKeys = numKeys; + meshMorphAnim->mKeys = new aiMeshMorphKey[numKeys]; + unsigned int j = 0; + for (auto animIt : *animData) { + morphKeyData* keyData = animIt.second; + unsigned int numValuesAndWeights = static_cast(keyData->values.size()); + meshMorphAnim->mKeys[j].mNumValuesAndWeights = numValuesAndWeights; + meshMorphAnim->mKeys[j].mValues = new unsigned int[numValuesAndWeights]; + meshMorphAnim->mKeys[j].mWeights = new double[numValuesAndWeights]; + meshMorphAnim->mKeys[j].mTime = CONVERT_FBX_TIME(animIt.first) * anim_fps; + for (unsigned int k = 0; k < numValuesAndWeights; k++) { + meshMorphAnim->mKeys[j].mValues[k] = keyData->values.at(k); + meshMorphAnim->mKeys[j].mWeights[k] = keyData->weights.at(k); + } + j++; + } + anim->mMorphMeshChannels[i++] = meshMorphAnim; + } + } + } + else { + // empty animations would fail validation, so drop them + delete anim; + animations.pop_back(); + FBXImporter::LogInfo("ignoring empty AnimationStack (using IK?): " + name); + return; + } + + double start_time_fps = has_local_startstop ? (CONVERT_FBX_TIME(start_time) * anim_fps) : min_time; + double stop_time_fps = has_local_startstop ? (CONVERT_FBX_TIME(stop_time) * anim_fps) : max_time; + + // adjust relative timing for animation + for (unsigned int c = 0; c < anim->mNumChannels; c++) { + aiNodeAnim* channel = anim->mChannels[c]; + for (uint32_t i = 0; i < channel->mNumPositionKeys; i++) { + channel->mPositionKeys[i].mTime -= start_time_fps; + } + for (uint32_t i = 0; i < channel->mNumRotationKeys; i++) { + channel->mRotationKeys[i].mTime -= start_time_fps; + } + for (uint32_t i = 0; i < channel->mNumScalingKeys; i++) { + channel->mScalingKeys[i].mTime -= start_time_fps; + } + } + for (unsigned int c = 0; c < anim->mNumMorphMeshChannels; c++) { + aiMeshMorphAnim* channel = anim->mMorphMeshChannels[c]; + for (uint32_t i = 0; i < channel->mNumKeys; i++) { + channel->mKeys[i].mTime -= start_time_fps; + } + } + + // for some mysterious reason, mDuration is simply the maximum key -- the + // validator always assumes animations to start at zero. + anim->mDuration = stop_time_fps - start_time_fps; + anim->mTicksPerSecond = anim_fps; + } + + // ------------------------------------------------------------------------------------------------ + void FBXConverter::ProcessMorphAnimDatas(std::map* morphAnimDatas, const BlendShapeChannel* bsc, const AnimationCurveNode* node) { + std::vector bscConnections = doc.GetConnectionsBySourceSequenced(bsc->ID(), "Deformer"); + for (const Connection* bscConnection : bscConnections) { + auto bs = dynamic_cast(bscConnection->DestinationObject()); + if (bs) { + auto channelIt = std::find(bs->BlendShapeChannels().begin(), bs->BlendShapeChannels().end(), bsc); + if (channelIt != bs->BlendShapeChannels().end()) { + auto channelIndex = static_cast(std::distance(bs->BlendShapeChannels().begin(), channelIt)); + std::vector bsConnections = doc.GetConnectionsBySourceSequenced(bs->ID(), "Geometry"); + for (const Connection* bsConnection : bsConnections) { + auto geo = dynamic_cast(bsConnection->DestinationObject()); + if (geo) { + std::vector geoConnections = doc.GetConnectionsBySourceSequenced(geo->ID(), "Model"); + for (const Connection* geoConnection : geoConnections) { + auto model = dynamic_cast(geoConnection->DestinationObject()); + if (model) { + auto geoIt = std::find(model->GetGeometry().begin(), model->GetGeometry().end(), geo); + auto geoIndex = static_cast(std::distance(model->GetGeometry().begin(), geoIt)); + auto name = aiString(FixNodeName(model->Name() + "*")); + name.length = 1 + ASSIMP_itoa10(name.data + name.length, MAXLEN - 1, geoIndex); + morphAnimData* animData; + auto animIt = morphAnimDatas->find(name.C_Str()); + if (animIt == morphAnimDatas->end()) { + animData = new morphAnimData(); + morphAnimDatas->insert(std::make_pair(name.C_Str(), animData)); + } + else { + animData = animIt->second; + } + for (std::pair curvesIt : node->Curves()) { + if (curvesIt.first == "d|DeformPercent") { + const AnimationCurve* animationCurve = curvesIt.second; + const KeyTimeList& keys = animationCurve->GetKeys(); + const KeyValueList& values = animationCurve->GetValues(); + unsigned int k = 0; + for (auto key : keys) { + morphKeyData* keyData; + auto keyIt = animData->find(key); + if (keyIt == animData->end()) { + keyData = new morphKeyData(); + animData->insert(std::make_pair(key, keyData)); + } + else { + keyData = keyIt->second; + } + keyData->values.push_back(channelIndex); + keyData->weights.push_back(values.at(k) / 100.0f); + k++; + } + } + } + } + } + } + } + } + } + } + } + + // ------------------------------------------------------------------------------------------------ +#ifdef ASSIMP_BUILD_DEBUG + // ------------------------------------------------------------------------------------------------ + // sanity check whether the input is ok + static void validateAnimCurveNodes(const std::vector& curves, + bool strictMode) { + const Object* target(NULL); + for (const AnimationCurveNode* node : curves) { + if (!target) { + target = node->Target(); + } + if (node->Target() != target) { + FBXImporter::LogWarn("Node target is nullptr type."); + } + if (strictMode) { + ai_assert(node->Target() == target); + } + } + } +#endif // ASSIMP_BUILD_DEBUG + + // ------------------------------------------------------------------------------------------------ + void FBXConverter::GenerateNodeAnimations(std::vector& node_anims, + const std::string& fixed_name, + const std::vector& curves, + const LayerMap& layer_map, + int64_t start, int64_t stop, + double& max_time, + double& min_time) + { + + NodeMap node_property_map; + ai_assert(curves.size()); + +#ifdef ASSIMP_BUILD_DEBUG + validateAnimCurveNodes(curves, doc.Settings().strictMode); +#endif + const AnimationCurveNode* curve_node = NULL; + for (const AnimationCurveNode* node : curves) { + ai_assert(node); + + if (node->TargetProperty().empty()) { + FBXImporter::LogWarn("target property for animation curve not set: " + node->Name()); + continue; + } + + curve_node = node; + if (node->Curves().empty()) { + FBXImporter::LogWarn("no animation curves assigned to AnimationCurveNode: " + node->Name()); + continue; + } + + node_property_map[node->TargetProperty()].push_back(node); + } + + ai_assert(curve_node); + ai_assert(curve_node->TargetAsModel()); + + const Model& target = *curve_node->TargetAsModel(); + + // check for all possible transformation components + NodeMap::const_iterator chain[TransformationComp_MAXIMUM]; + + bool has_any = false; + bool has_complex = false; + + for (size_t i = 0; i < TransformationComp_MAXIMUM; ++i) { + const TransformationComp comp = static_cast(i); + + // inverse pivots don't exist in the input, we just generate them + if (comp == TransformationComp_RotationPivotInverse || comp == TransformationComp_ScalingPivotInverse) { + chain[i] = node_property_map.end(); + continue; + } + + chain[i] = node_property_map.find(NameTransformationCompProperty(comp)); + if (chain[i] != node_property_map.end()) { + + // check if this curves contains redundant information by looking + // up the corresponding node's transformation chain. + if (doc.Settings().optimizeEmptyAnimationCurves && + IsRedundantAnimationData(target, comp, (*chain[i]).second)) { + + FBXImporter::LogDebug("dropping redundant animation channel for node " + target.Name()); + continue; + } + + has_any = true; + + if (comp != TransformationComp_Rotation && comp != TransformationComp_Scaling && comp != TransformationComp_Translation) + { + has_complex = true; + } + } + } + + if (!has_any) { + FBXImporter::LogWarn("ignoring node animation, did not find any transformation key frames"); + return; + } + + // this needs to play nicely with GenerateTransformationNodeChain() which will + // be invoked _later_ (animations come first). If this node has only rotation, + // scaling and translation _and_ there are no animated other components either, + // we can use a single node and also a single node animation channel. + if (!has_complex && !NeedsComplexTransformationChain(target)) { + + aiNodeAnim* const nd = GenerateSimpleNodeAnim(fixed_name, target, chain, + node_property_map.end(), + layer_map, + start, stop, + max_time, + min_time, + true // input is TRS order, assimp is SRT + ); + + ai_assert(nd); + if (nd->mNumPositionKeys == 0 && nd->mNumRotationKeys == 0 && nd->mNumScalingKeys == 0) { + delete nd; + } + else { + node_anims.push_back(nd); + } + return; + } + + // otherwise, things get gruesome and we need separate animation channels + // for each part of the transformation chain. Remember which channels + // we generated and pass this information to the node conversion + // code to avoid nodes that have identity transform, but non-identity + // animations, being dropped. + unsigned int flags = 0, bit = 0x1; + for (size_t i = 0; i < TransformationComp_MAXIMUM; ++i, bit <<= 1) { + const TransformationComp comp = static_cast(i); + + if (chain[i] != node_property_map.end()) { + flags |= bit; + + ai_assert(comp != TransformationComp_RotationPivotInverse); + ai_assert(comp != TransformationComp_ScalingPivotInverse); + + const std::string& chain_name = NameTransformationChainNode(fixed_name, comp); + + aiNodeAnim* na = nullptr; + switch (comp) + { + case TransformationComp_Rotation: + case TransformationComp_PreRotation: + case TransformationComp_PostRotation: + case TransformationComp_GeometricRotation: + na = GenerateRotationNodeAnim(chain_name, + target, + (*chain[i]).second, + layer_map, + start, stop, + max_time, + min_time); + + break; + + case TransformationComp_RotationOffset: + case TransformationComp_RotationPivot: + case TransformationComp_ScalingOffset: + case TransformationComp_ScalingPivot: + case TransformationComp_Translation: + case TransformationComp_GeometricTranslation: + na = GenerateTranslationNodeAnim(chain_name, + target, + (*chain[i]).second, + layer_map, + start, stop, + max_time, + min_time); + + // pivoting requires us to generate an implicit inverse channel to undo the pivot translation + if (comp == TransformationComp_RotationPivot) { + const std::string& invName = NameTransformationChainNode(fixed_name, + TransformationComp_RotationPivotInverse); + + aiNodeAnim* const inv = GenerateTranslationNodeAnim(invName, + target, + (*chain[i]).second, + layer_map, + start, stop, + max_time, + min_time, + true); + + ai_assert(inv); + if (inv->mNumPositionKeys == 0 && inv->mNumRotationKeys == 0 && inv->mNumScalingKeys == 0) { + delete inv; + } + else { + node_anims.push_back(inv); + } + + ai_assert(TransformationComp_RotationPivotInverse > i); + flags |= bit << (TransformationComp_RotationPivotInverse - i); + } + else if (comp == TransformationComp_ScalingPivot) { + const std::string& invName = NameTransformationChainNode(fixed_name, + TransformationComp_ScalingPivotInverse); + + aiNodeAnim* const inv = GenerateTranslationNodeAnim(invName, + target, + (*chain[i]).second, + layer_map, + start, stop, + max_time, + min_time, + true); + + ai_assert(inv); + if (inv->mNumPositionKeys == 0 && inv->mNumRotationKeys == 0 && inv->mNumScalingKeys == 0) { + delete inv; + } + else { + node_anims.push_back(inv); + } + + ai_assert(TransformationComp_RotationPivotInverse > i); + flags |= bit << (TransformationComp_RotationPivotInverse - i); + } + + break; + + case TransformationComp_Scaling: + case TransformationComp_GeometricScaling: + na = GenerateScalingNodeAnim(chain_name, + target, + (*chain[i]).second, + layer_map, + start, stop, + max_time, + min_time); + + break; + + default: + ai_assert(false); + } + + ai_assert(na); + if (na->mNumPositionKeys == 0 && na->mNumRotationKeys == 0 && na->mNumScalingKeys == 0) { + delete na; + } + else { + node_anims.push_back(na); + } + continue; + } + } + + node_anim_chain_bits[fixed_name] = flags; + } + + + bool FBXConverter::IsRedundantAnimationData(const Model& target, + TransformationComp comp, + const std::vector& curves) { + ai_assert(curves.size()); + + // look for animation nodes with + // * sub channels for all relevant components set + // * one key/value pair per component + // * combined values match up the corresponding value in the bind pose node transformation + // only such nodes are 'redundant' for this function. + + if (curves.size() > 1) { + return false; + } + + const AnimationCurveNode& nd = *curves.front(); + const AnimationCurveMap& sub_curves = nd.Curves(); + + const AnimationCurveMap::const_iterator dx = sub_curves.find("d|X"); + const AnimationCurveMap::const_iterator dy = sub_curves.find("d|Y"); + const AnimationCurveMap::const_iterator dz = sub_curves.find("d|Z"); + + if (dx == sub_curves.end() || dy == sub_curves.end() || dz == sub_curves.end()) { + return false; + } + + const KeyValueList& vx = (*dx).second->GetValues(); + const KeyValueList& vy = (*dy).second->GetValues(); + const KeyValueList& vz = (*dz).second->GetValues(); + + if (vx.size() != 1 || vy.size() != 1 || vz.size() != 1) { + return false; + } + + const aiVector3D dyn_val = aiVector3D(vx[0], vy[0], vz[0]); + const aiVector3D& static_val = PropertyGet(target.Props(), + NameTransformationCompProperty(comp), + TransformationCompDefaultValue(comp) + ); + + const float epsilon = 1e-6f; + return (dyn_val - static_val).SquareLength() < epsilon; + } + + + aiNodeAnim* FBXConverter::GenerateRotationNodeAnim(const std::string& name, + const Model& target, + const std::vector& curves, + const LayerMap& layer_map, + int64_t start, int64_t stop, + double& max_time, + double& min_time) + { + std::unique_ptr na(new aiNodeAnim()); + na->mNodeName.Set(name); + + ConvertRotationKeys(na.get(), curves, layer_map, start, stop, max_time, min_time, target.RotationOrder()); + + // dummy scaling key + na->mScalingKeys = new aiVectorKey[1]; + na->mNumScalingKeys = 1; + + na->mScalingKeys[0].mTime = 0.; + na->mScalingKeys[0].mValue = aiVector3D(1.0f, 1.0f, 1.0f); + + // dummy position key + na->mPositionKeys = new aiVectorKey[1]; + na->mNumPositionKeys = 1; + + na->mPositionKeys[0].mTime = 0.; + na->mPositionKeys[0].mValue = aiVector3D(); + + return na.release(); + } + + aiNodeAnim* FBXConverter::GenerateScalingNodeAnim(const std::string& name, + const Model& /*target*/, + const std::vector& curves, + const LayerMap& layer_map, + int64_t start, int64_t stop, + double& max_time, + double& min_time) + { + std::unique_ptr na(new aiNodeAnim()); + na->mNodeName.Set(name); + + ConvertScaleKeys(na.get(), curves, layer_map, start, stop, max_time, min_time); + + // dummy rotation key + na->mRotationKeys = new aiQuatKey[1]; + na->mNumRotationKeys = 1; + + na->mRotationKeys[0].mTime = 0.; + na->mRotationKeys[0].mValue = aiQuaternion(); + + // dummy position key + na->mPositionKeys = new aiVectorKey[1]; + na->mNumPositionKeys = 1; + + na->mPositionKeys[0].mTime = 0.; + na->mPositionKeys[0].mValue = aiVector3D(); + + return na.release(); + } + + aiNodeAnim* FBXConverter::GenerateTranslationNodeAnim(const std::string& name, + const Model& /*target*/, + const std::vector& curves, + const LayerMap& layer_map, + int64_t start, int64_t stop, + double& max_time, + double& min_time, + bool inverse) { + std::unique_ptr na(new aiNodeAnim()); + na->mNodeName.Set(name); + + ConvertTranslationKeys(na.get(), curves, layer_map, start, stop, max_time, min_time); + + if (inverse) { + for (unsigned int i = 0; i < na->mNumPositionKeys; ++i) { + na->mPositionKeys[i].mValue *= -1.0f; + } + } + + // dummy scaling key + na->mScalingKeys = new aiVectorKey[1]; + na->mNumScalingKeys = 1; + + na->mScalingKeys[0].mTime = 0.; + na->mScalingKeys[0].mValue = aiVector3D(1.0f, 1.0f, 1.0f); + + // dummy rotation key + na->mRotationKeys = new aiQuatKey[1]; + na->mNumRotationKeys = 1; + + na->mRotationKeys[0].mTime = 0.; + na->mRotationKeys[0].mValue = aiQuaternion(); + + return na.release(); + } + + aiNodeAnim* FBXConverter::GenerateSimpleNodeAnim(const std::string& name, + const Model& target, + NodeMap::const_iterator chain[TransformationComp_MAXIMUM], + NodeMap::const_iterator iter_end, + const LayerMap& layer_map, + int64_t start, int64_t stop, + double& max_time, + double& min_time, + bool reverse_order) + + { + std::unique_ptr na(new aiNodeAnim()); + na->mNodeName.Set(name); + + const PropertyTable& props = target.Props(); + + // need to convert from TRS order to SRT? + if (reverse_order) { + + aiVector3D def_scale = PropertyGet(props, "Lcl Scaling", aiVector3D(1.f, 1.f, 1.f)); + aiVector3D def_translate = PropertyGet(props, "Lcl Translation", aiVector3D(0.f, 0.f, 0.f)); + aiVector3D def_rot = PropertyGet(props, "Lcl Rotation", aiVector3D(0.f, 0.f, 0.f)); + + KeyFrameListList scaling; + KeyFrameListList translation; + KeyFrameListList rotation; + + if (chain[TransformationComp_Scaling] != iter_end) { + scaling = GetKeyframeList((*chain[TransformationComp_Scaling]).second, start, stop); + } + + if (chain[TransformationComp_Translation] != iter_end) { + translation = GetKeyframeList((*chain[TransformationComp_Translation]).second, start, stop); + } + + if (chain[TransformationComp_Rotation] != iter_end) { + rotation = GetKeyframeList((*chain[TransformationComp_Rotation]).second, start, stop); + } + + KeyFrameListList joined; + joined.insert(joined.end(), scaling.begin(), scaling.end()); + joined.insert(joined.end(), translation.begin(), translation.end()); + joined.insert(joined.end(), rotation.begin(), rotation.end()); + + const KeyTimeList& times = GetKeyTimeList(joined); + + aiQuatKey* out_quat = new aiQuatKey[times.size()]; + aiVectorKey* out_scale = new aiVectorKey[times.size()]; + aiVectorKey* out_translation = new aiVectorKey[times.size()]; + + if (times.size()) + { + ConvertTransformOrder_TRStoSRT(out_quat, out_scale, out_translation, + scaling, + translation, + rotation, + times, + max_time, + min_time, + target.RotationOrder(), + def_scale, + def_translate, + def_rot); + } + + // XXX remove duplicates / redundant keys which this operation did + // likely produce if not all three channels were equally dense. + + na->mNumScalingKeys = static_cast(times.size()); + na->mNumRotationKeys = na->mNumScalingKeys; + na->mNumPositionKeys = na->mNumScalingKeys; + + na->mScalingKeys = out_scale; + na->mRotationKeys = out_quat; + na->mPositionKeys = out_translation; + } + else { + + // if a particular transformation is not given, grab it from + // the corresponding node to meet the semantics of aiNodeAnim, + // which requires all of rotation, scaling and translation + // to be set. + if (chain[TransformationComp_Scaling] != iter_end) { + ConvertScaleKeys(na.get(), (*chain[TransformationComp_Scaling]).second, + layer_map, + start, stop, + max_time, + min_time); + } + else { + na->mScalingKeys = new aiVectorKey[1]; + na->mNumScalingKeys = 1; + + na->mScalingKeys[0].mTime = 0.; + na->mScalingKeys[0].mValue = PropertyGet(props, "Lcl Scaling", + aiVector3D(1.f, 1.f, 1.f)); + } + + if (chain[TransformationComp_Rotation] != iter_end) { + ConvertRotationKeys(na.get(), (*chain[TransformationComp_Rotation]).second, + layer_map, + start, stop, + max_time, + min_time, + target.RotationOrder()); + } + else { + na->mRotationKeys = new aiQuatKey[1]; + na->mNumRotationKeys = 1; + + na->mRotationKeys[0].mTime = 0.; + na->mRotationKeys[0].mValue = EulerToQuaternion( + PropertyGet(props, "Lcl Rotation", aiVector3D(0.f, 0.f, 0.f)), + target.RotationOrder()); + } + + if (chain[TransformationComp_Translation] != iter_end) { + ConvertTranslationKeys(na.get(), (*chain[TransformationComp_Translation]).second, + layer_map, + start, stop, + max_time, + min_time); + } + else { + na->mPositionKeys = new aiVectorKey[1]; + na->mNumPositionKeys = 1; + + na->mPositionKeys[0].mTime = 0.; + na->mPositionKeys[0].mValue = PropertyGet(props, "Lcl Translation", + aiVector3D(0.f, 0.f, 0.f)); + } + + } + return na.release(); + } + + FBXConverter::KeyFrameListList FBXConverter::GetKeyframeList(const std::vector& nodes, int64_t start, int64_t stop) + { + KeyFrameListList inputs; + inputs.reserve(nodes.size() * 3); + + //give some breathing room for rounding errors + int64_t adj_start = start - 10000; + int64_t adj_stop = stop + 10000; + + for (const AnimationCurveNode* node : nodes) { + ai_assert(node); + + const AnimationCurveMap& curves = node->Curves(); + for (const AnimationCurveMap::value_type& kv : curves) { + + unsigned int mapto; + if (kv.first == "d|X") { + mapto = 0; + } + else if (kv.first == "d|Y") { + mapto = 1; + } + else if (kv.first == "d|Z") { + mapto = 2; + } + else { + FBXImporter::LogWarn("ignoring scale animation curve, did not recognize target component"); + continue; + } + + const AnimationCurve* const curve = kv.second; + ai_assert(curve->GetKeys().size() == curve->GetValues().size() && curve->GetKeys().size()); + + //get values within the start/stop time window + std::shared_ptr Keys(new KeyTimeList()); + std::shared_ptr Values(new KeyValueList()); + const size_t count = curve->GetKeys().size(); + Keys->reserve(count); + Values->reserve(count); + for (size_t n = 0; n < count; n++) + { + int64_t k = curve->GetKeys().at(n); + if (k >= adj_start && k <= adj_stop) + { + Keys->push_back(k); + Values->push_back(curve->GetValues().at(n)); + } + } + + inputs.push_back(std::make_tuple(Keys, Values, mapto)); + } + } + return inputs; // pray for NRVO :-) + } + + + KeyTimeList FBXConverter::GetKeyTimeList(const KeyFrameListList& inputs) { + ai_assert(!inputs.empty()); + + // reserve some space upfront - it is likely that the key-frame lists + // have matching time values, so max(of all key-frame lists) should + // be a good estimate. + KeyTimeList keys; + + size_t estimate = 0; + for (const KeyFrameList& kfl : inputs) { + estimate = std::max(estimate, std::get<0>(kfl)->size()); + } + + keys.reserve(estimate); + + std::vector next_pos; + next_pos.resize(inputs.size(), 0); + + const size_t count = inputs.size(); + while (true) { + + int64_t min_tick = std::numeric_limits::max(); + for (size_t i = 0; i < count; ++i) { + const KeyFrameList& kfl = inputs[i]; + + if (std::get<0>(kfl)->size() > next_pos[i] && std::get<0>(kfl)->at(next_pos[i]) < min_tick) { + min_tick = std::get<0>(kfl)->at(next_pos[i]); + } + } + + if (min_tick == std::numeric_limits::max()) { + break; + } + keys.push_back(min_tick); + + for (size_t i = 0; i < count; ++i) { + const KeyFrameList& kfl = inputs[i]; + + + while (std::get<0>(kfl)->size() > next_pos[i] && std::get<0>(kfl)->at(next_pos[i]) == min_tick) { + ++next_pos[i]; + } + } + } + + return keys; + } + + void FBXConverter::InterpolateKeys(aiVectorKey* valOut, const KeyTimeList& keys, const KeyFrameListList& inputs, + const aiVector3D& def_value, + double& max_time, + double& min_time) { + ai_assert(!keys.empty()); + ai_assert(nullptr != valOut); + + std::vector next_pos; + const size_t count(inputs.size()); + + next_pos.resize(inputs.size(), 0); + + for (KeyTimeList::value_type time : keys) { + ai_real result[3] = { def_value.x, def_value.y, def_value.z }; + + for (size_t i = 0; i < count; ++i) { + const KeyFrameList& kfl = inputs[i]; + + const size_t ksize = std::get<0>(kfl)->size(); + if (ksize == 0) { + continue; + } + if (ksize > next_pos[i] && std::get<0>(kfl)->at(next_pos[i]) == time) { + ++next_pos[i]; + } + + const size_t id0 = next_pos[i] > 0 ? next_pos[i] - 1 : 0; + const size_t id1 = next_pos[i] == ksize ? ksize - 1 : next_pos[i]; + + // use lerp for interpolation + const KeyValueList::value_type valueA = std::get<1>(kfl)->at(id0); + const KeyValueList::value_type valueB = std::get<1>(kfl)->at(id1); + + const KeyTimeList::value_type timeA = std::get<0>(kfl)->at(id0); + const KeyTimeList::value_type timeB = std::get<0>(kfl)->at(id1); + + const ai_real factor = timeB == timeA ? ai_real(0.) : static_cast((time - timeA)) / (timeB - timeA); + const ai_real interpValue = static_cast(valueA + (valueB - valueA) * factor); + + result[std::get<2>(kfl)] = interpValue; + } + + // magic value to convert fbx times to seconds + valOut->mTime = CONVERT_FBX_TIME(time) * anim_fps; + + min_time = std::min(min_time, valOut->mTime); + max_time = std::max(max_time, valOut->mTime); + + valOut->mValue.x = result[0]; + valOut->mValue.y = result[1]; + valOut->mValue.z = result[2]; + + ++valOut; + } + } + + void FBXConverter::InterpolateKeys(aiQuatKey* valOut, const KeyTimeList& keys, const KeyFrameListList& inputs, + const aiVector3D& def_value, + double& maxTime, + double& minTime, + Model::RotOrder order) + { + ai_assert(!keys.empty()); + ai_assert(nullptr != valOut); + + std::unique_ptr temp(new aiVectorKey[keys.size()]); + InterpolateKeys(temp.get(), keys, inputs, def_value, maxTime, minTime); + + aiMatrix4x4 m; + + aiQuaternion lastq; + + for (size_t i = 0, c = keys.size(); i < c; ++i) { + + valOut[i].mTime = temp[i].mTime; + + GetRotationMatrix(order, temp[i].mValue, m); + aiQuaternion quat = aiQuaternion(aiMatrix3x3(m)); + + // take shortest path by checking the inner product + // http://www.3dkingdoms.com/weekly/weekly.php?a=36 + if (quat.x * lastq.x + quat.y * lastq.y + quat.z * lastq.z + quat.w * lastq.w < 0) + { + quat.x = -quat.x; + quat.y = -quat.y; + quat.z = -quat.z; + quat.w = -quat.w; + } + lastq = quat; + + valOut[i].mValue = quat; + } + } + + void FBXConverter::ConvertTransformOrder_TRStoSRT(aiQuatKey* out_quat, aiVectorKey* out_scale, + aiVectorKey* out_translation, + const KeyFrameListList& scaling, + const KeyFrameListList& translation, + const KeyFrameListList& rotation, + const KeyTimeList& times, + double& maxTime, + double& minTime, + Model::RotOrder order, + const aiVector3D& def_scale, + const aiVector3D& def_translate, + const aiVector3D& def_rotation) + { + if (rotation.size()) { + InterpolateKeys(out_quat, times, rotation, def_rotation, maxTime, minTime, order); + } + else { + for (size_t i = 0; i < times.size(); ++i) { + out_quat[i].mTime = CONVERT_FBX_TIME(times[i]) * anim_fps; + out_quat[i].mValue = EulerToQuaternion(def_rotation, order); + } + } + + if (scaling.size()) { + InterpolateKeys(out_scale, times, scaling, def_scale, maxTime, minTime); + } + else { + for (size_t i = 0; i < times.size(); ++i) { + out_scale[i].mTime = CONVERT_FBX_TIME(times[i]) * anim_fps; + out_scale[i].mValue = def_scale; + } + } + + if (translation.size()) { + InterpolateKeys(out_translation, times, translation, def_translate, maxTime, minTime); + } + else { + for (size_t i = 0; i < times.size(); ++i) { + out_translation[i].mTime = CONVERT_FBX_TIME(times[i]) * anim_fps; + out_translation[i].mValue = def_translate; + } + } + + const size_t count = times.size(); + for (size_t i = 0; i < count; ++i) { + aiQuaternion& r = out_quat[i].mValue; + aiVector3D& s = out_scale[i].mValue; + aiVector3D& t = out_translation[i].mValue; + + aiMatrix4x4 mat, temp; + aiMatrix4x4::Translation(t, mat); + mat *= aiMatrix4x4(r.GetMatrix()); + mat *= aiMatrix4x4::Scaling(s, temp); + + mat.Decompose(s, r, t); + } + } + + aiQuaternion FBXConverter::EulerToQuaternion(const aiVector3D& rot, Model::RotOrder order) + { + aiMatrix4x4 m; + GetRotationMatrix(order, rot, m); + + return aiQuaternion(aiMatrix3x3(m)); + } + + void FBXConverter::ConvertScaleKeys(aiNodeAnim* na, const std::vector& nodes, const LayerMap& /*layers*/, + int64_t start, int64_t stop, + double& maxTime, + double& minTime) + { + ai_assert(nodes.size()); + + // XXX for now, assume scale should be blended geometrically (i.e. two + // layers should be multiplied with each other). There is a FBX + // property in the layer to specify the behaviour, though. + + const KeyFrameListList& inputs = GetKeyframeList(nodes, start, stop); + const KeyTimeList& keys = GetKeyTimeList(inputs); + + na->mNumScalingKeys = static_cast(keys.size()); + na->mScalingKeys = new aiVectorKey[keys.size()]; + if (keys.size() > 0) + InterpolateKeys(na->mScalingKeys, keys, inputs, aiVector3D(1.0f, 1.0f, 1.0f), maxTime, minTime); + } + + void FBXConverter::ConvertTranslationKeys(aiNodeAnim* na, const std::vector& nodes, + const LayerMap& /*layers*/, + int64_t start, int64_t stop, + double& maxTime, + double& minTime) + { + ai_assert(nodes.size()); + + // XXX see notes in ConvertScaleKeys() + const KeyFrameListList& inputs = GetKeyframeList(nodes, start, stop); + const KeyTimeList& keys = GetKeyTimeList(inputs); + + na->mNumPositionKeys = static_cast(keys.size()); + na->mPositionKeys = new aiVectorKey[keys.size()]; + if (keys.size() > 0) + InterpolateKeys(na->mPositionKeys, keys, inputs, aiVector3D(0.0f, 0.0f, 0.0f), maxTime, minTime); + } + + void FBXConverter::ConvertRotationKeys(aiNodeAnim* na, const std::vector& nodes, + const LayerMap& /*layers*/, + int64_t start, int64_t stop, + double& maxTime, + double& minTime, + Model::RotOrder order) + { + ai_assert(nodes.size()); + + // XXX see notes in ConvertScaleKeys() + const std::vector< KeyFrameList >& inputs = GetKeyframeList(nodes, start, stop); + const KeyTimeList& keys = GetKeyTimeList(inputs); + + na->mNumRotationKeys = static_cast(keys.size()); + na->mRotationKeys = new aiQuatKey[keys.size()]; + if (!keys.empty()) { + InterpolateKeys(na->mRotationKeys, keys, inputs, aiVector3D(0.0f, 0.0f, 0.0f), maxTime, minTime, order); + } + } + + void FBXConverter::ConvertGlobalSettings() { + if (nullptr == out) { + return; + } + + out->mMetaData = aiMetadata::Alloc(15); + out->mMetaData->Set(0, "UpAxis", doc.GlobalSettings().UpAxis()); + out->mMetaData->Set(1, "UpAxisSign", doc.GlobalSettings().UpAxisSign()); + out->mMetaData->Set(2, "FrontAxis", doc.GlobalSettings().FrontAxis()); + out->mMetaData->Set(3, "FrontAxisSign", doc.GlobalSettings().FrontAxisSign()); + out->mMetaData->Set(4, "CoordAxis", doc.GlobalSettings().CoordAxis()); + out->mMetaData->Set(5, "CoordAxisSign", doc.GlobalSettings().CoordAxisSign()); + out->mMetaData->Set(6, "OriginalUpAxis", doc.GlobalSettings().OriginalUpAxis()); + out->mMetaData->Set(7, "OriginalUpAxisSign", doc.GlobalSettings().OriginalUpAxisSign()); + out->mMetaData->Set(8, "UnitScaleFactor", doc.GlobalSettings().UnitScaleFactor()); + out->mMetaData->Set(9, "OriginalUnitScaleFactor", doc.GlobalSettings().OriginalUnitScaleFactor()); + out->mMetaData->Set(10, "AmbientColor", doc.GlobalSettings().AmbientColor()); + out->mMetaData->Set(11, "FrameRate", (int)doc.GlobalSettings().TimeMode()); + out->mMetaData->Set(12, "TimeSpanStart", doc.GlobalSettings().TimeSpanStart()); + out->mMetaData->Set(13, "TimeSpanStop", doc.GlobalSettings().TimeSpanStop()); + out->mMetaData->Set(14, "CustomFrameRate", doc.GlobalSettings().CustomFrameRate()); + } + + void FBXConverter::TransferDataToScene() + { + ai_assert(!out->mMeshes); + ai_assert(!out->mNumMeshes); + + // note: the trailing () ensures initialization with NULL - not + // many C++ users seem to know this, so pointing it out to avoid + // confusion why this code works. + + if (meshes.size()) { + out->mMeshes = new aiMesh*[meshes.size()](); + out->mNumMeshes = static_cast(meshes.size()); + + std::swap_ranges(meshes.begin(), meshes.end(), out->mMeshes); + } + + if (materials.size()) { + out->mMaterials = new aiMaterial*[materials.size()](); + out->mNumMaterials = static_cast(materials.size()); + + std::swap_ranges(materials.begin(), materials.end(), out->mMaterials); + } + + if (animations.size()) { + out->mAnimations = new aiAnimation*[animations.size()](); + out->mNumAnimations = static_cast(animations.size()); + + std::swap_ranges(animations.begin(), animations.end(), out->mAnimations); + } + + if (lights.size()) { + out->mLights = new aiLight*[lights.size()](); + out->mNumLights = static_cast(lights.size()); + + std::swap_ranges(lights.begin(), lights.end(), out->mLights); + } + + if (cameras.size()) { + out->mCameras = new aiCamera*[cameras.size()](); + out->mNumCameras = static_cast(cameras.size()); + + std::swap_ranges(cameras.begin(), cameras.end(), out->mCameras); + } + + if (textures.size()) { + out->mTextures = new aiTexture*[textures.size()](); + out->mNumTextures = static_cast(textures.size()); + + std::swap_ranges(textures.begin(), textures.end(), out->mTextures); + } + } + + // ------------------------------------------------------------------------------------------------ + void ConvertToAssimpScene(aiScene* out, const Document& doc) + { + FBXConverter converter(out, doc); + } + + } // !FBX } // !Assimp #endif diff --git a/code/FBXConverter.h b/code/FBXConverter.h index ca8dcba2e..039422839 100644 --- a/code/FBXConverter.h +++ b/code/FBXConverter.h @@ -63,6 +63,12 @@ struct aiScene; struct aiNode; struct aiMaterial; +struct morphKeyData { + std::vector values; + std::vector weights; +}; +typedef std::map morphAnimData; + namespace Assimp { namespace FBX { @@ -272,6 +278,7 @@ private: // the function is guaranteed to provide consistent results over multiple invocations // UNLESS RenameNode() is called for a particular node name. std::string FixNodeName(const std::string& name); + std::string FixAnimMeshName(const std::string& name); typedef std::map LayerMap; @@ -281,6 +288,9 @@ private: // ------------------------------------------------------------------------------------------------ void ConvertAnimationStack(const AnimationStack& st); + // ------------------------------------------------------------------------------------------------ + void ProcessMorphAnimDatas(std::map* morphAnimDatas, const BlendShapeChannel* bsc, const AnimationCurveNode* node); + // ------------------------------------------------------------------------------------------------ void GenerateNodeAnimations(std::vector& node_anims, const std::string& fixed_name, diff --git a/code/FBXDeformer.cpp b/code/FBXDeformer.cpp index 9c7c7a4c4..fc8b38e57 100644 --- a/code/FBXDeformer.cpp +++ b/code/FBXDeformer.cpp @@ -48,6 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "FBXParser.h" #include "FBXDocument.h" +#include "FBXMeshGeometry.h" #include "FBXImporter.h" #include "FBXDocumentUtil.h" @@ -158,9 +159,55 @@ Skin::~Skin() { } +// ------------------------------------------------------------------------------------------------ +BlendShape::BlendShape(uint64_t id, const Element& element, const Document& doc, const std::string& name) + : Deformer(id, element, doc, name) +{ + const std::vector& conns = doc.GetConnectionsByDestinationSequenced(ID(), "Deformer"); + blendShapeChannels.reserve(conns.size()); + for (const Connection* con : conns) { + const BlendShapeChannel* const bspc = ProcessSimpleConnection(*con, false, "BlendShapeChannel -> BlendShape", element); + if (bspc) { + blendShapeChannels.push_back(bspc); + continue; + } + } +} +// ------------------------------------------------------------------------------------------------ +BlendShape::~BlendShape() +{ } +// ------------------------------------------------------------------------------------------------ +BlendShapeChannel::BlendShapeChannel(uint64_t id, const Element& element, const Document& doc, const std::string& name) + : Deformer(id, element, doc, name) +{ + const Scope& sc = GetRequiredScope(element); + const Element* const DeformPercent = sc["DeformPercent"]; + if (DeformPercent) { + percent = ParseTokenAsFloat(GetRequiredToken(*DeformPercent, 0)); + } + const Element* const FullWeights = sc["FullWeights"]; + if (FullWeights) { + ParseVectorDataArray(fullWeights, *FullWeights); + } + const std::vector& conns = doc.GetConnectionsByDestinationSequenced(ID(), "Geometry"); + shapeGeometries.reserve(conns.size()); + for (const Connection* con : conns) { + const ShapeGeometry* const sg = ProcessSimpleConnection(*con, false, "Shape -> BlendShapeChannel", element); + if (sg) { + shapeGeometries.push_back(sg); + continue; + } + } } +// ------------------------------------------------------------------------------------------------ +BlendShapeChannel::~BlendShapeChannel() +{ +} +// ------------------------------------------------------------------------------------------------ +} +} #endif diff --git a/code/FBXDocument.cpp b/code/FBXDocument.cpp index f53ae4405..29bc052da 100644 --- a/code/FBXDocument.cpp +++ b/code/FBXDocument.cpp @@ -146,6 +146,9 @@ const Object* LazyObject::Get(bool dieOnError) if (!strcmp(classtag.c_str(),"Mesh")) { object.reset(new MeshGeometry(id,element,name,doc)); } + if (!strcmp(classtag.c_str(), "Shape")) { + object.reset(new ShapeGeometry(id, element, name, doc)); + } } else if (!strncmp(obtype,"NodeAttribute",length)) { if (!strcmp(classtag.c_str(),"Camera")) { @@ -171,6 +174,12 @@ const Object* LazyObject::Get(bool dieOnError) else if (!strcmp(classtag.c_str(),"Skin")) { object.reset(new Skin(id,element,doc,name)); } + else if (!strcmp(classtag.c_str(), "BlendShape")) { + object.reset(new BlendShape(id, element, doc, name)); + } + else if (!strcmp(classtag.c_str(), "BlendShapeChannel")) { + object.reset(new BlendShapeChannel(id, element, doc, name)); + } } else if ( !strncmp( obtype, "Model", length ) ) { // FK and IK effectors are not supported diff --git a/code/FBXDocument.h b/code/FBXDocument.h index 654f5bfa8..a7d81cf0a 100644 --- a/code/FBXDocument.h +++ b/code/FBXDocument.h @@ -65,6 +65,7 @@ struct ImportSettings; class PropertyTable; class Document; class Material; +class ShapeGeometry; class Geometry; class Video; @@ -74,6 +75,8 @@ class AnimationCurveNode; class AnimationLayer; class AnimationStack; +class BlendShapeChannel; +class BlendShape; class Skin; class Cluster; @@ -869,6 +872,46 @@ private: typedef std::vector WeightArray; typedef std::vector WeightIndexArray; + +/** DOM class for BlendShapeChannel deformers */ +class BlendShapeChannel : public Deformer +{ +public: + BlendShapeChannel(uint64_t id, const Element& element, const Document& doc, const std::string& name); + virtual ~BlendShapeChannel(); + + float DeformPercent() const { + return percent; + } + + const WeightArray& GetFullWeights() const { + return fullWeights; + } + + const std::vector& GetShapeGeometries() const { + return shapeGeometries; + } +private: + float percent; + WeightArray fullWeights; + std::vector shapeGeometries; +}; + +/** DOM class for BlendShape deformers */ +class BlendShape : public Deformer +{ +public: + BlendShape(uint64_t id, const Element& element, const Document& doc, const std::string& name); + virtual ~BlendShape(); + + const std::vector& BlendShapeChannels() const { + return blendShapeChannels; + } + +private: + std::vector blendShapeChannels; +}; + /** DOM class for skin deformer clusters (aka subdeformers) */ class Cluster : public Deformer { diff --git a/code/FBXMeshGeometry.cpp b/code/FBXMeshGeometry.cpp index aa794d4df..aa60ee184 100644 --- a/code/FBXMeshGeometry.cpp +++ b/code/FBXMeshGeometry.cpp @@ -62,7 +62,7 @@ using namespace Util; // ------------------------------------------------------------------------------------------------ Geometry::Geometry(uint64_t id, const Element& element, const std::string& name, const Document& doc) - : Object(id, element,name) + : Object(id, element, name) , skin() { const std::vector& conns = doc.GetConnectionsByDestinationSequenced(ID(),"Deformer"); @@ -70,18 +70,26 @@ Geometry::Geometry(uint64_t id, const Element& element, const std::string& name, const Skin* const sk = ProcessSimpleConnection(*con, false, "Skin -> Geometry", element); if(sk) { skin = sk; - break; + } + const BlendShape* const bsp = ProcessSimpleConnection(*con, false, "BlendShape -> Geometry", element); + if (bsp) { + blendShapes.push_back(bsp); } } } - // ------------------------------------------------------------------------------------------------ Geometry::~Geometry() { // empty } +// ------------------------------------------------------------------------------------------------ +const std::vector& Geometry::GetBlendShapes() const { + return blendShapes; +} + +// ------------------------------------------------------------------------------------------------ const Skin* Geometry::DeformerSkin() const { return skin; } @@ -232,7 +240,6 @@ const std::vector& MeshGeometry::GetVertexColors( unsigned int index const MatIndexArray& MeshGeometry::GetMaterialIndices() const { return m_materials; } - // ------------------------------------------------------------------------------------------------ const unsigned int* MeshGeometry::ToOutputVertexIndex( unsigned int in_index, unsigned int& count ) const { if ( in_index >= m_mapping_counts.size() ) { @@ -640,9 +647,39 @@ void MeshGeometry::ReadVertexDataMaterials(std::vector& materials_out, cons << MappingInformationType << "," << ReferenceInformationType); } } +// ------------------------------------------------------------------------------------------------ +ShapeGeometry::ShapeGeometry(uint64_t id, const Element& element, const std::string& name, const Document& doc) + : Geometry(id, element, name, doc) +{ + const Scope* sc = element.Compound(); + if (!sc) { + DOMError("failed to read Geometry object (class: Shape), no data scope found"); + } + const Element& Indexes = GetRequiredElement(*sc, "Indexes", &element); + const Element& Normals = GetRequiredElement(*sc, "Normals", &element); + const Element& Vertices = GetRequiredElement(*sc, "Vertices", &element); + ParseVectorDataArray(m_indices, Indexes); + ParseVectorDataArray(m_vertices, Vertices); + ParseVectorDataArray(m_normals, Normals); +} +// ------------------------------------------------------------------------------------------------ +ShapeGeometry::~ShapeGeometry() { + // empty +} +// ------------------------------------------------------------------------------------------------ +const std::vector& ShapeGeometry::GetVertices() const { + return m_vertices; +} +// ------------------------------------------------------------------------------------------------ +const std::vector& ShapeGeometry::GetNormals() const { + return m_normals; +} +// ------------------------------------------------------------------------------------------------ +const std::vector& ShapeGeometry::GetIndices() const { + return m_indices; +} } // !FBX } // !Assimp - #endif diff --git a/code/FBXMeshGeometry.h b/code/FBXMeshGeometry.h index acd44668a..3e10d73d3 100644 --- a/code/FBXMeshGeometry.h +++ b/code/FBXMeshGeometry.h @@ -64,8 +64,13 @@ public: /** Get the Skin attached to this geometry or NULL */ const Skin* DeformerSkin() const; + /** Get the BlendShape attached to this geometry or NULL */ + const std::vector& GetBlendShapes() const; + private: const Skin* skin; + std::vector blendShapes; + }; typedef std::vector MatIndexArray; @@ -125,7 +130,6 @@ public: /** Determine the face to which a particular output vertex index belongs. * This mapping is always unique. */ unsigned int FaceForVertexIndex( unsigned int in_index ) const; - private: void ReadLayer( const Scope& layer ); void ReadLayerElement( const Scope& layerElement ); @@ -174,6 +178,34 @@ private: std::vector m_mappings; }; +/** +* DOM class for FBX geometry of type "Shape" +*/ +class ShapeGeometry : public Geometry +{ +public: + /** The class constructor */ + ShapeGeometry(uint64_t id, const Element& element, const std::string& name, const Document& doc); + + /** The class destructor */ + virtual ~ShapeGeometry(); + + /** Get a list of all vertex points, non-unique*/ + const std::vector& GetVertices() const; + + /** Get a list of all vertex normals or an empty array if + * no normals are specified. */ + const std::vector& GetNormals() const; + + /** Return list of vertex indices. */ + const std::vector& GetIndices() const; + +private: + std::vector m_vertices; + std::vector m_normals; + std::vector m_indices; +}; + } } diff --git a/code/Importer/IFC/IFCLoader.cpp b/code/Importer/IFC/IFCLoader.cpp index 97c514d44..0b423a4cd 100644 --- a/code/Importer/IFC/IFCLoader.cpp +++ b/code/Importer/IFC/IFCLoader.cpp @@ -207,10 +207,21 @@ void IFCImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOS } uint8_t* buff = new uint8_t[fileInfo.uncompressed_size]; LogInfo("Decompressing IFCZIP file"); - unzOpenCurrentFile( zip ); - const int ret = unzReadCurrentFile( zip, buff, fileInfo.uncompressed_size); + unzOpenCurrentFile(zip); + size_t total = 0; + int read = 0; + do { + int bufferSize = fileInfo.uncompressed_size < INT16_MAX ? fileInfo.uncompressed_size : INT16_MAX; + void* buffer = malloc(bufferSize); + read = unzReadCurrentFile(zip, buffer, bufferSize); + if (read > 0) { + memcpy((char*)buff + total, buffer, read); + total += read; + } + free(buffer); + } while (read > 0); size_t filesize = fileInfo.uncompressed_size; - if ( ret < 0 || size_t(ret) != filesize ) + if (total < 0 || size_t(total) != filesize) { delete[] buff; ThrowException("Failed to decompress IFC ZIP file"); diff --git a/code/ObjFileParser.cpp b/code/ObjFileParser.cpp index 7630127fa..62d2ad46a 100644 --- a/code/ObjFileParser.cpp +++ b/code/ObjFileParser.cpp @@ -119,7 +119,7 @@ void ObjFileParser::parseFile( IOStreamBuffer &streamBuffer ) { size_t lastFilePos( 0 ); std::vector buffer; - while ( streamBuffer.getNextDataLine( buffer, '\\' ) ) { + while ( streamBuffer.getNextDataLine( buffer, '\0' ) ) { m_DataIt = buffer.begin(); m_DataItEnd = buffer.end(); diff --git a/code/glTF2Importer.cpp b/code/glTF2Importer.cpp index 20c28f498..c73e1eabb 100755 --- a/code/glTF2Importer.cpp +++ b/code/glTF2Importer.cpp @@ -438,13 +438,16 @@ void glTF2Importer::ImportMeshes(glTF2::Asset& r) } } - for (size_t tc = 0; tc < attr.texcoord.size() && tc < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++tc) { - if (!attr.texcoord[tc]) { - DefaultLogger::get()->warn("NULL texcoord encountered in mesh \"" + mesh.name + - "\" and will be ignored"); + for (size_t c = 0; c < attr.color.size() && c < AI_MAX_NUMBER_OF_COLOR_SETS; ++c) { + if (attr.color[c]->count != aim->mNumVertices) { + DefaultLogger::get()->warn("Color stream size in mesh \"" + mesh.name + + "\" does not match the vertex count"); continue; } - + aim->mColors[c] = new aiColor4D[attr.color[c]->count]; + attr.color[c]->ExtractData(aim->mColors[c]); + } + for (size_t tc = 0; tc < attr.texcoord.size() && tc < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++tc) { if (attr.texcoord[tc]->count != aim->mNumVertices) { DefaultLogger::get()->warn("Texcoord stream size in mesh \"" + mesh.name + "\" does not match the vertex count"); diff --git a/include/assimp/IOStreamBuffer.h b/include/assimp/IOStreamBuffer.h index c93a191df..be5e4d0c5 100644 --- a/include/assimp/IOStreamBuffer.h +++ b/include/assimp/IOStreamBuffer.h @@ -243,7 +243,7 @@ template inline bool IOStreamBuffer::getNextDataLine( std::vector &buffer, T continuationToken ) { buffer.resize( m_cacheSize ); - if ( m_cachePos == m_cacheSize || 0 == m_filePos ) { + if ( m_cachePos >= m_cacheSize || 0 == m_filePos ) { if ( !readNextBlock() ) { return false; } @@ -273,6 +273,9 @@ bool IOStreamBuffer::getNextDataLine( std::vector &buffer, T continuationT buffer[ i ] = m_cache[ m_cachePos ]; ++m_cachePos; ++i; + if (m_cachePos >= size()) { + break; + } if ( m_cachePos >= m_cacheSize ) { if ( !readNextBlock() ) { return false; diff --git a/include/assimp/mesh.h b/include/assimp/mesh.h index f47d5fd00..f9c2c1e67 100644 --- a/include/assimp/mesh.h +++ b/include/assimp/mesh.h @@ -402,7 +402,7 @@ enum aiPrimitiveType // --------------------------------------------------------------------------- -/** @brief NOT CURRENTLY IN USE. An AnimMesh is an attachment to an #aiMesh stores per-vertex +/** @brief An AnimMesh is an attachment to an #aiMesh stores per-vertex * animations for a particular frame. * * You may think of an #aiAnimMesh as a `patch` for the host mesh, which @@ -414,6 +414,9 @@ enum aiPrimitiveType */ struct aiAnimMesh { + /**Anim Mesh name */ + C_STRUCT aiString mName; + /** Replacement for aiMesh::mVertices. If this array is non-NULL, * it *must* contain mNumVertices entries. The corresponding * array in the host mesh must be non-NULL as well - animation From f170c842263b0d3ddd3d92e4445175ec9a6ae6dd Mon Sep 17 00:00:00 2001 From: rickomax Date: Sun, 6 Jan 2019 19:38:29 -0200 Subject: [PATCH 57/78] Test fixes Test fixes --- code/FBXConverter.cpp | 2 +- code/Importer/IFC/IFCLoader.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/FBXConverter.cpp b/code/FBXConverter.cpp index cd9ad0966..b14bbfe98 100644 --- a/code/FBXConverter.cpp +++ b/code/FBXConverter.cpp @@ -3208,7 +3208,7 @@ namespace Assimp { out->mMetaData->Set(5, "CoordAxisSign", doc.GlobalSettings().CoordAxisSign()); out->mMetaData->Set(6, "OriginalUpAxis", doc.GlobalSettings().OriginalUpAxis()); out->mMetaData->Set(7, "OriginalUpAxisSign", doc.GlobalSettings().OriginalUpAxisSign()); - out->mMetaData->Set(8, "UnitScaleFactor", doc.GlobalSettings().UnitScaleFactor()); + out->mMetaData->Set(8, "UnitScaleFactor", (double)doc.GlobalSettings().UnitScaleFactor()); out->mMetaData->Set(9, "OriginalUnitScaleFactor", doc.GlobalSettings().OriginalUnitScaleFactor()); out->mMetaData->Set(10, "AmbientColor", doc.GlobalSettings().AmbientColor()); out->mMetaData->Set(11, "FrameRate", (int)doc.GlobalSettings().TimeMode()); diff --git a/code/Importer/IFC/IFCLoader.cpp b/code/Importer/IFC/IFCLoader.cpp index 0b423a4cd..2c95872d3 100644 --- a/code/Importer/IFC/IFCLoader.cpp +++ b/code/Importer/IFC/IFCLoader.cpp @@ -221,7 +221,7 @@ void IFCImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOS free(buffer); } while (read > 0); size_t filesize = fileInfo.uncompressed_size; - if (total < 0 || size_t(total) != filesize) + if (total == 0 || size_t(total) != filesize) { delete[] buff; ThrowException("Failed to decompress IFC ZIP file"); From e06b1d0de23af83c2801b25c422f4a80e29a67f4 Mon Sep 17 00:00:00 2001 From: Marc Kurtz Date: Tue, 8 Jan 2019 11:16:41 -0500 Subject: [PATCH 58/78] Change access of getData() to package-private for access in JaiDebug. Move private field to fix compile error. --- port/jassimp/jassimp/src/jassimp/AiMaterial.java | 2 +- port/jassimp/jassimp/src/jassimp/AiSceneFlag.java | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/port/jassimp/jassimp/src/jassimp/AiMaterial.java b/port/jassimp/jassimp/src/jassimp/AiMaterial.java index bf077dff3..77a15a455 100644 --- a/port/jassimp/jassimp/src/jassimp/AiMaterial.java +++ b/port/jassimp/jassimp/src/jassimp/AiMaterial.java @@ -457,7 +457,7 @@ public final class AiMaterial { * * @return the data */ - private Object getData() { + Object getData() { return m_data; } } diff --git a/port/jassimp/jassimp/src/jassimp/AiSceneFlag.java b/port/jassimp/jassimp/src/jassimp/AiSceneFlag.java index 4c7dd6072..af3ee5d5f 100644 --- a/port/jassimp/jassimp/src/jassimp/AiSceneFlag.java +++ b/port/jassimp/jassimp/src/jassimp/AiSceneFlag.java @@ -47,11 +47,6 @@ import java.util.Set; * Status flags for {@link AiScene}s. */ public enum AiSceneFlag { - /** - * The mapped c/c++ integer enum value. - */ - private final int m_rawValue; - /** * Specifies that the scene data structure that was imported is not * complete.

@@ -119,8 +114,12 @@ public enum AiSceneFlag { * you actually need to render it). */ TERRAIN(0x10); - - + + /** + * The mapped c/c++ integer enum value. + */ + private final int m_rawValue; + /** * Utility method for converting from c/c++ based integer enums to java * enums.

From d2f6c6d65e3412406ea0cde7eacdcb7684f5e987 Mon Sep 17 00:00:00 2001 From: Marc Kurtz Date: Tue, 8 Jan 2019 11:17:11 -0500 Subject: [PATCH 59/78] Add ProgressHandler support. --- port/jassimp/jassimp-native/src/jassimp.cpp | 28 ++++++++++- port/jassimp/jassimp-native/src/jassimp.h | 2 +- .../src/jassimp/AiProgressHandler.java | 46 +++++++++++++++++++ port/jassimp/jassimp/src/jassimp/Jassimp.java | 28 ++++++++--- 4 files changed, 95 insertions(+), 9 deletions(-) create mode 100644 port/jassimp/jassimp/src/jassimp/AiProgressHandler.java diff --git a/port/jassimp/jassimp-native/src/jassimp.cpp b/port/jassimp/jassimp-native/src/jassimp.cpp index 070dbc95d..0cf01b1e3 100644 --- a/port/jassimp/jassimp-native/src/jassimp.cpp +++ b/port/jassimp/jassimp-native/src/jassimp.cpp @@ -1,6 +1,7 @@ #include "jassimp.h" #include +#include #include #include #include @@ -248,7 +249,7 @@ static bool call(JNIEnv *env, jobject object, const char* typeName, const char* return false; } - jboolean jReturnValue = env->CallBooleanMethod(object, mid, params[0].l); + jboolean jReturnValue = env->CallBooleanMethodA(object, mid, params); return (bool)jReturnValue; } @@ -591,6 +592,24 @@ class JavaIOSystem : public Assimp::IOSystem { }; +class JavaProgressHandler : public Assimp::ProgressHandler { + private: + JNIEnv* mJniEnv; + jobject& mJavaProgressHandler; + + public: + JavaProgressHandler(JNIEnv* env, jobject& javaProgressHandler) : + mJniEnv(env), + mJavaProgressHandler(javaProgressHandler) + {}; + + bool Update(float percentage) + { + jvalue params[1]; + params[0].f = percentage; + return call(mJniEnv, mJavaProgressHandler, "jassimp/AiProgressHandler", "update", "(F)Z", params); + } +}; static bool loadMeshes(JNIEnv *env, const aiScene* cScene, jobject& jScene) { @@ -1880,7 +1899,7 @@ JNIEXPORT jstring JNICALL Java_jassimp_Jassimp_getErrorString JNIEXPORT jobject JNICALL Java_jassimp_Jassimp_aiImportFile - (JNIEnv *env, jclass jClazz, jstring jFilename, jlong postProcess, jobject ioSystem) + (JNIEnv *env, jclass jClazz, jstring jFilename, jlong postProcess, jobject ioSystem, jobject progressHandler) { jobject jScene = NULL; @@ -1896,6 +1915,11 @@ JNIEXPORT jobject JNICALL Java_jassimp_Jassimp_aiImportFile lprintf("Created aiFileIO\n"); } + if(progressHandler != NULL) + { + imp.SetProgressHandler(new JavaProgressHandler(env, progressHandler)); + } + lprintf("opening file: %s\n", cFilename); /* do import */ diff --git a/port/jassimp/jassimp-native/src/jassimp.h b/port/jassimp/jassimp-native/src/jassimp.h index 7d4b66e29..2a4a84538 100644 --- a/port/jassimp/jassimp-native/src/jassimp.h +++ b/port/jassimp/jassimp-native/src/jassimp.h @@ -39,7 +39,7 @@ JNIEXPORT jstring JNICALL Java_jassimp_Jassimp_getErrorString * Signature: (Ljava/lang/String;J)Ljassimp/AiScene; */ JNIEXPORT jobject JNICALL Java_jassimp_Jassimp_aiImportFile - (JNIEnv *, jclass, jstring, jlong, jobject); + (JNIEnv *, jclass, jstring, jlong, jobject, jobject); #ifdef __cplusplus } diff --git a/port/jassimp/jassimp/src/jassimp/AiProgressHandler.java b/port/jassimp/jassimp/src/jassimp/AiProgressHandler.java new file mode 100644 index 000000000..5512942d9 --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiProgressHandler.java @@ -0,0 +1,46 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, 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. +--------------------------------------------------------------------------- +*/ +package jassimp; + +public interface AiProgressHandler +{ + boolean update(float percentage); +} \ No newline at end of file diff --git a/port/jassimp/jassimp/src/jassimp/Jassimp.java b/port/jassimp/jassimp/src/jassimp/Jassimp.java index 727570a5b..c33f95c0a 100644 --- a/port/jassimp/jassimp/src/jassimp/Jassimp.java +++ b/port/jassimp/jassimp/src/jassimp/Jassimp.java @@ -68,8 +68,9 @@ public final class Jassimp { * @return the loaded scene, or null if an error occurred * @throws IOException if an error occurs */ - private static native AiScene aiImportFile(String filename, - long postProcessing, AiIOSystem ioSystem) throws IOException; + private static native AiScene aiImportFile(String filename, + long postProcessing, AiIOSystem ioSystem, + AiProgressHandler progressHandler) throws IOException; /** @@ -158,11 +159,26 @@ public final class Jassimp { public static AiScene importFile(String filename, Set postProcessing, AiIOSystem ioSystem) throws IOException { - - loadLibrary(); - + return importFile(filename, postProcessing, ioSystem, null); + } + + /** + * Imports a file via assimp. + * + * @param filename the file to import + * @param postProcessing post processing flags + * @param ioSystem ioSystem to load files, or null for default + * @return the loaded scene, or null if an error occurred + * @throws IOException if an error occurs + */ + public static AiScene importFile(String filename, + Set postProcessing, AiIOSystem ioSystem, + AiProgressHandler progressHandler) throws IOException { + + loadLibrary(); + return aiImportFile(filename, AiPostProcessSteps.toRawValue( - postProcessing), ioSystem); + postProcessing), ioSystem, progressHandler); } From f384d1221a160c6abe892fea01e3db3e9f78d14a Mon Sep 17 00:00:00 2001 From: Marc Kurtz Date: Tue, 8 Jan 2019 13:55:07 -0500 Subject: [PATCH 60/78] Make this public for JaiDebug and to pass quality checks. --- port/jassimp/jassimp/src/jassimp/AiMaterial.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/port/jassimp/jassimp/src/jassimp/AiMaterial.java b/port/jassimp/jassimp/src/jassimp/AiMaterial.java index 77a15a455..8582d881a 100644 --- a/port/jassimp/jassimp/src/jassimp/AiMaterial.java +++ b/port/jassimp/jassimp/src/jassimp/AiMaterial.java @@ -457,7 +457,7 @@ public final class AiMaterial { * * @return the data */ - Object getData() { + public Object getData() { return m_data; } } From e37a4de2c218240e5705524ab8b05521e3034131 Mon Sep 17 00:00:00 2001 From: Marc Kurtz Date: Tue, 8 Jan 2019 15:56:20 -0500 Subject: [PATCH 61/78] Fix progress reporting in ObjFileParser. Remove old unused code which is claiming to still take up "1/3" of the total progress. --- code/ObjFileImporter.cpp | 32 -------------------------------- code/ObjFileParser.cpp | 7 +++---- 2 files changed, 3 insertions(+), 36 deletions(-) diff --git a/code/ObjFileImporter.cpp b/code/ObjFileImporter.cpp index 6fd48cfa1..93b2de6f4 100644 --- a/code/ObjFileImporter.cpp +++ b/code/ObjFileImporter.cpp @@ -144,38 +144,6 @@ void ObjFileImporter::InternReadFile( const std::string &file, aiScene* pScene, modelName = file; } - // This next stage takes ~ 1/3th of the total readFile task - // so should amount for 1/3th of the progress - // only update every 100KB or it'll be too slow - /*unsigned int progress = 0; - unsigned int progressCounter = 0; - const unsigned int updateProgressEveryBytes = 100 * 1024; - const unsigned int progressTotal = static_cast(3*m_Buffer.size()/updateProgressEveryBytes);*/ - // process all '\' - /*std::vector ::iterator iter = m_Buffer.begin(); - while (iter != m_Buffer.end()) - { - if (*iter == '\\') - { - // remove '\' - iter = m_Buffer.erase(iter); - // remove next character - while (*iter == '\r' || *iter == '\n') - iter = m_Buffer.erase(iter); - } - else - ++iter; - - if (++progressCounter >= updateProgressEveryBytes) - { - m_progress->UpdateFileRead(++progress, progressTotal); - progressCounter = 0; - } - }*/ - - // 1/3rd progress - m_progress->UpdateFileRead(1, 3); - // parse the file into a temporary representation ObjFileParser parser( streamedBuffer, modelName, pIOHandler, m_progress, file); diff --git a/code/ObjFileParser.cpp b/code/ObjFileParser.cpp index 7630127fa..6b0815a99 100644 --- a/code/ObjFileParser.cpp +++ b/code/ObjFileParser.cpp @@ -113,8 +113,7 @@ void ObjFileParser::parseFile( IOStreamBuffer &streamBuffer ) { //const unsigned int updateProgressEveryBytes = 100 * 1024; unsigned int progressCounter = 0; const unsigned int bytesToProcess = static_cast(streamBuffer.size()); - const unsigned int progressTotal = 3 * bytesToProcess; - const unsigned int progressOffset = bytesToProcess; + const unsigned int progressTotal = bytesToProcess; unsigned int processed = 0; size_t lastFilePos( 0 ); @@ -126,10 +125,10 @@ void ObjFileParser::parseFile( IOStreamBuffer &streamBuffer ) { // Handle progress reporting const size_t filePos( streamBuffer.getFilePos() ); if ( lastFilePos < filePos ) { - processed += static_cast(filePos); + processed = static_cast(filePos); lastFilePos = filePos; progressCounter++; - m_progress->UpdateFileRead( progressOffset + processed * 2, progressTotal ); + m_progress->UpdateFileRead( processed, progressTotal ); } // parse line From 3a3340b9260a09046d0041b8345eca11c7873c56 Mon Sep 17 00:00:00 2001 From: SchroerDev <46781125+SchroerDev@users.noreply.github.com> Date: Thu, 17 Jan 2019 12:26:22 +0100 Subject: [PATCH 62/78] add FBX Line Element support add FBX Line Element support --- code/FBXConverter.cpp | 56 +++++++++++++++++++++++++++++++++++++++- code/FBXConverter.h | 9 +++++-- code/FBXDocument.cpp | 3 +++ code/FBXDocument.h | 1 + code/FBXMeshGeometry.cpp | 26 +++++++++++++++++++ code/FBXMeshGeometry.h | 22 ++++++++++++++++ 6 files changed, 114 insertions(+), 3 deletions(-) diff --git a/code/FBXConverter.cpp b/code/FBXConverter.cpp index b14bbfe98..6070465d5 100644 --- a/code/FBXConverter.cpp +++ b/code/FBXConverter.cpp @@ -870,10 +870,15 @@ namespace Assimp { for (const Geometry* geo : geos) { const MeshGeometry* const mesh = dynamic_cast(geo); + const LineGeometry* const line = dynamic_cast(geo); if (mesh) { const std::vector& indices = ConvertMesh(*mesh, model, node_global_transform, nd); std::copy(indices.begin(), indices.end(), std::back_inserter(meshes)); } + else if (line) { + const std::vector& indices = ConvertLine(*line, model, node_global_transform, nd); + std::copy(indices.begin(), indices.end(), std::back_inserter(meshes)); + } else { FBXImporter::LogWarn("ignoring unrecognized geometry: " + geo->Name()); } @@ -922,7 +927,52 @@ namespace Assimp { return temp; } - aiMesh* FBXConverter::SetupEmptyMesh(const MeshGeometry& mesh, aiNode& nd) + std::vector FBXConverter::ConvertLine(const LineGeometry& line, const Model& model, + const aiMatrix4x4& node_global_transform, aiNode& nd) + { + std::vector temp; + + const std::vector& vertices = line.GetVertices(); + const std::vector& indices = line.GetIndices(); + if (vertices.empty() || indices.empty()) { + FBXImporter::LogWarn("ignoring empty line: " + line.Name()); + return temp; + } + + aiMesh* const out_mesh = SetupEmptyMesh(line, nd); + out_mesh->mPrimitiveTypes |= aiPrimitiveType_LINE; + + // copy vertices + out_mesh->mNumVertices = static_cast(vertices.size()); + out_mesh->mVertices = new aiVector3D[out_mesh->mNumVertices]; + std::copy(vertices.begin(), vertices.end(), out_mesh->mVertices); + + //Number of line segments (faces) is "Number of Points - Number of Endpoints" + //N.B.: Endpoints in FbxLine are denoted by negative indices. + //If such an Index is encountered, add 1 and multiply by -1 to get the real index. + unsigned int epcount = 0; + for (unsigned i = 0; i < indices.size(); i++) + { + if (indices[i] < 0) epcount++; + } + unsigned int pcount = indices.size(); + unsigned int scount = out_mesh->mNumFaces = pcount - epcount; + + aiFace* fac = out_mesh->mFaces = new aiFace[scount](); + for (unsigned int i = 0; i < pcount; ++i) { + if (indices[i] < 0) continue; + aiFace& f = *fac++; + f.mNumIndices = 2; //2 == aiPrimitiveType_LINE + f.mIndices = new unsigned int[2]; + f.mIndices[0] = indices[i]; + int segid = indices[(i + 1 == pcount ? 0 : i + 1)]; //If we have reached he last point, wrap around + f.mIndices[1] = (segid < 0 ? (segid + 1)*-1 : segid); //Convert EndPoint Index to normal Index + } + temp.push_back(static_cast(meshes.size() - 1)); + return temp; + } + + aiMesh* FBXConverter::SetupEmptyMesh(const Geometry& mesh, aiNode& nd) { aiMesh* const out_mesh = new aiMesh(); meshes.push_back(out_mesh); @@ -957,6 +1007,10 @@ namespace Assimp { // copy vertices out_mesh->mNumVertices = static_cast(vertices.size()); out_mesh->mVertices = new aiVector3D[vertices.size()]; + // for (unsigned int i = 0; i < vertices.size(); i++) + // { + // aiMatrix4x4::Translation(vertices[i], nd); + // } std::copy(vertices.begin(), vertices.end(), out_mesh->mVertices); // generate dummy faces diff --git a/code/FBXConverter.h b/code/FBXConverter.h index 039422839..2d1278373 100644 --- a/code/FBXConverter.h +++ b/code/FBXConverter.h @@ -174,14 +174,18 @@ private: // ------------------------------------------------------------------------------------------------ void ConvertModel(const Model& model, aiNode& nd, const aiMatrix4x4& node_global_transform); - + // ------------------------------------------------------------------------------------------------ // MeshGeometry -> aiMesh, return mesh index + 1 or 0 if the conversion failed std::vector ConvertMesh(const MeshGeometry& mesh, const Model& model, const aiMatrix4x4& node_global_transform, aiNode& nd); // ------------------------------------------------------------------------------------------------ - aiMesh* SetupEmptyMesh(const MeshGeometry& mesh, aiNode& nd); + std::vector ConvertLine(const LineGeometry& line, const Model& model, + const aiMatrix4x4& node_global_transform, aiNode& nd); + + // ------------------------------------------------------------------------------------------------ + aiMesh* SetupEmptyMesh(const Geometry& mesh, aiNode& nd); // ------------------------------------------------------------------------------------------------ unsigned int ConvertMeshSingleMaterial(const MeshGeometry& mesh, const Model& model, @@ -424,6 +428,7 @@ private: std::vector lights; std::vector cameras; std::vector textures; + typedef std::map MaterialMap; MaterialMap materials_converted; diff --git a/code/FBXDocument.cpp b/code/FBXDocument.cpp index 29bc052da..deac89ca0 100644 --- a/code/FBXDocument.cpp +++ b/code/FBXDocument.cpp @@ -149,6 +149,9 @@ const Object* LazyObject::Get(bool dieOnError) if (!strcmp(classtag.c_str(), "Shape")) { object.reset(new ShapeGeometry(id, element, name, doc)); } + if (!strcmp(classtag.c_str(), "Line")) { + object.reset(new LineGeometry(id, element, name, doc)); + } } else if (!strncmp(obtype,"NodeAttribute",length)) { if (!strcmp(classtag.c_str(),"Camera")) { diff --git a/code/FBXDocument.h b/code/FBXDocument.h index a7d81cf0a..02accf92e 100644 --- a/code/FBXDocument.h +++ b/code/FBXDocument.h @@ -66,6 +66,7 @@ class PropertyTable; class Document; class Material; class ShapeGeometry; +class LineGeometry; class Geometry; class Video; diff --git a/code/FBXMeshGeometry.cpp b/code/FBXMeshGeometry.cpp index aa60ee184..faa5de75c 100644 --- a/code/FBXMeshGeometry.cpp +++ b/code/FBXMeshGeometry.cpp @@ -679,6 +679,32 @@ const std::vector& ShapeGeometry::GetNormals() const { const std::vector& ShapeGeometry::GetIndices() const { return m_indices; } +// ------------------------------------------------------------------------------------------------ +LineGeometry::LineGeometry(uint64_t id, const Element& element, const std::string& name, const Document& doc) + : Geometry(id, element, name, doc) +{ + const Scope* sc = element.Compound(); + if (!sc) { + DOMError("failed to read Geometry object (class: Line), no data scope found"); + } + const Element& Points = GetRequiredElement(*sc, "Points", &element); + const Element& PointsIndex = GetRequiredElement(*sc, "PointsIndex", &element); + ParseVectorDataArray(m_vertices, Points); + ParseVectorDataArray(m_indices, PointsIndex); +} + +// ------------------------------------------------------------------------------------------------ +LineGeometry::~LineGeometry() { + // empty +} +// ------------------------------------------------------------------------------------------------ +const std::vector& LineGeometry::GetVertices() const { + return m_vertices; +} +// ------------------------------------------------------------------------------------------------ +const std::vector& LineGeometry::GetIndices() const { + return m_indices; +} } // !FBX } // !Assimp #endif diff --git a/code/FBXMeshGeometry.h b/code/FBXMeshGeometry.h index 3e10d73d3..641461a69 100644 --- a/code/FBXMeshGeometry.h +++ b/code/FBXMeshGeometry.h @@ -205,6 +205,28 @@ private: std::vector m_normals; std::vector m_indices; }; +/** +* DOM class for FBX geometry of type "Line" +*/ +class LineGeometry : public Geometry +{ +public: + /** The class constructor */ + LineGeometry(uint64_t id, const Element& element, const std::string& name, const Document& doc); + + /** The class destructor */ + virtual ~LineGeometry(); + + /** Get a list of all vertex points, non-unique*/ + const std::vector& GetVertices() const; + + /** Return list of vertex indices. */ + const std::vector& GetIndices() const; + +private: + std::vector m_vertices; + std::vector m_indices; +}; } } From f7fe729c88308734efb0c9927291965ceaa548a6 Mon Sep 17 00:00:00 2001 From: SchroerDev <46781125+SchroerDev@users.noreply.github.com> Date: Thu, 17 Jan 2019 12:32:36 +0100 Subject: [PATCH 63/78] Update FBXConverter.cpp --- code/FBXConverter.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/code/FBXConverter.cpp b/code/FBXConverter.cpp index 6070465d5..14d2b2c5c 100644 --- a/code/FBXConverter.cpp +++ b/code/FBXConverter.cpp @@ -1007,10 +1007,7 @@ namespace Assimp { // copy vertices out_mesh->mNumVertices = static_cast(vertices.size()); out_mesh->mVertices = new aiVector3D[vertices.size()]; - // for (unsigned int i = 0; i < vertices.size(); i++) - // { - // aiMatrix4x4::Translation(vertices[i], nd); - // } + std::copy(vertices.begin(), vertices.end(), out_mesh->mVertices); // generate dummy faces From 7dc32ab9b6bf96515bd1978a5892b7cbefd964fb Mon Sep 17 00:00:00 2001 From: Merwan Achibet Date: Tue, 8 Jan 2019 22:14:45 +0100 Subject: [PATCH 64/78] Preserve all the material parameters from FBX models --- code/FBXConverter.cpp | 175 ++++++++++++++++++++++++++++++++++++++++++ code/FBXConverter.h | 1 + 2 files changed, 176 insertions(+) diff --git a/code/FBXConverter.cpp b/code/FBXConverter.cpp index b14bbfe98..a67f171da 100644 --- a/code/FBXConverter.cpp +++ b/code/FBXConverter.cpp @@ -1524,6 +1524,7 @@ namespace Assimp { // shading stuff and colors SetShadingPropertiesCommon(out_mat, props); + SetShadingPropertiesRaw( out_mat, props, material.Textures(), mesh ); // texture assignments SetTextureProperties(out_mat, material.Textures(), mesh); @@ -2022,6 +2023,180 @@ namespace Assimp { const float DispFactor = PropertyGet(props, "DisplacementFactor", ok); if (ok) { out_mat->AddProperty(&DispFactor, 1, "$mat.displacementscaling", 0, 0); + } +} + + +void FBXConverter::SetShadingPropertiesRaw(aiMaterial* out_mat, const PropertyTable& props, const TextureMap& textures, const MeshGeometry* const mesh) +{ + // Add all the unparsed properties with a "$raw." prefix + + const std::string prefix = "$raw."; + + for (const DirectPropertyMap::value_type& prop : props.GetUnparsedProperties()) { + + std::string name = prefix + prop.first; + + if (const TypedProperty* interpreted = prop.second->As >()) + { + out_mat->AddProperty(&interpreted->Value(), 1, name.c_str(), 0, 0); + } + else if (const TypedProperty* interpreted = prop.second->As >()) + { + out_mat->AddProperty(&interpreted->Value(), 1, name.c_str(), 0, 0); + } + else if (const TypedProperty* interpreted = prop.second->As >()) + { + out_mat->AddProperty(&interpreted->Value(), 1, name.c_str(), 0, 0); + } + else if (const TypedProperty* interpreted = prop.second->As >()) + { + out_mat->AddProperty(&interpreted->Value(), 1, name.c_str(), 0, 0); + } + else if (const TypedProperty* interpreted = prop.second->As >()) + { + out_mat->AddProperty(&interpreted->Value(), 1, name.c_str(), 0, 0); + } + else if (const TypedProperty* interpreted = prop.second->As >()) + { + int value = interpreted->Value() ? 1 : 0; + out_mat->AddProperty(&value, 1, name.c_str(), 0, 0); + } + else if (const TypedProperty* interpreted = prop.second->As >()) + { + const aiString value = aiString(interpreted->Value()); + out_mat->AddProperty(&value, name.c_str(), 0, 0); + } + } + + // Add the textures' properties + + for (TextureMap::const_iterator it = textures.begin(); it != textures.end(); it++) { + + std::string name = prefix + it->first; + + const Texture* const tex = (*it).second; + if (tex != nullptr) + { + aiString path; + path.Set(tex->RelativeFilename()); + + const Video* media = tex->Media(); + if (media != nullptr && media->ContentLength() > 0) { + unsigned int index; + + VideoMap::const_iterator it = textures_converted.find(media); + if (it != textures_converted.end()) { + index = (*it).second; + } + else { + index = ConvertVideo(*media); + textures_converted[media] = index; + } + + // setup texture reference string (copied from ColladaLoader::FindFilenameForEffectTexture) + path.data[0] = '*'; + path.length = 1 + ASSIMP_itoa10(path.data + 1, MAXLEN - 1, index); + } + + out_mat->AddProperty(&path, (name + "|file").c_str(), aiTextureType_UNKNOWN, 0); + + aiUVTransform uvTrafo; + // XXX handle all kinds of UV transformations + uvTrafo.mScaling = tex->UVScaling(); + uvTrafo.mTranslation = tex->UVTranslation(); + out_mat->AddProperty(&uvTrafo, 1, (name + "|uvtrafo").c_str(), aiTextureType_UNKNOWN, 0); + + int uvIndex = 0; + + bool uvFound = false; + const std::string& uvSet = PropertyGet(tex->Props(), "UVSet", uvFound); + if (uvFound) { + // "default" is the name which usually appears in the FbxFileTexture template + if (uvSet != "default" && uvSet.length()) { + // this is a bit awkward - we need to find a mesh that uses this + // material and scan its UV channels for the given UV name because + // assimp references UV channels by index, not by name. + + // XXX: the case that UV channels may appear in different orders + // in meshes is unhandled. A possible solution would be to sort + // the UV channels alphabetically, but this would have the side + // effect that the primary (first) UV channel would sometimes + // be moved, causing trouble when users read only the first + // UV channel and ignore UV channel assignments altogether. + + std::vector::iterator materialIt = std::find(materials.begin(), materials.end(), out_mat); + const unsigned int matIndex = static_cast(std::distance(materials.begin(), materialIt)); + + uvIndex = -1; + if (!mesh) + { + for (const MeshMap::value_type& v : meshes_converted) { + const MeshGeometry* const mesh = dynamic_cast(v.first); + if (!mesh) { + continue; + } + + const MatIndexArray& mats = mesh->GetMaterialIndices(); + if (std::find(mats.begin(), mats.end(), matIndex) == mats.end()) { + continue; + } + + int index = -1; + for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) { + if (mesh->GetTextureCoords(i).empty()) { + break; + } + const std::string& name = mesh->GetTextureCoordChannelName(i); + if (name == uvSet) { + index = static_cast(i); + break; + } + } + if (index == -1) { + FBXImporter::LogWarn("did not find UV channel named " + uvSet + " in a mesh using this material"); + continue; + } + + if (uvIndex == -1) { + uvIndex = index; + } + else { + FBXImporter::LogWarn("the UV channel named " + uvSet + " appears at different positions in meshes, results will be wrong"); + } + } + } + else + { + int index = -1; + for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) { + if (mesh->GetTextureCoords(i).empty()) { + break; + } + const std::string& name = mesh->GetTextureCoordChannelName(i); + if (name == uvSet) { + index = static_cast(i); + break; + } + } + if (index == -1) { + FBXImporter::LogWarn("did not find UV channel named " + uvSet + " in a mesh using this material"); + } + + if (uvIndex == -1) { + uvIndex = index; + } + } + + if (uvIndex == -1) { + FBXImporter::LogWarn("failed to resolve UV channel " + uvSet + ", using first UV channel"); + uvIndex = 0; + } + } + } + + out_mat->AddProperty(&uvIndex, 1, (name + "|uvwsrc").c_str(), aiTextureType_UNKNOWN, 0); + } } } diff --git a/code/FBXConverter.h b/code/FBXConverter.h index 039422839..0f87038bb 100644 --- a/code/FBXConverter.h +++ b/code/FBXConverter.h @@ -264,6 +264,7 @@ private: // ------------------------------------------------------------------------------------------------ void SetShadingPropertiesCommon(aiMaterial* out_mat, const PropertyTable& props); + void SetShadingPropertiesRaw(aiMaterial* out_mat, const PropertyTable& props, const TextureMap& textures, const MeshGeometry* const mesh); // ------------------------------------------------------------------------------------------------ // get the number of fps for a FrameRate enumerated value From a04b96ef66dd625121792b2ae8d7029213e87a5b Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 20 Jan 2019 20:29:23 +0100 Subject: [PATCH 65/78] Disable step. --- code/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 043599aca..b9b9c211b 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -890,7 +890,7 @@ SET( assimp_src ${PostProcessing_SRCS} ${MaterialSystem_SRCS} ${STEPParser_SRCS} - ${Step_SRCS} +# ${Step_SRCS} check if we need a different approach # Model Support ${ASSIMP_LOADER_SRCS} From 819108098687970edb661d3fbfaac1c92ca952a0 Mon Sep 17 00:00:00 2001 From: Adrian Perez Date: Fri, 18 Jan 2019 16:43:39 -0800 Subject: [PATCH 66/78] Adapt MemoryIOSystem to delegate unhandled calls to shadowed IO system --- code/Importer.cpp | 2 +- include/assimp/MemoryIOWrapper.h | 37 +++++++++++++++++++++----------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/code/Importer.cpp b/code/Importer.cpp index fe6df187c..da395edb2 100644 --- a/code/Importer.cpp +++ b/code/Importer.cpp @@ -483,7 +483,7 @@ const aiScene* Importer::ReadFileFromMemory( const void* pBuffer, IOSystem* io = pimpl->mIOHandler; pimpl->mIOHandler = NULL; - SetIOHandler(new MemoryIOSystem((const uint8_t*)pBuffer,pLength)); + SetIOHandler(new MemoryIOSystem((const uint8_t*)pBuffer,pLength,io)); // read the file and recover the previous IOSystem static const size_t BufSize(Importer::MaxLenHint + 28); diff --git a/include/assimp/MemoryIOWrapper.h b/include/assimp/MemoryIOWrapper.h index 5260cb2b2..540f5f32c 100644 --- a/include/assimp/MemoryIOWrapper.h +++ b/include/assimp/MemoryIOWrapper.h @@ -151,9 +151,8 @@ class MemoryIOSystem : public IOSystem { public: /** Constructor. */ - MemoryIOSystem (const uint8_t* buff, size_t len) - : buffer (buff), length(len) { - } + MemoryIOSystem(const uint8_t* buff, size_t len, IOSystem* io) + : buffer(buff), length(len), existing_io(io), created_stream(NULL) {} /** Destructor. */ ~MemoryIOSystem() { @@ -161,40 +160,52 @@ public: // ------------------------------------------------------------------- /** Tests for the existence of a file at the given path. */ - bool Exists( const char* pFile) const { - return !strncmp(pFile,AI_MEMORYIO_MAGIC_FILENAME,AI_MEMORYIO_MAGIC_FILENAME_LENGTH); + bool Exists(const char* pFile) const { + if (!strncmp(pFile,AI_MEMORYIO_MAGIC_FILENAME,AI_MEMORYIO_MAGIC_FILENAME_LENGTH)) { + return true; + } + return existing_io ? existing_io->Exists(pFile) : false; } // ------------------------------------------------------------------- /** Returns the directory separator. */ char getOsSeparator() const { - return '/'; // why not? it doesn't care + return existing_io ? existing_io->getOsSeparator() + : '/'; // why not? it doesn't care } // ------------------------------------------------------------------- /** Open a new file with a given path. */ - IOStream* Open( const char* pFile, const char* /*pMode*/ = "rb") { - if (strncmp(pFile,AI_MEMORYIO_MAGIC_FILENAME,AI_MEMORYIO_MAGIC_FILENAME_LENGTH)) { - return NULL; + IOStream* Open(const char* pFile, const char* pMode = "rb") { + if (!strncmp(pFile,AI_MEMORYIO_MAGIC_FILENAME,AI_MEMORYIO_MAGIC_FILENAME_LENGTH)) { + created_stream = new MemoryIOStream(buffer, length); + return created_stream; } - return new MemoryIOStream(buffer,length); + return existing_io ? existing_io->Open(pFile, pMode) : NULL; } // ------------------------------------------------------------------- /** Closes the given file and releases all resources associated with it. */ void Close( IOStream* pFile) { - delete pFile; + if (pFile == created_stream) { + delete pFile; + created_stream = NULL; + } else if (existing_io) { + existing_io->Close(pFile); + } } // ------------------------------------------------------------------- /** Compare two paths */ - bool ComparePaths (const char* /*one*/, const char* /*second*/) const { - return false; + bool ComparePaths(const char* one, const char* second) const { + return existing_io ? existing_io->ComparePaths(one, second) : false; } private: const uint8_t* buffer; size_t length; + IOSystem* existing_io; + IOStream* created_stream; }; } // end namespace Assimp From 87112eefaee620a7473cbcf54361a2f8dcabe5f7 Mon Sep 17 00:00:00 2001 From: Adrian Perez Date: Mon, 21 Jan 2019 14:37:33 -0800 Subject: [PATCH 67/78] Fill in rest of interface; switch created_stream to a unique_ptr --- include/assimp/MemoryIOWrapper.h | 54 ++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 13 deletions(-) diff --git a/include/assimp/MemoryIOWrapper.h b/include/assimp/MemoryIOWrapper.h index 540f5f32c..33be00393 100644 --- a/include/assimp/MemoryIOWrapper.h +++ b/include/assimp/MemoryIOWrapper.h @@ -152,7 +152,7 @@ class MemoryIOSystem : public IOSystem public: /** Constructor. */ MemoryIOSystem(const uint8_t* buff, size_t len, IOSystem* io) - : buffer(buff), length(len), existing_io(io), created_stream(NULL) {} + : buffer(buff), length(len), existing_io(io), created_stream() {} /** Destructor. */ ~MemoryIOSystem() { @@ -160,7 +160,7 @@ public: // ------------------------------------------------------------------- /** Tests for the existence of a file at the given path. */ - bool Exists(const char* pFile) const { + bool Exists(const char* pFile) const override { if (!strncmp(pFile,AI_MEMORYIO_MAGIC_FILENAME,AI_MEMORYIO_MAGIC_FILENAME_LENGTH)) { return true; } @@ -169,27 +169,26 @@ public: // ------------------------------------------------------------------- /** Returns the directory separator. */ - char getOsSeparator() const { + char getOsSeparator() const override { return existing_io ? existing_io->getOsSeparator() - : '/'; // why not? it doesn't care + : '/'; // why not? it doesn't care } // ------------------------------------------------------------------- /** Open a new file with a given path. */ - IOStream* Open(const char* pFile, const char* pMode = "rb") { + IOStream* Open(const char* pFile, const char* pMode = "rb") override { if (!strncmp(pFile,AI_MEMORYIO_MAGIC_FILENAME,AI_MEMORYIO_MAGIC_FILENAME_LENGTH)) { - created_stream = new MemoryIOStream(buffer, length); - return created_stream; + created_stream.reset(new MemoryIOStream(buffer, length)); + return created_stream.get(); } return existing_io ? existing_io->Open(pFile, pMode) : NULL; } // ------------------------------------------------------------------- /** Closes the given file and releases all resources associated with it. */ - void Close( IOStream* pFile) { - if (pFile == created_stream) { - delete pFile; - created_stream = NULL; + void Close( IOStream* pFile) override { + if (pFile == created_stream.get()) { + created_stream.reset(); } else if (existing_io) { existing_io->Close(pFile); } @@ -197,15 +196,44 @@ public: // ------------------------------------------------------------------- /** Compare two paths */ - bool ComparePaths(const char* one, const char* second) const { + bool ComparePaths(const char* one, const char* second) const override { return existing_io ? existing_io->ComparePaths(one, second) : false; } + bool PushDirectory( const std::string &path ) override { + return existing_io ? existing_io->PushDirectory(path) : false; + } + + const std::string &CurrentDirectory() const override { + static std::string empty; + return existing_io ? existing_io->CurrentDirectory() : empty; + } + + size_t StackSize() const override { + return existing_io ? existing_io->StackSize() : 0; + } + + bool PopDirectory() override { + return existing_io ? existing_io->PopDirectory() : false; + } + + bool CreateDirectory( const std::string &path ) override { + return existing_io ? existing_io->CreateDirectory(path) : false; + } + + bool ChangeDirectory( const std::string &path ) override { + return existing_io ? existing_io->ChangeDirectory(path) : false; + } + + bool DeleteFile( const std::string &file ) override { + return existing_io ? existing_io->DeleteFile(file) : false; + } + private: const uint8_t* buffer; size_t length; IOSystem* existing_io; - IOStream* created_stream; + std::unique_ptr created_stream; }; } // end namespace Assimp From ad18cd96609cefb487980b0beed63ec72b36765d Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 22 Jan 2019 11:13:26 +0100 Subject: [PATCH 68/78] Update MemoryIOWrapper.h Fix leak. --- include/assimp/MemoryIOWrapper.h | 50 +++++++++++++++++--------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/include/assimp/MemoryIOWrapper.h b/include/assimp/MemoryIOWrapper.h index 33be00393..4ac9d1c70 100644 --- a/include/assimp/MemoryIOWrapper.h +++ b/include/assimp/MemoryIOWrapper.h @@ -57,20 +57,16 @@ namespace Assimp { // ---------------------------------------------------------------------------------- /** Implementation of IOStream to read directly from a memory buffer */ // ---------------------------------------------------------------------------------- -class MemoryIOStream : public IOStream -{ - //friend class MemoryIOSystem; +class MemoryIOStream : public IOStream { public: MemoryIOStream (const uint8_t* buff, size_t len, bool own = false) - : buffer (buff) - , length(len) - , pos((size_t)0) - , own(own) - { + : buffer (buff) + , length(len) + , pos((size_t)0) + , own(own) { + // empty } -public: - ~MemoryIOStream () { if(own) { delete[] buffer; @@ -80,8 +76,8 @@ public: // ------------------------------------------------------------------- // Read from stream size_t Read(void* pvBuffer, size_t pSize, size_t pCount) { - ai_assert(pvBuffer); - ai_assert(pSize); + ai_assert(nullptr != pvBuffer); + ai_assert(0 != pSize); const size_t cnt = std::min(pCount,(length-pos)/pSize), ofs = pSize*cnt; memcpy(pvBuffer,buffer+pos,ofs); @@ -105,14 +101,12 @@ public: return AI_FAILURE; } pos = pOffset; - } - else if (aiOrigin_END == pOrigin) { + } else if (aiOrigin_END == pOrigin) { if (pOffset > length) { return AI_FAILURE; } pos = length-pOffset; - } - else { + } else { if (pOffset+pos > length) { return AI_FAILURE; } @@ -147,15 +141,21 @@ private: // --------------------------------------------------------------------------- /** Dummy IO system to read from a memory buffer */ -class MemoryIOSystem : public IOSystem -{ +class MemoryIOSystem : public IOSystem { public: /** Constructor. */ MemoryIOSystem(const uint8_t* buff, size_t len, IOSystem* io) - : buffer(buff), length(len), existing_io(io), created_stream() {} + : buffer(buff) + , length(len) + , existing_io(io) + , created_stream() { + // empty + } /** Destructor. */ ~MemoryIOSystem() { + delete created_stream; + created_stream = nullptr; } // ------------------------------------------------------------------- @@ -178,8 +178,8 @@ public: /** Open a new file with a given path. */ IOStream* Open(const char* pFile, const char* pMode = "rb") override { if (!strncmp(pFile,AI_MEMORYIO_MAGIC_FILENAME,AI_MEMORYIO_MAGIC_FILENAME_LENGTH)) { - created_stream.reset(new MemoryIOStream(buffer, length)); - return created_stream.get(); + created_stream = new MemoryIOStream(buffer, length); + return created_stream; } return existing_io ? existing_io->Open(pFile, pMode) : NULL; } @@ -187,8 +187,9 @@ public: // ------------------------------------------------------------------- /** Closes the given file and releases all resources associated with it. */ void Close( IOStream* pFile) override { - if (pFile == created_stream.get()) { - created_stream.reset(); + if (pFile == created_stream) { + delete created_stream; + created_stream = nullptr; } else if (existing_io) { existing_io->Close(pFile); } @@ -233,8 +234,9 @@ private: const uint8_t* buffer; size_t length; IOSystem* existing_io; - std::unique_ptr created_stream; + IOStream *created_stream; }; + } // end namespace Assimp #endif From f8a23e128bfbd9fe300005a7338952cfbf9a9ceb Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 22 Jan 2019 20:47:24 +0100 Subject: [PATCH 69/78] Update MemoryIOWrapper.h Make code more readable. --- include/assimp/MemoryIOWrapper.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/assimp/MemoryIOWrapper.h b/include/assimp/MemoryIOWrapper.h index 4ac9d1c70..7b0ea0dbc 100644 --- a/include/assimp/MemoryIOWrapper.h +++ b/include/assimp/MemoryIOWrapper.h @@ -51,6 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include namespace Assimp { + #define AI_MEMORYIO_MAGIC_FILENAME "$$$___magic___$$$" #define AI_MEMORYIO_MAGIC_FILENAME_LENGTH 17 @@ -78,9 +79,11 @@ public: size_t Read(void* pvBuffer, size_t pSize, size_t pCount) { ai_assert(nullptr != pvBuffer); ai_assert(0 != pSize); - const size_t cnt = std::min(pCount,(length-pos)/pSize), ofs = pSize*cnt; + + const size_t cnt = std::min( pCount, (length-pos) / pSize); + const size_t ofs = pSize * cnt; - memcpy(pvBuffer,buffer+pos,ofs); + ::memcpy(pvBuffer,buffer+pos,ofs); pos += ofs; return cnt; @@ -161,7 +164,7 @@ public: // ------------------------------------------------------------------- /** Tests for the existence of a file at the given path. */ bool Exists(const char* pFile) const override { - if (!strncmp(pFile,AI_MEMORYIO_MAGIC_FILENAME,AI_MEMORYIO_MAGIC_FILENAME_LENGTH)) { + if (0 == strncmp( pFile, AI_MEMORYIO_MAGIC_FILENAME, AI_MEMORYIO_MAGIC_FILENAME_LENGTH ) ) { return true; } return existing_io ? existing_io->Exists(pFile) : false; @@ -177,7 +180,7 @@ public: // ------------------------------------------------------------------- /** Open a new file with a given path. */ IOStream* Open(const char* pFile, const char* pMode = "rb") override { - if (!strncmp(pFile,AI_MEMORYIO_MAGIC_FILENAME,AI_MEMORYIO_MAGIC_FILENAME_LENGTH)) { + if ( 0 == strncmp( pFile, AI_MEMORYIO_MAGIC_FILENAME, AI_MEMORYIO_MAGIC_FILENAME_LENGTH ) ) { created_stream = new MemoryIOStream(buffer, length); return created_stream; } From b04ed672886c672a45d12bbd900ba5d2b9694314 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 22 Jan 2019 20:47:24 +0100 Subject: [PATCH 70/78] Update MemoryIOWrapper.h Make code more readable. --- include/assimp/MemoryIOWrapper.h | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/include/assimp/MemoryIOWrapper.h b/include/assimp/MemoryIOWrapper.h index 4ac9d1c70..a9a78c319 100644 --- a/include/assimp/MemoryIOWrapper.h +++ b/include/assimp/MemoryIOWrapper.h @@ -51,6 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include namespace Assimp { + #define AI_MEMORYIO_MAGIC_FILENAME "$$$___magic___$$$" #define AI_MEMORYIO_MAGIC_FILENAME_LENGTH 17 @@ -78,9 +79,11 @@ public: size_t Read(void* pvBuffer, size_t pSize, size_t pCount) { ai_assert(nullptr != pvBuffer); ai_assert(0 != pSize); - const size_t cnt = std::min(pCount,(length-pos)/pSize), ofs = pSize*cnt; + + const size_t cnt = std::min( pCount, (length-pos) / pSize); + const size_t ofs = pSize * cnt; - memcpy(pvBuffer,buffer+pos,ofs); + ::memcpy(pvBuffer,buffer+pos,ofs); pos += ofs; return cnt; @@ -148,20 +151,18 @@ public: : buffer(buff) , length(len) , existing_io(io) - , created_stream() { + , created_streams() { // empty } /** Destructor. */ ~MemoryIOSystem() { - delete created_stream; - created_stream = nullptr; } // ------------------------------------------------------------------- /** Tests for the existence of a file at the given path. */ bool Exists(const char* pFile) const override { - if (!strncmp(pFile,AI_MEMORYIO_MAGIC_FILENAME,AI_MEMORYIO_MAGIC_FILENAME_LENGTH)) { + if (0 == strncmp( pFile, AI_MEMORYIO_MAGIC_FILENAME, AI_MEMORYIO_MAGIC_FILENAME_LENGTH ) ) { return true; } return existing_io ? existing_io->Exists(pFile) : false; @@ -177,9 +178,9 @@ public: // ------------------------------------------------------------------- /** Open a new file with a given path. */ IOStream* Open(const char* pFile, const char* pMode = "rb") override { - if (!strncmp(pFile,AI_MEMORYIO_MAGIC_FILENAME,AI_MEMORYIO_MAGIC_FILENAME_LENGTH)) { - created_stream = new MemoryIOStream(buffer, length); - return created_stream; + if ( 0 == strncmp( pFile, AI_MEMORYIO_MAGIC_FILENAME, AI_MEMORYIO_MAGIC_FILENAME_LENGTH ) ) { + created_streams.emplace_back(new MemoryIOStream(buffer, length)); + return created_streams.back(); } return existing_io ? existing_io->Open(pFile, pMode) : NULL; } @@ -187,9 +188,10 @@ public: // ------------------------------------------------------------------- /** Closes the given file and releases all resources associated with it. */ void Close( IOStream* pFile) override { - if (pFile == created_stream) { - delete created_stream; - created_stream = nullptr; + auto it = std::find(created_streams.begin(), created_streams.end(), pFile); + if (it != created_streams.end()) { + delete pFile; + created_streams.erase(it); } else if (existing_io) { existing_io->Close(pFile); } @@ -234,7 +236,7 @@ private: const uint8_t* buffer; size_t length; IOSystem* existing_io; - IOStream *created_stream; + std::vector created_streams; }; } // end namespace Assimp From 5d6fc7a5574e16d276159cca6952542689c6d765 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 27 Jan 2019 21:05:58 +0100 Subject: [PATCH 71/78] Closes https://github.com/assimp/assimp/issues/2251: introduce AI_CONFIG_PP_FID_IGNORE_TEXTURECOORDS to avoid removing textures. --- code/FindInvalidDataProcess.cpp | 36 +++++++++++++++++++-------------- code/FindInvalidDataProcess.h | 20 +++++++++--------- include/assimp/config.h.in | 7 +++++++ 3 files changed, 37 insertions(+), 26 deletions(-) diff --git a/code/FindInvalidDataProcess.cpp b/code/FindInvalidDataProcess.cpp index b1a296a54..19dd420a1 100644 --- a/code/FindInvalidDataProcess.cpp +++ b/code/FindInvalidDataProcess.cpp @@ -51,6 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // internal headers #include "FindInvalidDataProcess.h" #include "ProcessHelper.h" + #include #include #include @@ -60,8 +61,8 @@ using namespace Assimp; // ------------------------------------------------------------------------------------------------ // Constructor to be privately used by Importer FindInvalidDataProcess::FindInvalidDataProcess() - : configEpsilon(0.0) -{ +: configEpsilon(0.0) +, mIgnoreTexCoods( false ){ // nothing to do here } @@ -85,6 +86,7 @@ void FindInvalidDataProcess::SetupProperties(const Importer* pImp) { // Get the current value of AI_CONFIG_PP_FID_ANIM_ACCURACY configEpsilon = (0 != pImp->GetPropertyFloat(AI_CONFIG_PP_FID_ANIM_ACCURACY,0.f)); + mIgnoreTexCoods = pImp->GetPropertyBool(AI_CONFIG_PP_FID_IGNORE_TEXTURECOORDS, false); } // ------------------------------------------------------------------------------------------------ @@ -171,7 +173,8 @@ void FindInvalidDataProcess::Execute( aiScene* pScene) // ------------------------------------------------------------------------------------------------ template -inline const char* ValidateArrayContents(const T* /*arr*/, unsigned int /*size*/, +inline +const char* ValidateArrayContents(const T* /*arr*/, unsigned int /*size*/, const std::vector& /*dirtyMask*/, bool /*mayBeIdentical = false*/, bool /*mayBeZero = true*/) { return NULL; @@ -179,7 +182,8 @@ inline const char* ValidateArrayContents(const T* /*arr*/, unsigned int /*size*/ // ------------------------------------------------------------------------------------------------ template <> -inline const char* ValidateArrayContents(const aiVector3D* arr, unsigned int size, +inline +const char* ValidateArrayContents(const aiVector3D* arr, unsigned int size, const std::vector& dirtyMask, bool mayBeIdentical , bool mayBeZero ) { bool b = false; @@ -251,8 +255,8 @@ bool EpsilonCompare(const aiQuatKey& n, const aiQuatKey& s, ai_real e // ------------------------------------------------------------------------------------------------ template -inline bool AllIdentical(T* in, unsigned int num, ai_real epsilon) -{ +inline +bool AllIdentical(T* in, unsigned int num, ai_real epsilon) { if (num <= 1) { return true; } @@ -361,17 +365,19 @@ int FindInvalidDataProcess::ProcessMesh (aiMesh* pMesh) // process texture coordinates for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS && pMesh->mTextureCoords[i]; ++i) { - if (ProcessArray(pMesh->mTextureCoords[i], pMesh->mNumVertices, "uvcoords", dirtyMask)) { - pMesh->mNumUVComponents[i] = 0; + if (!mIgnoreTexCoods) { + if (ProcessArray(pMesh->mTextureCoords[i], pMesh->mNumVertices, "uvcoords", dirtyMask)) { + pMesh->mNumUVComponents[i] = 0; - // delete all subsequent texture coordinate sets. - for (unsigned int a = i + 1; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a) { - delete[] pMesh->mTextureCoords[a]; - pMesh->mTextureCoords[a] = NULL; - pMesh->mNumUVComponents[a] = 0; + // delete all subsequent texture coordinate sets. + for (unsigned int a = i + 1; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a) { + delete[] pMesh->mTextureCoords[a]; + pMesh->mTextureCoords[a] = NULL; + pMesh->mNumUVComponents[a] = 0; + } + + ret = true; } - - ret = true; } } diff --git a/code/FindInvalidDataProcess.h b/code/FindInvalidDataProcess.h index 00dfef145..f5a49f496 100644 --- a/code/FindInvalidDataProcess.h +++ b/code/FindInvalidDataProcess.h @@ -41,7 +41,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** @file Defines a post processing step to search an importer's output - for data that is obviously invalid */ + * for data that is obviously invalid + */ #ifndef AI_FINDINVALIDDATA_H_INC #define AI_FINDINVALIDDATA_H_INC @@ -50,7 +51,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include struct aiMesh; + class FindInvalidDataProcessTest; + namespace Assimp { // --------------------------------------------------------------------------- @@ -59,15 +62,11 @@ namespace Assimp { * * Originally this was a workaround for some models written by Blender * which have zero normal vectors. */ -class ASSIMP_API FindInvalidDataProcess : public BaseProcess -{ +class ASSIMP_API FindInvalidDataProcess : public BaseProcess { public: - FindInvalidDataProcess(); ~FindInvalidDataProcess(); -public: - // ------------------------------------------------------------------- // bool IsActive( unsigned int pFlags) const; @@ -80,26 +79,25 @@ public: // Run the step void Execute( aiScene* pScene); -public: - // ------------------------------------------------------------------- - /** Executes the postprocessing step on the given mesh + /** Executes the post-processing step on the given mesh * @param pMesh The mesh to process. * @return 0 - nothing, 1 - removed sth, 2 - please delete me */ int ProcessMesh( aiMesh* pMesh); // ------------------------------------------------------------------- - /** Executes the postprocessing step on the given animation + /** Executes the post-processing step on the given animation * @param anim The animation to process. */ void ProcessAnimation (aiAnimation* anim); // ------------------------------------------------------------------- - /** Executes the postprocessing step on the given anim channel + /** Executes the post-processing step on the given anim channel * @param anim The animation channel to process.*/ void ProcessAnimationChannel (aiNodeAnim* anim); private: ai_real configEpsilon; + bool mIgnoreTexCoods; }; } // end of namespace Assimp diff --git a/include/assimp/config.h.in b/include/assimp/config.h.in index fd828bc6e..a37ff0b8c 100644 --- a/include/assimp/config.h.in +++ b/include/assimp/config.h.in @@ -498,6 +498,13 @@ enum aiComponent #define AI_CONFIG_PP_FID_ANIM_ACCURACY \ "PP_FID_ANIM_ACCURACY" +// --------------------------------------------------------------------------- +/** @brief Input parameter to the #aiProcess_FindInvalidData step: + * Set to true to ignore texture coordinates. This may be useful if you have + * to assign different kind of textures like one for the summer or one for the winter. + */ +#define AI_CONFIG_PP_FID_IGNORE_TEXTURECOORDS \ + "PP_FID_IGNORE_TEXTURECOORDS" // TransformUVCoords evaluates UV scalings #define AI_UVTRAFO_SCALING 0x1 From 2432abacc70eb225fc917883405f188f190ac414 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 27 Jan 2019 21:11:52 +0100 Subject: [PATCH 72/78] Update README.md Update doc. --- port/AndroidJNI/README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/port/AndroidJNI/README.md b/port/AndroidJNI/README.md index 570ca4fb3..7998fa3ef 100644 --- a/port/AndroidJNI/README.md +++ b/port/AndroidJNI/README.md @@ -1,7 +1,7 @@ Build Asset Importer Lib for Android ==================================== -This module provides a fascade for the io-stream-access to files behind the -android-asset-management within an Android native application. +This module provides a fascade for the io-stream-access to files behind the android-asset-management within +an Android-native application. - It is built as a static library - It requires Android NDK with android API > 9 support. @@ -20,6 +20,8 @@ A small example how to wrap assimp for Android: #include Assimp::Importer* importer = new Assimp::Importer(); -Assimp::AndroidJNIIOSystem* ioSystem = new Assimp::AndroidJNIIOSystem(app->activity); -importer->SetIOHandler(ioSystem); +Assimp::AndroidJNIIOSystem *ioSystem = new Assimp::AndroidJNIIOSystem(app->activity); +if ( nullptr != iosSystem ) { + importer->SetIOHandler(ioSystem); +} ``` From b35331b92ae90b6d7d5932721f203a7bd6bb2933 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 28 Jan 2019 10:50:36 +0100 Subject: [PATCH 73/78] Update FindInvalidDataProcess.cpp -Fix some review findings. --- code/FindInvalidDataProcess.cpp | 80 ++++++++++++++------------------- 1 file changed, 33 insertions(+), 47 deletions(-) diff --git a/code/FindInvalidDataProcess.cpp b/code/FindInvalidDataProcess.cpp index 19dd420a1..c775187e9 100644 --- a/code/FindInvalidDataProcess.cpp +++ b/code/FindInvalidDataProcess.cpp @@ -68,22 +68,19 @@ FindInvalidDataProcess::FindInvalidDataProcess() // ------------------------------------------------------------------------------------------------ // Destructor, private as well -FindInvalidDataProcess::~FindInvalidDataProcess() -{ +FindInvalidDataProcess::~FindInvalidDataProcess() { // nothing to do here } // ------------------------------------------------------------------------------------------------ // Returns whether the processing step is present in the given flag field. -bool FindInvalidDataProcess::IsActive( unsigned int pFlags) const -{ +bool FindInvalidDataProcess::IsActive( unsigned int pFlags) const { return 0 != (pFlags & aiProcess_FindInvalidData); } // ------------------------------------------------------------------------------------------------ // Setup import configuration -void FindInvalidDataProcess::SetupProperties(const Importer* pImp) -{ +void FindInvalidDataProcess::SetupProperties(const Importer* pImp) { // Get the current value of AI_CONFIG_PP_FID_ANIM_ACCURACY configEpsilon = (0 != pImp->GetPropertyFloat(AI_CONFIG_PP_FID_ANIM_ACCURACY,0.f)); mIgnoreTexCoods = pImp->GetPropertyBool(AI_CONFIG_PP_FID_IGNORE_TEXTURECOORDS, false); @@ -91,8 +88,7 @@ void FindInvalidDataProcess::SetupProperties(const Importer* pImp) // ------------------------------------------------------------------------------------------------ // Update mesh references in the node graph -void UpdateMeshReferences(aiNode* node, const std::vector& meshMapping) -{ +void UpdateMeshReferences(aiNode* node, const std::vector& meshMapping) { if (node->mNumMeshes) { unsigned int out = 0; for (unsigned int a = 0; a < node->mNumMeshes;++a) { @@ -118,8 +114,7 @@ void UpdateMeshReferences(aiNode* node, const std::vector& meshMap // ------------------------------------------------------------------------------------------------ // Executes the post processing step on the given imported data. -void FindInvalidDataProcess::Execute( aiScene* pScene) -{ +void FindInvalidDataProcess::Execute( aiScene* pScene) { ASSIMP_LOG_DEBUG("FindInvalidDataProcess begin"); bool out = false; @@ -175,17 +170,16 @@ void FindInvalidDataProcess::Execute( aiScene* pScene) template inline const char* ValidateArrayContents(const T* /*arr*/, unsigned int /*size*/, - const std::vector& /*dirtyMask*/, bool /*mayBeIdentical = false*/, bool /*mayBeZero = true*/) + const std::vector& /*dirtyMask*/, bool /*mayBeIdentical = false*/, bool /*mayBeZero = true*/) { - return NULL; + return nullptr; } // ------------------------------------------------------------------------------------------------ template <> inline const char* ValidateArrayContents(const aiVector3D* arr, unsigned int size, - const std::vector& dirtyMask, bool mayBeIdentical , bool mayBeZero ) -{ + const std::vector& dirtyMask, bool mayBeIdentical , bool mayBeZero ) { bool b = false; unsigned int cnt = 0; for (unsigned int i = 0; i < size;++i) { @@ -207,14 +201,14 @@ const char* ValidateArrayContents(const aiVector3D* arr, unsigned in if (cnt > 1 && !b && !mayBeIdentical) { return "All vectors are identical"; } - return NULL; + return nullptr; } // ------------------------------------------------------------------------------------------------ template -inline bool ProcessArray(T*& in, unsigned int num,const char* name, - const std::vector& dirtyMask, bool mayBeIdentical = false, bool mayBeZero = true) -{ +inline +bool ProcessArray(T*& in, unsigned int num,const char* name, + const std::vector& dirtyMask, bool mayBeIdentical = false, bool mayBeZero = true) { const char* err = ValidateArrayContents(in,num,dirtyMask,mayBeIdentical,mayBeZero); if (err) { ASSIMP_LOG_ERROR_F( "FindInvalidDataProcess fails on mesh ", name, ": ", err); @@ -261,17 +255,14 @@ bool AllIdentical(T* in, unsigned int num, ai_real epsilon) { return true; } - if (epsilon > 0.f) { + if (fabs(epsilon) > 0.f) { for (unsigned int i = 0; i < num-1;++i) { - if (!EpsilonCompare(in[i],in[i+1],epsilon)) { return false; } } - } - else { + } else { for (unsigned int i = 0; i < num-1;++i) { - if (in[i] != in[i+1]) { return false; } @@ -282,27 +273,24 @@ bool AllIdentical(T* in, unsigned int num, ai_real epsilon) { // ------------------------------------------------------------------------------------------------ // Search an animation for invalid content -void FindInvalidDataProcess::ProcessAnimation (aiAnimation* anim) -{ +void FindInvalidDataProcess::ProcessAnimation (aiAnimation* anim) { // Process all animation channels - for (unsigned int a = 0; a < anim->mNumChannels;++a) { + for ( unsigned int a = 0; a < anim->mNumChannels; ++a ) { ProcessAnimationChannel( anim->mChannels[a]); } } // ------------------------------------------------------------------------------------------------ -void FindInvalidDataProcess::ProcessAnimationChannel (aiNodeAnim* anim) -{ - int i = 0; - - // ScenePreprocessor's work ... - ai_assert((0 != anim->mPositionKeys && 0 != anim->mRotationKeys && 0 != anim->mScalingKeys)); +void FindInvalidDataProcess::ProcessAnimationChannel (aiNodeAnim* anim) { + ai_assert( 0 != anim->mPositionKeys ); + ai_assert( 0 != anim->mRotationKeys ); + ai_assert( 0 != anim->mScalingKeys ); // Check whether all values in a tracks are identical - in this case // we can remove al keys except one. // POSITIONS - if (anim->mNumPositionKeys > 1 && AllIdentical(anim->mPositionKeys,anim->mNumPositionKeys,configEpsilon)) - { + int i = 0; + if (anim->mNumPositionKeys > 1 && AllIdentical(anim->mPositionKeys,anim->mNumPositionKeys,configEpsilon)) { aiVectorKey v = anim->mPositionKeys[0]; // Reallocate ... we need just ONE element, it makes no sense to reuse the array @@ -313,8 +301,7 @@ void FindInvalidDataProcess::ProcessAnimationChannel (aiNodeAnim* anim) } // ROTATIONS - if (anim->mNumRotationKeys > 1 && AllIdentical(anim->mRotationKeys,anim->mNumRotationKeys,configEpsilon)) - { + if (anim->mNumRotationKeys > 1 && AllIdentical(anim->mRotationKeys,anim->mNumRotationKeys,configEpsilon)) { aiQuatKey v = anim->mRotationKeys[0]; // Reallocate ... we need just ONE element, it makes no sense to reuse the array @@ -325,8 +312,7 @@ void FindInvalidDataProcess::ProcessAnimationChannel (aiNodeAnim* anim) } // SCALINGS - if (anim->mNumScalingKeys > 1 && AllIdentical(anim->mScalingKeys,anim->mNumScalingKeys,configEpsilon)) - { + if (anim->mNumScalingKeys > 1 && AllIdentical(anim->mScalingKeys,anim->mNumScalingKeys,configEpsilon)) { aiVectorKey v = anim->mScalingKeys[0]; // Reallocate ... we need just ONE element, it makes no sense to reuse the array @@ -335,8 +321,9 @@ void FindInvalidDataProcess::ProcessAnimationChannel (aiNodeAnim* anim) anim->mScalingKeys[0] = v; i = 1; } - if (1 == i) + if ( 1 == i ) { ASSIMP_LOG_WARN("Simplified dummy tracks with just one key"); + } } // ------------------------------------------------------------------------------------------------ @@ -364,8 +351,8 @@ int FindInvalidDataProcess::ProcessMesh (aiMesh* pMesh) } // process texture coordinates - for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS && pMesh->mTextureCoords[i]; ++i) { - if (!mIgnoreTexCoods) { + if (!mIgnoreTexCoods) { + for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS && pMesh->mTextureCoords[i]; ++i) { if (ProcessArray(pMesh->mTextureCoords[i], pMesh->mNumVertices, "uvcoords", dirtyMask)) { pMesh->mNumUVComponents[i] = 0; @@ -394,13 +381,11 @@ int FindInvalidDataProcess::ProcessMesh (aiMesh* pMesh) aiPrimitiveType_POLYGON & pMesh->mPrimitiveTypes) { // We need to update the lookup-table - for (unsigned int m = 0; m < pMesh->mNumFaces;++m) - { - const aiFace& f = pMesh->mFaces[m]; + for (unsigned int m = 0; m < pMesh->mNumFaces;++m) { + const aiFace& f = pMesh->mFaces[ m ]; if (f.mNumIndices < 3) { dirtyMask[f.mIndices[0]] = true; - if (f.mNumIndices == 2) { dirtyMask[f.mIndices[1]] = true; } @@ -409,7 +394,9 @@ int FindInvalidDataProcess::ProcessMesh (aiMesh* pMesh) } // Normals, tangents and bitangents are undefined for // the whole mesh (and should not even be there) - else return ret; + else { + return ret; + } } // Process mesh normals @@ -432,5 +419,4 @@ int FindInvalidDataProcess::ProcessMesh (aiMesh* pMesh) return ret ? 1 : 0; } - #endif // !! ASSIMP_BUILD_NO_FINDINVALIDDATA_PROCESS From 38bebaf4d3356a0d4544c44f9001fbe104e2aae9 Mon Sep 17 00:00:00 2001 From: FRICOTEAUX Date: Mon, 28 Jan 2019 16:02:09 +0100 Subject: [PATCH 74/78] Fix glTF2 export with no texture coordinates --- code/glTF2Exporter.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/glTF2Exporter.cpp b/code/glTF2Exporter.cpp index d513dc45d..c8dfd8f4b 100644 --- a/code/glTF2Exporter.cpp +++ b/code/glTF2Exporter.cpp @@ -732,6 +732,9 @@ void glTF2Exporter::ExportMeshes() /************** Texture coordinates **************/ for (int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) { + if (!aim->HasTextureCoords(i)) + continue; + // Flip UV y coords if (aim -> mNumUVComponents[i] > 1) { for (unsigned int j = 0; j < aim->mNumVertices; ++j) { @@ -967,7 +970,7 @@ void glTF2Exporter::ExportMetadata() inline Ref GetSamplerInputRef(Asset& asset, std::string& animId, Ref& buffer, std::vector& times) { - return ExportData(asset, animId, buffer, times.size(), ×[0], AttribType::SCALAR, AttribType::SCALAR, ComponentType_FLOAT); + return ExportData(asset, animId, buffer, (unsigned int)times.size(), ×[0], AttribType::SCALAR, AttribType::SCALAR, ComponentType_FLOAT); } inline void ExtractTranslationSampler(Asset& asset, std::string& animId, Ref& buffer, const aiNodeAnim* nodeChannel, float ticksPerSecond, Animation::Sampler& sampler) From a06133ab52cc49d611f2616a55840dfdb7522d09 Mon Sep 17 00:00:00 2001 From: kimkulling Date: Wed, 30 Jan 2019 09:41:39 +0100 Subject: [PATCH 75/78] Update copyrights. --- CMakeLists.txt | 2 +- code/3DSConverter.cpp | 2 +- code/3DSExporter.cpp | 2 +- code/3DSExporter.h | 2 +- code/3DSHelper.h | 2 +- code/3DSLoader.cpp | 2 +- code/3DSLoader.h | 2 +- code/3MFXmlTags.h | 2 +- code/ACLoader.cpp | 2 +- code/ACLoader.h | 2 +- code/AMFImporter.cpp | 2 +- code/AMFImporter.hpp | 2 +- code/AMFImporter_Geometry.cpp | 2 +- code/AMFImporter_Macro.hpp | 2 +- code/AMFImporter_Material.cpp | 2 +- code/AMFImporter_Node.hpp | 2 +- code/AMFImporter_Postprocess.cpp | 2 +- code/ASELoader.cpp | 2 +- code/ASELoader.h | 2 +- code/ASEParser.cpp | 2 +- code/ASEParser.h | 2 +- code/AssbinExporter.cpp | 2 +- code/AssbinExporter.h | 2 +- code/AssbinLoader.cpp | 2 +- code/AssbinLoader.h | 2 +- code/Assimp.cpp | 2 +- code/AssimpCExport.cpp | 2 +- code/AssxmlExporter.cpp | 2 +- code/AssxmlExporter.h | 2 +- code/B3DImporter.cpp | 2 +- code/B3DImporter.h | 2 +- code/BVHLoader.cpp | 2 +- code/BVHLoader.h | 2 +- code/BaseImporter.cpp | 2 +- code/BaseProcess.cpp | 2 +- code/BaseProcess.h | 2 +- code/Bitmap.cpp | 2 +- code/BlenderDNA.cpp | 2 +- code/BlenderDNA.h | 2 +- code/BlenderDNA.inl | 2 +- code/BlenderIntermediate.h | 2 +- code/BlenderLoader.cpp | 2 +- code/BlenderLoader.h | 2 +- code/BlenderModifier.cpp | 2 +- code/BlenderModifier.h | 2 +- code/BlenderScene.h | 2 +- code/BlenderTessellator.cpp | 2 +- code/BlenderTessellator.h | 2 +- code/CInterfaceIOWrapper.cpp | 2 +- code/CInterfaceIOWrapper.h | 2 +- code/CMakeLists.txt | 2 +- code/COBLoader.cpp | 2 +- code/COBLoader.h | 2 +- code/COBScene.h | 2 +- code/CSMLoader.cpp | 2 +- code/CSMLoader.h | 2 +- code/CalcTangentsProcess.cpp | 2 +- code/CalcTangentsProcess.h | 2 +- code/ColladaExporter.cpp | 2 +- code/ColladaExporter.h | 2 +- code/ColladaHelper.h | 2 +- code/ColladaLoader.cpp | 2 +- code/ColladaLoader.h | 2 +- code/ColladaParser.cpp | 2 +- code/ColladaParser.h | 2 +- code/ComputeUVMappingProcess.cpp | 2 +- code/ComputeUVMappingProcess.h | 2 +- code/ConvertToLHProcess.cpp | 2 +- code/ConvertToLHProcess.h | 2 +- code/D3MFExporter.cpp | 2 +- code/D3MFExporter.h | 2 +- code/D3MFImporter.cpp | 2 +- code/D3MFImporter.h | 2 +- code/D3MFOpcPackage.cpp | 2 +- code/D3MFOpcPackage.h | 2 +- code/DXFHelper.h | 2 +- code/DXFLoader.cpp | 2 +- code/DXFLoader.h | 2 +- code/DeboneProcess.cpp | 2 +- code/DeboneProcess.h | 2 +- code/DefaultIOStream.cpp | 2 +- code/DefaultIOSystem.cpp | 2 +- code/DefaultLogger.cpp | 2 +- code/DefaultProgressHandler.h | 2 +- code/DropFaceNormalsProcess.cpp | 2 +- code/DropFaceNormalsProcess.h | 2 +- code/EmbedTexturesProcess.cpp | 2 +- code/EmbedTexturesProcess.h | 2 +- code/Exporter.cpp | 2 +- code/FBXAnimation.cpp | 2 +- code/FBXBinaryTokenizer.cpp | 2 +- code/FBXCommon.h | 2 +- code/FBXCompileConfig.h | 2 +- code/FBXConverter.cpp | 2 +- code/FBXConverter.h | 2 +- code/FBXDeformer.cpp | 2 +- code/FBXDocument.cpp | 2 +- code/FBXDocument.h | 2 +- code/FBXDocumentUtil.cpp | 2 +- code/FBXExportNode.cpp | 2 +- code/FBXExportNode.h | 2 +- code/FBXExportProperty.cpp | 2 +- code/FBXExportProperty.h | 2 +- code/FBXExporter.cpp | 2 +- code/FBXExporter.h | 2 +- code/FBXImportSettings.h | 2 +- code/FBXImporter.cpp | 2 +- code/FBXImporter.h | 2 +- code/FBXMaterial.cpp | 2 +- code/FBXMeshGeometry.cpp | 2 +- code/FBXMeshGeometry.h | 2 +- code/FBXModel.cpp | 2 +- code/FBXNodeAttribute.cpp | 2 +- code/FBXParser.cpp | 2 +- code/FBXParser.h | 2 +- code/FBXProperties.cpp | 2 +- code/FBXProperties.h | 2 +- code/FBXTokenizer.cpp | 2 +- code/FBXTokenizer.h | 2 +- code/FBXUtil.cpp | 2 +- code/FBXUtil.h | 2 +- code/FIReader.cpp | 2 +- code/FIReader.hpp | 2 +- code/FileLogStream.h | 2 +- code/FindDegenerates.cpp | 2 +- code/FindDegenerates.h | 2 +- code/FindInstancesProcess.cpp | 2 +- code/FindInstancesProcess.h | 2 +- code/FindInvalidDataProcess.cpp | 2 +- code/FindInvalidDataProcess.h | 2 +- code/FixNormalsStep.cpp | 2 +- code/FixNormalsStep.h | 2 +- code/GenFaceNormalsProcess.cpp | 2 +- code/GenFaceNormalsProcess.h | 2 +- code/GenVertexNormalsProcess.cpp | 2 +- code/GenVertexNormalsProcess.h | 2 +- code/HMPFileData.h | 2 +- code/HMPLoader.cpp | 2 +- code/HMPLoader.h | 2 +- code/HalfLifeFileData.h | 2 +- code/IRRLoader.cpp | 2 +- code/IRRLoader.h | 2 +- code/IRRMeshLoader.cpp | 2 +- code/IRRMeshLoader.h | 2 +- code/IRRShared.cpp | 2 +- code/Importer.cpp | 2 +- code/Importer.h | 2 +- code/Importer/IFC/IFCCurve.cpp | 2 +- code/Importer/IFC/IFCLoader.cpp | 2 +- code/Importer/IFC/IFCLoader.h | 2 +- code/Importer/IFC/IFCMaterial.cpp | 2 +- code/Importer/IFC/IFCProfile.cpp | 2 +- code/Importer/IFC/IFCUtil.cpp | 2 +- code/Importer/IFC/IFCUtil.h | 2 +- code/Importer/STEPParser/STEPFileEncoding.cpp | 2 +- code/Importer/STEPParser/STEPFileEncoding.h | 2 +- code/Importer/STEPParser/STEPFileReader.cpp | 96 ++++++++++--------- code/Importer/STEPParser/STEPFileReader.h | 4 +- code/Importer/StepFile/StepFileImporter.cpp | 2 +- code/Importer/StepFile/StepFileImporter.h | 2 +- code/ImporterRegistry.cpp | 2 +- code/ImproveCacheLocality.cpp | 2 +- code/ImproveCacheLocality.h | 2 +- code/JoinVerticesProcess.cpp | 2 +- code/JoinVerticesProcess.h | 2 +- code/LWOAnimation.cpp | 2 +- code/LWOAnimation.h | 2 +- code/LWOBLoader.cpp | 2 +- code/LWOFileData.h | 2 +- code/LWOLoader.cpp | 2 +- code/LWOLoader.h | 2 +- code/LWOMaterial.cpp | 2 +- code/LWSLoader.cpp | 2 +- code/LWSLoader.h | 2 +- code/LimitBoneWeightsProcess.cpp | 2 +- code/LimitBoneWeightsProcess.h | 2 +- code/MD2FileData.h | 2 +- code/MD2Loader.cpp | 2 +- code/MD2Loader.h | 2 +- code/MD2NormalTable.h | 2 +- code/MD3FileData.h | 2 +- code/MD3Loader.cpp | 2 +- code/MD3Loader.h | 2 +- code/MD5Loader.cpp | 2 +- code/MD5Loader.h | 2 +- code/MD5Parser.cpp | 2 +- code/MD5Parser.h | 2 +- code/MDCFileData.h | 2 +- code/MDCLoader.cpp | 2 +- code/MDCLoader.h | 2 +- code/MDLDefaultColorMap.h | 2 +- code/MDLFileData.h | 2 +- code/MDLLoader.cpp | 2 +- code/MDLLoader.h | 2 +- code/MDLMaterialLoader.cpp | 2 +- code/MMDCpp14.h | 2 +- code/MMDPmdParser.h | 2 +- code/MMDPmxParser.cpp | 2 +- code/MMDPmxParser.h | 2 +- code/MMDVmdParser.h | 2 +- code/MS3DLoader.cpp | 2 +- code/MS3DLoader.h | 2 +- code/MakeVerboseFormat.cpp | 2 +- code/MakeVerboseFormat.h | 2 +- code/MaterialSystem.cpp | 2 +- code/MaterialSystem.h | 2 +- code/NDOLoader.cpp | 2 +- code/NFFLoader.cpp | 2 +- code/NFFLoader.h | 2 +- code/OFFLoader.cpp | 2 +- code/OFFLoader.h | 2 +- code/ObjExporter.cpp | 2 +- code/ObjExporter.h | 2 +- code/ObjFileData.h | 2 +- code/ObjFileImporter.cpp | 2 +- code/ObjFileImporter.h | 2 +- code/ObjFileMtlImporter.cpp | 2 +- code/ObjFileMtlImporter.h | 2 +- code/ObjFileParser.cpp | 2 +- code/ObjFileParser.h | 2 +- code/ObjTools.h | 2 +- code/OgreBinarySerializer.cpp | 2 +- code/OgreBinarySerializer.h | 2 +- code/OgreImporter.cpp | 2 +- code/OgreImporter.h | 2 +- code/OgreMaterial.cpp | 2 +- code/OgreParsingUtils.h | 2 +- code/OgreStructs.cpp | 2 +- code/OgreStructs.h | 2 +- code/OgreXmlSerializer.cpp | 2 +- code/OgreXmlSerializer.h | 2 +- code/OpenGEXExporter.cpp | 2 +- code/OpenGEXExporter.h | 2 +- code/OpenGEXImporter.cpp | 2 +- code/OpenGEXImporter.h | 2 +- code/OpenGEXStructs.h | 2 +- code/OptimizeGraph.cpp | 2 +- code/OptimizeGraph.h | 2 +- code/OptimizeMeshes.cpp | 2 +- code/OptimizeMeshes.h | 2 +- code/PlyExporter.cpp | 2 +- code/PlyExporter.h | 2 +- code/PlyLoader.cpp | 2 +- code/PlyLoader.h | 2 +- code/PlyParser.cpp | 2 +- code/PlyParser.h | 2 +- code/PolyTools.h | 2 +- code/PostStepRegistry.cpp | 2 +- code/PretransformVertices.cpp | 2 +- code/PretransformVertices.h | 2 +- code/ProcessHelper.cpp | 2 +- code/ProcessHelper.h | 2 +- code/Q3BSPFileData.h | 2 +- code/Q3BSPFileImporter.cpp | 2 +- code/Q3BSPFileImporter.h | 2 +- code/Q3BSPFileParser.cpp | 2 +- code/Q3BSPFileParser.h | 2 +- code/Q3BSPZipArchive.cpp | 2 +- code/Q3BSPZipArchive.h | 2 +- code/Q3DLoader.cpp | 2 +- code/Q3DLoader.h | 2 +- code/RawLoader.cpp | 2 +- code/RawLoader.h | 2 +- code/RemoveComments.cpp | 2 +- code/RemoveRedundantMaterials.cpp | 2 +- code/RemoveRedundantMaterials.h | 2 +- code/RemoveVCProcess.cpp | 2 +- code/RemoveVCProcess.h | 2 +- code/SGSpatialSort.cpp | 2 +- code/SIBImporter.cpp | 2 +- code/SIBImporter.h | 2 +- code/SMDLoader.cpp | 2 +- code/SMDLoader.h | 2 +- code/STEPFile.h | 2 +- code/STLExporter.cpp | 2 +- code/STLExporter.h | 2 +- code/STLLoader.cpp | 2 +- code/STLLoader.h | 2 +- code/ScaleProcess.cpp | 2 +- code/ScaleProcess.h | 2 +- code/SceneCombiner.cpp | 2 +- code/ScenePreprocessor.cpp | 2 +- code/ScenePreprocessor.h | 2 +- code/ScenePrivate.h | 2 +- code/SkeletonMeshBuilder.cpp | 2 +- code/SortByPTypeProcess.cpp | 2 +- code/SortByPTypeProcess.h | 2 +- code/SpatialSort.cpp | 2 +- code/SplitByBoneCountProcess.cpp | 2 +- code/SplitByBoneCountProcess.h | 2 +- code/SplitLargeMeshes.cpp | 2 +- code/SplitLargeMeshes.h | 2 +- code/StandardShapes.cpp | 2 +- code/StdOStreamLogStream.h | 2 +- code/StepExporter.cpp | 2 +- code/StepExporter.h | 2 +- code/Subdivision.cpp | 2 +- code/TargetAnimation.cpp | 2 +- code/TargetAnimation.h | 2 +- code/TerragenLoader.cpp | 2 +- code/TerragenLoader.h | 2 +- code/TextureTransform.cpp | 2 +- code/TextureTransform.h | 2 +- code/TriangulateProcess.cpp | 2 +- code/TriangulateProcess.h | 2 +- code/UnrealLoader.cpp | 2 +- code/UnrealLoader.h | 2 +- code/ValidateDataStructure.cpp | 2 +- code/ValidateDataStructure.h | 2 +- code/Version.cpp | 2 +- code/VertexTriangleAdjacency.cpp | 2 +- code/VertexTriangleAdjacency.h | 2 +- code/Win32DebugLogStream.h | 2 +- code/X3DImporter.cpp | 2 +- code/X3DImporter.hpp | 2 +- code/X3DImporter_Geometry2D.cpp | 2 +- code/X3DImporter_Geometry3D.cpp | 2 +- code/X3DImporter_Group.cpp | 2 +- code/X3DImporter_Light.cpp | 2 +- code/X3DImporter_Macro.hpp | 2 +- code/X3DImporter_Metadata.cpp | 2 +- code/X3DImporter_Networking.cpp | 2 +- code/X3DImporter_Node.hpp | 2 +- code/X3DImporter_Postprocess.cpp | 2 +- code/X3DImporter_Rendering.cpp | 2 +- code/X3DImporter_Shape.cpp | 2 +- code/X3DImporter_Texturing.cpp | 2 +- code/X3DVocabulary.cpp | 2 +- code/XFileExporter.cpp | 2 +- code/XFileExporter.h | 2 +- code/XFileHelper.h | 2 +- code/XFileImporter.cpp | 2 +- code/XFileImporter.h | 2 +- code/XFileParser.cpp | 2 +- code/XFileParser.h | 2 +- code/XGLLoader.cpp | 2 +- code/XGLLoader.h | 2 +- code/glTF2Asset.h | 2 +- code/glTF2Asset.inl | 2 +- code/glTF2AssetWriter.h | 2 +- code/glTF2AssetWriter.inl | 2 +- code/glTF2Exporter.cpp | 2 +- code/glTF2Exporter.h | 2 +- code/glTF2Importer.cpp | 2 +- code/glTF2Importer.h | 2 +- code/glTFAsset.h | 2 +- code/glTFAsset.inl | 2 +- code/glTFAssetWriter.h | 2 +- code/glTFAssetWriter.inl | 2 +- code/glTFExporter.cpp | 2 +- code/glTFExporter.h | 2 +- code/glTFImporter.cpp | 2 +- code/glTFImporter.h | 2 +- code/scene.cpp | 2 +- code/simd.cpp | 2 +- code/simd.h | 2 +- include/assimp/BaseImporter.h | 2 +- include/assimp/Bitmap.h | 2 +- include/assimp/BlobIOSystem.h | 2 +- include/assimp/ByteSwapper.h | 2 +- include/assimp/CreateAnimMesh.h | 2 +- include/assimp/DefaultIOStream.h | 2 +- include/assimp/DefaultIOSystem.h | 2 +- include/assimp/DefaultLogger.hpp | 2 +- include/assimp/Exporter.hpp | 2 +- include/assimp/GenericProperty.h | 2 +- include/assimp/Hash.h | 2 +- include/assimp/IOStream.hpp | 2 +- include/assimp/IOStreamBuffer.h | 2 +- include/assimp/IOSystem.hpp | 2 +- include/assimp/Importer.hpp | 2 +- include/assimp/LineSplitter.h | 2 +- include/assimp/LogAux.h | 2 +- include/assimp/LogStream.hpp | 2 +- include/assimp/Logger.hpp | 2 +- include/assimp/Macros.h | 2 +- include/assimp/MemoryIOWrapper.h | 2 +- include/assimp/NullLogger.hpp | 2 +- include/assimp/ParsingUtils.h | 2 +- include/assimp/Profiler.h | 2 +- include/assimp/ProgressHandler.hpp | 2 +- include/assimp/RemoveComments.h | 2 +- include/assimp/SGSpatialSort.h | 2 +- include/assimp/SceneCombiner.h | 2 +- include/assimp/SkeletonMeshBuilder.h | 2 +- include/assimp/SmoothingGroups.h | 2 +- include/assimp/SpatialSort.h | 2 +- include/assimp/StandardShapes.h | 2 +- include/assimp/StreamReader.h | 2 +- include/assimp/StreamWriter.h | 2 +- include/assimp/StringComparison.h | 2 +- include/assimp/StringUtils.h | 2 +- include/assimp/Subdivision.h | 2 +- include/assimp/TinyFormatter.h | 2 +- include/assimp/Vertex.h | 2 +- include/assimp/XMLTools.h | 2 +- include/assimp/ai_assert.h | 2 +- include/assimp/anim.h | 2 +- include/assimp/camera.h | 2 +- include/assimp/cfileio.h | 2 +- include/assimp/cimport.h | 2 +- include/assimp/color4.h | 2 +- include/assimp/color4.inl | 2 +- include/assimp/defs.h | 2 +- include/assimp/importerdesc.h | 2 +- include/assimp/irrXMLWrapper.h | 2 +- include/assimp/light.h | 2 +- include/assimp/material.h | 2 +- include/assimp/material.inl | 2 +- include/assimp/matrix3x3.h | 2 +- include/assimp/matrix3x3.inl | 2 +- include/assimp/matrix4x4.h | 2 +- include/assimp/matrix4x4.inl | 2 +- include/assimp/mesh.h | 2 +- include/assimp/metadata.h | 2 +- include/assimp/pbrmaterial.h | 2 +- include/assimp/postprocess.h | 2 +- include/assimp/qnan.h | 2 +- include/assimp/quaternion.h | 2 +- include/assimp/quaternion.inl | 2 +- include/assimp/scene.h | 2 +- include/assimp/texture.h | 2 +- include/assimp/types.h | 2 +- include/assimp/vector2.h | 2 +- include/assimp/vector2.inl | 2 +- include/assimp/vector3.h | 2 +- include/assimp/vector3.inl | 2 +- include/assimp/version.h | 2 +- test/CMakeLists.txt | 2 +- test/unit/AbstractImportExportBase.cpp | 2 +- test/unit/AssimpAPITest.cpp | 2 +- test/unit/Common/utLineSplitter.cpp | 2 +- test/unit/ImportExport/utCOBImportExport.cpp | 2 +- test/unit/ImportExport/utExporter.cpp | 2 +- test/unit/ImportExport/utNFFImportExport.cpp | 2 +- test/unit/ImportExport/utOFFImportExport.cpp | 2 +- test/unit/ImportExport/utOgreImportExport.cpp | 2 +- .../ImportExport/utQ3BSPFileImportExport.cpp | 2 +- test/unit/ImportExport/utXGLImportExport.cpp | 2 +- test/unit/SceneDiffer.cpp | 2 +- test/unit/SceneDiffer.h | 2 +- test/unit/TestIOSystem.h | 2 +- test/unit/TestModelFactory.h | 2 +- test/unit/UTLogStream.h | 2 +- test/unit/ut3DImportExport.cpp | 2 +- test/unit/ut3DSImportExport.cpp | 2 +- test/unit/utACImportExport.cpp | 2 +- test/unit/utAMFImportExport.cpp | 2 +- test/unit/utASEImportExport.cpp | 2 +- test/unit/utAnim.cpp | 2 +- test/unit/utAssbinImportExport.cpp | 2 +- test/unit/utB3DImportExport.cpp | 2 +- test/unit/utBVHImportExport.cpp | 2 +- test/unit/utBatchLoader.cpp | 2 +- test/unit/utBlendImportAreaLight.cpp | 2 +- test/unit/utBlendImportMaterials.cpp | 2 +- test/unit/utBlenderImportExport.cpp | 2 +- test/unit/utBlenderIntermediate.cpp | 2 +- test/unit/utBlenderWork.cpp | 2 +- test/unit/utCSMImportExport.cpp | 2 +- test/unit/utColladaExportCamera.cpp | 2 +- test/unit/utColladaExportLight.cpp | 2 +- test/unit/utColladaImportExport.cpp | 2 +- test/unit/utD3MFImportExport.cpp | 2 +- test/unit/utDXFImporterExporter.cpp | 2 +- test/unit/utDefaultIOStream.cpp | 2 +- test/unit/utFBXImporterExporter.cpp | 2 +- test/unit/utFastAtof.cpp | 2 +- test/unit/utFindDegenerates.cpp | 2 +- test/unit/utFindInvalidData.cpp | 2 +- test/unit/utFixInfacingNormals.cpp | 2 +- test/unit/utGenNormals.cpp | 2 +- test/unit/utHMPImportExport.cpp | 2 +- test/unit/utIFCImportExport.cpp | 2 +- test/unit/utIOStreamBuffer.cpp | 2 +- test/unit/utIOSystem.cpp | 2 +- test/unit/utImporter.cpp | 2 +- test/unit/utImproveCacheLocality.cpp | 2 +- test/unit/utIssues.cpp | 2 +- test/unit/utJoinVertices.cpp | 2 +- test/unit/utLWOImportExport.cpp | 2 +- test/unit/utLWSImportExport.cpp | 2 +- test/unit/utLimitBoneWeights.cpp | 2 +- test/unit/utMDCImportExport.cpp | 2 +- test/unit/utMaterialSystem.cpp | 2 +- test/unit/utMatrix3x3.cpp | 2 +- test/unit/utMatrix4x4.cpp | 2 +- test/unit/utMetadata.cpp | 2 +- test/unit/utObjImportExport.cpp | 2 +- test/unit/utObjTools.cpp | 2 +- test/unit/utOpenGEXImportExport.cpp | 2 +- test/unit/utPLYImportExport.cpp | 2 +- test/unit/utPretransformVertices.cpp | 2 +- test/unit/utProfiler.cpp | 2 +- test/unit/utQ3DImportExport.cpp | 2 +- test/unit/utRemoveComments.cpp | 2 +- test/unit/utRemoveComponent.cpp | 2 +- test/unit/utRemoveRedundantMaterials.cpp | 2 +- test/unit/utRemoveVCProcess.cpp | 2 +- test/unit/utSIBImporter.cpp | 2 +- test/unit/utSMDImportExport.cpp | 2 +- test/unit/utSTLImportExport.cpp | 2 +- test/unit/utScaleProcess.cpp | 2 +- test/unit/utSceneCombiner.cpp | 2 +- test/unit/utScenePreprocessor.cpp | 2 +- test/unit/utSharedPPData.cpp | 2 +- test/unit/utSimd.cpp | 2 +- test/unit/utSortByPType.cpp | 2 +- test/unit/utSplitLargeMeshes.cpp | 2 +- test/unit/utStringUtils.cpp | 2 +- test/unit/utTargetAnimation.cpp | 2 +- test/unit/utTextureTransform.cpp | 2 +- test/unit/utTriangulate.cpp | 2 +- test/unit/utTypes.cpp | 2 +- test/unit/utVector3.cpp | 2 +- test/unit/utVersion.cpp | 2 +- test/unit/utVertexTriangleAdjacency.cpp | 2 +- test/unit/utX3DImportExport.cpp | 2 +- test/unit/utXImporterExporter.cpp | 2 +- test/unit/utglTF2ImportExport.cpp | 2 +- test/unit/utglTFImportExport.cpp | 2 +- tools/assimp_cmd/CMakeLists.txt | 2 +- tools/assimp_cmd/CompareDump.cpp | 2 +- tools/assimp_cmd/Export.cpp | 2 +- tools/assimp_cmd/ImageExtractor.cpp | 2 +- tools/assimp_cmd/Info.cpp | 2 +- tools/assimp_cmd/Main.cpp | 2 +- tools/assimp_cmd/WriteDumb.cpp | 2 +- tools/assimp_view/AnimEvaluator.cpp | 2 +- tools/assimp_view/CMakeLists.txt | 2 +- tools/assimp_view/assimp_view.cpp | 2 +- tools/assimp_view/assimp_view.h | 2 +- 532 files changed, 584 insertions(+), 576 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a97174de4..14c65c188 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ # Open Asset Import Library (assimp) # ---------------------------------------------------------------------- -# Copyright (c) 2006-2018, assimp team +# Copyright (c) 2006-2019, assimp team # All rights reserved. # diff --git a/code/3DSConverter.cpp b/code/3DSConverter.cpp index 7ec79ba64..e6865a809 100644 --- a/code/3DSConverter.cpp +++ b/code/3DSConverter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/3DSExporter.cpp b/code/3DSExporter.cpp index 53976b16f..2501d4049 100644 --- a/code/3DSExporter.cpp +++ b/code/3DSExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/3DSExporter.h b/code/3DSExporter.h index 5db58a4cb..035b562cf 100644 --- a/code/3DSExporter.h +++ b/code/3DSExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/3DSHelper.h b/code/3DSHelper.h index d67a7c14c..8eb4cd97c 100644 --- a/code/3DSHelper.h +++ b/code/3DSHelper.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/3DSLoader.cpp b/code/3DSLoader.cpp index 34066e44b..24626d936 100644 --- a/code/3DSLoader.cpp +++ b/code/3DSLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/3DSLoader.h b/code/3DSLoader.h index eb311a81b..f57e6a8e3 100644 --- a/code/3DSLoader.h +++ b/code/3DSLoader.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/3MFXmlTags.h b/code/3MFXmlTags.h index e869c33c1..ea6aeede0 100644 --- a/code/3MFXmlTags.h +++ b/code/3MFXmlTags.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/ACLoader.cpp b/code/ACLoader.cpp index 7b8afbe9b..2eb839553 100644 --- a/code/ACLoader.cpp +++ b/code/ACLoader.cpp @@ -4,7 +4,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/ACLoader.h b/code/ACLoader.h index 86af9afb6..cab2c3ae5 100644 --- a/code/ACLoader.h +++ b/code/ACLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/AMFImporter.cpp b/code/AMFImporter.cpp index e5b41b3ad..d173bd0f5 100644 --- a/code/AMFImporter.cpp +++ b/code/AMFImporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/AMFImporter.hpp b/code/AMFImporter.hpp index b7e58362c..2b8086a06 100644 --- a/code/AMFImporter.hpp +++ b/code/AMFImporter.hpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/AMFImporter_Geometry.cpp b/code/AMFImporter_Geometry.cpp index d4d648fbd..f1538e3fb 100644 --- a/code/AMFImporter_Geometry.cpp +++ b/code/AMFImporter_Geometry.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/AMFImporter_Macro.hpp b/code/AMFImporter_Macro.hpp index ea8c17850..f60c5fbbb 100644 --- a/code/AMFImporter_Macro.hpp +++ b/code/AMFImporter_Macro.hpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/AMFImporter_Material.cpp b/code/AMFImporter_Material.cpp index c9190bb92..2f36df061 100644 --- a/code/AMFImporter_Material.cpp +++ b/code/AMFImporter_Material.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/AMFImporter_Node.hpp b/code/AMFImporter_Node.hpp index 22b8f58cb..a1bf9f008 100644 --- a/code/AMFImporter_Node.hpp +++ b/code/AMFImporter_Node.hpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/AMFImporter_Postprocess.cpp b/code/AMFImporter_Postprocess.cpp index a6ee8fa2f..2bfe3f78c 100644 --- a/code/AMFImporter_Postprocess.cpp +++ b/code/AMFImporter_Postprocess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/ASELoader.cpp b/code/ASELoader.cpp index 1808f25e2..321e8548a 100644 --- a/code/ASELoader.cpp +++ b/code/ASELoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/ASELoader.h b/code/ASELoader.h index 7f71bf49d..33406e3e5 100644 --- a/code/ASELoader.h +++ b/code/ASELoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/ASEParser.cpp b/code/ASEParser.cpp index 298c6fe61..e8d6febc2 100644 --- a/code/ASEParser.cpp +++ b/code/ASEParser.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/ASEParser.h b/code/ASEParser.h index 305a3f3d6..b8c820632 100644 --- a/code/ASEParser.h +++ b/code/ASEParser.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/AssbinExporter.cpp b/code/AssbinExporter.cpp index f49389f78..77c8d1118 100644 --- a/code/AssbinExporter.cpp +++ b/code/AssbinExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/AssbinExporter.h b/code/AssbinExporter.h index ee70d78b6..3e13639bb 100644 --- a/code/AssbinExporter.h +++ b/code/AssbinExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/AssbinLoader.cpp b/code/AssbinLoader.cpp index 321a0cfec..7adb8db6f 100644 --- a/code/AssbinLoader.cpp +++ b/code/AssbinLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/AssbinLoader.h b/code/AssbinLoader.h index 37799a2c8..9f2dde125 100644 --- a/code/AssbinLoader.h +++ b/code/AssbinLoader.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/Assimp.cpp b/code/Assimp.cpp index 87f436602..41e1a4800 100644 --- a/code/Assimp.cpp +++ b/code/Assimp.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/AssimpCExport.cpp b/code/AssimpCExport.cpp index caf51a08c..5121ce39c 100644 --- a/code/AssimpCExport.cpp +++ b/code/AssimpCExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/AssxmlExporter.cpp b/code/AssxmlExporter.cpp index c9e125d0d..fafee0e80 100644 --- a/code/AssxmlExporter.cpp +++ b/code/AssxmlExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/AssxmlExporter.h b/code/AssxmlExporter.h index 3db496db2..8ca887eea 100644 --- a/code/AssxmlExporter.h +++ b/code/AssxmlExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/B3DImporter.cpp b/code/B3DImporter.cpp index ce8bd5159..e48646de9 100644 --- a/code/B3DImporter.cpp +++ b/code/B3DImporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/B3DImporter.h b/code/B3DImporter.h index 3cb66e5c7..d52dac34a 100644 --- a/code/B3DImporter.h +++ b/code/B3DImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/BVHLoader.cpp b/code/BVHLoader.cpp index cba58d056..cd9ab0843 100644 --- a/code/BVHLoader.cpp +++ b/code/BVHLoader.cpp @@ -4,7 +4,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/BVHLoader.h b/code/BVHLoader.h index a18ad81d9..33b4e2453 100644 --- a/code/BVHLoader.h +++ b/code/BVHLoader.h @@ -4,7 +4,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/BaseImporter.cpp b/code/BaseImporter.cpp index f03db189f..4803c6d6f 100644 --- a/code/BaseImporter.cpp +++ b/code/BaseImporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/BaseProcess.cpp b/code/BaseProcess.cpp index 154b586d2..18872c369 100644 --- a/code/BaseProcess.cpp +++ b/code/BaseProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/BaseProcess.h b/code/BaseProcess.h index b09fc732e..4d5c7a76b 100644 --- a/code/BaseProcess.h +++ b/code/BaseProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/Bitmap.cpp b/code/Bitmap.cpp index 903a13fb1..b22b71ea9 100644 --- a/code/Bitmap.cpp +++ b/code/Bitmap.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/BlenderDNA.cpp b/code/BlenderDNA.cpp index f84c45601..f274e02f9 100644 --- a/code/BlenderDNA.cpp +++ b/code/BlenderDNA.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/BlenderDNA.h b/code/BlenderDNA.h index ecf606a3b..5d3a4f6ea 100644 --- a/code/BlenderDNA.h +++ b/code/BlenderDNA.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/BlenderDNA.inl b/code/BlenderDNA.inl index 89c94e7bf..65bc1374c 100644 --- a/code/BlenderDNA.inl +++ b/code/BlenderDNA.inl @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/BlenderIntermediate.h b/code/BlenderIntermediate.h index f3d34d1b2..95fdf0f03 100644 --- a/code/BlenderIntermediate.h +++ b/code/BlenderIntermediate.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/BlenderLoader.cpp b/code/BlenderLoader.cpp index b0d273a5f..90065ceee 100644 --- a/code/BlenderLoader.cpp +++ b/code/BlenderLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/BlenderLoader.h b/code/BlenderLoader.h index 9f452a0aa..d85a82842 100644 --- a/code/BlenderLoader.h +++ b/code/BlenderLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/BlenderModifier.cpp b/code/BlenderModifier.cpp index 1f32ee410..cc7acc929 100644 --- a/code/BlenderModifier.cpp +++ b/code/BlenderModifier.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/BlenderModifier.h b/code/BlenderModifier.h index b8797691b..c260ba1f6 100644 --- a/code/BlenderModifier.h +++ b/code/BlenderModifier.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/BlenderScene.h b/code/BlenderScene.h index b74d7b198..8e4223eb1 100644 --- a/code/BlenderScene.h +++ b/code/BlenderScene.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/BlenderTessellator.cpp b/code/BlenderTessellator.cpp index afedbfb53..d98c2e865 100644 --- a/code/BlenderTessellator.cpp +++ b/code/BlenderTessellator.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/BlenderTessellator.h b/code/BlenderTessellator.h index dab3ba8aa..8675b4e57 100644 --- a/code/BlenderTessellator.h +++ b/code/BlenderTessellator.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/CInterfaceIOWrapper.cpp b/code/CInterfaceIOWrapper.cpp index 41dbba772..5a3a49565 100644 --- a/code/CInterfaceIOWrapper.cpp +++ b/code/CInterfaceIOWrapper.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/CInterfaceIOWrapper.h b/code/CInterfaceIOWrapper.h index 6f0eb7957..216232030 100644 --- a/code/CInterfaceIOWrapper.h +++ b/code/CInterfaceIOWrapper.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index b9b9c211b..1726fda72 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -1,7 +1,7 @@ # Open Asset Import Library (assimp) # ---------------------------------------------------------------------- # -# Copyright (c) 2006-2018, assimp team +# Copyright (c) 2006-2019, assimp team # All rights reserved. diff --git a/code/COBLoader.cpp b/code/COBLoader.cpp index a8e41dbbc..efb22e08b 100644 --- a/code/COBLoader.cpp +++ b/code/COBLoader.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/COBLoader.h b/code/COBLoader.h index 156c8d911..40fed324b 100644 --- a/code/COBLoader.h +++ b/code/COBLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/COBScene.h b/code/COBScene.h index 2473c42a5..90349be70 100644 --- a/code/COBScene.h +++ b/code/COBScene.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/CSMLoader.cpp b/code/CSMLoader.cpp index 777b6cf1b..9dbb38467 100644 --- a/code/CSMLoader.cpp +++ b/code/CSMLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/CSMLoader.h b/code/CSMLoader.h index ea82bb87a..31a814b52 100644 --- a/code/CSMLoader.h +++ b/code/CSMLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/CalcTangentsProcess.cpp b/code/CalcTangentsProcess.cpp index 54e55fc5a..b30f39c27 100644 --- a/code/CalcTangentsProcess.cpp +++ b/code/CalcTangentsProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/CalcTangentsProcess.h b/code/CalcTangentsProcess.h index 4cac2ed9f..18775abcc 100644 --- a/code/CalcTangentsProcess.h +++ b/code/CalcTangentsProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/ColladaExporter.cpp b/code/ColladaExporter.cpp index 9d66741eb..37a6ba4e0 100644 --- a/code/ColladaExporter.cpp +++ b/code/ColladaExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/ColladaExporter.h b/code/ColladaExporter.h index d1a307532..8244b61aa 100644 --- a/code/ColladaExporter.h +++ b/code/ColladaExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/ColladaHelper.h b/code/ColladaHelper.h index fe6674b93..ffab6226d 100644 --- a/code/ColladaHelper.h +++ b/code/ColladaHelper.h @@ -4,7 +4,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/ColladaLoader.cpp b/code/ColladaLoader.cpp index af04e9a16..0c87330a9 100644 --- a/code/ColladaLoader.cpp +++ b/code/ColladaLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/ColladaLoader.h b/code/ColladaLoader.h index d61845b24..72c2dd8e7 100644 --- a/code/ColladaLoader.h +++ b/code/ColladaLoader.h @@ -4,7 +4,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/ColladaParser.cpp b/code/ColladaParser.cpp index 052cd51c4..4d599a0c7 100644 --- a/code/ColladaParser.cpp +++ b/code/ColladaParser.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/ColladaParser.h b/code/ColladaParser.h index 21f741551..232d85654 100644 --- a/code/ColladaParser.h +++ b/code/ColladaParser.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- - Copyright (c) 2006-2018, assimp team + Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/ComputeUVMappingProcess.cpp b/code/ComputeUVMappingProcess.cpp index 3b0577b2d..bb571a551 100644 --- a/code/ComputeUVMappingProcess.cpp +++ b/code/ComputeUVMappingProcess.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/ComputeUVMappingProcess.h b/code/ComputeUVMappingProcess.h index 41e25f99f..24f6bb721 100644 --- a/code/ComputeUVMappingProcess.h +++ b/code/ComputeUVMappingProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/ConvertToLHProcess.cpp b/code/ConvertToLHProcess.cpp index 1831739ac..b7cd4f0bc 100644 --- a/code/ConvertToLHProcess.cpp +++ b/code/ConvertToLHProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/ConvertToLHProcess.h b/code/ConvertToLHProcess.h index f219d6ca2..63351568d 100644 --- a/code/ConvertToLHProcess.h +++ b/code/ConvertToLHProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/D3MFExporter.cpp b/code/D3MFExporter.cpp index 99e2ff3f5..e8da91ba9 100644 --- a/code/D3MFExporter.cpp +++ b/code/D3MFExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/D3MFExporter.h b/code/D3MFExporter.h index 110862b99..e82120247 100644 --- a/code/D3MFExporter.h +++ b/code/D3MFExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/D3MFImporter.cpp b/code/D3MFImporter.cpp index de5708149..c218f4005 100644 --- a/code/D3MFImporter.cpp +++ b/code/D3MFImporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/D3MFImporter.h b/code/D3MFImporter.h index 701d056e2..3dbdf07bf 100644 --- a/code/D3MFImporter.h +++ b/code/D3MFImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/D3MFOpcPackage.cpp b/code/D3MFOpcPackage.cpp index 8161a31e4..2545a2750 100644 --- a/code/D3MFOpcPackage.cpp +++ b/code/D3MFOpcPackage.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/D3MFOpcPackage.h b/code/D3MFOpcPackage.h index 6d7b3d478..47c67f45f 100644 --- a/code/D3MFOpcPackage.h +++ b/code/D3MFOpcPackage.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/DXFHelper.h b/code/DXFHelper.h index daf2f97e2..0ec8e130b 100644 --- a/code/DXFHelper.h +++ b/code/DXFHelper.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/DXFLoader.cpp b/code/DXFLoader.cpp index 6710597df..ab86f89ae 100644 --- a/code/DXFLoader.cpp +++ b/code/DXFLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/DXFLoader.h b/code/DXFLoader.h index e7f534e98..044cf6bcb 100644 --- a/code/DXFLoader.h +++ b/code/DXFLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/DeboneProcess.cpp b/code/DeboneProcess.cpp index bc6afa36e..83b8336bc 100644 --- a/code/DeboneProcess.cpp +++ b/code/DeboneProcess.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/DeboneProcess.h b/code/DeboneProcess.h index 3da861362..ba77aba70 100644 --- a/code/DeboneProcess.h +++ b/code/DeboneProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/DefaultIOStream.cpp b/code/DefaultIOStream.cpp index 3b0a672a7..1c100b618 100644 --- a/code/DefaultIOStream.cpp +++ b/code/DefaultIOStream.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/DefaultIOSystem.cpp b/code/DefaultIOSystem.cpp index 67fd82f17..d40b67de3 100644 --- a/code/DefaultIOSystem.cpp +++ b/code/DefaultIOSystem.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/DefaultLogger.cpp b/code/DefaultLogger.cpp index 2871a4131..de3528d2b 100644 --- a/code/DefaultLogger.cpp +++ b/code/DefaultLogger.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/DefaultProgressHandler.h b/code/DefaultProgressHandler.h index 851c17be6..bd2cce00b 100644 --- a/code/DefaultProgressHandler.h +++ b/code/DefaultProgressHandler.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/DropFaceNormalsProcess.cpp b/code/DropFaceNormalsProcess.cpp index 57e8b972b..b11615bb8 100644 --- a/code/DropFaceNormalsProcess.cpp +++ b/code/DropFaceNormalsProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/DropFaceNormalsProcess.h b/code/DropFaceNormalsProcess.h index 6dbfe0397..0d116663b 100644 --- a/code/DropFaceNormalsProcess.h +++ b/code/DropFaceNormalsProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/EmbedTexturesProcess.cpp b/code/EmbedTexturesProcess.cpp index a6dd8457e..739382a05 100644 --- a/code/EmbedTexturesProcess.cpp +++ b/code/EmbedTexturesProcess.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/EmbedTexturesProcess.h b/code/EmbedTexturesProcess.h index ce9821652..cdf40bef7 100644 --- a/code/EmbedTexturesProcess.h +++ b/code/EmbedTexturesProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/Exporter.cpp b/code/Exporter.cpp index 0acde75bf..8848e87f5 100644 --- a/code/Exporter.cpp +++ b/code/Exporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/FBXAnimation.cpp b/code/FBXAnimation.cpp index 871d62578..874914431 100644 --- a/code/FBXAnimation.cpp +++ b/code/FBXAnimation.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXBinaryTokenizer.cpp b/code/FBXBinaryTokenizer.cpp index b81a9f945..f12a5c5b2 100644 --- a/code/FBXBinaryTokenizer.cpp +++ b/code/FBXBinaryTokenizer.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXCommon.h b/code/FBXCommon.h index 60b040552..fcb20a5ca 100644 --- a/code/FBXCommon.h +++ b/code/FBXCommon.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXCompileConfig.h b/code/FBXCompileConfig.h index 2e7336e85..3a3841fa5 100644 --- a/code/FBXCompileConfig.h +++ b/code/FBXCompileConfig.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXConverter.cpp b/code/FBXConverter.cpp index fd4986a3c..d88a3cacd 100644 --- a/code/FBXConverter.cpp +++ b/code/FBXConverter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXConverter.h b/code/FBXConverter.h index 796b3e2f0..398baa445 100644 --- a/code/FBXConverter.h +++ b/code/FBXConverter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXDeformer.cpp b/code/FBXDeformer.cpp index fc8b38e57..692755345 100644 --- a/code/FBXDeformer.cpp +++ b/code/FBXDeformer.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXDocument.cpp b/code/FBXDocument.cpp index deac89ca0..2e0d00a79 100644 --- a/code/FBXDocument.cpp +++ b/code/FBXDocument.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXDocument.h b/code/FBXDocument.h index 02accf92e..cbc6d60cd 100644 --- a/code/FBXDocument.h +++ b/code/FBXDocument.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXDocumentUtil.cpp b/code/FBXDocumentUtil.cpp index 6f1e18e42..f84691479 100644 --- a/code/FBXDocumentUtil.cpp +++ b/code/FBXDocumentUtil.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXExportNode.cpp b/code/FBXExportNode.cpp index a1171eca8..ace6a6ac2 100644 --- a/code/FBXExportNode.cpp +++ b/code/FBXExportNode.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXExportNode.h b/code/FBXExportNode.h index b9cd5156f..e1ebc3696 100644 --- a/code/FBXExportNode.h +++ b/code/FBXExportNode.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXExportProperty.cpp b/code/FBXExportProperty.cpp index 431750274..9981d6b1c 100644 --- a/code/FBXExportProperty.cpp +++ b/code/FBXExportProperty.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXExportProperty.h b/code/FBXExportProperty.h index cb3b0113f..9c9d37c36 100644 --- a/code/FBXExportProperty.h +++ b/code/FBXExportProperty.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXExporter.cpp b/code/FBXExporter.cpp index ce00deee3..acb122714 100644 --- a/code/FBXExporter.cpp +++ b/code/FBXExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXExporter.h b/code/FBXExporter.h index c27d1a8ce..71fb55c57 100644 --- a/code/FBXExporter.h +++ b/code/FBXExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXImportSettings.h b/code/FBXImportSettings.h index e612fddef..d5e1c2060 100644 --- a/code/FBXImportSettings.h +++ b/code/FBXImportSettings.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXImporter.cpp b/code/FBXImporter.cpp index b004bcd8c..72f8eea8e 100644 --- a/code/FBXImporter.cpp +++ b/code/FBXImporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXImporter.h b/code/FBXImporter.h index 870f1c49b..c365b2cdd 100644 --- a/code/FBXImporter.h +++ b/code/FBXImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXMaterial.cpp b/code/FBXMaterial.cpp index 75b2e3b4b..f5f6fda03 100644 --- a/code/FBXMaterial.cpp +++ b/code/FBXMaterial.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXMeshGeometry.cpp b/code/FBXMeshGeometry.cpp index faa5de75c..d75476b82 100644 --- a/code/FBXMeshGeometry.cpp +++ b/code/FBXMeshGeometry.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXMeshGeometry.h b/code/FBXMeshGeometry.h index 641461a69..d6d451217 100644 --- a/code/FBXMeshGeometry.h +++ b/code/FBXMeshGeometry.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXModel.cpp b/code/FBXModel.cpp index c16ca841c..589af36ac 100644 --- a/code/FBXModel.cpp +++ b/code/FBXModel.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXNodeAttribute.cpp b/code/FBXNodeAttribute.cpp index 1064151b3..b72e5637e 100644 --- a/code/FBXNodeAttribute.cpp +++ b/code/FBXNodeAttribute.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXParser.cpp b/code/FBXParser.cpp index 96d113bd1..b255c4734 100644 --- a/code/FBXParser.cpp +++ b/code/FBXParser.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXParser.h b/code/FBXParser.h index 389da3fed..7b0cf7203 100644 --- a/code/FBXParser.h +++ b/code/FBXParser.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXProperties.cpp b/code/FBXProperties.cpp index ca89743ca..8d7036b6a 100644 --- a/code/FBXProperties.cpp +++ b/code/FBXProperties.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXProperties.h b/code/FBXProperties.h index 404e04deb..58755542f 100644 --- a/code/FBXProperties.h +++ b/code/FBXProperties.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXTokenizer.cpp b/code/FBXTokenizer.cpp index c9dd1697a..252cce355 100644 --- a/code/FBXTokenizer.cpp +++ b/code/FBXTokenizer.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXTokenizer.h b/code/FBXTokenizer.h index e93982617..2af29743f 100644 --- a/code/FBXTokenizer.h +++ b/code/FBXTokenizer.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXUtil.cpp b/code/FBXUtil.cpp index 992c30efc..c184c4a00 100644 --- a/code/FBXUtil.cpp +++ b/code/FBXUtil.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FBXUtil.h b/code/FBXUtil.h index caea7f115..1a37d346b 100644 --- a/code/FBXUtil.h +++ b/code/FBXUtil.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FIReader.cpp b/code/FIReader.cpp index bdc447b34..2116316ca 100755 --- a/code/FIReader.cpp +++ b/code/FIReader.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FIReader.hpp b/code/FIReader.hpp index 9ff752d5c..29e3ddb1b 100644 --- a/code/FIReader.hpp +++ b/code/FIReader.hpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FileLogStream.h b/code/FileLogStream.h index 9966091d2..740c50319 100644 --- a/code/FileLogStream.h +++ b/code/FileLogStream.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FindDegenerates.cpp b/code/FindDegenerates.cpp index c0c0de08b..365f5d744 100644 --- a/code/FindDegenerates.cpp +++ b/code/FindDegenerates.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/FindDegenerates.h b/code/FindDegenerates.h index c234c57f5..880f5f16a 100644 --- a/code/FindDegenerates.h +++ b/code/FindDegenerates.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FindInstancesProcess.cpp b/code/FindInstancesProcess.cpp index 25dcc51e8..23f9d1581 100644 --- a/code/FindInstancesProcess.cpp +++ b/code/FindInstancesProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/FindInstancesProcess.h b/code/FindInstancesProcess.h index fb2ac6eb6..ab4a371c7 100644 --- a/code/FindInstancesProcess.h +++ b/code/FindInstancesProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FindInvalidDataProcess.cpp b/code/FindInvalidDataProcess.cpp index c775187e9..c99a98865 100644 --- a/code/FindInvalidDataProcess.cpp +++ b/code/FindInvalidDataProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/FindInvalidDataProcess.h b/code/FindInvalidDataProcess.h index f5a49f496..8504fb7b1 100644 --- a/code/FindInvalidDataProcess.h +++ b/code/FindInvalidDataProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/FixNormalsStep.cpp b/code/FixNormalsStep.cpp index 668b50c24..bbbe6899b 100644 --- a/code/FixNormalsStep.cpp +++ b/code/FixNormalsStep.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/FixNormalsStep.h b/code/FixNormalsStep.h index 389e6e1a6..6be27faef 100644 --- a/code/FixNormalsStep.h +++ b/code/FixNormalsStep.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/GenFaceNormalsProcess.cpp b/code/GenFaceNormalsProcess.cpp index 43960ac3b..028334dec 100644 --- a/code/GenFaceNormalsProcess.cpp +++ b/code/GenFaceNormalsProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/GenFaceNormalsProcess.h b/code/GenFaceNormalsProcess.h index e2f41e07f..c80ec9fdd 100644 --- a/code/GenFaceNormalsProcess.h +++ b/code/GenFaceNormalsProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/GenVertexNormalsProcess.cpp b/code/GenVertexNormalsProcess.cpp index 1778ef513..3f6c2f86b 100644 --- a/code/GenVertexNormalsProcess.cpp +++ b/code/GenVertexNormalsProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/GenVertexNormalsProcess.h b/code/GenVertexNormalsProcess.h index 2efafa302..9142ad26f 100644 --- a/code/GenVertexNormalsProcess.h +++ b/code/GenVertexNormalsProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/HMPFileData.h b/code/HMPFileData.h index 962f2f9c7..ab4100174 100644 --- a/code/HMPFileData.h +++ b/code/HMPFileData.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/HMPLoader.cpp b/code/HMPLoader.cpp index 7f53f9b54..7c1d0b65f 100644 --- a/code/HMPLoader.cpp +++ b/code/HMPLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/HMPLoader.h b/code/HMPLoader.h index 4e513aee6..d0a34bfb7 100644 --- a/code/HMPLoader.h +++ b/code/HMPLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/HalfLifeFileData.h b/code/HalfLifeFileData.h index 7c55657d4..ef328edf8 100644 --- a/code/HalfLifeFileData.h +++ b/code/HalfLifeFileData.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/IRRLoader.cpp b/code/IRRLoader.cpp index 9432eff61..6bc4b8ce4 100644 --- a/code/IRRLoader.cpp +++ b/code/IRRLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/IRRLoader.h b/code/IRRLoader.h index 3bd39092a..e245a0a6f 100644 --- a/code/IRRLoader.h +++ b/code/IRRLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/IRRMeshLoader.cpp b/code/IRRMeshLoader.cpp index 85de42195..f3aed5943 100644 --- a/code/IRRMeshLoader.cpp +++ b/code/IRRMeshLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/IRRMeshLoader.h b/code/IRRMeshLoader.h index ef6a8a11b..d8b42d78d 100644 --- a/code/IRRMeshLoader.h +++ b/code/IRRMeshLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/IRRShared.cpp b/code/IRRShared.cpp index 1e69f1d09..ecac031ab 100644 --- a/code/IRRShared.cpp +++ b/code/IRRShared.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/Importer.cpp b/code/Importer.cpp index da395edb2..65b16471c 100644 --- a/code/Importer.cpp +++ b/code/Importer.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/Importer.h b/code/Importer.h index c6628c428..a439d99c2 100644 --- a/code/Importer.h +++ b/code/Importer.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/Importer/IFC/IFCCurve.cpp b/code/Importer/IFC/IFCCurve.cpp index af58e7b10..b0a1fdaa9 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-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/Importer/IFC/IFCLoader.cpp b/code/Importer/IFC/IFCLoader.cpp index 2c95872d3..368f98ec0 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-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/Importer/IFC/IFCLoader.h b/code/Importer/IFC/IFCLoader.h index 99e3e8ed9..678c60343 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-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/Importer/IFC/IFCMaterial.cpp b/code/Importer/IFC/IFCMaterial.cpp index 423d1471e..5fda0a1de 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-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/Importer/IFC/IFCProfile.cpp b/code/Importer/IFC/IFCProfile.cpp index 2236d0d9b..daafc9afe 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-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/Importer/IFC/IFCUtil.cpp b/code/Importer/IFC/IFCUtil.cpp index 06cc4405a..b9a8538b0 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-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/Importer/IFC/IFCUtil.h b/code/Importer/IFC/IFCUtil.h index 194206d4b..17051210e 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-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/Importer/STEPParser/STEPFileEncoding.cpp b/code/Importer/STEPParser/STEPFileEncoding.cpp index 70d5f4e4b..1d7ac3418 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-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/Importer/STEPParser/STEPFileEncoding.h b/code/Importer/STEPParser/STEPFileEncoding.h index 232cb81ba..09f16ba33 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-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/Importer/STEPParser/STEPFileReader.cpp b/code/Importer/STEPParser/STEPFileReader.cpp index c7cad05ae..1707899a1 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-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. @@ -63,7 +63,6 @@ std::string AddLineNumber(const std::string& s,uint64_t line /*= LINE_NOT_SPECIF return line == STEP::SyntaxError::LINE_NOT_SPECIFIED ? prefix+s : static_cast( (Formatter::format(),prefix,"(line ",line,") ",s) ); } - // ------------------------------------------------------------------------------------------------ std::string AddEntityID(const std::string& s,uint64_t entity /*= ENTITY_NOT_SPECIFIED*/, const std::string& prefix = "") { @@ -243,7 +242,6 @@ void STEP::ReadFile(DB& db,const EXPRESS::ConversionSchema& scheme, std::string::size_type n2 = s.find_last_of(')'); if (n2 == std::string::npos || n2 < n1 || n2 == s.length() - 1 || s[n2 + 1] != ';') { - has_next = true; bool ok = false; for( ++splitter; splitter; ++splitter) { @@ -251,14 +249,14 @@ void STEP::ReadFile(DB& db,const EXPRESS::ConversionSchema& scheme, if (snext.empty()) { continue; } + // the next line doesn't start an entity, so maybe it is // just a continuation for this line, keep going if (!IsEntityDef(snext)) { s.append(snext); n2 = s.find_last_of(')'); ok = !(n2 == std::string::npos || n2 < n1 || n2 == s.length() - 1 || s[n2 + 1] != ';'); - } - else { + } else { break; } } @@ -424,10 +422,8 @@ std::shared_ptr EXPRESS::DataType::Parse(const char*& i return std::make_shared(neg?-num:num); } - // ------------------------------------------------------------------------------------------------ -std::shared_ptr EXPRESS::LIST::Parse(const char*& inout,uint64_t line, const EXPRESS::ConversionSchema* schema /*= NULL*/) -{ +std::shared_ptr EXPRESS::LIST::Parse(const char*& inout,uint64_t line, const EXPRESS::ConversionSchema* schema /*= NULL*/) { const std::shared_ptr list = std::make_shared(); EXPRESS::LIST::MemberList& members = list->members; @@ -468,61 +464,73 @@ std::shared_ptr EXPRESS::LIST::Parse(const char*& inout,uin return list; } +// ------------------------------------------------------------------------------------------------ +static void handleSkippedDepthFromToken(const char *a, int64_t &skip_depth ) { + if (*a == '(') { + ++skip_depth; + } else if (*a == ')') { + --skip_depth; + } +} + +// ------------------------------------------------------------------------------------------------ +static int64_t getIdFromToken(const char *a) { + const char *tmp; + const int64_t num = static_cast(strtoul10_64(a + 1, &tmp)); + + return num; +} // ------------------------------------------------------------------------------------------------ STEP::LazyObject::LazyObject(DB& db, uint64_t id,uint64_t /*line*/, const char* const type,const char* args) - : id(id) - , type(type) - , db(db) - , args(args) - , obj() -{ +: id(id) +, type(type) +, db(db) +, args(args) +, obj() { // find any external references and store them in the database. // this helps us emulate STEPs INVERSE fields. - if (db.KeepInverseIndicesForType(type)) { - const char* a = args; + if (!db.KeepInverseIndicesForType(type)) { + return; + } - // do a quick scan through the argument tuple and watch out for entity references - int64_t skip_depth = 0; - while(*a) { - if (*a == '(') { - ++skip_depth; - } - else if (*a == ')') { - --skip_depth; - } + // do a quick scan through the argument tuple and watch out for entity references + const char *a( args ); + int64_t skip_depth( 0 ); + while ( *a ) { + handleSkippedDepthFromToken(a, skip_depth); + /*if (*a == '(') { + ++skip_depth; + } else if (*a == ')') { + --skip_depth; + }*/ - if (skip_depth >= 1 && *a=='#') { - if (*(a + 1) != '#') - { - const char* tmp; - const int64_t num = static_cast(strtoul10_64(a + 1, &tmp)); - db.MarkRef(num, id); - } - else - { - ++a; - } - } - ++a; + if (skip_depth >= 1 && *a=='#') { + if (*(a + 1) != '#') { + /*const char *tmp; + const int64_t num = static_cast(strtoul10_64(a + 1, &tmp)); + db.MarkRef(num, id);*/ + db.MarkRef(getIdFromToken(a), id); + } else { + ++a; + } } - + ++a; } } // ------------------------------------------------------------------------------------------------ -STEP::LazyObject::~LazyObject() -{ +STEP::LazyObject::~LazyObject() { // make sure the right dtor/operator delete get called if (obj) { delete obj; + } else { + delete[] args; } - else delete[] args; } // ------------------------------------------------------------------------------------------------ -void STEP::LazyObject::LazyInit() const -{ +void STEP::LazyObject::LazyInit() const { const EXPRESS::ConversionSchema& schema = db.GetSchema(); STEP::ConvertObjectProc proc = schema.GetConverterProc(type); diff --git a/code/Importer/STEPParser/STEPFileReader.h b/code/Importer/STEPParser/STEPFileReader.h index 667d28bfd..8fc462749 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-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. @@ -68,4 +68,4 @@ void ReadFile(DB& db,const EXPRESS::ConversionSchema& scheme, const char* const } // ! STEP } // ! Assimp -#endif +#endif // INCLUDED_AI_STEPFILEREADER_H diff --git a/code/Importer/StepFile/StepFileImporter.cpp b/code/Importer/StepFile/StepFileImporter.cpp index edfe30754..26c456ac9 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-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/Importer/StepFile/StepFileImporter.h b/code/Importer/StepFile/StepFileImporter.h index 68d5a09ad..70f65fdcf 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-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/ImporterRegistry.cpp b/code/ImporterRegistry.cpp index e6cf8299e..747815fa6 100644 --- a/code/ImporterRegistry.cpp +++ b/code/ImporterRegistry.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/ImproveCacheLocality.cpp b/code/ImproveCacheLocality.cpp index adcbc92fe..be6452dda 100644 --- a/code/ImproveCacheLocality.cpp +++ b/code/ImproveCacheLocality.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/ImproveCacheLocality.h b/code/ImproveCacheLocality.h index 18eb5e460..1b29ee0d6 100644 --- a/code/ImproveCacheLocality.h +++ b/code/ImproveCacheLocality.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/JoinVerticesProcess.cpp b/code/JoinVerticesProcess.cpp index b91f44048..914ec05b4 100644 --- a/code/JoinVerticesProcess.cpp +++ b/code/JoinVerticesProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/JoinVerticesProcess.h b/code/JoinVerticesProcess.h index a7366efbe..66fa362de 100644 --- a/code/JoinVerticesProcess.h +++ b/code/JoinVerticesProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/LWOAnimation.cpp b/code/LWOAnimation.cpp index ff02a8eab..3a0d2c392 100644 --- a/code/LWOAnimation.cpp +++ b/code/LWOAnimation.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/LWOAnimation.h b/code/LWOAnimation.h index f7b0f177b..dd29695cc 100644 --- a/code/LWOAnimation.h +++ b/code/LWOAnimation.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/LWOBLoader.cpp b/code/LWOBLoader.cpp index fabf99cad..b24957072 100644 --- a/code/LWOBLoader.cpp +++ b/code/LWOBLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/LWOFileData.h b/code/LWOFileData.h index b3a963199..a702d9363 100644 --- a/code/LWOFileData.h +++ b/code/LWOFileData.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/LWOLoader.cpp b/code/LWOLoader.cpp index fbefe4a1e..d1c2641e8 100644 --- a/code/LWOLoader.cpp +++ b/code/LWOLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/LWOLoader.h b/code/LWOLoader.h index 4d42eb2d2..05b958fd2 100644 --- a/code/LWOLoader.h +++ b/code/LWOLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/LWOMaterial.cpp b/code/LWOMaterial.cpp index 15c210460..55d0e23f1 100644 --- a/code/LWOMaterial.cpp +++ b/code/LWOMaterial.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/LWSLoader.cpp b/code/LWSLoader.cpp index 6f8cbe78d..d0811625c 100644 --- a/code/LWSLoader.cpp +++ b/code/LWSLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/LWSLoader.h b/code/LWSLoader.h index 9f1636f21..3c24b59ea 100644 --- a/code/LWSLoader.h +++ b/code/LWSLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/LimitBoneWeightsProcess.cpp b/code/LimitBoneWeightsProcess.cpp index cc87e407c..d560f1928 100644 --- a/code/LimitBoneWeightsProcess.cpp +++ b/code/LimitBoneWeightsProcess.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/LimitBoneWeightsProcess.h b/code/LimitBoneWeightsProcess.h index 2161b89a8..3602fd8ed 100644 --- a/code/LimitBoneWeightsProcess.h +++ b/code/LimitBoneWeightsProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/MD2FileData.h b/code/MD2FileData.h index 4b893bbb1..9fcb8b0e2 100644 --- a/code/MD2FileData.h +++ b/code/MD2FileData.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/MD2Loader.cpp b/code/MD2Loader.cpp index cfd5458e7..a26f70533 100644 --- a/code/MD2Loader.cpp +++ b/code/MD2Loader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/MD2Loader.h b/code/MD2Loader.h index f26b31736..a3863f366 100644 --- a/code/MD2Loader.h +++ b/code/MD2Loader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/MD2NormalTable.h b/code/MD2NormalTable.h index dd2c837b4..f82b57683 100644 --- a/code/MD2NormalTable.h +++ b/code/MD2NormalTable.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/MD3FileData.h b/code/MD3FileData.h index 910813fc4..0978e548d 100644 --- a/code/MD3FileData.h +++ b/code/MD3FileData.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/MD3Loader.cpp b/code/MD3Loader.cpp index d12f2d5fd..0faffd5f9 100644 --- a/code/MD3Loader.cpp +++ b/code/MD3Loader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/MD3Loader.h b/code/MD3Loader.h index 8ac3cdc68..01b840228 100644 --- a/code/MD3Loader.h +++ b/code/MD3Loader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/MD5Loader.cpp b/code/MD5Loader.cpp index a4285ba03..346b59504 100644 --- a/code/MD5Loader.cpp +++ b/code/MD5Loader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/MD5Loader.h b/code/MD5Loader.h index 1ba5fea68..e15cc3fb9 100644 --- a/code/MD5Loader.h +++ b/code/MD5Loader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/MD5Parser.cpp b/code/MD5Parser.cpp index 6f942228c..2770226a9 100644 --- a/code/MD5Parser.cpp +++ b/code/MD5Parser.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/MD5Parser.h b/code/MD5Parser.h index 853268424..f7ff5303f 100644 --- a/code/MD5Parser.h +++ b/code/MD5Parser.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/MDCFileData.h b/code/MDCFileData.h index c599a930a..052473158 100644 --- a/code/MDCFileData.h +++ b/code/MDCFileData.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/MDCLoader.cpp b/code/MDCLoader.cpp index 03b3336de..42947f123 100644 --- a/code/MDCLoader.cpp +++ b/code/MDCLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/MDCLoader.h b/code/MDCLoader.h index 5bbe2b666..a21b8a55a 100644 --- a/code/MDCLoader.h +++ b/code/MDCLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/MDLDefaultColorMap.h b/code/MDLDefaultColorMap.h index b96a60a06..58f642884 100644 --- a/code/MDLDefaultColorMap.h +++ b/code/MDLDefaultColorMap.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/MDLFileData.h b/code/MDLFileData.h index f9be6761b..f33a57731 100644 --- a/code/MDLFileData.h +++ b/code/MDLFileData.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/MDLLoader.cpp b/code/MDLLoader.cpp index eb067a1c9..256d79a2c 100644 --- a/code/MDLLoader.cpp +++ b/code/MDLLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/MDLLoader.h b/code/MDLLoader.h index f1504beea..7009d5ba4 100644 --- a/code/MDLLoader.h +++ b/code/MDLLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/MDLMaterialLoader.cpp b/code/MDLMaterialLoader.cpp index 2c21b188b..0a196761f 100644 --- a/code/MDLMaterialLoader.cpp +++ b/code/MDLMaterialLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/MMDCpp14.h b/code/MMDCpp14.h index 5ec2fd975..638b0bfd2 100644 --- a/code/MMDCpp14.h +++ b/code/MMDCpp14.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/MMDPmdParser.h b/code/MMDPmdParser.h index d61a355fb..d2f2224aa 100644 --- a/code/MMDPmdParser.h +++ b/code/MMDPmdParser.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/MMDPmxParser.cpp b/code/MMDPmxParser.cpp index 2c5bd9a8d..7425ceac2 100644 --- a/code/MMDPmxParser.cpp +++ b/code/MMDPmxParser.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/MMDPmxParser.h b/code/MMDPmxParser.h index 43cad5899..cf523a129 100644 --- a/code/MMDPmxParser.h +++ b/code/MMDPmxParser.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/MMDVmdParser.h b/code/MMDVmdParser.h index 600959e94..947c3a242 100644 --- a/code/MMDVmdParser.h +++ b/code/MMDVmdParser.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/MS3DLoader.cpp b/code/MS3DLoader.cpp index c659d2ec7..c0d0eddbe 100644 --- a/code/MS3DLoader.cpp +++ b/code/MS3DLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/MS3DLoader.h b/code/MS3DLoader.h index 2efa3be5f..3e39dc79f 100644 --- a/code/MS3DLoader.h +++ b/code/MS3DLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/MakeVerboseFormat.cpp b/code/MakeVerboseFormat.cpp index b6f5cabd9..50ff5ed93 100644 --- a/code/MakeVerboseFormat.cpp +++ b/code/MakeVerboseFormat.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/MakeVerboseFormat.h b/code/MakeVerboseFormat.h index 292d9bea6..d12db63ae 100644 --- a/code/MakeVerboseFormat.h +++ b/code/MakeVerboseFormat.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/MaterialSystem.cpp b/code/MaterialSystem.cpp index e9ca475fb..03d5a18a3 100644 --- a/code/MaterialSystem.cpp +++ b/code/MaterialSystem.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/MaterialSystem.h b/code/MaterialSystem.h index d6f2cea46..67d53578c 100644 --- a/code/MaterialSystem.h +++ b/code/MaterialSystem.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/NDOLoader.cpp b/code/NDOLoader.cpp index 17c9e135b..d33f40c75 100644 --- a/code/NDOLoader.cpp +++ b/code/NDOLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/NFFLoader.cpp b/code/NFFLoader.cpp index 1c7283db6..10a7d1aff 100644 --- a/code/NFFLoader.cpp +++ b/code/NFFLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/NFFLoader.h b/code/NFFLoader.h index 1e3f0bd26..bc4840e14 100644 --- a/code/NFFLoader.h +++ b/code/NFFLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/OFFLoader.cpp b/code/OFFLoader.cpp index a72e6d9d4..afd44a539 100644 --- a/code/OFFLoader.cpp +++ b/code/OFFLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/OFFLoader.h b/code/OFFLoader.h index ed1ed98c1..3fca77e1b 100644 --- a/code/OFFLoader.h +++ b/code/OFFLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/ObjExporter.cpp b/code/ObjExporter.cpp index 1542efebf..08cba43f7 100644 --- a/code/ObjExporter.cpp +++ b/code/ObjExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/ObjExporter.h b/code/ObjExporter.h index bd745b593..0d2b48d6b 100644 --- a/code/ObjExporter.h +++ b/code/ObjExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/ObjFileData.h b/code/ObjFileData.h index 38786e6f4..5ff9db68c 100644 --- a/code/ObjFileData.h +++ b/code/ObjFileData.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/ObjFileImporter.cpp b/code/ObjFileImporter.cpp index 93b2de6f4..782b62a73 100644 --- a/code/ObjFileImporter.cpp +++ b/code/ObjFileImporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/ObjFileImporter.h b/code/ObjFileImporter.h index f564fe22b..0df2ef731 100644 --- a/code/ObjFileImporter.h +++ b/code/ObjFileImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/ObjFileMtlImporter.cpp b/code/ObjFileMtlImporter.cpp index 16bde1b43..dd9cc3ce2 100644 --- a/code/ObjFileMtlImporter.cpp +++ b/code/ObjFileMtlImporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/ObjFileMtlImporter.h b/code/ObjFileMtlImporter.h index d6a7b1f1a..731952359 100644 --- a/code/ObjFileMtlImporter.h +++ b/code/ObjFileMtlImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/ObjFileParser.cpp b/code/ObjFileParser.cpp index d3bb6f50f..d303cb8b9 100644 --- a/code/ObjFileParser.cpp +++ b/code/ObjFileParser.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/ObjFileParser.h b/code/ObjFileParser.h index 7cf06ae05..e00382f4c 100644 --- a/code/ObjFileParser.h +++ b/code/ObjFileParser.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/ObjTools.h b/code/ObjTools.h index 842efd749..3f4c41033 100644 --- a/code/ObjTools.h +++ b/code/ObjTools.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/OgreBinarySerializer.cpp b/code/OgreBinarySerializer.cpp index 8948844d0..b2326e244 100644 --- a/code/OgreBinarySerializer.cpp +++ b/code/OgreBinarySerializer.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/OgreBinarySerializer.h b/code/OgreBinarySerializer.h index a31047c70..8bab00ce9 100644 --- a/code/OgreBinarySerializer.h +++ b/code/OgreBinarySerializer.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/OgreImporter.cpp b/code/OgreImporter.cpp index e77654d7b..c2c328a47 100644 --- a/code/OgreImporter.cpp +++ b/code/OgreImporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/OgreImporter.h b/code/OgreImporter.h index 8f088a3cc..321d58763 100644 --- a/code/OgreImporter.h +++ b/code/OgreImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/OgreMaterial.cpp b/code/OgreMaterial.cpp index ceca04da1..47cb17eb0 100644 --- a/code/OgreMaterial.cpp +++ b/code/OgreMaterial.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/OgreParsingUtils.h b/code/OgreParsingUtils.h index c6b6e0caf..8786521e4 100644 --- a/code/OgreParsingUtils.h +++ b/code/OgreParsingUtils.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/OgreStructs.cpp b/code/OgreStructs.cpp index b2ad8e089..7962202c1 100644 --- a/code/OgreStructs.cpp +++ b/code/OgreStructs.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/OgreStructs.h b/code/OgreStructs.h index dfe0346dc..6ea211e10 100644 --- a/code/OgreStructs.h +++ b/code/OgreStructs.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/OgreXmlSerializer.cpp b/code/OgreXmlSerializer.cpp index 5805a528d..19fd3ad61 100644 --- a/code/OgreXmlSerializer.cpp +++ b/code/OgreXmlSerializer.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/OgreXmlSerializer.h b/code/OgreXmlSerializer.h index c0f09096c..7e5e83fec 100644 --- a/code/OgreXmlSerializer.h +++ b/code/OgreXmlSerializer.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/OpenGEXExporter.cpp b/code/OpenGEXExporter.cpp index ea2f64e8f..635174185 100644 --- a/code/OpenGEXExporter.cpp +++ b/code/OpenGEXExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/OpenGEXExporter.h b/code/OpenGEXExporter.h index 76d2418a4..b9b54c208 100644 --- a/code/OpenGEXExporter.h +++ b/code/OpenGEXExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/OpenGEXImporter.cpp b/code/OpenGEXImporter.cpp index 2de0aabc0..a7a143035 100644 --- a/code/OpenGEXImporter.cpp +++ b/code/OpenGEXImporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/OpenGEXImporter.h b/code/OpenGEXImporter.h index 8e86a4aa8..22b5cabef 100644 --- a/code/OpenGEXImporter.h +++ b/code/OpenGEXImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/OpenGEXStructs.h b/code/OpenGEXStructs.h index 6cd7488e9..2c83e8660 100644 --- a/code/OpenGEXStructs.h +++ b/code/OpenGEXStructs.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/OptimizeGraph.cpp b/code/OptimizeGraph.cpp index 59a764d5c..add9ab79e 100644 --- a/code/OptimizeGraph.cpp +++ b/code/OptimizeGraph.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/OptimizeGraph.h b/code/OptimizeGraph.h index 6781ec534..e5bbed767 100644 --- a/code/OptimizeGraph.h +++ b/code/OptimizeGraph.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/OptimizeMeshes.cpp b/code/OptimizeMeshes.cpp index 25575b049..3f6765f6c 100644 --- a/code/OptimizeMeshes.cpp +++ b/code/OptimizeMeshes.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/OptimizeMeshes.h b/code/OptimizeMeshes.h index 3ebe60cd8..9f46f349b 100644 --- a/code/OptimizeMeshes.h +++ b/code/OptimizeMeshes.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/PlyExporter.cpp b/code/PlyExporter.cpp index 31c64a4d1..4f9fa6c6f 100644 --- a/code/PlyExporter.cpp +++ b/code/PlyExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/PlyExporter.h b/code/PlyExporter.h index 060aa7ceb..b82498cbd 100644 --- a/code/PlyExporter.h +++ b/code/PlyExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/PlyLoader.cpp b/code/PlyLoader.cpp index 7e55e6c3e..3924305cb 100644 --- a/code/PlyLoader.cpp +++ b/code/PlyLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/PlyLoader.h b/code/PlyLoader.h index 9199e17d7..201c463b2 100644 --- a/code/PlyLoader.h +++ b/code/PlyLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/PlyParser.cpp b/code/PlyParser.cpp index b51b6ac71..2a6f00ad6 100644 --- a/code/PlyParser.cpp +++ b/code/PlyParser.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/PlyParser.h b/code/PlyParser.h index b544c3b04..a11b411d1 100644 --- a/code/PlyParser.h +++ b/code/PlyParser.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/PolyTools.h b/code/PolyTools.h index f43bd9de1..fbbda0e7d 100644 --- a/code/PolyTools.h +++ b/code/PolyTools.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/PostStepRegistry.cpp b/code/PostStepRegistry.cpp index 646aeaeb0..469a8ef39 100644 --- a/code/PostStepRegistry.cpp +++ b/code/PostStepRegistry.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/PretransformVertices.cpp b/code/PretransformVertices.cpp index 9745abd60..52001a057 100644 --- a/code/PretransformVertices.cpp +++ b/code/PretransformVertices.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/PretransformVertices.h b/code/PretransformVertices.h index a8196289d..b7329af13 100644 --- a/code/PretransformVertices.h +++ b/code/PretransformVertices.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/ProcessHelper.cpp b/code/ProcessHelper.cpp index 7f3e4ba72..59869fdff 100644 --- a/code/ProcessHelper.cpp +++ b/code/ProcessHelper.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/ProcessHelper.h b/code/ProcessHelper.h index dcf71e853..c59f3217b 100644 --- a/code/ProcessHelper.h +++ b/code/ProcessHelper.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/Q3BSPFileData.h b/code/Q3BSPFileData.h index d814837c2..4e05bebf1 100644 --- a/code/Q3BSPFileData.h +++ b/code/Q3BSPFileData.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/Q3BSPFileImporter.cpp b/code/Q3BSPFileImporter.cpp index 8b9e3c037..6a3b95bb8 100644 --- a/code/Q3BSPFileImporter.cpp +++ b/code/Q3BSPFileImporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/Q3BSPFileImporter.h b/code/Q3BSPFileImporter.h index 5f3e31157..5af9fb7bc 100644 --- a/code/Q3BSPFileImporter.h +++ b/code/Q3BSPFileImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/Q3BSPFileParser.cpp b/code/Q3BSPFileParser.cpp index f7038adeb..5bac5ae76 100644 --- a/code/Q3BSPFileParser.cpp +++ b/code/Q3BSPFileParser.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/Q3BSPFileParser.h b/code/Q3BSPFileParser.h index 747d1d494..143e42b15 100644 --- a/code/Q3BSPFileParser.h +++ b/code/Q3BSPFileParser.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/Q3BSPZipArchive.cpp b/code/Q3BSPZipArchive.cpp index 3e1087b9a..0b6664842 100644 --- a/code/Q3BSPZipArchive.cpp +++ b/code/Q3BSPZipArchive.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/Q3BSPZipArchive.h b/code/Q3BSPZipArchive.h index 606f7b183..2fdc781f8 100644 --- a/code/Q3BSPZipArchive.h +++ b/code/Q3BSPZipArchive.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/Q3DLoader.cpp b/code/Q3DLoader.cpp index 1aa7cb72f..b8c8de716 100644 --- a/code/Q3DLoader.cpp +++ b/code/Q3DLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/Q3DLoader.h b/code/Q3DLoader.h index bdb104df3..954d3105c 100644 --- a/code/Q3DLoader.h +++ b/code/Q3DLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/RawLoader.cpp b/code/RawLoader.cpp index 1bc508759..d0da247e4 100644 --- a/code/RawLoader.cpp +++ b/code/RawLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/RawLoader.h b/code/RawLoader.h index f6e894fdd..8bfe8ef98 100644 --- a/code/RawLoader.h +++ b/code/RawLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/RemoveComments.cpp b/code/RemoveComments.cpp index 3ba3c60be..91700a769 100644 --- a/code/RemoveComments.cpp +++ b/code/RemoveComments.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/RemoveRedundantMaterials.cpp b/code/RemoveRedundantMaterials.cpp index 7194d3c8e..632bdca3f 100644 --- a/code/RemoveRedundantMaterials.cpp +++ b/code/RemoveRedundantMaterials.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/RemoveRedundantMaterials.h b/code/RemoveRedundantMaterials.h index 314bbf345..dbd4d44cc 100644 --- a/code/RemoveRedundantMaterials.h +++ b/code/RemoveRedundantMaterials.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/RemoveVCProcess.cpp b/code/RemoveVCProcess.cpp index 81249eab2..99fd47a3a 100644 --- a/code/RemoveVCProcess.cpp +++ b/code/RemoveVCProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/RemoveVCProcess.h b/code/RemoveVCProcess.h index 597de8584..617d7b9b2 100644 --- a/code/RemoveVCProcess.h +++ b/code/RemoveVCProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/SGSpatialSort.cpp b/code/SGSpatialSort.cpp index d74c57ed5..120070b0a 100644 --- a/code/SGSpatialSort.cpp +++ b/code/SGSpatialSort.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/SIBImporter.cpp b/code/SIBImporter.cpp index 7a69dd175..cfa65520e 100644 --- a/code/SIBImporter.cpp +++ b/code/SIBImporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/SIBImporter.h b/code/SIBImporter.h index 9437af588..bb88c2255 100644 --- a/code/SIBImporter.h +++ b/code/SIBImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/SMDLoader.cpp b/code/SMDLoader.cpp index c6ec61624..00d92e0b4 100644 --- a/code/SMDLoader.cpp +++ b/code/SMDLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/SMDLoader.h b/code/SMDLoader.h index a791e7dde..85dac97d1 100644 --- a/code/SMDLoader.h +++ b/code/SMDLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/STEPFile.h b/code/STEPFile.h index f5b56c31f..ac3280c21 100644 --- a/code/STEPFile.h +++ b/code/STEPFile.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/STLExporter.cpp b/code/STLExporter.cpp index e4a1dbb66..00fced6ff 100644 --- a/code/STLExporter.cpp +++ b/code/STLExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/STLExporter.h b/code/STLExporter.h index 6e8f90915..cb5238e60 100644 --- a/code/STLExporter.h +++ b/code/STLExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/STLLoader.cpp b/code/STLLoader.cpp index f8c4bb7db..c615561a8 100644 --- a/code/STLLoader.cpp +++ b/code/STLLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/STLLoader.h b/code/STLLoader.h index 3b87f70a3..ca1011cb8 100644 --- a/code/STLLoader.h +++ b/code/STLLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/ScaleProcess.cpp b/code/ScaleProcess.cpp index facc39d7d..6d458c4b1 100644 --- a/code/ScaleProcess.cpp +++ b/code/ScaleProcess.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/ScaleProcess.h b/code/ScaleProcess.h index 0621220a8..55146ae06 100644 --- a/code/ScaleProcess.h +++ b/code/ScaleProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/SceneCombiner.cpp b/code/SceneCombiner.cpp index 2271194ca..e445bd743 100644 --- a/code/SceneCombiner.cpp +++ b/code/SceneCombiner.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/ScenePreprocessor.cpp b/code/ScenePreprocessor.cpp index 1228ab2c2..432a3d766 100644 --- a/code/ScenePreprocessor.cpp +++ b/code/ScenePreprocessor.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/ScenePreprocessor.h b/code/ScenePreprocessor.h index 3900a237b..3f4c8d7c3 100644 --- a/code/ScenePreprocessor.h +++ b/code/ScenePreprocessor.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/ScenePrivate.h b/code/ScenePrivate.h index 775b9cb52..f336aafc9 100644 --- a/code/ScenePrivate.h +++ b/code/ScenePrivate.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/SkeletonMeshBuilder.cpp b/code/SkeletonMeshBuilder.cpp index ecfe8586f..06cfe034e 100644 --- a/code/SkeletonMeshBuilder.cpp +++ b/code/SkeletonMeshBuilder.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/SortByPTypeProcess.cpp b/code/SortByPTypeProcess.cpp index b67da5b95..87bbe5257 100644 --- a/code/SortByPTypeProcess.cpp +++ b/code/SortByPTypeProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/SortByPTypeProcess.h b/code/SortByPTypeProcess.h index 27bfa2155..c9d9924d8 100644 --- a/code/SortByPTypeProcess.h +++ b/code/SortByPTypeProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/SpatialSort.cpp b/code/SpatialSort.cpp index b0ab6e412..a4f3a4e4b 100644 --- a/code/SpatialSort.cpp +++ b/code/SpatialSort.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/SplitByBoneCountProcess.cpp b/code/SplitByBoneCountProcess.cpp index 6faf11086..2ef66a9af 100644 --- a/code/SplitByBoneCountProcess.cpp +++ b/code/SplitByBoneCountProcess.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/SplitByBoneCountProcess.h b/code/SplitByBoneCountProcess.h index b46dd6b0f..6c904a9df 100644 --- a/code/SplitByBoneCountProcess.h +++ b/code/SplitByBoneCountProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/SplitLargeMeshes.cpp b/code/SplitLargeMeshes.cpp index 5cd3afe48..1797b28d5 100644 --- a/code/SplitLargeMeshes.cpp +++ b/code/SplitLargeMeshes.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/SplitLargeMeshes.h b/code/SplitLargeMeshes.h index 7a977ff07..77f089ce7 100644 --- a/code/SplitLargeMeshes.h +++ b/code/SplitLargeMeshes.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/StandardShapes.cpp b/code/StandardShapes.cpp index 7d2319401..f262b6bac 100644 --- a/code/StandardShapes.cpp +++ b/code/StandardShapes.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/StdOStreamLogStream.h b/code/StdOStreamLogStream.h index 43b8d7de2..893e261a2 100644 --- a/code/StdOStreamLogStream.h +++ b/code/StdOStreamLogStream.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/StepExporter.cpp b/code/StepExporter.cpp index 4368201b7..02e521247 100644 --- a/code/StepExporter.cpp +++ b/code/StepExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/StepExporter.h b/code/StepExporter.h index f1323bee8..f96a0d2b5 100644 --- a/code/StepExporter.h +++ b/code/StepExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/Subdivision.cpp b/code/Subdivision.cpp index 2f2f09596..19db223a5 100644 --- a/code/Subdivision.cpp +++ b/code/Subdivision.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/TargetAnimation.cpp b/code/TargetAnimation.cpp index 2834b1f10..b8062499f 100644 --- a/code/TargetAnimation.cpp +++ b/code/TargetAnimation.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/TargetAnimation.h b/code/TargetAnimation.h index bb37e6008..91634ab5a 100644 --- a/code/TargetAnimation.h +++ b/code/TargetAnimation.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/TerragenLoader.cpp b/code/TerragenLoader.cpp index 0eb22cef6..9b0873c68 100644 --- a/code/TerragenLoader.cpp +++ b/code/TerragenLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/TerragenLoader.h b/code/TerragenLoader.h index a02889de1..a478c0dcd 100644 --- a/code/TerragenLoader.h +++ b/code/TerragenLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/TextureTransform.cpp b/code/TextureTransform.cpp index c7adbe7a9..8ae2ba721 100644 --- a/code/TextureTransform.cpp +++ b/code/TextureTransform.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/TextureTransform.h b/code/TextureTransform.h index 99d5acf1e..c556ff5d8 100644 --- a/code/TextureTransform.h +++ b/code/TextureTransform.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/TriangulateProcess.cpp b/code/TriangulateProcess.cpp index b2ea46ef7..0f68f47dd 100644 --- a/code/TriangulateProcess.cpp +++ b/code/TriangulateProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/TriangulateProcess.h b/code/TriangulateProcess.h index e6300085d..47bd2115a 100644 --- a/code/TriangulateProcess.h +++ b/code/TriangulateProcess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/UnrealLoader.cpp b/code/UnrealLoader.cpp index 64bfbb9e0..778aef59d 100644 --- a/code/UnrealLoader.cpp +++ b/code/UnrealLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/UnrealLoader.h b/code/UnrealLoader.h index 4095aa142..f846eb43a 100644 --- a/code/UnrealLoader.h +++ b/code/UnrealLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/ValidateDataStructure.cpp b/code/ValidateDataStructure.cpp index 931c52822..7db05a4e3 100644 --- a/code/ValidateDataStructure.cpp +++ b/code/ValidateDataStructure.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/ValidateDataStructure.h b/code/ValidateDataStructure.h index 4e1636bfa..bd21e8854 100644 --- a/code/ValidateDataStructure.h +++ b/code/ValidateDataStructure.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/Version.cpp b/code/Version.cpp index b823abd68..cc94340ac 100644 --- a/code/Version.cpp +++ b/code/Version.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/VertexTriangleAdjacency.cpp b/code/VertexTriangleAdjacency.cpp index b41fd029d..7cfd1a350 100644 --- a/code/VertexTriangleAdjacency.cpp +++ b/code/VertexTriangleAdjacency.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/VertexTriangleAdjacency.h b/code/VertexTriangleAdjacency.h index 23624a5be..f3be47612 100644 --- a/code/VertexTriangleAdjacency.h +++ b/code/VertexTriangleAdjacency.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/Win32DebugLogStream.h b/code/Win32DebugLogStream.h index 7bbe8002a..a6063a261 100644 --- a/code/Win32DebugLogStream.h +++ b/code/Win32DebugLogStream.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/X3DImporter.cpp b/code/X3DImporter.cpp index e6c915e90..1f4d3f916 100644 --- a/code/X3DImporter.cpp +++ b/code/X3DImporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/X3DImporter.hpp b/code/X3DImporter.hpp index 1c9dc5486..a4afc1463 100644 --- a/code/X3DImporter.hpp +++ b/code/X3DImporter.hpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/X3DImporter_Geometry2D.cpp b/code/X3DImporter_Geometry2D.cpp index 5229017b3..b29c80b04 100644 --- a/code/X3DImporter_Geometry2D.cpp +++ b/code/X3DImporter_Geometry2D.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/X3DImporter_Geometry3D.cpp b/code/X3DImporter_Geometry3D.cpp index b6d130098..2eecc079d 100644 --- a/code/X3DImporter_Geometry3D.cpp +++ b/code/X3DImporter_Geometry3D.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/X3DImporter_Group.cpp b/code/X3DImporter_Group.cpp index 0c2e820de..de3610caf 100644 --- a/code/X3DImporter_Group.cpp +++ b/code/X3DImporter_Group.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/X3DImporter_Light.cpp b/code/X3DImporter_Light.cpp index 4ffea4411..842fffc04 100644 --- a/code/X3DImporter_Light.cpp +++ b/code/X3DImporter_Light.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/X3DImporter_Macro.hpp b/code/X3DImporter_Macro.hpp index d1172798c..a6aca33fb 100644 --- a/code/X3DImporter_Macro.hpp +++ b/code/X3DImporter_Macro.hpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/X3DImporter_Metadata.cpp b/code/X3DImporter_Metadata.cpp index a566f0aa9..f888ac2b9 100644 --- a/code/X3DImporter_Metadata.cpp +++ b/code/X3DImporter_Metadata.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/X3DImporter_Networking.cpp b/code/X3DImporter_Networking.cpp index 9c15c4ac4..89010ae08 100644 --- a/code/X3DImporter_Networking.cpp +++ b/code/X3DImporter_Networking.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/X3DImporter_Node.hpp b/code/X3DImporter_Node.hpp index cb1317582..85208223d 100644 --- a/code/X3DImporter_Node.hpp +++ b/code/X3DImporter_Node.hpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/X3DImporter_Postprocess.cpp b/code/X3DImporter_Postprocess.cpp index c439a4004..e7686b41e 100644 --- a/code/X3DImporter_Postprocess.cpp +++ b/code/X3DImporter_Postprocess.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/X3DImporter_Rendering.cpp b/code/X3DImporter_Rendering.cpp index 1b44f8c19..d0c58030d 100644 --- a/code/X3DImporter_Rendering.cpp +++ b/code/X3DImporter_Rendering.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/X3DImporter_Shape.cpp b/code/X3DImporter_Shape.cpp index 43089c698..126d5905a 100644 --- a/code/X3DImporter_Shape.cpp +++ b/code/X3DImporter_Shape.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/X3DImporter_Texturing.cpp b/code/X3DImporter_Texturing.cpp index 807d19ff8..b4e42025a 100644 --- a/code/X3DImporter_Texturing.cpp +++ b/code/X3DImporter_Texturing.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/X3DVocabulary.cpp b/code/X3DVocabulary.cpp index dc361b7aa..c6ee113b3 100644 --- a/code/X3DVocabulary.cpp +++ b/code/X3DVocabulary.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/XFileExporter.cpp b/code/XFileExporter.cpp index 1510ae6d4..baa478226 100644 --- a/code/XFileExporter.cpp +++ b/code/XFileExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/XFileExporter.h b/code/XFileExporter.h index fc480f40b..322440af8 100644 --- a/code/XFileExporter.h +++ b/code/XFileExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/XFileHelper.h b/code/XFileHelper.h index c51e2eba9..0365280f0 100644 --- a/code/XFileHelper.h +++ b/code/XFileHelper.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/XFileImporter.cpp b/code/XFileImporter.cpp index ae847eef8..e9335cfaa 100644 --- a/code/XFileImporter.cpp +++ b/code/XFileImporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/XFileImporter.h b/code/XFileImporter.h index b3c06eab1..d1b8d3f47 100644 --- a/code/XFileImporter.h +++ b/code/XFileImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/XFileParser.cpp b/code/XFileParser.cpp index e7bf8518c..ed715a19d 100644 --- a/code/XFileParser.cpp +++ b/code/XFileParser.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/XFileParser.h b/code/XFileParser.h index 24eb6104d..993bae6a1 100644 --- a/code/XFileParser.h +++ b/code/XFileParser.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/XGLLoader.cpp b/code/XGLLoader.cpp index 2dfd51284..32cfd72ca 100644 --- a/code/XGLLoader.cpp +++ b/code/XGLLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/XGLLoader.h b/code/XGLLoader.h index 8ae05836a..bba2a643c 100644 --- a/code/XGLLoader.h +++ b/code/XGLLoader.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/glTF2Asset.h b/code/glTF2Asset.h index 6672dd7a9..897db7474 100644 --- a/code/glTF2Asset.h +++ b/code/glTF2Asset.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/glTF2Asset.inl b/code/glTF2Asset.inl index ed37937f4..97ad6df57 100755 --- a/code/glTF2Asset.inl +++ b/code/glTF2Asset.inl @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/glTF2AssetWriter.h b/code/glTF2AssetWriter.h index 493ca1c0a..928b6e71b 100644 --- a/code/glTF2AssetWriter.h +++ b/code/glTF2AssetWriter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/glTF2AssetWriter.inl b/code/glTF2AssetWriter.inl index 75726fd08..0d61d23e5 100644 --- a/code/glTF2AssetWriter.inl +++ b/code/glTF2AssetWriter.inl @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/glTF2Exporter.cpp b/code/glTF2Exporter.cpp index d513dc45d..aae8a6c30 100644 --- a/code/glTF2Exporter.cpp +++ b/code/glTF2Exporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/glTF2Exporter.h b/code/glTF2Exporter.h index 06bc5ad40..2dc083709 100644 --- a/code/glTF2Exporter.h +++ b/code/glTF2Exporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/glTF2Importer.cpp b/code/glTF2Importer.cpp index c73e1eabb..be3a9a96f 100755 --- a/code/glTF2Importer.cpp +++ b/code/glTF2Importer.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/glTF2Importer.h b/code/glTF2Importer.h index 7414e2f95..091b61ee6 100644 --- a/code/glTF2Importer.h +++ b/code/glTF2Importer.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/glTFAsset.h b/code/glTFAsset.h index b04692901..463c69be4 100644 --- a/code/glTFAsset.h +++ b/code/glTFAsset.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/glTFAsset.inl b/code/glTFAsset.inl index 267cbd4a3..f545b809c 100644 --- a/code/glTFAsset.inl +++ b/code/glTFAsset.inl @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/glTFAssetWriter.h b/code/glTFAssetWriter.h index bbe89fc77..03aee7d4c 100644 --- a/code/glTFAssetWriter.h +++ b/code/glTFAssetWriter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/glTFAssetWriter.inl b/code/glTFAssetWriter.inl index fd29a96b4..259ad03f6 100644 --- a/code/glTFAssetWriter.inl +++ b/code/glTFAssetWriter.inl @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/glTFExporter.cpp b/code/glTFExporter.cpp index 5d00c9178..9daf202cb 100644 --- a/code/glTFExporter.cpp +++ b/code/glTFExporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/glTFExporter.h b/code/glTFExporter.h index 061dac5e8..d6c2e7f04 100644 --- a/code/glTFExporter.h +++ b/code/glTFExporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/glTFImporter.cpp b/code/glTFImporter.cpp index c68969dc6..57566b463 100755 --- a/code/glTFImporter.cpp +++ b/code/glTFImporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/glTFImporter.h b/code/glTFImporter.h index 064d6dc1a..ce8a000dc 100644 --- a/code/glTFImporter.h +++ b/code/glTFImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/code/scene.cpp b/code/scene.cpp index 676051163..2acb348d8 100644 --- a/code/scene.cpp +++ b/code/scene.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/simd.cpp b/code/simd.cpp index 9e2a83a60..04615f408 100644 --- a/code/simd.cpp +++ b/code/simd.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/code/simd.h b/code/simd.h index 19117569d..3eecdd458 100644 --- a/code/simd.h +++ b/code/simd.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/BaseImporter.h b/include/assimp/BaseImporter.h index b218d06ff..48dfc8ed8 100644 --- a/include/assimp/BaseImporter.h +++ b/include/assimp/BaseImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/Bitmap.h b/include/assimp/Bitmap.h index 209116863..e6b5fb132 100644 --- a/include/assimp/Bitmap.h +++ b/include/assimp/Bitmap.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/BlobIOSystem.h b/include/assimp/BlobIOSystem.h index a0ed7209f..d005e5c11 100644 --- a/include/assimp/BlobIOSystem.h +++ b/include/assimp/BlobIOSystem.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/ByteSwapper.h b/include/assimp/ByteSwapper.h index 322a242de..20a2463fb 100644 --- a/include/assimp/ByteSwapper.h +++ b/include/assimp/ByteSwapper.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/CreateAnimMesh.h b/include/assimp/CreateAnimMesh.h index ad625cb9f..a60173588 100644 --- a/include/assimp/CreateAnimMesh.h +++ b/include/assimp/CreateAnimMesh.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/DefaultIOStream.h b/include/assimp/DefaultIOStream.h index e0e010ecb..994d728ff 100644 --- a/include/assimp/DefaultIOStream.h +++ b/include/assimp/DefaultIOStream.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/DefaultIOSystem.h b/include/assimp/DefaultIOSystem.h index a5d45c692..2dd5c801b 100644 --- a/include/assimp/DefaultIOSystem.h +++ b/include/assimp/DefaultIOSystem.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/DefaultLogger.hpp b/include/assimp/DefaultLogger.hpp index 1f0c899be..1946e250a 100644 --- a/include/assimp/DefaultLogger.hpp +++ b/include/assimp/DefaultLogger.hpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/Exporter.hpp b/include/assimp/Exporter.hpp index 4e0843b60..bf0096e7e 100644 --- a/include/assimp/Exporter.hpp +++ b/include/assimp/Exporter.hpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/GenericProperty.h b/include/assimp/GenericProperty.h index 7b75cb1c8..183ecd519 100644 --- a/include/assimp/GenericProperty.h +++ b/include/assimp/GenericProperty.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/Hash.h b/include/assimp/Hash.h index eb5df757d..30657be19 100644 --- a/include/assimp/Hash.h +++ b/include/assimp/Hash.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/IOStream.hpp b/include/assimp/IOStream.hpp index 52b80cc15..0623d0f70 100644 --- a/include/assimp/IOStream.hpp +++ b/include/assimp/IOStream.hpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/IOStreamBuffer.h b/include/assimp/IOStreamBuffer.h index be5e4d0c5..58abd97a0 100644 --- a/include/assimp/IOStreamBuffer.h +++ b/include/assimp/IOStreamBuffer.h @@ -4,7 +4,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/IOSystem.hpp b/include/assimp/IOSystem.hpp index a36e22508..78139c283 100644 --- a/include/assimp/IOSystem.hpp +++ b/include/assimp/IOSystem.hpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/Importer.hpp b/include/assimp/Importer.hpp index 1d1dac19f..4941df412 100644 --- a/include/assimp/Importer.hpp +++ b/include/assimp/Importer.hpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/LineSplitter.h b/include/assimp/LineSplitter.h index eb6b6e46c..4afe45b92 100644 --- a/include/assimp/LineSplitter.h +++ b/include/assimp/LineSplitter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/LogAux.h b/include/assimp/LogAux.h index cf6d50014..558485272 100644 --- a/include/assimp/LogAux.h +++ b/include/assimp/LogAux.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/LogStream.hpp b/include/assimp/LogStream.hpp index e0eb8d505..d0281e2d0 100644 --- a/include/assimp/LogStream.hpp +++ b/include/assimp/LogStream.hpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/Logger.hpp b/include/assimp/Logger.hpp index 6a9928735..89cade6c3 100644 --- a/include/assimp/Logger.hpp +++ b/include/assimp/Logger.hpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/Macros.h b/include/assimp/Macros.h index 3aaed4e97..651530337 100644 --- a/include/assimp/Macros.h +++ b/include/assimp/Macros.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/MemoryIOWrapper.h b/include/assimp/MemoryIOWrapper.h index a9a78c319..c52278718 100644 --- a/include/assimp/MemoryIOWrapper.h +++ b/include/assimp/MemoryIOWrapper.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/NullLogger.hpp b/include/assimp/NullLogger.hpp index 776f301ab..c45d01bd4 100644 --- a/include/assimp/NullLogger.hpp +++ b/include/assimp/NullLogger.hpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/ParsingUtils.h b/include/assimp/ParsingUtils.h index 4553072db..ca30ce13b 100644 --- a/include/assimp/ParsingUtils.h +++ b/include/assimp/ParsingUtils.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/Profiler.h b/include/assimp/Profiler.h index da5af2726..6ff9d41c0 100644 --- a/include/assimp/Profiler.h +++ b/include/assimp/Profiler.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/ProgressHandler.hpp b/include/assimp/ProgressHandler.hpp index f295eac39..4e47f1d0a 100644 --- a/include/assimp/ProgressHandler.hpp +++ b/include/assimp/ProgressHandler.hpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/RemoveComments.h b/include/assimp/RemoveComments.h index 08299f22b..404b49671 100644 --- a/include/assimp/RemoveComments.h +++ b/include/assimp/RemoveComments.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/SGSpatialSort.h b/include/assimp/SGSpatialSort.h index 3c95d0b51..5b4f3f41f 100644 --- a/include/assimp/SGSpatialSort.h +++ b/include/assimp/SGSpatialSort.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/SceneCombiner.h b/include/assimp/SceneCombiner.h index ec2788245..679a2acea 100644 --- a/include/assimp/SceneCombiner.h +++ b/include/assimp/SceneCombiner.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/SkeletonMeshBuilder.h b/include/assimp/SkeletonMeshBuilder.h index 993d9c84d..f9b8d9f55 100644 --- a/include/assimp/SkeletonMeshBuilder.h +++ b/include/assimp/SkeletonMeshBuilder.h @@ -4,7 +4,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/SmoothingGroups.h b/include/assimp/SmoothingGroups.h index 88345c66a..92d65cea0 100644 --- a/include/assimp/SmoothingGroups.h +++ b/include/assimp/SmoothingGroups.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/SpatialSort.h b/include/assimp/SpatialSort.h index 8fb450841..61b345bcb 100644 --- a/include/assimp/SpatialSort.h +++ b/include/assimp/SpatialSort.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/StandardShapes.h b/include/assimp/StandardShapes.h index fdf1b034d..3791569b8 100644 --- a/include/assimp/StandardShapes.h +++ b/include/assimp/StandardShapes.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/StreamReader.h b/include/assimp/StreamReader.h index 4e5d2ddfa..9116c1426 100644 --- a/include/assimp/StreamReader.h +++ b/include/assimp/StreamReader.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/StreamWriter.h b/include/assimp/StreamWriter.h index deb35fb4d..c7cf6c0d7 100644 --- a/include/assimp/StreamWriter.h +++ b/include/assimp/StreamWriter.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/StringComparison.h b/include/assimp/StringComparison.h index aea7f001a..8acef277b 100644 --- a/include/assimp/StringComparison.h +++ b/include/assimp/StringComparison.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/StringUtils.h b/include/assimp/StringUtils.h index 906898b53..d68b7fa47 100644 --- a/include/assimp/StringUtils.h +++ b/include/assimp/StringUtils.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/Subdivision.h b/include/assimp/Subdivision.h index 84aff68f1..43feb73b3 100644 --- a/include/assimp/Subdivision.h +++ b/include/assimp/Subdivision.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/TinyFormatter.h b/include/assimp/TinyFormatter.h index 2ddc227e9..1226b482e 100644 --- a/include/assimp/TinyFormatter.h +++ b/include/assimp/TinyFormatter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/Vertex.h b/include/assimp/Vertex.h index f1c02ee07..2a7f0256a 100644 --- a/include/assimp/Vertex.h +++ b/include/assimp/Vertex.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/XMLTools.h b/include/assimp/XMLTools.h index 4b76c4483..b0d327687 100644 --- a/include/assimp/XMLTools.h +++ b/include/assimp/XMLTools.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/ai_assert.h b/include/assimp/ai_assert.h index 7752763db..daae23454 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-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/anim.h b/include/assimp/anim.h index 8a0984192..02e92739e 100644 --- a/include/assimp/anim.h +++ b/include/assimp/anim.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/camera.h b/include/assimp/camera.h index 6fea5a7d7..99daf6993 100644 --- a/include/assimp/camera.h +++ b/include/assimp/camera.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/cfileio.h b/include/assimp/cfileio.h index a7a56f81c..8f7ca4546 100644 --- a/include/assimp/cfileio.h +++ b/include/assimp/cfileio.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/cimport.h b/include/assimp/cimport.h index eb1e6e0d4..dbd10f137 100644 --- a/include/assimp/cimport.h +++ b/include/assimp/cimport.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/color4.h b/include/assimp/color4.h index fddd1b638..3c97c8eda 100644 --- a/include/assimp/color4.h +++ b/include/assimp/color4.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/color4.inl b/include/assimp/color4.inl index 6e27292b9..3192d55f3 100644 --- a/include/assimp/color4.inl +++ b/include/assimp/color4.inl @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/defs.h b/include/assimp/defs.h index e651a1f7b..4a177e3c3 100644 --- a/include/assimp/defs.h +++ b/include/assimp/defs.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/importerdesc.h b/include/assimp/importerdesc.h index 36b773e45..36e387f01 100644 --- a/include/assimp/importerdesc.h +++ b/include/assimp/importerdesc.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/irrXMLWrapper.h b/include/assimp/irrXMLWrapper.h index 296f26a32..ec8ee7c76 100644 --- a/include/assimp/irrXMLWrapper.h +++ b/include/assimp/irrXMLWrapper.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/light.h b/include/assimp/light.h index dc0b8a4b6..1667cfb8c 100644 --- a/include/assimp/light.h +++ b/include/assimp/light.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/material.h b/include/assimp/material.h index 45b4844a3..81b5fb05f 100644 --- a/include/assimp/material.h +++ b/include/assimp/material.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/material.inl b/include/assimp/material.inl index 3d4b07c06..b05d6af6c 100644 --- a/include/assimp/material.inl +++ b/include/assimp/material.inl @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/matrix3x3.h b/include/assimp/matrix3x3.h index 4bb55ad21..22b69561f 100644 --- a/include/assimp/matrix3x3.h +++ b/include/assimp/matrix3x3.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/matrix3x3.inl b/include/assimp/matrix3x3.inl index ab2cc410b..d9d45a3e9 100644 --- a/include/assimp/matrix3x3.inl +++ b/include/assimp/matrix3x3.inl @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/matrix4x4.h b/include/assimp/matrix4x4.h index bfa9d3865..046bb535f 100644 --- a/include/assimp/matrix4x4.h +++ b/include/assimp/matrix4x4.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/matrix4x4.inl b/include/assimp/matrix4x4.inl index 680d7666d..ebc67a06e 100644 --- a/include/assimp/matrix4x4.inl +++ b/include/assimp/matrix4x4.inl @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/mesh.h b/include/assimp/mesh.h index f9c2c1e67..8d539c59e 100644 --- a/include/assimp/mesh.h +++ b/include/assimp/mesh.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/metadata.h b/include/assimp/metadata.h index 498e2f6d1..3a1dd1442 100644 --- a/include/assimp/metadata.h +++ b/include/assimp/metadata.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/pbrmaterial.h b/include/assimp/pbrmaterial.h index 723957300..ce5f82217 100644 --- a/include/assimp/pbrmaterial.h +++ b/include/assimp/pbrmaterial.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/postprocess.h b/include/assimp/postprocess.h index a0ae0a1bc..c23a5490a 100644 --- a/include/assimp/postprocess.h +++ b/include/assimp/postprocess.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/qnan.h b/include/assimp/qnan.h index 251688989..0918bde5e 100644 --- a/include/assimp/qnan.h +++ b/include/assimp/qnan.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/quaternion.h b/include/assimp/quaternion.h index e2479f2ed..96574d24b 100644 --- a/include/assimp/quaternion.h +++ b/include/assimp/quaternion.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/include/assimp/quaternion.inl b/include/assimp/quaternion.inl index 0a2c92937..c26648215 100644 --- a/include/assimp/quaternion.inl +++ b/include/assimp/quaternion.inl @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/scene.h b/include/assimp/scene.h index 867e87de0..de0239702 100644 --- a/include/assimp/scene.h +++ b/include/assimp/scene.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/texture.h b/include/assimp/texture.h index 575f5754f..dc6cbef65 100644 --- a/include/assimp/texture.h +++ b/include/assimp/texture.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/types.h b/include/assimp/types.h index 660479f8a..748e4851f 100644 --- a/include/assimp/types.h +++ b/include/assimp/types.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/vector2.h b/include/assimp/vector2.h index 85ca6d0a4..d5ef00154 100644 --- a/include/assimp/vector2.h +++ b/include/assimp/vector2.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/vector2.inl b/include/assimp/vector2.inl index 46c6c9d27..3b7a7beab 100644 --- a/include/assimp/vector2.inl +++ b/include/assimp/vector2.inl @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/vector3.h b/include/assimp/vector3.h index 33ae7d22f..7ff25cf0a 100644 --- a/include/assimp/vector3.h +++ b/include/assimp/vector3.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/vector3.inl b/include/assimp/vector3.inl index ebe2f82e9..2fce6edde 100644 --- a/include/assimp/vector3.inl +++ b/include/assimp/vector3.inl @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/include/assimp/version.h b/include/assimp/version.h index 470166edf..c62a40e11 100644 --- a/include/assimp/version.h +++ b/include/assimp/version.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 210d95550..03c4ac6a1 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,7 +1,7 @@ # Open Asset Import Library (assimp) # ---------------------------------------------------------------------- # -# Copyright (c) 2006-2018, assimp team +# Copyright (c) 2006-2019, assimp team # All rights reserved. diff --git a/test/unit/AbstractImportExportBase.cpp b/test/unit/AbstractImportExportBase.cpp index c09ec0fd7..bf89fa5d4 100644 --- a/test/unit/AbstractImportExportBase.cpp +++ b/test/unit/AbstractImportExportBase.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/AssimpAPITest.cpp b/test/unit/AssimpAPITest.cpp index faf551f7c..3e1d97314 100644 --- a/test/unit/AssimpAPITest.cpp +++ b/test/unit/AssimpAPITest.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/Common/utLineSplitter.cpp b/test/unit/Common/utLineSplitter.cpp index ad050ea73..2aa581add 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-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/ImportExport/utCOBImportExport.cpp b/test/unit/ImportExport/utCOBImportExport.cpp index 854f27cbb..d80757e53 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-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/ImportExport/utExporter.cpp b/test/unit/ImportExport/utExporter.cpp index 9ce4bfdd7..c46a55b00 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-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/ImportExport/utNFFImportExport.cpp b/test/unit/ImportExport/utNFFImportExport.cpp index aca9e0392..d2fc1df5f 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-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/ImportExport/utOFFImportExport.cpp b/test/unit/ImportExport/utOFFImportExport.cpp index a355beab6..eadd48b12 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-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/ImportExport/utOgreImportExport.cpp b/test/unit/ImportExport/utOgreImportExport.cpp index 1950fc90a..608d0b068 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-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/ImportExport/utQ3BSPFileImportExport.cpp b/test/unit/ImportExport/utQ3BSPFileImportExport.cpp index ba12652b4..70d89f1d2 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-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/ImportExport/utXGLImportExport.cpp b/test/unit/ImportExport/utXGLImportExport.cpp index 8f82ba48d..89e780e20 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-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/SceneDiffer.cpp b/test/unit/SceneDiffer.cpp index 30b6e9086..fb000db29 100644 --- a/test/unit/SceneDiffer.cpp +++ b/test/unit/SceneDiffer.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/SceneDiffer.h b/test/unit/SceneDiffer.h index 5c9ce2c3b..2a8bdae33 100644 --- a/test/unit/SceneDiffer.h +++ b/test/unit/SceneDiffer.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/TestIOSystem.h b/test/unit/TestIOSystem.h index f984baa13..5749df45b 100644 --- a/test/unit/TestIOSystem.h +++ b/test/unit/TestIOSystem.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/test/unit/TestModelFactory.h b/test/unit/TestModelFactory.h index 6afbe5685..f1ef1701f 100644 --- a/test/unit/TestModelFactory.h +++ b/test/unit/TestModelFactory.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/UTLogStream.h b/test/unit/UTLogStream.h index 6e24fc5ed..e679249df 100644 --- a/test/unit/UTLogStream.h +++ b/test/unit/UTLogStream.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/test/unit/ut3DImportExport.cpp b/test/unit/ut3DImportExport.cpp index 1268fa360..a3a3197cc 100644 --- a/test/unit/ut3DImportExport.cpp +++ b/test/unit/ut3DImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/ut3DSImportExport.cpp b/test/unit/ut3DSImportExport.cpp index 0f91e0f7d..edec1d793 100644 --- a/test/unit/ut3DSImportExport.cpp +++ b/test/unit/ut3DSImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utACImportExport.cpp b/test/unit/utACImportExport.cpp index 937c0afb4..192de16a0 100644 --- a/test/unit/utACImportExport.cpp +++ b/test/unit/utACImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utAMFImportExport.cpp b/test/unit/utAMFImportExport.cpp index 332d5b929..dc2c9b99b 100644 --- a/test/unit/utAMFImportExport.cpp +++ b/test/unit/utAMFImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utASEImportExport.cpp b/test/unit/utASEImportExport.cpp index 28c498dca..28168de7d 100644 --- a/test/unit/utASEImportExport.cpp +++ b/test/unit/utASEImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utAnim.cpp b/test/unit/utAnim.cpp index 40c840d7e..7d4cff7d1 100644 --- a/test/unit/utAnim.cpp +++ b/test/unit/utAnim.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/test/unit/utAssbinImportExport.cpp b/test/unit/utAssbinImportExport.cpp index bbfb9421b..6def04796 100644 --- a/test/unit/utAssbinImportExport.cpp +++ b/test/unit/utAssbinImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utB3DImportExport.cpp b/test/unit/utB3DImportExport.cpp index 6795f8cba..d51ca51a6 100644 --- a/test/unit/utB3DImportExport.cpp +++ b/test/unit/utB3DImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utBVHImportExport.cpp b/test/unit/utBVHImportExport.cpp index eebfe1439..c4ed43cf8 100644 --- a/test/unit/utBVHImportExport.cpp +++ b/test/unit/utBVHImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utBatchLoader.cpp b/test/unit/utBatchLoader.cpp index ce95727ee..d38f83b35 100644 --- a/test/unit/utBatchLoader.cpp +++ b/test/unit/utBatchLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utBlendImportAreaLight.cpp b/test/unit/utBlendImportAreaLight.cpp index c2f6c0be3..a259294aa 100644 --- a/test/unit/utBlendImportAreaLight.cpp +++ b/test/unit/utBlendImportAreaLight.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utBlendImportMaterials.cpp b/test/unit/utBlendImportMaterials.cpp index f36ffdb18..cefacbe27 100644 --- a/test/unit/utBlendImportMaterials.cpp +++ b/test/unit/utBlendImportMaterials.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utBlenderImportExport.cpp b/test/unit/utBlenderImportExport.cpp index 5634b33a8..b2d268497 100644 --- a/test/unit/utBlenderImportExport.cpp +++ b/test/unit/utBlenderImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utBlenderIntermediate.cpp b/test/unit/utBlenderIntermediate.cpp index 55490e613..c1b53bbfd 100644 --- a/test/unit/utBlenderIntermediate.cpp +++ b/test/unit/utBlenderIntermediate.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utBlenderWork.cpp b/test/unit/utBlenderWork.cpp index a17764673..65fefde28 100644 --- a/test/unit/utBlenderWork.cpp +++ b/test/unit/utBlenderWork.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utCSMImportExport.cpp b/test/unit/utCSMImportExport.cpp index 4da51f089..7f6ae0f4e 100644 --- a/test/unit/utCSMImportExport.cpp +++ b/test/unit/utCSMImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utColladaExportCamera.cpp b/test/unit/utColladaExportCamera.cpp index 3219dbf0c..3c7412e0b 100644 --- a/test/unit/utColladaExportCamera.cpp +++ b/test/unit/utColladaExportCamera.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utColladaExportLight.cpp b/test/unit/utColladaExportLight.cpp index 71f404c29..502cecf3a 100644 --- a/test/unit/utColladaExportLight.cpp +++ b/test/unit/utColladaExportLight.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utColladaImportExport.cpp b/test/unit/utColladaImportExport.cpp index c7ad6f906..78a74d973 100644 --- a/test/unit/utColladaImportExport.cpp +++ b/test/unit/utColladaImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utD3MFImportExport.cpp b/test/unit/utD3MFImportExport.cpp index c5fdd003b..9d97f0f19 100644 --- a/test/unit/utD3MFImportExport.cpp +++ b/test/unit/utD3MFImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utDXFImporterExporter.cpp b/test/unit/utDXFImporterExporter.cpp index e0e764ea6..af57ffc79 100644 --- a/test/unit/utDXFImporterExporter.cpp +++ b/test/unit/utDXFImporterExporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utDefaultIOStream.cpp b/test/unit/utDefaultIOStream.cpp index cf51ed56a..bfc82a620 100644 --- a/test/unit/utDefaultIOStream.cpp +++ b/test/unit/utDefaultIOStream.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utFBXImporterExporter.cpp b/test/unit/utFBXImporterExporter.cpp index 1d6cdf883..5aca810a0 100644 --- a/test/unit/utFBXImporterExporter.cpp +++ b/test/unit/utFBXImporterExporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utFastAtof.cpp b/test/unit/utFastAtof.cpp index 10284a1de..ef1e72202 100644 --- a/test/unit/utFastAtof.cpp +++ b/test/unit/utFastAtof.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utFindDegenerates.cpp b/test/unit/utFindDegenerates.cpp index 5fd016b2c..d6ef803fa 100644 --- a/test/unit/utFindDegenerates.cpp +++ b/test/unit/utFindDegenerates.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utFindInvalidData.cpp b/test/unit/utFindInvalidData.cpp index 2313555b8..953c6728c 100644 --- a/test/unit/utFindInvalidData.cpp +++ b/test/unit/utFindInvalidData.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utFixInfacingNormals.cpp b/test/unit/utFixInfacingNormals.cpp index 742b12013..40b962dcb 100644 --- a/test/unit/utFixInfacingNormals.cpp +++ b/test/unit/utFixInfacingNormals.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utGenNormals.cpp b/test/unit/utGenNormals.cpp index 253d76742..65ab7c833 100644 --- a/test/unit/utGenNormals.cpp +++ b/test/unit/utGenNormals.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utHMPImportExport.cpp b/test/unit/utHMPImportExport.cpp index 1e1a4bcd2..35f4583aa 100644 --- a/test/unit/utHMPImportExport.cpp +++ b/test/unit/utHMPImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utIFCImportExport.cpp b/test/unit/utIFCImportExport.cpp index 01132435b..3f7cf7c8c 100644 --- a/test/unit/utIFCImportExport.cpp +++ b/test/unit/utIFCImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utIOStreamBuffer.cpp b/test/unit/utIOStreamBuffer.cpp index 41575fa59..6c6153135 100644 --- a/test/unit/utIOStreamBuffer.cpp +++ b/test/unit/utIOStreamBuffer.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utIOSystem.cpp b/test/unit/utIOSystem.cpp index c5c02bd45..80165fe79 100644 --- a/test/unit/utIOSystem.cpp +++ b/test/unit/utIOSystem.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utImporter.cpp b/test/unit/utImporter.cpp index b76c96d2a..3e88e3ff4 100644 --- a/test/unit/utImporter.cpp +++ b/test/unit/utImporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utImproveCacheLocality.cpp b/test/unit/utImproveCacheLocality.cpp index 01f99ebb9..8564bb01d 100644 --- a/test/unit/utImproveCacheLocality.cpp +++ b/test/unit/utImproveCacheLocality.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utIssues.cpp b/test/unit/utIssues.cpp index e526c2b82..6a974d7b9 100644 --- a/test/unit/utIssues.cpp +++ b/test/unit/utIssues.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utJoinVertices.cpp b/test/unit/utJoinVertices.cpp index 522cec4af..067c0558c 100644 --- a/test/unit/utJoinVertices.cpp +++ b/test/unit/utJoinVertices.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utLWOImportExport.cpp b/test/unit/utLWOImportExport.cpp index 7e03ee2e4..c8655b664 100644 --- a/test/unit/utLWOImportExport.cpp +++ b/test/unit/utLWOImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utLWSImportExport.cpp b/test/unit/utLWSImportExport.cpp index e34cfc90e..b04424b48 100644 --- a/test/unit/utLWSImportExport.cpp +++ b/test/unit/utLWSImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utLimitBoneWeights.cpp b/test/unit/utLimitBoneWeights.cpp index 1ce1cff1b..48da66df0 100644 --- a/test/unit/utLimitBoneWeights.cpp +++ b/test/unit/utLimitBoneWeights.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utMDCImportExport.cpp b/test/unit/utMDCImportExport.cpp index 19b8e68d2..30a4cfad1 100644 --- a/test/unit/utMDCImportExport.cpp +++ b/test/unit/utMDCImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utMaterialSystem.cpp b/test/unit/utMaterialSystem.cpp index 55ee6e2a0..c2a9b520b 100644 --- a/test/unit/utMaterialSystem.cpp +++ b/test/unit/utMaterialSystem.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utMatrix3x3.cpp b/test/unit/utMatrix3x3.cpp index bc15f780d..bff8ca1cd 100644 --- a/test/unit/utMatrix3x3.cpp +++ b/test/unit/utMatrix3x3.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utMatrix4x4.cpp b/test/unit/utMatrix4x4.cpp index b11f0b43d..e94bf500c 100644 --- a/test/unit/utMatrix4x4.cpp +++ b/test/unit/utMatrix4x4.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utMetadata.cpp b/test/unit/utMetadata.cpp index c2cd6e1ef..64b7dfe4c 100644 --- a/test/unit/utMetadata.cpp +++ b/test/unit/utMetadata.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utObjImportExport.cpp b/test/unit/utObjImportExport.cpp index f0b20fb7f..916f4713c 100644 --- a/test/unit/utObjImportExport.cpp +++ b/test/unit/utObjImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utObjTools.cpp b/test/unit/utObjTools.cpp index 6604dfd59..e08b5de79 100644 --- a/test/unit/utObjTools.cpp +++ b/test/unit/utObjTools.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utOpenGEXImportExport.cpp b/test/unit/utOpenGEXImportExport.cpp index 313a7210e..4e154f50f 100644 --- a/test/unit/utOpenGEXImportExport.cpp +++ b/test/unit/utOpenGEXImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utPLYImportExport.cpp b/test/unit/utPLYImportExport.cpp index 540996b21..bb8ba64d9 100644 --- a/test/unit/utPLYImportExport.cpp +++ b/test/unit/utPLYImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/test/unit/utPretransformVertices.cpp b/test/unit/utPretransformVertices.cpp index d8f7de165..0bf6245c6 100644 --- a/test/unit/utPretransformVertices.cpp +++ b/test/unit/utPretransformVertices.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utProfiler.cpp b/test/unit/utProfiler.cpp index 49c9a855c..b86f1952c 100644 --- a/test/unit/utProfiler.cpp +++ b/test/unit/utProfiler.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utQ3DImportExport.cpp b/test/unit/utQ3DImportExport.cpp index 6f840cfc9..51fa4b70a 100644 --- a/test/unit/utQ3DImportExport.cpp +++ b/test/unit/utQ3DImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utRemoveComments.cpp b/test/unit/utRemoveComments.cpp index e236b1d30..cd3175f5a 100644 --- a/test/unit/utRemoveComments.cpp +++ b/test/unit/utRemoveComments.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utRemoveComponent.cpp b/test/unit/utRemoveComponent.cpp index 5fb9656d1..1b13989dd 100644 --- a/test/unit/utRemoveComponent.cpp +++ b/test/unit/utRemoveComponent.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utRemoveRedundantMaterials.cpp b/test/unit/utRemoveRedundantMaterials.cpp index 312302846..c3497595b 100644 --- a/test/unit/utRemoveRedundantMaterials.cpp +++ b/test/unit/utRemoveRedundantMaterials.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utRemoveVCProcess.cpp b/test/unit/utRemoveVCProcess.cpp index 8c726de4a..1eedf9842 100644 --- a/test/unit/utRemoveVCProcess.cpp +++ b/test/unit/utRemoveVCProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utSIBImporter.cpp b/test/unit/utSIBImporter.cpp index da51b14af..4d6a09783 100644 --- a/test/unit/utSIBImporter.cpp +++ b/test/unit/utSIBImporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utSMDImportExport.cpp b/test/unit/utSMDImportExport.cpp index ea315db83..500277099 100644 --- a/test/unit/utSMDImportExport.cpp +++ b/test/unit/utSMDImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utSTLImportExport.cpp b/test/unit/utSTLImportExport.cpp index 77602a882..b5518de23 100644 --- a/test/unit/utSTLImportExport.cpp +++ b/test/unit/utSTLImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utScaleProcess.cpp b/test/unit/utScaleProcess.cpp index e01f822b9..13a184249 100644 --- a/test/unit/utScaleProcess.cpp +++ b/test/unit/utScaleProcess.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utSceneCombiner.cpp b/test/unit/utSceneCombiner.cpp index 3e7ba0146..e9be598e1 100644 --- a/test/unit/utSceneCombiner.cpp +++ b/test/unit/utSceneCombiner.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utScenePreprocessor.cpp b/test/unit/utScenePreprocessor.cpp index 788ee1d34..5e1af334c 100644 --- a/test/unit/utScenePreprocessor.cpp +++ b/test/unit/utScenePreprocessor.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utSharedPPData.cpp b/test/unit/utSharedPPData.cpp index 94f2a5678..380235c58 100644 --- a/test/unit/utSharedPPData.cpp +++ b/test/unit/utSharedPPData.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utSimd.cpp b/test/unit/utSimd.cpp index 33358c0da..e7779a0ee 100644 --- a/test/unit/utSimd.cpp +++ b/test/unit/utSimd.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/test/unit/utSortByPType.cpp b/test/unit/utSortByPType.cpp index 7affd56f1..4d9240c93 100644 --- a/test/unit/utSortByPType.cpp +++ b/test/unit/utSortByPType.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utSplitLargeMeshes.cpp b/test/unit/utSplitLargeMeshes.cpp index 496049d65..fced5df4b 100644 --- a/test/unit/utSplitLargeMeshes.cpp +++ b/test/unit/utSplitLargeMeshes.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utStringUtils.cpp b/test/unit/utStringUtils.cpp index ab053fd6f..3791e8622 100644 --- a/test/unit/utStringUtils.cpp +++ b/test/unit/utStringUtils.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utTargetAnimation.cpp b/test/unit/utTargetAnimation.cpp index 6bbc1f418..bbcacd2cb 100644 --- a/test/unit/utTargetAnimation.cpp +++ b/test/unit/utTargetAnimation.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utTextureTransform.cpp b/test/unit/utTextureTransform.cpp index 6bbc1f418..bbcacd2cb 100644 --- a/test/unit/utTextureTransform.cpp +++ b/test/unit/utTextureTransform.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utTriangulate.cpp b/test/unit/utTriangulate.cpp index e421d40b1..8c42000cd 100644 --- a/test/unit/utTriangulate.cpp +++ b/test/unit/utTriangulate.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utTypes.cpp b/test/unit/utTypes.cpp index a67154f7c..6289c75e7 100644 --- a/test/unit/utTypes.cpp +++ b/test/unit/utTypes.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utVector3.cpp b/test/unit/utVector3.cpp index 387b4614d..adeb70615 100644 --- a/test/unit/utVector3.cpp +++ b/test/unit/utVector3.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/test/unit/utVersion.cpp b/test/unit/utVersion.cpp index 4886377f8..5cfc91ccd 100644 --- a/test/unit/utVersion.cpp +++ b/test/unit/utVersion.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utVertexTriangleAdjacency.cpp b/test/unit/utVertexTriangleAdjacency.cpp index dc109f519..f15b0d21f 100644 --- a/test/unit/utVertexTriangleAdjacency.cpp +++ b/test/unit/utVertexTriangleAdjacency.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utX3DImportExport.cpp b/test/unit/utX3DImportExport.cpp index aeee72318..2aa0ae3cc 100644 --- a/test/unit/utX3DImportExport.cpp +++ b/test/unit/utX3DImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utXImporterExporter.cpp b/test/unit/utXImporterExporter.cpp index d4c742e6f..53e156bcc 100644 --- a/test/unit/utXImporterExporter.cpp +++ b/test/unit/utXImporterExporter.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utglTF2ImportExport.cpp b/test/unit/utglTF2ImportExport.cpp index 08fa9d989..3ad02645d 100644 --- a/test/unit/utglTF2ImportExport.cpp +++ b/test/unit/utglTF2ImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/test/unit/utglTFImportExport.cpp b/test/unit/utglTFImportExport.cpp index 17aa94d31..562cb05b9 100644 --- a/test/unit/utglTFImportExport.cpp +++ b/test/unit/utglTFImportExport.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/tools/assimp_cmd/CMakeLists.txt b/tools/assimp_cmd/CMakeLists.txt index ae38b5f11..5ea4e1a24 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-2018, assimp team +# Copyright (c) 2006-2019, assimp team # All rights reserved. diff --git a/tools/assimp_cmd/CompareDump.cpp b/tools/assimp_cmd/CompareDump.cpp index d8304f020..0ea0893f9 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-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/tools/assimp_cmd/Export.cpp b/tools/assimp_cmd/Export.cpp index 03f896822..e29936e38 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-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/tools/assimp_cmd/ImageExtractor.cpp b/tools/assimp_cmd/ImageExtractor.cpp index ce472dcb3..f9d55b8e8 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-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/tools/assimp_cmd/Info.cpp b/tools/assimp_cmd/Info.cpp index 050dbf989..cb7ac86cf 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-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/tools/assimp_cmd/Main.cpp b/tools/assimp_cmd/Main.cpp index 2a18bf33a..af372582c 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-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/tools/assimp_cmd/WriteDumb.cpp b/tools/assimp_cmd/WriteDumb.cpp index b05adf249..0bcd5321c 100644 --- a/tools/assimp_cmd/WriteDumb.cpp +++ b/tools/assimp_cmd/WriteDumb.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/tools/assimp_view/AnimEvaluator.cpp b/tools/assimp_view/AnimEvaluator.cpp index 94c581df4..23e3c0e7d 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-2018, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/tools/assimp_view/CMakeLists.txt b/tools/assimp_view/CMakeLists.txt index f75937eff..f5365e11a 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-2018, assimp team +# Copyright (c) 2006-2019, assimp team # All rights reserved. diff --git a/tools/assimp_view/assimp_view.cpp b/tools/assimp_view/assimp_view.cpp index 746a4836f..d96e5ac97 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-2018, assimp team +Copyright (c) 2006-2019, assimp team diff --git a/tools/assimp_view/assimp_view.h b/tools/assimp_view/assimp_view.h index 9317495c1..bed4c64c3 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-2018, assimp team +Copyright (c) 2006-2019, assimp team From de02fb212962cae39966e92466d17145773166fa Mon Sep 17 00:00:00 2001 From: kimkulling Date: Wed, 30 Jan 2019 16:07:40 +0100 Subject: [PATCH 76/78] Fix review findings. --- tools/assimp_view/AnimEvaluator.cpp | 81 ++-- tools/assimp_view/AnimEvaluator.h | 32 +- tools/assimp_view/Background.cpp | 2 +- tools/assimp_view/Display.cpp | 2 +- tools/assimp_view/HelpDialog.cpp | 49 +- tools/assimp_view/Input.cpp | 2 +- tools/assimp_view/LogDisplay.cpp | 74 ++- tools/assimp_view/LogWindow.cpp | 61 +-- tools/assimp_view/Material.cpp | 3 +- tools/assimp_view/MeshRenderer.cpp | 8 +- tools/assimp_view/MessageProc.cpp | 685 ++++++++++------------------ tools/assimp_view/Normals.cpp | 60 +-- tools/assimp_view/SceneAnimator.cpp | 102 ++--- tools/assimp_view/SceneAnimator.h | 32 +- tools/assimp_view/Shaders.cpp | 2 +- 15 files changed, 464 insertions(+), 731 deletions(-) diff --git a/tools/assimp_view/AnimEvaluator.cpp b/tools/assimp_view/AnimEvaluator.cpp index 23e3c0e7d..9d9481a77 100644 --- a/tools/assimp_view/AnimEvaluator.cpp +++ b/tools/assimp_view/AnimEvaluator.cpp @@ -47,17 +47,21 @@ using namespace AssimpView; // ------------------------------------------------------------------------------------------------ // Constructor on a given animation. -AnimEvaluator::AnimEvaluator( const aiAnimation* pAnim) -{ - mAnim = pAnim; - mLastTime = 0.0; +AnimEvaluator::AnimEvaluator( const aiAnimation *pAnim ) +: mAnim(pAnim) +, mLastTime(0.0) { mLastPositions.resize( pAnim->mNumChannels, std::make_tuple( 0, 0, 0)); } +// ------------------------------------------------------------------------------------------------ +// Destructor. +AnimEvaluator::~AnimEvaluator() { + // empty +} + // ------------------------------------------------------------------------------------------------ // Evaluates the animation tracks for a given time stamp. -void AnimEvaluator::Evaluate( double pTime) -{ +void AnimEvaluator::Evaluate( double pTime ) { // extract ticks per second. Assume default value if not given double ticksPerSecond = mAnim->mTicksPerSecond != 0.0 ? mAnim->mTicksPerSecond : 25.0; // every following time calculation happens in ticks @@ -65,29 +69,29 @@ void AnimEvaluator::Evaluate( double pTime) // map into anim's duration double time = 0.0f; - if( mAnim->mDuration > 0.0) - time = fmod( pTime, mAnim->mDuration); + if (mAnim->mDuration > 0.0) { + time = fmod(pTime, mAnim->mDuration); + } - if( mTransforms.size() != mAnim->mNumChannels) - mTransforms.resize( mAnim->mNumChannels); + if (mTransforms.size() != mAnim->mNumChannels) { + mTransforms.resize(mAnim->mNumChannels); + } // calculate the transformations for each animation channel - for( unsigned int a = 0; a < mAnim->mNumChannels; a++) - { + for( unsigned int a = 0; a < mAnim->mNumChannels; ++a ) { const aiNodeAnim* channel = mAnim->mChannels[a]; // ******** Position ***** aiVector3D presentPosition( 0, 0, 0); - if( channel->mNumPositionKeys > 0) - { + if( channel->mNumPositionKeys > 0) { // Look for present frame number. Search from last position if time is after the last time, else from beginning // Should be much quicker than always looking from start for the average use case. unsigned int frame = (time >= mLastTime) ? std::get<0>(mLastPositions[a]) : 0; - while( frame < channel->mNumPositionKeys - 1) - { - if( time < channel->mPositionKeys[frame+1].mTime) + while( frame < channel->mNumPositionKeys - 1) { + if (time < channel->mPositionKeys[frame + 1].mTime) { break; - frame++; + } + ++frame; } // interpolate between this frame's value and next frame's value @@ -95,14 +99,13 @@ void AnimEvaluator::Evaluate( double pTime) const aiVectorKey& key = channel->mPositionKeys[frame]; const aiVectorKey& nextKey = channel->mPositionKeys[nextFrame]; double diffTime = nextKey.mTime - key.mTime; - if( diffTime < 0.0) + if (diffTime < 0.0) { diffTime += mAnim->mDuration; - if( diffTime > 0) - { + } + if( diffTime > 0) { float factor = float( (time - key.mTime) / diffTime); presentPosition = key.mValue + (nextKey.mValue - key.mValue) * factor; - } else - { + } else { presentPosition = key.mValue; } @@ -111,14 +114,13 @@ void AnimEvaluator::Evaluate( double pTime) // ******** Rotation ********* aiQuaternion presentRotation( 1, 0, 0, 0); - if( channel->mNumRotationKeys > 0) - { + if( channel->mNumRotationKeys > 0) { unsigned int frame = (time >= mLastTime) ? std::get<1>(mLastPositions[a]) : 0; - while( frame < channel->mNumRotationKeys - 1) - { - if( time < channel->mRotationKeys[frame+1].mTime) + while( frame < channel->mNumRotationKeys - 1) { + if (time < channel->mRotationKeys[frame + 1].mTime) { break; - frame++; + } + ++frame; } // interpolate between this frame's value and next frame's value @@ -126,14 +128,13 @@ void AnimEvaluator::Evaluate( double pTime) const aiQuatKey& key = channel->mRotationKeys[frame]; const aiQuatKey& nextKey = channel->mRotationKeys[nextFrame]; double diffTime = nextKey.mTime - key.mTime; - if( diffTime < 0.0) + if (diffTime < 0.0) { diffTime += mAnim->mDuration; - if( diffTime > 0) - { + } + if( diffTime > 0) { float factor = float( (time - key.mTime) / diffTime); aiQuaternion::Interpolate( presentRotation, key.mValue, nextKey.mValue, factor); - } else - { + } else { presentRotation = key.mValue; } @@ -142,14 +143,13 @@ void AnimEvaluator::Evaluate( double pTime) // ******** Scaling ********** aiVector3D presentScaling( 1, 1, 1); - if( channel->mNumScalingKeys > 0) - { + if( channel->mNumScalingKeys > 0) { unsigned int frame = (time >= mLastTime) ? std::get<2>(mLastPositions[a]) : 0; - while( frame < channel->mNumScalingKeys - 1) - { - if( time < channel->mScalingKeys[frame+1].mTime) + while( frame < channel->mNumScalingKeys - 1) { + if (time < channel->mScalingKeys[frame + 1].mTime) { break; - frame++; + } + ++frame; } // TODO: (thom) interpolation maybe? This time maybe even logarithmic, not linear @@ -164,7 +164,6 @@ void AnimEvaluator::Evaluate( double pTime) mat.a2 *= presentScaling.y; mat.b2 *= presentScaling.y; mat.c2 *= presentScaling.y; mat.a3 *= presentScaling.z; mat.b3 *= presentScaling.z; mat.c3 *= presentScaling.z; mat.a4 = presentPosition.x; mat.b4 = presentPosition.y; mat.c4 = presentPosition.z; - //mat.Transpose(); } mLastTime = time; diff --git a/tools/assimp_view/AnimEvaluator.h b/tools/assimp_view/AnimEvaluator.h index 417a02935..1b4d54186 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-2012, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. @@ -46,22 +46,23 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -namespace AssimpView -{ +namespace AssimpView { -/** Calculates transformations for a given timestamp from a set of animation tracks. Not directly useful, - * better use the AnimPlayer class. +/** + * @brief Calculates transformations for a given timestamp from a set of animation tracks. Not directly useful, + * better use the AnimPlayer class. */ -class AnimEvaluator -{ +class AnimEvaluator { public: - /** Constructor on a given animation. The animation is fixed throughout the lifetime of - * the object. - * @param pAnim The animation to calculate poses for. Ownership of the animation object stays - * at the caller, the evaluator just keeps a reference to it as long as it persists. - */ + /// @brief Constructor on a given animation. The animation is fixed throughout the lifetime of + /// the object. + /// @param pAnim The animation to calculate poses for. Ownership of the animation object stays + /// at the caller, the evaluator just keeps a reference to it as long as it persists. AnimEvaluator( const aiAnimation* pAnim); + /// @brief The class destructor. + ~AnimEvaluator(); + /** Evaluates the animation tracks for a given time stamp. The calculated pose can be retrieved as a * array of transformation matrices afterwards by calling GetTransformations(). * @param pTime The time for which you want to evaluate the animation, in seconds. Will be mapped into the animation cycle, so @@ -74,16 +75,9 @@ public: const std::vector& GetTransformations() const { return mTransforms; } protected: - /** The animation we're working on */ const aiAnimation* mAnim; - - /** At which frame the last evaluation happened for each channel. - * Useful to quickly find the corresponding frame for slightly increased time stamps - */ double mLastTime; std::vector > mLastPositions; - - /** The array to store the transformations results of the evaluation */ std::vector mTransforms; }; diff --git a/tools/assimp_view/Background.cpp b/tools/assimp_view/Background.cpp index 14bf5b90d..b356a245b 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-2015, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/tools/assimp_view/Display.cpp b/tools/assimp_view/Display.cpp index 041ab34c5..196e8a2ac 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-2015, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/tools/assimp_view/HelpDialog.cpp b/tools/assimp_view/HelpDialog.cpp index 7b2ebf7b6..1a9f08f5f 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-2015, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. @@ -48,14 +48,10 @@ namespace AssimpView { //------------------------------------------------------------------------------- // Message procedure for the help dialog //------------------------------------------------------------------------------- -INT_PTR CALLBACK HelpDialogProc(HWND hwndDlg,UINT uMsg, - WPARAM wParam,LPARAM lParam) - { - (void)lParam; - switch (uMsg) - { +INT_PTR CALLBACK HelpDialogProc(HWND hwndDlg,UINT uMsg, WPARAM wParam,LPARAM ) { + switch (uMsg) { case WM_INITDIALOG: - { + { // load the help file ... HRSRC res = FindResource(NULL,MAKEINTRESOURCE(IDR_TEXT1),"TEXT"); HGLOBAL hg = LoadResource(NULL,res); @@ -70,39 +66,38 @@ INT_PTR CALLBACK HelpDialogProc(HWND hwndDlg,UINT uMsg, FreeResource(hg); return TRUE; - } + } case WM_CLOSE: EndDialog(hwndDlg,0); return TRUE; case WM_COMMAND: - - if (IDOK == LOWORD(wParam)) - { + if (IDOK == LOWORD(wParam)) { EndDialog(hwndDlg,0); return TRUE; - } + } case WM_PAINT: { - PAINTSTRUCT sPaint; - HDC hdc = BeginPaint(hwndDlg,&sPaint); + PAINTSTRUCT sPaint; + HDC hdc = BeginPaint(hwndDlg,&sPaint); - HBRUSH hBrush = CreateSolidBrush(RGB(0xFF,0xFF,0xFF)); + HBRUSH hBrush = CreateSolidBrush(RGB(0xFF,0xFF,0xFF)); - RECT sRect; - sRect.left = 0; - sRect.top = 26; - sRect.right = 1000; - sRect.bottom = 507; - FillRect(hdc, &sRect, hBrush); + RECT sRect; + sRect.left = 0; + sRect.top = 26; + sRect.right = 1000; + sRect.bottom = 507; + FillRect(hdc, &sRect, hBrush); - EndPaint(hwndDlg,&sPaint); - return TRUE; + EndPaint(hwndDlg,&sPaint); + return TRUE; } - }; - return FALSE; } -}; \ No newline at end of file + return FALSE; +} + +} diff --git a/tools/assimp_view/Input.cpp b/tools/assimp_view/Input.cpp index 7a9582fb2..56007bdf1 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-2015, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. diff --git a/tools/assimp_view/LogDisplay.cpp b/tools/assimp_view/LogDisplay.cpp index bf0c190b6..d24b9bf20 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-2015, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. @@ -46,32 +46,26 @@ namespace AssimpView { CLogDisplay CLogDisplay::s_cInstance; //------------------------------------------------------------------------------- -void CLogDisplay::AddEntry(const std::string& szText, - const D3DCOLOR clrColor) - { +void CLogDisplay::AddEntry(const std::string& szText, const D3DCOLOR clrColor) { SEntry sNew; sNew.clrColor = clrColor; sNew.szText = szText; sNew.dwStartTicks = (DWORD)GetTickCount(); this->asEntries.push_back(sNew); - } +} //------------------------------------------------------------------------------- -void CLogDisplay::ReleaseNativeResource() - { - if (this->piFont) - { +void CLogDisplay::ReleaseNativeResource() { + if (this->piFont) { this->piFont->Release(); - this->piFont = NULL; - } + this->piFont = nullptr; } +} //------------------------------------------------------------------------------- -void CLogDisplay::RecreateNativeResource() - { - if (!this->piFont) - { +void CLogDisplay::RecreateNativeResource() { + if (!this->piFont) { if (FAILED(D3DXCreateFont(g_piDevice, 16, //Font height 0, //Font width @@ -84,20 +78,17 @@ void CLogDisplay::RecreateNativeResource() 5, //Quality DEFAULT_PITCH|FF_DONTCARE, //PitchAndFamily "Verdana", //pFacename, - &this->piFont))) - { + &this->piFont))) { CLogDisplay::Instance().AddEntry("Unable to load font",D3DCOLOR_ARGB(0xFF,0xFF,0,0)); - this->piFont = NULL; + this->piFont = nullptr; return; - } } - return; } +} //------------------------------------------------------------------------------- -void CLogDisplay::OnRender() - { +void CLogDisplay::OnRender() { DWORD dwTick = (DWORD) GetTickCount(); DWORD dwLimit = dwTick - 8000; DWORD dwLimit2 = dwLimit + 3000; @@ -117,9 +108,8 @@ void CLogDisplay::OnRender() sRect.bottom = sWndRect.bottom; // if no asset is loaded draw a "no asset loaded" text in the center - if (!g_pcAsset) - { - const char* szText = "Nothing to display ... \r\nTry [Viewer | Open asset] to load an asset"; + if (!g_pcAsset) { + const char* szText = "Nothing to display ... \r\nTry [Viewer | Open asset] to load an asset"; // shadow RECT sCopy; @@ -151,38 +141,34 @@ void CLogDisplay::OnRender() // text this->piFont->DrawText(NULL,szText , -1,&sWndRect,DT_CENTER | DT_VCENTER,D3DCOLOR_ARGB(0xFF,0xFF,0xFF,0xFF)); - } + } // update all elements in the queue and render them for (std::list::iterator - i = this->asEntries.begin(); - i != this->asEntries.end();++i,++iCnt) - { - if ((*i).dwStartTicks < dwLimit) - { + i = this->asEntries.begin(); + i != this->asEntries.end();++i,++iCnt) { + if ((*i).dwStartTicks < dwLimit) { i = this->asEntries.erase(i); - if(i == this->asEntries.end())break; + if (i == this->asEntries.end()) { + break; } - else if (NULL != this->piFont) - { + } else if (nullptr != this->piFont) { float fAlpha = 1.0f; - if ((*i).dwStartTicks <= dwLimit2) - { + if ((*i).dwStartTicks <= dwLimit2) { // linearly interpolate to create the fade out effect fAlpha = 1.0f - (float)(dwLimit2 - (*i).dwStartTicks) / 3000.0f; - } + } D3DCOLOR& clrColor = (*i).clrColor; clrColor &= ~(0xFFu << 24); clrColor |= (((unsigned char)(fAlpha * 255.0f)) & 0xFFu) << 24; const char* szText = (*i).szText.c_str(); - if (sRect.top + 30 > sWndRect.bottom) - { + if (sRect.top + 30 > sWndRect.bottom) { // end of window. send a special message szText = "... too many errors"; clrColor = D3DCOLOR_ARGB(0xFF,0xFF,100,0x0); - } + } // draw the black shadow RECT sCopy; @@ -225,9 +211,11 @@ void CLogDisplay::OnRender() sRect.top += iPX; sRect.bottom += iPX; - if (szText != (*i).szText.c_str())break; + if (szText != (*i).szText.c_str()) { + break; } } - return; } -}; \ No newline at end of file +} + +} diff --git a/tools/assimp_view/LogWindow.cpp b/tools/assimp_view/LogWindow.cpp index dba70ee71..ca9b88f95 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-2015, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. @@ -101,13 +101,11 @@ INT_PTR CALLBACK LogDialogProc(HWND hwndDlg,UINT uMsg, } //------------------------------------------------------------------------------- -void CLogWindow::Init () -{ +void CLogWindow::Init () { this->hwnd = ::CreateDialog(g_hInstance,MAKEINTRESOURCE(IDD_LOGVIEW), NULL,&LogDialogProc); - if (!this->hwnd) - { + if (!this->hwnd) { CLogDisplay::Instance().AddEntry("[ERROR] Unable to create logger window", D3DCOLOR_ARGB(0xFF,0,0xFF,0)); } @@ -116,11 +114,10 @@ void CLogWindow::Init () this->szText = AI_VIEW_RTF_LOG_HEADER;; this->szPlainText = ""; } + //------------------------------------------------------------------------------- -void CLogWindow::Show() -{ - if (this->hwnd) - { +void CLogWindow::Show() { + if (this->hwnd) { ShowWindow(this->hwnd,SW_SHOW); this->bIsVisible = true; @@ -128,24 +125,23 @@ void CLogWindow::Show() this->Update(); } } + //------------------------------------------------------------------------------- -void CMyLogStream::write(const char* message) -{ +void CMyLogStream::write(const char* message) { CLogWindow::Instance().WriteLine(message); } + //------------------------------------------------------------------------------- -void CLogWindow::Clear() -{ +void CLogWindow::Clear() { this->szText = AI_VIEW_RTF_LOG_HEADER;; this->szPlainText = ""; this->Update(); } + //------------------------------------------------------------------------------- -void CLogWindow::Update() -{ - if (this->bIsVisible) - { +void CLogWindow::Update() { + if (this->bIsVisible) { SETTEXTEX sInfo; sInfo.flags = ST_DEFAULT; sInfo.codepage = CP_ACP; @@ -154,20 +150,16 @@ void CLogWindow::Update() EM_SETTEXTEX,(WPARAM)&sInfo,( LPARAM)this->szText.c_str()); } } + //------------------------------------------------------------------------------- -void CLogWindow::Save() -{ +void CLogWindow::Save() { char szFileName[MAX_PATH]; DWORD dwTemp = MAX_PATH; - if(ERROR_SUCCESS != RegQueryValueEx(g_hRegistry,"LogDestination",NULL,NULL, - (BYTE*)szFileName,&dwTemp)) - { + if(ERROR_SUCCESS != RegQueryValueEx(g_hRegistry,"LogDestination",NULL,NULL,(BYTE*)szFileName,&dwTemp)) { // Key was not found. Use C: strcpy(szFileName,""); - } - else - { + } else { // need to remove the file name char* sz = strrchr(szFileName,'\\'); if (!sz) @@ -196,14 +188,13 @@ void CLogWindow::Save() CLogDisplay::Instance().AddEntry("[INFO] The log file has been saved", D3DCOLOR_ARGB(0xFF,0xFF,0xFF,0)); } + //------------------------------------------------------------------------------- -void CLogWindow::WriteLine(const char* message) -{ +void CLogWindow::WriteLine(const char* message) { this->szPlainText.append(message); this->szPlainText.append("\r\n"); - if (0 != this->szText.length()) - { + if (0 != this->szText.length()) { this->szText.resize(this->szText.length()-1); } @@ -231,12 +222,10 @@ void CLogWindow::WriteLine(const char* message) } std::string _message = message; - for (unsigned int i = 0; i < _message.length();++i) - { + for (unsigned int i = 0; i < _message.length();++i) { if ('\\' == _message[i] || '}' == _message[i] || - '{' == _message[i]) - { + '{' == _message[i]) { _message.insert(i++,"\\"); } } @@ -244,8 +233,7 @@ void CLogWindow::WriteLine(const char* message) this->szText.append(_message); this->szText.append("\\par}}"); - if (this->bIsVisible && this->bUpdate) - { + if (this->bIsVisible && this->bUpdate) { SETTEXTEX sInfo; sInfo.flags = ST_DEFAULT; sInfo.codepage = CP_ACP; @@ -253,7 +241,6 @@ void CLogWindow::WriteLine(const char* message) SendDlgItemMessage(this->hwnd,IDC_EDIT1, EM_SETTEXTEX,(WPARAM)&sInfo,( LPARAM)this->szText.c_str()); } - return; } -}; //! AssimpView \ No newline at end of file +} //! AssimpView diff --git a/tools/assimp_view/Material.cpp b/tools/assimp_view/Material.cpp index 1fb13f5a8..2c5316d81 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-2015, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. @@ -136,7 +136,6 @@ extern float g_smoothAngle /*= 80.f*/; extern unsigned int ppsteps, ppstepsdefault; extern bool nopointslines; - CMaterialManager CMaterialManager::s_cInstance; //------------------------------------------------------------------------------- diff --git a/tools/assimp_view/MeshRenderer.cpp b/tools/assimp_view/MeshRenderer.cpp index 834c5a9e2..dfa249735 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-2015, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. @@ -49,8 +49,7 @@ namespace AssimpView { CMeshRenderer CMeshRenderer::s_cInstance; //------------------------------------------------------------------------------- -int CMeshRenderer::DrawUnsorted(unsigned int iIndex) -{ +int CMeshRenderer::DrawUnsorted(unsigned int iIndex) { ai_assert(iIndex < g_pcAsset->pcScene->mNumMeshes); // set vertex and index buffer @@ -77,8 +76,7 @@ int CMeshRenderer::DrawUnsorted(unsigned int iIndex) return 1; } //------------------------------------------------------------------------------- -int CMeshRenderer::DrawSorted(unsigned int iIndex,const aiMatrix4x4& mWorld) -{ +int CMeshRenderer::DrawSorted(unsigned int iIndex,const aiMatrix4x4& mWorld) { ai_assert(iIndex < g_pcAsset->pcScene->mNumMeshes); AssetHelper::MeshHelper* pcHelper = g_pcAsset->apcMeshes[iIndex]; diff --git a/tools/assimp_view/MessageProc.cpp b/tools/assimp_view/MessageProc.cpp index 5a9cfd0ed..f9bcf2e9d 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-2015, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. @@ -47,9 +47,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #ifdef __MINGW32__ -#include +# include #else -#include +# include #endif namespace AssimpView { @@ -92,31 +92,29 @@ void MakeFileAssociations() { GetModuleFileName(NULL,szTemp2,MAX_PATH); sprintf(szTemp,"%s %%1",szTemp2); - HKEY g_hRegistry; + HKEY hRegistry = NULL; aiString list, tmp; aiGetExtensionList(&list); tmp = list; const char* sz = strtok(list.data,";"); - do - { + do { char buf[256]; ai_assert(sz[0] == '*'); sprintf(buf,"Software\\Classes\\%s",sz+1); - RegCreateKeyEx(HKEY_CURRENT_USER,buf,0,NULL,0,KEY_ALL_ACCESS, NULL, &g_hRegistry,NULL); - RegSetValueEx(g_hRegistry,"",0,REG_SZ,(const BYTE*)"ASSIMPVIEW_CLASS",(DWORD)strlen("ASSIMPVIEW_CLASS")+1); - RegCloseKey(g_hRegistry); - } - while ((sz = strtok(NULL,";"))); + RegCreateKeyEx(HKEY_CURRENT_USER,buf,0,NULL,0,KEY_ALL_ACCESS, NULL, &hRegistry,NULL); + RegSetValueEx(hRegistry,"",0,REG_SZ,(const BYTE*)"ASSIMPVIEW_CLASS",(DWORD)strlen("ASSIMPVIEW_CLASS")+1); + RegCloseKey(hRegistry); + } while ((sz = strtok(NULL,";"))); - RegCreateKeyEx(HKEY_CURRENT_USER,"Software\\Classes\\ASSIMPVIEW_CLASS",0,NULL,0,KEY_ALL_ACCESS, NULL, &g_hRegistry,NULL); - RegCloseKey(g_hRegistry); + RegCreateKeyEx(HKEY_CURRENT_USER,"Software\\Classes\\ASSIMPVIEW_CLASS",0,NULL,0,KEY_ALL_ACCESS, NULL, &hRegistry,NULL); + RegCloseKey(hRegistry); - RegCreateKeyEx(HKEY_CURRENT_USER,"Software\\Classes\\ASSIMPVIEW_CLASS\\shell\\open\\command",0,NULL,0,KEY_ALL_ACCESS, NULL, &g_hRegistry,NULL); - RegSetValueEx(g_hRegistry,"",0,REG_SZ,(const BYTE*)szTemp,(DWORD)strlen(szTemp)+1); - RegCloseKey(g_hRegistry); + RegCreateKeyEx(HKEY_CURRENT_USER,"Software\\Classes\\ASSIMPVIEW_CLASS\\shell\\open\\command",0,NULL,0,KEY_ALL_ACCESS, NULL, &hRegistry,NULL); + RegSetValueEx(hRegistry,"",0,REG_SZ,(const BYTE*)szTemp,(DWORD)strlen(szTemp)+1); + RegCloseKey(hRegistry); CLogDisplay::Instance().AddEntry("[OK] File assocations have been registered", D3DCOLOR_ARGB(0xFF,0,0xFF,0)); @@ -124,19 +122,19 @@ void MakeFileAssociations() { CLogDisplay::Instance().AddEntry(tmp.data,D3DCOLOR_ARGB(0xFF,0,0xFF,0)); } - //------------------------------------------------------------------------------- // Handle command line parameters // // The function loads an asset specified on the command line as first argument // Other command line parameters are not handled //------------------------------------------------------------------------------- -void HandleCommandLine(char* p_szCommand) -{ +void HandleCommandLine(char* p_szCommand) { char* sz = p_szCommand; //bool bQuak = false; - if (strlen(sz) < 2)return; + if (strlen(sz) < 2) { + return; + } if (*sz == '\"') { char* sz2 = strrchr(sz,'\"'); @@ -157,8 +155,7 @@ void HandleCommandLine(char* p_szCommand) //------------------------------------------------------------------------------- // Load the light colors from the registry //------------------------------------------------------------------------------- -void LoadLightColors() -{ +void LoadLightColors() { DWORD dwTemp = 4; RegQueryValueEx(g_hRegistry,"LightColor0",NULL,NULL, (BYTE*)&g_avLightColors[0],&dwTemp); RegQueryValueEx(g_hRegistry,"LightColor1",NULL,NULL, (BYTE*)&g_avLightColors[1],&dwTemp); @@ -168,8 +165,7 @@ void LoadLightColors() //------------------------------------------------------------------------------- // Save the light colors to the registry //------------------------------------------------------------------------------- -void SaveLightColors() -{ +void SaveLightColors() { RegSetValueExA(g_hRegistry,"LightColor0",0,REG_DWORD,(const BYTE*)&g_avLightColors[0],4); RegSetValueExA(g_hRegistry,"LightColor1",0,REG_DWORD,(const BYTE*)&g_avLightColors[1],4); RegSetValueExA(g_hRegistry,"LightColor2",0,REG_DWORD,(const BYTE*)&g_avLightColors[2],4); @@ -178,8 +174,7 @@ void SaveLightColors() //------------------------------------------------------------------------------- // Save the checker pattern colors to the registry //------------------------------------------------------------------------------- -void SaveCheckerPatternColors() -{ +void SaveCheckerPatternColors() { // we have it as float4. save it as binary value --. RegSetValueExA(g_hRegistry,"CheckerPattern0",0,REG_BINARY, (const BYTE*)CDisplay::Instance().GetFirstCheckerColor(), @@ -193,8 +188,7 @@ void SaveCheckerPatternColors() //------------------------------------------------------------------------------- // Load the checker pattern colors from the registry //------------------------------------------------------------------------------- -void LoadCheckerPatternColors() -{ +void LoadCheckerPatternColors() { DWORD dwTemp = sizeof(D3DXVECTOR3); RegQueryValueEx(g_hRegistry,"CheckerPattern0",NULL,NULL, (BYTE*) /* jep, this is evil */ CDisplay::Instance().GetFirstCheckerColor(),&dwTemp); @@ -206,8 +200,7 @@ void LoadCheckerPatternColors() //------------------------------------------------------------------------------- // Changed pp setup //------------------------------------------------------------------------------- -void UpdatePPSettings() -{ +void UpdatePPSettings() { DWORD dwValue = ppsteps; RegSetValueExA(g_hRegistry,"PostProcessing",0,REG_DWORD,(const BYTE*)&dwValue,4); UpdateWindow(g_hDlg); @@ -216,8 +209,7 @@ void UpdatePPSettings() //------------------------------------------------------------------------------- // Toggle the "Display Normals" state //------------------------------------------------------------------------------- -void ToggleNormals() -{ +void ToggleNormals() { g_sOptions.bRenderNormals = !g_sOptions.bRenderNormals; // store this in the registry, too @@ -226,97 +218,72 @@ void ToggleNormals() RegSetValueExA(g_hRegistry,"RenderNormals",0,REG_DWORD,(const BYTE*)&dwValue,4); } +static void storeRegKey(bool option, LPCSTR name) { + // store this in the registry, too + DWORD dwValue = 0; + if (option) { + dwValue = 1; + } + RegSetValueExA(g_hRegistry, name, 0, REG_DWORD, (const BYTE*)&dwValue, 4); + +} //------------------------------------------------------------------------------- // Toggle the "AutoRotate" state //------------------------------------------------------------------------------- -void ToggleAutoRotate() -{ +void ToggleAutoRotate() { g_sOptions.bRotate = !g_sOptions.bRotate; - - // store this in the registry, too - DWORD dwValue = 0; - if (g_sOptions.bRotate)dwValue = 1; - RegSetValueExA(g_hRegistry,"AutoRotate",0,REG_DWORD,(const BYTE*)&dwValue,4); + storeRegKey(g_sOptions.bRotate, "AutoRotate"); UpdateWindow(g_hDlg); } //------------------------------------------------------------------------------- // Toggle the "FPS" state //------------------------------------------------------------------------------- -void ToggleFPSView() -{ +void ToggleFPSView() { g_bFPSView = !g_bFPSView; SetupFPSView(); - - // store this in the registry, too - DWORD dwValue = 0; - if (g_bFPSView)dwValue = 1; - RegSetValueExA(g_hRegistry,"FPSView",0,REG_DWORD,(const BYTE*)&dwValue,4); + storeRegKey(g_bFPSView, "FPSView"); } //------------------------------------------------------------------------------- // Toggle the "2 Light sources" state //------------------------------------------------------------------------------- -void ToggleMultipleLights() -{ +void ToggleMultipleLights() { g_sOptions.b3Lights = !g_sOptions.b3Lights; - - // store this in the registry, too - DWORD dwValue = 0; - if (g_sOptions.b3Lights)dwValue = 1; - RegSetValueExA(g_hRegistry,"MultipleLights",0,REG_DWORD,(const BYTE*)&dwValue,4); + storeRegKey(g_sOptions.b3Lights, "MultipleLights"); } //------------------------------------------------------------------------------- // Toggle the "LightRotate" state //------------------------------------------------------------------------------- -void ToggleLightRotate() -{ +void ToggleLightRotate() { g_sOptions.bLightRotate = !g_sOptions.bLightRotate; - - // store this in the registry, too - DWORD dwValue = 0; - if (g_sOptions.bLightRotate)dwValue = 1; - RegSetValueExA(g_hRegistry,"LightRotate",0,REG_DWORD,(const BYTE*)&dwValue,4); + storeRegKey(g_sOptions.bLightRotate, "LightRotate"); } //------------------------------------------------------------------------------- // Toggle the "NoTransparency" state //------------------------------------------------------------------------------- -void ToggleTransparency() -{ +void ToggleTransparency() { g_sOptions.bNoAlphaBlending = !g_sOptions.bNoAlphaBlending; - - // store this in the registry, too - DWORD dwValue = 0; - if (g_sOptions.bNoAlphaBlending)dwValue = 1; - RegSetValueExA(g_hRegistry,"NoTransparency",0,REG_DWORD,(const BYTE*)&dwValue,4); + storeRegKey(g_sOptions.bNoAlphaBlending, "NoTransparency"); } //------------------------------------------------------------------------------- // Toggle the "LowQuality" state //------------------------------------------------------------------------------- -void ToggleLowQuality() -{ +void ToggleLowQuality() { g_sOptions.bLowQuality = !g_sOptions.bLowQuality; - - // store this in the registry, too - DWORD dwValue = 0; - if (g_sOptions.bLowQuality)dwValue = 1; - RegSetValueExA(g_hRegistry,"LowQuality",0,REG_DWORD,(const BYTE*)&dwValue,4); + storeRegKey(g_sOptions.bLowQuality, "LowQuality"); } //------------------------------------------------------------------------------- // Toggle the "Specular" state //------------------------------------------------------------------------------- -void ToggleSpecular() -{ +void ToggleSpecular() { g_sOptions.bNoSpecular = !g_sOptions.bNoSpecular; - // store this in the registry, too - DWORD dwValue = 0; - if (g_sOptions.bNoSpecular)dwValue = 1; - RegSetValueExA(g_hRegistry,"NoSpecular",0,REG_DWORD,(const BYTE*)&dwValue,4); + storeRegKey(g_sOptions.bNoSpecular, "NoSpecular"); // update all specular materials CMaterialManager::Instance().UpdateSpecularMaterials(); @@ -325,14 +292,10 @@ void ToggleSpecular() //------------------------------------------------------------------------------- // Toggle the "RenderMats" state //------------------------------------------------------------------------------- -void ToggleMats() -{ +void ToggleMats() { g_sOptions.bRenderMats = !g_sOptions.bRenderMats; - // store this in the registry, too - DWORD dwValue = 0; - if (g_sOptions.bRenderMats)dwValue = 1; - RegSetValueExA(g_hRegistry,"RenderMats",0,REG_DWORD,(const BYTE*)&dwValue,4); + storeRegKey(g_sOptions.bRenderMats, "RenderMats"); // update all specular materials CMaterialManager::Instance().UpdateSpecularMaterials(); @@ -341,45 +304,32 @@ void ToggleMats() //------------------------------------------------------------------------------- // Toggle the "Culling" state //------------------------------------------------------------------------------- -void ToggleCulling() -{ +void ToggleCulling() { g_sOptions.bCulling = !g_sOptions.bCulling; - - // store this in the registry, too - DWORD dwValue = 0; - if (g_sOptions.bCulling)dwValue = 1; - RegSetValueExA(g_hRegistry,"Culling",0,REG_DWORD,(const BYTE*)&dwValue,4); + storeRegKey(g_sOptions.bCulling, "Culling"); } //------------------------------------------------------------------------------- // Toggle the "Skeleton" state //------------------------------------------------------------------------------- -void ToggleSkeleton() -{ +void ToggleSkeleton() { g_sOptions.bSkeleton = !g_sOptions.bSkeleton; - - // store this in the registry, too - DWORD dwValue = 0; - if (g_sOptions.bCulling)dwValue = 1; - RegSetValueExA(g_hRegistry,"Skeleton",0,REG_DWORD,(const BYTE*)&dwValue,4); + storeRegKey(g_sOptions.bSkeleton, "Skeleton"); } //------------------------------------------------------------------------------- // Toggle the "WireFrame" state //------------------------------------------------------------------------------- -void ToggleWireFrame() -{ - if (g_sOptions.eDrawMode == RenderOptions::WIREFRAME) +void ToggleWireFrame() { + if (g_sOptions.eDrawMode == RenderOptions::WIREFRAME) { g_sOptions.eDrawMode = RenderOptions::NORMAL; - else g_sOptions.eDrawMode = RenderOptions::WIREFRAME; + } else { + g_sOptions.eDrawMode = RenderOptions::WIREFRAME; + } - // store this in the registry, too - DWORD dwValue = 0; - if (RenderOptions::WIREFRAME == g_sOptions.eDrawMode)dwValue = 1; - RegSetValueExA(g_hRegistry,"Wireframe",0,REG_DWORD,(const BYTE*)&dwValue,4); + storeRegKey(RenderOptions::WIREFRAME == g_sOptions.eDrawMode, "Wireframe"); } - //------------------------------------------------------------------------------- // Toggle the "MultiSample" state //------------------------------------------------------------------------------- @@ -388,8 +338,7 @@ void ToggleMS() g_sOptions.bMultiSample = !g_sOptions.bMultiSample; DeleteAssetData(); ShutdownDevice(); - if (0 == CreateDevice()) - { + if (0 == CreateDevice()) { CLogDisplay::Instance().AddEntry( "[ERROR] Failed to toggle MultiSampling mode"); g_sOptions.bMultiSample = !g_sOptions.bMultiSample; @@ -397,28 +346,21 @@ void ToggleMS() } CreateAssetData(); - if (g_sOptions.bMultiSample) - { + if (g_sOptions.bMultiSample) { CLogDisplay::Instance().AddEntry( "[OK] Changed MultiSampling mode to the maximum value for this device"); - } - else - { + } else { CLogDisplay::Instance().AddEntry( "[OK] MultiSampling has been disabled"); } - // store this in the registry, too - DWORD dwValue = 0; - if (g_sOptions.bMultiSample)dwValue = 1; - RegSetValueExA(g_hRegistry,"MultiSampling",0,REG_DWORD,(const BYTE*)&dwValue,4); + storeRegKey(g_sOptions.bMultiSample, "MultiSampling"); } //------------------------------------------------------------------------------- // Expand or collapse the UI //------------------------------------------------------------------------------- -void ToggleUIState() -{ +void ToggleUIState() { // adjust the size RECT sRect; GetWindowRect(g_hDlg,&sRect); @@ -430,46 +372,33 @@ void ToggleUIState() sRect2.left -= sRect.left; sRect2.top -= sRect.top; - DWORD dwValue; - if (BST_UNCHECKED == IsDlgButtonChecked(g_hDlg,IDC_BLUBB)) - { + if (BST_UNCHECKED == IsDlgButtonChecked(g_hDlg,IDC_BLUBB)) { SetWindowPos(g_hDlg,NULL,0,0,sRect.right-214,sRect.bottom, SWP_NOMOVE | SWP_NOZORDER); - dwValue = 0; SetWindowText(GetDlgItem(g_hDlg,IDC_BLUBB),">>"); - RegSetValueExA(g_hRegistry,"LastUIState",0,REG_DWORD,(const BYTE*)&dwValue,4); - } - else - { + storeRegKey(false, "MultiSampling"); + } else { SetWindowPos(g_hDlg,NULL,0,0,sRect.right+214,sRect.bottom, SWP_NOMOVE | SWP_NOZORDER); - dwValue = 1; + storeRegKey(true, "LastUIState"); SetWindowText(GetDlgItem(g_hDlg,IDC_BLUBB),"<<"); - RegSetValueExA(g_hRegistry,"LastUIState",0,REG_DWORD,(const BYTE*)&dwValue,4); } UpdateWindow(g_hDlg); - return; } - //------------------------------------------------------------------------------- // Load the background texture for the cviewer //------------------------------------------------------------------------------- -void LoadBGTexture() -{ +void LoadBGTexture() { char szFileName[MAX_PATH]; DWORD dwTemp = MAX_PATH; - if(ERROR_SUCCESS != RegQueryValueEx(g_hRegistry,"TextureSrc",NULL,NULL, - (BYTE*)szFileName,&dwTemp)) - { + if(ERROR_SUCCESS != RegQueryValueEx(g_hRegistry,"TextureSrc",NULL,NULL, (BYTE*)szFileName,&dwTemp)) { // Key was not found. Use C: strcpy(szFileName,""); - } - else - { + } else { // need to remove the file name char* sz = strrchr(szFileName,'\\'); if (!sz) @@ -495,14 +424,12 @@ void LoadBGTexture() RegSetValueExA(g_hRegistry,"LastSkyBoxSrc",0,REG_SZ,(const BYTE*)"",MAX_PATH); CBackgroundPainter::Instance().SetTextureBG(szFileName); - return; } //------------------------------------------------------------------------------- // Reset the background color to a smart and nice grey //------------------------------------------------------------------------------- -void ClearBG() -{ +void ClearBG() { D3DCOLOR clrColor = D3DCOLOR_ARGB(0xFF,100,100,100); CBackgroundPainter::Instance().SetColor(clrColor); @@ -510,14 +437,12 @@ void ClearBG() RegSetValueExA(g_hRegistry,"LastTextureSrc",0,REG_SZ,(const BYTE*)"",MAX_PATH); RegSetValueExA(g_hRegistry,"Color",0,REG_DWORD,(const BYTE*)&clrColor,4); - return; } //------------------------------------------------------------------------------- // Let the user choose a color in a windows standard color dialog //------------------------------------------------------------------------------- -void DisplayColorDialog(D3DCOLOR* pclrResult) -{ +void DisplayColorDialog(D3DCOLOR* pclrResult) { CHOOSECOLOR clr; clr.lStructSize = sizeof(CHOOSECOLOR); clr.hwndOwner = g_hDlg; @@ -534,15 +459,12 @@ void DisplayColorDialog(D3DCOLOR* pclrResult) GetRValue(clr.rgbResult), GetGValue(clr.rgbResult), GetBValue(clr.rgbResult)); - return; } - //------------------------------------------------------------------------------- // Let the user choose a color in a windows standard color dialog //------------------------------------------------------------------------------- -void DisplayColorDialog(D3DXVECTOR4* pclrResult) -{ +void DisplayColorDialog(D3DXVECTOR4* pclrResult) { CHOOSECOLOR clr; clr.lStructSize = sizeof(CHOOSECOLOR); clr.hwndOwner = g_hDlg; @@ -560,14 +482,12 @@ void DisplayColorDialog(D3DXVECTOR4* pclrResult) pclrResult->x = GetRValue(clr.rgbResult) / 255.0f; pclrResult->y = GetGValue(clr.rgbResult) / 255.0f; pclrResult->z = GetBValue(clr.rgbResult) / 255.0f; - return; } //------------------------------------------------------------------------------- -// Let the user choose the baclground color for the viewer +// Let the user choose the background color for the viewer //------------------------------------------------------------------------------- -void ChooseBGColor() -{ +void ChooseBGColor() { RegSetValueExA(g_hRegistry,"LastSkyBoxSrc",0,REG_SZ,(const BYTE*)"",MAX_PATH); RegSetValueExA(g_hRegistry,"LastTextureSrc",0,REG_SZ,(const BYTE*)"",MAX_PATH); @@ -576,14 +496,12 @@ void ChooseBGColor() CBackgroundPainter::Instance().SetColor(clrColor); RegSetValueExA(g_hRegistry,"Color",0,REG_DWORD,(const BYTE*)&clrColor,4); - return; } //------------------------------------------------------------------------------- // Display the OpenFile dialog and let the user choose a new slybox as bg //------------------------------------------------------------------------------- -void LoadSkybox() -{ +void LoadSkybox() { char szFileName[MAX_PATH]; DWORD dwTemp = MAX_PATH; @@ -622,23 +540,26 @@ void LoadSkybox() return; } +template +inline +void SaveRelease(T **iface ) { + if (nullptr != iface) { + (*iface)->Release(); + *iface = nullptr; + } +} //------------------------------------------------------------------------------- -// Sace a screenshot to an user-defined file +// Save a screenshot to an user-defined file //------------------------------------------------------------------------------- -void SaveScreenshot() -{ +void SaveScreenshot() { char szFileName[MAX_PATH]; DWORD dwTemp = MAX_PATH; - if(ERROR_SUCCESS != RegQueryValueEx(g_hRegistry,"ScreenShot",NULL,NULL, - (BYTE*)szFileName,&dwTemp)) - { + if(ERROR_SUCCESS != RegQueryValueEx(g_hRegistry,"ScreenShot",NULL,NULL, (BYTE*)szFileName,&dwTemp)) { // Key was not found. Use C: strcpy(szFileName,""); - } - else - { + } else { // need to remove the file name char* sz = strrchr(szFileName,'\\'); if (!sz) @@ -662,49 +583,42 @@ void SaveScreenshot() IDirect3DSurface9* pi = NULL; g_piDevice->GetRenderTarget(0,&pi); - if(!pi || FAILED(D3DXSaveSurfaceToFile(szFileName,D3DXIFF_PNG,pi,NULL,NULL))) - { + if(!pi || FAILED(D3DXSaveSurfaceToFile(szFileName,D3DXIFF_PNG,pi,NULL,NULL))) { CLogDisplay::Instance().AddEntry("[ERROR] Unable to save screenshot", D3DCOLOR_ARGB(0xFF,0xFF,0,0)); - } - else - { + } else { CLogDisplay::Instance().AddEntry("[INFO] The screenshot has been saved", D3DCOLOR_ARGB(0xFF,0xFF,0xFF,0)); } - if(pi)pi->Release(); - return; + SaveRelease(&pi); } //------------------------------------------------------------------------------- // Get the amount of memory required for textures //------------------------------------------------------------------------------- -void AddTextureMem(IDirect3DTexture9* pcTex, unsigned int& out) -{ - if (!pcTex)return; +void AddTextureMem(IDirect3DTexture9* pcTex, unsigned int& out) { + if (!pcTex) { + return; + } D3DSURFACE_DESC sDesc; pcTex->GetLevelDesc(0,&sDesc); out += (sDesc.Width * sDesc.Height) << 2; - return; } //------------------------------------------------------------------------------- // Display memory statistics //------------------------------------------------------------------------------- -void DisplayMemoryConsumption() -{ +void DisplayMemoryConsumption() { // first get the memory consumption for the aiScene - if (! g_pcAsset ||!g_pcAsset->pcScene) - { + if (! g_pcAsset ||!g_pcAsset->pcScene) { MessageBox(g_hDlg,"No asset is loaded. Can you guess how much memory I need to store nothing?", "Memory consumption",MB_OK); return; } unsigned int iScene = sizeof(aiScene); - for (unsigned int i = 0; i < g_pcAsset->pcScene->mNumMeshes;++i) - { + for (unsigned int i = 0; i < g_pcAsset->pcScene->mNumMeshes;++i) { iScene += sizeof(aiMesh); if (g_pcAsset->pcScene->mMeshes[i]->HasPositions()) iScene += sizeof(aiVector3D) * g_pcAsset->pcScene->mMeshes[i]->mNumVertices; @@ -715,22 +629,20 @@ void DisplayMemoryConsumption() if (g_pcAsset->pcScene->mMeshes[i]->HasTangentsAndBitangents()) iScene += sizeof(aiVector3D) * g_pcAsset->pcScene->mMeshes[i]->mNumVertices * 2; - for (unsigned int a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS;++a) - { - if (g_pcAsset->pcScene->mMeshes[i]->HasVertexColors(a)) + for (unsigned int a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS;++a) { + if (g_pcAsset->pcScene->mMeshes[i]->HasVertexColors(a)) { iScene += sizeof(aiColor4D) * g_pcAsset->pcScene->mMeshes[i]->mNumVertices; - else break; + } else { + break; + } } - for (unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS;++a) - { + for (unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS;++a) { if (g_pcAsset->pcScene->mMeshes[i]->HasTextureCoords(a)) iScene += sizeof(aiVector3D) * g_pcAsset->pcScene->mMeshes[i]->mNumVertices; else break; } - if (g_pcAsset->pcScene->mMeshes[i]->HasBones()) - { - for (unsigned int p = 0; p < g_pcAsset->pcScene->mMeshes[i]->mNumBones;++p) - { + if (g_pcAsset->pcScene->mMeshes[i]->HasBones()) { + for (unsigned int p = 0; p < g_pcAsset->pcScene->mMeshes[i]->mNumBones;++p) { iScene += sizeof(aiBone); iScene += g_pcAsset->pcScene->mMeshes[i]->mBones[p]->mNumWeights * sizeof(aiVertexWeight); } @@ -738,22 +650,20 @@ void DisplayMemoryConsumption() iScene += (sizeof(aiFace) + 3 * sizeof(unsigned int))*g_pcAsset->pcScene->mMeshes[i]->mNumFaces; } // add all embedded textures - for (unsigned int i = 0; i < g_pcAsset->pcScene->mNumTextures;++i) - { + for (unsigned int i = 0; i < g_pcAsset->pcScene->mNumTextures;++i) { const aiTexture* pc = g_pcAsset->pcScene->mTextures[i]; - if (0 != pc->mHeight) - { + if (0 != pc->mHeight) { iScene += 4 * pc->mHeight * pc->mWidth; + } else { + iScene += pc->mWidth; } - else iScene += pc->mWidth; } // add 30k for each material ... a string has 4k for example iScene += g_pcAsset->pcScene->mNumMaterials * 30 * 1024; // now get the memory consumption required by D3D, first all textures unsigned int iTexture = 0; - for (unsigned int i = 0; i < g_pcAsset->pcScene->mNumMeshes;++i) - { + for (unsigned int i = 0; i < g_pcAsset->pcScene->mNumMeshes;++i) { AssetHelper::MeshHelper* pc = g_pcAsset->apcMeshes[i]; AddTextureMem(pc->piDiffuseTexture,iTexture); @@ -767,15 +677,13 @@ void DisplayMemoryConsumption() unsigned int iVRAM = iTexture; // now get the memory consumption of all vertex/index buffers - unsigned int iVB = 0; - unsigned int iIB = 0; - for (unsigned int i = 0; i < g_pcAsset->pcScene->mNumMeshes;++i) - { + unsigned int iVB( 0 ), iIB(0); + for (unsigned int i = 0; i < g_pcAsset->pcScene->mNumMeshes;++i) { AssetHelper:: MeshHelper* pc = g_pcAsset->apcMeshes[i]; union{ - D3DVERTEXBUFFER_DESC sDesc; - D3DINDEXBUFFER_DESC sDesc2; + D3DVERTEXBUFFER_DESC sDesc; + D3DINDEXBUFFER_DESC sDesc2; }; if (pc->piVB) @@ -814,36 +722,30 @@ void DisplayMemoryConsumption() iScene / 1024,iTexture / 1024,iVB / 1024,iIB / 1024,iVRAM / 1024, (iScene + iTexture + iVB + iIB + iVRAM) / 1024); MessageBox(g_hDlg,szOut,"Memory consumption",MB_OK); - return; } //------------------------------------------------------------------------------- // Save the list of recent files to the registry //------------------------------------------------------------------------------- -void SaveHistory() -{ - for (unsigned int i = 0; i < AI_VIEW_NUM_RECENT_FILES;++i) - { +void SaveHistory() { + for (unsigned int i = 0; i < AI_VIEW_NUM_RECENT_FILES;++i) { char szName[66]; sprintf(szName,"Recent%i",i+1); RegSetValueEx(g_hRegistry,szName,0,REG_SZ, (const BYTE*)g_aPreviousFiles[i].c_str(),(DWORD)g_aPreviousFiles[i].length()); } - return; } //------------------------------------------------------------------------------- // Recover the file history //------------------------------------------------------------------------------- -void LoadHistory() -{ +void LoadHistory() { g_aPreviousFiles.resize(AI_VIEW_NUM_RECENT_FILES); char szFileName[MAX_PATH]; - for (unsigned int i = 0; i < AI_VIEW_NUM_RECENT_FILES;++i) - { + for (unsigned int i = 0; i < AI_VIEW_NUM_RECENT_FILES;++i) { char szName[66]; sprintf(szName,"Recent%i",i+1); @@ -851,20 +753,17 @@ void LoadHistory() szFileName[0] ='\0'; if(ERROR_SUCCESS == RegQueryValueEx(g_hRegistry,szName,NULL,NULL, - (BYTE*)szFileName,&dwTemp)) - { + (BYTE*)szFileName,&dwTemp)) { g_aPreviousFiles[i] = std::string(szFileName); } } // add sub items for all recent files g_hHistoryMenu = CreateMenu(); - for (int i = AI_VIEW_NUM_RECENT_FILES-1; i >= 0;--i) - { + for (int i = AI_VIEW_NUM_RECENT_FILES-1; i >= 0;--i) { const char* szText = g_aPreviousFiles[i].c_str(); UINT iFlags = 0; - if ('\0' == *szText) - { + if ('\0' == *szText) { szText = ""; iFlags = MF_GRAYED | MF_DISABLED; } @@ -873,19 +772,17 @@ void LoadHistory() ModifyMenu(GetMenu(g_hDlg),ID_VIEWER_RECENTFILES,MF_BYCOMMAND | MF_POPUP, (UINT_PTR)g_hHistoryMenu,"Recent files"); - return; } //------------------------------------------------------------------------------- // Clear the file history //------------------------------------------------------------------------------- -void ClearHistory() -{ - for(unsigned int i = 0; i < AI_VIEW_NUM_RECENT_FILES;++i) +void ClearHistory() { + for (unsigned int i = 0; i < AI_VIEW_NUM_RECENT_FILES; ++i) { g_aPreviousFiles[i] = std::string(""); + } - for (int i = AI_VIEW_NUM_RECENT_FILES-1; i >= 0;--i) - { + for (int i = AI_VIEW_NUM_RECENT_FILES-1; i >= 0;--i) { ModifyMenu(g_hHistoryMenu,AI_VIEW_RECENT_FILE_ID(i), MF_STRING | MF_BYCOMMAND | MF_GRAYED | MF_DISABLED,AI_VIEW_RECENT_FILE_ID(i),""); } @@ -896,50 +793,44 @@ void ClearHistory() //------------------------------------------------------------------------------- // Update the file history //------------------------------------------------------------------------------- -void UpdateHistory() -{ - if(!g_hHistoryMenu)return; +void UpdateHistory() { + if (!g_hHistoryMenu) { + return; + } std::string sz = std::string(g_szFileName); - if (g_aPreviousFiles[AI_VIEW_NUM_RECENT_FILES-1] == sz)return; + if (g_aPreviousFiles[AI_VIEW_NUM_RECENT_FILES - 1] == sz) { + return; + } // add the new asset to the list of recent files - for (unsigned int i = 0; i < AI_VIEW_NUM_RECENT_FILES-1;++i) - { + for (unsigned int i = 0; i < AI_VIEW_NUM_RECENT_FILES-1;++i) { g_aPreviousFiles[i] = g_aPreviousFiles[i+1]; } g_aPreviousFiles[AI_VIEW_NUM_RECENT_FILES-1] = sz; - for (int i = AI_VIEW_NUM_RECENT_FILES-1; i >= 0;--i) - { + for (int i = AI_VIEW_NUM_RECENT_FILES-1; i >= 0;--i) { const char* szText = g_aPreviousFiles[i].c_str(); UINT iFlags = 0; - if ('\0' == *szText) - { + if ('\0' == *szText) { szText = ""; iFlags = MF_GRAYED | MF_DISABLED; } ModifyMenu(g_hHistoryMenu,AI_VIEW_RECENT_FILE_ID(i), MF_STRING | MF_BYCOMMAND | iFlags,AI_VIEW_RECENT_FILE_ID(i),szText); } - return; } //------------------------------------------------------------------------------- // Open a new asset //------------------------------------------------------------------------------- -void OpenAsset() -{ +void OpenAsset() { char szFileName[MAX_PATH]; DWORD dwTemp = MAX_PATH; - if(ERROR_SUCCESS != RegQueryValueEx(g_hRegistry,"CurrentApp",NULL,NULL, - (BYTE*)szFileName,&dwTemp)) - { + if(ERROR_SUCCESS != RegQueryValueEx(g_hRegistry,"CurrentApp",NULL,NULL, (BYTE*)szFileName,&dwTemp)) { // Key was not found. Use C: strcpy(szFileName,""); - } - else - { + } else { // need to remove the file name char* sz = strrchr(szFileName,'\\'); if (!sz) @@ -970,13 +861,14 @@ void OpenAsset() OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY | OFN_NOCHANGEDIR, 0, 1, ".x", 0, NULL, NULL }; - if(GetOpenFileName(&sFilename1) == 0) return; + if (GetOpenFileName(&sFilename1) == 0) { + return; + } // Now store the file in the registry RegSetValueExA(g_hRegistry,"CurrentApp",0,REG_SZ,(const BYTE*)szFileName,MAX_PATH); - if (0 != strcmp(g_szFileName,szFileName)) - { + if (0 != strcmp(g_szFileName,szFileName)) { strcpy(g_szFileName, szFileName); DeleteAssetData(); DeleteAsset(); @@ -988,13 +880,10 @@ void OpenAsset() // Save the list of previous files to the registry SaveHistory(); } - return; } //------------------------------------------------------------------------------- -void SetupPPUIState() -{ - +void SetupPPUIState() { // that's ugly. anyone willing to rewrite me from scratch? HMENU hMenu = GetMenu(g_hDlg); CheckMenuItem(hMenu,ID_VIEWER_PP_JIV,ppsteps & aiProcess_JoinIdenticalVertices ? MF_CHECKED : MF_UNCHECKED); @@ -1018,13 +907,11 @@ void SetupPPUIState() //------------------------------------------------------------------------------- // Fill the 'export' top level menu with a list of all supported export formats //------------------------------------------------------------------------------- -void PopulateExportMenu() -{ +void PopulateExportMenu() { // add sub items for all recent files Exporter exp; HMENU hm = ::CreateMenu(); - for(size_t i = 0; i < exp.GetExportFormatCount(); ++i) - { + for(size_t i = 0; i < exp.GetExportFormatCount(); ++i) { const aiExportFormatDesc* const e = exp.GetExportFormatDescription(i); char tmp[256]; sprintf(tmp,"%s (%s)",e->description,e->id); @@ -1038,8 +925,7 @@ void PopulateExportMenu() //------------------------------------------------------------------------------- //------------------------------------------------------------------------------- -void DoExport(size_t formatId) -{ +void DoExport(size_t formatId) { if (!g_szFileName[0]) { MessageBox(g_hDlg, "No model loaded", "Export", MB_ICONERROR); return; @@ -1122,8 +1008,7 @@ void DoExport(size_t formatId) //------------------------------------------------------------------------------- // Initialize the user interface //------------------------------------------------------------------------------- -void InitUI() -{ +void InitUI() { SetDlgItemText(g_hDlg,IDC_EVERT,"0"); SetDlgItemText(g_hDlg,IDC_EFACE,"0"); SetDlgItemText(g_hDlg,IDC_EMAT,"0"); @@ -1147,13 +1032,10 @@ void InitUI() RegCreateKeyEx(HKEY_CURRENT_USER,"Software\\ASSIMP\\Viewer", 0,NULL,0,KEY_ALL_ACCESS, NULL, &g_hRegistry,NULL); - if(ERROR_SUCCESS != RegQueryValueEx(g_hRegistry,"LastUIState",NULL,NULL, - (BYTE*)&dwValue,&dwTemp)) - { + if(ERROR_SUCCESS != RegQueryValueEx(g_hRegistry,"LastUIState",NULL,NULL, (BYTE*)&dwValue,&dwTemp)) { dwValue = 1; } - if (0 == dwValue) - { + if (0 == dwValue) { // collapse the viewer // adjust the size RECT sRect; @@ -1169,22 +1051,17 @@ void InitUI() SetWindowPos(g_hDlg,NULL,0,0,sRect.right-214,sRect.bottom, SWP_NOMOVE | SWP_NOZORDER); SetWindowText(GetDlgItem(g_hDlg,IDC_BLUBB),">>"); - } - else - { + } else { CheckDlgButton(g_hDlg,IDC_BLUBB,BST_CHECKED); } // AutoRotate if(ERROR_SUCCESS != RegQueryValueEx(g_hRegistry,"AutoRotate",NULL,NULL, (BYTE*)&dwValue,&dwTemp))dwValue = 0; - if (0 == dwValue) - { + if (0 == dwValue) { g_sOptions.bRotate = false; CheckDlgButton(g_hDlg,IDC_AUTOROTATE,BST_UNCHECKED); - } - else - { + } else { g_sOptions.bRotate = true; CheckDlgButton(g_hDlg,IDC_AUTOROTATE,BST_CHECKED); } @@ -1192,13 +1069,10 @@ void InitUI() // MultipleLights if(ERROR_SUCCESS != RegQueryValueEx(g_hRegistry,"MultipleLights",NULL,NULL, (BYTE*)&dwValue,&dwTemp))dwValue = 0; - if (0 == dwValue) - { + if (0 == dwValue) { g_sOptions.b3Lights = false; CheckDlgButton(g_hDlg,IDC_3LIGHTS,BST_UNCHECKED); - } - else - { + } else { g_sOptions.b3Lights = true; CheckDlgButton(g_hDlg,IDC_3LIGHTS,BST_CHECKED); } @@ -1206,27 +1080,22 @@ void InitUI() // Light rotate if(ERROR_SUCCESS != RegQueryValueEx(g_hRegistry,"LightRotate",NULL,NULL, (BYTE*)&dwValue,&dwTemp))dwValue = 0; - if (0 == dwValue) - { + if (0 == dwValue) { g_sOptions.bLightRotate = false; CheckDlgButton(g_hDlg,IDC_LIGHTROTATE,BST_UNCHECKED); - } - else - { + } else { g_sOptions.bLightRotate = true; CheckDlgButton(g_hDlg,IDC_LIGHTROTATE,BST_CHECKED); } // NoSpecular - if(ERROR_SUCCESS != RegQueryValueEx(g_hRegistry,"NoSpecular",NULL,NULL, - (BYTE*)&dwValue,&dwTemp))dwValue = 0; - if (0 == dwValue) - { + if (ERROR_SUCCESS != RegQueryValueEx(g_hRegistry, "NoSpecular", NULL, NULL, (BYTE*)&dwValue, &dwTemp)) { + dwValue = 0; + } + if (0 == dwValue) { g_sOptions.bNoSpecular = false; CheckDlgButton(g_hDlg,IDC_NOSPECULAR,BST_UNCHECKED); - } - else - { + } else { g_sOptions.bNoSpecular = true; CheckDlgButton(g_hDlg,IDC_NOSPECULAR,BST_CHECKED); } @@ -1234,13 +1103,10 @@ void InitUI() // LowQuality if(ERROR_SUCCESS != RegQueryValueEx(g_hRegistry,"LowQuality",NULL,NULL, (BYTE*)&dwValue,&dwTemp))dwValue = 0; - if (0 == dwValue) - { + if (0 == dwValue) { g_sOptions.bLowQuality = false; CheckDlgButton(g_hDlg,IDC_LOWQUALITY,BST_UNCHECKED); - } - else - { + } else { g_sOptions.bLowQuality = true; CheckDlgButton(g_hDlg,IDC_LOWQUALITY,BST_CHECKED); } @@ -1248,13 +1114,10 @@ void InitUI() // LowQuality if(ERROR_SUCCESS != RegQueryValueEx(g_hRegistry,"NoTransparency",NULL,NULL, (BYTE*)&dwValue,&dwTemp))dwValue = 0; - if (0 == dwValue) - { + if (0 == dwValue) { g_sOptions.bNoAlphaBlending = false; CheckDlgButton(g_hDlg,IDC_NOAB,BST_UNCHECKED); - } - else - { + } else { g_sOptions.bNoAlphaBlending = true; CheckDlgButton(g_hDlg,IDC_NOAB,BST_CHECKED); } @@ -1262,27 +1125,23 @@ void InitUI() // DisplayNormals if(ERROR_SUCCESS != RegQueryValueEx(g_hRegistry,"RenderNormals",NULL,NULL, (BYTE*)&dwValue,&dwTemp))dwValue = 0; - if (0 == dwValue) - { + if (0 == dwValue) { g_sOptions.bRenderNormals = false; CheckDlgButton(g_hDlg,IDC_TOGGLENORMALS,BST_UNCHECKED); - } - else - { + } else { g_sOptions.bRenderNormals = true; CheckDlgButton(g_hDlg,IDC_TOGGLENORMALS,BST_CHECKED); } // NoMaterials - if(ERROR_SUCCESS != RegQueryValueEx(g_hRegistry,"RenderMats",NULL,NULL, - (BYTE*)&dwValue,&dwTemp))dwValue = 1; - if (0 == dwValue) - { + if (ERROR_SUCCESS != RegQueryValueEx(g_hRegistry, "RenderMats", NULL, NULL, + (BYTE*)&dwValue, &dwTemp)) { + dwValue = 1; + } + if (0 == dwValue) { g_sOptions.bRenderMats = false; CheckDlgButton(g_hDlg,IDC_TOGGLEMAT,BST_CHECKED); - } - else - { + } else { g_sOptions.bRenderMats = true; CheckDlgButton(g_hDlg,IDC_TOGGLEMAT,BST_UNCHECKED); } @@ -1294,9 +1153,7 @@ void InitUI() { g_sOptions.bMultiSample = false; CheckDlgButton(g_hDlg,IDC_TOGGLEMS,BST_UNCHECKED); - } - else - { + } else { g_sOptions.bMultiSample = true; CheckDlgButton(g_hDlg,IDC_TOGGLEMS,BST_CHECKED); } @@ -1304,13 +1161,10 @@ void InitUI() // FPS Mode if(ERROR_SUCCESS != RegQueryValueEx(g_hRegistry,"FPSView",NULL,NULL, (BYTE*)&dwValue,&dwTemp))dwValue = 0; - if (0 == dwValue) - { + if (0 == dwValue) { g_bFPSView = false; CheckDlgButton(g_hDlg,IDC_ZOOM,BST_CHECKED); - } - else - { + } else { g_bFPSView = true; CheckDlgButton(g_hDlg,IDC_ZOOM,BST_UNCHECKED); } @@ -1338,22 +1192,20 @@ void InitUI() SendDlgItemMessage(g_hDlg,IDC_SLIDERANIM,TBM_SETRANGEMIN,TRUE,0); SendDlgItemMessage(g_hDlg,IDC_SLIDERANIM,TBM_SETRANGEMAX,TRUE,10000); - return; } //------------------------------------------------------------------------------- -// Message prcoedure for the smooth normals dialog +// Message procedure for the smooth normals dialog //------------------------------------------------------------------------------- -INT_PTR CALLBACK SMMessageProc(HWND hwndDlg,UINT uMsg, - WPARAM wParam,LPARAM lParam) -{ +INT_PTR CALLBACK SMMessageProc(HWND hwndDlg,UINT uMsg, WPARAM wParam,LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); - switch (uMsg) - { + switch (uMsg) { case WM_INITDIALOG: - char s[30]; - ::sprintf(s,"%.2f",g_smoothAngle); - SetDlgItemText(hwndDlg,IDC_EDITSM,s); + { + char s[30]; + ::sprintf(s, "%.2f", g_smoothAngle); + SetDlgItemText(hwndDlg, IDC_EDITSM, s); + } return TRUE; case WM_CLOSE: @@ -1361,16 +1213,16 @@ INT_PTR CALLBACK SMMessageProc(HWND hwndDlg,UINT uMsg, return TRUE; case WM_COMMAND: + { + if (IDOK == LOWORD(wParam)) { + char s[30]; + GetDlgItemText(hwndDlg, IDC_EDITSM, s, 30); + g_smoothAngle = (float)atof(s); - if (IDOK == LOWORD(wParam)) { - char s[30]; - GetDlgItemText(hwndDlg,IDC_EDITSM,s,30); - g_smoothAngle = (float)atof(s); - - EndDialog(hwndDlg,0); - } - else if (IDCANCEL == LOWORD(wParam)) { - EndDialog(hwndDlg,1); + EndDialog(hwndDlg, 0); + } else if (IDCANCEL == LOWORD(wParam)) { + EndDialog(hwndDlg, 1); + } } return TRUE; } @@ -1385,9 +1237,7 @@ INT_PTR CALLBACK SMMessageProc(HWND hwndDlg,UINT uMsg, // NOTE: Due to the impossibility to process WM_CHAR messages in dialogs // properly the code for all hotkeys has been moved to the WndMain //------------------------------------------------------------------------------- -INT_PTR CALLBACK MessageProc(HWND hwndDlg,UINT uMsg, - WPARAM wParam,LPARAM lParam) - { +INT_PTR CALLBACK MessageProc(HWND hwndDlg,UINT uMsg, WPARAM wParam,LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); UNREFERENCED_PARAMETER(wParam); @@ -1830,13 +1680,10 @@ INT_PTR CALLBACK MessageProc(HWND hwndDlg,UINT uMsg, case WM_COMMAND: HMENU hMenu = GetMenu(g_hDlg); - if (ID_VIEWER_QUIT == LOWORD(wParam)) - { + if (ID_VIEWER_QUIT == LOWORD(wParam)) { PostQuitMessage(0); DestroyWindow(hwndDlg); - } - else if (IDC_COMBO1 == LOWORD(wParam)) - { + } else if (IDC_COMBO1 == LOWORD(wParam)) { if(HIWORD(wParam) == CBN_SELCHANGE) { const size_t sel = static_cast(ComboBox_GetCurSel(GetDlgItem(hwndDlg,IDC_COMBO1))); if(g_pcAsset) { @@ -1844,9 +1691,7 @@ INT_PTR CALLBACK MessageProc(HWND hwndDlg,UINT uMsg, SendDlgItemMessage(hwndDlg,IDC_SLIDERANIM,TBM_SETPOS,TRUE,0); } } - } - else if (ID_VIEWER_RESETVIEW == LOWORD(wParam)) - { + } else if (ID_VIEWER_RESETVIEW == LOWORD(wParam)) { g_sCamera.vPos = aiVector3D(0.0f,0.0f,-10.0f); g_sCamera.vLookAt = aiVector3D(0.0f,0.0f,1.0f); g_sCamera.vUp = aiVector3D(0.0f,1.0f,0.0f); @@ -1856,63 +1701,35 @@ INT_PTR CALLBACK MessageProc(HWND hwndDlg,UINT uMsg, // don't forget to reset the st CBackgroundPainter::Instance().ResetSB(); - } - else if (ID__HELP == LOWORD(wParam)) - { + } else if (ID__HELP == LOWORD(wParam)) { DialogBox(g_hInstance,MAKEINTRESOURCE(IDD_AVHELP), hwndDlg,&HelpDialogProc); - } - else if (ID__ABOUT == LOWORD(wParam)) - { + } else if (ID__ABOUT == LOWORD(wParam)) { DialogBox(g_hInstance,MAKEINTRESOURCE(IDD_ABOUTBOX), hwndDlg,&AboutMessageProc); - } - else if (ID_TOOLS_LOGWINDOW == LOWORD(wParam)) - { - CLogWindow::Instance().Show(); - } - else if (ID__WEBSITE == LOWORD(wParam)) - { - ShellExecute(NULL,"open","http://assimp.sourceforge.net","","",SW_SHOW); - } - else if (ID__WEBSITESF == LOWORD(wParam)) - { - ShellExecute(NULL,"open","https://sourceforge.net/projects/assimp","","",SW_SHOW); - } - else if (ID_REPORTBUG == LOWORD(wParam)) - { - ShellExecute(NULL,"open","https://sourceforge.net/tracker/?func=add&group_id=226462&atid=1067632","","",SW_SHOW); - } - else if (ID_FR == LOWORD(wParam)) - { - ShellExecute(NULL,"open","https://sourceforge.net/forum/forum.php?forum_id=817653","","",SW_SHOW); - } - else if (ID_TOOLS_CLEARLOG == LOWORD(wParam)) - { - CLogWindow::Instance().Clear(); - } - else if (ID_TOOLS_SAVELOGTOFILE == LOWORD(wParam)) - { - CLogWindow::Instance().Save(); - } - else if (ID_VIEWER_MEMORYCONSUMATION == LOWORD(wParam)) - { - DisplayMemoryConsumption(); - } - else if (ID_VIEWER_H == LOWORD(wParam)) - { + } else if (ID_TOOLS_LOGWINDOW == LOWORD(wParam)) { + CLogWindow::Instance().Show(); + } else if (ID__WEBSITE == LOWORD(wParam)) { + ShellExecute(NULL,"open","http://assimp.sourceforge.net","","",SW_SHOW); + } else if (ID__WEBSITESF == LOWORD(wParam)) { + ShellExecute(NULL,"open","https://sourceforge.net/projects/assimp","","",SW_SHOW); + } else if (ID_REPORTBUG == LOWORD(wParam)) { + ShellExecute(NULL,"open","https://sourceforge.net/tracker/?func=add&group_id=226462&atid=1067632","","",SW_SHOW); + } else if (ID_FR == LOWORD(wParam)) { + ShellExecute(NULL,"open","https://sourceforge.net/forum/forum.php?forum_id=817653","","",SW_SHOW); + } else if (ID_TOOLS_CLEARLOG == LOWORD(wParam)) { + CLogWindow::Instance().Clear(); + } else if (ID_TOOLS_SAVELOGTOFILE == LOWORD(wParam)) { + CLogWindow::Instance().Save(); + } else if (ID_VIEWER_MEMORYCONSUMATION == LOWORD(wParam)) { + DisplayMemoryConsumption(); + } else if (ID_VIEWER_H == LOWORD(wParam)) { MakeFileAssociations(); - } - else if (ID_BACKGROUND_CLEAR == LOWORD(wParam)) - { + } else if (ID_BACKGROUND_CLEAR == LOWORD(wParam)) { ClearBG(); - } - else if (ID_BACKGROUND_SETCOLOR == LOWORD(wParam)) - { + } else if (ID_BACKGROUND_SETCOLOR == LOWORD(wParam)) { ChooseBGColor(); - } - else if (ID_BACKGROUND_LOADTEXTURE == LOWORD(wParam)) - { + } else if (ID_BACKGROUND_LOADTEXTURE == LOWORD(wParam)) { LoadBGTexture(); } else if (ID_BACKGROUND_LOADSKYBOX == LOWORD(wParam)) @@ -2071,34 +1888,25 @@ INT_PTR CALLBACK MessageProc(HWND hwndDlg,UINT uMsg, { g_sOptions.bStereoView =! g_sOptions.bStereoView; - HMENU hMenu = GetMenu(g_hDlg); - if (g_sOptions.bStereoView) - { - ModifyMenu(hMenu,ID_TOOLS_STEREOVIEW, + HMENU menu = ::GetMenu(g_hDlg); + if (g_sOptions.bStereoView) { + ::ModifyMenu(menu,ID_TOOLS_STEREOVIEW, MF_BYCOMMAND | MF_CHECKED | MF_STRING,ID_TOOLS_STEREOVIEW,"Stereo view"); CLogDisplay::Instance().AddEntry("[INFO] Switched to stereo mode", D3DCOLOR_ARGB(0xFF,0xFF,0xFF,0)); - } - else - { - ModifyMenu(hMenu,ID_TOOLS_STEREOVIEW, + } else { + ModifyMenu(menu,ID_TOOLS_STEREOVIEW, MF_BYCOMMAND | MF_UNCHECKED | MF_STRING,ID_TOOLS_STEREOVIEW,"Stereo view"); CLogDisplay::Instance().AddEntry("[INFO] Switched to mono mode", D3DCOLOR_ARGB(0xFF,0xFF,0xFF,0)); } - } - else if (ID_TOOLS_SETANGLELIMIT == LOWORD(wParam)) - { + } else if (ID_TOOLS_SETANGLELIMIT == LOWORD(wParam)) { DialogBox(g_hInstance,MAKEINTRESOURCE(IDD_DIALOGSMOOTH),g_hDlg,&SMMessageProc); - } - else if (ID_VIEWER_CLEARHISTORY == LOWORD(wParam)) - { + } else if (ID_VIEWER_CLEARHISTORY == LOWORD(wParam)) { ClearHistory(); - } - else if (ID_VIEWER_CLOSEASSET == LOWORD(wParam)) - { + } else if (ID_VIEWER_CLOSEASSET == LOWORD(wParam)) { DeleteAssetData(); DeleteAsset(); } @@ -2420,36 +2228,34 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, SetFocus(g_hDlg); // recover background skyboxes/textures from the last session - HKEY g_hRegistry; - union - { + HKEY hRegistry; + union { char szFileName[MAX_PATH]; D3DCOLOR clrColor; - }; + }; DWORD dwTemp = MAX_PATH; RegCreateKeyEx(HKEY_CURRENT_USER, - "Software\\ASSIMP\\Viewer",0,NULL,0,KEY_ALL_ACCESS, NULL, &g_hRegistry,NULL); - if(ERROR_SUCCESS == RegQueryValueEx(g_hRegistry,"LastSkyBoxSrc",NULL,NULL, + "Software\\ASSIMP\\Viewer",0,NULL,0,KEY_ALL_ACCESS, NULL, &hRegistry,NULL); + if(ERROR_SUCCESS == RegQueryValueEx(hRegistry,"LastSkyBoxSrc",NULL,NULL, (BYTE*)szFileName,&dwTemp) && '\0' != szFileName[0]) { CBackgroundPainter::Instance().SetCubeMapBG(szFileName); } - else if(ERROR_SUCCESS == RegQueryValueEx(g_hRegistry,"LastTextureSrc",NULL,NULL, + else if(ERROR_SUCCESS == RegQueryValueEx(hRegistry,"LastTextureSrc",NULL,NULL, (BYTE*)szFileName,&dwTemp) && '\0' != szFileName[0]) { CBackgroundPainter::Instance().SetTextureBG(szFileName); } - else if(ERROR_SUCCESS == RegQueryValueEx(g_hRegistry,"Color",NULL,NULL, + else if(ERROR_SUCCESS == RegQueryValueEx(hRegistry,"Color",NULL,NULL, (BYTE*)&clrColor,&dwTemp)) { CBackgroundPainter::Instance().SetColor(clrColor); } - RegCloseKey(g_hRegistry); + RegCloseKey(hRegistry); // now handle command line arguments HandleCommandLine(lpCmdLine); - double adLast[30]; for (int i = 0; i < 30;++i)adLast[i] = 0.0f; int iCurrent = 0; @@ -2608,7 +2414,6 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, // render the scene CDisplay::Instance().OnRender(); - // measure FPS, average it out g_dCurTime = timeGetTime(); g_fElpasedTime = (float)((g_dCurTime - g_dLastTime) * 0.001); @@ -2617,26 +2422,26 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, adLast[iCurrent++] = 1.0f / g_fElpasedTime; double dFPS = 0.0; - for (int i = 0;i < 30;++i) - dFPS += adLast[i]; + for (int i = 0; i < 30; ++i) { + dFPS += adLast[ i ]; + } dFPS /= 30.0; - if (30 == iCurrent) - { + if (30 == iCurrent) { iCurrent = 0; - if (dFPS != g_fFPS) - { + if (dFPS != g_fFPS) { g_fFPS = dFPS; char szOut[256]; sprintf(szOut,"%i",(int)floorf((float)dFPS+0.5f)); SetDlgItemText(g_hDlg,IDC_EFPS,szOut); - } } } + } DeleteAsset(); Assimp::DefaultLogger::kill(); ShutdownDevice(); ShutdownD3D(); + return 0; - } \ No newline at end of file +} diff --git a/tools/assimp_view/Normals.cpp b/tools/assimp_view/Normals.cpp index 240825905..4ce706c6a 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-2015, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. @@ -39,11 +39,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------- */ - #include "assimp_view.h" -// note: these are no longer part of the public API, but they are -// exported on Windows to keep AssimpView alive. #include "GenFaceNormalsProcess.h" #include "GenVertexNormalsProcess.h" #include "JoinVerticesProcess.h" @@ -60,15 +57,14 @@ float g_smoothAngle = 80.f; //------------------------------------------------------------------------------- // Flip all normal vectors //------------------------------------------------------------------------------- -void AssetHelper::FlipNormalsInt() -{ +void AssetHelper::FlipNormalsInt() { // invert all normal vectors - for (unsigned int i = 0; i < this->pcScene->mNumMeshes;++i) - { + for (unsigned int i = 0; i < this->pcScene->mNumMeshes;++i) { aiMesh* pcMesh = this->pcScene->mMeshes[i]; - if (!pcMesh->mNormals) + if (!pcMesh->mNormals) { continue; + } for (unsigned int a = 0; a < pcMesh->mNumVertices;++a){ pcMesh->mNormals[a] *= -1.0f; @@ -77,8 +73,7 @@ void AssetHelper::FlipNormalsInt() } //------------------------------------------------------------------------------- -void AssetHelper::FlipNormals() -{ +void AssetHelper::FlipNormals() { FlipNormalsInt(); // recreate native data @@ -90,53 +85,42 @@ void AssetHelper::FlipNormals() //------------------------------------------------------------------------------- // Set the normal set of the scene //------------------------------------------------------------------------------- -void AssetHelper::SetNormalSet(unsigned int iSet) -{ +void AssetHelper::SetNormalSet(unsigned int iSet) { // we need to build an unique set of vertices for this ... { MakeVerboseFormatProcess* pcProcess = new MakeVerboseFormatProcess(); pcProcess->Execute(pcScene); delete pcProcess; - for (unsigned int i = 0; i < pcScene->mNumMeshes;++i) - { - if (!apcMeshes[i]->pvOriginalNormals) - { + for (unsigned int i = 0; i < pcScene->mNumMeshes;++i) { + if (!apcMeshes[i]->pvOriginalNormals) { apcMeshes[i]->pvOriginalNormals = new aiVector3D[pcScene->mMeshes[i]->mNumVertices]; memcpy( apcMeshes[i]->pvOriginalNormals,pcScene->mMeshes[i]->mNormals, pcScene->mMeshes[i]->mNumVertices * sizeof(aiVector3D)); } delete[] pcScene->mMeshes[i]->mNormals; - pcScene->mMeshes[i]->mNormals = NULL; + pcScene->mMeshes[i]->mNormals = nullptr; } } - // now we can start to calculate a new set of normals - if (HARD == iSet) - { + if (HARD == iSet) { GenFaceNormalsProcess* pcProcess = new GenFaceNormalsProcess(); pcProcess->Execute(pcScene); FlipNormalsInt(); delete pcProcess; - } - else if (SMOOTH == iSet) - { + } else if (SMOOTH == iSet) { GenVertexNormalsProcess* pcProcess = new GenVertexNormalsProcess(); pcProcess->SetMaxSmoothAngle((float)AI_DEG_TO_RAD(g_smoothAngle)); pcProcess->Execute(pcScene); FlipNormalsInt(); delete pcProcess; - } - else if (ORIGINAL == iSet) - { - for (unsigned int i = 0; i < pcScene->mNumMeshes;++i) - { - if (apcMeshes[i]->pvOriginalNormals) - { + } else if (ORIGINAL == iSet) { + for (unsigned int i = 0; i < pcScene->mNumMeshes;++i) { + if (apcMeshes[i]->pvOriginalNormals) { delete[] pcScene->mMeshes[i]->mNormals; pcScene->mMeshes[i]->mNormals = apcMeshes[i]->pvOriginalNormals; - apcMeshes[i]->pvOriginalNormals = NULL; + apcMeshes[i]->pvOriginalNormals = nullptr; } } } @@ -153,14 +137,11 @@ void AssetHelper::SetNormalSet(unsigned int iSet) iNormalSet = iSet; - if (g_bWasFlipped) - { + if (g_bWasFlipped) { // invert all normal vectors - for (unsigned int i = 0; i < pcScene->mNumMeshes;++i) - { + for (unsigned int i = 0; i < pcScene->mNumMeshes;++i) { aiMesh* pcMesh = pcScene->mMeshes[i]; - for (unsigned int a = 0; a < pcMesh->mNumVertices;++a) - { + for (unsigned int a = 0; a < pcMesh->mNumVertices;++a) { pcMesh->mNormals[a] *= -1.0f; } } @@ -169,7 +150,6 @@ void AssetHelper::SetNormalSet(unsigned int iSet) // recreate native data DeleteAssetData(true); CreateAssetData(); - return; } -}; \ No newline at end of file +} diff --git a/tools/assimp_view/SceneAnimator.cpp b/tools/assimp_view/SceneAnimator.cpp index 6e507cb41..c2ebeacb3 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-2015, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. @@ -47,21 +47,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using namespace AssimpView; +const aiMatrix4x4 IdentityMatrix; + // ------------------------------------------------------------------------------------------------ // Constructor for a given scene. SceneAnimator::SceneAnimator( const aiScene* pScene, size_t pAnimIndex) -{ - mScene = pScene; - mCurrentAnimIndex = -1; - mAnimEvaluator = NULL; - mRootNode = NULL; - +: mScene( pScene ) +, mCurrentAnimIndex( -1 ) +, mAnimEvaluator( nullptr ) +, mRootNode( nullptr ) { // build the nodes-for-bones table - for (unsigned int i = 0; i < pScene->mNumMeshes;++i) - { + for (unsigned int i = 0; i < pScene->mNumMeshes;++i) { const aiMesh* mesh = pScene->mMeshes[i]; - for (unsigned int n = 0; n < mesh->mNumBones;++n) - { + for (unsigned int n = 0; n < mesh->mNumBones;++n) { const aiBone* bone = mesh->mBones[n]; mBoneNodesByName[bone->mName.data] = pScene->mRootNode->FindNode(bone->mName); @@ -74,34 +72,34 @@ SceneAnimator::SceneAnimator( const aiScene* pScene, size_t pAnimIndex) // ------------------------------------------------------------------------------------------------ // Destructor -SceneAnimator::~SceneAnimator() -{ +SceneAnimator::~SceneAnimator() { delete mRootNode; delete mAnimEvaluator; } // ------------------------------------------------------------------------------------------------ // Sets the animation to use for playback. -void SceneAnimator::SetAnimIndex( size_t pAnimIndex) -{ +void SceneAnimator::SetAnimIndex( size_t pAnimIndex) { // no change - if( pAnimIndex == mCurrentAnimIndex) + if (pAnimIndex == static_cast( mCurrentAnimIndex ) ) { return; + } // kill data of the previous anim - delete mRootNode; mRootNode = NULL; - delete mAnimEvaluator; mAnimEvaluator = NULL; + delete mRootNode; mRootNode = nullptr; + delete mAnimEvaluator; mAnimEvaluator = nullptr; mNodesByName.clear(); mCurrentAnimIndex = pAnimIndex; // create the internal node tree. Do this even in case of invalid animation index // so that the transformation matrices are properly set up to mimic the current scene - mRootNode = CreateNodeTree( mScene->mRootNode, NULL); + mRootNode = CreateNodeTree( mScene->mRootNode, nullptr); // invalid anim index - if( mCurrentAnimIndex >= mScene->mNumAnimations) + if (static_cast( mCurrentAnimIndex )>= mScene->mNumAnimations) { return; + } // create an evaluator for this animation mAnimEvaluator = new AnimEvaluator( mScene->mAnimations[mCurrentAnimIndex]); @@ -109,11 +107,11 @@ void SceneAnimator::SetAnimIndex( size_t pAnimIndex) // ------------------------------------------------------------------------------------------------ // Calculates the node transformations for the scene. -void SceneAnimator::Calculate( double pTime) -{ +void SceneAnimator::Calculate( double pTime) { // invalid anim - if( !mAnimEvaluator) + if (!mAnimEvaluator) { return; + } // calculate current local transformations mAnimEvaluator->Evaluate( pTime); @@ -124,36 +122,35 @@ void SceneAnimator::Calculate( double pTime) // ------------------------------------------------------------------------------------------------ // Retrieves the most recent local transformation matrix for the given node. -const aiMatrix4x4& SceneAnimator::GetLocalTransform( const aiNode* node) const -{ +const aiMatrix4x4& SceneAnimator::GetLocalTransform( const aiNode* node) const { NodeMap::const_iterator it = mNodesByName.find( node); - if( it == mNodesByName.end()) - return mIdentityMatrix; + if (it == mNodesByName.end()) { + return IdentityMatrix; + } return it->second->mLocalTransform; } // ------------------------------------------------------------------------------------------------ // Retrieves the most recent global transformation matrix for the given node. -const aiMatrix4x4& SceneAnimator::GetGlobalTransform( const aiNode* node) const -{ +const aiMatrix4x4& SceneAnimator::GetGlobalTransform( const aiNode* node) const { NodeMap::const_iterator it = mNodesByName.find( node); - if( it == mNodesByName.end()) - return mIdentityMatrix; + if (it == mNodesByName.end()) { + return IdentityMatrix; + } return it->second->mGlobalTransform; } // ------------------------------------------------------------------------------------------------ // Calculates the bone matrices for the given mesh. -const std::vector& SceneAnimator::GetBoneMatrices( const aiNode* pNode, size_t pMeshIndex /* = 0 */) -{ +const std::vector& SceneAnimator::GetBoneMatrices( const aiNode* pNode, size_t pMeshIndex /* = 0 */) { ai_assert( pMeshIndex < pNode->mNumMeshes); size_t meshIndex = pNode->mMeshes[pMeshIndex]; ai_assert( meshIndex < mScene->mNumMeshes); const aiMesh* mesh = mScene->mMeshes[meshIndex]; - // resize array and initialise it with identity matrices + // resize array and initialize it with identity matrices mTransforms.resize( mesh->mNumBones, aiMatrix4x4()); // calculate the mesh's inverse global transform @@ -162,8 +159,7 @@ const std::vector& SceneAnimator::GetBoneMatrices( const aiNode* pN // Bone matrices transform from mesh coordinates in bind pose to mesh coordinates in skinned pose // Therefore the formula is offsetMatrix * currentGlobalTransform * inverseCurrentMeshTransform - for( size_t a = 0; a < mesh->mNumBones; ++a) - { + for( size_t a = 0; a < mesh->mNumBones; ++a) { const aiBone* bone = mesh->mBones[a]; const aiMatrix4x4& currentGlobalTransform = GetGlobalTransform( mBoneNodesByName[ bone->mName.data ]); mTransforms[a] = globalInverseMeshTransform * currentGlobalTransform * bone->mOffsetMatrix; @@ -175,8 +171,7 @@ const std::vector& SceneAnimator::GetBoneMatrices( const aiNode* pN // ------------------------------------------------------------------------------------------------ // Recursively creates an internal node structure matching the current scene and animation. -SceneAnimNode* SceneAnimator::CreateNodeTree( aiNode* pNode, SceneAnimNode* pParent) -{ +SceneAnimNode* SceneAnimator::CreateNodeTree( aiNode* pNode, SceneAnimNode* pParent) { // create a node SceneAnimNode* internalNode = new SceneAnimNode( pNode->mName.data); internalNode->mParent = pParent; @@ -187,14 +182,11 @@ SceneAnimNode* SceneAnimator::CreateNodeTree( aiNode* pNode, SceneAnimNode* pPar CalculateGlobalTransform( internalNode); // find the index of the animation track affecting this node, if any - if( mCurrentAnimIndex < mScene->mNumAnimations) - { + if(static_cast( mCurrentAnimIndex ) < mScene->mNumAnimations) { internalNode->mChannelIndex = -1; const aiAnimation* currentAnim = mScene->mAnimations[mCurrentAnimIndex]; - for( unsigned int a = 0; a < currentAnim->mNumChannels; a++) - { - if( currentAnim->mChannels[a]->mNodeName.data == internalNode->mName) - { + for( unsigned int a = 0; a < currentAnim->mNumChannels; a++) { + if( currentAnim->mChannels[a]->mNodeName.data == internalNode->mName) { internalNode->mChannelIndex = a; break; } @@ -202,8 +194,7 @@ SceneAnimNode* SceneAnimator::CreateNodeTree( aiNode* pNode, SceneAnimNode* pPar } // continue for all child nodes and assign the created internal nodes as our children - for( unsigned int a = 0; a < pNode->mNumChildren; a++) - { + for( unsigned int a = 0; a < pNode->mNumChildren; ++a ) { SceneAnimNode* childNode = CreateNodeTree( pNode->mChildren[a], internalNode); internalNode->mChildren.push_back( childNode); } @@ -213,12 +204,10 @@ SceneAnimNode* SceneAnimator::CreateNodeTree( aiNode* pNode, SceneAnimNode* pPar // ------------------------------------------------------------------------------------------------ // Recursively updates the internal node transformations from the given matrix array -void SceneAnimator::UpdateTransforms( SceneAnimNode* pNode, const std::vector& pTransforms) -{ +void SceneAnimator::UpdateTransforms( SceneAnimNode* pNode, const std::vector& pTransforms) { // update node local transform - if( pNode->mChannelIndex != -1) - { - ai_assert( pNode->mChannelIndex < pTransforms.size()); + if( pNode->mChannelIndex != -1) { + ai_assert(static_cast( pNode->mChannelIndex ) < pTransforms.size()); pNode->mLocalTransform = pTransforms[pNode->mChannelIndex]; } @@ -226,19 +215,18 @@ void SceneAnimator::UpdateTransforms( SceneAnimNode* pNode, const std::vector::iterator it = pNode->mChildren.begin(); it != pNode->mChildren.end(); ++it) - UpdateTransforms( *it, pTransforms); + for (std::vector::iterator it = pNode->mChildren.begin(); it != pNode->mChildren.end(); ++it) { + UpdateTransforms(*it, pTransforms); + } } // ------------------------------------------------------------------------------------------------ // Calculates the global transformation matrix for the given internal node -void SceneAnimator::CalculateGlobalTransform( SceneAnimNode* pInternalNode) -{ +void SceneAnimator::CalculateGlobalTransform( SceneAnimNode* pInternalNode) { // concatenate all parent transforms to get the global transform for this node pInternalNode->mGlobalTransform = pInternalNode->mLocalTransform; SceneAnimNode* node = pInternalNode->mParent; - while( node) - { + while( node) { pInternalNode->mGlobalTransform = node->mLocalTransform * pInternalNode->mGlobalTransform; node = node->mParent; } diff --git a/tools/assimp_view/SceneAnimator.h b/tools/assimp_view/SceneAnimator.h index afcbac925..00d9832b6 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-2012, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. @@ -49,15 +49,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include -namespace AssimpView { +namespace AssimpView { // --------------------------------------------------------------------------------- /** A little tree structure to match the scene's node structure, but holding * additional data. Needs to be public to allow using it in templates at * certain compilers. */ -struct SceneAnimNode -{ +struct SceneAnimNode { std::string mName; SceneAnimNode* mParent; std::vector mChildren; @@ -69,12 +68,15 @@ struct SceneAnimNode aiMatrix4x4 mGlobalTransform; //! index in the current animation's channel array. -1 if not animated. - size_t mChannelIndex; + int mChannelIndex; //! Default construction SceneAnimNode() : mName() - , mParent(NULL) + , mParent(nullptr) + , mChildren() + , mLocalTransform() + , mGlobalTransform() , mChannelIndex(-1) { // empty } @@ -82,8 +84,11 @@ struct SceneAnimNode //! Construction from a given name SceneAnimNode( const std::string& pName) : mName( pName) - , mParent(NULL) - , mChannelIndex( -1 ) { + , mParent(nullptr) + , mChildren() + , mLocalTransform() + , mGlobalTransform() + , mChannelIndex(-1) { // empty } @@ -105,8 +110,7 @@ struct SceneAnimNode * GetGlobalTransform(). A full set of bone matrices can be retrieved by * GetBoneMatrices() for a given mesh. */ -class SceneAnimator -{ +class SceneAnimator { public: // ---------------------------------------------------------------------------- @@ -186,7 +190,6 @@ public: const std::vector& GetBoneMatrices( const aiNode* pNode, size_t pMeshIndex = 0); - // ---------------------------------------------------------------------------- /** @brief Get the current animation index */ @@ -198,7 +201,7 @@ public: /** @brief Get the current animation or NULL */ aiAnimation* CurrentAnim() const { - return mCurrentAnimIndex < mScene->mNumAnimations ? mScene->mAnimations[ mCurrentAnimIndex ] : NULL; + return static_cast( mCurrentAnimIndex ) < mScene->mNumAnimations ? mScene->mAnimations[ mCurrentAnimIndex ] : NULL; } protected: @@ -221,7 +224,7 @@ protected: const aiScene* mScene; /** Current animation index */ - size_t mCurrentAnimIndex; + int mCurrentAnimIndex; /** The AnimEvaluator we use to calculate the current pose for the current animation */ AnimEvaluator* mAnimEvaluator; @@ -239,9 +242,6 @@ protected: /** Array to return transformations results inside. */ std::vector mTransforms; - - /** Identity matrix to return a reference to in case of error */ - aiMatrix4x4 mIdentityMatrix; }; } // end of namespace AssimpView diff --git a/tools/assimp_view/Shaders.cpp b/tools/assimp_view/Shaders.cpp index 1b6f3dc88..49ec5320d 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-2015, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. From 1ac86476fe0df95bc7f3ba8575aae0752b88321e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9verin=20Lemaignan?= Date: Wed, 30 Jan 2019 22:41:01 +0000 Subject: [PATCH 77/78] [pyassimp] Bumped to 4.1.4 Main changes: - Support for metadata fields (Vincent Fazio, Wojciech Matyjewicz) - added support for aiExportSceneToBlob (Vincent Fazio) - a few bug fix + code beautification --- port/PyAssimp/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/port/PyAssimp/setup.py b/port/PyAssimp/setup.py index e19e497f0..a3497d657 100644 --- a/port/PyAssimp/setup.py +++ b/port/PyAssimp/setup.py @@ -8,7 +8,7 @@ def readme(): return f.read() setup(name='pyassimp', - version='4.1.3', + version='4.1.4', license='ISC', description='Python bindings for the Open Asset Import Library (ASSIMP)', long_description=readme(), From 4347ce4311cee8e88ba2a73385f38a92dc75ec25 Mon Sep 17 00:00:00 2001 From: kimkulling Date: Thu, 31 Jan 2019 17:24:08 +0100 Subject: [PATCH 78/78] Some more findings. --- tools/assimp_cmd/Main.h | 11 +++---- tools/assimp_view/MessageProc.cpp | 53 ++++++++++--------------------- 2 files changed, 21 insertions(+), 43 deletions(-) diff --git a/tools/assimp_cmd/Main.h b/tools/assimp_cmd/Main.h index 56b06d57e..5dc4f7d28 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-2015, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. @@ -89,9 +89,8 @@ extern Assimp::Exporter* globalExporter; #endif // ------------------------------------------------------------------------------ -/** Defines common import parameters */ -struct ImportData -{ +/// Defines common import parameters +struct ImportData { ImportData() : ppFlags (0) , showLog (false) @@ -99,11 +98,9 @@ struct ImportData , log (false) {} - /** Postprocessing flags - */ + /// Post-processing flags unsigned int ppFlags; - // Log to std::err? bool showLog; diff --git a/tools/assimp_view/MessageProc.cpp b/tools/assimp_view/MessageProc.cpp index f9bcf2e9d..823edc643 100644 --- a/tools/assimp_view/MessageProc.cpp +++ b/tools/assimp_view/MessageProc.cpp @@ -1597,21 +1597,17 @@ INT_PTR CALLBACK MessageProc(HWND hwndDlg,UINT uMsg, WPARAM wParam,LPARAM lParam case WM_DROPFILES: { HDROP hDrop = (HDROP)wParam; - char szFile[MAX_PATH]; DragQueryFile(hDrop,0,szFile,sizeof(szFile)); - const char* sz = strrchr(szFile,'.'); - if (!sz) + if (!sz) { sz = szFile; + } - if (CDisplay::VIEWMODE_TEXTURE == CDisplay::Instance().GetViewMode()) - { + if (CDisplay::VIEWMODE_TEXTURE == CDisplay::Instance().GetViewMode()) { // replace the selected texture with the new one ... CDisplay::Instance().ReplaceCurrentTexture(szFile); - } - else - { + } else { // check whether it is a typical texture file format ... ++sz; if (0 == ASSIMP_stricmp(sz,"png") || @@ -1653,19 +1649,17 @@ INT_PTR CALLBACK MessageProc(HWND hwndDlg,UINT uMsg, WPARAM wParam,LPARAM lParam fseek(pFile,112,SEEK_SET); fread(&dwCaps,4,1,pFile); - if (dwCaps & 0x00000400L /* DDSCAPS2_CUBEMAP_POSITIVEX */) - { + if (dwCaps & 0x00000400L /* DDSCAPS2_CUBEMAP_POSITIVEX */) { CLogDisplay::Instance().AddEntry( "[INFO] Assuming this dds file is a skybox ...", D3DCOLOR_ARGB(0xFF,0xFF,0xFF,0)); CBackgroundPainter::Instance().SetCubeMapBG(szFile); + } else { + CBackgroundPainter::Instance().SetTextureBG(szFile); } - else CBackgroundPainter::Instance().SetTextureBG(szFile); fclose(pFile); - } - else - { + } else { strcpy(g_szFileName,szFile); DeleteAsset(); @@ -1731,44 +1725,31 @@ INT_PTR CALLBACK MessageProc(HWND hwndDlg,UINT uMsg, WPARAM wParam,LPARAM lParam ChooseBGColor(); } else if (ID_BACKGROUND_LOADTEXTURE == LOWORD(wParam)) { LoadBGTexture(); - } - else if (ID_BACKGROUND_LOADSKYBOX == LOWORD(wParam)) - { + } else if (ID_BACKGROUND_LOADSKYBOX == LOWORD(wParam)) { LoadSkybox(); - } - else if (ID_VIEWER_SAVESCREENSHOTTOFILE == LOWORD(wParam)) - { + } else if (ID_VIEWER_SAVESCREENSHOTTOFILE == LOWORD(wParam)) { SaveScreenshot(); - } - else if (ID_VIEWER_OPEN == LOWORD(wParam)) - { + } else if (ID_VIEWER_OPEN == LOWORD(wParam)) { OpenAsset(); - } - else if (ID_TOOLS_FLIPNORMALS == LOWORD(wParam)) - { - if (g_pcAsset && g_pcAsset->pcScene) - { + } else if (ID_TOOLS_FLIPNORMALS == LOWORD(wParam)) { + if (g_pcAsset && g_pcAsset->pcScene) { g_pcAsset->FlipNormals(); - } } - + } // this is ugly. anyone willing to rewrite it from scratch using wxwidgets or similar? else if (ID_VIEWER_PP_JIV == LOWORD(wParam)) { ppsteps ^= aiProcess_JoinIdenticalVertices; CheckMenuItem(hMenu,ID_VIEWER_PP_JIV,ppsteps & aiProcess_JoinIdenticalVertices ? MF_CHECKED : MF_UNCHECKED); UpdatePPSettings(); - } - else if (ID_VIEWER_PP_CTS == LOWORD(wParam)) { + } else if (ID_VIEWER_PP_CTS == LOWORD(wParam)) { ppsteps ^= aiProcess_CalcTangentSpace; CheckMenuItem(hMenu,ID_VIEWER_PP_CTS,ppsteps & aiProcess_CalcTangentSpace ? MF_CHECKED : MF_UNCHECKED); UpdatePPSettings(); - } - else if (ID_VIEWER_PP_FD == LOWORD(wParam)) { + } else if (ID_VIEWER_PP_FD == LOWORD(wParam)) { ppsteps ^= aiProcess_FindDegenerates; CheckMenuItem(hMenu,ID_VIEWER_PP_FD,ppsteps & aiProcess_FindDegenerates ? MF_CHECKED : MF_UNCHECKED); UpdatePPSettings(); - } - else if (ID_VIEWER_PP_FID == LOWORD(wParam)) { + } else if (ID_VIEWER_PP_FID == LOWORD(wParam)) { ppsteps ^= aiProcess_FindInvalidData; CheckMenuItem(hMenu,ID_VIEWER_PP_FID,ppsteps & aiProcess_FindInvalidData ? MF_CHECKED : MF_UNCHECKED); UpdatePPSettings();