<?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 Random Texture in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/random-texture/m-p/537057#M7287</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I want to model a one family house complex on one lot. For this purpose I make two rule files: the first one ???buildingComplex.cga??? splits the lot in smaller parcels. In each parcel the second rule ???building.cga??? is accessed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For the roof I use random textures (inside the building.cga):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;const randomRoofTexture = "textur/roof/ziegel_efh_"+ceil(rand(0,6))+".jpg"&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but now each building on the lot has the same texture.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How can I make one texture per house but different textures for different buildings in one complex?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Nov 2011 11:35:03 GMT</pubDate>
    <dc:creator>NoemiNeuenschwander1</dc:creator>
    <dc:date>2011-11-16T11:35:03Z</dc:date>
    <item>
      <title>Random Texture</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/random-texture/m-p/537057#M7287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I want to model a one family house complex on one lot. For this purpose I make two rule files: the first one ???buildingComplex.cga??? splits the lot in smaller parcels. In each parcel the second rule ???building.cga??? is accessed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For the roof I use random textures (inside the building.cga):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;const randomRoofTexture = "textur/roof/ziegel_efh_"+ceil(rand(0,6))+".jpg"&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but now each building on the lot has the same texture.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How can I make one texture per house but different textures for different buildings in one complex?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2011 11:35:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/random-texture/m-p/537057#M7287</guid>
      <dc:creator>NoemiNeuenschwander1</dc:creator>
      <dc:date>2011-11-16T11:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: random texture</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/random-texture/m-p/537058#M7288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;'const' makes an attribute constant for the whole shape. thus, there's no direct differentiation between the facades of the different buildings.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;so what you have to do is pass one random 'chosen' texture down to each one of the building footprints for using as the facade texture.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you are on 2010.3, you have to pass the value from rule to rule, like :&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Lot --&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Rule(rand(10,20))

Rule (value) --&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; print (value)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This can of course get confusing if you have many many rules, because you need to pass the values down like, even over rules which do not use this value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For this, in the 2011 version, GENERIC ATTRIBUTES were introduced, which let you set and change any attribute in the Rules. These are then passed down automatically.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;E.g.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;attr myValue= 1

Lot --&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; set (myValue, 10)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Rule

Rule --&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; print&amp;nbsp; (myValue)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please note that these attribute values are handed down to the different 'subtrees' in the Model Hierarchy, thus each branch can have different values.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:19:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/random-texture/m-p/537058#M7288</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2021-12-11T23:19:17Z</dc:date>
    </item>
  </channel>
</rss>

