Random Texture with Inspector Override

09-04-2020 04:37 PM
New Contributor

Hello CE Community,

I'm looking for a way to override randomized textures. It would be nice to have the ability to change the textures with a drop-down menu in the inspector.


0 Kudos
3 Replies
Occasional Contributor III

Just use a stochastic rule in your attribute. This will randomize on seed generation and then give you the ability to change it.  Something like the code below should work. 


attr Texture =  25%: "texA.jpg"
                25%: "texB.jpg"
                25%: "texC.jpg"
               else: "texD.jpg"‍‍‍‍‍‍‍‍‍
by Anonymous User
Not applicable

I think you are trying to activate browse tool.

I use the texture folder wildcard method:

attr wall_tex = getWallTexture
getWallTexture  = listRandom(_getWallTexture)
_getWallTexture = fileSearch("/FolderDestination*" + "*.*")

Then over in the inspector you should be able to access the "browse" to override your texture:

I also think you can activate the browse by simply adding the "@File" before your attribute rule (?).

Esri Regular Contributor

Yes, that is correct.  The @File annotation allows you to open a file chooser.

Annotations—ArcGIS CityEngine Resources | Documentation