Merge branch 'master' of https://github.com/assimp/assimp
commit
3ad7aea123
|
@ -16,7 +16,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules")
|
||||||
set(LIBASSIMP_COMPONENT libassimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}.${ASSIMP_VERSION_PATCH})
|
set(LIBASSIMP_COMPONENT libassimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}.${ASSIMP_VERSION_PATCH})
|
||||||
set(LIBASSIMP-DEV_COMPONENT libassimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}.${ASSIMP_VERSION_PATCH}-dev)
|
set(LIBASSIMP-DEV_COMPONENT libassimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}.${ASSIMP_VERSION_PATCH}-dev)
|
||||||
set(CPACK_COMPONENTS_ALL assimp-bin ${LIBASSIMP_COMPONENT} ${LIBASSIMP-DEV_COMPONENT} assimp-dev)
|
set(CPACK_COMPONENTS_ALL assimp-bin ${LIBASSIMP_COMPONENT} ${LIBASSIMP-DEV_COMPONENT} assimp-dev)
|
||||||
set(ASSIMP_LIBRARY_SUFFIX "${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}" CACHE STRING "Suffix to append to library names")
|
set(ASSIMP_LIBRARY_SUFFIX "" CACHE STRING "Suffix to append to library names")
|
||||||
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
||||||
add_definitions(-fPIC) # this is a very important switch and some libraries seem now to have it....
|
add_definitions(-fPIC) # this is a very important switch and some libraries seem now to have it....
|
||||||
|
|
|
@ -19,7 +19,7 @@ Open Asset Import Library (assimp)
|
||||||
|
|
||||||
Open Asset Import Library is a Open Source library designed to load various 3d file formats and convert them into a shared, in-memory format. It supports more than 30 file formats. It also supports exporting files to a few selected file formats.
|
Open Asset Import Library is a Open Source library designed to load various 3d file formats and convert them into a shared, in-memory format. It supports more than 30 file formats. It also supports exporting files to a few selected file formats.
|
||||||
|
|
||||||
Its short name is _assimp_, which is an unintended joke (the abbreviation is derived from _Asset Importer_).
|
Its abbreviated name is _assimp_.
|
||||||
|
|
||||||
__Note__: this `README` refers to the file structure used by release packages, which differs in some points from the development trunk.
|
__Note__: this `README` refers to the file structure used by release packages, which differs in some points from the development trunk.
|
||||||
|
|
||||||
|
@ -129,5 +129,3 @@ The license of the Asset Import Library is based on the modified, __3-clause BSD
|
||||||
Note that, unlike LGPLed code, you may link statically to Assimp.
|
Note that, unlike LGPLed code, you may link statically to Assimp.
|
||||||
For the formal details, see the `LICENSE` file.
|
For the formal details, see the `LICENSE` file.
|
||||||
|
|
||||||
|
|
||||||
------------------------------
|
|
||||||
|
|
|
@ -707,7 +707,7 @@ void Discreet3DSImporter::GenerateNodeGraph(aiScene* pcOut)
|
||||||
if (0 == mRootNode->mChildren.size())
|
if (0 == mRootNode->mChildren.size())
|
||||||
{
|
{
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
// It seems the file is so fucked up that it has not even a hierarchy.
|
// It seems the file is so messed up that it has not even a hierarchy.
|
||||||
// generate a flat hiearachy which looks like this:
|
// generate a flat hiearachy which looks like this:
|
||||||
//
|
//
|
||||||
// ROOT_NODE
|
// ROOT_NODE
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
@ -624,7 +625,7 @@ void BlenderImporter::ConvertMesh(const Scene& /*in*/, const Object* /*obj*/, co
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
typedef std::pair<const int,size_t> MyPair;
|
typedef std::pair<const int,size_t> MyPair;
|
||||||
if (!mesh->totface || !mesh->totvert) {
|
if ((!mesh->totface && !mesh->totloop) || !mesh->totvert) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -637,6 +638,10 @@ void BlenderImporter::ConvertMesh(const Scene& /*in*/, const Object* /*obj*/, co
|
||||||
ThrowException("Number of vertices is larger than the corresponding array");
|
ThrowException("Number of vertices is larger than the corresponding array");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (static_cast<size_t> ( mesh->totloop ) > mesh->mloop.size()) {
|
||||||
|
ThrowException("Number of vertices is larger than the corresponding array");
|
||||||
|
}
|
||||||
|
|
||||||
// collect per-submesh numbers
|
// collect per-submesh numbers
|
||||||
std::map<int,size_t> per_mat;
|
std::map<int,size_t> per_mat;
|
||||||
for (int i = 0; i < mesh->totface; ++i) {
|
for (int i = 0; i < mesh->totface; ++i) {
|
||||||
|
@ -644,6 +649,10 @@ void BlenderImporter::ConvertMesh(const Scene& /*in*/, const Object* /*obj*/, co
|
||||||
const MFace& mf = mesh->mface[i];
|
const MFace& mf = mesh->mface[i];
|
||||||
per_mat[ mf.mat_nr ]++;
|
per_mat[ mf.mat_nr ]++;
|
||||||
}
|
}
|
||||||
|
for (int i = 0; i < mesh->totpoly; ++i) {
|
||||||
|
const MPoly& mp = mesh->mpoly[i];
|
||||||
|
per_mat[ mp.mat_nr ]++;
|
||||||
|
}
|
||||||
|
|
||||||
// ... and allocate the corresponding meshes
|
// ... and allocate the corresponding meshes
|
||||||
const size_t old = temp->size();
|
const size_t old = temp->size();
|
||||||
|
@ -780,8 +789,56 @@ void BlenderImporter::ConvertMesh(const Scene& /*in*/, const Object* /*obj*/, co
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < mesh->totpoly; ++i) {
|
||||||
|
|
||||||
|
const MPoly& mf = mesh->mpoly[i];
|
||||||
|
|
||||||
|
aiMesh* const out = temp[ mat_num_to_mesh_idx[ mf.mat_nr ] ];
|
||||||
|
aiFace& f = out->mFaces[out->mNumFaces++];
|
||||||
|
|
||||||
|
f.mIndices = new unsigned int[ f.mNumIndices = mf.totloop ];
|
||||||
|
aiVector3D* vo = out->mVertices + out->mNumVertices;
|
||||||
|
aiVector3D* vn = out->mNormals + out->mNumVertices;
|
||||||
|
|
||||||
|
// XXX we can't fold this easily, because we are restricted
|
||||||
|
// to the member names from the BLEND file (v1,v2,v3,v4)
|
||||||
|
// which are assigned by the genblenddna.py script and
|
||||||
|
// cannot be changed without breaking the entire
|
||||||
|
// import process.
|
||||||
|
for (int j = 0;j < mf.totloop; ++j)
|
||||||
|
{
|
||||||
|
const MLoop& loop = mesh->mloop[mf.loopstart + j];
|
||||||
|
|
||||||
|
if (loop.v >= mesh->totvert) {
|
||||||
|
ThrowException("Vertex index out of range");
|
||||||
|
}
|
||||||
|
|
||||||
|
const MVert& v = mesh->mvert[loop.v];
|
||||||
|
|
||||||
|
vo->x = v.co[0];
|
||||||
|
vo->y = v.co[1];
|
||||||
|
vo->z = v.co[2];
|
||||||
|
vn->x = v.no[0];
|
||||||
|
vn->y = v.no[1];
|
||||||
|
vn->z = v.no[2];
|
||||||
|
f.mIndices[j] = out->mNumVertices++;
|
||||||
|
|
||||||
|
++vo;
|
||||||
|
++vn;
|
||||||
|
|
||||||
|
}
|
||||||
|
if (mf.totloop == 3)
|
||||||
|
{
|
||||||
|
out->mPrimitiveTypes |= aiPrimitiveType_TRIANGLE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out->mPrimitiveTypes |= aiPrimitiveType_POLYGON;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// collect texture coordinates, they're stored in a separate per-face buffer
|
// collect texture coordinates, they're stored in a separate per-face buffer
|
||||||
if (mesh->mtface) {
|
if (mesh->mtface || mesh->mloopuv) {
|
||||||
if (mesh->totface > static_cast<int> ( mesh->mtface.size())) {
|
if (mesh->totface > static_cast<int> ( mesh->mtface.size())) {
|
||||||
ThrowException("Number of UV faces is larger than the corresponding UV face array (#1)");
|
ThrowException("Number of UV faces is larger than the corresponding UV face array (#1)");
|
||||||
}
|
}
|
||||||
|
@ -804,6 +861,20 @@ void BlenderImporter::ConvertMesh(const Scene& /*in*/, const Object* /*obj*/, co
|
||||||
vo->y = v->uv[i][1];
|
vo->y = v->uv[i][1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < mesh->totpoly; ++i) {
|
||||||
|
const MPoly& v = mesh->mpoly[i];
|
||||||
|
aiMesh* const out = temp[ mat_num_to_mesh_idx[ v.mat_nr ] ];
|
||||||
|
const aiFace& f = out->mFaces[out->mNumFaces++];
|
||||||
|
|
||||||
|
aiVector3D* vo = &out->mTextureCoords[0][out->mNumVertices];
|
||||||
|
for (unsigned int j = 0; j < f.mNumIndices; ++j,++vo,++out->mNumVertices) {
|
||||||
|
const MLoopUV& uv = mesh->mloopuv[v.loopstart + j];
|
||||||
|
vo->x = uv.uv[0];
|
||||||
|
vo->y = uv.uv[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// collect texture coordinates, old-style (marked as deprecated in current blender sources)
|
// collect texture coordinates, old-style (marked as deprecated in current blender sources)
|
||||||
|
@ -833,7 +904,7 @@ void BlenderImporter::ConvertMesh(const Scene& /*in*/, const Object* /*obj*/, co
|
||||||
}
|
}
|
||||||
|
|
||||||
// collect vertex colors, stored separately as well
|
// collect vertex colors, stored separately as well
|
||||||
if (mesh->mcol) {
|
if (mesh->mcol || mesh->mloopcol) {
|
||||||
if (mesh->totface > static_cast<int> ( (mesh->mcol.size()/4)) ) {
|
if (mesh->totface > static_cast<int> ( (mesh->mcol.size()/4)) ) {
|
||||||
ThrowException("Number of faces is larger than the corresponding color face array");
|
ThrowException("Number of faces is larger than the corresponding color face array");
|
||||||
}
|
}
|
||||||
|
@ -860,6 +931,23 @@ void BlenderImporter::ConvertMesh(const Scene& /*in*/, const Object* /*obj*/, co
|
||||||
}
|
}
|
||||||
for (unsigned int n = f.mNumIndices; n < 4; ++n);
|
for (unsigned int n = f.mNumIndices; n < 4; ++n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < mesh->totpoly; ++i) {
|
||||||
|
const MPoly& v = mesh->mpoly[i];
|
||||||
|
aiMesh* const out = temp[ mat_num_to_mesh_idx[ v.mat_nr ] ];
|
||||||
|
const aiFace& f = out->mFaces[out->mNumFaces++];
|
||||||
|
|
||||||
|
aiColor4D* vo = &out->mColors[0][out->mNumVertices];
|
||||||
|
for (unsigned int j = 0; j < f.mNumIndices; ++j,++vo,++out->mNumVertices) {
|
||||||
|
const MLoopCol& col = mesh->mloopcol[v.loopstart + j];
|
||||||
|
vo->r = col.r;
|
||||||
|
vo->g = col.g;
|
||||||
|
vo->b = col.b;
|
||||||
|
vo->a = col.a;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -94,6 +94,7 @@ namespace Assimp {
|
||||||
|
|
||||||
struct Object;
|
struct Object;
|
||||||
struct MTex;
|
struct MTex;
|
||||||
|
struct Image;
|
||||||
|
|
||||||
#define AI_BLEND_MESH_MAX_VERTS 2000000000L
|
#define AI_BLEND_MESH_MAX_VERTS 2000000000L
|
||||||
|
|
||||||
|
@ -156,6 +157,38 @@ struct MEdge : ElemBase {
|
||||||
short flag;
|
short flag;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------------------
|
||||||
|
struct MLoop : ElemBase {
|
||||||
|
int v, e;
|
||||||
|
};
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------------------
|
||||||
|
struct MLoopUV : ElemBase {
|
||||||
|
float uv[2];
|
||||||
|
int flag;
|
||||||
|
};
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------------------
|
||||||
|
// Note that red and blue are not swapped, as with MCol
|
||||||
|
struct MLoopCol : ElemBase {
|
||||||
|
char r, g, b, a;
|
||||||
|
};
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------------------
|
||||||
|
struct MPoly : ElemBase {
|
||||||
|
int loopstart;
|
||||||
|
int totloop;
|
||||||
|
short mat_nr;
|
||||||
|
char flag;
|
||||||
|
};
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------------------
|
||||||
|
struct MTexPoly : ElemBase {
|
||||||
|
Image* tpage;
|
||||||
|
char flag, transp;
|
||||||
|
short mode, tile, pad;
|
||||||
|
};
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
struct MCol : ElemBase {
|
struct MCol : ElemBase {
|
||||||
char r,g,b,a FAIL;
|
char r,g,b,a FAIL;
|
||||||
|
@ -235,6 +268,8 @@ struct Mesh : ElemBase {
|
||||||
int totface FAIL;
|
int totface FAIL;
|
||||||
int totedge FAIL;
|
int totedge FAIL;
|
||||||
int totvert FAIL;
|
int totvert FAIL;
|
||||||
|
int totloop;
|
||||||
|
int totpoly;
|
||||||
|
|
||||||
short subdiv;
|
short subdiv;
|
||||||
short subdivr;
|
short subdivr;
|
||||||
|
@ -246,6 +281,11 @@ struct Mesh : ElemBase {
|
||||||
vector<TFace> tface;
|
vector<TFace> tface;
|
||||||
vector<MVert> mvert FAIL;
|
vector<MVert> mvert FAIL;
|
||||||
vector<MEdge> medge WARN;
|
vector<MEdge> medge WARN;
|
||||||
|
vector<MLoop> mloop;
|
||||||
|
vector<MLoopUV> mloopuv;
|
||||||
|
vector<MLoopCol> mloopcol;
|
||||||
|
vector<MPoly> mpoly;
|
||||||
|
vector<MTexPoly> mtpoly;
|
||||||
vector<MDeformVert> dvert;
|
vector<MDeformVert> dvert;
|
||||||
vector<MCol> mcol;
|
vector<MCol> mcol;
|
||||||
|
|
||||||
|
|
|
@ -47,174 +47,204 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
namespace Blender {
|
namespace Blender {
|
||||||
|
|
||||||
|
|
||||||
template <> void Structure :: Convert<Object> (
|
template <> void Structure :: Convert<Object> (
|
||||||
Object& dest,
|
Object& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<Group> (
|
template <> void Structure :: Convert<Group> (
|
||||||
Group& dest,
|
Group& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<MTex> (
|
template <> void Structure :: Convert<MTex> (
|
||||||
MTex& dest,
|
MTex& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<TFace> (
|
template <> void Structure :: Convert<TFace> (
|
||||||
TFace& dest,
|
TFace& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<SubsurfModifierData> (
|
template <> void Structure :: Convert<SubsurfModifierData> (
|
||||||
SubsurfModifierData& dest,
|
SubsurfModifierData& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<MFace> (
|
template <> void Structure :: Convert<MFace> (
|
||||||
MFace& dest,
|
MFace& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<Lamp> (
|
template <> void Structure :: Convert<Lamp> (
|
||||||
Lamp& dest,
|
Lamp& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<MDeformWeight> (
|
template <> void Structure :: Convert<MDeformWeight> (
|
||||||
MDeformWeight& dest,
|
MDeformWeight& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<PackedFile> (
|
template <> void Structure :: Convert<PackedFile> (
|
||||||
PackedFile& dest,
|
PackedFile& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<Base> (
|
template <> void Structure :: Convert<Base> (
|
||||||
Base& dest,
|
Base& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<MTFace> (
|
template <> void Structure :: Convert<MTFace> (
|
||||||
MTFace& dest,
|
MTFace& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<Material> (
|
template <> void Structure :: Convert<Material> (
|
||||||
Material& dest,
|
Material& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<Mesh> (
|
template <> void Structure :: Convert<MTexPoly> (
|
||||||
Mesh& dest,
|
MTexPoly& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<MDeformVert> (
|
template <> void Structure :: Convert<Mesh> (
|
||||||
MDeformVert& dest,
|
Mesh& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<World> (
|
template <> void Structure :: Convert<MDeformVert> (
|
||||||
World& dest,
|
MDeformVert& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<MVert> (
|
template <> void Structure :: Convert<World> (
|
||||||
MVert& dest,
|
World& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<MEdge> (
|
template <> void Structure :: Convert<MLoopCol> (
|
||||||
MEdge& dest,
|
MLoopCol& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<GroupObject> (
|
template <> void Structure :: Convert<MVert> (
|
||||||
GroupObject& dest,
|
MVert& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<ListBase> (
|
template <> void Structure :: Convert<MEdge> (
|
||||||
ListBase& dest,
|
MEdge& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<ModifierData> (
|
template <> void Structure :: Convert<MLoopUV> (
|
||||||
ModifierData& dest,
|
MLoopUV& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<ID> (
|
template <> void Structure :: Convert<GroupObject> (
|
||||||
ID& dest,
|
GroupObject& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<MCol> (
|
template <> void Structure :: Convert<ListBase> (
|
||||||
MCol& dest,
|
ListBase& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<Image> (
|
template <> void Structure :: Convert<MLoop> (
|
||||||
Image& dest,
|
MLoop& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<Scene> (
|
template <> void Structure :: Convert<ModifierData> (
|
||||||
Scene& dest,
|
ModifierData& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<Library> (
|
template <> void Structure :: Convert<ID> (
|
||||||
Library& dest,
|
ID& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<Tex> (
|
template <> void Structure :: Convert<MCol> (
|
||||||
Tex& dest,
|
MCol& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<Camera> (
|
template <> void Structure :: Convert<MPoly> (
|
||||||
Camera& dest,
|
MPoly& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
template <> void Structure :: Convert<MirrorModifierData> (
|
template <> void Structure :: Convert<Scene> (
|
||||||
MirrorModifierData& dest,
|
Scene& dest,
|
||||||
const FileDatabase& db
|
const FileDatabase& db
|
||||||
) const
|
) const
|
||||||
;
|
;
|
||||||
|
|
||||||
|
template <> void Structure :: Convert<Library> (
|
||||||
|
Library& dest,
|
||||||
|
const FileDatabase& db
|
||||||
|
) const
|
||||||
|
;
|
||||||
|
|
||||||
|
template <> void Structure :: Convert<Tex> (
|
||||||
|
Tex& dest,
|
||||||
|
const FileDatabase& db
|
||||||
|
) const
|
||||||
|
;
|
||||||
|
|
||||||
|
template <> void Structure :: Convert<Camera> (
|
||||||
|
Camera& dest,
|
||||||
|
const FileDatabase& db
|
||||||
|
) const
|
||||||
|
;
|
||||||
|
|
||||||
|
template <> void Structure :: Convert<MirrorModifierData> (
|
||||||
|
MirrorModifierData& dest,
|
||||||
|
const FileDatabase& db
|
||||||
|
) const
|
||||||
|
;
|
||||||
|
|
||||||
|
template <> void Structure :: Convert<Image> (
|
||||||
|
Image& dest,
|
||||||
|
const FileDatabase& db
|
||||||
|
) const
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -255,7 +255,7 @@ namespace boost {
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Constructs a tuple with 2 elements (fucking idiot, use std::pair instead!)
|
// Constructs a tuple with 2 elements
|
||||||
template <typename T0,typename T1>
|
template <typename T0,typename T1>
|
||||||
inline tuple <T0,T1> make_tuple (const T0& t0,
|
inline tuple <T0,T1> make_tuple (const T0& t0,
|
||||||
const T1& t1) {
|
const T1& t1) {
|
||||||
|
@ -265,7 +265,7 @@ namespace boost {
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Constructs a tuple with 1 elements (no comment ...)
|
// Constructs a tuple with 1 elements (well ...)
|
||||||
template <typename T0>
|
template <typename T0>
|
||||||
inline tuple <T0> make_tuple (const T0& t0) {
|
inline tuple <T0> make_tuple (const T0& t0) {
|
||||||
tuple <T0> t;
|
tuple <T0> t;
|
||||||
|
@ -273,7 +273,7 @@ namespace boost {
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Constructs a tuple with 0 elements (ehm? Try http://www.promillerechner.net)
|
// Constructs a tuple with 0 elements (well ...)
|
||||||
inline tuple <> make_tuple () {
|
inline tuple <> make_tuple () {
|
||||||
tuple <> t;
|
tuple <> t;
|
||||||
return t;
|
return t;
|
||||||
|
|
|
@ -1045,9 +1045,9 @@ void COBImporter::ReadPolH_Binary(COB::Scene& out, StreamReaderLE& reader, const
|
||||||
v.y = reader.GetF4();
|
v.y = reader.GetF4();
|
||||||
}
|
}
|
||||||
|
|
||||||
const size_t numfuck = reader.GetI4();
|
const size_t numf = reader.GetI4();
|
||||||
msh.faces.reserve(numfuck);
|
msh.faces.reserve(numf);
|
||||||
for(size_t i = 0; i < numfuck; ++i) {
|
for(size_t i = 0; i < numf; ++i) {
|
||||||
// XXX backface culling flag is 0x10 in flags
|
// XXX backface culling flag is 0x10 in flags
|
||||||
|
|
||||||
// hole?
|
// hole?
|
||||||
|
|
|
@ -99,7 +99,7 @@ void ColladaExporter::WriteFile()
|
||||||
|
|
||||||
WriteSceneLibrary();
|
WriteSceneLibrary();
|
||||||
|
|
||||||
// useless Collada bullshit at the end, just in case we haven't had enough indirections, yet.
|
// useless Collada fu at the end, just in case we haven't had enough indirections, yet.
|
||||||
mOutput << startstr << "<scene>" << endstr;
|
mOutput << startstr << "<scene>" << endstr;
|
||||||
PushTag();
|
PushTag();
|
||||||
mOutput << startstr << "<instance_visual_scene url=\"#myScene\" />" << endstr;
|
mOutput << startstr << "<instance_visual_scene url=\"#myScene\" />" << endstr;
|
||||||
|
@ -495,7 +495,7 @@ void ColladaExporter::WriteFloatArray( const std::string& pIdString, FloatDataTy
|
||||||
mOutput << "</float_array>" << endstr;
|
mOutput << "</float_array>" << endstr;
|
||||||
PopTag();
|
PopTag();
|
||||||
|
|
||||||
// the usual Collada bullshit. Let's bloat it even more!
|
// the usual Collada fun. Let's bloat it even more!
|
||||||
mOutput << startstr << "<technique_common>" << endstr;
|
mOutput << startstr << "<technique_common>" << endstr;
|
||||||
PushTag();
|
PushTag();
|
||||||
mOutput << startstr << "<accessor count=\"" << pElementCount << "\" offset=\"0\" source=\"#" << arrayId << "\" stride=\"" << floatsPerElement << "\">" << endstr;
|
mOutput << startstr << "<accessor count=\"" << pElementCount << "\" offset=\"0\" source=\"#" << arrayId << "\" stride=\"" << floatsPerElement << "\">" << endstr;
|
||||||
|
|
|
@ -119,6 +119,7 @@ struct Camera
|
||||||
};
|
};
|
||||||
|
|
||||||
#define aiLightSource_AMBIENT 0xdeaddead
|
#define aiLightSource_AMBIENT 0xdeaddead
|
||||||
|
#define ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET 1e9f
|
||||||
|
|
||||||
/** A collada light source. */
|
/** A collada light source. */
|
||||||
struct Light
|
struct Light
|
||||||
|
@ -129,8 +130,8 @@ struct Light
|
||||||
, mAttQuadratic (0.f)
|
, mAttQuadratic (0.f)
|
||||||
, mFalloffAngle (180.f)
|
, mFalloffAngle (180.f)
|
||||||
, mFalloffExponent (0.f)
|
, mFalloffExponent (0.f)
|
||||||
, mPenumbraAngle (10e10f)
|
, mPenumbraAngle (ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET)
|
||||||
, mOuterAngle (10e10f)
|
, mOuterAngle (ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET)
|
||||||
, mIntensity (1.f)
|
, mIntensity (1.f)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
|
@ -325,11 +325,11 @@ void ColladaLoader::BuildLightsForNode( const ColladaParser& pParser, const Coll
|
||||||
|
|
||||||
out->mAngleInnerCone = AI_DEG_TO_RAD( srcLight->mFalloffAngle );
|
out->mAngleInnerCone = AI_DEG_TO_RAD( srcLight->mFalloffAngle );
|
||||||
|
|
||||||
// ... some extension magic. FUCKING COLLADA.
|
// ... some extension magic.
|
||||||
if (srcLight->mOuterAngle == 10e10f)
|
if (srcLight->mOuterAngle >= ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET*(1-1e-6f))
|
||||||
{
|
{
|
||||||
// ... some deprecation magic. FUCKING FCOLLADA.
|
// ... some deprecation magic.
|
||||||
if (srcLight->mPenumbraAngle == 10e10f)
|
if (srcLight->mPenumbraAngle >= ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET*(1-1e-6f))
|
||||||
{
|
{
|
||||||
// Need to rely on falloff_exponent. I don't know how to interpret it, so I need to guess ....
|
// Need to rely on falloff_exponent. I don't know how to interpret it, so I need to guess ....
|
||||||
// epsilon chosen to be 0.1
|
// epsilon chosen to be 0.1
|
||||||
|
@ -382,7 +382,7 @@ void ColladaLoader::BuildCamerasForNode( const ColladaParser& pParser, const Col
|
||||||
out->mClipPlaneNear = srcCamera->mZNear;
|
out->mClipPlaneNear = srcCamera->mZNear;
|
||||||
|
|
||||||
// ... but for the rest some values are optional
|
// ... but for the rest some values are optional
|
||||||
// and we need to compute the others in any combination. FUCKING COLLADA.
|
// and we need to compute the others in any combination.
|
||||||
if (srcCamera->mAspect != 10e10f)
|
if (srcCamera->mAspect != 10e10f)
|
||||||
out->mAspect = srcCamera->mAspect;
|
out->mAspect = srcCamera->mAspect;
|
||||||
|
|
||||||
|
@ -545,7 +545,7 @@ aiMesh* ColladaLoader::CreateMesh( const ColladaParser& pParser, const Collada::
|
||||||
std::copy( pSrcMesh->mPositions.begin() + pStartVertex, pSrcMesh->mPositions.begin() +
|
std::copy( pSrcMesh->mPositions.begin() + pStartVertex, pSrcMesh->mPositions.begin() +
|
||||||
pStartVertex + numVertices, dstMesh->mVertices);
|
pStartVertex + numVertices, dstMesh->mVertices);
|
||||||
|
|
||||||
// normals, if given. HACK: (thom) Due to the fucking Collada spec we never
|
// normals, if given. HACK: (thom) Due to the glorious Collada spec we never
|
||||||
// know if we have the same number of normals as there are positions. So we
|
// know if we have the same number of normals as there are positions. So we
|
||||||
// also ignore any vertex attribute if it has a different count
|
// also ignore any vertex attribute if it has a different count
|
||||||
if( pSrcMesh->mNormals.size() >= pStartVertex + numVertices)
|
if( pSrcMesh->mNormals.size() >= pStartVertex + numVertices)
|
||||||
|
@ -636,7 +636,7 @@ aiMesh* ColladaLoader::CreateMesh( const ColladaParser& pParser, const Collada::
|
||||||
throw DeadlyImportError( "Data type mismatch while resolving mesh joints");
|
throw DeadlyImportError( "Data type mismatch while resolving mesh joints");
|
||||||
// sanity check: we rely on the vertex weights always coming as pairs of BoneIndex-WeightIndex
|
// sanity check: we rely on the vertex weights always coming as pairs of BoneIndex-WeightIndex
|
||||||
if( pSrcController->mWeightInputJoints.mOffset != 0 || pSrcController->mWeightInputWeights.mOffset != 1)
|
if( pSrcController->mWeightInputJoints.mOffset != 0 || pSrcController->mWeightInputWeights.mOffset != 1)
|
||||||
throw DeadlyImportError( "Unsupported vertex_weight adresssing scheme. Fucking collada spec.");
|
throw DeadlyImportError( "Unsupported vertex_weight adressing scheme. ");
|
||||||
|
|
||||||
// create containers to collect the weights for each bone
|
// create containers to collect the weights for each bone
|
||||||
size_t numBones = jointNames.mStrings.size();
|
size_t numBones = jointNames.mStrings.size();
|
||||||
|
@ -1445,13 +1445,16 @@ void ColladaLoader::ConvertPath (aiString& ss)
|
||||||
ss.data[ss.length] = 0;
|
ss.data[ss.length] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// find and convert all %xyz special chars
|
// find and convert all %xy special chars
|
||||||
char* out = ss.data;
|
char* out = ss.data;
|
||||||
for( const char* it = ss.data; it != ss.data + ss.length; /**/ )
|
for( const char* it = ss.data; it != ss.data + ss.length; /**/ )
|
||||||
{
|
{
|
||||||
if( *it == '%' )
|
if( *it == '%' && (it + 3) < ss.data + ss.length )
|
||||||
{
|
{
|
||||||
size_t nbr = strtoul16( ++it, &it);
|
// separate the number to avoid dragging in chars from behind into the parsing
|
||||||
|
char mychar[3] = { it[1], it[2], 0 };
|
||||||
|
size_t nbr = strtoul16( mychar);
|
||||||
|
it += 3;
|
||||||
*out++ = (char)(nbr & 0xFF);
|
*out++ = (char)(nbr & 0xFF);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
|
|
|
@ -487,7 +487,7 @@ void ColladaParser::ReadController( Collada::Controller& pController)
|
||||||
else if( IsElement( "skin"))
|
else if( IsElement( "skin"))
|
||||||
{
|
{
|
||||||
// read the mesh it refers to. According to the spec this could also be another
|
// read the mesh it refers to. According to the spec this could also be another
|
||||||
// controller, but I refuse to implement every bullshit idea they've come up with
|
// controller, but I refuse to implement every single idea they've come up with
|
||||||
int sourceIndex = GetAttribute( "source");
|
int sourceIndex = GetAttribute( "source");
|
||||||
pController.mMeshId = mReader->getAttributeValue( sourceIndex) + 1;
|
pController.mMeshId = mReader->getAttributeValue( sourceIndex) + 1;
|
||||||
}
|
}
|
||||||
|
@ -1097,9 +1097,6 @@ void ColladaParser::ReadEffectLibrary()
|
||||||
if( IsElement( "effect"))
|
if( IsElement( "effect"))
|
||||||
{
|
{
|
||||||
// read ID. Do I have to repeat my ranting about "optional" attributes?
|
// read ID. Do I have to repeat my ranting about "optional" attributes?
|
||||||
// Alex: .... no, not necessary. Please shut up and leave more space for
|
|
||||||
// me to complain about the fucking Collada spec with its fucking
|
|
||||||
// 'optional' attributes ...
|
|
||||||
int attrID = GetAttribute( "id");
|
int attrID = GetAttribute( "id");
|
||||||
std::string id = mReader->getAttributeValue( attrID);
|
std::string id = mReader->getAttributeValue( attrID);
|
||||||
|
|
||||||
|
@ -1613,7 +1610,7 @@ void ColladaParser::ReadSource()
|
||||||
}
|
}
|
||||||
else if( IsElement( "technique_common"))
|
else if( IsElement( "technique_common"))
|
||||||
{
|
{
|
||||||
// I don't fucking care for your profiles bullshit
|
// I don't care for your profiles
|
||||||
}
|
}
|
||||||
else if( IsElement( "accessor"))
|
else if( IsElement( "accessor"))
|
||||||
{
|
{
|
||||||
|
|
|
@ -48,7 +48,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <boost/tuple/tuple.hpp>
|
#include <boost/tuple/tuple.hpp>
|
||||||
|
|
||||||
#include "../contrib/unzip/unzip.h"
|
#ifndef ASSIMP_BUILD_NO_COMPRESSED_IFC
|
||||||
|
# include "../contrib/unzip/unzip.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "IFCLoader.h"
|
#include "IFCLoader.h"
|
||||||
#include "STEPFileReader.h"
|
#include "STEPFileReader.h"
|
||||||
|
@ -169,8 +171,10 @@ void IFCImporter::InternReadFile( const std::string& pFile,
|
||||||
ThrowException("Could not open file for reading");
|
ThrowException("Could not open file for reading");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// if this is a ifczip file, decompress its contents first
|
// if this is a ifczip file, decompress its contents first
|
||||||
if(GetExtension(pFile) == "ifczip") {
|
if(GetExtension(pFile) == "ifczip") {
|
||||||
|
#ifndef ASSIMP_BUILD_NO_COMPRESSED_IFC
|
||||||
unzFile zip = unzOpen( pFile.c_str() );
|
unzFile zip = unzOpen( pFile.c_str() );
|
||||||
if(zip == NULL) {
|
if(zip == NULL) {
|
||||||
ThrowException("Could not open ifczip file for reading, unzip failed");
|
ThrowException("Could not open ifczip file for reading, unzip failed");
|
||||||
|
@ -214,6 +218,9 @@ void IFCImporter::InternReadFile( const std::string& pFile,
|
||||||
}
|
}
|
||||||
|
|
||||||
unzClose(zip);
|
unzClose(zip);
|
||||||
|
#else
|
||||||
|
ThrowException("Could not open ifczip file for reading, assimp was built without ifczip support");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::scoped_ptr<STEP::DB> db(STEP::ReadFileHeader(stream));
|
boost::scoped_ptr<STEP::DB> db(STEP::ReadFileHeader(stream));
|
||||||
|
|
|
@ -448,8 +448,8 @@ void AnimResolver::GetKeys(std::vector<aiVectorKey>& out,
|
||||||
|
|
||||||
if ((*cur_x).time == (*cur_y).time && (*cur_x).time == (*cur_z).time ) {
|
if ((*cur_x).time == (*cur_y).time && (*cur_x).time == (*cur_z).time ) {
|
||||||
|
|
||||||
// we have a keyframe for all of them defined .. great,
|
// we have a keyframe for all of them defined .. this means
|
||||||
// we don't need to fucking interpolate here ...
|
// we don't need to interpolate here.
|
||||||
fill.mTime = (*cur_x).time;
|
fill.mTime = (*cur_x).time;
|
||||||
|
|
||||||
fill.mValue.x = (*cur_x).value;
|
fill.mValue.x = (*cur_x).value;
|
||||||
|
|
|
@ -89,7 +89,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://sourceforge.net/tracker/?func=detail&atid=1067632&aid=3358562&group_id=226462
|
// https://sourceforge.net/tracker/?func=detail&atid=1067632&aid=3358562&group_id=226462
|
||||||
#if !defined(__GNUC__) || !defined(__APPLE__) || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
|
#if !defined(__GNUC__) || !defined(__APPLE__) || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
static void LogWarn (const char* message) {
|
static void LogWarn (const char* message) {
|
||||||
|
|
|
@ -787,7 +787,6 @@ void MDLImporter::SkipSkinLump_3DGS_MDL7(
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// What the fuck does this function do? Can't remember
|
|
||||||
void MDLImporter::ParseSkinLump_3DGS_MDL7(
|
void MDLImporter::ParseSkinLump_3DGS_MDL7(
|
||||||
const unsigned char* szCurrent,
|
const unsigned char* szCurrent,
|
||||||
const unsigned char** szCurrentOut,
|
const unsigned char** szCurrentOut,
|
||||||
|
|
|
@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
#include "AssimpPCH.h"
|
||||||
#ifndef AI_BUILD_NO_NDO_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_NDO_IMPORTER
|
||||||
#include "NDOLoader.h"
|
#include "NDOLoader.h"
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
|
@ -182,7 +182,7 @@ void OgreImporter::ReadVertexBuffer(SubMesh &theSubMesh, XmlReader *Reader, unsi
|
||||||
XmlRead(Reader);
|
XmlRead(Reader);
|
||||||
|
|
||||||
/*it might happen, that we have more than one attribute per vertex (they are not splitted to different buffers)
|
/*it might happen, that we have more than one attribute per vertex (they are not splitted to different buffers)
|
||||||
so the break condition is a bit tricky (well, IrrXML just sucks :( )*/
|
so the break condition is a bit tricky */
|
||||||
while(Reader->getNodeName()==string("vertex")
|
while(Reader->getNodeName()==string("vertex")
|
||||||
||Reader->getNodeName()==string("position")
|
||Reader->getNodeName()==string("position")
|
||||||
||Reader->getNodeName()==string("normal")
|
||Reader->getNodeName()==string("normal")
|
||||||
|
|
|
@ -77,8 +77,6 @@ void OgreImporter::LoadSkeleton(std::string FileName, vector<Bone> &Bones, vecto
|
||||||
if(!SkeletonFile)
|
if(!SkeletonFile)
|
||||||
throw DeadlyImportError(string("Failed to create XML Reader for ")+FileName);
|
throw DeadlyImportError(string("Failed to create XML Reader for ")+FileName);
|
||||||
|
|
||||||
//Quick note: Whoever read this should know this one thing: irrXml fucking sucks!!!
|
|
||||||
|
|
||||||
XmlRead(SkeletonFile);
|
XmlRead(SkeletonFile);
|
||||||
if(string("skeleton")!=SkeletonFile->getNodeName())
|
if(string("skeleton")!=SkeletonFile->getNodeName())
|
||||||
throw DeadlyImportError("No <skeleton> node in SkeletonFile: "+FileName);
|
throw DeadlyImportError("No <skeleton> node in SkeletonFile: "+FileName);
|
||||||
|
@ -169,12 +167,12 @@ void OgreImporter::LoadSkeleton(std::string FileName, vector<Bone> &Bones, vecto
|
||||||
Bones[ChildId].ParentId=ParentId;
|
Bones[ChildId].ParentId=ParentId;
|
||||||
Bones[ParentId].Children.push_back(ChildId);
|
Bones[ParentId].Children.push_back(ChildId);
|
||||||
|
|
||||||
XmlRead(SkeletonFile);//I once forget this line, which led to an endless loop, did i mentioned, that irrxml sucks??
|
XmlRead(SkeletonFile);
|
||||||
}
|
}
|
||||||
//_____________________________________________________________________________
|
//_____________________________________________________________________________
|
||||||
|
|
||||||
|
|
||||||
//--------- Calculate the WorldToBoneSpace Matrix recursivly for all bones: ------------------
|
//--------- Calculate the WorldToBoneSpace Matrix recursively for all bones: ------------------
|
||||||
BOOST_FOREACH(Bone &theBone, Bones)
|
BOOST_FOREACH(Bone &theBone, Bones)
|
||||||
{
|
{
|
||||||
if(-1==theBone.ParentId) //the bone is a root bone
|
if(-1==theBone.ParentId) //the bone is a root bone
|
||||||
|
|
|
@ -379,8 +379,7 @@ void Q3DImporter::InternReadFile( const std::string& pFile,
|
||||||
light->mColorSpecular = light->mColorDiffuse;
|
light->mColorSpecular = light->mColorDiffuse;
|
||||||
|
|
||||||
|
|
||||||
// We don't need the rest, but we need to know where
|
// We don't need the rest, but we need to know where this chunk ends.
|
||||||
// this fucking chunk ends.
|
|
||||||
unsigned int temp = (unsigned int)(stream.GetI4() * stream.GetI4());
|
unsigned int temp = (unsigned int)(stream.GetI4() * stream.GetI4());
|
||||||
|
|
||||||
// skip the background file name
|
// skip the background file name
|
||||||
|
|
|
@ -384,7 +384,7 @@ bool STLImporter::LoadBinaryFile()
|
||||||
}
|
}
|
||||||
aiColor4D* clr = &pMesh->mColors[0][i*3];
|
aiColor4D* clr = &pMesh->mColors[0][i*3];
|
||||||
clr->a = 1.0f;
|
clr->a = 1.0f;
|
||||||
if (bIsMaterialise) // fuck, this is reversed
|
if (bIsMaterialise) // this is reversed
|
||||||
{
|
{
|
||||||
clr->r = (color & 0x31u) / 31.0f;
|
clr->r = (color & 0x31u) / 31.0f;
|
||||||
clr->g = ((color & (0x31u<<5))>>5u) / 31.0f;
|
clr->g = ((color & (0x31u<<5))>>5u) / 31.0f;
|
||||||
|
|
|
@ -60,9 +60,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* Other (mixed) configuration switches are listed here:
|
* Other (mixed) configuration switches are listed here:
|
||||||
* ASSIMP_BUILD_NO_COMPRESSED_X
|
* ASSIMP_BUILD_NO_COMPRESSED_X
|
||||||
* - Disable support for compressed X files
|
* - Disable support for compressed X files (zip)
|
||||||
* ASSIMP_BUILD_NO_COMPRESSED_BLEND
|
* ASSIMP_BUILD_NO_COMPRESSED_BLEND
|
||||||
* - Disable support for compressed Blender files*/
|
* - Disable support for compressed Blender files (zip)
|
||||||
|
* ASSIMP_BUILD_NO_COMPRESSED_IFC
|
||||||
|
* - Disable support for IFCZIP files (unzip)
|
||||||
|
*/
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_COMPRESSED_X
|
#ifndef ASSIMP_BUILD_NO_COMPRESSED_X
|
||||||
|
@ -71,6 +74,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_COMPRESSED_BLEND
|
#ifndef ASSIMP_BUILD_NO_COMPRESSED_BLEND
|
||||||
# define ASSIMP_BUILD_NEED_Z_INFLATE
|
# define ASSIMP_BUILD_NEED_Z_INFLATE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef ASSIMP_BUILD_NO_COMPRESSED_IFC
|
||||||
|
# define ASSIMP_BUILD_NEED_Z_INFLATE
|
||||||
|
# define ASSIMP_BUILD_NEED_UNZIP
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef ASSIMP_BUILD_NO_Q3BSP_IMPORTER
|
||||||
|
# define ASSIMP_BUILD_NEED_Z_INFLATE
|
||||||
|
# define ASSIMP_BUILD_NEED_UNZIP
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -160,8 +160,13 @@ struct aiFace
|
||||||
|
|
||||||
delete[] mIndices;
|
delete[] mIndices;
|
||||||
mNumIndices = o.mNumIndices;
|
mNumIndices = o.mNumIndices;
|
||||||
mIndices = new unsigned int[mNumIndices];
|
if (mNumIndices) {
|
||||||
::memcpy( mIndices, o.mIndices, mNumIndices * sizeof( unsigned int));
|
mIndices = new unsigned int[mNumIndices];
|
||||||
|
::memcpy( mIndices, o.mIndices, mNumIndices * sizeof( unsigned int));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
mIndices = NULL;
|
||||||
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,8 @@ def main():
|
||||||
# Parse structure definitions from BlenderScene.h
|
# Parse structure definitions from BlenderScene.h
|
||||||
input = open(inputfile,"rt").read()
|
input = open(inputfile,"rt").read()
|
||||||
|
|
||||||
flags = re.ASCII|re.DOTALL|re.MULTILINE
|
#flags = re.ASCII|re.DOTALL|re.MULTILINE
|
||||||
|
flags = re.DOTALL|re.MULTILINE
|
||||||
#stripcoms = re.compile(r"/\*(.*?)*\/",flags)
|
#stripcoms = re.compile(r"/\*(.*?)*\/",flags)
|
||||||
getstruct = re.compile(r"struct\s+(\w+?)\s*(:\s*ElemBase)?\s*\{(.*?)^\}\s*;",flags)
|
getstruct = re.compile(r"struct\s+(\w+?)\s*(:\s*ElemBase)?\s*\{(.*?)^\}\s*;",flags)
|
||||||
getsmartx = re.compile(r"(std\s*::\s*)?(vector)\s*<\s*(boost\s*::\s*)?shared_(ptr)\s*<\s*(\w+)\s*>\s*>\s*",flags)
|
getsmartx = re.compile(r"(std\s*::\s*)?(vector)\s*<\s*(boost\s*::\s*)?shared_(ptr)\s*<\s*(\w+)\s*>\s*>\s*",flags)
|
||||||
|
@ -143,7 +144,8 @@ def main():
|
||||||
|
|
||||||
input = input[match.end():]
|
input = input[match.end():]
|
||||||
|
|
||||||
[print ("Enum: "+e) for e in enums]
|
for e in enums:
|
||||||
|
print("Enum: "+e)
|
||||||
for k,v in hits.items():
|
for k,v in hits.items():
|
||||||
out = []
|
out = []
|
||||||
for line in v:
|
for line in v:
|
||||||
|
@ -177,7 +179,8 @@ def main():
|
||||||
|
|
||||||
v[:] = out
|
v[:] = out
|
||||||
print("Structure {0}".format(k))
|
print("Structure {0}".format(k))
|
||||||
[print("\t"+"\t".join(elem)) for elem in out]
|
for elem in out:
|
||||||
|
print("\t"+"\t".join(elem))
|
||||||
print("")
|
print("")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -985,7 +985,7 @@ void OpenAsset()
|
||||||
void SetupPPUIState()
|
void SetupPPUIState()
|
||||||
{
|
{
|
||||||
|
|
||||||
// fucking hell, that's ugly. anyone willing to rewrite me from scratch?
|
// that's ugly. anyone willing to rewrite me from scratch?
|
||||||
HMENU hMenu = GetMenu(g_hDlg);
|
HMENU hMenu = GetMenu(g_hDlg);
|
||||||
CheckMenuItem(hMenu,ID_VIEWER_PP_JIV,ppsteps & aiProcess_JoinIdenticalVertices ? MF_CHECKED : MF_UNCHECKED);
|
CheckMenuItem(hMenu,ID_VIEWER_PP_JIV,ppsteps & aiProcess_JoinIdenticalVertices ? MF_CHECKED : MF_UNCHECKED);
|
||||||
CheckMenuItem(hMenu,ID_VIEWER_PP_CTS,ppsteps & aiProcess_CalcTangentSpace ? MF_CHECKED : MF_UNCHECKED);
|
CheckMenuItem(hMenu,ID_VIEWER_PP_CTS,ppsteps & aiProcess_CalcTangentSpace ? MF_CHECKED : MF_UNCHECKED);
|
||||||
|
@ -1916,7 +1916,7 @@ INT_PTR CALLBACK MessageProc(HWND hwndDlg,UINT uMsg,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// fucking hell, this is ugly. anyone willing to rewrite it from scratch using wxwidgets or similar?
|
// this is ugly. anyone willing to rewrite it from scratch using wxwidgets or similar?
|
||||||
else if (ID_VIEWER_PP_JIV == LOWORD(wParam)) {
|
else if (ID_VIEWER_PP_JIV == LOWORD(wParam)) {
|
||||||
ppsteps ^= aiProcess_JoinIdenticalVertices;
|
ppsteps ^= aiProcess_JoinIdenticalVertices;
|
||||||
CheckMenuItem(hMenu,ID_VIEWER_PP_JIV,ppsteps & aiProcess_JoinIdenticalVertices ? MF_CHECKED : MF_UNCHECKED);
|
CheckMenuItem(hMenu,ID_VIEWER_PP_JIV,ppsteps & aiProcess_JoinIdenticalVertices ? MF_CHECKED : MF_UNCHECKED);
|
||||||
|
|
Loading…
Reference in New Issue