Jump to content

Custom objects and editor


photo

Recommended Posts

Dear @tower120,

Yes It is possible to write custom objects and use them in editor.

Following steps are required.

  1. Create a C++ Plugin https://developer.unigine.com/en/docs/2.13/code/cpp/plugin?rlang=cpp
  2. Create a Component for custom object with properties attached to it. In the plugin initialization initiate component system and all required stuff. https://developer.unigine.com/en/docs/2.13/code/usage/using_component_system/index?rlang=cpp
  3. In open editor command on the SDK Browser manage the plugin loading through extern_plugin command
  4. image.thumb.png.78491d90365528aca8de056e54052a44.png
  5. Add Node Dummy and apply your custom properties to it. You should see custom object and your properties. You should write the behavior for it. 
  6. While running the project don't forget to add the component by loading the plugin and everything will happen as you like.

I have used this technique for allowing content creators to attach custom objects while editing, creating the scene itself. 

Keep us posted about your success. 

Regards,

Rohit

Link to comment

Dear @tower120,

You can just write a component to add the visual representation and behavior for your object.

For example, write a pie chart object. Which may have properties for number of fragments and % of slice  for each fragment. Then create a property file with these two properties and attached it to node. The component will get attached to it when you run it. But if you want this to be happen in editor then write one C++ plugin and put your component inside it. While loading the editor load the plugin with additional parameters and editor will find run time component as you attach the properties.

First try to write component for small implementation write creating a plane. then step by step we can finalize the stuff. (I am on 2.11.0.2)

Regards,

Rohit

Link to comment
×
×
  • Create New...