Merge branch 'master' into fix-paint3d-vertexcolor

pull/1735/head
Kim Kulling 2018-02-20 09:23:53 +01:00 committed by GitHub
commit d49c5b6ecf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
627 changed files with 30879 additions and 2374 deletions

View File

@ -1,6 +1,7 @@
# Open Asset Import Library (assimp) # Open Asset Import Library (assimp)
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Copyright (c) 2006-2017, assimp team # Copyright (c) 2006-2018, assimp team
# All rights reserved. # All rights reserved.
# #
# Redistribution and use of this software in source and binary forms, # Redistribution and use of this software in source and binary forms,
@ -213,7 +214,9 @@ IF ((CMAKE_C_COMPILER_ID MATCHES "GNU") AND NOT CMAKE_COMPILER_IS_MINGW)
ELSEIF(MSVC) ELSEIF(MSVC)
# enable multi-core compilation with MSVC # enable multi-core compilation with MSVC
add_compile_options(/MP) add_compile_options(/MP)
if("${CMAKE_GENERATOR}" MATCHES "(Win64|IA64)")
add_compile_options( /bigobj )
endif()
# disable "elements of array '' will be default initialized" warning on MSVC2013 # disable "elements of array '' will be default initialized" warning on MSVC2013
IF(MSVC12) IF(MSVC12)
add_compile_options(/wd4351) add_compile_options(/wd4351)

View File

