Textures are lost

05-25-2016 07:37 AM
New Contributor II

I had a complete model (CGA rules, textures...) on City Engine and I needed to change some fields related to the footprints shape so:

1. I modified the footprint file on ArcGIS and imported it back to CityEngine as a GDB file

2. City Engine read the CGA rules associated to each building but not the textures

Does anybody know why is that? The rules are perfectly written specifying the exact path to the Images. I left the original layer on the scene (it has the same rules and shows the textures) and it works perfectly. The imported one doesn´t read the textures...

I hope somebody can help me. Thank you

0 Kudos
3 Replies
Esri Regular Contributor

Is the texture file specified in the cga code or does it come from an object attribute on your shape?  Could you please include the cga code that determines where to get the texture?

0 Kudos
New Contributor II
I attach a CGA sample of one texture for a front facade (FaF). gid is the building footprint number,"White_01_m" is a jpg file contained in the Images folder:

attr gid = 0

attr path = "images/"+gid+"/"

attr end = ".jpg"


FaF_M -->        


            alignScopeToGeometry(zUp, 0, world.lowest)

            setupProjection(0, scope.xy, '1.0000, '1.0000)


            split (y){

            (scope.sy-0): FaF_M_Body |

            ~1 : FaF_M_Top


On the inspector this is shown for the building 627334:

0 Kudos
Esri Regular Contributor

The code looks fine.  It looks like the attributes called end and path are linked to Object Attributes.  This means that they are trying to get their values from the Object Attributes on the shape.  The attribute gid is also linked and has the value 627334 which it got from the linked Object Attribute.  The Object Attribute values for end and path are empty, so that's why they look empty in the screenshot.  I think this might be why the texture are not found.  To link these attributes (end and path) back to the rules, you can click on the icon with the square and black arrow and set them to rule attributes.  You could also try to diagnose the problem by printing the texture file to the console before the texture call in the rules using print(path+"White_01_m"+end).  Then, open the console (Window -> Show Console) to see the output.

0 Kudos