Jump to content

[SOLVED] Accessing selected nodes in new Editor


photo

Recommended Posts

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

Link to comment

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
Link to comment
  • silent changed the title to [SOLVED] Accessing selected nodes in new Editor
×
×
  • Create New...