christian.wolf2 Posted March 12, 2020 Share Posted March 12, 2020 (edited) Hi UNIGINE-Team, I don't know if it is an intented behavior but after migrating my codebase to the newest 2.10-release, I get an "unexpected" behavior from the World::getNodes()-function. During initializing the world, I iterate through all objects and add them to my custom classes. Previous, I got only that nodes, that are created in editor. Mainly the sun and default player, a static mesh and an node reference. With the new version I got 6 (?!) objects, the four above and two times the dynamic mesh inside my node reference. Unfortunately the node reference contains only one dynamic mesh, but the World::getNodes() returns the node inside my reference twice. For the .world-file everything seems to be correct, because there are only four nodes in it. Best Christian Edited March 12, 2020 by christian.wolf2 Link to comment
silent Posted March 12, 2020 Share Posted March 12, 2020 Hi Сhristian, AFAIK, World::getNodes() always returned all the nodes (including cached one, internals of node references and so on). If you want only the root ones, you can try to use World::getRootNodes() instead: https://developer.unigine.com/en/docs/2.10/api/library/engine/class.world?rlang=cpp#getRootNodes_VECNode_void 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
christian.wolf2 Posted March 12, 2020 Author Share Posted March 12, 2020 Hi silent, many thanks for the quick reply. Indeed, getRootNodes() does the trick on my site. It was not clear for me by reading the API-documentation about that one. Thanks! Link to comment
silent Posted March 12, 2020 Share Posted March 12, 2020 We'll see how we can clarify the difference between these two methods in the documentation. Thanks for the feedback :) 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
Recommended Posts