<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Random texture in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/random-texture/m-p/313172#M4314</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Many thanks for the assistance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried the code you gave but it didn't work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So i tried the script found within the image attachment.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have 16 facade textures in my assets that &lt;/SPAN&gt;&lt;STRONG&gt;i want to apply to all the buildings in my scene randomly.&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I got something to work out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But what I really want is to associate ONE Facade texture for the 4 sides of the building and not different facade textures for every side.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How can I generate that?!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Nov 2012 11:01:38 GMT</pubDate>
    <dc:creator>ziadfilfili</dc:creator>
    <dc:date>2012-11-26T11:01:38Z</dc:date>
    <item>
      <title>Random texture</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/random-texture/m-p/313170#M4312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi there,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need help in applying random texture to my buildings.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;All my textures has the same name but different numbering.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Is there a way for a random rule texture where it can be applied for all the buildings with the same height at once ?&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;cheers,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2012 12:23:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/random-texture/m-p/313170#M4312</guid>
      <dc:creator>ziadfilfili</dc:creator>
      <dc:date>2012-11-20T12:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/random-texture/m-p/313171#M4313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;have you tried something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
attr height = 10
const buildingtex = fileRandom("assets/buildingtex*")

Lot--&amp;gt; Building(comp.index)
Building(myIndex)--&amp;gt; case height == 10 : Texture1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else: Texture2.
Texture1--&amp;gt;setupProjection(0, scope.xy, scope.sx, scope.sy)
&amp;nbsp; projectUV(0) 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; texture(buildingtex)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The fileRandom will choose random textures within your path, when they've all got the same name and different numbers you add the name at the start and the * indicates the numbers that will change.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that helps! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:56:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/random-texture/m-p/313171#M4313</guid>
      <dc:creator>JoanneO_Brien</dc:creator>
      <dc:date>2021-12-11T14:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/random-texture/m-p/313172#M4314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Many thanks for the assistance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried the code you gave but it didn't work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So i tried the script found within the image attachment.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have 16 facade textures in my assets that &lt;/SPAN&gt;&lt;STRONG&gt;i want to apply to all the buildings in my scene randomly.&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I got something to work out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But what I really want is to associate ONE Facade texture for the 4 sides of the building and not different facade textures for every side.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How can I generate that?!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Nov 2012 11:01:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/random-texture/m-p/313172#M4314</guid>
      <dc:creator>ziadfilfili</dc:creator>
      <dc:date>2012-11-26T11:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/random-texture/m-p/313173#M4315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;then, you forgot to define the filesearch as a 'const'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;&lt;STRONG&gt;const &lt;/STRONG&gt;buildingtex = fileRandom("assets/buildingtex/myFacade*.jpg")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Nov 2012 14:06:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/random-texture/m-p/313173#M4315</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2012-11-26T14:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/random-texture/m-p/313174#M4316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there any way to randomize color?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2012 15:45:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/random-texture/m-p/313174#M4316</guid>
      <dc:creator>BenHaas</dc:creator>
      <dc:date>2012-11-29T15:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/random-texture/m-p/313175#M4317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you have specific colours you want you could randomise using the Stochastic Rule where you assign a percentage for each colour, then it can randomly pick between those colours. Alternatively have you looked at the colorRamp operation? I haven't played around much with this myself yet but I might be useful for your query, check it out in the help files anyway.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;hope that helps! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2012 22:52:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/random-texture/m-p/313175#M4317</guid>
      <dc:creator>JoanneO_Brien</dc:creator>
      <dc:date>2012-11-29T22:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/random-texture/m-p/313176#M4318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Very interesting ! but lets say, i want to use a random facade rule instead of a texture - how would that be managed ? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;greetings&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 08:04:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/random-texture/m-p/313176#M4318</guid>
      <dc:creator>floLang</dc:creator>
      <dc:date>2013-01-08T08:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/random-texture/m-p/313177#M4319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;you can also do randomised colour by &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;color(rand(0,1),rand(0,1),rand(0,1))&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Again with the facade rules you could always use a stocastic function where you say&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Facade1--&amp;gt; ...
Facade2--&amp;gt;...
Facade3--&amp;gt;...
RandomFacade--&amp;gt; 30% : Facade1
30% : Facade2
else: Facade3&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:56:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/random-texture/m-p/313177#M4319</guid>
      <dc:creator>JoanneO_Brien</dc:creator>
      <dc:date>2021-12-11T14:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/random-texture/m-p/313178#M4320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi !&lt;BR /&gt;&lt;BR /&gt;then, you forgot to define the filesearch as a 'const'.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;&lt;STRONG&gt;const &lt;/STRONG&gt;buildingtex = fileRandom("assets/buildingtex/myFacade*.jpg")&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;OH MAN! Thanks for this Matthias (though way old).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was searching forever to find a way to keep a random texture the same throughout the CGA code. The help contents needs a little ProTip specifying this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-ap-&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2013 19:54:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/random-texture/m-p/313178#M4320</guid>
      <dc:creator>boycepostma</dc:creator>
      <dc:date>2013-07-23T19:54:00Z</dc:date>
    </item>
  </channel>
</rss>

