Warn if baked mesh is empty for OBJBaker

This commit is contained in:
sabrina-shanman 2019-03-18 13:13:12 -07:00
parent 266f3a8ad8
commit 64fbf51ac2

View file

@ -119,7 +119,7 @@ void OBJBaker::createFBXNodeTree(FBXNode& rootNode, const hfm::Model::Pointer& h
// Store the draco node containing the compressed mesh information, along with the per-meshPart material IDs the draco node references // Store the draco node containing the compressed mesh information, along with the per-meshPart material IDs the draco node references
// Because we redefine the material IDs when initializing the material nodes above, we pass that in for the material list // Because we redefine the material IDs when initializing the material nodes above, we pass that in for the material list
// The nth mesh part gets the nth material // The nth mesh part gets the nth material
{ if (!dracoMesh.isEmpty()) {
std::vector<hifi::ByteArray> newMaterialList; std::vector<hifi::ByteArray> newMaterialList;
newMaterialList.reserve(_materialIDs.size()); newMaterialList.reserve(_materialIDs.size());
for (auto materialID : _materialIDs) { for (auto materialID : _materialIDs) {
@ -128,6 +128,8 @@ void OBJBaker::createFBXNodeTree(FBXNode& rootNode, const hfm::Model::Pointer& h
FBXNode dracoNode; FBXNode dracoNode;
buildDracoMeshNode(dracoNode, dracoMesh, newMaterialList); buildDracoMeshNode(dracoNode, dracoMesh, newMaterialList);
geometryNode.children.append(dracoNode); geometryNode.children.append(dracoNode);
} else {
handleWarning("Baked mesh for OBJ model '" + _modelURL.toString() + "' is empty");
} }
// Generating Texture Node // Generating Texture Node