add possibility to export textures on nxs/nxz

This commit is contained in:
alemuntoni 2021-06-24 17:26:51 +02:00
parent 70bb79d4a9
commit 4a795dacdf
2 changed files with 8 additions and 8 deletions

2
src/external/nexus vendored

@ -1 +1 @@
Subproject commit c27d9bce0a8dc933ba7513da9ff95a73a76c5309
Subproject commit 61536927f71dcab499d1db26c8913ed932dd4afa

View File

@ -203,12 +203,15 @@ void IONXSPlugin::saveNxs(
loader = new VcgLoader<CMeshO>;
std::vector<QImage> textures;
loader->load(&m.cm, has_colors, has_normals, has_textures);
stream->load(loader);
//WORKAROUND to save loading textures not needed
if(!(components & NexusBuilder::TEXTURES)) {
stream->textures.clear();
if((components & NexusBuilder::TEXTURES)) {
for (const std::string& tn : m.cm.textures){
textures.push_back(m.getTexture(tn));
}
}
NexusBuilder builder(components);
@ -221,10 +224,7 @@ void IONXSPlugin::saveNxs(
if(deepzoom)
builder.header.signature.flags |= nx::Signature::Flags::DEEPZOOM;
builder.tex_quality = tex_quality;
bool success = builder.initAtlas(stream->textures);
if(!success) {
throw MLException("Fail");
}
builder.initAtlas(textures);
if(point_cloud)
tree = new KDTreeCloud("cache_tree", adaptive.toFloat());
else