irrlicht 1.5 saving absolute paths of textures to irr scene

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

irrlicht 1.5 saving absolute paths of textures to irr scene

Post by pera »

irrlicht 1.5 saving absolute paths of textures to irr scene file like this:
<texture name="Texture1" value="c:\documents and settings\f\my documents\race\le\media\gameobjects\monsters\beast1.png" />

is this known issue?
any fix?
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

yes, its a known bug. Fixes:
1. write a little postprocess tool which replaces the paths
2. replace them manually
3. revert the NullDriver to the old version which does not use absolute paths
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

4. use my IrrExtensions (I made a patch so it saves relative pathes) !!! 8)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

Post by pera »

I tried to figure out how NullDriver is getting that path, to make local change, but was lost somewhere around attr->addTexture("Texture1", material->getTexture(0));
Seems like ITexture is holding the full path somewhere.

to Acki: checking IrrExtensions now...
your FAQ page contains only questions... well no one said they are "frequently answered questions".
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

Take a look at SVN revision 1673. But to be honest, this fix is completly correct. I guess you should check ackis extension or write a own patch, which you can add to the patch tracker. Maybe it will be accepted and integrated.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

pera wrote:your FAQ page contains only questions...
no, just click on a question and you'll get the answer... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
mc08
Posts: 25
Joined: Thu Aug 07, 2008 9:49 am

Post by mc08 »

I can't click them either :P
FuzzYspo0N
Posts: 914
Joined: Fri Aug 03, 2007 12:43 pm
Location: South Africa
Contact:

Post by FuzzYspo0N »

Is this a known issue in irrEDIT or irrlicht? thats totally random that that was not fixe long ago, its really a stupid bug to leave in the engine :P
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

mc08 wrote:I can't click them either :P
I'll have a look at it, seems something was changed... :oops:
Last edited by Acki on Tue May 12, 2009 6:55 pm, edited 1 time in total.
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

Its not a bug. I makes all texturepaths absolut during the loadprocess. The serialisationsystem just save these paths. Only proper way to "fix" this in the engine is to add a parameter to the save- and loadmethods with a workingpath to refer to.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Acki wrote:
mc08 wrote:I can't click them either :P
I'll have a look at it, seems something was changed... :oops:
I'm not sure what happened to this page, but now it works again... ;)
thx for the bug report !!! :lol:
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
FuzzYspo0N
Posts: 914
Joined: Fri Aug 03, 2007 12:43 pm
Location: South Africa
Contact:

Post by FuzzYspo0N »

ah i see now, thanks nox. absolute paths, not THIS absolute path :P
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

Post by pera »

what do you mean its not a bug?

path to model is saved as relative path few lines above, and texture is saved as absolute path.

if i move map to another computer its not going to work for texture,
if I move map to another folder on the same computer its not going to work for model.

its totally scr**d. :D

I hope you'll revert it to relative paths soon. It worked like that in 1.4.2
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

Well. Just think about the following situation:
- 2 images. ./graphics/test.png and ./test.png
- call getTexture("test.png") -> ./test.png will be loaded (if the workingdir was not changed)
-change the workingdir to ./graphics
- call getTexture("test.png") -> the engine looks into it caches, sees that there is already a test.png and return the wrong texture!

So the engine uses absolut paths for textures now. That makes the trouble with the saving.
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

Post by pera »

can texture have two member fields?

absolutePath
relativePath

one used for saving and the other for cash check?
Post Reply