pull/21/merge
Kim 2013-03-28 18:56:19 +01:00
commit 3ad7aea123
26 changed files with 1043 additions and 773 deletions

View File

@ -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-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(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)
add_definitions(-fPIC) # this is a very important switch and some libraries seem now to have it....

View File

@ -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.
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.
@ -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.
For the formal details, see the `LICENSE` file.
------------------------------

View File

@ -707,7 +707,7 @@ void Discreet3DSImporter::GenerateNodeGraph(aiScene* pcOut)
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:
//
// ROOT_NODE

View File

@ -1,3 +1,4 @@
/*
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;
if (!mesh->totface || !mesh->totvert) {
if ((!mesh->totface && !mesh->totloop) || !mesh->totvert) {
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");
}
if (static_cast<size_t> ( mesh->totloop ) > mesh->mloop.size()) {
ThrowException("Number of vertices is larger than the corresponding array");
}
// collect per-submesh numbers
std::map<int,size_t> per_mat;
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];
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
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
if (mesh->mtface) {
if (mesh->mtface || mesh->mloopuv) {
if (mesh->totface > static_cast<int> ( mesh->mtface.size())) {
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];
}
}
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)
@ -833,7 +904,7 @@ void BlenderImporter::ConvertMesh(const Scene& /*in*/, const Object* /*obj*/, co
}
// 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)) ) {
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 (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;

File diff suppressed because it is too large Load Diff

View File

@ -94,6 +94,7 @@ namespace Assimp {
struct Object;
struct MTex;
struct Image;
#define AI_BLEND_MESH_MAX_VERTS 2000000000L
@ -156,6 +157,38 @@ struct MEdge : ElemBase {
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 {
char r,g,b,a FAIL;
@ -235,6 +268,8 @@ struct Mesh : ElemBase {
int totface FAIL;
int totedge FAIL;
int totvert FAIL;
int totloop;
int totpoly;
short subdiv;
short subdivr;
@ -246,6 +281,11 @@ struct Mesh : ElemBase {
vector<TFace> tface;
vector<MVert> mvert FAIL;
vector<MEdge> medge WARN;
vector<MLoop> mloop;
vector<MLoopUV> mloopuv;
vector<MLoopCol> mloopcol;
vector<MPoly> mpoly;
vector<MTexPoly> mtpoly;
vector<MDeformVert> dvert;
vector<MCol> mcol;

View File

@ -47,174 +47,204 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace Assimp {
namespace Blender {
template <> void Structure :: Convert<Object> (
Object& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<Group> (
Group& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<MTex> (
MTex& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<TFace> (
TFace& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<SubsurfModifierData> (
SubsurfModifierData& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<MFace> (
MFace& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<Lamp> (
Lamp& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<MDeformWeight> (
MDeformWeight& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<PackedFile> (
PackedFile& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<Base> (
Base& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<MTFace> (
MTFace& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<Material> (
Material& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<Mesh> (
Mesh& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<MDeformVert> (
MDeformVert& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<World> (
World& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<MVert> (
MVert& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<MEdge> (
MEdge& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<GroupObject> (
GroupObject& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<ListBase> (
ListBase& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<ModifierData> (
ModifierData& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<ID> (
ID& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<MCol> (
MCol& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<Image> (
Image& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<Scene> (
Scene& dest,
const FileDatabase& db
) 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<Object> (
Object& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<Group> (
Group& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<MTex> (
MTex& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<TFace> (
TFace& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<SubsurfModifierData> (
SubsurfModifierData& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<MFace> (
MFace& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<Lamp> (
Lamp& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<MDeformWeight> (
MDeformWeight& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<PackedFile> (
PackedFile& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<Base> (
Base& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<MTFace> (
MTFace& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<Material> (
Material& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<MTexPoly> (
MTexPoly& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<Mesh> (
Mesh& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<MDeformVert> (
MDeformVert& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<World> (
World& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<MLoopCol> (
MLoopCol& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<MVert> (
MVert& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<MEdge> (
MEdge& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<MLoopUV> (
MLoopUV& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<GroupObject> (
GroupObject& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<ListBase> (
ListBase& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<MLoop> (
MLoop& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<ModifierData> (
ModifierData& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<ID> (
ID& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<MCol> (
MCol& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<MPoly> (
MPoly& dest,
const FileDatabase& db
) const
;
template <> void Structure :: Convert<Scene> (
Scene& dest,
const FileDatabase& db
) 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
;
}

View File

@ -255,7 +255,7 @@ namespace boost {
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>
inline tuple <T0,T1> make_tuple (const T0& t0,
const T1& t1) {
@ -265,7 +265,7 @@ namespace boost {
return t;
}
// Constructs a tuple with 1 elements (no comment ...)
// Constructs a tuple with 1 elements (well ...)
template <typename T0>
inline tuple <T0> make_tuple (const T0& t0) {
tuple <T0> t;
@ -273,7 +273,7 @@ namespace boost {
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 () {
tuple <> t;
return t;

View File

@ -1045,9 +1045,9 @@ void COBImporter::ReadPolH_Binary(COB::Scene& out, StreamReaderLE& reader, const
v.y = reader.GetF4();
}
const size_t numfuck = reader.GetI4();
msh.faces.reserve(numfuck);
for(size_t i = 0; i < numfuck; ++i) {
const size_t numf = reader.GetI4();
msh.faces.reserve(numf);
for(size_t i = 0; i < numf; ++i) {
// XXX backface culling flag is 0x10 in flags
// hole?

View File

@ -99,7 +99,7 @@ void ColladaExporter::WriteFile()
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;
PushTag();
mOutput << startstr << "<instance_visual_scene url=\"#myScene\" />" << endstr;
@ -495,7 +495,7 @@ void ColladaExporter::WriteFloatArray( const std::string& pIdString, FloatDataTy
mOutput << "</float_array>" << endstr;
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;
PushTag();
mOutput << startstr << "<accessor count=\"" << pElementCount << "\" offset=\"0\" source=\"#" << arrayId << "\" stride=\"" << floatsPerElement << "\">" << endstr;

View File

@ -119,6 +119,7 @@ struct Camera
};
#define aiLightSource_AMBIENT 0xdeaddead
#define ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET 1e9f
/** A collada light source. */
struct Light
@ -129,8 +130,8 @@ struct Light
, mAttQuadratic (0.f)
, mFalloffAngle (180.f)
, mFalloffExponent (0.f)
, mPenumbraAngle (10e10f)
, mOuterAngle (10e10f)
, mPenumbraAngle (ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET)
, mOuterAngle (ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET)
, mIntensity (1.f)
{}

View File

@ -325,11 +325,11 @@ void ColladaLoader::BuildLightsForNode( const ColladaParser& pParser, const Coll
out->mAngleInnerCone = AI_DEG_TO_RAD( srcLight->mFalloffAngle );
// ... some extension magic. FUCKING COLLADA.
if (srcLight->mOuterAngle == 10e10f)
// ... some extension magic.
if (srcLight->mOuterAngle >= ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET*(1-1e-6f))
{
// ... some deprecation magic. FUCKING FCOLLADA.
if (srcLight->mPenumbraAngle == 10e10f)
// ... some deprecation magic.
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 ....
// epsilon chosen to be 0.1
@ -382,7 +382,7 @@ void ColladaLoader::BuildCamerasForNode( const ColladaParser& pParser, const Col
out->mClipPlaneNear = srcCamera->mZNear;
// ... 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)
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() +
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
// also ignore any vertex attribute if it has a different count
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");
// sanity check: we rely on the vertex weights always coming as pairs of BoneIndex-WeightIndex
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
size_t numBones = jointNames.mStrings.size();
@ -1445,13 +1445,16 @@ void ColladaLoader::ConvertPath (aiString& ss)
ss.data[ss.length] = 0;
}
// find and convert all %xyz special chars
// find and convert all %xy special chars
char* out = ss.data;
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);
} else
{

View File

@ -487,7 +487,7 @@ void ColladaParser::ReadController( Collada::Controller& pController)
else if( IsElement( "skin"))
{
// 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");
pController.mMeshId = mReader->getAttributeValue( sourceIndex) + 1;
}
@ -1097,9 +1097,6 @@ void ColladaParser::ReadEffectLibrary()
if( IsElement( "effect"))
{
// 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");
std::string id = mReader->getAttributeValue( attrID);
@ -1613,7 +1610,7 @@ void ColladaParser::ReadSource()
}
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"))
{

View File

@ -48,7 +48,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <iterator>
#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 "STEPFileReader.h"
@ -169,8 +171,10 @@ void IFCImporter::InternReadFile( const std::string& pFile,
ThrowException("Could not open file for reading");
}
// if this is a ifczip file, decompress its contents first
if(GetExtension(pFile) == "ifczip") {
#ifndef ASSIMP_BUILD_NO_COMPRESSED_IFC
unzFile zip = unzOpen( pFile.c_str() );
if(zip == NULL) {
ThrowException("Could not open ifczip file for reading, unzip failed");
@ -214,6 +218,9 @@ void IFCImporter::InternReadFile( const std::string& pFile,
}
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));

View File

@ -448,8 +448,8 @@ void AnimResolver::GetKeys(std::vector<aiVectorKey>& out,
if ((*cur_x).time == (*cur_y).time && (*cur_x).time == (*cur_z).time ) {
// we have a keyframe for all of them defined .. great,
// we don't need to fucking interpolate here ...
// we have a keyframe for all of them defined .. this means
// we don't need to interpolate here.
fill.mTime = (*cur_x).time;
fill.mValue.x = (*cur_x).value;

View File

@ -89,7 +89,7 @@ public:
}
// 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) {

View File

@ -787,7 +787,6 @@ void MDLImporter::SkipSkinLump_3DGS_MDL7(
}
// ------------------------------------------------------------------------------------------------
// What the fuck does this function do? Can't remember
void MDLImporter::ParseSkinLump_3DGS_MDL7(
const unsigned char* szCurrent,
const unsigned char** szCurrentOut,

View File

@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "AssimpPCH.h"
#ifndef AI_BUILD_NO_NDO_IMPORTER
#ifndef ASSIMP_BUILD_NO_NDO_IMPORTER
#include "NDOLoader.h"
using namespace Assimp;

View File

@ -182,7 +182,7 @@ void OgreImporter::ReadVertexBuffer(SubMesh &theSubMesh, XmlReader *Reader, unsi
XmlRead(Reader);
/*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")
||Reader->getNodeName()==string("position")
||Reader->getNodeName()==string("normal")

View File

@ -77,8 +77,6 @@ void OgreImporter::LoadSkeleton(std::string FileName, vector<Bone> &Bones, vecto
if(!SkeletonFile)
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);
if(string("skeleton")!=SkeletonFile->getNodeName())
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[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)
{
if(-1==theBone.ParentId) //the bone is a root bone

View File

@ -379,8 +379,7 @@ void Q3DImporter::InternReadFile( const std::string& pFile,
light->mColorSpecular = light->mColorDiffuse;
// We don't need the rest, but we need to know where
// this fucking chunk ends.
// We don't need the rest, but we need to know where this chunk ends.
unsigned int temp = (unsigned int)(stream.GetI4() * stream.GetI4());
// skip the background file name

View File

@ -384,7 +384,7 @@ bool STLImporter::LoadBinaryFile()
}
aiColor4D* clr = &pMesh->mColors[0][i*3];
clr->a = 1.0f;
if (bIsMaterialise) // fuck, this is reversed
if (bIsMaterialise) // this is reversed
{
clr->r = (color & 0x31u) / 31.0f;
clr->g = ((color & (0x31u<<5))>>5u) / 31.0f;

View File

@ -60,9 +60,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Other (mixed) configuration switches are listed here:
* ASSIMP_BUILD_NO_COMPRESSED_X
* - Disable support for compressed X files
* - Disable support for compressed X files (zip)
* 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
@ -71,6 +74,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef ASSIMP_BUILD_NO_COMPRESSED_BLEND
# 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
//////////////////////////////////////////////////////////////////////////

View File

@ -160,8 +160,13 @@ struct aiFace
delete[] mIndices;
mNumIndices = o.mNumIndices;
mIndices = new unsigned int[mNumIndices];
::memcpy( mIndices, o.mIndices, mNumIndices * sizeof( unsigned int));
if (mNumIndices) {
mIndices = new unsigned int[mNumIndices];
::memcpy( mIndices, o.mIndices, mNumIndices * sizeof( unsigned int));
}
else {
mIndices = NULL;
}
return *this;
}

View File

@ -105,7 +105,8 @@ def main():
# Parse structure definitions from BlenderScene.h
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)
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)
@ -143,7 +144,8 @@ def main():
input = input[match.end():]
[print ("Enum: "+e) for e in enums]
for e in enums:
print("Enum: "+e)
for k,v in hits.items():
out = []
for line in v:
@ -177,7 +179,8 @@ def main():
v[:] = out
print("Structure {0}".format(k))
[print("\t"+"\t".join(elem)) for elem in out]
for elem in out:
print("\t"+"\t".join(elem))
print("")

View File

@ -985,7 +985,7 @@ void OpenAsset()
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);
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);
@ -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)) {
ppsteps ^= aiProcess_JoinIdenticalVertices;
CheckMenuItem(hMenu,ID_VIEWER_PP_JIV,ppsteps & aiProcess_JoinIdenticalVertices ? MF_CHECKED : MF_UNCHECKED);