cinetec_tech Posted August 29, 2014 Posted August 29, 2014 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?
unclebob Posted August 29, 2014 Posted August 29, 2014 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.
yang.zhang Posted September 3, 2014 Posted September 3, 2014 hi Bob: I's actually not sure how to select nodes in the editor properly. could you send me a sample script? thanks
unclebob Posted September 3, 2014 Posted September 3, 2014 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); }
Recommended Posts