Textures not found when exporting from Cinema 4D
So I made some models in Cinema 4D and exported as .obj, brought into jitter, everything is fine model-wise but Jitter can't find the textures. I had thought they were embedded in the .obj but obviously not. I also tried saving the textures that I used, but they are in Cinema 4D format, not some kind of texture format, which seemed strange. So Jitter claims it can't use them either.
There's no export options that help, either, at least for the .obj filetype (some of the others have "include textures" etc. with them, but not this one).
Anyone have any ideas of how to get this working? Even if you don't use Cinema 4D, maybe similar issues happen with other programs, I'd like to hear what worked. Thanks!
--CJ
can't help you much with cinema4d specifically, but i can tell you what you need to render textures with gl.model.
if you look in max folder/patches/media/models there are some examples of the files you need. look in the apples folder. in addition to the readme, there are some image files and two text files (.mtl and .obj). the obj file you know, the .mtl file is the material file. if you open the obj file with textedit or notepad, you can see that it references a apple.mtl. if you open apple.mtl file, you can see that it references two image texture files.
if you look further down the apple.obj, you will see the lines preceded with vt, which refer to texture coordinates. if your model doesn't have texture coordinates, it won't be able to display automatic textures.
these are the things you need to have in order to display textures with gl.model. you should google how to export mtl material files from cinema4d (of if it's even possible). you should also google the mtl format, because it might be something you can figure out and write yourself.
hth.
-rob
The textures are referenced by the OBJ in the .mtl file, which should
have been specified in the mtl file.
the mtl file is a plaintext file.
Open it up and look at the paths.
I suggest editing the path so that it only specified the texture file
in the local directory. the entry you want is map_Kd i believe : see
below:
for example:
----
# WaveFront *.mtl file (generated by Cheetah3D)
newmtl default
Ns 64
Kd 0.7 0.7 0.7
Ks 1.0 1.0 1.0
Ka 0.1 0.1 0.1
newmtl BoxTexture
Ns 64.000000
Tr 1.000000
Kd 0.750000 0.750000 0.750000
Ks 1.000000 1.000000 1.000000
Ka 0.1 0.1 0.1
map_Kd /some/path/to/some/folder/containing/boxtexture.jpg
----
change to
----
# WaveFront *.mtl file (generated by Cheetah3D)
newmtl default
Ns 64
Kd 0.7 0.7 0.7
Ks 1.0 1.0 1.0
Ka 0.1 0.1 0.1
newmtl BoxTexture
Ns 64.000000
Tr 1.000000
Kd 0.750000 0.750000 0.750000
Ks 1.000000 1.000000 1.000000
Ka 0.1 0.1 0.1
map_Kd boxtexture.jpg
----
and simply make sure boxtexture.jpg is in the same folder as your mtl
and obj file. Jitter should find it.
On Oct 14, 2007, at 11:57 PM, Robert Ramirez wrote:
>
> can't help you much with cinema4d specifically, but i can tell you
> what you need to render textures with gl.model.
>
> if you look in max folder/patches/media/models there are some
> examples of the files you need. look in the apples folder. in
> addition to the readme, there are some image files and two text
> files (.mtl and .obj). the obj file you know, the .mtl file is the
> material file. if you open the obj file with textedit or notepad,
> you can see that it references a apple.mtl. if you open apple.mtl
> file, you can see that it references two image texture files.
>
> if you look further down the apple.obj, you will see the lines
> preceded with vt, which refer to texture coordinates. if your model
> doesn't have texture coordinates, it won't be able to display
> automatic textures.
>
> these are the things you need to have in order to display textures
> with gl.model. you should google how to export mtl material files
> from cinema4d (of if it's even possible). you should also google
> the mtl format, because it might be something you can figure out
> and write yourself.
>
> hth.
> -rob
v a d e //
www.vade.info
abstrakt.vade.info
Thanks very much for both the replies, that all makes a lot more sense now. I think I can get it working, and tweak the parameters of the texture mapping. I'll have to see the specifics regarding Cinema4D, but these should be manageable.
Didn't know there would be this extra step needed, but actually, having the params in the .mtl file could provide some interesting additional control over the mapping.
Thanks again, off to fiddle!
--CJ