Truncation of Texture Names?

Started by PabloMack, November 24, 2014, 09:53:09 PM

Previous topic - Next topic

PabloMack

A few months ago I was having trouble with getting textures on OBJ objects imported into Terragen. Tonight it seems that part of the problem may have been that surface names seem to get truncated in Terragen to about 19~20 characters long. A model I downloaded from a website has long surface names where the first so many characters are the same. An example is that there are two surfaces, one with the name "initialShadingGroup" and another with the name "initialShadingGroup_Smoothing". When loading and rendering the scene I got errors that there was a conflict with two textures being assigned the same surface name or some such thing. The surface name in the error was "initialShadingGroup". When I renamed the surface "initialShadingGroup_Smoothing" to "initialShadingGroupS" the error went away. Instead of having a fixed length for surface names, the problem may have something to do with the second underscore in a surface name as I saw another pair of similar surface names and the longer one also seemed to be truncated before the second underscore leaving two names shorter than the first example I gave. Strange...

Oshyan

Are you talking about actual *file names* (on disk, in the file system), or *node names*, or something else? If you're referring to file names, are the files you're referencing deep in some other directory structure? Are you on Windows or Mac?

- Oshyan

PabloMack

#2
[Read my following post. The problem is in Lightwave, not Terragen. ]

I edited my previous post because I was writing "texture name" instead of "surface name" which are not the same thing. Sorry for my confusing terminology.

I am not talking about file names. I'm talking about surface names within objects. When polygons are surfaced with image patterns, there is a name associated with the surface. It is these surface names that I suspect are possibly being truncated or too many underscores in the surface names may be causing them to be truncated. Specifically, in the mtl file that comes with an obj, each surface is defined with a number of lines of code. In the example below, the surface named "Concrete-X" is associated with an image in the file "E:/Clients/LenScape/Family/House/Concrete.jpg" and is applied to polygons associated with that surface name. I presume the intervening lines of code describe the surface's various parameters like reflection, transparency etc. and even color when there is no image file associated with the surface.

newmtl Concrete-X
Kd 0.784314 0.784314 0.784314
Ke 0 0 0
Ka 1 1 1
Ks 0 0 0
Ns 400
Tr 0
d 1
Ni 1
Tf 1 1 1
map_Kd E:/Clients/LenScape/Family/House/Concrete.jpg

As for the problem, I think that the surface names "initialShadingGroup" and "initialShadingGroup_Smoothing" were truncated to "initialShadingGroup" so that TG thought that two different surfaces were being assigned the same name. When I rename "initialShadingGroup_Smoothing" to "initialShadingGroupS" the error went away.

PabloMack

Uh...oh..... It is Lightwave truncating the names, not Terragen. This causes two surfaces to be defined with the same name. I renamed the surfaces in Lightwave, not in the mtl file. Sorry for my mistake. I think I know what is going on now. I need to shorten the surface names in Lightwave before I start the process of creating an obj file. If I do that then a whole lot of errors go away for some models with long surface names.

Oshyan

Oh, good to know. I was going to say, I don't know what's going on then, hehe. Lightwave's OBJ support is not awesome, unfortunately.

- Oshyan