Select to view content in your preferred language

how to texture object with multi ID

1123
5
12-20-2012 10:11 PM
anthonymagdelaine
Emerging Contributor
i usally work with object from max, with multi-Texture ID, like trees with barks and leafs,
is it possible to set it back inside CE?
0 Kudos
5 Replies
MatthiasBuehler1
Deactivated User
Hi,

I'm not perfectly sure what you mean ..

You can bring over textured objects from 3ds Max to CityEngine via .obj ( with .mtl ) and .dae ..

Let me know..

Maybe add a few screenshots !

matt
0 Kudos
anthonymagdelaine
Emerging Contributor
ok, i mean 1 object (like a tree) with 2 texture (one for bark, one for leafs)
inside max this return a multi-material contening 2 materials,
and the differents polys are identified by material ID (1 or 2).

because i use .obj, i must load .mtl like you mensionned.

first test i seen that the .obj try to load unknown texture, refering them to the C: folder i used inside max. is it possible to modify this line to the CE folders and subfolder?

i didn't find any information about this
0 Kudos
MatthiasBuehler1
Deactivated User
hi !

the best is to edit the .obj's .mtl file.

place all files (.obj, .mtl and textures) in the same CityEngine directory, e.g. :
assets/myTree/

edit the .mtl file's texture path to a just the texture name
e.g.
map_Kd barkTexture.jpg


that way, CE directly uses this relative path and not the full system path (C:/...)

ok?
0 Kudos
anthonymagdelaine
Emerging Contributor
i understand and tryed this way, but not working, i missed something as you can see on this screen:

[ATTACH=CONFIG]20452[/ATTACH]
0 Kudos
MatthiasBuehler1
Deactivated User
Hi !

Not sure why you have multiple textures .. but per material, you should only have 1 texture reference in the .mtl file ..

After inserting the asset in CGA with i(), if you use texture() to set the texture, you will lose any 'faceMaterials' which were set via the .mtl file.

Also, make sure that you texture only at the 'leafShapes' of your CGA code. If you e.g. insert objects on a surface which already has a texture set, the texture will be inherited on following shapes.

Let me know if this makes sense..

🙂
0 Kudos