LDraw.org Discussion Forums

Full Version: Subpart texture file path
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
There are no subpart textures on the PT right now (or in the official library) but I'd like to figure this out before it becomes an issue. I think the way the PT is handling subpart textures is wrong.

The UI on the PT submit page lists "\parts\s\textures" as the subpart texture file path

However the !TEXMAP spec states "a search for the specified texture file will first be attempted after adding a "textures\" prefix to the filename". By my reading this means subpart textures files should be in "parts\textures\s".
(2020-07-02, 3:10)Orion Pobursky Wrote: [ -> ]There are no subpart textures on the PT right now (or in the official library) but I'd like to figure this out before it becomes an issue. I think the way the PT is handling subpart textures is wrong.

The UI on the PT submit page lists "\parts\s\textures" as the subpart texture file path

However the !TEXMAP spec states "a search for the specified texture file will first be attempted after adding a "textures\" prefix to the filename". By my reading this means subpart textures files should be in "parts\textures\s".

Really? I am sure I based the Parts Tracker implementation on an example, but to my mind adding a prefix to the filename (not the filepath), gives:
  • A texmap for parts/1234.dat in parts/textures/1234.png.
  • A texmap for parts/s/1234s01.dat in parts/s/textures/1234s01.png.
  • A texmap for p/logo.dat in p/textures/logo.png.
I think it is more logical that the texture .png file is in a subfolder of its parent .dat file. But if what you describe is how tools have interpreted the spec then I'll change the Parts Tracker.
This is interesting as I initially understood the structure to be:


- parts
 - parts/s
- p
 - p/48
 - p/8
- textures



And all textures would be lumped into the one separate folder. 

It would be nice with an example file structure in the spec so that we all have the same understanding.
(2020-07-02, 3:10)Orion Pobursky Wrote: [ -> ]There are no subpart textures on the PT right now (or in the official library) but I'd like to figure this out before it becomes an issue. I think the way the PT is handling subpart textures is wrong.

The UI on the PT submit page lists "\parts\s\textures" as the subpart texture file path

However the !TEXMAP spec states "a search for the specified texture file will first be attempted after adding a "textures\" prefix to the filename". By my reading this means subpart textures files should be in "parts\textures\s".

To be honest, I'm not entirely sure what the original intent was. Looking at my actual code in LDView, I put "textures/" before the "filename" referenced in the part. In this case, the "filename" would be something like "s\whatever.png", so LDView would indeed look in "parts\textures\s\whatever.png".

I'm open for debate on what the proper behavior should be. Also, whatever the decision, we should clarify the !TEXMAP spec.
(2020-07-02, 3:10)Orion Pobursky Wrote: [ -> ]There are no subpart textures on the PT right now (or in the official library) but I'd like to figure this out before it becomes an issue. I think the way the PT is handling subpart textures is wrong.

The UI on the PT submit page lists "\parts\s\textures" as the subpart texture file path

However the !TEXMAP spec states "a search for the specified texture file will first be attempted after adding a "textures\" prefix to the filename". By my reading this means subpart textures files should be in "parts\textures\s".

I always considered the type 1 string a reference not a filename.

So "1 ....... s\123.dat" translates into

Reference s\123.dat
fileName: 123.dat
path: d:\ldraw\parts\s\123.dat

then it will search for s\123.dat in

1 the mpd if any
2 same folder as the containing file
3 library parts
4 library p

Once 123.dat has been found a texture used in that file will be searched for in

1 the mpd if any
2 same folder (as the .dat) \textures
3 library parts\textures
4 library p\textures
5 same folder
6 library parts
7 library p

This means if a texture meta references s\123.png it will look for

<mpd>s\123.png
<folder>\textures\s\123.png
d:\ldraw\parts\textures\s\123.png
d:\ldraw\p\textures\s\123.png
<folder>\s\123.png
d:\ldraw\parts\s\123.png
d:\ldraw\p\s\123.png

So in short, it should be a prefix to the reference used in the texture meta.

It might be good practice to just always use 123.png without 's' in the meta's.

side note:  this makes me wonder if <mpd>\textures\s\123.png should be checked too.
(2020-07-02, 3:10)Orion Pobursky Wrote: [ -> ]There are no subpart textures on the PT right now (or in the official library) but I'd like to figure this out before it becomes an issue. I think the way the PT is handling subpart textures is wrong.

The UI on the PT submit page lists "\parts\s\textures" as the subpart texture file path

However the !TEXMAP spec states "a search for the specified texture file will first be attempted after adding a "textures\" prefix to the filename". By my reading this means subpart textures files should be in "parts\textures\s".

I'm writing the proposed change to the spec. Is the consensus that texture should be appended to the name as specified in the Name: META (e.g. s/123.dat would search parts/textures/s/123.png)?
(2020-07-21, 15:32)Orion Pobursky Wrote: [ -> ]I'm writing the proposed change to the spec. Is the consensus that texture should be appended to the name as specified in the Name: META (e.g. s/123.dat would search parts/textures/s/123.dat)?
I always thought it was supposed to work that way...
(2020-07-21, 15:32)Orion Pobursky Wrote: [ -> ]I'm writing the proposed change to the spec. Is the consensus that texture should be appended to the name as specified in the Name: META (e.g. s/123.dat would search parts/textures/s/123.dat)?

Hm...
Don't you mean " s/123.dat would search parts/textures/s/123.png "?
(2020-07-21, 19:29)Magnus Forsberg Wrote: [ -> ]Hm...
Don't you mean " s/123.dat would search parts/textures/s/123.png "?
Yes. Copy and paste. Grr.
(2020-07-21, 15:32)Orion Pobursky Wrote: [ -> ]I'm writing the proposed change to the spec. Is the consensus that texture should be appended to the name as specified in the Name: META (e.g. s/123.dat would search parts/textures/s/123.png)?

Just to be clear here, when s/123.dat references a texture, it needs to do so using s/123.png as the texture name (just like s/123.dat would use s/123a.dat to reference a separate subpart). Given that, then parts/textures/s/123.png would be where the texture file would go.
Pages: 1 2