Jump to content

Extending UNIGINE Editor - some questions


photo

Recommended Posts

Hi all,

we are currently investigating the possibility into extending the UNIGINE editor with our needs. However, we run in some general questions, we hope to get an answer here:

  1. General frame update: The Editors Plugin-class are currently only providing init() and shutdown() functions but are lacking of any other functions we are getting used to with the AppWorld-class. For example we want to render some custom information, based on renderLine3D() but are not able to do it in an convenient way. We are currently connecting to the EngineGuiWindow::getEventUpdate() event which only seems to trigger when the actual window is rendered (based on the policy), but unable to update when the window was closed. Are there an more convenient way to do this?
  2. Are we able to connect to any event when user is clicking into the world and getting the intersection point? For example we want to do the same as the current SplineGraphSystem, where we can create, edit and move SplinePoints in the virtual world. We want to select our custom spline points (rendered via update if possible :) ) and creating an WidgetManipulator on it and need to manipulate the transform as well. Is this possible at the moment?

Thanks in advance!

Link to comment

As far as I remember you could use render() , swap() ,etc methods in AppEditor class level  , as same as which you can use in AppWorld-Class . 

Ungine support system , editor , application level for different usage , but same methods which inserted into Unigine rendering pipeline or calling sequences.

I  am not 100% sure what I said is what you need , however we could exchange ideas . 

Link to comment

Hi leon,

thanks for your reply. As far as I remembered correctly, AppEditorLogic is only used for a complete custom editor logic, but neither extends the UNIGINE editor nor is called during editor execution stage.

Let's say we want to create a plugin for a more customized road network, where we can create/modify/delete any RoadNode/RoadSegement in editor. Each class has some additional parameters to be set during creation (type of road segment, who can access the road segment,...). Therefor we need some logic to create such RoadNodes, move them around and edit there parameters (maybe same like the SplineGraph-editing).

Best

Link to comment
Quote

As far as I remembered correctly, AppEditorLogic is only used for a complete custom editor logic, but neither extends the UNIGINE editor nor is called during editor execution stage.

The documentation seems to say otherwise:
 

Quote

The EditorLogic class is used to control the logic of the editor. Methods of this class are called after corresponding methods of the editor script.

EditorLogic class methods are called only if the UnigineEditor is loaded.

[...]

int update ( ) Engine calls this function before updating each render frame when editor is loaded. Similar to the editor script's update() function.


And EditorLogic::update is called before system and world logic. (https://developer.unigine.com/en/docs/2.18/code/fundamentals/execution_sequence/execution_sequence_multi.png)

Link to comment
10 hours ago, devrom said:

The documentation seems to say otherwise:
 


And EditorLogic::update is called before system and world logic. (https://developer.unigine.com/en/docs/2.18/code/fundamentals/execution_sequence/execution_sequence_multi.png)

Document is always behind the engine source codes. 

We found many scenarios that engine has different implementations by comparing the document.

But anyway , Thanks for your exchanged ideas. @devrom

 

@christian.wolf2 I think your requirements are complicated than I think , hope offfical developers could help on this. 

Link to comment
20 hours ago, devrom said:

The documentation seems to say otherwise:
 


And EditorLogic::update is called before system and world logic. (https://developer.unigine.com/en/docs/2.18/code/fundamentals/execution_sequence/execution_sequence_multi.png)

I know this documentation entry, but also found this entry, where it is stated: "This component is to be used in case you need to implement your own Editor.". Logging anything in the AppEditorLogic doesn't show in the editor console, so I guess it is not called at all. I also have found this post and it is stated, that it haven't any effect.

Anyway, thanks for the hint.

Link to comment

Hi christian.wolf2,

I've made a sample that should cover all your basic needs in creating your Spline/Road Tool. Requires SDK v2.18.

What this sample demonstrates:
1) How to use ImGui instead of Unigine's widgets or Qt widgets
in editor's plugins. I think it's the best way to prototype interfaces.
2) How to use Editor/Engine API in ImGui-like way. Again, for prototyping or relatively simple plugins.
3) How to use Editor API "correctly": using Undo/Redo system, WidgetCanvas to draw custom icons in viewports, check intersections for your custom objects in Editor's viewport, how to add many manipulators at the same time, how to use hotkeys/Input in the Editor, etc.

imgui_plugin_1.gif
imgui_plugin_2.gif
imgui_plugin_3.gif

How to install:
1) Create a new project in the SDK Browser with these settings:
plugin_install.png

2) Extract attached zip file (imgui_samples_plugin.zip) in created project folder.
3) Use CMake / Qt Creator / Visual Studio 2022 to build the ImGuiSamplesPlugin project.

Hope it helps.

Best regards,
Alexander

  • Like 3
  • Thanks 2
Link to comment
×
×
  • Create New...