Jump to content

[SOLVED] Accessing selected nodes in new Editor


photo

Recommended Posts

Posted

Hi,

In the old editor (implemented in UnigineScript), there was an array called Nodes::nodes which contained all the currently selected nodes.

Is there anything like that in the new editor?

Thanks in advance

Posted

Hello Karim,

Yes, Editor's API has such a functionality. This function does what you want:

#include <editor/Selection.h>
#include <editor/Selector.h>

using namespace Unigine;

Vector<NodePtr> getSelectedNodes()
{
	Vector<NodePtr> result;
	if (Editor::SelectorNodes *snodes = Editor::Selection::getSelectorNodes())
	{
		result = snodes->getNodes();
	}
	return result;
}

 

  • Like 2
Posted

@victor Thank you.

I hope this will be well documented when Unigine 2.15 gets released.

  • silent changed the title to [SOLVED] Accessing selected nodes in new Editor
×
×
  • Create New...