Added in meshlab support for opening fbx files

This commit is contained in:
Paolo Cignoni 2018-09-09 09:28:21 +02:00
parent 68f4b097b4
commit 722b6ace90
2 changed files with 22 additions and 3 deletions

View File

@ -28,6 +28,7 @@
#include <wrap/io_trimesh/import_obj.h>
#include <wrap/io_trimesh/import_off.h>
#include <wrap/io_trimesh/import_ptx.h>
#include <wrap/io_trimesh/import_fbx.h>
#include <wrap/io_trimesh/import_vmi.h>
#include <wrap/io_trimesh/import_gts.h>
@ -249,8 +250,21 @@ bool BaseMeshIOPlugin::open(const QString &formatName, const QString &fileName,
return false;
}
}
else
{
else if (formatName.toUpper() == tr("FBX"))
{
m.Enable(tri::io::Mask::IOM_WEDGTEXCOORD);
int result = tri::io::ImporterFBX<CMeshO>::Open(m.cm, filename.c_str(),cb);
if(m.cm.textures.empty())
m.clearDataMask(tri::io::Mask::IOM_WEDGTEXCOORD);
if (result != 0)
{
errorMessage = errorMsgFormat.arg(fileName, vcg::tri::io::ImporterFBX<CMeshO>::ErrorMsg(result));
return false;
}
}else
{
assert(0); // Unknown File type
return false;
}
@ -421,6 +435,7 @@ QList<MeshIOInterface::Format> BaseMeshIOPlugin::importFormats() const
formatList << Format("Object File Format", tr("OFF"));
formatList << Format("PTX File Format", tr("PTX"));
formatList << Format("VCG Dump File Format", tr("VMI"));
formatList << Format("FBX Autodesk Interchange Format", tr("FBX"));
return formatList;
}

View File

@ -6,6 +6,7 @@ HEADERS += baseio.h \
$$VCGDIR/wrap/io_trimesh/import_off.h \
$$VCGDIR/wrap/io_trimesh/import_ptx.h \
$$VCGDIR/wrap/io_trimesh/import_stl.h \
$$VCGDIR/wrap/io_trimesh/import_fbx.h \
$$VCGDIR/wrap/io_trimesh/export_ply.h \
$$VCGDIR/wrap/io_trimesh/export_obj.h \
$$VCGDIR/wrap/io_trimesh/export_off.h \
@ -13,7 +14,10 @@ HEADERS += baseio.h \
$$VCGDIR/wrap/io_trimesh/io_material.h
SOURCES += baseio.cpp \
$$VCGDIR//wrap/ply/plylib.cpp\
$$VCGDIR//wrap/ply/plylib.cpp\
$$VCGDIR//wrap/openfbx/src/ofbx.cpp \
$$VCGDIR//wrap/openfbx/src/miniz.c
TARGET = io_base
CONFIG += c++14