OBJ imports with no textures

5609
10
08-05-2013 12:48 PM
leewinslow1
New Contributor
Hello all,

I'm trying to import some building models in to CE in an OBJ format.  The problem is that all the buildings are coming in grey with no textures.  My OBJ file is saved in the same location as my textures and the .MTL file.  I'm not sure whats going wrong any suggestions.

Thanks
0 Kudos
10 Replies
MatthiasBuehler1
Frequent Contributor II
Hi Lee !

Open the .mtl in a text editor and check all texture paths (use 'notepad++' to search & replace over many files if needed).


Usually if you want the .mtl right next to the .obj file, use a 'relative path', means just use the texture name.


E.g.

If the path in the .mtl is :
mapKd C:/images/myPic.jpg

CE cannot find that path because it needs to reside within CityEngine's workspace. If the files are copied to :
assets/..

it should work with just the texture name.


* * *

Otherwise, you can also use the standard file navigation syntax :
../ # 1 dir up
/   # 1 dir below

* * *

I usually create:
assets/trees/..
assets/cars/..
..

and within those just use relative paths in the .mtls.

Additionally, you'll make your life easier if none of any textures you use in your full projects share the same name because on export, they may ( depending on your export settings ) be copied into 1 big folder. Note that files will not be overridden if they have the same name, but incrementally renamed, which may mess up your workflow.



Cheers !

Matt
0 Kudos
leewinslow1
New Contributor
Hello Matt

Thanks for the help with the texture path name conventions.  I think that tipped me off to what was going wrong with my textures.  I had a "./" in front of my texture instead of just the texture name.

Thanks again
0 Kudos
MicheleAndreolli
New Contributor
Hi,

I'm facing the same issue, but it seems that everthing is ok.

First of all I tried with complex models, but the last test has been performed with a simple cube with one texture.
If I switch the Material_Transparent setting I can visualize the texture with the alpha channel active.

You can check my settings from my screenshots.

I'm working on MAC Pro Quad-Core Intel Xeon, 4 GB, with ATI Radeon HD 5770.

Any ideas?
Thanks for the support,
Michele

The Material_Transparent setting:
[ATTACH=CONFIG]32664[/ATTACH]
The mtl file:
[ATTACH=CONFIG]32663[/ATTACH]
The result:
[ATTACH=CONFIG]32662[/ATTACH]
0 Kudos
MatthiasBuehler1
Frequent Contributor II
Hi,

can you try to change the line
'Ka' to '0 0 0' ?

Lemme know.

m.
0 Kudos
MicheleAndreolli
New Contributor
No improvements...I'm testing the new trial release of CE... could this be the problem?

In the .zip file, if you want you can test my cube :)

Thanks,
Michele
0 Kudos
MatthiasBuehler1
Frequent Contributor II
Hi,

In the mtl, change line
  Tr 0.0000

to
  Tr 1.0000


Ok ?

m.
0 Kudos
SebastianLuhmer
New Contributor
Hi Folks,

I´m struggling with the same issue in City Engine 2012. The imported obj-Files appear without texture in City Engine. All Files (obj, mtl and related graphics file) are in the same location (Folder "assets"within the City Engine Workspace Directory). Into the mtl-file the graphics-file is referenced wihtout pointing to an absolute or relative path (like Mat described it in the post marked as the solution).

Any further ideas or recommendations?

All the best.

Sebastian
0 Kudos
MatthiasBuehler1
Frequent Contributor II
Hi,

Are you sure you display the models textured and not just shaded ?

Matt
0 Kudos
SebastianLuhmer
New Contributor
Hi Matt,

yes I am sure that the models are displayed in textured mode (see attatched screenshot). The OBJs are the same I sent you some weeks ago when we were talking about the OBJ-Imort in CE 2013. I tried to import these files in CE 2012, but was unfortunately just able to visualize them without texture.


Sebastian

[ATTACH=CONFIG]33323[/ATTACH]
0 Kudos