Klimczak.Jan Posted January 1, 2018 Share Posted January 1, 2018 (edited) Hi, I observed that Editor2 (SDK 2.6.1) crashes at the moment of applying edit of NodeReference by Apply button in editor in the case of using nodes from such NodeReference somewhere in UnigineScript in update function e.g.: void update() { ... nodeFromReference.getWorldPosition(); ... } Here nodeFromReference is not nulled at this time so I can't prevent it. As I see is a Editor issue. Edited January 1, 2018 by Klimczak.Jan Link to comment
grmmvv Posted January 9, 2018 Share Posted January 9, 2018 Hi, Unfortunately, I can't reproduce your issue. When I using nodes from NodeReference in UnigineScript, Editor 2 working properly. Please give us more detailed step by step description of your problem. 1 Link to comment
Klimczak.Jan Posted January 9, 2018 Author Share Posted January 9, 2018 15 hours ago, grmmvv said: Hi, Unfortunately, I can't reproduce your issue. When I using nodes from NodeReference in UnigineScript, Editor 2 working properly. Please give us more detailed step by step description of your problem. Hi, As I see the problem is not obvious. It's happens in more advanced scenarios. That's why I send you a PM with a project where you can replicate the problem. It is not happens every time as you do: 1. Open GalacticTanks world, 2. Select "czolg_1" reference node, 3. Click "Edit" button in Reference part of the Parameters node, 4. Then edit reference or just click "Apply" button to save reference node, This sometimes crashes Editor2, if not you can then repeat 4 and 5 steps a few times until it will crash Editor2. Here is other possibility to crash Editor2 like that: 1. Open GalacticTanks world, 2. Select "czolg_1" reference node, 3. Click "Edit" button in Reference part of the Parameters node, 4. Then edit reference or just click "Apply" button to save reference node, 5. Reload world. This will crash Editor2 each time (after clicking Yes or No for question about saving changes). Sometime you can just select an node in World list or in the scene instead a reloading world to crash Editor2. Link to comment
grmmvv Posted January 15, 2018 Share Posted January 15, 2018 Hi, Thank you for detailed description and test project. I've successfully reproduce both cases and added it in our internal bug tracker. There is problems in joints that you create in init method and use in update method. There is two ways for a workaround: use regular node, not NodeReference; do not create joints if Editor2 is loaded, you can check that using engine.editor.isLoaded(), see docs here: https://developer.unigine.com/en/docs/2.6.1/api/library/engine/class.editor?rlang=usc#isLoaded_flag 1 Link to comment
silent Posted January 16, 2018 Share Posted January 16, 2018 Hi Jan, The actual issue is that you are forget to call class_remove() on the following line: JointWheel joint = new JointWheel(n0.getBody(), n1.getBody()); this line should look more like this: JointWheel joint = class_remove(new JointWheel(n0.getBody(), n1.getBody()));) It is required to use class_remove() for created bodies, shapes or joints to release the script ownership. Please, refer to this article about memory management: https://developer.unigine.com/en/docs/2.6.1/code/fundamentals/memory_management Thanks! 1 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
Klimczak.Jan Posted January 16, 2018 Author Share Posted January 16, 2018 On 15.01.2018 at 12:13 PM, grmmvv said: Hi, Thank you for detailed description and test project. I've successfully reproduce both cases and added it in our internal bug tracker. There is problems in joints that you create in init method and use in update method. There is two ways for a workaround: use regular node, not NodeReference; do not create joints if Editor2 is loaded, you can check that using engine.editor.isLoaded(), see docs here: https://developer.unigine.com/en/docs/2.6.1/api/library/engine/class.editor?rlang=usc#isLoaded_flag Thanks! It seems to work :) Jan Link to comment
Klimczak.Jan Posted January 16, 2018 Author Share Posted January 16, 2018 3 hours ago, silent said: Hi Jan, The actual issue is that you are forget to call class_remove() on the following line: JointWheel joint = new JointWheel(n0.getBody(), n1.getBody()); this line should look more like this: JointWheel joint = class_remove(new JointWheel(n0.getBody(), n1.getBody()));) It is required to use class_remove() for created bodies, shapes or joints to release the script ownership. Please, refer to this article about memory management: https://developer.unigine.com/en/docs/2.6.1/code/fundamentals/memory_management Thanks! Hi, You are right, that was my mistake. With class_remove() I don't see any crashes at the moment :) Link to comment
Recommended Posts