Jump to content

[SOLVED] how to select nodes in script


photo

Recommended Posts

Hi Natlia:

 

in the editor when user select some nodes. they can save the selection and after they lost the slelection they can reselect those nodes by a single button.

Thanks

Link to comment

Hi,

 

Sorry, still can't understand the use case.

 

Could you please describe in more details (or provide simple step-by-step guide) of what you want to achieve. User can select nodes in node window and remove focus from selected nodes only when reselecting other nodes or pressing the space button.

 

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

hi Silent:

    Here is the step for what i need to do in my editor plugin:

1: in my unigine script i create 2 buttons. one for "save" user selection one for "load" user selection

2: user open unigine and load the unigine editor then load my editor plugin. he saw the 2 button

3: user put some meshes in to the editor. lets say he put 4 meshes. A,B,C and D

4: user select A and B in editor , and click "save" selection button, the A,B selection is got by "nodesGetNodes(nodes);" Very easy.

5: user select C and D and do something. 

6: now user want to reselect A and B, but instead of select A and B manually, he can just click "load" selection button and  A and B will be reselected automatically.

my issue is that i can't select A and B in unigine script. i tried to call "nodesSelect" but doesn't seam to work.

 

if you familiar with 3dsmax, there is such feature in max.

I need this when user select lots of objects and don't have to select them again and again.

Link to comment
  • 1 month later...

Hi,

 

we also need to be able to select a node in the Editor via Script.

I looked into the editor_nodes.h, but... it is rather confusing and I do not see how I would select a Node.

 

We have a list of Nodes:

Node nodes[0];

and want those to be selected in the Editor - how? :)

 

 

Cheers.

Link to comment

Hi Oliver. You can use a "nodesSelectNew(Node node,int toggle)" function to select your node in a editor. Make sure that editor knows about this node.

if(engine.editor.isNode(my_node)) nodesSelectNew(my_node,1);

Also you can use this function for multiselection like this:

Node new_selection[0];

// your code
// ...
// ...
// ...
// something else

forloop(int i = 0; new_selection.size()) {
	nodesSelectNew(new_selection[i],1);
}
Link to comment
×
×
  • Create New...