diff --git a/code/BlenderCustomData.cpp b/code/BlenderCustomData.cpp index dd9032e50..b89a1ded8 100644 --- a/code/BlenderCustomData.cpp +++ b/code/BlenderCustomData.cpp @@ -166,7 +166,7 @@ namespace Assimp { return cdtype >= 0 && cdtype < CD_NUMTYPES; } - bool readCustomData(std::shared_ptr &out, const CustomDataType cdtype, const size_t cnt, const FileDatabase &db) { + bool readCustomData(std::shared_ptr &out, const int cdtype, const size_t cnt, const FileDatabase &db) { if (!isValidCustomDataType(cdtype)) { throw Error((Formatter::format(), "CustomData.type ", cdtype, " out of index")); } diff --git a/code/BlenderCustomData.h b/code/BlenderCustomData.h index 782403bdd..243480cb0 100644 --- a/code/BlenderCustomData.h +++ b/code/BlenderCustomData.h @@ -76,7 +76,7 @@ namespace Assimp { * @param[in] db to read elements from * @return true when ok */ - bool readCustomData(std::shared_ptr &out, CustomDataType cdtype, size_t cnt, const FileDatabase &db); + bool readCustomData(std::shared_ptr &out, int cdtype, size_t cnt, const FileDatabase &db); /** * @brief returns CustomDataLayer ptr for given cdtype and name diff --git a/code/BlenderDNA.inl b/code/BlenderDNA.inl index 5e54d04bd..6a34ac18c 100644 --- a/code/BlenderDNA.inl +++ b/code/BlenderDNA.inl @@ -311,10 +311,6 @@ void Structure :: ReadField(T& out, const char* name, const FileDatabase& db) co // field parsing for raw untyped data (like CustomDataLayer.data) template bool Structure::ReadCustomDataPtr(std::shared_ptr&out, int cdtype, const char* name, const FileDatabase& db) const { - if (!isValidCustomDataType(cdtype)) { - ASSIMP_LOG_ERROR("given rawtype out of index"); - return false; - } const StreamReaderAny::pos old = db.reader->GetCurrentPos(); @@ -345,7 +341,7 @@ bool Structure::ReadCustomDataPtr(std::shared_ptr&out, int cdtype, const c const FileBlockHead* block = LocateFileBlockForAddress(ptrval, db); db.reader->SetCurrentPos(block->start + static_cast((ptrval.val - block->address.val))); // read block->num instances of given type to out - readOk = readCustomData(out, static_cast(cdtype), block->num, db); + readOk = readCustomData(out, cdtype, block->num, db); } // and recover the previous stream position