evgen2023 Posted August 5, 2023 Share Posted August 5, 2023 Hello! I'm begginer in Unigine. And I tring developing simple pugin for UnigineEditor... Can you help me advice for implementing next logic: 1. Create node from editor plugin (Already has and it's worked) 2. Set property (but I didn't understood how to set parameters for created Property) So I'm not sure can I working with property without component system in UnigineEditor Plugin? Link to comment
alexander Posted August 7, 2023 Share Posted August 7, 2023 Hi evgen2023, Quote 2. Set property (but I didn't understood how to set parameters for created Property) You can use something like this: NodePtr node; PropertyPtr prop = node->getProperty(node->addProperty("PropertyName")); prop->getParameterPtr("parameter_name")->setValueInt(5); Please note that you can't create a new property (new .prop file) via API, only use existing ones (and attach them to the nodes/surfaces, change their parameters). Best regards, Alexander 1 Link to comment
evgen2023 Posted August 8, 2023 Author Share Posted August 8, 2023 (edited) So If I try call addProperty from EditorPlugin so then got crash: But found next way (via inherit from node_base and save later): ``` Unigine::PropertyPtr pProperty = Unigine::Properties::findProperty("node_base")->inherit("myproperty"); pProperty->setPath(m_sFullPathProp.toStdString().c_str()); m_pDynamicMesh->addProperty(pProperty); pProperty->save(); ``` it worked without initializing Component System in Editor Plugin. Thanks for your reply! Edited August 8, 2023 by evgen2023 Link to comment
Recommended Posts