Model loading and texturing

This commit is contained in:
Dane Johnson
2021-01-18 18:25:47 -06:00
parent 66bf7776c7
commit 155b572aca
1283 changed files with 533814 additions and 42 deletions

View File

@@ -0,0 +1,5 @@
%{
#include "DefaultLogger.h"
%}
%include "DefaultLogger.h"

View File

@@ -0,0 +1,5 @@
%{
#include "IOStream.h"
%}
%include "IOStream.h"

View File

@@ -0,0 +1,11 @@
%{
#include "IOSystem.h"
%}
// The const char* overload is used instead.
%ignore Assimp::IOSystem::Exists(const std::string&) const;
%ignore Assimp::IOSystem::Open(const std::string& pFile);
%ignore Assimp::IOSystem::Open(const std::string& pFile, const std::string& pMode);
%ignore Assimp::IOSystem::ComparePaths(const std::string& one, const std::string& second) const;
%include "IOSystem.h"

View File

@@ -0,0 +1,5 @@
%{
#include "LogStream.h"
%}
%include "LogStream.h"

View File

@@ -0,0 +1,5 @@
%{
#include "Logger.h"
%}
%include "Logger.h"

View File

@@ -0,0 +1,5 @@
%{
#include "NullLogger.h"
%}
%include "NullLogger.h"

View File

@@ -0,0 +1,8 @@
%{
#include "aiAnim.h"
%}
ASSIMP_ARRAY(aiAnimation, aiNodeAnim*, mChannels, $self->mNumChannels);
ASSIMP_ARRAY(aiAnimation, aiMeshAnim*, mMeshChannels, $self->mNumMeshChannels);
%include "aiAnim.h"

View File

@@ -0,0 +1,5 @@
%{
#include "aiAssert.h"
%}
%include "aiAssert.h"

View File

@@ -0,0 +1,5 @@
%{
#include "aiCamera.h"
%}
%include "aiCamera.h"

View File

@@ -0,0 +1,5 @@
%{
#include "aiColor4D.h"
%}
%include "aiColor4D.h"

View File

@@ -0,0 +1,5 @@
%{
#include "aiConfig.h"
%}
%include "aiConfig.h"

View File

@@ -0,0 +1,5 @@
%{
#include "aiDefines.h"
%}
%include "aiDefines.h"

View File

@@ -0,0 +1,5 @@
%{
#include "aiFileIO.h"
%}
%include "aiFileIO.h"

View File

@@ -0,0 +1,5 @@
%{
#include "aiLight.h"
%}
%include "aiLight.h"

View File

@@ -0,0 +1,33 @@
%{
#include "aiMaterial.h"
%}
ASSIMP_ARRAY(aiMaterial, aiMaterialProperty*, mProperties, $self->mNumProperties)
%include <typemaps.i>
%apply enum SWIGTYPE *OUTPUT { aiTextureMapping* mapping };
%apply unsigned int *OUTPUT { unsigned int* uvindex };
%apply float *OUTPUT { float* blend };
%apply enum SWIGTYPE *OUTPUT { aiTextureOp* op };
%apply unsigned int *OUTPUT { unsigned int* flags };
%include "aiMaterial.h"
%clear unsigned int* flags;
%clear aiTextureOp* op;
%clear float *blend;
%clear unsigned int* uvindex;
%clear aiTextureMapping* mapping;
%apply int &OUTPUT { int &pOut };
%apply float &OUTPUT { float &pOut };
%template(GetInteger) aiMaterial::Get<int>;
%template(GetFloat) aiMaterial::Get<float>;
%template(GetColor4D) aiMaterial::Get<aiColor4D>;
%template(GetColor3D) aiMaterial::Get<aiColor3D>;
%template(GetString) aiMaterial::Get<aiString>;
%clear int &pOut;
%clear float &pOut;

View File

@@ -0,0 +1,5 @@
%{
#include "aiMatrix3x3.h"
%}
%include "aiMatrix3x3.h"

View File

@@ -0,0 +1,5 @@
%{
#include "aiMatrix4x4.h"
%}
%include "aiMatrix4x4.h"

View File

