Crystal Space
Welcome, Guest. Please login or register.
April 23, 2014, 07:59:19 pm

Login with username, password and session length
Search:     Advanced search
8990 Posts in 2037 Topics by 7618 Members
Latest Member: Tymqwaro
* 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 657 times)
Joepadmiraal
Newbie
*
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:
<library>factories/skelfrankie_rig</library>
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,
Joep
Logged
kickvb
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():

Code:
csRef<iVFS> vfs = csQueryRegistry<iVFS> (avatarTest->GetObjectRegistry());
vfs->ChDir ("/data/mymesh");
Logged
Joepadmiraal
Newbie
*
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.
Logged
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.158 seconds with 15 queries.