Jump to content

getReference() for NodeReference from another .world return NULL


photo

Recommended Posts

I need to work with NodeReference from another .world, which was loaded in code.

    Unigine::World::get()->loadWorld("../../mission_demo_server/data/mission_demo_server.world");
    Unigine::World::get()->setAutoReloadNodeReferences(1);


I can get node by getNodeByName(), i can cast to NodeReference, but if i get getReference() for a working with nodes of this NodeReference, it will be return null adress. If i do same in project where this .world is native, it will work rigth. 

    NodeReferencePtr temp_ref = NodeReference::cast(Editor::get()->getNodeByName("triton_test"));

 	m_tnpa = temp_ref->getReference();

2.thumb.png.94f9fcada24cf643b8849b36a3477b7e.png1.thumb.png.578556b8a9a1839b00921b79f7e028cd.png

Where am I wrong?

Link to comment

Alexei,

To safely load nodes with materials from other projects you need to extend filesystem by adding mount points: https://developer.unigine.com/en/docs/2.7.2/principles/filesystem/#mount_points

In that case node will be able to load it's content by GUIDs.

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
×
×
  • Create New...