View previous topic :: View next topic |
Author |
Message |
chronozphere DeleD PRO user
Joined: 20 Jun 2006 Posts: 1010 Location: Netherlands
|
Posted: Wed Apr 01, 2009 7:15 pm Post subject: How to get full path of a DeleD texture? |
|
|
Hey people
I'm working on a plugin and i need to determine the full path of a texture.
As far as i know, the DXS fileformat is the same as the XML format used to let the plugin communicate with DeleD. When I open some DXS file, i see this:
Code: |
<category name="System">
<material id="0" name="system" used="true" lightmap="true" castShadows="true" receiveShadows="true">
<layer type="texture" blend="replace">
<texture file="System\system.bmp" />
</layer>
</material>
</category>
|
System\system.bmp is not a full path. It's relative to the Texture directory. Is there any way to make my plugin retrieve the texture directory?
I recall that it was possible to retrieve the installation directory by doing something like this (correct me if i'm wrong):
Code: |
<request><InstallDir><request/>
|
Wouldn't it be nice to retrieve other directories in a similair way? |
|
Back to top |
|
|
Jeroen Site Admin
Joined: 07 Aug 2004 Posts: 5332 Location: The Netherlands
|
Posted: Wed Apr 01, 2009 8:27 pm Post subject: |
|
|
The exact code would be:
Code: |
<request>
<installdirectory />
</request> |
The textures usually reside in a directory called Textures, but you can't assume this is always the case as the user can change that. Retrieving the exact texture directory from the INI file seems like the way to go. That's not supported by the current plugin architecture though. _________________ Check out Figuro, our online 3D app! More powerful 3D tools for free. |
|
Back to top |
|
|
chronozphere DeleD PRO user
Joined: 20 Jun 2006 Posts: 1010 Location: Netherlands
|
Posted: Wed Apr 01, 2009 10:50 pm Post subject: |
|
|
Okay... Thanks.
It would be nice to have a <TextureDirectory/> tag for this. It might be worth adding more "Options" that should be accessible for the plugin. |
|
Back to top |
|
|
vgo DeleD PRO user
Joined: 19 Jan 2007 Posts: 28 Location: Finland
|
Posted: Fri Apr 03, 2009 8:39 pm Post subject: |
|
|
It's easy enough to read all the stuff from the ini file, that's what I do:
Code: |
var
Ini: TIniFile;
begin
Ini := TIniFile.Create(InstallDir + 'deled.ini');
TexturePath := Ini.ReadString('Dirs', 'texturefiles', '');
Ini.Free.
end;
|
|
|
Back to top |
|
|
chronozphere DeleD PRO user
Joined: 20 Jun 2006 Posts: 1010 Location: Netherlands
|
Posted: Fri Apr 03, 2009 10:23 pm Post subject: |
|
|
Okay.. Thanks for the snippet. |
|
Back to top |
|
|
|