Merge branch 'master' into master

pull/2969/head
Kim Kulling 2020-02-01 19:26:52 +01:00 committed by GitHub
commit 99175e3eaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 32 additions and 6 deletions

View File

@ -448,6 +448,12 @@ void ResolveVertexDataArray(std::vector<T>& data_out, const Scope& source,
std::vector<T> tempData; std::vector<T> tempData;
ParseVectorDataArray(tempData, GetRequiredElement(source, dataElementName)); ParseVectorDataArray(tempData, GetRequiredElement(source, dataElementName));
if (tempData.size() != vertex_count) {
FBXImporter::LogError(Formatter::format("length of input data unexpected for ByVertice mapping: ")
<< tempData.size() << ", expected " << vertex_count);
return;
}
data_out.resize(vertex_count); data_out.resize(vertex_count);
for (size_t i = 0, e = tempData.size(); i < e; ++i) { for (size_t i = 0, e = tempData.size(); i < e; ++i) {
@ -461,10 +467,23 @@ void ResolveVertexDataArray(std::vector<T>& data_out, const Scope& source,
std::vector<T> tempData; std::vector<T> tempData;
ParseVectorDataArray(tempData, GetRequiredElement(source, dataElementName)); ParseVectorDataArray(tempData, GetRequiredElement(source, dataElementName));
data_out.resize(vertex_count); if (tempData.size() != vertex_count) {
FBXImporter::LogError(Formatter::format("length of input data unexpected for ByVertice mapping: ")
<< tempData.size() << ", expected " << vertex_count);
return;
}
std::vector<int> uvIndices; std::vector<int> uvIndices;
ParseVectorDataArray(uvIndices,GetRequiredElement(source,indexDataElementName)); ParseVectorDataArray(uvIndices,GetRequiredElement(source,indexDataElementName));
if (uvIndices.size() != vertex_count) {
FBXImporter::LogError(Formatter::format("length of input data unexpected for ByVertice mapping: ")
<< uvIndices.size() << ", expected " << vertex_count);
return;
}
data_out.resize(vertex_count);
for (size_t i = 0, e = uvIndices.size(); i < e; ++i) { for (size_t i = 0, e = uvIndices.size(); i < e; ++i) {
const unsigned int istart = mapping_offsets[i], iend = istart + mapping_counts[i]; const unsigned int istart = mapping_offsets[i], iend = istart + mapping_counts[i];
@ -493,16 +512,23 @@ void ResolveVertexDataArray(std::vector<T>& data_out, const Scope& source,
std::vector<T> tempData; std::vector<T> tempData;
ParseVectorDataArray(tempData, GetRequiredElement(source, dataElementName)); ParseVectorDataArray(tempData, GetRequiredElement(source, dataElementName));
data_out.resize(vertex_count); if (tempData.size() != vertex_count) {
FBXImporter::LogError(Formatter::format("length of input data unexpected for ByPolygonVertex mapping: ")
<< tempData.size() << ", expected " << vertex_count);
return;
}
std::vector<int> uvIndices; std::vector<int> uvIndices;
ParseVectorDataArray(uvIndices,GetRequiredElement(source,indexDataElementName)); ParseVectorDataArray(uvIndices,GetRequiredElement(source,indexDataElementName));
if (uvIndices.size() != vertex_count) { if (uvIndices.size() != vertex_count) {
FBXImporter::LogError("length of input data unexpected for ByPolygonVertex mapping"); FBXImporter::LogError(Formatter::format("length of input data unexpected for ByPolygonVertex mapping: ")
<< uvIndices.size() << ", expected " << vertex_count);
return; return;
} }
data_out.resize(vertex_count);
const T empty; const T empty;
unsigned int next = 0; unsigned int next = 0;
for(int i : uvIndices) { for(int i : uvIndices) {