Crystal Space
Welcome, Guest. Please login or register.
October 21, 2017, 03:10:40 pm

Login with username, password and session length
Search:     Advanced search
9063 Posts in 2051 Topics by 77569 Members
Latest Member: Elzbieavijit462
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  CS relative paths
« previous next »
Pages: [1] Print
Author Topic: CS relative paths  (Read 1538 times)
Posts: 5

View Profile WWW Email
« on: July 24, 2010, 04:18:01 pm »

I modified the avatertest program from CS1.9.
It now loads my own model which I exported from blender with b2cs.
There is only one small issue with my setup.
The library file from b2cs contains links to the mesh and skeleton files.
These links are something like this:
Unfortunately the avatartest program cannot find files which are linked relatively.
When I modify the links to link to a path defined in the vfs file, it loads fine.
It loads the library file with avatarTest->loader->load(filename).

Can anyone please give me some pointers about how to make the relative file links work?
Thanks in advance,
Global Moderator
Jr. Member
Posts: 79

View Profile
« Reply #1 on: August 02, 2010, 04:03:51 pm »

avatartest does not find your relative files because it loads the data from the current VFS path, ie '/'. So, when you designate a relative path, say 'factories/myfact', it will try to find it relatively to the current path, ie in '/factories/myfact' and will fail since you meant '/data/mymesh/factories/myfact'.

That is, your files are named relatively to the directory where you put them, so you must first go to that directory in order for the system to find them.

So the solution would simply be to add something like that just before avatarTest->loader->Load():

csRef<iVFS> vfs = csQueryRegistry<iVFS> (avatarTest->GetObjectRegistry());
vfs->ChDir ("/data/mymesh");
Posts: 5

View Profile WWW Email
« Reply #2 on: August 02, 2010, 05:17:37 pm »

hmm that does make sense.
Thanks for the awnser.
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 3.84 seconds with 15 queries.