@@ -0,0 +1,29 @@
%{
#include "aiMesh.h"
%}
ASSIMP_ARRAY(aiFace, unsigned int, mIndices, $self->mNumIndices);
ASSIMP_POINTER_ARRAY(aiBone, aiVertexWeight, mWeights, $self->mNumWeights);
ASSIMP_POINTER_ARRAY(aiAnimMesh, aiVector3D, mVertices, $self->mNumVertices);
ASSIMP_POINTER_ARRAY(aiAnimMesh, aiVector3D, mNormals, $self->mNumVertices);
ASSIMP_POINTER_ARRAY(aiAnimMesh, aiVector3D, mTangents, $self->mNumVertices);
ASSIMP_POINTER_ARRAY(aiAnimMesh, aiVector3D, mBitangents, $self->mNumVertices);
ASSIMP_POINTER_ARRAY_ARRAY(aiAnimMesh, aiVector3D, mTextureCoords, AI_MAX_NUMBER_OF_TEXTURECOORDS, $self->mNumVertices);
ASSIMP_POINTER_ARRAY_ARRAY(aiAnimMesh, aiColor4D, mColors, AI_MAX_NUMBER_OF_COLOR_SETS, $self->mNumVertices);
ASSIMP_ARRAY(aiMesh, aiAnimMesh*, mAnimMeshes, $self->mNumAnimMeshes);
ASSIMP_ARRAY(aiMesh, aiBone*, mBones, $self->mNumBones);
ASSIMP_ARRAY(aiMesh, unsigned int, mNumUVComponents, AI_MAX_NUMBER_OF_TEXTURECOORDS);
ASSIMP_POINTER_ARRAY(aiMesh, aiVector3D, mVertices, $self->mNumVertices);
ASSIMP_POINTER_ARRAY(aiMesh, aiVector3D, mNormals, $self->mNumVertices);
ASSIMP_POINTER_ARRAY(aiMesh, aiVector3D, mTangents, $self->mNumVertices);
ASSIMP_POINTER_ARRAY(aiMesh, aiVector3D, mBitangents, $self->mNumVertices);
ASSIMP_POINTER_ARRAY(aiMesh, aiFace, mFaces, $self->mNumFaces);
ASSIMP_POINTER_ARRAY_ARRAY(aiMesh, aiVector3D, mTextureCoords, AI_MAX_NUMBER_OF_TEXTURECOORDS, $self->mNumVertices);
ASSIMP_POINTER_ARRAY_ARRAY(aiMesh, aiColor4D, mColors, AI_MAX_NUMBER_OF_COLOR_SETS, $self->mNumVertices);
%include "aiMesh.h"

View File

@@ -0,0 +1,7 @@
%{
#include "aiPostProcess.h"
%}
%feature("d:stripprefix", "aiProcess_") aiPostProcessSteps;
%include "aiPostProcess.h"

View File

@@ -0,0 +1,5 @@
%{
#include "aiQuaternion.h"
%}
%include "aiQuaternion.h"

View File

@@ -0,0 +1,17 @@
%{
#include "aiScene.h"
%}
ASSIMP_ARRAY(aiScene, aiAnimation*, mAnimations, $self->mNumAnimations);
ASSIMP_ARRAY(aiScene, aiCamera*, mCameras, $self->mNumCameras);
ASSIMP_ARRAY(aiScene, aiLight*, mLights, $self->mNumLights);
ASSIMP_ARRAY(aiScene, aiMaterial*, mMaterials, $self->mNumMaterials);
ASSIMP_ARRAY(aiScene, aiMesh*, mMeshes, $self->mNumMeshes);
ASSIMP_ARRAY(aiScene, aiTexture*, mTextures, $self->mNumTextures);
ASSIMP_ARRAY(aiNode, aiNode*, mChildren, $self->mNumChildren);
ASSIMP_ARRAY(aiNode, unsigned int, mMeshes, $self->mNumMeshes);
%include "aiScene.h"

View File

@@ -0,0 +1,5 @@
%{
#include "aiTexture.h"
%}
%include "aiTexture.h"

View File

@@ -0,0 +1,8 @@
%{
#include "aiTypes.h"
%}
// The const char* overload is used instead.
%ignore aiString::Set(const std::string& pString);
%include "aiTypes.h"

View File

@@ -0,0 +1,5 @@
%{
#include "aiVector2D.h"
%}
%include "aiVector2D.h"

View File

@@ -0,0 +1,5 @@
%{
#include "aiVector3D.h"
%}
%include "aiVector3D.h"

View File

@@ -0,0 +1,5 @@
%{
#include "aiVersion.h"
%}
%include "aiVersion.h"

View File

@@ -0,0 +1,45 @@
%{
#include "assimp.hpp"
%}
namespace Assimp {
// See docs in assimp.hpp.
%ignore Importer::ReadFile(const std::string& pFile, unsigned int pFlags);
%ignore Importer::GetExtensionList(std::string& szOut);
%ignore Importer::IsExtensionSupported(const std::string& szExtension);
// These are only necessary for extending Assimp with custom importers or post
// processing steps, which would require wrapping the internal BaseImporter and
// BaseProcess classes.
%ignore Importer::RegisterLoader(BaseImporter* pImp);
%ignore Importer::UnregisterLoader(BaseImporter* pImp);
%ignore Importer::RegisterPPStep(BaseProcess* pImp);
%ignore Importer::UnregisterPPStep(BaseProcess* pImp);
%ignore Importer::FindLoader(const char* szExtension);
}
// Each aiScene has to keep a reference to the Importer to prevent it from
// being garbage collected, whose destructor would release the underlying
// C++ memory the scene is stored in.
%typemap(dcode) aiScene "package Object m_importer;"
%typemap(dout)
aiScene* GetScene,
aiScene* ReadFile,
aiScene* ApplyPostProcessing,
aiScene* ReadFileFromMemory {
void* cPtr = $wcall;
$dclassname ret = (cPtr is null) ? null : new $dclassname(cPtr, $owner);$excode
ret.m_importer = this;
return ret;
}
%include <typemaps.i>
%apply bool *OUTPUT { bool *bWasExisting };
%include "assimp.hpp"
%clear bool *bWasExisting;