Merge branch 'master' into master
This commit is contained in:
@@ -917,8 +917,10 @@ void FBXConverter::ConvertModel(const Model &model, aiNode *parent, aiNode *root
|
||||
} else if (line) {
|
||||
const std::vector<unsigned int> &indices = ConvertLine(*line, root_node);
|
||||
std::copy(indices.begin(), indices.end(), std::back_inserter(meshes));
|
||||
} else {
|
||||
} else if (geo) {
|
||||
FBXImporter::LogWarn("ignoring unrecognized geometry: ", geo->Name());
|
||||
} else {
|
||||
FBXImporter::LogWarn("skipping null geometry");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@ void XGLImporter::ReadWorld(XmlNode &node, TempScope &scope) {
|
||||
}
|
||||
}
|
||||
|
||||
aiNode *const nd = ReadObject(node, scope, true);
|
||||
aiNode *const nd = ReadObject(node, scope);
|
||||
if (!nd) {
|
||||
ThrowException("failure reading <world>");
|
||||
}
|
||||
@@ -296,16 +296,13 @@ aiLight *XGLImporter::ReadDirectionalLight(XmlNode &node) {
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
aiNode *XGLImporter::ReadObject(XmlNode &node, TempScope &scope, bool skipFirst/*, const char *closetag */) {
|
||||
aiNode *XGLImporter::ReadObject(XmlNode &node, TempScope &scope) {
|
||||
aiNode *nd = new aiNode;
|
||||
std::vector<aiNode *> children;
|
||||
std::vector<unsigned int> meshes;
|
||||
|
||||
try {
|
||||
for (XmlNode &child : node.children()) {
|
||||
|
||||
skipFirst = false;
|
||||
|
||||
const std::string &s = ai_stdStrToLower(child.name());
|
||||
if (s == "mesh") {
|
||||
const size_t prev = scope.meshes_linear.size();
|
||||
|
||||
@@ -185,7 +185,7 @@ private:
|
||||
void ReadWorld(XmlNode &node, TempScope &scope);
|
||||
void ReadLighting(XmlNode &node, TempScope &scope);
|
||||
aiLight *ReadDirectionalLight(XmlNode &node);
|
||||
aiNode *ReadObject(XmlNode &node, TempScope &scope, bool skipFirst = false/*, const char *closetag = "object"*/);
|
||||
aiNode *ReadObject(XmlNode &node, TempScope &scope);
|
||||
bool ReadMesh(XmlNode &node, TempScope &scope);
|
||||
void ReadMaterial(XmlNode &node, TempScope &scope);
|
||||
aiVector2D ReadVec2(XmlNode &node);
|
||||
|
||||
@@ -1337,6 +1337,17 @@ std::unordered_map<unsigned int, AnimationSamplers> GatherSamplers(Animation &an
|
||||
}
|
||||
|
||||
auto& animsampler = anim.samplers[channel.sampler];
|
||||
|
||||
if (!animsampler.input) {
|
||||
ASSIMP_LOG_WARN("Animation ", anim.name, ": Missing sampler input. Skipping.");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!animsampler.output) {
|
||||
ASSIMP_LOG_WARN("Animation ", anim.name, ": Missing sampler output. Skipping.");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (animsampler.input->count > animsampler.output->count) {
|
||||
ASSIMP_LOG_WARN("Animation ", anim.name, ": Number of keyframes in sampler input ", animsampler.input->count, " exceeds number of keyframes in sampler output ", animsampler.output->count);
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user