Browse Source

sceneconverter: properly fail --info-scenes if importing a scene fails.

Somehow this was completely ignored when implementing scene info
printing back in 26d2f3e9ab.
pull/556/head
Vladimír Vondruš 4 years ago
parent
commit
e92c4316ac
  1. 7
      src/Magnum/SceneTools/sceneconverter.cpp

7
src/Magnum/SceneTools/sceneconverter.cpp

@ -419,6 +419,7 @@ is specified as well, the IDs reference attributes of the first mesh.)")
};
/* Parse everything first to avoid errors interleaved with output */
bool error = false;
/* Scene properties, together with counting how much is each mesh /
light / material / skin shared (which gets used only if both
@ -438,7 +439,10 @@ is specified as well, the IDs reference attributes of the first mesh.)")
for(UnsignedInt i = 0; i != importer->sceneCount(); ++i) {
Containers::Optional<Trade::SceneData> scene = importer->scene(i);
if(!scene) continue;
if(!scene) {
error = true;
continue;
}
SceneInfo info{};
info.scene = i;
@ -482,7 +486,6 @@ is specified as well, the IDs reference attributes of the first mesh.)")
}
/* Animation properties */
bool error = false;
Containers::Array<AnimationInfo> animationInfos;
if(args.isSet("info") || args.isSet("info-animations")) for(UnsignedInt i = 0; i != importer->animationCount(); ++i) {
Containers::Optional<Trade::AnimationData> animation;

Loading…
Cancel
Save