Jump to content

[SOLVED] select node in editor and needReload()


photo

Recommended Posts

hi : i would like to select some node in the editor
here is the code and it works
foreach(Node node;nodes){
nodesSelect(node,0);
}
engine.editor.needReload();

if i remove the needReload() it will not work. I don't really understand why.

the problem for needReload() is that it will stop editor to update.

any idea?

 

Link to comment

Hi there!

 

First of all, engine.editor.needReload won't stop editor updates as it'll just set internal flag. If you look at update function in core/editor/editor.cpp file you can notice that inside it's constantly checking for that flag.

 

You could also use nodesUpdate(1) call instead so you won't reload all editor systems.

Link to comment

Hello there, Yang!

 

This should be something like this:

Node new_selection[0]; // fill this array with the nodes you want to select

nodesReload();

forloop(int i = 0; new_selection.size()) {
	nodesSelectNew(new_selection[i],1);
}

Link to comment
×
×
  • Create New...