Qt3D export
-
Hi everybody
I use QSceneLoader for import scene with Qt3D.
Now, I have to export scene but after look on the web, I found nothing. So I decided to try to code an exporter: a plugin for Qt3D.
I have only two files, who are in the same .pro with assimpImporter, so they are included in the DLL assimpsceneimport.dll
But I don't know how to use my class Qt3DRender::AssimpExporterI have tried to do the same that QSceneLoader but, I don't see where Qt3DRender::AssimpImporter is called. The only one time where assimpImporter is called is with sceneJob. But QSceneLoader doesn't call sceneJob too.
So I'm confused, I don't know how to call my class and use It.Ps: my class inherits of QSceneExport
-
Hi, I have advanced my plugin.
Now I have other files like the plugin gltfexport:- A main file :
#include "assimpexporter.h" #include <private/qsceneexportplugin_p.h> QT_BEGIN_NAMESPACE class AssimpSceneExportPlugin : public Qt3DRender::QSceneExportPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID QSceneExportFactoryInterface_iid FILE "assimpexport.json") Qt3DRender::QSceneExporter *create(const QString &key, const QStringList ¶mList) override { Q_UNUSED(key) Q_UNUSED(paramList) return new Qt3DRender::AssimpExporter(); } }; QT_END_NAMESPACE #include "main.moc"
- A json file :
{ "Keys": ["assimpexport"] }
- A cmake file :
add_library(Qt5::AssimpSceneExportPlugin MODULE IMPORTED) _populate_3DRender_plugin_properties(AssimpSceneExportPlugin RELEASE "sceneparsers/assimpsceneexport.dll") _populate_3DRender_plugin_properties(AssimpSceneExportPlugin DEBUG "sceneparsers/assimpsceneexportd.dll") list(APPEND Qt53DRender_PLUGINS Qt5::AssimpSceneExportPlugin)
I have already recompiled Qt3D and now when I want to use my plugin, I have some link errors.
#include <assimpexport/assimpexport.h> void myFunction(void) { Qt3DRender::AssimpExporter assimpExporter; }
Errors :
Gravité Code Description Projet Chemin Fichier Ligne État de la suppression Erreur LNK2019 symbole externe non résolu "public: __cdecl Qt3DRender::AssimpExporter::AssimpExporter(void)" (??0AssimpExporter@Qt3DRender@@QEAA@XZ) référencé dans la fonction "public: void __cdecl nvr::ProjectManager::on3DFileSaveAs(void)" (?on3DFileSaveAs@ProjectManager@nvr@@QEAAXXZ) NucleusCreator C:\Users\alex-clevo\Documents\Leo\NucleusCreator\NucleusCreator C:\Users\alex-clevo\Documents\Leo\NucleusCreator\NucleusCreator\ProjectManager.obj 1
And the same for the destruction. But I have include the library Qt3DRender and AssimpExport is included in Qt3DRender thanks to the cmake file, don't?