Vladimir_tyutenkov Posted September 11, 2019 Share Posted September 11, 2019 C ++ api, plugin for the editor, how to determine that the world and all its objects are loaded and ready to work methods like World :: get () -> Isloaded () do not work Link to comment
morbid Posted September 11, 2019 Share Posted September 11, 2019 Hello Vladimir, Still don't understand what do you mean by plugin for the editor. You've made engine plugin and loaded it with the Editor, am I right? 1 hour ago, Vladimir_tyutenkov said: how to determine that the world and all its objects are loaded and ready to work Could you specify what do mean by "ready to work"? All objects are loaded in AppWorldLogic::init and you can work with them. 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
Vladimir_tyutenkov Posted September 11, 2019 Author Share Posted September 11, 2019 yes, I created a plugin for a project that loads with it and works with the logic of the editor class Plugin_Logic : public Unigine::EditorLogic{ //editor virtual int init () override; virtual int update () override; virtual int shutdown() override { return 1; } //world virtual int worldInit () override; virtual int worldShutdown() override; virtual int worldSave() override; ... } class Plugin_ : public Unigine::Plugin { public: Plugin_() {} ~Plugin_() {} virtual int init () override; virtual int shutdown() override; virtual void update () override {} private: Plugin_Logic m_editor_logic; }; I get information about the objects loaded in the editor through the overloaded methods, as I understand it in the editor, objects are loaded into several streams and getting a link to the object node after loading the world does not mean that the object is fully loaded and in the right position. in my case there is a world in which there is a landscape object after loading the world in the editor, the plug-in connected to the editor - downloads objects and arranges them on the surface of the ladscape at the time of the arrangement of the objects, the Landscaping node is in the editor, but it is apparently not loaded to the end. I define the loading of the world in the overloaded Unigine :: EditorLogic :: update method and then I get access to the editor nodes auto _world= World::get(); if(_world) if (_world->isLoaded() == 1) { m_terrain_gl_node = ObjectTerrainGlobal :: cast (Editor :: get () -> getNodeByName ("Landscape")); } but the received nodes , immediately after loading, are not completely ready for work, the editor some time later loads them Link to comment
morbid Posted September 11, 2019 Share Posted September 11, 2019 37 minutes ago, Vladimir_tyutenkov said: in my case there is a world in which there is a landscape object after loading the world in the editor, the plug-in connected to the editor - downloads objects and arranges them on the surface of the ladscape at the time of the arrangement of the objects, the Landscaping node is in the editor, but it is apparently not loaded to the end. As I understood the issue is in scattering objects over terrain. Terrain Global never fully loaded, it's always streamed. However, you can use force intersection flag to place some object in the not rendered terrain area: https://developer.unigine.com/en/docs/2.9/api/library/objects/class.objectterrainglobal#setForceIntersection_int_void Please, provide more info if I misunderstood you. 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
Vladimir_tyutenkov Posted September 11, 2019 Author Share Posted September 11, 2019 yes all right with setForceIntersection method everything worked Link to comment
Recommended Posts