Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt3D export
Forum Updated to NodeBB v4.3 + New Features

Qt3D export

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
2 Posts 1 Posters 712 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bozo6919
    wrote on last edited by
    #1

    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::AssimpExporter

    I 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

    Sorry for my English ^^'

    1 Reply Last reply
    0
    • B Offline
      B Offline
      bozo6919
      wrote on last edited by
      #2

      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 &paramList) 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?

      Sorry for my English ^^'

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved