karim.salama Posted December 6, 2021 Posted December 6, 2021 Hi, When you click on Create -> Node -> Reference, you get a dialog as shown bellow to select a .node file. Can a dialog like this be shown using the editor's API in C++? Thanks
silent Posted December 7, 2021 Posted December 7, 2021 Hi Karim, We think that we would expose this functionality into the Editor's API in 2.15 release (it's not yet available in beta). Thanks! 1 How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
victor Posted December 7, 2021 Posted December 7, 2021 Hello Karim, There are examples of API using. E.g. how to open a dialog to browse one asset: #include <editor/AssetDialogs.h> auto callback = MakeCallback([](const ::Editor::AssetDialogs::SelectedAsset &s) { Log::message("asset: %s, runtime: %s, asset path: %asset\n", s.asset_guid.getString(), s.runtime_guid.getString(), s.asset_guid.getFileSystemString()); }); ::Editor::AssetDialogs::browseAsset(callback, "Select Node or Mesh", ".node.mesh", "some/existed/my.node"); How to open a dialog to browse a lot of assets: auto callback = MakeCallback([](const Vector<::Editor::AssetDialogs::SelectedAsset> &vec) { for (const ::Editor::AssetDialogs::SelectedAsset &s : vec) { Log::message("asset: %s, runtime: %s, asset path: %asset\n", s.asset_guid.getString(), a.runtime_guid.getString(), s.asset_guid.getFileSystemString()); } }); ::Editor::AssetDialogs::browseAssetList(callback, "Select Nodes and Meshes and Material Graphs", ".node.mesh.mgraph", "some/existed/my.mesh"); How to open a dialog to choose a path for saving a new asset: auto callback = Unigine::MakeCallback([](const char *s) { Log::message("New path: %s\n", s); }); ::Editor::AssetDialogs::saveAsset(callback, "Save My Asset", ".node.mesh", "demos/oil_platform"); 1
Recommended Posts