Select to view content in your preferred language

Random texures to building not tiles?

997
5
08-18-2014 01:22 AM
KennethLindhardt
Deactivated User

Hi,

I would like to get a set of random textures to my buildings. All my building will get an attribute, so I know what kind of material I need to assign to each building. I would like to assign my rule to multiply buildings, and choose a random material texture inside my texture folders. Let’s say I got an brick building, it should randomly choose from 5 different brick textures. If I use a random search inside my brick folder, it will assign random textures to my tiles inside 1 building. If my folder contains 2 textures 1 yellow brick and 1 red brick, one building will contain both textures. That is not what I would like of course. How do I create my rule, so it would take random textures for each building and not each tile?

0 Kudos
5 Replies
KennethLindhardt
Deactivated User

Got it,

using the case Materiale == "Bric" : listRandom(fileSearch("assets/Textures/Brick/*.png"))

instead of fileRandom, will assign only one picture to the building.

0 Kudos
DavidWasserman
Frequent Contributor

Yeah, you have to be careful in general about how the rules are being called. That seems it will do the trick.

David Wasserman, AICP
0 Kudos
KennethLindhardt
Deactivated User

Thanks for your reply. It seems so 😉 I'm happy about it!

0 Kudos
MatthiasBuehler
Deactivated User

hey !

also, you can do this:

const myTex = fileRandom(..)

This will make sure that myTex is always the same texture, no matter where called in the code.

Ok ?

Matt

KennethLindhardt
Deactivated User

Tanks for the info.

At this point what I did, is doing the job perfectly. Also when I split my gable roofs vertically, the vertical texture are the same as the one given for my facades. 

0 Kudos