ataylor Posted July 13, 2016 Share Posted July 13, 2016 I have a custom class which loads a .node and grabs an ObjectMeshStaticPtr using the following: Unigine::NodePtr myNode = Unigine::World::get()->loadNode(nodePath, 0); Unigine::Editor::get()->addNode(myNode); ObjectMeshStaticPtr myMesh = Unigine::ObjectMeshStatic::create(myNode); The node in 'nodePath' references a .mesh file on disk. The node is displayed in the world as expected, and the transforms of all myMesh's surfaces are altered every update() tick based on user input or from a data stream on disk. This all mostly works... The issue arises when I try to instantiate multiple instances of my class that are loading the same node file on disk. When this happens, modifying the surface transforms of myMesh in any one class instance seems to also affect myMesh in all other instances of my class that loaded the same node file. If my class instances load different node files, there is no problem and the meshes can be updated independently. I need to be able to modify each mesh independently regardless of whether the .node or .mesh is shared. How can I achieve this? Link to comment
ataylor Posted July 13, 2016 Author Share Posted July 13, 2016 It looks like the solution is to call this after myMesh creation: myMesh->createMesh(myMesh->getMeshName(), 1); Link to comment
silent Posted July 14, 2016 Share Posted July 14, 2016 Hi Adam, Yep, it's right solution for that task :) 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