<?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 Window textures in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/window-textures/m-p/198545#M2610</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a question regarding writing a rule for windows texturing.&lt;/P&gt;&lt;P&gt;I have 1 folder ("WindowTextures") with 3 subfolders("Group1","Group2" and "Group3") and each "Group" folder contains a number of jpgs&amp;nbsp; that are textures for windows named "window.1", "window.2", "window.3" etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need a rule that applies random jpgs from a "Group" folder to&amp;nbsp; a building`s windows, but also be able to change the group jpgss from the inspector.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This also applies to wall textures because I have several jpgs separated on material type - a folder for brick material with several jpgs, a folder for wood material with several jpgs etc ( I have like 4 or 5 material type) and I want to apply that rule to multiple buildings and to have random brick texture but also random material texture.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks !!&lt;/P&gt;&lt;P&gt;Ionut&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. - I attached the rule&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Oct 2014 13:03:47 GMT</pubDate>
    <dc:creator>IonutAlixandroae</dc:creator>
    <dc:date>2014-10-28T13:03:47Z</dc:date>
    <item>
      <title>Window textures</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/window-textures/m-p/198545#M2610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a question regarding writing a rule for windows texturing.&lt;/P&gt;&lt;P&gt;I have 1 folder ("WindowTextures") with 3 subfolders("Group1","Group2" and "Group3") and each "Group" folder contains a number of jpgs&amp;nbsp; that are textures for windows named "window.1", "window.2", "window.3" etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need a rule that applies random jpgs from a "Group" folder to&amp;nbsp; a building`s windows, but also be able to change the group jpgss from the inspector.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This also applies to wall textures because I have several jpgs separated on material type - a folder for brick material with several jpgs, a folder for wood material with several jpgs etc ( I have like 4 or 5 material type) and I want to apply that rule to multiple buildings and to have random brick texture but also random material texture.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks !!&lt;/P&gt;&lt;P&gt;Ionut&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. - I attached the rule&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 13:03:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/window-textures/m-p/198545#M2610</guid>
      <dc:creator>IonutAlixandroae</dc:creator>
      <dc:date>2014-10-28T13:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: Window textures</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/window-textures/m-p/198546#M2611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14145034145484599 jive_text_macro" jivemacro_uid="_14145034145484599" modifiedtitle="true"&gt;
&lt;P&gt;# Pick your group in the inspector, or move it to some internal logic.&lt;/P&gt;
&lt;P&gt;@Range("Group1","Group2","Group3")&lt;/P&gt;
&lt;P&gt;attr windowGroup = "Group1"&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# Make the random file path for the window textures.&lt;/P&gt;
&lt;P&gt;const windowTextureRandomPath = "WindowTextures/" + windowGroup + "/window.*.jpg")&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# Make the texture be an attribute, so you may override.&lt;/P&gt;
&lt;P&gt;attr randomWindowTexture = fileRandom(windowTextureRandomPath)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;# Let me know if this works for you. :)&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 13:38:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/window-textures/m-p/198546#M2611</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-10-28T13:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: Window textures</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/window-textures/m-p/198547#M2612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It`s perfect Chris!! Thanks!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The thing is that it gives me random textures from one group. If I apply the rule I need to have random textures from random group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Eg. I have Brick,Cement and Wood Groups, each one of them with 5 textures. If I apply the rule on 3 lots, it gives me random textures from BrickGroup, instead maybe random texture from Brick, Wood and Cement...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 14:22:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/window-textures/m-p/198547#M2612</guid>
      <dc:creator>IonutAlixandroae</dc:creator>
      <dc:date>2014-10-28T14:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Window textures</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/window-textures/m-p/198548#M2613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First I tried replacing line 03 with this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;attr windowGroup = "Group" + rint(rand(1,3))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;Then I realized I got more twos than ones and threes. Can anyone guess why? ( about double)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;So then I did this...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14145077483483785 jive_text_macro" jivemacro_uid="_14145077483483785"&gt;
&lt;P&gt;attr windowGroup = "Group" + groupNum&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;const groupNum =&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 33%: "1"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 33%: "2"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; else:"3"&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This ensures each gets roughly a third each. Of course you might like to change the percentages, which you can do in this case. Also, to see the random numbers change, make sure to use "Update Seed and Regenerate", rather than just "Generate".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 14:52:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/window-textures/m-p/198548#M2613</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-10-28T14:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Window textures</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/window-textures/m-p/198549#M2614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried to do the same with texturing the roofs (each type) but something is missing and I can`t see any texture.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you check please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attached the rule&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 20:22:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/window-textures/m-p/198549#M2614</guid>
      <dc:creator>IonutAlixandroae</dc:creator>
      <dc:date>2014-10-28T20:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: Window textures</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/window-textures/m-p/198550#M2615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ionut, you don't need someone to look at your rule... You need to dive into debugging. Try getting well versed in using the Model Hierarchy window with the Inspect Model mode. Learn to use the print statement to see what attribute values are. Bypass rules by sending them to shorter test rules. Track through the code from the point you think is broken. Go backwards. See where it went wrong. Also, post the code in question along with a screen shot. That will help us all answer your questions without opening the CGA on our side.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That said, look at this part of your rule:&lt;/P&gt;&lt;P&gt;HipRoof --&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; roofHip(45) RoofMassScale&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RoofMassScale is getting a duplicate of the current shape. You ARE getting a textured shape from the rest of the code, but it is covered up by the shapes from RoofMassScale.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, some of your roof code is using setupProjection with uvSet 1 - you need uvSet 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 21:19:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/window-textures/m-p/198550#M2615</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-10-28T21:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Window textures</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/window-textures/m-p/198551#M2616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I understand . Thank you for your help. So I will.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 21:23:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/window-textures/m-p/198551#M2616</guid>
      <dc:creator>IonutAlixandroae</dc:creator>
      <dc:date>2014-10-28T21:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: Window textures</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/window-textures/m-p/198552#M2617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;To see textures, change:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;HipRoof --&amp;gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp; roofHip(45) RoofMassScale&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="text-decoration: underline;"&gt;To this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;HipRoof --&amp;gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp; roofHip(45) # RoofMassScale (comment out RoofMassScale)&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Because RoofMassScale is putting it's shapes right on top of the shapes generated by the rest of the HipRoofRule. You branch the code at that point. I'm just guessing on this, but I think if you move that RoofMassScale to the very end of the HipRoof rule, then that will work the way you want it. Just a guess. &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 21:29:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/window-textures/m-p/198552#M2617</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-10-28T21:29:14Z</dc:date>
    </item>
  </channel>
</rss>

