christian.wolf2 Posted June 19, 2017 Posted June 19, 2017 Hi, I am currently working on an Unigine plugin and therefor need a proper handling with nodes. As your tutorials described, there are nodeInit(), nodeUpdate() and nodeShutdown() as basic callback function. Currently, on selecting an existing node, the nodeInit() and nodeUpdate() function will be called immediately, but after that, I got no feedback (I expected that when the node is rotated/transformed/scaled, that the nodeUpdate() will be called again). Same thing, when I deselect node. The nodeShutdown() function will be called three times. So my question is, what is a good way to work with the existing functionalities? Do I have to check in update, if the selected node has changed? And how do I check, if a node is deselected or destroyed, when nodeShutdown() will be called in both cases? Thanks in advance.
silent Posted June 26, 2017 Posted June 26, 2017 christian.wolf2 You can start watching your selected node in nodeInit(). Inside your plugin's update() manually check if node is modified somehow. inside nodeShutdown() forget selected node. Please, don't forget to check the following plugins source code as well: NodeExport, MeshCombiner. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
christian.wolf2 Posted June 26, 2017 Author Posted June 26, 2017 Hi silent, thanks for the answer. To track, if a node is updated, your approach sounds reasonable for me. Thanks! But how do I keep track, if the selected node is removed from the scene? Cheers
silent Posted June 27, 2017 Posted June 27, 2017 You can use editor method engine.editor.isNode(Node n) and just delete node if it no longer exists in Editor scope. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Recommended Posts