Amerio.Stephane Posted March 17, 2023 Posted March 17, 2023 (edited) Hi, I just noticed the IG component WaterClamp can be executed from within the Editor. How is this done? Can we get the source for this? I found about this the hard way, because if you select "Forced" clamp without setting the clamp nodes, then the component crashes and brings down the Editor with it. Edited March 17, 2023 by Amerio.Stephane
bmyagkov Posted March 17, 2023 Posted March 17, 2023 Hello! The "IGEditorPlugin" plugin is mainly an experimental feature that allows IG to be used within the Unigine Editor. We are currently exploring its usefulness and demand among users. However, as its status is uncertain we advise against using it for production purposes. It may not function properly at this time. Quote Can we get the source for this? You can locate the source code for an algorithm that is almost identical in the "CPP Sample" demo by following this path: "cpp_sample/source/water_buoy/BuoyComponent". It is important to note that if you do not set clamp nodes it may also crash. This behavior is to be expected and might be improved later. Thanks!
Amerio.Stephane Posted March 17, 2023 Author Posted March 17, 2023 I think that having the possibility to run Component directly within the editor is absolutely a must-have, even if some restriction could be applied (eg. creation or deletion of nodes could be disabled). We have a lot of uses cases that we currently cannot fully exploit because Components don't run in the editor, and using deprecated/unsupported UnigineScript is not always possible or usable: scripted animation (tracking, camera wobble, controlled particles emission) film making with Tracker, but we have to redo all animation by hand because .. no component is running changing properties inside editor with context (eg: an intersection mask modified depending on the position of the node) 38 minutes ago, bmyagkov said: Can we get the source for this? I was mainly concerned about how to correctly run a component both in editor and in runtime, not this specific WaterClamp code. 36 minutes ago, bmyagkov said: This behavior is to be expected Hum, I would say a crash is NEVER to be expected, especially when dealing with user-specified data. You should always ensure an invalid data is taken care of correctly, with no crash at the end.
bmyagkov Posted March 17, 2023 Posted March 17, 2023 32 minutes ago, Amerio.Stephane said: Hum, I would say a crash is NEVER to be expected, especially when dealing with user-specified data. You should always ensure an invalid data is taken care of correctly, with no crash at the end. I apologize for any confusion caused. What I intended to convey is that while fixing the crash is important, specifying the nodes for the clamp operation is also necessary :)
cash-metall Posted March 20, 2023 Posted March 20, 2023 if your want to make some logic for editor - look at UnigineEditor plugins and Editor API https://developer.unigine.com/en/docs/latest/editor2/extensions/?rlang=cpp https://developer.unigine.com/en/docs/2.16.1/api/editor/index.html you can also use the Component System inside EditorPlugin, but you have more options for accessing the editor - selection, focus, widgets. Of course, there are many limitations to how components work in the editor. because the editor does not know anything about your logic and is not ready for any intervention. - deleting nodes can be dangerous (if selected in the editor) - work inside noreference (editor hides some noreferences/caches that actually exist and there are no way to recognaze witch node is the original) - when the editor deletes a node - it actually just hides and continues to exist (for undo/redo mechanizm). and if there is a component there, it will also continue to work. 2
Recommended Posts