Jump to content

How get selected nodes list in Editor


photo

Recommended Posts

I need do some manipulations with selected nodes in Editor. So I need get selected nodes list. How it can be done?

 

I try to use nodesGetNodes() from "core/editor/editor_nodes.h":

Node nodeList[];

nodesGetNodes(nodeList);

for (int i = 0; i < nodeList.size(); i++)
log.message(nodeList[i].getName() + "\n");

 

But if I include this file to my project I have an error:

16:23:38 referenceUpdate();

16:23:38 core/editor/editor_nodes_unredo.h:191: Interpreter::parse(): unknown token "referenceUpdate"

 

This functional can be used outside of unigine editor core?

Link to comment

You should use engine.editor.call() in case of script inter-operation.

But unfortunately arrays can't be passed by this function.

 

You can get single selected node by using:

Node node = engine.editor.call("nodesGetNode");

Link to comment

One selected node is good, but not enough )

Maybe you could extend this functionality by supporting arrays (Vector, Map) in return values or passing array's pointer in function? Thanks

Link to comment

You should use engine.editor.call() in case of script inter-operation.

But unfortunately arrays can't be passed by this function.

 

Maybe required custom functionallity could be implemented directly within UNIGINE editor script (where nodesGetNodes() is available/usable) and this could be called via engine.editor.call(). Not elegant, but maybe at least a work-around

Link to comment

No, editor have this functionality - nodesGetNodes(Node nodes[]), but engine.editor.call() don't allow use arrays in parameters. I can create nodesGetNodes(Node nodes[]) analog where pack selected node's names in string, and then return it.

Link to comment
×
×
  • Create New...