grayfox3000 Posted May 22, 2015 Share Posted May 22, 2015 On unigine version v1 this classes not using unigine virtual-fs as base for realtive paths resolving, that gives us a lot of trouble. Maybe we do something wrong? Link to comment
silent Posted May 22, 2015 Share Posted May 22, 2015 Hi Vlad, Could you please be more specific and provide several examples of your issues? Maybe, indeed, you are trying to do something wrong. 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
grayfox3000 Posted May 22, 2015 Author Share Posted May 22, 2015 Of course =) In ++ code we are adding some directories to unigine vfs system because our projects are modular. Something like this: FileSystem::addDirectory("../"); FileSystem::addDirectory("../../extern/"); FileSystem::addDirectory("../../common/"); FileSystem::addDirectory("../../groups/"); FileSystem::addDirectory(DEV_RESOURCES_DIR); And then from scripts we are trying to access files/folders by relative (i.e. omitting "../../common/data/" for example) paths. This works from resource xmls like *.node, *.mat etc, but not works from scripts/cpp. Also, editor saves all paths relative to the real-fs and we must call bash script with regexp replace "(\.\./)+[^<>:\"/\\|?*]+/data/" to fix paths all the time. =( Link to comment
silent Posted May 26, 2015 Share Posted May 26, 2015 Hi! As far as I understand, you have a lot of assets outside of data folder? For correct engine work you should keep all assets inside the data directory. If there is no such possibility, you can use extern_path command to "extend" data directory. Please, check this documentation if you are using Unigine 2.0: https://developer.unigine.com/en/docs/1.0/principles/filesystem/#data_dir For Unigine 1.0 you can use extern_directory: http://old-docs.developer.unigine.com/principles/filesystem/#data_dir You also can use multiple extern directories at once, just use comma to separate 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
grayfox3000 Posted May 26, 2015 Author Share Posted May 26, 2015 "FileSystem::addDirectory" do the same thing as extern_directory, you can look at unigine src =) Every of folder contains 'data'. Like ../data/ ../../extern/data/ ../../common/data/ ../../groups/data/ And by using unigine resource system we expect that this 'data' merge in one virtual-fs and and it happens, but with bugs that I mentioned. Link to comment
unclebob Posted May 27, 2015 Share Posted May 27, 2015 Hi Vlad! There should be no problems with using File/Xml class with virtual fs in the script as it's trying to get the file from virtual fs first. The only trouble is with Dir class, because it's based on OS API calls and doesn't know anything about virtual fs. If you have troubles with File/Xml class then please send us a minimal reproduction sample. Thanks! Link to comment
grayfox3000 Posted May 27, 2015 Author Share Posted May 27, 2015 Hi =) I understood you, we tested again File and we have no problems with it, as well as with XML. What we need to do is bypass directory and collect all XMLs. Something like this: Dir directory = new Dir(path); forloop(int i=0; directory.getNumFiles()) { string filename = basename(directory.getFileName(i)); models.append(filename); } And we want use vfs to do that. Link to comment
unclebob Posted May 27, 2015 Share Posted May 27, 2015 Vlad, There's no easy way you can traverse specific dir in virtual fs. However, you can traverse through the list of filenames which you can get via Filesystem::getFileNames call. Link to comment
grayfox3000 Posted May 28, 2015 Author Share Posted May 28, 2015 Andrey, can we request this feature for future releases? =) It's very useful when you can access vfs transparently, like, for example, in ogre3d engine or some mmo engines (wow, gw2). Thx! Link to comment
silent Posted June 1, 2015 Share Posted June 1, 2015 Hi Vlad, I've added this suggestion to our internal TODO list, thanks! But I'm afraid right now it is not a priority task for our dev team, sorry. 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