@ -120,7 +120,7 @@ Take a look into the `INSTALL` file. Our build system is CMake, if you used CMak
* [Pascal](port/AssimpPascal/Readme.md) * [Pascal](port/AssimpPascal/Readme.md)
* [Javascript (Alpha)](https://github.com/makc/assimp2json) * [Javascript (Alpha)](https://github.com/makc/assimp2json)
* [Unity 3d Plugin](https://www.assetstore.unity3d.com/en/#!/content/91777) * [Unity 3d Plugin](https://www.assetstore.unity3d.com/en/#!/content/91777)
* [JVM](https://github.com/kotlin-graphics/assimp) Full jvm port (currently supported obj, ply, stl, collada, md2) * [JVM](https://github.com/kotlin-graphics/assimp) Full jvm port (current [status](https://github.com/kotlin-graphics/assimp/wiki/Status))
### Other tools ### ### Other tools ###
[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.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.
@ -494,17 +495,16 @@ struct Material
/** Helper structure to represent a 3ds file mesh */ /** Helper structure to represent a 3ds file mesh */
struct Mesh : public MeshWithSmoothingGroups<D3DS::Face> struct Mesh : public MeshWithSmoothingGroups<D3DS::Face>
{ {
//! Default constructor //! Default constructor has been deleted
Mesh() Mesh() = delete;
{
static int iCnt = 0;
// Generate a default name for the mesh //! Constructor with explicit name
char szTemp[128]; explicit Mesh(const std::string &name)
ai_snprintf(szTemp, 128, "UNNAMED_%i",iCnt++); : mName(name)
mName = szTemp; {
} }
//! Name of the mesh //! Name of the mesh
std::string mName; std::string mName;
@ -550,25 +550,22 @@ struct aiFloatKey
/** Helper structure to represent a 3ds file node */ /** Helper structure to represent a 3ds file node */
struct Node struct Node
{ {
Node(): Node() = delete;
mParent(NULL)
, mInstanceNumber(0) explicit Node(const std::string &name)
, mHierarchyPos (0) : mParent(NULL)
, mHierarchyIndex (0) , mName(name)
, mInstanceCount (1) , mInstanceNumber(0)
, mHierarchyPos (0)
, mHierarchyIndex (0)
, mInstanceCount (1)
{ {
static int iCnt = 0;
// Generate a default name for the node
char szTemp[128];
::ai_snprintf(szTemp, 128, "UNNAMED_%i",iCnt++);
mName = szTemp;
aRotationKeys.reserve (20); aRotationKeys.reserve (20);
aPositionKeys.reserve (20); aPositionKeys.reserve (20);
aScalingKeys.reserve (20); aScalingKeys.reserve (20);
} }
~Node() ~Node()
{ {
for (unsigned int i = 0; i < mChildren.size();++i) for (unsigned int i = 0; i < mChildren.size();++i)

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.
@ -112,22 +113,24 @@ Discreet3DSImporter::Discreet3DSImporter()
, mScene() , mScene()
, mMasterScale() , mMasterScale()
, bHasBG() , bHasBG()
, bIsPrj() , bIsPrj() {
{} // empty
}
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Destructor, private as well // Destructor, private as well
Discreet3DSImporter::~Discreet3DSImporter() Discreet3DSImporter::~Discreet3DSImporter() {
{} // empty
}
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Returns whether the class can handle the format of the given file. // Returns whether the class can handle the format of the given file.
bool Discreet3DSImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const bool Discreet3DSImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const {
{
std::string extension = GetExtension(pFile); std::string extension = GetExtension(pFile);
if(extension == "3ds" || extension == "prj" ) { if(extension == "3ds" || extension == "prj" ) {
return true; return true;
} }
if (!extension.length() || checkSig) { if (!extension.length() || checkSig) {
uint16_t token[3]; uint16_t token[3];
token[0] = 0x4d4d; token[0] = 0x4d4d;
@ -170,7 +173,7 @@ void Discreet3DSImporter::InternReadFile( const std::string& pFile,
// Initialize members // Initialize members
mLastNodeIndex = -1; mLastNodeIndex = -1;
mCurrentNode = new D3DS::Node(); mCurrentNode = new D3DS::Node("UNNAMED");
mRootNode = mCurrentNode; mRootNode = mCurrentNode;
mRootNode->mHierarchyPos = -1; mRootNode->mHierarchyPos = -1;
mRootNode->mHierarchyIndex = -1; mRootNode->mHierarchyIndex = -1;
@ -209,7 +212,7 @@ void Discreet3DSImporter::InternReadFile( const std::string& pFile,
ConvertScene(pScene); ConvertScene(pScene);
// Generate the node graph for the scene. This is a little bit // Generate the node graph for the scene. This is a little bit
// tricky since we'll need to split some meshes into submeshes // tricky since we'll need to split some meshes into sub-meshes
GenerateNodeGraph(pScene); GenerateNodeGraph(pScene);
// Now apply the master scaling factor to the scene // Now apply the master scaling factor to the scene
@ -402,11 +405,7 @@ void Discreet3DSImporter::ParseChunk(const char* name, unsigned int num)
case Discreet3DS::CHUNK_TRIMESH: case Discreet3DS::CHUNK_TRIMESH:
{ {
// this starts a new triangle mesh // this starts a new triangle mesh
mScene->mMeshes.push_back(D3DS::Mesh()); mScene->mMeshes.push_back(D3DS::Mesh(std::string(name, num)));
D3DS::Mesh& m = mScene->mMeshes.back();
// Setup the name of the mesh
m.mName = std::string(name, num);
// Read mesh chunks // Read mesh chunks
ParseMeshChunk(); ParseMeshChunk();
@ -690,8 +689,7 @@ void Discreet3DSImporter::ParseHierarchyChunk(uint16_t parent)
pcNode->mInstanceCount++; pcNode->mInstanceCount++;
instanceNumber = pcNode->mInstanceCount; instanceNumber = pcNode->mInstanceCount;
} }
pcNode = new D3DS::Node(); pcNode = new D3DS::Node(name);
pcNode->mName = name;
pcNode->mInstanceNumber = instanceNumber; pcNode->mInstanceNumber = instanceNumber;
// There are two unknown values which we can safely ignore // There are two unknown values which we can safely ignore

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -4,7 +4,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.
@ -582,7 +583,7 @@ void ASEImporter::AddNodes (const std::vector<BaseNode*>& nodes,
node->mTransformation = mParentAdjust*snode->mTransform; node->mTransformation = mParentAdjust*snode->mTransform;
// Add sub nodes - prevent stack overflow due to recursive parenting // Add sub nodes - prevent stack overflow due to recursive parenting
if (node->mName != node->mParent->mName) { if (node->mName != node->mParent->mName && node->mName != node->mParent->mParent->mName ) {
AddNodes(nodes,node,node->mName.data,snode->mTransform); AddNodes(nodes,node,node->mName.data,snode->mTransform);
} }

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.
@ -292,7 +293,7 @@ void Parser::Parse()
if (TokenMatch(filePtr,"GEOMOBJECT",10)) if (TokenMatch(filePtr,"GEOMOBJECT",10))
{ {
m_vMeshes.push_back(Mesh()); m_vMeshes.push_back(Mesh("UNNAMED"));
ParseLV1ObjectBlock(m_vMeshes.back()); ParseLV1ObjectBlock(m_vMeshes.back());
continue; continue;
} }
@ -308,14 +309,14 @@ void Parser::Parse()
if (TokenMatch(filePtr,"LIGHTOBJECT",11)) if (TokenMatch(filePtr,"LIGHTOBJECT",11))
{ {
m_vLights.push_back(Light()); m_vLights.push_back(Light("UNNAMED"));
ParseLV1ObjectBlock(m_vLights.back()); ParseLV1ObjectBlock(m_vLights.back());
continue; continue;
} }
// camera object // camera object
if (TokenMatch(filePtr,"CAMERAOBJECT",12)) if (TokenMatch(filePtr,"CAMERAOBJECT",12))
{ {
m_vCameras.push_back(Camera()); m_vCameras.push_back(Camera("UNNAMED"));
ParseLV1ObjectBlock(m_vCameras.back()); ParseLV1ObjectBlock(m_vCameras.back());
continue; continue;
} }
@ -1553,7 +1554,7 @@ void Parser::ParseLV3MeshWeightsBlock(ASE::Mesh& mesh)
void Parser::ParseLV4MeshBones(unsigned int iNumBones,ASE::Mesh& mesh) void Parser::ParseLV4MeshBones(unsigned int iNumBones,ASE::Mesh& mesh)
{ {
AI_ASE_PARSER_INIT(); AI_ASE_PARSER_INIT();
mesh.mBones.resize(iNumBones); mesh.mBones.resize(iNumBones, Bone("UNNAMED"));
while (true) while (true)
{ {
if ('*' == *filePtr) if ('*' == *filePtr)

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.
@ -168,15 +169,7 @@ struct Face : public FaceWithSmoothingGroup
struct Bone struct Bone
{ {
//! Constructor //! Constructor
Bone() Bone() = delete;
{
static int iCnt = 0;
// Generate a default name for the bone
char szTemp[128];
::ai_snprintf(szTemp, 128, "UNNAMED_%i",iCnt++);
mName = szTemp;
}
//! Construction from an existing name //! Construction from an existing name
explicit Bone( const std::string& name) explicit Bone( const std::string& name)
@ -256,22 +249,19 @@ struct BaseNode
{ {
enum Type {Light, Camera, Mesh, Dummy} mType; enum Type {Light, Camera, Mesh, Dummy} mType;
//! Constructor. Creates a default name for the node
explicit BaseNode(Type _mType)
: mType (_mType)
, mProcessed (false)
{
// generate a default name for the node
static int iCnt = 0;
char szTemp[128]; // should be sufficiently large
::ai_snprintf(szTemp, 128, "UNNAMED_%i",iCnt++);
mName = szTemp;
//! Construction from an existing name
BaseNode(Type _mType, const std::string &name)
: mType (_mType)
, mName (name)
, mProcessed (false)
{
// Set mTargetPosition to qnan // Set mTargetPosition to qnan
const ai_real qnan = get_qnan(); const ai_real qnan = get_qnan();
mTargetPosition.x = qnan; mTargetPosition.x = qnan;
} }
//! Name of the mesh //! Name of the mesh
std::string mName; std::string mName;
@ -303,19 +293,22 @@ struct BaseNode
/** Helper structure to represent an ASE file mesh */ /** Helper structure to represent an ASE file mesh */
struct Mesh : public MeshWithSmoothingGroups<ASE::Face>, public BaseNode struct Mesh : public MeshWithSmoothingGroups<ASE::Face>, public BaseNode
{ {
//! Constructor. //! Default constructor has been deleted
Mesh() Mesh() = delete;
: BaseNode (BaseNode::Mesh)
, bSkip (false)
//! Construction from an existing name
explicit Mesh(const std::string &name)
: BaseNode (BaseNode::Mesh, name)
, iMaterialIndex(Face::DEFAULT_MATINDEX)
, bSkip (false)
{ {
// use 2 texture vertex components by default // use 2 texture vertex components by default
for (unsigned int c = 0; c < AI_MAX_NUMBER_OF_TEXTURECOORDS;++c) for (unsigned int c = 0; c < AI_MAX_NUMBER_OF_TEXTURECOORDS;++c)
this->mNumUVComponents[c] = 2; this->mNumUVComponents[c] = 2;
// setup the default material index by default
iMaterialIndex = Face::DEFAULT_MATINDEX;
} }
//! List of all texture coordinate sets //! List of all texture coordinate sets
std::vector<aiVector3D> amTexCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS]; std::vector<aiVector3D> amTexCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS];
@ -350,17 +343,21 @@ struct Light : public BaseNode
DIRECTIONAL DIRECTIONAL
}; };
//! Constructor. //! Default constructor has been deleted
Light() Light() = delete;
: BaseNode (BaseNode::Light)
, mLightType (OMNI) //! Construction from an existing name
, mColor (1.f,1.f,1.f) explicit Light(const std::string &name)
, mIntensity (1.f) // light is white by default : BaseNode (BaseNode::Light, name)
, mAngle (45.f) , mLightType (OMNI)
, mFalloff (0.f) , mColor (1.f,1.f,1.f)
, mIntensity (1.f) // light is white by default
, mAngle (45.f)
, mFalloff (0.f)
{ {
} }
LightType mLightType; LightType mLightType;
aiColor3D mColor; aiColor3D mColor;
ai_real mIntensity; ai_real mIntensity;
@ -378,16 +375,21 @@ struct Camera : public BaseNode
TARGET TARGET
}; };
//! Constructor //! Default constructor has been deleted
Camera() Camera() = delete;
: BaseNode (BaseNode::Camera)
, mFOV (0.75f) // in radians
, mNear (0.1f) //! Construction from an existing name
, mFar (1000.f) // could be zero explicit Camera(const std::string &name)
, mCameraType (FREE) : BaseNode (BaseNode::Camera, name)
, mFOV (0.75f) // in radians
, mNear (0.1f)
, mFar (1000.f) // could be zero
, mCameraType (FREE)
{ {
} }
ai_real mFOV, mNear, mFar; ai_real mFOV, mNear, mFar;
CameraType mCameraType; CameraType mCameraType;
}; };
@ -398,7 +400,7 @@ struct Dummy : public BaseNode
{ {
//! Constructor //! Constructor
Dummy() Dummy()
: BaseNode (BaseNode::Dummy) : BaseNode (BaseNode::Dummy, "DUMMY")
{ {
} }
}; };

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.
@ -41,6 +42,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file AssbinExporter.cpp /** @file AssbinExporter.cpp
* ASSBIN exporter main code * ASSBIN exporter main code
*/ */
#ifndef ASSIMP_BUILD_NO_EXPORT
#ifndef ASSIMP_BUILD_NO_ASSBIN_EXPORTER
#include "assbin_chunks.h" #include "assbin_chunks.h"
#include <assimp/version.h> #include <assimp/version.h>
#include <assimp/IOStream.hpp> #include <assimp/IOStream.hpp>
@ -57,10 +62,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <time.h> #include <time.h>
#ifndef ASSIMP_BUILD_NO_EXPORT
#ifndef ASSIMP_BUILD_NO_ASSBIN_EXPORTER
using namespace Assimp; using namespace Assimp;
namespace Assimp { namespace Assimp {

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.
@ -41,6 +42,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/** @file AssxmlExporter.cpp /** @file AssxmlExporter.cpp
* ASSXML exporter main code * ASSXML exporter main code
*/ */
#ifndef ASSIMP_BUILD_NO_EXPORT
#ifndef ASSIMP_BUILD_NO_ASSXML_EXPORTER
#include <stdarg.h> #include <stdarg.h>
#include <assimp/version.h> #include <assimp/version.h>
#include "ProcessHelper.h" #include "ProcessHelper.h"
@ -57,9 +62,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <time.h> #include <time.h>
#include <stdio.h> #include <stdio.h>
#ifndef ASSIMP_BUILD_NO_EXPORT
#ifndef ASSIMP_BUILD_NO_ASSXML_EXPORTER
using namespace Assimp; using namespace Assimp;
namespace Assimp { namespace Assimp {

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -4,7 +4,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -4,7 +4,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.
@ -83,7 +84,10 @@ class BVHLoader : public BaseImporter
std::vector<ChannelType> mChannels; std::vector<ChannelType> mChannels;
std::vector<float> mChannelValues; // motion data values for that node. Of size NumChannels * NumFrames std::vector<float> mChannelValues; // motion data values for that node. Of size NumChannels * NumFrames
Node() { } Node()
: mNode(nullptr)
{ }
explicit Node( const aiNode* pNode) : mNode( pNode) { } explicit Node( const aiNode* pNode) : mNode( pNode) { }
}; };

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.
@ -156,9 +157,6 @@ void BaseImporter::GetExtensionList(std::set<std::string>& extensions)
// read 200 characters from the file // read 200 characters from the file
std::unique_ptr<char[]> _buffer (new char[searchBytes+1 /* for the '\0' */]); std::unique_ptr<char[]> _buffer (new char[searchBytes+1 /* for the '\0' */]);
char* buffer = _buffer.get(); char* buffer = _buffer.get();
if( NULL == buffer ) {
return false;
}
const size_t read = pStream->Read(buffer,1,searchBytes); const size_t read = pStream->Read(buffer,1,searchBytes);
if( !read ) { if( !read ) {

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.
@ -57,12 +58,11 @@ using namespace Assimp::Formatter;
static bool match4(StreamReaderAny& stream, const char* string) { static bool match4(StreamReaderAny& stream, const char* string) {
ai_assert( nullptr != string ); ai_assert( nullptr != string );
char tmp[] = { char tmp[4];
(const char)(stream).GetI1(), tmp[ 0 ] = ( stream ).GetI1();
(const char)(stream).GetI1(), tmp[ 1 ] = ( stream ).GetI1();
(const char)(stream).GetI1(), tmp[ 2 ] = ( stream ).GetI1();
(const char)(stream).GetI1() tmp[ 3 ] = ( stream ).GetI1();
};
return (tmp[0]==string[0] && tmp[1]==string[1] && tmp[2]==string[2] && tmp[3]==string[3]); return (tmp[0]==string[0] && tmp[1]==string[1] && tmp[2]==string[2] && tmp[3]==string[3]);
} }

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.
@ -121,9 +122,11 @@ namespace Blender {
# pragma warning(disable:4351) # pragma warning(disable:4351)
#endif #endif
// As counter-intuitive as it may seem, a comparator must return false for equal values.
// The C++ standard defines and expects this behavior: true if lhs < rhs, false otherwise.
struct ObjectCompare { struct ObjectCompare {
bool operator() (const Object* left, const Object* right) const { bool operator() (const Object* left, const Object* right) const {
return ::strncmp(left->id.name, right->id.name, strlen( left->id.name ) ) == 0; return ::strncmp(left->id.name, right->id.name, strlen( left->id.name ) ) < 0;
} }
}; };
@ -142,9 +145,11 @@ namespace Blender {
, db(db) , db(db)
{} {}
// As counter-intuitive as it may seem, a comparator must return false for equal values.
// The C++ standard defines and expects this behavior: true if lhs < rhs, false otherwise.
struct ObjectCompare { struct ObjectCompare {
bool operator() (const Object* left, const Object* right) const { bool operator() (const Object* left, const Object* right) const {
return ::strncmp( left->id.name, right->id.name, strlen( left->id.name ) ) == 0; return ::strncmp( left->id.name, right->id.name, strlen( left->id.name ) ) < 0;
} }
}; };

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.
@ -153,14 +154,6 @@ void BlenderImporter::SetupProperties(const Importer* /*pImp*/)
// nothing to be done for the moment // nothing to be done for the moment
} }
struct free_it {
free_it(void* free) : free(free) {}
~free_it() {
::free(this->free);
}
void* free;
};
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Imports the given file into the given scene structure. // Imports the given file into the given scene structure.
@ -168,8 +161,7 @@ void BlenderImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler) aiScene* pScene, IOSystem* pIOHandler)
{ {
#ifndef ASSIMP_BUILD_NO_COMPRESSED_BLEND #ifndef ASSIMP_BUILD_NO_COMPRESSED_BLEND
Bytef* dest = NULL; std::vector<Bytef> uncompressed;
free_it free_it_really(dest);
#endif #endif
@ -217,6 +209,7 @@ void BlenderImporter::InternReadFile( const std::string& pFile,
size_t total = 0l; size_t total = 0l;
// TODO: be smarter about this, decompress directly into heap buffer
// and decompress the data .... do 1k chunks in the hope that we won't kill the stack // and decompress the data .... do 1k chunks in the hope that we won't kill the stack
#define MYBLOCK 1024 #define MYBLOCK 1024
Bytef block[MYBLOCK]; Bytef block[MYBLOCK];
@ -231,8 +224,8 @@ void BlenderImporter::InternReadFile( const std::string& pFile,
} }
const size_t have = MYBLOCK - zstream.avail_out; const size_t have = MYBLOCK - zstream.avail_out;
total += have; total += have;
dest = reinterpret_cast<Bytef*>( realloc(dest,total) ); uncompressed.resize(total);
memcpy(dest + total - have,block,have); memcpy(uncompressed.data() + total - have,block,have);
} }
while (ret != Z_STREAM_END); while (ret != Z_STREAM_END);
@ -240,7 +233,7 @@ void BlenderImporter::InternReadFile( const std::string& pFile,
inflateEnd(&zstream); inflateEnd(&zstream);
// replace the input stream with a memory stream // replace the input stream with a memory stream
stream.reset(new MemoryIOStream(reinterpret_cast<uint8_t*>(dest),total)); stream.reset(new MemoryIOStream(reinterpret_cast<uint8_t*>(uncompressed.data()),total));
// .. and retry // .. and retry
stream->Read(magic,7,1); stream->Read(magic,7,1);

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -1,7 +1,8 @@
# Open Asset Import Library (assimp) # Open Asset Import Library (assimp)
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# #
# Copyright (c) 2006-2017, assimp team # Copyright (c) 2006-2018, assimp team
# All rights reserved. # All rights reserved.
# #

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.
@ -135,7 +136,7 @@ void CSMImporter::InternReadFile( const std::string& pFile,
TextFileToBuffer(file.get(),mBuffer2); TextFileToBuffer(file.get(),mBuffer2);
const char* buffer = &mBuffer2[0]; const char* buffer = &mBuffer2[0];
aiAnimation* anim = new aiAnimation(); std::unique_ptr<aiAnimation> anim(new aiAnimation());
int first = 0, last = 0x00ffffff; int first = 0, last = 0x00ffffff;
// now process the file and look out for '$' sections // now process the file and look out for '$' sections
@ -293,8 +294,8 @@ void CSMImporter::InternReadFile( const std::string& pFile,
// Store the one and only animation in the scene // Store the one and only animation in the scene
pScene->mAnimations = new aiAnimation*[pScene->mNumAnimations=1]; pScene->mAnimations = new aiAnimation*[pScene->mNumAnimations=1];
pScene->mAnimations[0] = anim;
anim->mName.Set("$CSM_MasterAnim"); anim->mName.Set("$CSM_MasterAnim");
pScene->mAnimations[0] = anim.release();
// mark the scene as incomplete and run SkeletonMeshBuilder on it // mark the scene as incomplete and run SkeletonMeshBuilder on it
pScene->mFlags |= AI_SCENE_FLAGS_INCOMPLETE; pScene->mFlags |= AI_SCENE_FLAGS_INCOMPLETE;

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -4,7 +4,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -4,7 +4,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.
@ -57,7 +58,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <memory> #include <memory>
#include "D3MFOpcPackage.h" #include "D3MFOpcPackage.h"
#include <contrib/unzip/unzip.h> #include <unzip.h>
#include <assimp/irrXMLWrapper.h> #include <assimp/irrXMLWrapper.h>
#include "3MFXmlTags.h" #include "3MFXmlTags.h"

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.
@ -55,7 +56,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <map> #include <map>
#include <algorithm> #include <algorithm>
#include <cassert> #include <cassert>
#include <contrib/unzip/unzip.h> #include <unzip.h>
#include "3MFXmlTags.h" #include "3MFXmlTags.h"
namespace Assimp { namespace Assimp {

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -3,7 +3,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.
@ -75,10 +76,9 @@ using namespace Util;
Converter::Converter( aiScene* out, const Document& doc ) Converter::Converter( aiScene* out, const Document& doc )
: defaultMaterialIndex() : defaultMaterialIndex()
, out( out ) , out( out )
, doc( doc ) , doc( doc ) {
{
// animations need to be converted first since this will // animations need to be converted first since this will
// populate the node_anim_chain_bits map, which is needed // populate the node_anim_chain_bits map, which is needed
// to determine which nodes need to be generated. // to determine which nodes need to be generated.
@ -116,8 +116,7 @@ Converter::Converter( aiScene* out, const Document& doc )
} }
Converter::~Converter() Converter::~Converter() {
{
std::for_each( meshes.begin(), meshes.end(), Util::delete_fun<aiMesh>() ); std::for_each( meshes.begin(), meshes.end(), Util::delete_fun<aiMesh>() );
std::for_each( materials.begin(), materials.end(), Util::delete_fun<aiMaterial>() ); std::for_each( materials.begin(), materials.end(), Util::delete_fun<aiMaterial>() );
std::for_each( animations.begin(), animations.end(), Util::delete_fun<aiAnimation>() ); std::for_each( animations.begin(), animations.end(), Util::delete_fun<aiAnimation>() );
@ -126,8 +125,7 @@ Converter::~Converter()
std::for_each( textures.begin(), textures.end(), Util::delete_fun<aiTexture>() ); std::for_each( textures.begin(), textures.end(), Util::delete_fun<aiTexture>() );
} }
void Converter::ConvertRootNode() void Converter::ConvertRootNode() {
{
out->mRootNode = new aiNode(); out->mRootNode = new aiNode();
out->mRootNode->mName.Set( "RootNode" ); out->mRootNode->mName.Set( "RootNode" );
@ -354,10 +352,12 @@ void Converter::ConvertCamera( const Model& model, const Camera& cam )
out_camera->mName.Set( FixNodeName( model.Name() ) ); out_camera->mName.Set( FixNodeName( model.Name() ) );
out_camera->mAspect = cam.AspectWidth() / cam.AspectHeight(); out_camera->mAspect = cam.AspectWidth() / cam.AspectHeight();
//cameras are defined along positive x direction //cameras are defined along positive x direction
out_camera->mPosition = aiVector3D(0.0f); out_camera->mPosition = cam.Position();
out_camera->mLookAt = aiVector3D(1.0f, 0.0f, 0.0f); out_camera->mLookAt = ( cam.InterestPosition() - out_camera->mPosition ).Normalize();
out_camera->mUp = aiVector3D(0.0f, 1.0f, 0.0f); out_camera->mUp = cam.UpVector();
out_camera->mHorizontalFOV = AI_DEG_TO_RAD( cam.FieldOfView() ); out_camera->mHorizontalFOV = AI_DEG_TO_RAD( cam.FieldOfView() );
out_camera->mClipPlaneNear = cam.NearPlane(); out_camera->mClipPlaneNear = cam.NearPlane();
out_camera->mClipPlaneFar = cam.FarPlane(); out_camera->mClipPlaneFar = cam.FarPlane();
@ -1130,14 +1130,14 @@ unsigned int Converter::ConvertMeshMultiMaterial( const MeshGeometry& mesh, cons
out_mesh->mBitangents[ cursor ] = ( *binormals )[ in_cursor ]; out_mesh->mBitangents[ cursor ] = ( *binormals )[ in_cursor ];
} }
for ( unsigned int i = 0; i < num_uvs; ++i ) { for ( unsigned int j = 0; j < num_uvs; ++j ) {
const std::vector<aiVector2D>& uvs = mesh.GetTextureCoords( i ); const std::vector<aiVector2D>& uvs = mesh.GetTextureCoords( j );
out_mesh->mTextureCoords[ i ][ cursor ] = aiVector3D( uvs[ in_cursor ].x, uvs[ in_cursor ].y, 0.0f ); out_mesh->mTextureCoords[ j ][ cursor ] = aiVector3D( uvs[ in_cursor ].x, uvs[ in_cursor ].y, 0.0f );
} }
for ( unsigned int i = 0; i < num_vcs; ++i ) { for ( unsigned int j = 0; j < num_vcs; ++j ) {
const std::vector<aiColor4D>& cols = mesh.GetVertexColors( i ); const std::vector<aiColor4D>& cols = mesh.GetVertexColors( j );
out_mesh->mColors[ i ][ cursor ] = cols[ in_cursor ]; out_mesh->mColors[ j ][ cursor ] = cols[ in_cursor ];
} }
} }
} }

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.
@ -350,7 +351,9 @@ void Document::ReadGlobalSettings()
return; return;
} }
std::shared_ptr<const PropertyTable> props = GetPropertyTable(*this, "", *ehead, *ehead->Compound(), true); std::shared_ptr<const PropertyTable> props = GetPropertyTable( *this, "", *ehead, *ehead->Compound(), true );
//double v = PropertyGet<float>( *props.get(), std::string("UnitScaleFactor"), 1.0 );
if(!props) { if(!props) {
DOMError("GlobalSettings dictionary contains no property table"); DOMError("GlobalSettings dictionary contains no property table");

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.
@ -1021,8 +1022,8 @@ public:
fbx_simple_property(CoordAxisSign, int, 1) fbx_simple_property(CoordAxisSign, int, 1)
fbx_simple_property(OriginalUpAxis, int, 0) fbx_simple_property(OriginalUpAxis, int, 0)
fbx_simple_property(OriginalUpAxisSign, int, 1) fbx_simple_property(OriginalUpAxisSign, int, 1)
fbx_simple_property(UnitScaleFactor, double, 1) fbx_simple_property(UnitScaleFactor, float, 1)
fbx_simple_property(OriginalUnitScaleFactor, double, 1) fbx_simple_property(OriginalUnitScaleFactor, float, 1)
fbx_simple_property(AmbientColor, aiVector3D, aiVector3D(0,0,0)) fbx_simple_property(AmbientColor, aiVector3D, aiVector3D(0,0,0))
fbx_simple_property(DefaultCamera, std::string, "") fbx_simple_property(DefaultCamera, std::string, "")

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -105,7 +105,7 @@ inline const T* ProcessSimpleConnection(const Connection& con,
const Object* const ob = con.SourceObject(); const Object* const ob = con.SourceObject();
if(!ob) { if(!ob) {
DOMWarning("failed to read source object for incoming" + std::string(name) + DOMWarning("failed to read source object for incoming " + std::string(name) +
" link, ignoring", " link, ignoring",
&element); &element);
return NULL; return NULL;

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

View File

@ -2,7 +2,8 @@
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2017, assimp team Copyright (c) 2006-2018, assimp team
All rights reserved. All rights reserved.

Some files were not shown because too many files have changed in this diff Show More