Jump to content

[Unigine 2.16.1.0] Editor plugin : "Unknown error"


photo

Recommended Posts

Posted

Hello,

I'm currently developing a plugin using the Unigine 2.16.1 Editor API and I am encountering some issues.

First, I define the plugin using the following code : (inspired by the EngineGuiWindowPlugin)

class MyPlugin final : public QObject, public ::UnigineEditor::Plugin
{
    Q_OBJECT
    Q_DISABLE_COPY(MyPlugin)
    Q_PLUGIN_METADATA(IID UNIGINE_EDITOR_PLUGIN_IID FILE "MyPlugin.json")
    Q_INTERFACES(UnigineEditor::Plugin)

public:
    MyPlugin() = default;

    bool init() override;
    void shutdown() override;

private:
    QAction*                        m_action;
    UnigineEditor::EngineGuiWindow* m_window;
};

And although UNIGINE_DOUBLE is defined, I get the following error :

Quote

Editor.PluginSystem: Your plugin is ignored by UnigineEditor due to incompatible version/precision.
UnigineEditor v.2.16.1.0 (double precision)
myplugin_double_x64d.dll plugin v.2.16.1.0 (float precision)

To fix this issue please replace the following line in your plugin class declaration and rebuild the plugin:
Q_PLUGIN_METADATA(IID UNIGINE_EDITOR_PLUGIN_IID FILE "YourPluginFile.json")

I have tried redefining UNIGINE_EDITOR_PLUGIN_IID to "com.unigine.EditorPlugin.double.2.16.1.0" and now I'm getting an "Unknown error" in the logs of the editor :

image.thumb.png.52ed9085600702a934285692a50bbc08.png

Is there something that I am missing here?

Thanks in advance.

Posted

Ok, I've just found what was causing the error : I needed to put -DUNIGINE_DOUBLE in the arguments of Qt's moc.exe.

So the custom build command for the header file is now

Quote

"$(UNIGINE_QTROOT)\bin\moc.exe" -DARCH_X64 -DWIN32 -DUNIGINE_DOUBLE -o "%(RootDir)%(Directory)moc_%(Filename).cpp" -I"$(ProjectDir)..\..\include" "%(FullPath)"

instead of

Quote

"$(UNIGINE_QTROOT)\bin\moc.exe" -DARCH_X64 -DWIN32 -o "%(RootDir)%(Directory)moc_%(Filename).cpp" -I"$(ProjectDir)..\..\include" "%(FullPath)"

 

Posted

Hi Karim,

Quote

I have tried redefining UNIGINE_EDITOR_PLUGIN_IID to "com.unigine.EditorPlugin.double.2.16.1.0" and now I'm getting an "Unknown error" in the logs of the editor :

Please, don't do this, since the suggested fix is a bit wrong (for a different use-case). We will add proper error messages in the next update.

 

Quote

Ok, I've just found what was causing the error : I needed to put -DUNIGINE_DOUBLE in the arguments of Qt's moc.exe.

Yep, that's the correct way of fixing this behavior. Also you can add preprocessor definition for cmake:

target_compile_definitions(AppMain PUBLIC UNIGINE_DOUBLE)

or in case of VS:

image.png

 

We will also check Editor's plugin templates to see if there is something that we do to make it easier to use.

Thanks!

  • Like 1

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Posted

Yes, and you should also add the -DUNIGINE_DOUBLE parameter to the moc.exe (Qt) command.

×
×
  • Create New...