snow_zhangy Posted June 8, 2014 Share Posted June 8, 2014 I can get the user selection from the editor. but how could i make a selection from the script in editor? thanks Link to comment
snow_zhangy Posted June 10, 2014 Author Share Posted June 10, 2014 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
silent Posted June 10, 2014 Share Posted June 10, 2014 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: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
snow_zhangy Posted June 10, 2014 Author Share Posted June 10, 2014 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
silent Posted June 11, 2014 Share Posted June 11, 2014 Hi, Thank you for detailed description. Please, check the node handling algorithms (like selecting, reselecting and etc.) inside data/core/editor/editor_nodes.h. I belive you can reuse parts of that code in your plugin. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
oliver.markowski Posted July 22, 2014 Share Posted July 22, 2014 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
azagniy Posted July 23, 2014 Share Posted July 23, 2014 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
Recommended Posts