update assimp to 5.2.5 Bugfix-Release

This commit is contained in:
AzaezelX 2023-05-28 11:19:45 -05:00
parent 360edf18a1
commit c3f53b99ea
886 changed files with 7946 additions and 524449 deletions

View file

@ -305,16 +305,19 @@ void FBXConverter::ConvertNodes(uint64_t id, aiNode *parent, aiNode *root_node)
}
}
if (nodes.empty()) {
if (nodes.size()) {
parent->mChildren = new aiNode *[nodes.size()]();
parent->mNumChildren = static_cast<unsigned int>(nodes.size());
for (unsigned int i = 0; i < nodes.size(); ++i)
{
parent->mChildren[i] = nodes[i].mOwnership.release();
}
nodes.clear();
} else {
parent->mNumChildren = 0;
parent->mChildren = nullptr;
}
parent->mChildren = new aiNode *[nodes.size()]();
parent->mNumChildren = static_cast<unsigned int>(nodes.size());
for (unsigned int i = 0; i < nodes.size(); ++i) {
parent->mChildren[i] = nodes[i].mOwnership.release();
}
}
void FBXConverter::ConvertLights(const Model &model, const std::string &orig_name) {

View file

@ -415,11 +415,9 @@ void ResolveVertexDataArray(std::vector<T>& data_out, const Scope& source,
{
bool isDirect = ReferenceInformationType == "Direct";
bool isIndexToDirect = ReferenceInformationType == "IndexToDirect";
const bool hasDataElement = HasElement(source, dataElementName);
const bool hasIndexDataElement = HasElement(source, indexDataElementName);
// fall-back to direct data if there is no index data element
if (isIndexToDirect && !hasIndexDataElement) {
if ( isIndexToDirect && !HasElement( source, indexDataElementName ) ) {
isDirect = true;
isIndexToDirect = false;
}
@ -428,8 +426,7 @@ void ResolveVertexDataArray(std::vector<T>& data_out, const Scope& source,
// deal with this more elegantly and with less redundancy, but right
// now it seems unavoidable.
if (MappingInformationType == "ByVertice" && isDirect) {
if (!hasDataElement) {
FBXImporter::LogWarn("missing data element: ", dataElementName);
if (!HasElement(source, dataElementName)) {
return;
}
std::vector<T> tempData;
@ -451,15 +448,7 @@ void ResolveVertexDataArray(std::vector<T>& data_out, const Scope& source,
}
else if (MappingInformationType == "ByVertice" && isIndexToDirect) {
std::vector<T> tempData;
if (!hasDataElement || !hasIndexDataElement) {
if (!hasDataElement)
FBXImporter::LogWarn("missing data element: ", dataElementName);
if (!hasIndexDataElement)
FBXImporter::LogWarn("missing index data element: ", indexDataElementName);
return;
}
ParseVectorDataArray(tempData, GetRequiredElement(source, dataElementName));
ParseVectorDataArray(tempData, GetRequiredElement(source, dataElementName));
std::vector<int> uvIndices;
ParseVectorDataArray(uvIndices,GetRequiredElement(source,indexDataElementName));
@ -484,11 +473,6 @@ void ResolveVertexDataArray(std::vector<T>& data_out, const Scope& source,
}
}
else if (MappingInformationType == "ByPolygonVertex" && isDirect) {
if (!hasDataElement) {
FBXImporter::LogWarn("missing data element: ", dataElementName);
return;
}
std::vector<T> tempData;
ParseVectorDataArray(tempData, GetRequiredElement(source, dataElementName));
@ -503,14 +487,7 @@ void ResolveVertexDataArray(std::vector<T>& data_out, const Scope& source,
}
else if (MappingInformationType == "ByPolygonVertex" && isIndexToDirect) {
std::vector<T> tempData;
if (!hasDataElement || !hasIndexDataElement) {
if (!hasDataElement)
FBXImporter::LogWarn("missing data element: ", dataElementName);
if (!hasIndexDataElement)
FBXImporter::LogWarn("missing index data element: ", indexDataElementName);
return;
}
ParseVectorDataArray(tempData, GetRequiredElement(source, dataElementName));
ParseVectorDataArray(tempData, GetRequiredElement(source, dataElementName));
std::vector<int> uvIndices;
ParseVectorDataArray(uvIndices,GetRequiredElement(source,indexDataElementName));