Merge branch 'master' into master

pull/4693/head
Kim Kulling 2022-08-23 21:14:45 +02:00 committed by GitHub
commit 87f601531c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 85 additions and 128 deletions

View File

@ -130,7 +130,7 @@ inline size_t Write<double>(IOStream *stream, const double &f) {
// Serialize a vec3
template <>
inline size_t Write<aiVector3D>(IOStream *stream, const aiVector3D &v) {
size_t t = Write<float>(stream, v.x);
size_t t = Write<ai_real>(stream, v.x);
t += Write<float>(stream, v.y);
t += Write<float>(stream, v.z);
@ -141,7 +141,7 @@ inline size_t Write<aiVector3D>(IOStream *stream, const aiVector3D &v) {
// Serialize a color value
template <>
inline size_t Write<aiColor3D>(IOStream *stream, const aiColor3D &v) {
size_t t = Write<float>(stream, v.r);
size_t t = Write<ai_real>(stream, v.r);
t += Write<float>(stream, v.g);
t += Write<float>(stream, v.b);
@ -152,7 +152,7 @@ inline size_t Write<aiColor3D>(IOStream *stream, const aiColor3D &v) {
// Serialize a color value
template <>
inline size_t Write<aiColor4D>(IOStream *stream, const aiColor4D &v) {
size_t t = Write<float>(stream, v.r);
size_t t = Write<ai_real>(stream, v.r);
t += Write<float>(stream, v.g);
t += Write<float>(stream, v.b);
t += Write<float>(stream, v.a);
@ -164,7 +164,7 @@ inline size_t Write<aiColor4D>(IOStream *stream, const aiColor4D &v) {
// Serialize a quaternion
template <>
inline size_t Write<aiQuaternion>(IOStream *stream, const aiQuaternion &v) {
size_t t = Write<float>(stream, v.w);
size_t t = Write<ai_real>(stream, v.w);
t += Write<float>(stream, v.x);
t += Write<float>(stream, v.y);
t += Write<float>(stream, v.z);
@ -190,7 +190,7 @@ template <>
inline size_t Write<aiMatrix4x4>(IOStream *stream, const aiMatrix4x4 &m) {
for (unsigned int i = 0; i < 4; ++i) {
for (unsigned int i2 = 0; i2 < 4; ++i2) {
Write<float>(stream, m[i][i2]);
Write<ai_real>(stream, m[i][i2]);
}
}

View File

@ -416,10 +416,10 @@ template <>
struct Structure::_defaultInitializer<ErrorPolicy_Fail> {
template <typename T>
void operator()(T & /*out*/, const char * = "") {
void operator()(T & /*out*/, const char *message = "") {
// obviously, it is crucial that _DefaultInitializer is used
// only from within a catch clause.
throw DeadlyImportError("Constructing BlenderDNA Structure encountered an error");
throw DeadlyImportError("Constructing BlenderDNA Structure encountered an error: ", message);
}
};

View File

@ -71,10 +71,6 @@ static const fpCreateModifier creators[] = {
nullptr // sentinel
};
// ------------------------------------------------------------------------------------------------
struct SharedModifierData : ElemBase {
ModifierData modifier;
};
// ------------------------------------------------------------------------------------------------
void BlenderModifierShowcase::ApplyModifiers(aiNode &out, ConversionData &conv_data, const Scene &in, const Object &orig_object) {
@ -157,6 +153,7 @@ void BlenderModifier_Mirror ::DoIt(aiNode &out, ConversionData &conv_data, const
// hijacking the ABI, see the big note in BlenderModifierShowcase::ApplyModifiers()
const MirrorModifierData &mir = static_cast<const MirrorModifierData &>(orig_modifier);
ai_assert(mir.modifier.type == ModifierData::eModifierType_Mirror);
std::shared_ptr<Object> mirror_ob = mir.mirror_ob.lock();
conv_data.meshes->reserve(conv_data.meshes->size() + out.mNumMeshes);
@ -171,8 +168,8 @@ void BlenderModifier_Mirror ::DoIt(aiNode &out, ConversionData &conv_data, const
const float ys = mir.flag & MirrorModifierData::Flags_AXIS_Y ? -1.f : 1.f;
const float zs = mir.flag & MirrorModifierData::Flags_AXIS_Z ? -1.f : 1.f;
if (mir.mirror_ob) {
const aiVector3D center(mir.mirror_ob->obmat[3][0], mir.mirror_ob->obmat[3][1], mir.mirror_ob->obmat[3][2]);
if (mirror_ob) {
const aiVector3D center(mirror_ob->obmat[3][0], mirror_ob->obmat[3][1], mirror_ob->obmat[3][2]);
for (unsigned int j = 0; j < mesh->mNumVertices; ++j) {
aiVector3D &v = mesh->mVertices[j];

View File

@ -624,7 +624,9 @@ void Structure ::Convert<ListBase>(
const FileDatabase &db) const {
ReadFieldPtr<ErrorPolicy_Igno>(dest.first, "*first", db);
ReadFieldPtr<ErrorPolicy_Igno>(dest.last, "*last", db);
std::shared_ptr<ElemBase> last;
ReadFieldPtr<ErrorPolicy_Igno>(last, "*last", db);
dest.last = last;
db.reader->IncPtr(size);
}
@ -648,7 +650,9 @@ void Structure ::Convert<ModifierData>(
const FileDatabase &db) const {
ReadFieldPtr<ErrorPolicy_Warn>(dest.next, "*next", db);
ReadFieldPtr<ErrorPolicy_Warn>(dest.prev, "*prev", db);
std::shared_ptr<ElemBase> prev;
ReadFieldPtr<ErrorPolicy_Warn>(prev, "*prev", db);
dest.prev = prev;
ReadField<ErrorPolicy_Igno>(dest.type, "type", db);
ReadField<ErrorPolicy_Igno>(dest.mode, "mode", db);
ReadFieldArray<ErrorPolicy_Igno>(dest.name, "name", db);
@ -772,7 +776,9 @@ void Structure ::Convert<MirrorModifierData>(
ReadField<ErrorPolicy_Igno>(dest.axis, "axis", db);
ReadField<ErrorPolicy_Igno>(dest.flag, "flag", db);
ReadField<ErrorPolicy_Igno>(dest.tolerance, "tolerance", db);
ReadFieldPtr<ErrorPolicy_Igno>(dest.mirror_ob, "*mirror_ob", db);
std::shared_ptr<Object> mirror_ob;
ReadFieldPtr<ErrorPolicy_Igno>(mirror_ob, "*mirror_ob", db);
dest.mirror_ob = mirror_ob;
db.reader->IncPtr(size);
}
@ -833,9 +839,9 @@ void Structure::Convert<CustomDataLayer>(
ReadField<ErrorPolicy_Fail>(dest.flag, "flag", db);
ReadField<ErrorPolicy_Fail>(dest.active, "active", db);
ReadField<ErrorPolicy_Fail>(dest.active_rnd, "active_rnd", db);
ReadField<ErrorPolicy_Fail>(dest.active_clone, "active_clone", db);
ReadField<ErrorPolicy_Fail>(dest.active_mask, "active_mask", db);
ReadField<ErrorPolicy_Fail>(dest.uid, "uid", db);
ReadField<ErrorPolicy_Warn>(dest.active_clone, "active_clone", db);
ReadField<ErrorPolicy_Warn>(dest.active_mask, "active_mask", db);
ReadField<ErrorPolicy_Warn>(dest.uid, "uid", db);
ReadFieldArray<ErrorPolicy_Warn>(dest.name, "name", db);
ReadCustomDataPtr<ErrorPolicy_Fail>(dest.data, dest.type, "*data", db);

View File

@ -124,7 +124,7 @@ struct ID : ElemBase {
// -------------------------------------------------------------------------------
struct ListBase : ElemBase {
std::shared_ptr<ElemBase> first;
std::shared_ptr<ElemBase> last;
std::weak_ptr<ElemBase> last;
};
// -------------------------------------------------------------------------------
@ -642,14 +642,21 @@ struct ModifierData : ElemBase {
};
std::shared_ptr<ElemBase> next WARN;
std::shared_ptr<ElemBase> prev WARN;
std::weak_ptr<ElemBase> prev WARN;
int type, mode;
char name[32];
};
// ------------------------------------------------------------------------------------------------
struct SharedModifierData : ElemBase {
ModifierData modifier;
};
// -------------------------------------------------------------------------------
struct SubsurfModifierData : ElemBase {
struct SubsurfModifierData : SharedModifierData {
enum Type {
@ -662,7 +669,6 @@ struct SubsurfModifierData : ElemBase {
FLAGS_SubsurfUV = 1 << 3
};
ModifierData modifier FAIL;
short subdivType WARN;
short levels FAIL;
short renderLevels;
@ -670,7 +676,7 @@ struct SubsurfModifierData : ElemBase {
};
// -------------------------------------------------------------------------------
struct MirrorModifierData : ElemBase {
struct MirrorModifierData : SharedModifierData {
enum Flags {
Flags_CLIPPING = 1 << 0,
@ -682,11 +688,9 @@ struct MirrorModifierData : ElemBase {
Flags_VGROUP = 1 << 6
};
ModifierData modifier FAIL;
short axis, flag;
float tolerance;
std::shared_ptr<Object> mirror_ob;
std::weak_ptr<Object> mirror_ob;
};
// -------------------------------------------------------------------------------

View File

@ -707,12 +707,10 @@ void LWOImporter::LoadNodalBlocks(unsigned int size) {
if (mFileBuffer + head.length > end) {
throw DeadlyImportError("LWO3: cannot read length; LoadNodalBlocks");
}
int node_idx = 0;
uint8_t *const next = mFileBuffer + head.length;
mFileBuffer += bufOffset;
switch (head.type) {
case AI_LWO_NNDS:
node_idx++;
LoadNodes(head.length);
break;
}

View File

@ -516,7 +516,7 @@ void LWSImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
std::list<LWS::NodeDesc> nodes;
unsigned int cur_light = 0, cur_camera = 0, cur_object = 0;
unsigned int num_light = 0, num_camera = 0, num_object = 0;
unsigned int num_light = 0, num_camera = 0;
// check magic identifier, 'LWSC'
bool motion_file = false;
@ -586,7 +586,6 @@ void LWSImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
d.id = batch.AddLoadRequest(path, 0, &props);
nodes.push_back(d);
++num_object;
} else if ((*it).tokens[0] == "LoadObject") { // 'LoadObject': load a LWO file into the scene-graph
// add node to list
@ -604,7 +603,6 @@ void LWSImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
d.path = path;
nodes.push_back(d);
++num_object;
} else if ((*it).tokens[0] == "AddNullObject") { // 'AddNullObject': add a dummy node to the hierarchy
// add node to list
@ -618,8 +616,6 @@ void LWSImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
}
d.name = c;
nodes.push_back(d);
num_object++;
}
// 'NumChannels': Number of envelope channels assigned to last layer
else if ((*it).tokens[0] == "NumChannels") {

View File

@ -112,7 +112,6 @@ ObjFile::Model *ObjFileParser::GetModel() const {
void ObjFileParser::parseFile(IOStreamBuffer<char> &streamBuffer) {
// only update every 100KB or it'll be too slow
//const unsigned int updateProgressEveryBytes = 100 * 1024;
unsigned int progressCounter = 0;
const unsigned int bytesToProcess = static_cast<unsigned int>(streamBuffer.size());
const unsigned int progressTotal = bytesToProcess;
unsigned int processed = 0;
@ -129,7 +128,6 @@ void ObjFileParser::parseFile(IOStreamBuffer<char> &streamBuffer) {
if (lastFilePos < filePos) {
processed = static_cast<unsigned int>(filePos);
lastFilePos = filePos;
progressCounter++;
m_progress->UpdateFileRead(processed, progressTotal);
}

View File

@ -147,10 +147,8 @@ void SMDImporter::InternReadFile( const std::string& pFile, aiScene* scene, IOSy
if (!asBones.empty()) {
// Check whether all bones have been initialized
for (std::vector<SMD::Bone>::const_iterator
i = asBones.begin();
i != asBones.end();++i) {
if (!(*i).mName.length()) {
for (const auto &asBone : asBones) {
if (!asBone.mName.length()) {
ASSIMP_LOG_WARN("SMD: Not all bones have been initialized");
break;
}
@ -210,14 +208,10 @@ void SMDImporter::LogWarning(const char* msg) {
void SMDImporter::FixTimeValues() {
double dDelta = (double)iSmallestFrame;
double dMax = 0.0f;
for (std::vector<SMD::Bone>::iterator
iBone = asBones.begin();
iBone != asBones.end();++iBone) {
for (std::vector<SMD::Bone::Animation::MatrixKey>::iterator
iKey = (*iBone).sAnim.asKeys.begin();
iKey != (*iBone).sAnim.asKeys.end();++iKey) {
(*iKey).dTime -= dDelta;
dMax = std::max(dMax, (*iKey).dTime);
for (auto &asBone : asBones) {
for (auto &asKey : asBone.sAnim.asKeys) {
asKey.dTime -= dDelta;
dMax = std::max(dMax, asKey.dTime);
}
}
dLengthOfAnim = dMax;
@ -237,7 +231,7 @@ void SMDImporter::CreateOutputMeshes() {
pScene->mMeshes = new aiMesh*[pScene->mNumMeshes];
typedef std::vector<unsigned int> FaceList;
FaceList* aaiFaces = new FaceList[pScene->mNumMeshes];
std::unique_ptr<FaceList[]> aaiFaces(new FaceList[pScene->mNumMeshes]);
// approximate the space that will be required
unsigned int iNum = (unsigned int)asTriangles.size() / pScene->mNumMeshes;
@ -248,17 +242,14 @@ void SMDImporter::CreateOutputMeshes() {
// collect all faces
iNum = 0;
for (std::vector<SMD::Face>::const_iterator
iFace = asTriangles.begin();
iFace != asTriangles.end();++iFace,++iNum) {
if (UINT_MAX == (*iFace).iTexture) {
aaiFaces[(*iFace).iTexture].push_back( 0 );
} else if ((*iFace).iTexture >= aszTextures.size()) {
for (const auto &asTriangle : asTriangles) {
if (asTriangle.iTexture >= aszTextures.size()) {
ASSIMP_LOG_INFO("[SMD/VTA] Material index overflow in face");
aaiFaces[(*iFace).iTexture].push_back((unsigned int)aszTextures.size()-1);
aaiFaces[asTriangle.iTexture].push_back((unsigned int)aszTextures.size()-1);
} else {
aaiFaces[(*iFace).iTexture].push_back(iNum);
aaiFaces[asTriangle.iTexture].push_back(iNum);
}
++iNum;
}
// now create the output meshes
@ -275,7 +266,7 @@ void SMDImporter::CreateOutputMeshes() {
typedef std::pair<unsigned int,float> TempWeightListEntry;
typedef std::vector< TempWeightListEntry > TempBoneWeightList;
TempBoneWeightList* aaiBones = new TempBoneWeightList[asBones.size()]();
std::unique_ptr<TempBoneWeightList[]> aaiBones(new TempBoneWeightList[asBones.size()]());
// try to reserve enough memory without wasting too much
for (unsigned int iBone = 0; iBone < asBones.size();++iBone) {
@ -351,8 +342,7 @@ void SMDImporter::CreateOutputMeshes() {
if (fSum) {
fSum = 1 / fSum;
for (unsigned int iBone = 0;iBone < face.avVertices[iVert].aiBoneLinks.size();++iBone) {
TempWeightListEntry& pairval = face.avVertices[iVert].aiBoneLinks[iBone];
for (auto &pairval : face.avVertices[iVert].aiBoneLinks) {
if (pairval.first >= asBones.size()) {
continue;
}
@ -398,9 +388,7 @@ void SMDImporter::CreateOutputMeshes() {
++iNum;
}
}
delete[] aaiBones;
}
delete[] aaiFaces;
}
// ------------------------------------------------------------------------------------------------
@ -411,8 +399,7 @@ void SMDImporter::AddBoneChildren(aiNode* pcNode, uint32_t iParent) {
ai_assert( nullptr == pcNode->mChildren);
// first count ...
for (unsigned int i = 0; i < asBones.size();++i) {
SMD::Bone& bone = asBones[i];
for (auto &bone : asBones) {
if (bone.iParent == iParent) {
++pcNode->mNumChildren;
}
@ -516,27 +503,25 @@ void SMDImporter::CreateOutputAnimation(int index, const std::string &name) {
// now build valid keys
unsigned int a = 0;
for (std::vector<SMD::Bone>::const_iterator i = asBones.begin(); i != asBones.end(); ++i) {
for (const auto &asBone : asBones) {
aiNodeAnim* p = pp[a] = new aiNodeAnim();
// copy the name of the bone
p->mNodeName.Set(i->mName);
p->mNodeName.Set(asBone.mName);
p->mNumRotationKeys = (unsigned int)(*i).sAnim.asKeys.size();
p->mNumRotationKeys = (unsigned int)asBone.sAnim.asKeys.size();
if (p->mNumRotationKeys){
p->mNumPositionKeys = p->mNumRotationKeys;
aiVectorKey* pVecKeys = p->mPositionKeys = new aiVectorKey[p->mNumRotationKeys];
aiQuatKey* pRotKeys = p->mRotationKeys = new aiQuatKey[p->mNumRotationKeys];
for (std::vector<SMD::Bone::Animation::MatrixKey>::const_iterator
qq = (*i).sAnim.asKeys.begin();
qq != (*i).sAnim.asKeys.end(); ++qq) {
pRotKeys->mTime = pVecKeys->mTime = (*qq).dTime;
for (const auto &asKey : asBone.sAnim.asKeys) {
pRotKeys->mTime = pVecKeys->mTime = asKey.dTime;
// compute the rotation quaternion from the euler angles
// aiQuaternion: The order of the parameters is yzx?
pRotKeys->mValue = aiQuaternion((*qq).vRot.y, (*qq).vRot.z, (*qq).vRot.x);
pVecKeys->mValue = (*qq).vPos;
pRotKeys->mValue = aiQuaternion(asKey.vRot.y, asKey.vRot.z, asKey.vRot.x);
pVecKeys->mValue = asKey.vPos;
++pVecKeys; ++pRotKeys;
}
@ -982,8 +967,8 @@ void SMDImporter::ParseTriangle(const char* szCurrent, const char** szCurrentOut
SkipSpacesAndLineEnd(szCurrent,&szCurrent);
// load three vertices
for (unsigned int iVert = 0; iVert < 3;++iVert) {
ParseVertex(szCurrent,&szCurrent, face.avVertices[iVert]);
for (auto &avVertex : face.avVertices) {
ParseVertex(szCurrent,&szCurrent, avVertex);
}
*szCurrentOut = szCurrent;
}
@ -1080,13 +1065,11 @@ void SMDImporter::ParseVertex(const char* szCurrent,
}
vertex.aiBoneLinks.resize(iSize,std::pair<unsigned int, float>(0,0.0f));
for (std::vector<std::pair<unsigned int, float> >::iterator
i = vertex.aiBoneLinks.begin();
i != vertex.aiBoneLinks.end();++i) {
if(!ParseUnsignedInt(szCurrent,&szCurrent,(*i).first)) {
for (auto &aiBoneLink : vertex.aiBoneLinks) {
if(!ParseUnsignedInt(szCurrent,&szCurrent,aiBoneLink.first)) {
SMDI_PARSE_RETURN;
}
if(!ParseFloat(szCurrent,&szCurrent,(*i).second)) {
if(!ParseFloat(szCurrent,&szCurrent,aiBoneLink.second)) {
SMDI_PARSE_RETURN;
}
}

View File

@ -477,9 +477,6 @@ void X3DImporter::ParseHelper_Node_Exit() {
// check if we can walk up.
if (mNodeElementCur != nullptr) {
mNodeElementCur = mNodeElementCur->Parent;
} else {
int i = 0;
++i;
}
}

View File

@ -118,10 +118,8 @@ void ScenePreprocessor::ProcessMesh(aiMesh *mesh) {
// as if they were 2D channels .. just in case an application doesn't handle
// this case
if (2 == mesh->mNumUVComponents[i]) {
size_t num = 0;
for (; p != end; ++p) {
p->z = 0.f;
num++;
}
} else if (1 == mesh->mNumUVComponents[i]) {
for (; p != end; ++p) {

View File

@ -647,12 +647,9 @@ char *OpenDDLParser::parseBooleanLiteral(char *in, char *end, Value **boolean) {
in = lookForNextToken(in, end);
char *start(in);
size_t len(0);
while (!isSeparator(*in) && in != end) {
++in;
++len;
}
++len;
int res = ::strncmp(Grammar::BoolTrue, start, strlen(Grammar::BoolTrue));
if (0 != res) {
res = ::strncmp(Grammar::BoolFalse, start, strlen(Grammar::BoolFalse));

View File

@ -64,8 +64,7 @@ TEST_F(utBlenderImporterExporter, importBlenFromFileTest) {
TEST(utBlenderImporter, import4cubes) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/4Cubes4Mats_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, import269_regress1) {
@ -77,22 +76,19 @@ TEST(utBlenderImporter, import269_regress1) {
TEST(utBlenderImporter, importBlenderDefault248) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderDefault_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importBlenderDefault250) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderDefault_250.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importBlenderDefault250Compressed) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderDefault_250_Compressed.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importBlenderDefault262) {
@ -123,92 +119,79 @@ TEST(utBlenderImporter, importBlenderDefault293) {
TEST(utBlenderImporter, importCubeHierarchy_248) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/CubeHierarchy_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importHuman) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/HUMAN.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importMirroredCube_252) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/MirroredCube_252.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importNoisyTexturedCube_VoronoiGlob_248) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/NoisyTexturedCube_VoronoiGlob_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importSmoothVsSolidCube_248) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/SmoothVsSolidCube_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importSuzanne_248) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/Suzanne_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importSuzanneSubdiv_252) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/SuzanneSubdiv_252.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importTexturedCube_ImageGlob_248) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/TexturedCube_ImageGlob_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importTexturedPlane_ImageUv_248) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/TexturedPlane_ImageUv_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importTexturedPlane_ImageUvPacked_248) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/TexturedPlane_ImageUvPacked_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importTorusLightsCams_250_compressed) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/TorusLightsCams_250_compressed.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, import_yxa_1) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/yxa_1.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importBob) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_NONBSD_DIR "/BLEND/Bob.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed
ASSERT_EQ(nullptr, scene);
ASSERT_NE(nullptr, scene);
}
TEST(utBlenderImporter, importFleurOptonl) {

View File

@ -286,12 +286,6 @@ void PrintHierarchy(
// -----------------------------------------------------------------------------------
// Implementation of the assimp info utility to print basic file info
int Assimp_Info(const char *const *params, unsigned int num) {
// --help
if (!strcmp(params[0], "-h") || !strcmp(params[0], "--help") || !strcmp(params[0], "-?")) {
printf("%s", AICMD_MSG_INFO_HELP_E);
return AssimpCmdError::Success;
}
// asssimp info <file> [-r]
if (num < 1) {
printf("assimp info: Invalid number of arguments. "
@ -299,6 +293,12 @@ int Assimp_Info(const char *const *params, unsigned int num) {
return AssimpCmdError::InvalidNumberOfArguments;
}
// --help
if (!strcmp(params[0], "-h") || !strcmp(params[0], "--help") || !strcmp(params[0], "-?")) {
printf("%s", AICMD_MSG_INFO_HELP_E);
return AssimpCmdError::Success;
}
const std::string in = std::string(params[0]);
// get -r and -v arguments