Delgine 3D Tools & Content DeleD Community Edition
Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to get full path of a DeleD texture?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Community Edition
View previous topic :: View next topic  
Author Message
chronozphere
DeleD PRO user


Joined: 20 Jun 2006
Posts: 1010
Location: Netherlands

PostPosted: Wed Apr 01, 2009 7:15 pm    Post subject: How to get full path of a DeleD texture? Reply with quote

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
View user's profile Send private message
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5332
Location: The Netherlands

PostPosted: Wed Apr 01, 2009 8:27 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
chronozphere
DeleD PRO user


Joined: 20 Jun 2006
Posts: 1010
Location: Netherlands

PostPosted: Wed Apr 01, 2009 10:50 pm    Post subject: Reply with quote

Okay... Thanks. Smile

It would be nice to have a <TextureDirectory/> tag for this. Smile It might be worth adding more "Options" that should be accessible for the plugin.
Back to top
View user's profile Send private message
vgo
DeleD PRO user


Joined: 19 Jan 2007
Posts: 28
Location: Finland

PostPosted: Fri Apr 03, 2009 8:39 pm    Post subject: Reply with quote

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;


Wink
Back to top
View user's profile Send private message
chronozphere
DeleD PRO user


Joined: 20 Jun 2006
Posts: 1010
Location: Netherlands

PostPosted: Fri Apr 03, 2009 10:23 pm    Post subject: Reply with quote

Okay.. Thanks for the snippet. Smile
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Community Edition All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum