Merge branch 'master' into coverity_scan
Conflicts: test/regression/db.zippull/1007/head
commit
5dc4a126b5
|
@ -11,6 +11,6 @@ else
|
||||||
&& sudo make install \
|
&& sudo make install \
|
||||||
&& sudo ldconfig \
|
&& sudo ldconfig \
|
||||||
&& (cd test/unit; ../../bin/unit) \
|
&& (cd test/unit; ../../bin/unit) \
|
||||||
&& (cd test/regression; chmod 755 run.py; ./run.py ../../bin/assimp; \
|
#&& (cd test/regression; chmod 755 run.py; ./run.py ../../bin/assimp; \
|
||||||
chmod 755 result_checker.py; ./result_checker.py)
|
# chmod 755 result_checker.py; ./result_checker.py)
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -81,11 +81,15 @@ IF(NOT GIT_COMMIT_HASH)
|
||||||
ENDIF(NOT GIT_COMMIT_HASH)
|
ENDIF(NOT GIT_COMMIT_HASH)
|
||||||
|
|
||||||
configure_file(
|
configure_file(
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/revision.h.in
|
${CMAKE_CURRENT_LIST_DIR}/revision.h.in
|
||||||
|
# ${CMAKE_CURRENT_SOURCE_DIR}/revision.h.in
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/revision.h
|
${CMAKE_CURRENT_BINARY_DIR}/revision.h
|
||||||
)
|
)
|
||||||
|
|
||||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
include_directories(
|
||||||
|
./
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
OPTION(ASSIMP_OPT_BUILD_PACKAGES "Set to ON to generate CPack configuration files and packaging targets" OFF)
|
OPTION(ASSIMP_OPT_BUILD_PACKAGES "Set to ON to generate CPack configuration files and packaging targets" OFF)
|
||||||
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules" )
|
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules" )
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
==================================
|
==================================
|
||||||
Open Asset Import Library is a library to load various 3d file formats into a shared, in-memory format. It supports more than __40 file formats__ for import and a growing selection of file formats for export.
|
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
|
@ -15,7 +14,8 @@ Coverity<a href="https://scan.coverity.com/projects/5607">
|
||||||
<img alt="Coverity Scan Build Status"
|
<img alt="Coverity Scan Build Status"
|
||||||
src="https://scan.coverity.com/projects/5607/badge.svg"/>
|
src="https://scan.coverity.com/projects/5607/badge.svg"/>
|
||||||
</a>
|
</a>
|
||||||
|
Gitter [![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)
|
||||||
|
<br>
|
||||||
__[open3mod](https://github.com/acgessler/open3mod) is a powerful 3D model viewer based on Assimp's import and export abilities.__
|
__[open3mod](https://github.com/acgessler/open3mod) is a powerful 3D model viewer based on Assimp's import and export abilities.__
|
||||||
|
|
||||||
#### Supported file formats ####
|
#### Supported file formats ####
|
||||||
|
@ -115,6 +115,8 @@ If the docs don't solve your problem, ask on [StackOverflow](http://stackoverflo
|
||||||
For development discussions, there is also a (very low-volume) mailing list, _assimp-discussions_
|
For development discussions, there is also a (very low-volume) mailing list, _assimp-discussions_
|
||||||
[(subscribe here)]( https://lists.sourceforge.net/lists/listinfo/assimp-discussions)
|
[(subscribe here)]( https://lists.sourceforge.net/lists/listinfo/assimp-discussions)
|
||||||
|
|
||||||
|
Open Asset Import Library is a library to load various 3d file formats into a shared, in-memory format. It supports more than __40 file formats__ for import and a growing selection of file formats for export.
|
||||||
|
|
||||||
And we also have an IRC-channel at freenode: #assetimporterlib . You can easily join us via: [KiwiIRC/freenote](https://kiwiirc.com/client/irc.freenode.net), choose your nickname and type
|
And we also have an IRC-channel at freenode: #assetimporterlib . You can easily join us via: [KiwiIRC/freenote](https://kiwiirc.com/client/irc.freenode.net), choose your nickname and type
|
||||||
> /join #assetimporterlib
|
> /join #assetimporterlib
|
||||||
|
|
||||||
|
|
|
@ -47,8 +47,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
// internal headers
|
// internal headers
|
||||||
#include "3DSLoader.h"
|
#include "3DSLoader.h"
|
||||||
#include "TargetAnimation.h"
|
#include "TargetAnimation.h"
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include "StringComparison.h"
|
#include "StringComparison.h"
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
|
|
|
@ -47,9 +47,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "SceneCombiner.h"
|
#include "SceneCombiner.h"
|
||||||
#include "SplitLargeMeshes.h"
|
#include "SplitLargeMeshes.h"
|
||||||
#include "StringComparison.h"
|
#include "StringComparison.h"
|
||||||
#include "../include/assimp/IOSystem.hpp"
|
#include <assimp/IOSystem.hpp>
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include "../include/assimp/Exporter.hpp"
|
#include <assimp/Exporter.hpp>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
|
@ -51,9 +51,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
// internal headers
|
// internal headers
|
||||||
#include "3DSLoader.h"
|
#include "3DSLoader.h"
|
||||||
#include "Macros.h"
|
#include "Macros.h"
|
||||||
#include "../include/assimp/IOSystem.hpp"
|
#include <assimp/IOSystem.hpp>
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include "StringComparison.h"
|
#include "StringComparison.h"
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
@ -186,15 +186,14 @@ void Discreet3DSImporter::InternReadFile( const std::string& pFile,
|
||||||
// internal verbose representation. Finally compute normal
|
// internal verbose representation. Finally compute normal
|
||||||
// vectors from the smoothing groups we read from the
|
// vectors from the smoothing groups we read from the
|
||||||
// file.
|
// file.
|
||||||
for (std::vector<D3DS::Mesh>::iterator i = mScene->mMeshes.begin(),
|
for (auto &mesh : mScene->mMeshes) {
|
||||||
end = mScene->mMeshes.end(); i != end;++i) {
|
if (mesh.mFaces.size() > 0 && mesh.mPositions.size() == 0) {
|
||||||
if ((*i).mFaces.size() > 0 && (*i).mPositions.size() == 0) {
|
|
||||||
delete mScene;
|
delete mScene;
|
||||||
throw DeadlyImportError("3DS file contains faces but no vertices: " + pFile);
|
throw DeadlyImportError("3DS file contains faces but no vertices: " + pFile);
|
||||||
}
|
}
|
||||||
CheckIndices(*i);
|
CheckIndices(mesh);
|
||||||
MakeUnique (*i);
|
MakeUnique (mesh);
|
||||||
ComputeNormalsWithSmoothingsGroups<D3DS::Face>(*i);
|
ComputeNormalsWithSmoothingsGroups<D3DS::Face>(mesh);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replace all occurrences of the default material with a
|
// Replace all occurrences of the default material with a
|
||||||
|
|
|
@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#define AI_3DSIMPORTER_H_INC
|
#define AI_3DSIMPORTER_H_INC
|
||||||
|
|
||||||
#include "BaseImporter.h"
|
#include "BaseImporter.h"
|
||||||
#include "../include/assimp/types.h"
|
#include <assimp/types.h>
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_3DS_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_3DS_IMPORTER
|
||||||
|
|
||||||
|
|
|
@ -53,13 +53,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "Subdivision.h"
|
#include "Subdivision.h"
|
||||||
#include "Importer.h"
|
#include "Importer.h"
|
||||||
#include "BaseImporter.h"
|
#include "BaseImporter.h"
|
||||||
#include "../include/assimp/Importer.hpp"
|
#include <assimp/Importer.hpp>
|
||||||
#include "../include/assimp/light.h"
|
#include <assimp/light.h>
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include "../include/assimp/material.h"
|
#include <assimp/material.h>
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
#include "../include/assimp/config.h"
|
#include <assimp/config.h>
|
||||||
#include "../include/assimp/IOSystem.hpp"
|
#include <assimp/IOSystem.hpp>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
|
@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "BaseImporter.h"
|
#include "BaseImporter.h"
|
||||||
#include "../include/assimp/types.h"
|
#include <assimp/types.h>
|
||||||
|
|
||||||
struct aiNode;
|
struct aiNode;
|
||||||
struct aiMesh;
|
struct aiMesh;
|
||||||
|
|
|
@ -50,12 +50,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "StringComparison.h"
|
#include "StringComparison.h"
|
||||||
#include "SkeletonMeshBuilder.h"
|
#include "SkeletonMeshBuilder.h"
|
||||||
#include "TargetAnimation.h"
|
#include "TargetAnimation.h"
|
||||||
#include "../include/assimp/Importer.hpp"
|
#include <assimp/Importer.hpp>
|
||||||
#include <memory>
|
#include <assimp/IOSystem.hpp>
|
||||||
#include "../include/assimp/IOSystem.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/scene.h>
|
||||||
#include "../include/assimp/scene.h"
|
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
// utilities
|
// utilities
|
||||||
#include "fast_atof.h"
|
#include "fast_atof.h"
|
||||||
|
@ -225,17 +225,13 @@ void ASEImporter::InternReadFile( const std::string& pFile,
|
||||||
+ mParser->m_vCameras.size() + mParser->m_vDummies.size());
|
+ mParser->m_vCameras.size() + mParser->m_vDummies.size());
|
||||||
|
|
||||||
// Lights
|
// Lights
|
||||||
for (std::vector<ASE::Light>::iterator it = mParser->m_vLights.begin(),
|
for (auto &light : mParser->m_vLights)nodes.push_back(&light);
|
||||||
end = mParser->m_vLights.end();it != end; ++it)nodes.push_back(&(*it));
|
|
||||||
// Cameras
|
// Cameras
|
||||||
for (std::vector<ASE::Camera>::iterator it = mParser->m_vCameras.begin(),
|
for (auto &camera : mParser->m_vCameras)nodes.push_back(&camera);
|
||||||
end = mParser->m_vCameras.end();it != end; ++it)nodes.push_back(&(*it));
|
|
||||||
// Meshes
|
// Meshes
|
||||||
for (std::vector<ASE::Mesh>::iterator it = mParser->m_vMeshes.begin(),
|
for (auto &mesh : mParser->m_vMeshes)nodes.push_back(&mesh);
|
||||||
end = mParser->m_vMeshes.end();it != end; ++it)nodes.push_back(&(*it));
|
|
||||||
// Dummies
|
// Dummies
|
||||||
for (std::vector<ASE::Dummy>::iterator it = mParser->m_vDummies.begin(),
|
for (auto &dummy : mParser->m_vDummies)nodes.push_back(&dummy);
|
||||||
end = mParser->m_vDummies.end();it != end; ++it)nodes.push_back(&(*it));
|
|
||||||
|
|
||||||
// build the final node graph
|
// build the final node graph
|
||||||
BuildNodes(nodes);
|
BuildNodes(nodes);
|
||||||
|
@ -657,8 +653,8 @@ void ASEImporter::BuildNodes(std::vector<BaseNode*>& nodes) {
|
||||||
ch->mParent = root;
|
ch->mParent = root;
|
||||||
|
|
||||||
// Change the transformation matrix of all nodes
|
// Change the transformation matrix of all nodes
|
||||||
for (std::vector<BaseNode*>::iterator it = nodes.begin(), end = nodes.end();it != end; ++it) {
|
for (BaseNode *node : nodes) {
|
||||||
aiMatrix4x4& m = (*it)->mTransform;
|
aiMatrix4x4& m = node->mTransform;
|
||||||
m.Transpose(); // row-order vs column-order
|
m.Transpose(); // row-order vs column-order
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#define AI_ASELOADER_H_INCLUDED
|
#define AI_ASELOADER_H_INCLUDED
|
||||||
|
|
||||||
#include "BaseImporter.h"
|
#include "BaseImporter.h"
|
||||||
#include "../include/assimp/types.h"
|
#include <assimp/types.h>
|
||||||
|
|
||||||
struct aiNode;
|
struct aiNode;
|
||||||
#include "ASEParser.h"
|
#include "ASEParser.h"
|
||||||
|
|
|
@ -51,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "ASELoader.h"
|
#include "ASELoader.h"
|
||||||
#include "MaterialSystem.h"
|
#include "MaterialSystem.h"
|
||||||
#include "fast_atof.h"
|
#include "fast_atof.h"
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
using namespace Assimp::ASE;
|
using namespace Assimp::ASE;
|
||||||
|
|
|
@ -44,9 +44,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#define AI_ASEFILEHELPER_H_INC
|
#define AI_ASEFILEHELPER_H_INC
|
||||||
|
|
||||||
// public ASSIMP headers
|
// public ASSIMP headers
|
||||||
#include "../include/assimp/types.h"
|
#include <assimp/types.h>
|
||||||
#include "../include/assimp/mesh.h"
|
#include <assimp/mesh.h>
|
||||||
#include "../include/assimp/anim.h"
|
#include <assimp/anim.h>
|
||||||
|
|
||||||
// for some helper routines like IsSpace()
|
// for some helper routines like IsSpace()
|
||||||
#include "ParsingUtils.h"
|
#include "ParsingUtils.h"
|
||||||
|
|
|
@ -41,10 +41,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
* ASSBIN exporter main code
|
* ASSBIN exporter main code
|
||||||
*/
|
*/
|
||||||
#include "assbin_chunks.h"
|
#include "assbin_chunks.h"
|
||||||
#include "../include/assimp/version.h"
|
#include <assimp/version.h>
|
||||||
#include "../include/assimp/IOStream.hpp"
|
#include <assimp/IOStream.hpp>
|
||||||
#include "../include/assimp/IOSystem.hpp"
|
#include <assimp/IOSystem.hpp>
|
||||||
#include "../include/assimp/Exporter.hpp"
|
#include <assimp/Exporter.hpp>
|
||||||
#include "ProcessHelper.h"
|
#include "ProcessHelper.h"
|
||||||
#include "Exceptional.h"
|
#include "Exceptional.h"
|
||||||
|
|
||||||
|
|
|
@ -51,14 +51,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "AssbinLoader.h"
|
#include "AssbinLoader.h"
|
||||||
#include "assbin_chunks.h"
|
#include "assbin_chunks.h"
|
||||||
#include "MemoryIOWrapper.h"
|
#include "MemoryIOWrapper.h"
|
||||||
#include "../include/assimp/mesh.h"
|
#include <assimp/mesh.h>
|
||||||
#include "../include/assimp/anim.h"
|
#include <assimp/anim.h>
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
|
|
||||||
#ifdef ASSIMP_BUILD_NO_OWN_ZLIB
|
#ifdef ASSIMP_BUILD_NO_OWN_ZLIB
|
||||||
# include <zlib.h>
|
# include <zlib.h>
|
||||||
#else
|
#else
|
||||||
# include "../contrib/zlib/zlib.h"
|
# include <contrib/zlib/zlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
|
@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#define AI_ASSBINIMPORTER_H_INC
|
#define AI_ASSBINIMPORTER_H_INC
|
||||||
|
|
||||||
#include "BaseImporter.h"
|
#include "BaseImporter.h"
|
||||||
#include "../include/assimp/types.h"
|
#include <assimp/types.h>
|
||||||
|
|
||||||
struct aiMesh;
|
struct aiMesh;
|
||||||
struct aiNode;
|
struct aiNode;
|
||||||
|
|
|
@ -47,7 +47,7 @@ Assimp C export interface. See Exporter.cpp for some notes.
|
||||||
#include "CInterfaceIOWrapper.h"
|
#include "CInterfaceIOWrapper.h"
|
||||||
#include "SceneCombiner.h"
|
#include "SceneCombiner.h"
|
||||||
#include "ScenePrivate.h"
|
#include "ScenePrivate.h"
|
||||||
#include "../include/assimp/Exporter.hpp"
|
#include <assimp/Exporter.hpp>
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
|
|
@ -43,14 +43,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include "./../include/assimp/version.h"
|
#include "./../include/assimp/version.h"
|
||||||
#include "ProcessHelper.h"
|
#include "ProcessHelper.h"
|
||||||
#include "../include/assimp/IOStream.hpp"
|
#include <assimp/IOStream.hpp>
|
||||||
#include "../include/assimp/IOSystem.hpp"
|
#include <assimp/IOSystem.hpp>
|
||||||
#include "../include/assimp/Exporter.hpp"
|
#include <assimp/Exporter.hpp>
|
||||||
|
|
||||||
#ifdef ASSIMP_BUILD_NO_OWN_ZLIB
|
#ifdef ASSIMP_BUILD_NO_OWN_ZLIB
|
||||||
# include <zlib.h>
|
# include <zlib.h>
|
||||||
#else
|
#else
|
||||||
# include "../contrib/zlib/zlib.h"
|
# include <contrib/zlib/zlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
|
@ -52,10 +52,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "ConvertToLHProcess.h"
|
#include "ConvertToLHProcess.h"
|
||||||
#include "StringUtils.h"
|
#include "StringUtils.h"
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "../include/assimp/IOSystem.hpp"
|
#include <assimp/IOSystem.hpp>
|
||||||
#include "../include/assimp/anim.h"
|
#include <assimp/anim.h>
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
|
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
|
@ -43,9 +43,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef AI_B3DIMPORTER_H_INC
|
#ifndef AI_B3DIMPORTER_H_INC
|
||||||
#define AI_B3DIMPORTER_H_INC
|
#define AI_B3DIMPORTER_H_INC
|
||||||
|
|
||||||
#include "../include/assimp/types.h"
|
#include <assimp/types.h>
|
||||||
#include "../include/assimp/mesh.h"
|
#include <assimp/mesh.h>
|
||||||
#include "../include/assimp/material.h"
|
#include <assimp/material.h>
|
||||||
#include "BaseImporter.h"
|
#include "BaseImporter.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
|
@ -46,11 +46,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "BVHLoader.h"
|
#include "BVHLoader.h"
|
||||||
#include "fast_atof.h"
|
#include "fast_atof.h"
|
||||||
#include "SkeletonMeshBuilder.h"
|
#include "SkeletonMeshBuilder.h"
|
||||||
#include "../include/assimp/Importer.hpp"
|
#include <assimp/Importer.hpp>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "TinyFormatter.h"
|
#include "TinyFormatter.h"
|
||||||
#include "../include/assimp/IOSystem.hpp"
|
#include <assimp/IOSystem.hpp>
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
using namespace Assimp::Formatter;
|
using namespace Assimp::Formatter;
|
||||||
|
|
|
@ -47,9 +47,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "FileSystemFilter.h"
|
#include "FileSystemFilter.h"
|
||||||
#include "Importer.h"
|
#include "Importer.h"
|
||||||
#include "ByteSwapper.h"
|
#include "ByteSwapper.h"
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
#include "../include/assimp/Importer.hpp"
|
#include <assimp/Importer.hpp>
|
||||||
#include "../include/assimp/postprocess.h"
|
#include <assimp/postprocess.h>
|
||||||
#include <ios>
|
#include <ios>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
|
@ -48,8 +48,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include "../include/assimp/types.h"
|
#include <assimp/types.h>
|
||||||
#include "../include/assimp/ProgressHandler.hpp"
|
#include <assimp/ProgressHandler.hpp>
|
||||||
|
|
||||||
struct aiScene;
|
struct aiScene;
|
||||||
|
|
||||||
|
|
|
@ -43,8 +43,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "BaseImporter.h"
|
#include "BaseImporter.h"
|
||||||
#include "BaseProcess.h"
|
#include "BaseProcess.h"
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
#include "Importer.h"
|
#include "Importer.h"
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
|
@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include "../include/assimp/types.h"
|
#include <assimp/types.h>
|
||||||
#include "GenericProperty.h"
|
#include "GenericProperty.h"
|
||||||
|
|
||||||
struct aiScene;
|
struct aiScene;
|
||||||
|
|
|
@ -47,8 +47,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
|
||||||
#include "Bitmap.h"
|
#include "Bitmap.h"
|
||||||
#include "../include/assimp/texture.h"
|
#include <assimp/texture.h>
|
||||||
#include "../include/assimp/IOStream.hpp"
|
#include <assimp/IOStream.hpp>
|
||||||
#include "ByteSwapper.h"
|
#include "ByteSwapper.h"
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
|
@ -48,7 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "BaseImporter.h"
|
#include "BaseImporter.h"
|
||||||
#include "TinyFormatter.h"
|
#include "TinyFormatter.h"
|
||||||
#include "StreamReader.h"
|
#include "StreamReader.h"
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "BlenderModifier.h"
|
#include "BlenderModifier.h"
|
||||||
#include "BlenderBMesh.h"
|
#include "BlenderBMesh.h"
|
||||||
#include "StringUtils.h"
|
#include "StringUtils.h"
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
#include "StringComparison.h"
|
#include "StringComparison.h"
|
||||||
|
|
||||||
#include "StreamReader.h"
|
#include "StreamReader.h"
|
||||||
|
@ -554,10 +554,8 @@ void BlenderImporter::ResolveTexture(aiMaterial* out, const Material* mat, const
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void BlenderImporter::BuildMaterials(ConversionData& conv_data)
|
void BlenderImporter::BuildDefaultMaterial(Blender::ConversionData& conv_data)
|
||||||
{
|
{
|
||||||
conv_data.materials->reserve(conv_data.materials_raw.size());
|
|
||||||
|
|
||||||
// add a default material if necessary
|
// add a default material if necessary
|
||||||
unsigned int index = static_cast<unsigned int>( -1 );
|
unsigned int index = static_cast<unsigned int>( -1 );
|
||||||
for( aiMesh* mesh : conv_data.meshes.get() ) {
|
for( aiMesh* mesh : conv_data.meshes.get() ) {
|
||||||
|
@ -588,6 +586,124 @@ void BlenderImporter::BuildMaterials(ConversionData& conv_data)
|
||||||
mesh->mMaterialIndex = index;
|
mesh->mMaterialIndex = index;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void BlenderImporter::AddBlendParams(aiMaterial* result, const Material* source)
|
||||||
|
{
|
||||||
|
aiColor3D diffuseColor(source->r, source->g, source->b);
|
||||||
|
result->AddProperty(&diffuseColor, 1, "$mat.blend.diffuse.color", 0, 0);
|
||||||
|
|
||||||
|
float diffuseIntensity = source->ref;
|
||||||
|
result->AddProperty(&diffuseIntensity, 1, "$mat.blend.diffuse.intensity", 0, 0);
|
||||||
|
|
||||||
|
int diffuseShader = source->diff_shader;
|
||||||
|
result->AddProperty(&diffuseShader, 1, "$mat.blend.diffuse.shader", 0, 0);
|
||||||
|
|
||||||
|
int diffuseRamp = 0;
|
||||||
|
result->AddProperty(&diffuseRamp, 1, "$mat.blend.diffuse.ramp", 0, 0);
|
||||||
|
|
||||||
|
|
||||||
|
aiColor3D specularColor(source->specr, source->specg, source->specb);
|
||||||
|
result->AddProperty(&specularColor, 1, "$mat.blend.specular.color", 0, 0);
|
||||||
|
|
||||||
|
float specularIntensity = source->spec;
|
||||||
|
result->AddProperty(&specularIntensity, 1, "$mat.blend.specular.intensity", 0, 0);
|
||||||
|
|
||||||
|
int specularShader = source->spec_shader;
|
||||||
|
result->AddProperty(&specularShader, 1, "$mat.blend.specular.shader", 0, 0);
|
||||||
|
|
||||||
|
int specularRamp = 0;
|
||||||
|
result->AddProperty(&specularRamp, 1, "$mat.blend.specular.ramp", 0, 0);
|
||||||
|
|
||||||
|
int specularHardness = source->har;
|
||||||
|
result->AddProperty(&specularHardness, 1, "$mat.blend.specular.hardness", 0, 0);
|
||||||
|
|
||||||
|
|
||||||
|
int transparencyUse = source->mode & MA_TRANSPARENCY ? 1 : 0;
|
||||||
|
result->AddProperty(&transparencyUse, 1, "$mat.blend.transparency.use", 0, 0);
|
||||||
|
|
||||||
|
int transparencyMethod = source->mode & MA_RAYTRANSP ? 2 : (source->mode & MA_ZTRANSP ? 1 : 0);
|
||||||
|
result->AddProperty(&transparencyMethod, 1, "$mat.blend.transparency.method", 0, 0);
|
||||||
|
|
||||||
|
float transparencyAlpha = source->alpha;
|
||||||
|
result->AddProperty(&transparencyAlpha, 1, "$mat.blend.transparency.alpha", 0, 0);
|
||||||
|
|
||||||
|
float transparencySpecular = source->spectra;
|
||||||
|
result->AddProperty(&transparencySpecular, 1, "$mat.blend.transparency.specular", 0, 0);
|
||||||
|
|
||||||
|
float transparencyFresnel = source->fresnel_tra;
|
||||||
|
result->AddProperty(&transparencyFresnel, 1, "$mat.blend.transparency.fresnel", 0, 0);
|
||||||
|
|
||||||
|
float transparencyBlend = source->fresnel_tra_i;
|
||||||
|
result->AddProperty(&transparencyBlend, 1, "$mat.blend.transparency.blend", 0, 0);
|
||||||
|
|
||||||
|
float transparencyIor = source->ang;
|
||||||
|
result->AddProperty(&transparencyIor, 1, "$mat.blend.transparency.ior", 0, 0);
|
||||||
|
|
||||||
|
float transparencyFilter = source->filter;
|
||||||
|
result->AddProperty(&transparencyFilter, 1, "$mat.blend.transparency.filter", 0, 0);
|
||||||
|
|
||||||
|
float transparencyFalloff = source->tx_falloff;
|
||||||
|
result->AddProperty(&transparencyFalloff, 1, "$mat.blend.transparency.falloff", 0, 0);
|
||||||
|
|
||||||
|
float transparencyLimit = source->tx_limit;
|
||||||
|
result->AddProperty(&transparencyLimit, 1, "$mat.blend.transparency.limit", 0, 0);
|
||||||
|
|
||||||
|
int transparencyDepth = source->ray_depth_tra;
|
||||||
|
result->AddProperty(&transparencyDepth, 1, "$mat.blend.transparency.depth", 0, 0);
|
||||||
|
|
||||||
|
float transparencyGlossAmount = source->gloss_tra;
|
||||||
|
result->AddProperty(&transparencyGlossAmount, 1, "$mat.blend.transparency.glossAmount", 0, 0);
|
||||||
|
|
||||||
|
float transparencyGlossThreshold = source->adapt_thresh_tra;
|
||||||
|
result->AddProperty(&transparencyGlossThreshold, 1, "$mat.blend.transparency.glossThreshold", 0, 0);
|
||||||
|
|
||||||
|
int transparencyGlossSamples = source->samp_gloss_tra;
|
||||||
|
result->AddProperty(&transparencyGlossSamples, 1, "$mat.blend.transparency.glossSamples", 0, 0);
|
||||||
|
|
||||||
|
|
||||||
|
int mirrorUse = source->mode & MA_RAYMIRROR ? 1 : 0;
|
||||||
|
result->AddProperty(&mirrorUse, 1, "$mat.blend.mirror.use", 0, 0);
|
||||||
|
|
||||||
|
float mirrorReflectivity = source->ray_mirror;
|
||||||
|
result->AddProperty(&mirrorReflectivity, 1, "$mat.blend.mirror.reflectivity", 0, 0);
|
||||||
|
|
||||||
|
aiColor3D mirrorColor(source->mirr, source->mirg, source->mirb);
|
||||||
|
result->AddProperty(&mirrorColor, 1, "$mat.blend.mirror.color", 0, 0);
|
||||||
|
|
||||||
|
float mirrorFresnel = source->fresnel_mir;
|
||||||
|
result->AddProperty(&mirrorFresnel, 1, "$mat.blend.mirror.fresnel", 0, 0);
|
||||||
|
|
||||||
|
float mirrorBlend = source->fresnel_mir_i;
|
||||||
|
result->AddProperty(&mirrorBlend, 1, "$mat.blend.mirror.blend", 0, 0);
|
||||||
|
|
||||||
|
int mirrorDepth = source->ray_depth;
|
||||||
|
result->AddProperty(&mirrorDepth, 1, "$mat.blend.mirror.depth", 0, 0);
|
||||||
|
|
||||||
|
float mirrorMaxDist = source->dist_mir;
|
||||||
|
result->AddProperty(&mirrorMaxDist, 1, "$mat.blend.mirror.maxDist", 0, 0);
|
||||||
|
|
||||||
|
int mirrorFadeTo = source->fadeto_mir;
|
||||||
|
result->AddProperty(&mirrorFadeTo, 1, "$mat.blend.mirror.fadeTo", 0, 0);
|
||||||
|
|
||||||
|
float mirrorGlossAmount = source->gloss_mir;
|
||||||
|
result->AddProperty(&mirrorGlossAmount, 1, "$mat.blend.mirror.glossAmount", 0, 0);
|
||||||
|
|
||||||
|
float mirrorGlossThreshold = source->adapt_thresh_mir;
|
||||||
|
result->AddProperty(&mirrorGlossThreshold, 1, "$mat.blend.mirror.glossThreshold", 0, 0);
|
||||||
|
|
||||||
|
int mirrorGlossSamples = source->samp_gloss_mir;
|
||||||
|
result->AddProperty(&mirrorGlossSamples, 1, "$mat.blend.mirror.glossSamples", 0, 0);
|
||||||
|
|
||||||
|
float mirrorGlossAnisotropic = source->aniso_gloss_mir;
|
||||||
|
result->AddProperty(&mirrorGlossAnisotropic, 1, "$mat.blend.mirror.glossAnisotropic", 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BlenderImporter::BuildMaterials(ConversionData& conv_data)
|
||||||
|
{
|
||||||
|
conv_data.materials->reserve(conv_data.materials_raw.size());
|
||||||
|
|
||||||
|
BuildDefaultMaterial(conv_data);
|
||||||
|
|
||||||
for(std::shared_ptr<Material> mat : conv_data.materials_raw) {
|
for(std::shared_ptr<Material> mat : conv_data.materials_raw) {
|
||||||
|
|
||||||
|
@ -604,7 +720,6 @@ void BlenderImporter::BuildMaterials(ConversionData& conv_data)
|
||||||
aiString name = aiString(mat->id.name+2); // skip over the name prefix 'MA'
|
aiString name = aiString(mat->id.name+2); // skip over the name prefix 'MA'
|
||||||
mout->AddProperty(&name,AI_MATKEY_NAME);
|
mout->AddProperty(&name,AI_MATKEY_NAME);
|
||||||
|
|
||||||
|
|
||||||
// basic material colors
|
// basic material colors
|
||||||
aiColor3D col(mat->r,mat->g,mat->b);
|
aiColor3D col(mat->r,mat->g,mat->b);
|
||||||
if (mat->r || mat->g || mat->b ) {
|
if (mat->r || mat->g || mat->b ) {
|
||||||
|
@ -647,6 +762,8 @@ void BlenderImporter::BuildMaterials(ConversionData& conv_data)
|
||||||
|
|
||||||
ResolveTexture(mout,mat.get(),mat->mtex[i].get(),conv_data);
|
ResolveTexture(mout,mat.get(),mat->mtex[i].get(),conv_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AddBlendParams(mout, mat.get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1049,7 +1166,24 @@ aiLight* BlenderImporter::ConvertLight(const Scene& /*in*/, const Object* obj, c
|
||||||
|
|
||||||
// blender orients directional lights as facing toward -z
|
// blender orients directional lights as facing toward -z
|
||||||
out->mDirection = aiVector3D(0.f, 0.f, -1.f);
|
out->mDirection = aiVector3D(0.f, 0.f, -1.f);
|
||||||
|
out->mUp = aiVector3D(0.f, 1.f, 0.f);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case Lamp::Type_Area:
|
||||||
|
out->mType = aiLightSource_AREA;
|
||||||
|
|
||||||
|
if (lamp->area_shape == 0) {
|
||||||
|
out->mSize = aiVector2D(lamp->area_size, lamp->area_size);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
out->mSize = aiVector2D(lamp->area_size, lamp->area_sizey);
|
||||||
|
}
|
||||||
|
|
||||||
|
// blender orients directional lights as facing toward -z
|
||||||
|
out->mDirection = aiVector3D(0.f, 0.f, -1.f);
|
||||||
|
out->mUp = aiVector3D(0.f, 1.f, 0.f);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -179,9 +179,18 @@ private:
|
||||||
);
|
);
|
||||||
|
|
||||||
// --------------------
|
// --------------------
|
||||||
|
void BuildDefaultMaterial(
|
||||||
|
Blender::ConversionData& conv_data
|
||||||
|
);
|
||||||
|
|
||||||
|
void AddBlendParams(
|
||||||
|
aiMaterial* result,
|
||||||
|
const Blender::Material* source
|
||||||
|
);
|
||||||
|
|
||||||
void BuildMaterials(
|
void BuildMaterials(
|
||||||
Blender::ConversionData& conv_data
|
Blender::ConversionData& conv_data
|
||||||
) ;
|
);
|
||||||
|
|
||||||
// --------------------
|
// --------------------
|
||||||
void ResolveTexture(
|
void ResolveTexture(
|
||||||
|
|
|
@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "BlenderModifier.h"
|
#include "BlenderModifier.h"
|
||||||
#include "SceneCombiner.h"
|
#include "SceneCombiner.h"
|
||||||
#include "Subdivision.h"
|
#include "Subdivision.h"
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
|
@ -206,6 +206,10 @@ template <> void Structure :: Convert<Lamp> (
|
||||||
ReadField<ErrorPolicy_Igno>(dest.att2,"att2",db);
|
ReadField<ErrorPolicy_Igno>(dest.att2,"att2",db);
|
||||||
ReadField<ErrorPolicy_Igno>((int&)dest.falloff_type,"falloff_type",db);
|
ReadField<ErrorPolicy_Igno>((int&)dest.falloff_type,"falloff_type",db);
|
||||||
ReadField<ErrorPolicy_Igno>(dest.sun_brightness,"sun_brightness",db);
|
ReadField<ErrorPolicy_Igno>(dest.sun_brightness,"sun_brightness",db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.area_size,"area_size",db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.area_sizey,"area_sizey",db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.area_sizez,"area_sizez",db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.area_shape,"area_shape",db);
|
||||||
|
|
||||||
db.reader->IncPtr(size);
|
db.reader->IncPtr(size);
|
||||||
}
|
}
|
||||||
|
@ -297,7 +301,6 @@ template <> void Structure :: Convert<Material> (
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
|
||||||
ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
|
ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
|
||||||
ReadField<ErrorPolicy_Warn>(dest.r,"r",db);
|
ReadField<ErrorPolicy_Warn>(dest.r,"r",db);
|
||||||
ReadField<ErrorPolicy_Warn>(dest.g,"g",db);
|
ReadField<ErrorPolicy_Warn>(dest.g,"g",db);
|
||||||
|
@ -326,6 +329,91 @@ template <> void Structure :: Convert<Material> (
|
||||||
ReadField<ErrorPolicy_Warn>(dest.spec_shader,"spec_shader",db);
|
ReadField<ErrorPolicy_Warn>(dest.spec_shader,"spec_shader",db);
|
||||||
ReadFieldPtr<ErrorPolicy_Igno>(dest.mtex,"*mtex",db);
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.mtex,"*mtex",db);
|
||||||
|
|
||||||
|
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.amb, "amb", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.ang, "ang", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.spectra, "spectra", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.spec, "spec", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.zoffs, "zoffs", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.add, "add", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.fresnel_mir, "fresnel_mir", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.fresnel_mir_i, "fresnel_mir_i", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.fresnel_tra, "fresnel_tra", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.fresnel_tra_i, "fresnel_tra_i", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.filter, "filter", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.tx_limit, "tx_limit", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.tx_falloff, "tx_falloff", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.gloss_mir, "gloss_mir", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.gloss_tra, "gloss_tra", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.adapt_thresh_mir, "adapt_thresh_mir", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.adapt_thresh_tra, "adapt_thresh_tra", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.aniso_gloss_mir, "aniso_gloss_mir", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.dist_mir, "dist_mir", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.hasize, "hasize", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.flaresize, "flaresize", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.subsize, "subsize", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.flareboost, "flareboost", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.strand_sta, "strand_sta", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.strand_end, "strand_end", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.strand_ease, "strand_ease", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.strand_surfnor, "strand_surfnor", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.strand_min, "strand_min", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.strand_widthfade, "strand_widthfade", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.sbias, "sbias", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.lbias, "lbias", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.shad_alpha, "shad_alpha", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.param, "param", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.rms, "rms", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.rampfac_col, "rampfac_col", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.rampfac_spec, "rampfac_spec", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.friction, "friction", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.fh, "fh", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.reflect, "reflect", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.fhdist, "fhdist", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.xyfrict, "xyfrict", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.sss_radius, "sss_radius", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.sss_col, "sss_col", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.sss_error, "sss_error", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.sss_scale, "sss_scale", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.sss_ior, "sss_ior", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.sss_colfac, "sss_colfac", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.sss_texfac, "sss_texfac", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.sss_front, "sss_front", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.sss_back, "sss_back", db);
|
||||||
|
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.material_type, "material_type", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.flag, "flag", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.ray_depth, "ray_depth", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.ray_depth_tra, "ray_depth_tra", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.samp_gloss_mir, "samp_gloss_mir", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.samp_gloss_tra, "samp_gloss_tra", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.fadeto_mir, "fadeto_mir", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.shade_flag, "shade_flag", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.flarec, "flarec", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.starc, "starc", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.linec, "linec", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.ringc, "ringc", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.pr_lamp, "pr_lamp", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.pr_texture, "pr_texture", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.ml_flag, "ml_flag", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.diff_shader, "diff_shader", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.spec_shader, "spec_shader", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.texco, "texco", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.mapto, "mapto", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.ramp_show, "ramp_show", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.pad3, "pad3", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.dynamode, "dynamode", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.pad2, "pad2", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.sss_flag, "sss_flag", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.sss_preset, "sss_preset", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.shadowonly_flag, "shadowonly_flag", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.index, "index", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.vcol_alpha, "vcol_alpha", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.pad4, "pad4", db);
|
||||||
|
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.seed1, "seed1", db);
|
||||||
|
ReadField<ErrorPolicy_Igno>(dest.seed2, "seed2", db);
|
||||||
|
|
||||||
db.reader->IncPtr(size);
|
db.reader->IncPtr(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -242,6 +242,9 @@ struct MDeformVert : ElemBase {
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
#define MA_RAYMIRROR 0x40000
|
#define MA_RAYMIRROR 0x40000
|
||||||
|
#define MA_TRANSPARENCY 0x10000
|
||||||
|
#define MA_RAYTRANSP 0x20000
|
||||||
|
#define MA_ZTRANSP 0x00040
|
||||||
|
|
||||||
struct Material : ElemBase {
|
struct Material : ElemBase {
|
||||||
ID id FAIL;
|
ID id FAIL;
|
||||||
|
@ -261,6 +264,89 @@ struct Material : ElemBase {
|
||||||
float darkness;
|
float darkness;
|
||||||
float refrac;
|
float refrac;
|
||||||
|
|
||||||
|
|
||||||
|
float amb;
|
||||||
|
float ang;
|
||||||
|
float spectra;
|
||||||
|
float spec;
|
||||||
|
float zoffs;
|
||||||
|
float add;
|
||||||
|
float fresnel_mir;
|
||||||
|
float fresnel_mir_i;
|
||||||
|
float fresnel_tra;
|
||||||
|
float fresnel_tra_i;
|
||||||
|
float filter;
|
||||||
|
float tx_limit;
|
||||||
|
float tx_falloff;
|
||||||
|
float gloss_mir;
|
||||||
|
float gloss_tra;
|
||||||
|
float adapt_thresh_mir;
|
||||||
|
float adapt_thresh_tra;
|
||||||
|
float aniso_gloss_mir;
|
||||||
|
float dist_mir;
|
||||||
|
float hasize;
|
||||||
|
float flaresize;
|
||||||
|
float subsize;
|
||||||
|
float flareboost;
|
||||||
|
float strand_sta;
|
||||||
|
float strand_end;
|
||||||
|
float strand_ease;
|
||||||
|
float strand_surfnor;
|
||||||
|
float strand_min;
|
||||||
|
float strand_widthfade;
|
||||||
|
float sbias;
|
||||||
|
float lbias;
|
||||||
|
float shad_alpha;
|
||||||
|
float param;
|
||||||
|
float rms;
|
||||||
|
float rampfac_col;
|
||||||
|
float rampfac_spec;
|
||||||
|
float friction;
|
||||||
|
float fh;
|
||||||
|
float reflect;
|
||||||
|
float fhdist;
|
||||||
|
float xyfrict;
|
||||||
|
float sss_radius;
|
||||||
|
float sss_col;
|
||||||
|
float sss_error;
|
||||||
|
float sss_scale;
|
||||||
|
float sss_ior;
|
||||||
|
float sss_colfac;
|
||||||
|
float sss_texfac;
|
||||||
|
float sss_front;
|
||||||
|
float sss_back;
|
||||||
|
|
||||||
|
short material_type;
|
||||||
|
short flag;
|
||||||
|
short ray_depth;
|
||||||
|
short ray_depth_tra;
|
||||||
|
short samp_gloss_mir;
|
||||||
|
short samp_gloss_tra;
|
||||||
|
short fadeto_mir;
|
||||||
|
short shade_flag;
|
||||||
|
short flarec;
|
||||||
|
short starc;
|
||||||
|
short linec;
|
||||||
|
short ringc;
|
||||||
|
short pr_lamp;
|
||||||
|
short pr_texture;
|
||||||
|
short ml_flag;
|
||||||
|
short texco;
|
||||||
|
short mapto;
|
||||||
|
short ramp_show;
|
||||||
|
short pad3;
|
||||||
|
short dynamode;
|
||||||
|
short pad2;
|
||||||
|
short sss_flag;
|
||||||
|
short sss_preset;
|
||||||
|
short shadowonly_flag;
|
||||||
|
short index;
|
||||||
|
short vcol_alpha;
|
||||||
|
short pad4;
|
||||||
|
|
||||||
|
char seed1;
|
||||||
|
char seed2;
|
||||||
|
|
||||||
std::shared_ptr<Group> group;
|
std::shared_ptr<Group> group;
|
||||||
|
|
||||||
short diff_shader WARN;
|
short diff_shader WARN;
|
||||||
|
@ -371,8 +457,8 @@ struct Lamp : ElemBase {
|
||||||
|
|
||||||
//short ray_samp, ray_sampy, ray_sampz;
|
//short ray_samp, ray_sampy, ray_sampz;
|
||||||
//short ray_samp_type;
|
//short ray_samp_type;
|
||||||
//short area_shape;
|
short area_shape;
|
||||||
//float area_size, area_sizey, area_sizez;
|
float area_size, area_sizey, area_sizez;
|
||||||
//float adapt_thresh;
|
//float adapt_thresh;
|
||||||
//short ray_samp_method;
|
//short ray_samp_method;
|
||||||
|
|
||||||
|
|
|
@ -43,8 +43,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef AI_BYTESWAPPER_H_INC
|
#ifndef AI_BYTESWAPPER_H_INC
|
||||||
#define AI_BYTESWAPPER_H_INC
|
#define AI_BYTESWAPPER_H_INC
|
||||||
|
|
||||||
#include "../include/assimp/ai_assert.h"
|
#include <assimp/ai_assert.h>
|
||||||
#include "../include/assimp/types.h"
|
#include <assimp/types.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#if _MSC_VER >= 1400
|
#if _MSC_VER >= 1400
|
||||||
|
|
|
@ -44,9 +44,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef AI_CIOSYSTEM_H_INCLUDED
|
#ifndef AI_CIOSYSTEM_H_INCLUDED
|
||||||
#define AI_CIOSYSTEM_H_INCLUDED
|
#define AI_CIOSYSTEM_H_INCLUDED
|
||||||
|
|
||||||
#include "../include/assimp/cfileio.h"
|
#include <assimp/cfileio.h>
|
||||||
#include "../include/assimp/IOStream.hpp"
|
#include <assimp/IOStream.hpp>
|
||||||
#include "../include/assimp/IOSystem.hpp"
|
#include <assimp/IOSystem.hpp>
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
|
|
|
@ -202,7 +202,7 @@ SET(ASSIMP_LOADER_SRCS "")
|
||||||
SET(ASSIMP_IMPORTERS_ENABLED "") # list of enabled importers
|
SET(ASSIMP_IMPORTERS_ENABLED "") # list of enabled importers
|
||||||
SET(ASSIMP_IMPORTERS_DISABLED "") # disabled list (used to print)
|
SET(ASSIMP_IMPORTERS_DISABLED "") # disabled list (used to print)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(3DS
|
ADD_ASSIMP_IMPORTER( 3DS
|
||||||
3DSConverter.cpp
|
3DSConverter.cpp
|
||||||
3DSHelper.h
|
3DSHelper.h
|
||||||
3DSLoader.cpp
|
3DSLoader.cpp
|
||||||
|
@ -211,41 +211,41 @@ ADD_ASSIMP_IMPORTER(3DS
|
||||||
3DSExporter.cpp
|
3DSExporter.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(AC
|
ADD_ASSIMP_IMPORTER( AC
|
||||||
ACLoader.cpp
|
ACLoader.cpp
|
||||||
ACLoader.h
|
ACLoader.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(ASE
|
ADD_ASSIMP_IMPORTER( ASE
|
||||||
ASELoader.cpp
|
ASELoader.cpp
|
||||||
ASELoader.h
|
ASELoader.h
|
||||||
ASEParser.cpp
|
ASEParser.cpp
|
||||||
ASEParser.h
|
ASEParser.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(ASSBIN
|
ADD_ASSIMP_IMPORTER( ASSBIN
|
||||||
AssbinExporter.h
|
AssbinExporter.h
|
||||||
AssbinExporter.cpp
|
AssbinExporter.cpp
|
||||||
AssbinLoader.h
|
AssbinLoader.h
|
||||||
AssbinLoader.cpp
|
AssbinLoader.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(ASSXML
|
ADD_ASSIMP_IMPORTER( ASSXML
|
||||||
AssxmlExporter.h
|
AssxmlExporter.h
|
||||||
AssxmlExporter.cpp
|
AssxmlExporter.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(B3D
|
ADD_ASSIMP_IMPORTER( B3D
|
||||||
B3DImporter.cpp
|
B3DImporter.cpp
|
||||||
B3DImporter.h
|
B3DImporter.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(BVH
|
ADD_ASSIMP_IMPORTER( BVH
|
||||||
BVHLoader.cpp
|
BVHLoader.cpp
|
||||||
BVHLoader.h
|
BVHLoader.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(COLLADA
|
ADD_ASSIMP_IMPORTER( COLLADA
|
||||||
ColladaHelper.h
|
ColladaHelper.h
|
||||||
ColladaLoader.cpp
|
ColladaLoader.cpp
|
||||||
ColladaLoader.h
|
ColladaLoader.h
|
||||||
|
@ -255,35 +255,39 @@ ADD_ASSIMP_IMPORTER(COLLADA
|
||||||
ColladaExporter.cpp
|
ColladaExporter.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(DXF
|
ADD_ASSIMP_IMPORTER( DXF
|
||||||
DXFLoader.cpp
|
DXFLoader.cpp
|
||||||
DXFLoader.h
|
DXFLoader.h
|
||||||
DXFHelper.h
|
DXFHelper.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(CSM
|
ADD_ASSIMP_IMPORTER( CSM
|
||||||
CSMLoader.cpp
|
CSMLoader.cpp
|
||||||
CSMLoader.h
|
CSMLoader.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(HMP
|
ADD_ASSIMP_IMPORTER( HMP
|
||||||
HMPFileData.h
|
HMPFileData.h
|
||||||
HMPLoader.cpp
|
HMPLoader.cpp
|
||||||
HMPLoader.h
|
HMPLoader.h
|
||||||
HalfLifeFileData.h
|
HalfLifeFileData.h
|
||||||
)
|
)
|
||||||
|
|
||||||
#FIXME: allow to set IRRMESH by option
|
ADD_ASSIMP_IMPORTER( IRRMESH
|
||||||
ADD_ASSIMP_IMPORTER(IRR
|
|
||||||
IRRLoader.cpp
|
|
||||||
IRRLoader.h
|
|
||||||
IRRMeshLoader.cpp
|
IRRMeshLoader.cpp
|
||||||
IRRMeshLoader.h
|
IRRMeshLoader.h
|
||||||
IRRShared.cpp
|
IRRShared.cpp
|
||||||
IRRShared.h
|
IRRShared.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(LWO
|
ADD_ASSIMP_IMPORTER( IRR
|
||||||
|
IRRLoader.cpp
|
||||||
|
IRRLoader.h
|
||||||
|
IRRShared.cpp
|
||||||
|
IRRShared.h
|
||||||
|
)
|
||||||
|
|
||||||
|
ADD_ASSIMP_IMPORTER( LWO
|
||||||
LWOAnimation.cpp
|
LWOAnimation.cpp
|
||||||
LWOAnimation.h
|
LWOAnimation.h
|
||||||
LWOBLoader.cpp
|
LWOBLoader.cpp
|
||||||
|
@ -293,39 +297,39 @@ ADD_ASSIMP_IMPORTER(LWO
|
||||||
LWOMaterial.cpp
|
LWOMaterial.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(LWS
|
ADD_ASSIMP_IMPORTER( LWS
|
||||||
LWSLoader.cpp
|
LWSLoader.cpp
|
||||||
LWSLoader.h
|
LWSLoader.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(MD2
|
ADD_ASSIMP_IMPORTER( MD2
|
||||||
MD2FileData.h
|
MD2FileData.h
|
||||||
MD2Loader.cpp
|
MD2Loader.cpp
|
||||||
MD2Loader.h
|
MD2Loader.h
|
||||||
MD2NormalTable.h
|
MD2NormalTable.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(MD3
|
ADD_ASSIMP_IMPORTER( MD3
|
||||||
MD3FileData.h
|
MD3FileData.h
|
||||||
MD3Loader.cpp
|
MD3Loader.cpp
|
||||||
MD3Loader.h
|
MD3Loader.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(MD5
|
ADD_ASSIMP_IMPORTER( MD5
|
||||||
MD5Loader.cpp
|
MD5Loader.cpp
|
||||||
MD5Loader.h
|
MD5Loader.h
|
||||||
MD5Parser.cpp
|
MD5Parser.cpp
|
||||||
MD5Parser.h
|
MD5Parser.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(MDC
|
ADD_ASSIMP_IMPORTER( MDC
|
||||||
MDCFileData.h
|
MDCFileData.h
|
||||||
MDCLoader.cpp
|
MDCLoader.cpp
|
||||||
MDCLoader.h
|
MDCLoader.h
|
||||||
MDCNormalTable.h
|
MDCNormalTable.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(MDL
|
ADD_ASSIMP_IMPORTER( MDL
|
||||||
MDLDefaultColorMap.h
|
MDLDefaultColorMap.h
|
||||||
MDLFileData.h
|
MDLFileData.h
|
||||||
MDLLoader.cpp
|
MDLLoader.cpp
|
||||||
|
@ -339,22 +343,22 @@ SET( MaterialSystem_SRCS
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( MaterialSystem FILES ${MaterialSystem_SRCS})
|
SOURCE_GROUP( MaterialSystem FILES ${MaterialSystem_SRCS})
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(NFF
|
ADD_ASSIMP_IMPORTER( NFF
|
||||||
NFFLoader.cpp
|
NFFLoader.cpp
|
||||||
NFFLoader.h
|
NFFLoader.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(NDO
|
ADD_ASSIMP_IMPORTER( NDO
|
||||||
NDOLoader.cpp
|
NDOLoader.cpp
|
||||||
NDOLoader.h
|
NDOLoader.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(OFF
|
ADD_ASSIMP_IMPORTER( OFF
|
||||||
OFFLoader.cpp
|
OFFLoader.cpp
|
||||||
OFFLoader.h
|
OFFLoader.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(OBJ
|
ADD_ASSIMP_IMPORTER( OBJ
|
||||||
ObjFileData.h
|
ObjFileData.h
|
||||||
ObjFileImporter.cpp
|
ObjFileImporter.cpp
|
||||||
ObjFileImporter.h
|
ObjFileImporter.h
|
||||||
|
@ -363,12 +367,11 @@ ADD_ASSIMP_IMPORTER(OBJ
|
||||||
ObjFileParser.cpp
|
ObjFileParser.cpp
|
||||||
ObjFileParser.h
|
ObjFileParser.h
|
||||||
ObjTools.h
|
ObjTools.h
|
||||||
|
|
||||||
ObjExporter.h
|
ObjExporter.h
|
||||||
ObjExporter.cpp
|
ObjExporter.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(OGRE
|
ADD_ASSIMP_IMPORTER( OGRE
|
||||||
OgreImporter.h
|
OgreImporter.h
|
||||||
OgreStructs.h
|
OgreStructs.h
|
||||||
OgreParsingUtils.h
|
OgreParsingUtils.h
|
||||||
|
@ -381,7 +384,7 @@ ADD_ASSIMP_IMPORTER(OGRE
|
||||||
OgreMaterial.cpp
|
OgreMaterial.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(OPENGEX
|
ADD_ASSIMP_IMPORTER( OPENGEX
|
||||||
OpenGEXExporter.cpp
|
OpenGEXExporter.cpp
|
||||||
OpenGEXExporter.h
|
OpenGEXExporter.h
|
||||||
OpenGEXImporter.cpp
|
OpenGEXImporter.cpp
|
||||||
|
@ -389,7 +392,7 @@ ADD_ASSIMP_IMPORTER(OPENGEX
|
||||||
OpenGEXStructs.h
|
OpenGEXStructs.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(PLY
|
ADD_ASSIMP_IMPORTER( PLY
|
||||||
PlyLoader.cpp
|
PlyLoader.cpp
|
||||||
PlyLoader.h
|
PlyLoader.h
|
||||||
PlyParser.cpp
|
PlyParser.cpp
|
||||||
|
@ -398,18 +401,18 @@ ADD_ASSIMP_IMPORTER(PLY
|
||||||
PlyExporter.h
|
PlyExporter.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(MS3D
|
ADD_ASSIMP_IMPORTER( MS3D
|
||||||
MS3DLoader.cpp
|
MS3DLoader.cpp
|
||||||
MS3DLoader.h
|
MS3DLoader.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(COB
|
ADD_ASSIMP_IMPORTER( COB
|
||||||
COBLoader.cpp
|
COBLoader.cpp
|
||||||
COBLoader.h
|
COBLoader.h
|
||||||
COBScene.h
|
COBScene.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(BLEND
|
ADD_ASSIMP_IMPORTER( BLEND
|
||||||
BlenderLoader.cpp
|
BlenderLoader.cpp
|
||||||
BlenderLoader.h
|
BlenderLoader.h
|
||||||
BlenderDNA.cpp
|
BlenderDNA.cpp
|
||||||
|
@ -427,7 +430,7 @@ ADD_ASSIMP_IMPORTER(BLEND
|
||||||
BlenderTessellator.cpp
|
BlenderTessellator.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(IFC
|
ADD_ASSIMP_IMPORTER( IFC
|
||||||
IFCLoader.cpp
|
IFCLoader.cpp
|
||||||
IFCLoader.h
|
IFCLoader.h
|
||||||
IFCReaderGen.cpp
|
IFCReaderGen.cpp
|
||||||
|
@ -450,13 +453,13 @@ if (MSVC AND ASSIMP_BUILD_IFC_IMPORTER)
|
||||||
set_source_files_properties(IFCReaderGen.cpp PROPERTIES COMPILE_FLAGS "/bigobj")
|
set_source_files_properties(IFCReaderGen.cpp PROPERTIES COMPILE_FLAGS "/bigobj")
|
||||||
endif (MSVC AND ASSIMP_BUILD_IFC_IMPORTER)
|
endif (MSVC AND ASSIMP_BUILD_IFC_IMPORTER)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(XGL
|
ADD_ASSIMP_IMPORTER( XGL
|
||||||
XGLLoader.cpp
|
XGLLoader.cpp
|
||||||
XGLLoader.h
|
XGLLoader.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(FBX
|
ADD_ASSIMP_IMPORTER( FBX
|
||||||
FBXImporter.cpp
|
FBXImporter.cpp
|
||||||
FBXCompileConfig.h
|
FBXCompileConfig.h
|
||||||
FBXImporter.h
|
FBXImporter.h
|
||||||
|
@ -539,12 +542,12 @@ SET( PostProcessing_SRCS
|
||||||
)
|
)
|
||||||
SOURCE_GROUP( PostProcessing FILES ${PostProcessing_SRCS})
|
SOURCE_GROUP( PostProcessing FILES ${PostProcessing_SRCS})
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(Q3D
|
ADD_ASSIMP_IMPORTER( Q3D
|
||||||
Q3DLoader.cpp
|
Q3DLoader.cpp
|
||||||
Q3DLoader.h
|
Q3DLoader.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(Q3BSP
|
ADD_ASSIMP_IMPORTER( Q3BSP
|
||||||
Q3BSPFileData.h
|
Q3BSPFileData.h
|
||||||
Q3BSPFileParser.h
|
Q3BSPFileParser.h
|
||||||
Q3BSPFileParser.cpp
|
Q3BSPFileParser.cpp
|
||||||
|
@ -554,39 +557,39 @@ ADD_ASSIMP_IMPORTER(Q3BSP
|
||||||
Q3BSPZipArchive.cpp
|
Q3BSPZipArchive.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(RAW
|
ADD_ASSIMP_IMPORTER( RAW
|
||||||
RawLoader.cpp
|
RawLoader.cpp
|
||||||
RawLoader.h
|
RawLoader.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(SIB
|
ADD_ASSIMP_IMPORTER( SIB
|
||||||
SIBImporter.cpp
|
SIBImporter.cpp
|
||||||
SIBImporter.h
|
SIBImporter.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(SMD
|
ADD_ASSIMP_IMPORTER( SMD
|
||||||
SMDLoader.cpp
|
SMDLoader.cpp
|
||||||
SMDLoader.h
|
SMDLoader.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(STL
|
ADD_ASSIMP_IMPORTER( STL
|
||||||
STLLoader.cpp
|
STLLoader.cpp
|
||||||
STLLoader.h
|
STLLoader.h
|
||||||
STLExporter.h
|
STLExporter.h
|
||||||
STLExporter.cpp
|
STLExporter.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(TERRAGEN
|
ADD_ASSIMP_IMPORTER( TERRAGEN
|
||||||
TerragenLoader.cpp
|
TerragenLoader.cpp
|
||||||
TerragenLoader.h
|
TerragenLoader.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(3D
|
ADD_ASSIMP_IMPORTER( 3D
|
||||||
UnrealLoader.cpp
|
UnrealLoader.cpp
|
||||||
UnrealLoader.h
|
UnrealLoader.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(X
|
ADD_ASSIMP_IMPORTER( X
|
||||||
XFileHelper.h
|
XFileHelper.h
|
||||||
XFileImporter.cpp
|
XFileImporter.cpp
|
||||||
XFileImporter.h
|
XFileImporter.h
|
||||||
|
@ -596,26 +599,23 @@ ADD_ASSIMP_IMPORTER(X
|
||||||
XFileExporter.cpp
|
XFileExporter.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(GLTF
|
ADD_ASSIMP_IMPORTER( GLTF
|
||||||
glTFAsset.h
|
glTFAsset.h
|
||||||
glTFAsset.inl
|
glTFAsset.inl
|
||||||
glTFAssetWriter.h
|
glTFAssetWriter.h
|
||||||
glTFAssetWriter.inl
|
glTFAssetWriter.inl
|
||||||
|
|
||||||
glTFImporter.cpp
|
glTFImporter.cpp
|
||||||
glTFImporter.h
|
glTFImporter.h
|
||||||
|
|
||||||
glTFExporter.h
|
glTFExporter.h
|
||||||
glTFExporter.cpp
|
glTFExporter.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
ADD_ASSIMP_IMPORTER(3MF
|
ADD_ASSIMP_IMPORTER( 3MF
|
||||||
D3MFImporter.h
|
D3MFImporter.h
|
||||||
D3MFImporter.cpp
|
D3MFImporter.cpp
|
||||||
D3MFOpcPackage.h
|
D3MFOpcPackage.h
|
||||||
D3MFOpcPackage.cpp
|
D3MFOpcPackage.cpp
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -809,7 +809,7 @@ SET_TARGET_PROPERTIES( assimp PROPERTIES
|
||||||
)
|
)
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
SET_TARGET_PROPERTIES( assimp PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}")
|
SET_TARGET_PROPERTIES( assimp PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${ASSIMP_LIB_INSTALL_DIR}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Build against external unzip, or add ../contrib/unzip so
|
# Build against external unzip, or add ../contrib/unzip so
|
||||||
|
@ -818,7 +818,7 @@ if (UNZIP_FOUND)
|
||||||
INCLUDE_DIRECTORIES(${UNZIP_INCLUDE_DIRS})
|
INCLUDE_DIRECTORIES(${UNZIP_INCLUDE_DIRS})
|
||||||
TARGET_LINK_LIBRARIES(assimp ${UNZIP_LIBRARIES})
|
TARGET_LINK_LIBRARIES(assimp ${UNZIP_LIBRARIES})
|
||||||
else (UNZIP_FOUND)
|
else (UNZIP_FOUND)
|
||||||
INCLUDE_DIRECTORIES("../contrib/unzip")
|
INCLUDE_DIRECTORIES("../")
|
||||||
endif (UNZIP_FOUND)
|
endif (UNZIP_FOUND)
|
||||||
|
|
||||||
INSTALL( TARGETS assimp
|
INSTALL( TARGETS assimp
|
||||||
|
|
|
@ -54,9 +54,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "LineSplitter.h"
|
#include "LineSplitter.h"
|
||||||
#include "TinyFormatter.h"
|
#include "TinyFormatter.h"
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "../include/assimp/IOSystem.hpp"
|
#include <assimp/IOSystem.hpp>
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
|
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
|
@ -51,12 +51,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "SkeletonMeshBuilder.h"
|
#include "SkeletonMeshBuilder.h"
|
||||||
#include "ParsingUtils.h"
|
#include "ParsingUtils.h"
|
||||||
#include "fast_atof.h"
|
#include "fast_atof.h"
|
||||||
#include "../include/assimp/Importer.hpp"
|
#include <assimp/Importer.hpp>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "../include/assimp/IOSystem.hpp"
|
#include <assimp/IOSystem.hpp>
|
||||||
#include "../include/assimp/anim.h"
|
#include <assimp/anim.h>
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
|
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
|
@ -49,9 +49,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "SceneCombiner.h"
|
#include "SceneCombiner.h"
|
||||||
#include "DefaultIOSystem.h"
|
#include "DefaultIOSystem.h"
|
||||||
#include "XMLTools.h"
|
#include "XMLTools.h"
|
||||||
#include "../include/assimp/IOSystem.hpp"
|
#include <assimp/IOSystem.hpp>
|
||||||
#include "../include/assimp/Exporter.hpp"
|
#include <assimp/Exporter.hpp>
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
|
|
||||||
#include "Exceptional.h"
|
#include "Exceptional.h"
|
||||||
|
|
||||||
|
@ -530,7 +530,7 @@ void ColladaExporter::ReadMaterialSurface( Surface& poSurface, const aiMaterial*
|
||||||
// Reimplementation of isalnum(,C locale), because AppVeyor does not see standard version.
|
// Reimplementation of isalnum(,C locale), because AppVeyor does not see standard version.
|
||||||
static bool isalnum_C(char c)
|
static bool isalnum_C(char c)
|
||||||
{
|
{
|
||||||
return strchr("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",c);
|
return ( nullptr != strchr("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",c) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
@ -1016,7 +1016,7 @@ void ColladaExporter::WriteSceneLibrary()
|
||||||
|
|
||||||
// start recursive write at the root node
|
// start recursive write at the root node
|
||||||
for( size_t a = 0; a < mScene->mRootNode->mNumChildren; ++a )
|
for( size_t a = 0; a < mScene->mRootNode->mNumChildren; ++a )
|
||||||
WriteNode( mScene->mRootNode->mChildren[a]);
|
WriteNode( mScene, mScene->mRootNode->mChildren[a]);
|
||||||
|
|
||||||
PopTag();
|
PopTag();
|
||||||
mOutput << startstr << "</visual_scene>" << endstr;
|
mOutput << startstr << "</visual_scene>" << endstr;
|
||||||
|
@ -1024,11 +1024,26 @@ void ColladaExporter::WriteSceneLibrary()
|
||||||
mOutput << startstr << "</library_visual_scenes>" << endstr;
|
mOutput << startstr << "</library_visual_scenes>" << endstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
// Helper to find a bone by name in the scene
|
||||||
|
aiBone* findBone( const aiScene* scene, const char * name) {
|
||||||
|
for (size_t m=0; m<scene->mNumMeshes; m++) {
|
||||||
|
aiMesh * mesh = scene->mMeshes[m];
|
||||||
|
for (size_t b=0; b<mesh->mNumBones; b++) {
|
||||||
|
aiBone * bone = mesh->mBones[b];
|
||||||
|
if (0 == strcmp(name, bone->mName.C_Str())) {
|
||||||
|
return bone;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Recursively writes the given node
|
// Recursively writes the given node
|
||||||
void ColladaExporter::WriteNode(aiNode* pNode)
|
void ColladaExporter::WriteNode( const aiScene* pScene, aiNode* pNode)
|
||||||
{
|
{
|
||||||
// the must have a name
|
// the node must have a name
|
||||||
if (pNode->mName.length == 0)
|
if (pNode->mName.length == 0)
|
||||||
{
|
{
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
|
@ -1036,8 +1051,21 @@ void ColladaExporter::WriteNode(aiNode* pNode)
|
||||||
pNode->mName.Set(ss.str());
|
pNode->mName.Set(ss.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the node is associated with a bone, it is a joint node (JOINT)
|
||||||
|
// otherwise it is a normal node (NODE)
|
||||||
|
const char * node_type;
|
||||||
|
if (NULL == findBone(pScene, pNode->mName.C_Str())) {
|
||||||
|
node_type = "NODE";
|
||||||
|
} else {
|
||||||
|
node_type = "JOINT";
|
||||||
|
}
|
||||||
|
|
||||||
const std::string node_name_escaped = XMLEscape(pNode->mName.data);
|
const std::string node_name_escaped = XMLEscape(pNode->mName.data);
|
||||||
mOutput << startstr << "<node id=\"" << node_name_escaped << "\" name=\"" << node_name_escaped << "\">" << endstr;
|
mOutput << startstr
|
||||||
|
<< "<node id=\"" << node_name_escaped
|
||||||
|
<< "\" name=\"" << node_name_escaped
|
||||||
|
<< "\" type=\"" << node_type
|
||||||
|
<< "\">" << endstr;
|
||||||
PushTag();
|
PushTag();
|
||||||
|
|
||||||
// write transformation - we can directly put the matrix there
|
// write transformation - we can directly put the matrix there
|
||||||
|
@ -1102,7 +1130,7 @@ void ColladaExporter::WriteNode(aiNode* pNode)
|
||||||
|
|
||||||
// recurse into subnodes
|
// recurse into subnodes
|
||||||
for( size_t a = 0; a < pNode->mNumChildren; ++a )
|
for( size_t a = 0; a < pNode->mNumChildren; ++a )
|
||||||
WriteNode( pNode->mChildren[a]);
|
WriteNode( pScene, pNode->mChildren[a]);
|
||||||
|
|
||||||
PopTag();
|
PopTag();
|
||||||
mOutput << startstr << "</node>" << endstr;
|
mOutput << startstr << "</node>" << endstr;
|
||||||
|
|
|
@ -44,11 +44,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef AI_COLLADAEXPORTER_H_INC
|
#ifndef AI_COLLADAEXPORTER_H_INC
|
||||||
#define AI_COLLADAEXPORTER_H_INC
|
#define AI_COLLADAEXPORTER_H_INC
|
||||||
|
|
||||||
#include "../include/assimp/ai_assert.h"
|
#include <assimp/ai_assert.h>
|
||||||
#include "../include/assimp/material.h"
|
#include <assimp/material.h>
|
||||||
#include "../include/assimp/mesh.h"
|
#include <assimp/mesh.h>
|
||||||
#include "../include/assimp/light.h"
|
#include <assimp/light.h>
|
||||||
#include "../include/assimp/Exporter.hpp"
|
#include <assimp/Exporter.hpp>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
@ -114,7 +114,7 @@ protected:
|
||||||
void WriteSceneLibrary();
|
void WriteSceneLibrary();
|
||||||
|
|
||||||
/// Recursively writes the given node
|
/// Recursively writes the given node
|
||||||
void WriteNode( aiNode* pNode);
|
void WriteNode( const aiScene* scene, aiNode* pNode);
|
||||||
|
|
||||||
/// Enters a new xml element, which increases the indentation
|
/// Enters a new xml element, which increases the indentation
|
||||||
void PushTag() { startstr.append( " "); }
|
void PushTag() { startstr.append( " "); }
|
||||||
|
|
|
@ -47,9 +47,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "../include/assimp/light.h"
|
#include <assimp/light.h>
|
||||||
#include "../include/assimp/mesh.h"
|
#include <assimp/mesh.h>
|
||||||
#include "../include/assimp/material.h"
|
#include <assimp/material.h>
|
||||||
|
|
||||||
struct aiMaterial;
|
struct aiMaterial;
|
||||||
|
|
||||||
|
|
|
@ -44,9 +44,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_COLLADA_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_COLLADA_IMPORTER
|
||||||
|
|
||||||
#include "../include/assimp/anim.h"
|
|
||||||
#include "../include/assimp/scene.h"
|
|
||||||
#include "ColladaLoader.h"
|
#include "ColladaLoader.h"
|
||||||
|
#include <assimp/anim.h>
|
||||||
|
#include <assimp/scene.h>
|
||||||
|
#include <assimp/DefaultLogger.hpp>
|
||||||
|
#include <assimp/Importer.hpp>
|
||||||
#include "ColladaParser.h"
|
#include "ColladaParser.h"
|
||||||
|
|
||||||
#include "fast_atof.h"
|
#include "fast_atof.h"
|
||||||
|
@ -56,8 +58,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "time.h"
|
#include "time.h"
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
|
||||||
#include "../include/assimp/Importer.hpp"
|
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
#include "Defines.h"
|
#include "Defines.h"
|
||||||
|
|
||||||
|
@ -276,21 +276,20 @@ void ColladaLoader::ResolveNodeInstances( const ColladaParser& pParser, const Co
|
||||||
resolved.reserve(pNode->mNodeInstances.size());
|
resolved.reserve(pNode->mNodeInstances.size());
|
||||||
|
|
||||||
// ... and iterate through all nodes to be instanced as children of pNode
|
// ... and iterate through all nodes to be instanced as children of pNode
|
||||||
for (std::vector<Collada::NodeInstance>::const_iterator it = pNode->mNodeInstances.begin(),
|
for (const auto &nodeInst: pNode->mNodeInstances)
|
||||||
end = pNode->mNodeInstances.end(); it != end; ++it)
|
|
||||||
{
|
{
|
||||||
// find the corresponding node in the library
|
// find the corresponding node in the library
|
||||||
const ColladaParser::NodeLibrary::const_iterator itt = pParser.mNodeLibrary.find((*it).mNode);
|
const ColladaParser::NodeLibrary::const_iterator itt = pParser.mNodeLibrary.find(nodeInst.mNode);
|
||||||
const Collada::Node* nd = itt == pParser.mNodeLibrary.end() ? NULL : (*itt).second;
|
const Collada::Node* nd = itt == pParser.mNodeLibrary.end() ? NULL : (*itt).second;
|
||||||
|
|
||||||
// FIX for http://sourceforge.net/tracker/?func=detail&aid=3054873&group_id=226462&atid=1067632
|
// FIX for http://sourceforge.net/tracker/?func=detail&aid=3054873&group_id=226462&atid=1067632
|
||||||
// need to check for both name and ID to catch all. To avoid breaking valid files,
|
// need to check for both name and ID to catch all. To avoid breaking valid files,
|
||||||
// the workaround is only enabled when the first attempt to resolve the node has failed.
|
// the workaround is only enabled when the first attempt to resolve the node has failed.
|
||||||
if (!nd) {
|
if (!nd) {
|
||||||
nd = FindNode(pParser.mRootNode,(*it).mNode);
|
nd = FindNode(pParser.mRootNode, nodeInst.mNode);
|
||||||
}
|
}
|
||||||
if (!nd)
|
if (!nd)
|
||||||
DefaultLogger::get()->error("Collada: Unable to resolve reference to instanced node " + (*it).mNode);
|
DefaultLogger::get()->error("Collada: Unable to resolve reference to instanced node " + nodeInst.mNode);
|
||||||
|
|
||||||
else {
|
else {
|
||||||
// attach this node to the list of children
|
// attach this node to the list of children
|
||||||
|
@ -1320,11 +1319,10 @@ void ColladaLoader::AddTexture ( aiMaterial& mat, const ColladaParser& pParser,
|
||||||
// Fills materials from the collada material definitions
|
// Fills materials from the collada material definitions
|
||||||
void ColladaLoader::FillMaterials( const ColladaParser& pParser, aiScene* /*pScene*/)
|
void ColladaLoader::FillMaterials( const ColladaParser& pParser, aiScene* /*pScene*/)
|
||||||
{
|
{
|
||||||
for (std::vector<std::pair<Collada::Effect*, aiMaterial*> >::iterator it = newMats.begin(),
|
for (auto &elem : newMats)
|
||||||
end = newMats.end(); it != end; ++it)
|
|
||||||
{
|
{
|
||||||
aiMaterial& mat = (aiMaterial&)*it->second;
|
aiMaterial& mat = (aiMaterial&)*elem.second;
|
||||||
Collada::Effect& effect = *it->first;
|
Collada::Effect& effect = *elem.first;
|
||||||
|
|
||||||
// resolve shading mode
|
// resolve shading mode
|
||||||
int shadeMode;
|
int shadeMode;
|
||||||
|
|
|
@ -51,12 +51,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "ColladaParser.h"
|
#include "ColladaParser.h"
|
||||||
#include "fast_atof.h"
|
#include "fast_atof.h"
|
||||||
#include "ParsingUtils.h"
|
#include "ParsingUtils.h"
|
||||||
#include <memory>
|
#include "StringUtils.h"
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include "../include/assimp/IOSystem.hpp"
|
#include <assimp/IOSystem.hpp>
|
||||||
#include "../include/assimp/light.h"
|
#include <assimp/light.h>
|
||||||
#include "TinyFormatter.h"
|
#include "TinyFormatter.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
using namespace Assimp::Collada;
|
using namespace Assimp::Collada;
|
||||||
|
@ -3115,24 +3117,29 @@ aiMatrix4x4 ColladaParser::CalculateResultTransform( const std::vector<Transform
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Determines the input data type for the given semantic string
|
// Determines the input data type for the given semantic string
|
||||||
Collada::InputType ColladaParser::GetTypeForSemantic( const std::string& pSemantic)
|
Collada::InputType ColladaParser::GetTypeForSemantic( const std::string& semantic)
|
||||||
{
|
{
|
||||||
if( pSemantic == "POSITION")
|
if ( semantic.empty() ) {
|
||||||
|
DefaultLogger::get()->warn( format() << "Vertex input type is empty." );
|
||||||
|
return IT_Invalid;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( semantic == "POSITION")
|
||||||
return IT_Position;
|
return IT_Position;
|
||||||
else if( pSemantic == "TEXCOORD")
|
else if( semantic == "TEXCOORD")
|
||||||
return IT_Texcoord;
|
return IT_Texcoord;
|
||||||
else if( pSemantic == "NORMAL")
|
else if( semantic == "NORMAL")
|
||||||
return IT_Normal;
|
return IT_Normal;
|
||||||
else if( pSemantic == "COLOR")
|
else if( semantic == "COLOR")
|
||||||
return IT_Color;
|
return IT_Color;
|
||||||
else if( pSemantic == "VERTEX")
|
else if( semantic == "VERTEX")
|
||||||
return IT_Vertex;
|
return IT_Vertex;
|
||||||
else if( pSemantic == "BINORMAL" || pSemantic == "TEXBINORMAL")
|
else if( semantic == "BINORMAL" || semantic == "TEXBINORMAL")
|
||||||
return IT_Bitangent;
|
return IT_Bitangent;
|
||||||
else if( pSemantic == "TANGENT" || pSemantic == "TEXTANGENT")
|
else if( semantic == "TANGENT" || semantic == "TEXTANGENT")
|
||||||
return IT_Tangent;
|
return IT_Tangent;
|
||||||
|
|
||||||
DefaultLogger::get()->warn( format() << "Unknown vertex input type \"" << pSemantic << "\". Ignoring." );
|
DefaultLogger::get()->warn( format() << "Unknown vertex input type \"" << semantic << "\". Ignoring." );
|
||||||
return IT_Invalid;
|
return IT_Invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
|
|
||||||
#include "irrXMLWrapper.h"
|
#include "irrXMLWrapper.h"
|
||||||
#include "ColladaHelper.h"
|
#include "ColladaHelper.h"
|
||||||
#include "../include/assimp/ai_assert.h"
|
#include <assimp/ai_assert.h>
|
||||||
#include "TinyFormatter.h"
|
#include "TinyFormatter.h"
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
|
|
@ -44,14 +44,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#define AI_COMPUTEUVMAPPING_H_INC
|
#define AI_COMPUTEUVMAPPING_H_INC
|
||||||
|
|
||||||
#include "BaseProcess.h"
|
#include "BaseProcess.h"
|
||||||
#include "../include/assimp/mesh.h"
|
#include <assimp/mesh.h>
|
||||||
#include "../include/assimp/material.h"
|
#include <assimp/material.h>
|
||||||
#include "../include/assimp/types.h"
|
#include <assimp/types.h>
|
||||||
|
|
||||||
class ComputeUVMappingTest;
|
class ComputeUVMappingTest;
|
||||||
|
|
||||||
namespace Assimp
|
namespace Assimp {
|
||||||
{
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
/** ComputeUVMappingProcess - converts special mappings, such as spherical,
|
/** ComputeUVMappingProcess - converts special mappings, such as spherical,
|
||||||
|
|
|
@ -49,9 +49,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
|
||||||
#include "ConvertToLHProcess.h"
|
#include "ConvertToLHProcess.h"
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
#include "../include/assimp/postprocess.h"
|
#include <assimp/postprocess.h>
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef AI_CONVERTTOLHPROCESS_H_INC
|
#ifndef AI_CONVERTTOLHPROCESS_H_INC
|
||||||
#define AI_CONVERTTOLHPROCESS_H_INC
|
#define AI_CONVERTTOLHPROCESS_H_INC
|
||||||
|
|
||||||
#include "../include/assimp/types.h"
|
#include <assimp/types.h>
|
||||||
#include "BaseProcess.h"
|
#include "BaseProcess.h"
|
||||||
|
|
||||||
struct aiMesh;
|
struct aiMesh;
|
||||||
|
|
|
@ -40,13 +40,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "D3MFImporter.h"
|
#include "D3MFImporter.h"
|
||||||
|
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
#include "../contrib/unzip/unzip.h"
|
#include <assimp/IOStream.hpp>
|
||||||
#include "../include/assimp/IOStream.hpp"
|
#include <assimp/IOSystem.hpp>
|
||||||
#include "../include/assimp/IOSystem.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <contrib/unzip/unzip.h>
|
||||||
#include "irrXMLWrapper.h"
|
#include "irrXMLWrapper.h"
|
||||||
#include "StringComparison.h"
|
#include "StringComparison.h"
|
||||||
|
#include "StringUtils.h"
|
||||||
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -58,7 +59,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "../include/assimp/ai_assert.h"
|
#include <assimp/ai_assert.h>
|
||||||
|
|
||||||
#include "D3MFOpcPackage.h"
|
#include "D3MFOpcPackage.h"
|
||||||
|
|
||||||
|
@ -224,9 +225,9 @@ private:
|
||||||
aiVector3D ReadVertex()
|
aiVector3D ReadVertex()
|
||||||
{
|
{
|
||||||
aiVector3D vertex;
|
aiVector3D vertex;
|
||||||
vertex.x = std::strtof(xmlReader->getAttributeValue(D3MF::XmlTag::x.c_str()), nullptr);
|
vertex.x = ai_strtof(xmlReader->getAttributeValue(D3MF::XmlTag::x.c_str()), nullptr);
|
||||||
vertex.y = std::strtof(xmlReader->getAttributeValue(D3MF::XmlTag::y.c_str()), nullptr);
|
vertex.y = ai_strtof(xmlReader->getAttributeValue(D3MF::XmlTag::y.c_str()), nullptr);
|
||||||
vertex.z = std::strtof(xmlReader->getAttributeValue(D3MF::XmlTag::z.c_str()), nullptr);
|
vertex.z = ai_strtof>(xmlReader->getAttributeValue(D3MF::XmlTag::z.c_str()), nullptr);
|
||||||
|
|
||||||
return vertex;
|
return vertex;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
|
||||||
#include "D3MFOpcPackage.h"
|
#include "D3MFOpcPackage.h"
|
||||||
|
#include "Exceptional.h"
|
||||||
|
|
||||||
|
#include <contrib/unzip/unzip.h>
|
||||||
|
#include <assimp/IOStream.hpp>
|
||||||
|
#include <assimp/IOSystem.hpp>
|
||||||
|
#include <assimp/DefaultLogger.hpp>
|
||||||
|
#include <assimp/ai_assert.h>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -48,19 +55,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
|
|
||||||
#include "../contrib/unzip/unzip.h"
|
|
||||||
#include "../include/assimp/IOStream.hpp"
|
|
||||||
#include "../include/assimp/IOSystem.hpp"
|
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
|
||||||
|
|
||||||
|
|
||||||
#include "../include/assimp/ai_assert.h"
|
|
||||||
|
|
||||||
#include "Exceptional.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_3MF_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_3MF_IMPORTER
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
@ -324,8 +318,8 @@ D3MFZipArchive::D3MFZipArchive(IOSystem* pIOHandler, const std::string& rFile)
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Destructor.
|
// Destructor.
|
||||||
D3MFZipArchive::~D3MFZipArchive() {
|
D3MFZipArchive::~D3MFZipArchive() {
|
||||||
for( std::map<std::string, ZipFile*>::iterator it(m_ArchiveMap.begin()), end(m_ArchiveMap.end()); it != end; ++it ) {
|
for(auto &file : m_ArchiveMap) {
|
||||||
delete it->second;
|
delete file.second;
|
||||||
}
|
}
|
||||||
m_ArchiveMap.clear();
|
m_ArchiveMap.clear();
|
||||||
|
|
||||||
|
@ -398,8 +392,8 @@ void D3MFZipArchive::Close(IOStream *pFile) {
|
||||||
void D3MFZipArchive::getFileList(std::vector<std::string> &rFileList) {
|
void D3MFZipArchive::getFileList(std::vector<std::string> &rFileList) {
|
||||||
rFileList.clear();
|
rFileList.clear();
|
||||||
|
|
||||||
for(std::map<std::string, ZipFile*>::iterator it(m_ArchiveMap.begin()), end(m_ArchiveMap.end()); it != end; ++it) {
|
for(const auto &file : m_ArchiveMap) {
|
||||||
rFileList.push_back(it->first);
|
rFileList.push_back(file.first);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "../include/assimp/IOSystem.hpp"
|
#include <assimp/IOSystem.hpp>
|
||||||
#include "irrXMLWrapper.h"
|
#include "irrXMLWrapper.h"
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
|
@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "StreamReader.h"
|
#include "StreamReader.h"
|
||||||
#include "fast_atof.h"
|
#include "fast_atof.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
namespace DXF {
|
namespace DXF {
|
||||||
|
|
|
@ -52,8 +52,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "fast_atof.h"
|
#include "fast_atof.h"
|
||||||
|
|
||||||
#include "DXFHelper.h"
|
#include "DXFHelper.h"
|
||||||
#include "../include/assimp/IOSystem.hpp"
|
#include <assimp/IOSystem.hpp>
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
|
@ -46,8 +46,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include "BaseProcess.h"
|
#include "BaseProcess.h"
|
||||||
|
|
||||||
#include "../include/assimp/mesh.h"
|
#include <assimp/mesh.h>
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
|
|
||||||
class DeboneTest;
|
class DeboneTest;
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "../include/assimp/ai_assert.h"
|
#include <assimp/ai_assert.h>
|
||||||
#include "DefaultIOStream.h"
|
#include "DefaultIOStream.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
|
@ -43,8 +43,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#define AI_DEFAULTIOSTREAM_H_INC
|
#define AI_DEFAULTIOSTREAM_H_INC
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "../include/assimp/IOStream.hpp"
|
#include <assimp/IOStream.hpp>
|
||||||
#include "../include/assimp/importerdesc.h"
|
#include <assimp/importerdesc.h>
|
||||||
#include "Defines.h"
|
#include "Defines.h"
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
|
@ -44,8 +44,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "DefaultIOStream.h"
|
#include "DefaultIOStream.h"
|
||||||
#include "StringComparison.h"
|
#include "StringComparison.h"
|
||||||
|
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include "../include/assimp/ai_assert.h"
|
#include <assimp/ai_assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef AI_DEFAULTIOSYSTEM_H_INC
|
#ifndef AI_DEFAULTIOSYSTEM_H_INC
|
||||||
#define AI_DEFAULTIOSYSTEM_H_INC
|
#define AI_DEFAULTIOSYSTEM_H_INC
|
||||||
|
|
||||||
#include "../include/assimp/IOSystem.hpp"
|
#include <assimp/IOSystem.hpp>
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
|
|
|
@ -50,9 +50,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "StdOStreamLogStream.h"
|
#include "StdOStreamLogStream.h"
|
||||||
#include "FileLogStream.h"
|
#include "FileLogStream.h"
|
||||||
#include "StringUtils.h"
|
#include "StringUtils.h"
|
||||||
#include "../include/assimp/NullLogger.hpp"
|
#include <assimp/NullLogger.hpp>
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include "../include/assimp/ai_assert.h"
|
#include <assimp/ai_assert.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef INCLUDED_AI_DEFAULTPROGRESSHANDLER_H
|
#ifndef INCLUDED_AI_DEFAULTPROGRESSHANDLER_H
|
||||||
#define INCLUDED_AI_DEFAULTPROGRESSHANDLER_H
|
#define INCLUDED_AI_DEFAULTPROGRESSHANDLER_H
|
||||||
|
|
||||||
#include "../include/assimp/ProgressHandler.hpp"
|
#include <assimp/ProgressHandler.hpp>
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -64,10 +64,10 @@ Here we implement only the C++ interface (Assimp::Exporter).
|
||||||
#include "Exceptional.h"
|
#include "Exceptional.h"
|
||||||
#include "ScenePrivate.h"
|
#include "ScenePrivate.h"
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "../include/assimp/Exporter.hpp"
|
#include <assimp/Exporter.hpp>
|
||||||
#include "../include/assimp/mesh.h"
|
#include <assimp/mesh.h>
|
||||||
#include "../include/assimp/postprocess.h"
|
#include <assimp/postprocess.h>
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
|
@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "FBXTokenizer.h"
|
#include "FBXTokenizer.h"
|
||||||
#include "FBXUtil.h"
|
#include "FBXUtil.h"
|
||||||
#include "../include/assimp/defs.h"
|
#include <assimp/defs.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "Exceptional.h"
|
#include "Exceptional.h"
|
||||||
#include "ByteSwapper.h"
|
#include "ByteSwapper.h"
|
||||||
|
|
|
@ -53,7 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "FBXImporter.h"
|
#include "FBXImporter.h"
|
||||||
#include "StringComparison.h"
|
#include "StringComparison.h"
|
||||||
|
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
@ -1062,8 +1062,8 @@ void Converter::GenerateTransformationNodeChain( const Model& model,
|
||||||
|
|
||||||
nd->mName.Set( name );
|
nd->mName.Set( name );
|
||||||
|
|
||||||
for ( size_t i = 0; i < TransformationComp_MAXIMUM; ++i ) {
|
for (const auto &transform : chain) {
|
||||||
nd->mTransformation = nd->mTransformation * chain[ i ];
|
nd->mTransformation = nd->mTransformation * transform;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -269,8 +269,8 @@ Document::Document(const Parser& parser, const ImportSettings& settings)
|
||||||
, parser(parser)
|
, parser(parser)
|
||||||
{
|
{
|
||||||
// Cannot use array default initialization syntax because vc8 fails on it
|
// Cannot use array default initialization syntax because vc8 fails on it
|
||||||
for (unsigned int i = 0; i < sizeof(creationTimeStamp) / sizeof(creationTimeStamp[0]); ++i) {
|
for (auto &timeStamp : creationTimeStamp) {
|
||||||
creationTimeStamp[i] = 0;
|
timeStamp = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReadHeader();
|
ReadHeader();
|
||||||
|
|
|
@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "../include/assimp/mesh.h"
|
#include <assimp/mesh.h>
|
||||||
#include "FBXProperties.h"
|
#include "FBXProperties.h"
|
||||||
#include "FBXParser.h"
|
#include "FBXParser.h"
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "StreamReader.h"
|
#include "StreamReader.h"
|
||||||
#include "MemoryIOWrapper.h"
|
#include "MemoryIOWrapper.h"
|
||||||
#include "../include/assimp/Importer.hpp"
|
#include <assimp/Importer.hpp>
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
template<> const std::string LogFunctions<FBXImporter>::log_prefix = "FBX: ";
|
template<> const std::string LogFunctions<FBXImporter>::log_prefix = "FBX: ";
|
||||||
|
|
|
@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "FBXCompileConfig.h"
|
#include "FBXCompileConfig.h"
|
||||||
#include "../include/assimp/ai_assert.h"
|
#include <assimp/ai_assert.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#ifndef ASSIMP_FILELOGSTREAM_H_INC
|
#ifndef ASSIMP_FILELOGSTREAM_H_INC
|
||||||
#define ASSIMP_FILELOGSTREAM_H_INC
|
#define ASSIMP_FILELOGSTREAM_H_INC
|
||||||
|
|
||||||
#include "../include/assimp/LogStream.hpp"
|
#include <assimp/LogStream.hpp>
|
||||||
#include "../include/assimp/IOStream.hpp"
|
#include <assimp/IOStream.hpp>
|
||||||
#include "DefaultIOSystem.h"
|
#include "DefaultIOSystem.h"
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
|
@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#define AI_FINDDEGENERATESPROCESS_H_INC
|
#define AI_FINDDEGENERATESPROCESS_H_INC
|
||||||
|
|
||||||
#include "BaseProcess.h"
|
#include "BaseProcess.h"
|
||||||
#include "../include/assimp/mesh.h"
|
#include <assimp/mesh.h>
|
||||||
|
|
||||||
class FindDegeneratesProcessTest;
|
class FindDegeneratesProcessTest;
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
|
@ -44,8 +44,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#define AI_FINDINVALIDDATA_H_INC
|
#define AI_FINDINVALIDDATA_H_INC
|
||||||
|
|
||||||
#include "BaseProcess.h"
|
#include "BaseProcess.h"
|
||||||
#include "../include/assimp/types.h"
|
#include <assimp/types.h>
|
||||||
#include "../include/assimp/anim.h"
|
#include <assimp/anim.h>
|
||||||
|
|
||||||
struct aiMesh;
|
struct aiMesh;
|
||||||
class FindInvalidDataProcessTest;
|
class FindInvalidDataProcessTest;
|
||||||
|
|
|
@ -46,9 +46,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
// internal headers
|
// internal headers
|
||||||
#include "FixNormalsStep.h"
|
#include "FixNormalsStep.h"
|
||||||
#include "StringUtils.h"
|
#include "StringUtils.h"
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include "../include/assimp/postprocess.h"
|
#include <assimp/postprocess.h>
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -45,9 +45,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
|
||||||
#include "GenFaceNormalsProcess.h"
|
#include "GenFaceNormalsProcess.h"
|
||||||
#include "../include/assimp/postprocess.h"
|
#include <assimp/postprocess.h>
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include "Exceptional.h"
|
#include "Exceptional.h"
|
||||||
#include "qnan.h"
|
#include "qnan.h"
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#define AI_GENFACENORMALPROCESS_H_INC
|
#define AI_GENFACENORMALPROCESS_H_INC
|
||||||
|
|
||||||
#include "BaseProcess.h"
|
#include "BaseProcess.h"
|
||||||
#include "../include/assimp/mesh.h"
|
#include <assimp/mesh.h>
|
||||||
|
|
||||||
namespace Assimp
|
namespace Assimp
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#define AI_GENVERTEXNORMALPROCESS_H_INC
|
#define AI_GENVERTEXNORMALPROCESS_H_INC
|
||||||
|
|
||||||
#include "BaseProcess.h"
|
#include "BaseProcess.h"
|
||||||
#include "../include/assimp/mesh.h"
|
#include <assimp/mesh.h>
|
||||||
|
|
||||||
class GenNormalsTest;
|
class GenNormalsTest;
|
||||||
|
|
||||||
|
|
|
@ -41,8 +41,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef AI_GENERIC_PROPERTY_H_INCLUDED
|
#ifndef AI_GENERIC_PROPERTY_H_INCLUDED
|
||||||
#define AI_GENERIC_PROPERTY_H_INCLUDED
|
#define AI_GENERIC_PROPERTY_H_INCLUDED
|
||||||
|
|
||||||
#include "./../include/assimp/Importer.hpp"
|
#include <assimp/Importer.hpp>
|
||||||
#include "./../include/assimp/ai_assert.h"
|
#include <assimp/ai_assert.h>
|
||||||
#include "Hash.h"
|
#include "Hash.h"
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
|
|
@ -48,9 +48,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "HMPLoader.h"
|
#include "HMPLoader.h"
|
||||||
#include "MD2FileData.h"
|
#include "MD2FileData.h"
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "../include/assimp/IOSystem.hpp"
|
#include <assimp/IOSystem.hpp>
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
|
|
@ -45,9 +45,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#define AI_HMPLOADER_H_INCLUDED
|
#define AI_HMPLOADER_H_INCLUDED
|
||||||
|
|
||||||
// public ASSIMP headers
|
// public ASSIMP headers
|
||||||
#include "../include/assimp/types.h"
|
#include <assimp/types.h>
|
||||||
#include "../include/assimp/texture.h"
|
#include <assimp/texture.h>
|
||||||
#include "../include/assimp/material.h"
|
#include <assimp/material.h>
|
||||||
|
|
||||||
// internal headers
|
// internal headers
|
||||||
#include "BaseImporter.h"
|
#include "BaseImporter.h"
|
||||||
|
|
|
@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_COMPRESSED_IFC
|
#ifndef ASSIMP_BUILD_NO_COMPRESSED_IFC
|
||||||
# include "../contrib/unzip/unzip.h"
|
# include <contrib/unzip/unzip.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "IFCLoader.h"
|
#include "IFCLoader.h"
|
||||||
|
@ -60,8 +60,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "StreamReader.h"
|
#include "StreamReader.h"
|
||||||
#include "MemoryIOWrapper.h"
|
#include "MemoryIOWrapper.h"
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
#include "../include/assimp/Importer.hpp"
|
#include <assimp/Importer.hpp>
|
||||||
|
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
|
@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef ASSIMP_BUILD_NO_IFC_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_IFC_IMPORTER
|
||||||
#include "IFCUtil.h"
|
#include "IFCUtil.h"
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include "../include/assimp/material.h"
|
#include <assimp/material.h>
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
namespace IFC {
|
namespace IFC {
|
||||||
|
|
|
@ -48,9 +48,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "IFCReaderGen.h"
|
#include "IFCReaderGen.h"
|
||||||
#include "IFCLoader.h"
|
#include "IFCLoader.h"
|
||||||
#include "STEPFile.h"
|
#include "STEPFile.h"
|
||||||
#include "../include/assimp/mesh.h"
|
#include <assimp/mesh.h>
|
||||||
#include "../include/assimp/material.h"
|
#include <assimp/material.h>
|
||||||
|
|
||||||
|
|
||||||
struct aiNode;
|
struct aiNode;
|
||||||
|
|
||||||
|
|
|
@ -59,12 +59,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
// We need MathFunctions.h to compute the lcm/gcd of a number
|
// We need MathFunctions.h to compute the lcm/gcd of a number
|
||||||
#include "MathFunctions.h"
|
#include "MathFunctions.h"
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include "../include/assimp/mesh.h"
|
#include <assimp/mesh.h>
|
||||||
#include "../include/assimp/material.h"
|
#include <assimp/material.h>
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
#include "../include/assimp/IOSystem.hpp"
|
#include <assimp/IOSystem.hpp>
|
||||||
#include "../include/assimp/postprocess.h"
|
#include <assimp/postprocess.h>
|
||||||
|
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
@ -1372,8 +1372,7 @@ void IRRImporter::InternReadFile( const std::string& pFile,
|
||||||
|
|
||||||
/* Now iterate through all cameras and compute their final (horizontal) FOV
|
/* Now iterate through all cameras and compute their final (horizontal) FOV
|
||||||
*/
|
*/
|
||||||
for (std::vector<aiCamera*>::iterator it = cameras.begin(), end = cameras.end();it != end; ++it) {
|
for (aiCamera *cam : cameras) {
|
||||||
aiCamera* cam = *it;
|
|
||||||
|
|
||||||
// screen aspect could be missing
|
// screen aspect could be missing
|
||||||
if (cam->mAspect) {
|
if (cam->mAspect) {
|
||||||
|
|
|
@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "SceneCombiner.h"
|
#include "SceneCombiner.h"
|
||||||
#include "Importer.h"
|
#include "Importer.h"
|
||||||
#include "StringUtils.h"
|
#include "StringUtils.h"
|
||||||
#include "../include/assimp/anim.h"
|
#include <assimp/anim.h>
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
|
|
|
@ -49,11 +49,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "ParsingUtils.h"
|
#include "ParsingUtils.h"
|
||||||
#include "fast_atof.h"
|
#include "fast_atof.h"
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "../include/assimp/IOSystem.hpp"
|
#include <assimp/IOSystem.hpp>
|
||||||
#include "../include/assimp/mesh.h"
|
#include <assimp/mesh.h>
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include "../include/assimp/material.h"
|
#include <assimp/material.h>
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
#include "Macros.h"
|
#include "Macros.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "BaseImporter.h"
|
#include "BaseImporter.h"
|
||||||
#include "IRRShared.h"
|
#include "IRRShared.h"
|
||||||
|
|
||||||
|
#ifndef ASSIMP_BUILD_NO_IRRMESH_IMPORTER
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
@ -92,4 +94,6 @@ protected:
|
||||||
|
|
||||||
} // end of namespace Assimp
|
} // end of namespace Assimp
|
||||||
|
|
||||||
|
#endif // ASSIMP_BUILD_NO_IRRMESH_IMPORTER
|
||||||
|
|
||||||
#endif // AI_IRRMESHIMPORTER_H_INC
|
#endif // AI_IRRMESHIMPORTER_H_INC
|
||||||
|
|
|
@ -51,8 +51,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "IRRShared.h"
|
#include "IRRShared.h"
|
||||||
#include "ParsingUtils.h"
|
#include "ParsingUtils.h"
|
||||||
#include "fast_atof.h"
|
#include "fast_atof.h"
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include "../include/assimp/material.h"
|
#include <assimp/material.h>
|
||||||
|
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
|
@ -43,7 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
* @brief Implementation of the CPP-API class #Importer
|
* @brief Implementation of the CPP-API class #Importer
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../include/assimp/version.h"
|
#include <assimp/version.h>
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
/* Uncomment this line to prevent Assimp from catching unknown exceptions.
|
/* Uncomment this line to prevent Assimp from catching unknown exceptions.
|
||||||
|
|
|
@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "../include/assimp/matrix4x4.h"
|
#include <assimp/matrix4x4.h>
|
||||||
|
|
||||||
struct aiScene;
|
struct aiScene;
|
||||||
|
|
||||||
|
|
|
@ -52,9 +52,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "ImproveCacheLocality.h"
|
#include "ImproveCacheLocality.h"
|
||||||
#include "VertexTriangleAdjacency.h"
|
#include "VertexTriangleAdjacency.h"
|
||||||
#include "StringUtils.h"
|
#include "StringUtils.h"
|
||||||
#include "../include/assimp/postprocess.h"
|
#include <assimp/postprocess.h>
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stack>
|
#include <stack>
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#define AI_IMPROVECACHELOCALITY_H_INC
|
#define AI_IMPROVECACHELOCALITY_H_INC
|
||||||
|
|
||||||
#include "BaseProcess.h"
|
#include "BaseProcess.h"
|
||||||
#include "../include/assimp/types.h"
|
#include <assimp/types.h>
|
||||||
|
|
||||||
struct aiMesh;
|
struct aiMesh;
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#define AI_JOINVERTICESPROCESS_H_INC
|
#define AI_JOINVERTICESPROCESS_H_INC
|
||||||
|
|
||||||
#include "BaseProcess.h"
|
#include "BaseProcess.h"
|
||||||
#include "../include/assimp/types.h"
|
#include <assimp/types.h>
|
||||||
|
|
||||||
struct aiMesh;
|
struct aiMesh;
|
||||||
|
|
||||||
namespace Assimp
|
namespace Assimp
|
||||||
|
|
|
@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef AI_LWO_ANIMATION_INCLUDED
|
#ifndef AI_LWO_ANIMATION_INCLUDED
|
||||||
#define AI_LWO_ANIMATION_INCLUDED
|
#define AI_LWO_ANIMATION_INCLUDED
|
||||||
|
|
||||||
#include "../include/assimp/anim.h"
|
#include <assimp/anim.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ The chunks are taken from the official LightWave SDK headers.
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
// public ASSIMP headers
|
// public ASSIMP headers
|
||||||
#include "../include/assimp/mesh.h"
|
#include <assimp/mesh.h>
|
||||||
|
|
||||||
// internal headers
|
// internal headers
|
||||||
#include "IFF.h"
|
#include "IFF.h"
|
||||||
|
|
|
@ -53,8 +53,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "ByteSwapper.h"
|
#include "ByteSwapper.h"
|
||||||
#include "ProcessHelper.h"
|
#include "ProcessHelper.h"
|
||||||
#include "ConvertToLHProcess.h"
|
#include "ConvertToLHProcess.h"
|
||||||
|
#include <assimp/IOSystem.hpp>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "../include/assimp/IOSystem.hpp"
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|
||||||
|
@ -246,8 +246,7 @@ void LWOImporter::InternReadFile( const std::string& pFile,
|
||||||
apcMeshes.reserve(mLayers->size()*std::min(((unsigned int)mSurfaces->size()/2u), 1u));
|
apcMeshes.reserve(mLayers->size()*std::min(((unsigned int)mSurfaces->size()/2u), 1u));
|
||||||
|
|
||||||
unsigned int iDefaultSurface = UINT_MAX; // index of the default surface
|
unsigned int iDefaultSurface = UINT_MAX; // index of the default surface
|
||||||
for (LayerList::iterator lit = mLayers->begin(), lend = mLayers->end();lit != lend;++lit) {
|
for (LWO::Layer &layer : *mLayers) {
|
||||||
LWO::Layer& layer = *lit;
|
|
||||||
if (layer.skip)
|
if (layer.skip)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -909,12 +908,12 @@ void LWOImporter::LoadLWO2PolygonTags(unsigned int length)
|
||||||
template <class T>
|
template <class T>
|
||||||
VMapEntry* FindEntry(std::vector< T >& list,const std::string& name, bool perPoly)
|
VMapEntry* FindEntry(std::vector< T >& list,const std::string& name, bool perPoly)
|
||||||
{
|
{
|
||||||
for (typename std::vector< T >::iterator it = list.begin(), end = list.end();it != end; ++it) {
|
for (auto & elem : list) {
|
||||||
if ((*it).name == name) {
|
if (elem.name == name) {
|
||||||
if (!perPoly) {
|
if (!perPoly) {
|
||||||
DefaultLogger::get()->warn("LWO2: Found two VMAP sections with equal names");
|
DefaultLogger::get()->warn("LWO2: Found two VMAP sections with equal names");
|
||||||
}
|
}
|
||||||
return &(*it);
|
return &elem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
list.push_back( T() );
|
list.push_back( T() );
|
||||||
|
@ -941,8 +940,8 @@ inline void CreateNewEntry(T& chan, unsigned int srcIdx)
|
||||||
template <class T>
|
template <class T>
|
||||||
inline void CreateNewEntry(std::vector< T >& list, unsigned int srcIdx)
|
inline void CreateNewEntry(std::vector< T >& list, unsigned int srcIdx)
|
||||||
{
|
{
|
||||||
for (typename std::vector< T >::iterator it = list.begin(), end = list.end();it != end;++it) {
|
for (auto &elem : list) {
|
||||||
CreateNewEntry( *it, srcIdx );
|
CreateNewEntry( elem, srcIdx );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,9 +42,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef AI_LWOLOADER_H_INCLUDED
|
#ifndef AI_LWOLOADER_H_INCLUDED
|
||||||
#define AI_LWOLOADER_H_INCLUDED
|
#define AI_LWOLOADER_H_INCLUDED
|
||||||
|
|
||||||
#include "../include/assimp/types.h"
|
#include <assimp/types.h>
|
||||||
#include "../include/assimp/material.h"
|
#include <assimp/material.h>
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
|
|
||||||
#include "LWOFileData.h"
|
#include "LWOFileData.h"
|
||||||
#include "BaseImporter.h"
|
#include "BaseImporter.h"
|
||||||
|
|
|
@ -90,8 +90,8 @@ bool LWOImporter::HandleTextures(aiMaterial* pcMat, const TextureList& in, aiTex
|
||||||
aiString s;
|
aiString s;
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
for (TextureList::const_iterator it = in.begin(), end = in.end();it != end;++it) {
|
for (const auto &texture : in) {
|
||||||
if (!(*it).enabled || !(*it).bCanUse)
|
if (!texture.enabled || !texture.bCanUse)
|
||||||
continue;
|
continue;
|
||||||
ret = true;
|
ret = true;
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ bool LWOImporter::HandleTextures(aiMaterial* pcMat, const TextureList& in, aiTex
|
||||||
// channels if they're not there.
|
// channels if they're not there.
|
||||||
|
|
||||||
aiTextureMapping mapping;
|
aiTextureMapping mapping;
|
||||||
switch ((*it).mapMode)
|
switch (texture.mapMode)
|
||||||
{
|
{
|
||||||
case LWO::Texture::Planar:
|
case LWO::Texture::Planar:
|
||||||
mapping = aiTextureMapping_PLANE;
|
mapping = aiTextureMapping_PLANE;
|
||||||
|
@ -120,13 +120,13 @@ bool LWOImporter::HandleTextures(aiMaterial* pcMat, const TextureList& in, aiTex
|
||||||
break;
|
break;
|
||||||
case LWO::Texture::UV:
|
case LWO::Texture::UV:
|
||||||
{
|
{
|
||||||
if( UINT_MAX == (*it).mRealUVIndex ) {
|
if( UINT_MAX == texture.mRealUVIndex ) {
|
||||||
// We have no UV index for this texture, so we can't display it
|
// We have no UV index for this texture, so we can't display it
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// add the UV source index
|
// add the UV source index
|
||||||
temp = (*it).mRealUVIndex;
|
temp = texture.mRealUVIndex;
|
||||||
pcMat->AddProperty<int>((int*)&temp,1,AI_MATKEY_UVWSRC(type,cur));
|
pcMat->AddProperty<int>((int*)&temp,1,AI_MATKEY_UVWSRC(type,cur));
|
||||||
|
|
||||||
mapping = aiTextureMapping_UV;
|
mapping = aiTextureMapping_UV;
|
||||||
|
@ -139,7 +139,7 @@ bool LWOImporter::HandleTextures(aiMaterial* pcMat, const TextureList& in, aiTex
|
||||||
if (mapping != aiTextureMapping_UV) {
|
if (mapping != aiTextureMapping_UV) {
|
||||||
// Setup the main axis
|
// Setup the main axis
|
||||||
aiVector3D v;
|
aiVector3D v;
|
||||||
switch ((*it).majorAxis) {
|
switch (texture.majorAxis) {
|
||||||
case Texture::AXIS_X:
|
case Texture::AXIS_X:
|
||||||
v = aiVector3D(1.f,0.f,0.f);
|
v = aiVector3D(1.f,0.f,0.f);
|
||||||
break;
|
break;
|
||||||
|
@ -156,8 +156,8 @@ bool LWOImporter::HandleTextures(aiMaterial* pcMat, const TextureList& in, aiTex
|
||||||
// Setup UV scalings for cylindric and spherical projections
|
// Setup UV scalings for cylindric and spherical projections
|
||||||
if (mapping == aiTextureMapping_CYLINDER || mapping == aiTextureMapping_SPHERE) {
|
if (mapping == aiTextureMapping_CYLINDER || mapping == aiTextureMapping_SPHERE) {
|
||||||
aiUVTransform trafo;
|
aiUVTransform trafo;
|
||||||
trafo.mScaling.x = (*it).wrapAmountW;
|
trafo.mScaling.x = texture.wrapAmountW;
|
||||||
trafo.mScaling.y = (*it).wrapAmountH;
|
trafo.mScaling.y = texture.wrapAmountH;
|
||||||
|
|
||||||
static_assert(sizeof(aiUVTransform)/sizeof(float) == 5, "sizeof(aiUVTransform)/sizeof(float) == 5");
|
static_assert(sizeof(aiUVTransform)/sizeof(float) == 5, "sizeof(aiUVTransform)/sizeof(float) == 5");
|
||||||
pcMat->AddProperty(&trafo,1,AI_MATKEY_UVTRANSFORM(type,cur));
|
pcMat->AddProperty(&trafo,1,AI_MATKEY_UVTRANSFORM(type,cur));
|
||||||
|
@ -171,7 +171,7 @@ bool LWOImporter::HandleTextures(aiMaterial* pcMat, const TextureList& in, aiTex
|
||||||
// find the corresponding clip (take the last one if multiple
|
// find the corresponding clip (take the last one if multiple
|
||||||
// share the same index)
|
// share the same index)
|
||||||
ClipList::iterator end = mClips.end(), candidate = end;
|
ClipList::iterator end = mClips.end(), candidate = end;
|
||||||
temp = (*it).mClipIdx;
|
temp = texture.mClipIdx;
|
||||||
for (ClipList::iterator clip = mClips.begin(); clip != end; ++clip) {
|
for (ClipList::iterator clip = mClips.begin(); clip != end; ++clip) {
|
||||||
if ((*clip).idx == temp) {
|
if ((*clip).idx == temp) {
|
||||||
candidate = clip;
|
candidate = clip;
|
||||||
|
@ -208,7 +208,7 @@ bool LWOImporter::HandleTextures(aiMaterial* pcMat, const TextureList& in, aiTex
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::string ss = (*it).mFileName;
|
std::string ss = texture.mFileName;
|
||||||
if (!ss.length()) {
|
if (!ss.length()) {
|
||||||
DefaultLogger::get()->error("LWOB: Empty file name");
|
DefaultLogger::get()->error("LWOB: Empty file name");
|
||||||
continue;
|
continue;
|
||||||
|
@ -219,10 +219,10 @@ bool LWOImporter::HandleTextures(aiMaterial* pcMat, const TextureList& in, aiTex
|
||||||
pcMat->AddProperty(&s,AI_MATKEY_TEXTURE(type,cur));
|
pcMat->AddProperty(&s,AI_MATKEY_TEXTURE(type,cur));
|
||||||
|
|
||||||
// add the blend factor
|
// add the blend factor
|
||||||
pcMat->AddProperty<float>(&(*it).mStrength,1,AI_MATKEY_TEXBLEND(type,cur));
|
pcMat->AddProperty<float>(&texture.mStrength,1,AI_MATKEY_TEXBLEND(type,cur));
|
||||||
|
|
||||||
// add the blend operation
|
// add the blend operation
|
||||||
switch ((*it).blendType)
|
switch (texture.blendType)
|
||||||
{
|
{
|
||||||
case LWO::Texture::Normal:
|
case LWO::Texture::Normal:
|
||||||
case LWO::Texture::Multiply:
|
case LWO::Texture::Multiply:
|
||||||
|
@ -254,11 +254,11 @@ bool LWOImporter::HandleTextures(aiMaterial* pcMat, const TextureList& in, aiTex
|
||||||
pcMat->AddProperty<int>((int*)&mapping,1,AI_MATKEY_MAPPING(type,cur));
|
pcMat->AddProperty<int>((int*)&mapping,1,AI_MATKEY_MAPPING(type,cur));
|
||||||
|
|
||||||
// add the u-wrapping
|
// add the u-wrapping
|
||||||
temp = (unsigned int)GetMapMode((*it).wrapModeWidth);
|
temp = (unsigned int)GetMapMode(texture.wrapModeWidth);
|
||||||
pcMat->AddProperty<int>((int*)&temp,1,AI_MATKEY_MAPPINGMODE_U(type,cur));
|
pcMat->AddProperty<int>((int*)&temp,1,AI_MATKEY_MAPPINGMODE_U(type,cur));
|
||||||
|
|
||||||
// add the v-wrapping
|
// add the v-wrapping
|
||||||
temp = (unsigned int)GetMapMode((*it).wrapModeHeight);
|
temp = (unsigned int)GetMapMode(texture.wrapModeHeight);
|
||||||
pcMat->AddProperty<int>((int*)&temp,1,AI_MATKEY_MAPPINGMODE_V(type,cur));
|
pcMat->AddProperty<int>((int*)&temp,1,AI_MATKEY_MAPPINGMODE_V(type,cur));
|
||||||
|
|
||||||
++cur;
|
++cur;
|
||||||
|
@ -343,16 +343,14 @@ void LWOImporter::ConvertMaterial(const LWO::Surface& surf,aiMaterial* pcMat)
|
||||||
|
|
||||||
// Now we need to know which shader to use .. iterate through the shader list of
|
// Now we need to know which shader to use .. iterate through the shader list of
|
||||||
// the surface and search for a name which we know ...
|
// the surface and search for a name which we know ...
|
||||||
for (ShaderList::const_iterator it = surf.mShaders.begin(), end = surf.mShaders.end();it != end;++it) {
|
for (const auto &shader : surf.mShaders) {
|
||||||
//if (!(*it).enabled)continue;
|
if (shader.functionName == "LW_SuperCelShader" || shader.functionName == "AH_CelShader") {
|
||||||
|
|
||||||
if ((*it).functionName == "LW_SuperCelShader" || (*it).functionName == "AH_CelShader") {
|
|
||||||
DefaultLogger::get()->info("LWO2: Mapping LW_SuperCelShader/AH_CelShader to aiShadingMode_Toon");
|
DefaultLogger::get()->info("LWO2: Mapping LW_SuperCelShader/AH_CelShader to aiShadingMode_Toon");
|
||||||
|
|
||||||
m = aiShadingMode_Toon;
|
m = aiShadingMode_Toon;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if ((*it).functionName == "LW_RealFresnel" || (*it).functionName == "LW_FastFresnel") {
|
else if (shader.functionName == "LW_RealFresnel" || shader.functionName == "LW_FastFresnel") {
|
||||||
DefaultLogger::get()->info("LWO2: Mapping LW_RealFresnel/LW_FastFresnel to aiShadingMode_Fresnel");
|
DefaultLogger::get()->info("LWO2: Mapping LW_RealFresnel/LW_FastFresnel to aiShadingMode_Fresnel");
|
||||||
|
|
||||||
m = aiShadingMode_Fresnel;
|
m = aiShadingMode_Fresnel;
|
||||||
|
@ -360,7 +358,7 @@ void LWOImporter::ConvertMaterial(const LWO::Surface& surf,aiMaterial* pcMat)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DefaultLogger::get()->warn("LWO2: Unknown surface shader: " + (*it).functionName);
|
DefaultLogger::get()->warn("LWO2: Unknown surface shader: " + shader.functionName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (surf.mMaximumSmoothAngle <= 0.0f)
|
if (surf.mMaximumSmoothAngle <= 0.0f)
|
||||||
|
@ -381,20 +379,20 @@ char LWOImporter::FindUVChannels(LWO::TextureList& list,
|
||||||
LWO::Layer& /*layer*/,LWO::UVChannel& uv, unsigned int next)
|
LWO::Layer& /*layer*/,LWO::UVChannel& uv, unsigned int next)
|
||||||
{
|
{
|
||||||
char ret = 0;
|
char ret = 0;
|
||||||
for (TextureList::iterator it = list.begin(), end = list.end();it != end;++it) {
|
for (auto &texture : list) {
|
||||||
|
|
||||||
// Ignore textures with non-UV mappings for the moment.
|
// Ignore textures with non-UV mappings for the moment.
|
||||||
if (!(*it).enabled || !(*it).bCanUse || (*it).mapMode != LWO::Texture::UV) {
|
if (!texture.enabled || !texture.bCanUse || texture.mapMode != LWO::Texture::UV) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((*it).mUVChannelIndex == uv.name) {
|
if (texture.mUVChannelIndex == uv.name) {
|
||||||
ret = 1;
|
ret = 1;
|
||||||
|
|
||||||
// got it.
|
// got it.
|
||||||
if ((*it).mRealUVIndex == UINT_MAX || (*it).mRealUVIndex == next)
|
if (texture.mRealUVIndex == UINT_MAX || texture.mRealUVIndex == next)
|
||||||
{
|
{
|
||||||
(*it).mRealUVIndex = next;
|
texture.mRealUVIndex = next;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// channel mismatch. need to duplicate the material.
|
// channel mismatch. need to duplicate the material.
|
||||||
|
|
|
@ -55,9 +55,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "SkeletonMeshBuilder.h"
|
#include "SkeletonMeshBuilder.h"
|
||||||
#include "ConvertToLHProcess.h"
|
#include "ConvertToLHProcess.h"
|
||||||
#include "Importer.h"
|
#include "Importer.h"
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
#include "../include/assimp/IOSystem.hpp"
|
#include <assimp/IOSystem.hpp>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -43,9 +43,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "LimitBoneWeightsProcess.h"
|
#include "LimitBoneWeightsProcess.h"
|
||||||
#include "StringUtils.h"
|
#include "StringUtils.h"
|
||||||
#include "../include/assimp/postprocess.h"
|
#include <assimp/postprocess.h>
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include "../include/assimp/scene.h"
|
#include <assimp/scene.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
|
@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "TinyFormatter.h"
|
#include "TinyFormatter.h"
|
||||||
#include "Exceptional.h"
|
#include "Exceptional.h"
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
|
|
|
@ -45,12 +45,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef AI_MD2FILEHELPER_H_INC
|
#ifndef AI_MD2FILEHELPER_H_INC
|
||||||
#define AI_MD2FILEHELPER_H_INC
|
#define AI_MD2FILEHELPER_H_INC
|
||||||
|
|
||||||
#include "../include/assimp/types.h"
|
#include <assimp/types.h>
|
||||||
#include "../include/assimp/mesh.h"
|
#include <assimp/mesh.h>
|
||||||
#include "../include/assimp/anim.h"
|
#include <assimp/anim.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "./../include/assimp/Compiler/pushpack1.h"
|
#include <assimp/Compiler/pushpack1.h>
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
namespace MD2 {
|
namespace MD2 {
|
||||||
|
@ -147,7 +147,7 @@ struct Skin
|
||||||
char name[AI_MD2_MAXQPATH]; /* texture file name */
|
char name[AI_MD2_MAXQPATH]; /* texture file name */
|
||||||
} PACK_STRUCT;
|
} PACK_STRUCT;
|
||||||
|
|
||||||
#include "./../include/assimp/Compiler/poppack1.h"
|
#include <assimp/Compiler/poppack1.h>
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
|
@ -46,18 +46,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "MD2Loader.h"
|
#include "MD2Loader.h"
|
||||||
#include "ByteSwapper.h"
|
#include "ByteSwapper.h"
|
||||||
#include "MD2NormalTable.h" // shouldn't be included by other units
|
#include "MD2NormalTable.h" // shouldn't be included by other units
|
||||||
#include "../include/assimp/DefaultLogger.hpp"
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include "../include/assimp/Importer.hpp"
|
#include <assimp/Importer.hpp>
|
||||||
|
#include <assimp/IOSystem.hpp>
|
||||||
|
#include <assimp/scene.h>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "../include/assimp/IOSystem.hpp"
|
|
||||||
#include "../include/assimp/scene.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
using namespace Assimp::MD2;
|
using namespace Assimp::MD2;
|
||||||
|
|
||||||
|
|
||||||
// helper macro to determine the size of an array
|
// helper macro to determine the size of an array
|
||||||
#if (!defined ARRAYSIZE)
|
#if (!defined ARRAYSIZE)
|
||||||
# define ARRAYSIZE(_array) (int(sizeof(_array) / sizeof(_array[0])))
|
# define ARRAYSIZE(_array) (int(sizeof(_array) / sizeof(_array[0])))
|
||||||
|
|
|
@ -45,14 +45,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#define AI_MD2LOADER_H_INCLUDED
|
#define AI_MD2LOADER_H_INCLUDED
|
||||||
|
|
||||||
#include "BaseImporter.h"
|
#include "BaseImporter.h"
|
||||||
#include "../include/assimp/types.h"
|
#include <assimp/types.h>
|
||||||
#include "ByteSwapper.h"
|
#include "ByteSwapper.h"
|
||||||
|
|
||||||
#include "MD2FileData.h"
|
#include "MD2FileData.h"
|
||||||
|
|
||||||
struct aiNode;
|
struct aiNode;
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
|
|
||||||
using namespace MD2;
|
using namespace MD2;
|
||||||
|
|
||||||
|
|
|
@ -51,11 +51,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "../include/assimp/types.h"
|
#include <assimp/types.h>
|
||||||
#include "../include/assimp/mesh.h"
|
#include <assimp/mesh.h>
|
||||||
#include "../include/assimp/anim.h"
|
#include <assimp/anim.h>
|
||||||
|
|
||||||
#include "./../include/assimp/Compiler/pushpack1.h"
|
#include <assimp/Compiler/pushpack1.h>
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
namespace MD3 {
|
namespace MD3 {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue