Pierre_Bultingaire Posted June 3, 2022 Share Posted June 3, 2022 Hi (again), In my project, during runtime I'm loading a world containing objects like sun, then also during runtime I'm creating dynamically a mountPoint with the functions addBlobFile and createMount. Then i'm adding in the world a node that is in my mountPoint. Everything seems to be loaded correctly, my paths for the mountPoint are good but when the simulation start there isn't the node I added from the mountPoint. Instead I have this type of errors : I'm sure this has something to do with this error, do you have any suggestion? Thanks! Pierre Link to comment
silent Posted June 6, 2022 Share Posted June 6, 2022 Hi Pierre, Could you please prepare a minimal test scene with only couple of nodes and send it to us so we can also reproduce the same behavior on our side? 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
Pierre_Bultingaire Posted June 7, 2022 Author Share Posted June 7, 2022 Hi Silent, Here is a .zip with 3 minimal unigine project to reproduce my problem. The project "test_mout" is the main project that you have to launch. The project "test_mount2" is a project included in the first one thanks to a .umount file. The project "test_mount3" is the project that I dynamically include during runtime with a mountPoint created in the code. In fact I don't have the same error, but the same result. For both case I have a node containing a mesh with a custom material, but the node from the the dynamic mountPoint doesn't appear. Note : In "test_mount3" the custom material doesn't seem to be loaded (the purple cylinder is not visible) Thanks! Pierre test_mount.zip Link to comment
silent Posted June 8, 2022 Share Posted June 8, 2022 Thanks for the test scene (I've deleted it from thread so it would not waste space in forum backups). Our devs already looking into it and will reply back as soon as possible. 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
victor Posted June 8, 2022 Share Posted June 8, 2022 Hello Pierre, I have modified your code and now it works. When you create dynamically a mount point during runtime, materials or properties are not added automatically from this new mount point, how it happens on the launch. In this case you need to do it yourself. You should load materials before nodes loading. int AppWorldLogic::init() { //// Add Node from Mount 2 std::string path2 = "test_mount2/node_mount2.node"; Unigine::NodeReferencePtr newRef2 = Unigine::NodeReference::create(path2.c_str()); newRef2->setPosition(Unigine::Math::Vec3(-3.0f, -3.0f, 0.0f)); newRef2->setOwner(false); //// Load Mount 3 auto absolute_path = std::string(Unigine::Engine::get()->getDataPath()) + "../../test_mount3/data/"; auto blob = Unigine::FileSystem::addBlobFile("test_mount3.umount"); auto mount = Unigine::FileSystem::createMount(absolute_path.c_str(), "test_mount3", Unigine::FileSystemMount::ACCESS_READONLY); mount->setOwner(false); //// Add Material from Mount 3 auto mat = Unigine::Materials::loadMaterial("test_mount3/Materials/mesh_base_0.mat"); assert(mat); //// Add Node from Mount 3 std::string path3 = "test_mount3/node_mount3.node"; Unigine::NodeReferencePtr newRef3 = Unigine::NodeReference::create(path3.c_str()); newRef2->setPosition(Unigine::Math::Vec3(3.0f, 3.0f, 0.0f)); newRef3->setOwner(false); return 1; } 1 Link to comment
Recommended Posts