karim.salama Posted March 22, 2023 Posted March 22, 2023 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 : Is there something that I am missing here? Thanks in advance.
karim.salama Posted March 22, 2023 Author Posted March 22, 2023 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)"
silent Posted March 23, 2023 Posted March 23, 2023 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: We will also check Editor's plugin templates to see if there is something that we do to make it easier to use. Thanks! 1 How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
karim.salama Posted March 23, 2023 Author Posted March 23, 2023 Yes, and you should also add the -DUNIGINE_DOUBLE parameter to the moc.exe (Qt) command.
Recommended Posts