Relative Path's with ASE loader

Hi
To what point do I have to set Paths in ASE-Files relative to? To the working directory, to the ASEFile, or to the classpath? Assuming this is possible, because my 3dsmax simply created an absolute path which is complete garbage to use.

The ASE Loader currently just searches for the filename (no path) in the old Texture loader. Any paths registered with the texture loader will be searched.

i.e., if you have “C:/Models/Foo/Bar/texture.jpg” in the ASE file, the loader will only query TextureLoader for “texture.jpg”.

Does that answer your question?

Cheers,

Will.

Ok I believe I understand that now: Because I haven’t registered any Path’s it only starts at the root of the filesystem.

[quote]i.e., if you have “C:/Models/Foo/Bar/texture.jpg” in the ASE file, the loader will only query TextureLoader for “texture.jpg”.
[/quote]
Nope: It will query “C:/Models/Foo/Bar/texture.jpg” which is exactly the problem because it’s an absolute Filepath (maybe it does differently, when there are Path registered - I think It’s worth a try :).

Looking at the source, it appears the assumption was made (by me) that there will only be Windows Backslashes.


tnameFileOnly = tname.substring(tname.lastIndexOf("\\") + 1);

Do you actually have forward slashes in your files? Don’t tell me you got MAX working under linux? :wink:

Will.

MAX isn’t the only program to export in ASE… :wink:
You can use File.separator constant for te code, so it will be cross-platform. (But I guess you know that)

Ah yes, that normally works, but – the file could be created on one OS, and loaded on another (which is exactly the case with MAX exported files on linux/osx).

As an aside: I’m interested what software do you use to export ASE?

Will.

I was using the ASE files which I created with 3dsmax (when I was using windows)

@bluesky: File.seperator works only when I create Paths not when I want to load one :wink: