mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-20 03:16:10 +00:00
corrected exporting error, when saving multiple layers
MeshLabServer was iterating on the "output list", but always exporting the current layer (meshDocument.mm()). Now it exports layers following their order - TO BE TESTED -
This commit is contained in:
parent
6ea0112cfe
commit
f948e80603
@ -896,19 +896,26 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
for(int ii = 0;ii < outmeshlist.size();++ii)
|
||||
{
|
||||
if (meshDocument.mm() != NULL)
|
||||
{
|
||||
bool exported = server.exportMesh(meshDocument.mm(), outmeshlist[ii].mask, outmeshlist[ii].filename,logfp);
|
||||
if (exported)
|
||||
fprintf(logfp,"Mesh %s saved as %s (%i vn %i fn)\n", qPrintable(meshDocument.mm()->fullName()), qPrintable(outmeshlist[ii].filename), meshDocument.mm()->cm.vn, meshDocument.mm()->cm.fn);
|
||||
else
|
||||
fprintf(logfp,"Output mesh %s has NOT been saved\n",qPrintable(outmeshlist[ii].filename));
|
||||
}
|
||||
else
|
||||
fprintf(logfp,"Invalid current mesh. Output mesh %s will not be saved\n",qPrintable(outmeshlist[ii].filename));
|
||||
}
|
||||
if (meshDocument.size() < outmeshlist.size())
|
||||
fprintf(logfp, "Error: trying to save %i meshes, but only %i available in the project\n", qPrintable(outmeshlist.size()), qPrintable(meshDocument.size()));
|
||||
else
|
||||
{
|
||||
for (int ii = 0; ii < outmeshlist.size(); ++ii)
|
||||
{
|
||||
if (meshDocument.meshList[ii] != NULL)
|
||||
{
|
||||
bool exported = server.exportMesh(meshDocument.meshList[ii], outmeshlist[ii].mask, outmeshlist[ii].filename, logfp);
|
||||
if (exported)
|
||||
fprintf(logfp, "Mesh %s saved as %s (%i vn %i fn)\n", qPrintable(meshDocument.mm()->fullName()), qPrintable(outmeshlist[ii].filename), meshDocument.mm()->cm.vn, meshDocument.mm()->cm.fn);
|
||||
else
|
||||
fprintf(logfp, "Output mesh %s has NOT been saved\n", qPrintable(outmeshlist[ii].filename));
|
||||
}
|
||||
else
|
||||
fprintf(logfp, "Invalid layer %i. Output mesh %s will not be saved\n", qPrintable(ii), qPrintable(outmeshlist[ii].filename));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if((logfp != NULL) && (logfp != stdout))
|
||||
fclose(logfp);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user