Yup, I did work with that. Actually, currently that is my only option to create "identifiers" for each picking box:
Code:
...
...
FloorPickingBox(splitTotal, floorIndex) -->
case floorIndex < splitTotal - 1:
set(material.opacity, 0.5)
misc.SetMaterial(FLOOR_PICKING_BOX_NAME +
"__" + floorIndex + "__" +
listItem(FLOOR_PICKING_BOXES_UUIDS, floorIndex))
else:
s('1, '2, '1)
set(material.opacity, 0.5)
misc.SetMaterial(FLOOR_PICKING_BOX_NAME +
"__" + floorIndex + "__" +
listItem(FLOOR_PICKING_BOXES_UUIDS, floorIndex))
...
...
# misc.cga
SetMaterial(name) -->
set(material.name, name)
TerminalMaterial.
I'm calling set(material.name, "name") all the time, to make sure that on the "other side" I can query things...
The "create shape groups" does not do anything that I find relevant. It only organizes the meshes in a hierarchical manner.
But let me tighten the scope of my question:
- given the example in the code above, is there a way to end up with a one single material for all the picking boxes, but meshes with different names (after importing into Unity)?
The way I have been doing it, I get different named meshes And different materials.

Originally Posted by
matthiasbuehler
hi !
did you work with
set(material.name, "matName")
?
did you work with the option
create shape groups ?
* * *
there's rules which define when exactly a new material is created in the CE. that usually is if some of the attributes have changed.
so, make sure that your pick box material go thru the exact same rules and get the exact same material settings & naming.
not all of the material / mesh merging combinations are possible with the CityEngine, thus it may make sense to post process them with a series of scripts in an other 3d app (such as Maya).
* * *
please note also that if you export 'one file per shape', the material merging only works per shape. e.g. the absolute same materials will not be merged over multiple files.
Bookmarks