Jump to content

[SOLVED] Creating an Editor Plugin


photo

Recommended Posts

Hi,

even if editor plugin tool is still in experimental state I want to dig into that topic and start to create my own editor plugin. I am following the tutorial from the documentation page and with some ups and downs because of CMAKE I was able to sucessfully generate the project and building a .dll file from it. When adding this dll to my project and try to load the plugin from editor, I get the following message:

plugin_error.thumb.png.421026eb4839f48eca4ba7b7e10794aa.png

Am I doing something wrong or what additional steps needs to be taken in order to build an plugin? Are there anyone that have sucessfully created any plugin for Editor?

 

Best

Christian

 

Link to comment

Hello Christian,

I have experimented with Editor plugins before, so maybe I can help you.
Plugins in general work for me with 2.11 and Linux.


Did you change the source code or did you just copy/paste everything?
Do you have the same problem if you just compile a minimal plugin with no content?
Maybe share parts you changed and your CMakeLists.txt.

Best regards

Link to comment

Hi ipg_rom,

thanks for helping me out! I am trying to create the plugin for 2.11 as well, but for windows plattforms. Basically, I just copy/pasted all the necessary files from the documentation into the first plugin. So nothing was changed. Even the cmake files are the same. I was using cmake-gui for creating the project and every variable (even Qt5-framework) was discovered as expected. And from the cmake-log the project was successfully created and also built without any errors. I attached the CMakeLists.txt from the scr/-folder.

BTW: The ONLY thing I changed was the #include paths from the QT-framework. All the core-files were located in QtCore-folder and not in the base one. Otherwise the paths to the QtWidget files has given me some errors. But this shouldn't be the issue I think. I also added an console-log image. So basically it says the "The specified module could not be found.".

  console_messag.jpg.97fd87a73bc762475b7c9b5003715ab2.jpg

CMakeLists.txt

Link to comment

Hi Christian,

The error message you get isn't related to the Editor's plugin system itself, but it seems that the dynamic linker failed to load your library at runtime for some reason. The most common reason is that some additional dependencies can't be found or, maybe, their versions are different from those with which the library was compiled with (and some symbols are missing, for example).

With what version of Qt did you compile the plugin?

Link to comment

@ipg_rom I compile a release binary. Didn't even tried debug one.

@sinbizkit I build with vs 2017 x64 and are using Qt-Framework 5.12.6. So that should be okay, right? I also started a new project from scratch without including the Material-Tutorial, just the basic Plugin template and I got the same result. No errors or warnings during cmake-creation or building the .dll files. Just the error from the editor.

 

Cheers

Link to comment

Hello Christian,

When I start with  expirementing editor plugins I have the same problem. Compiling ok, loading the plugin in Unigine give an error. The solution for me was:

Choose in Visual Studio  Managing configurations ... In the CMake Settings form you have under de General options the second option Configuration type. When I add the x64-Release configuration this option has the value RelWithDebInfo. I changed it to Release and the error by loading the plugin was gone.

Maybe it wil work for you.

Link to comment

Hi all,

many thanks for all the suggestions and the ongoing help. Unfortunately neither rebuilding the Qt source files from scratch nor trying it with UNIGINE 2.10 helped. Using Release build version was also considered during the first place (thanks roelof). So I will try it now with a different 5.12 Qt-version, and with newest 5.15 release. Will keep you updated.

Just to be completely sure: I am only using an Evaluation version for Qt (since I want to first try it out before buying an licence). Building from Qt source files was therefor also build with "-opensource" command instead of "-commercial". I read that beside some special features, both version are identical. Might be that a reason why it always fails?

 

Best and again thanks a lot for all the help. Much appreciated!

Link to comment

Hi Christian,

I work with version Qt 5.12.9 and the Unigine Community SDK for my editor plugins (without any problems).  I could not get editor plugins working with Qt 5.15.
Could you show your CMakeSettings.json file? (in the root directory of your editor plugin).

  • Like 1
Link to comment
  • 2 weeks later...

Hi all,

short update from my side because problem was solved. I figured out, that the CMAKE-Gui doesn't override the UNIGINE_DOUBLE variable, which is why the system tries to build with single-precision libraries instead of double precision one. If anyone else have the problem, set the variable to ON manually in Unigine.cmake file on line three.

option(UNIGINE_DOUBLE "Use double-precision build." ON)

Afterwards, generating and building the plugin was done successfully and UNIGINE Editor found the application as intended.

 

  • Like 1
Link to comment
  • silent changed the title to [SOLVED] Creating an Editor Plugin
×
×
  • Create New...