<?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: Apply textures to facades based on building attributes in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/apply-textures-to-facades-based-on-building/m-p/647462#M8602</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay thanks. So this is what I have (note LAYER is the name of the attribute field):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;const facadeDirectory = "assets/brick_facade_01/"&lt;/P&gt;&lt;P&gt;attr LAYER = "brick" &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Range("brick", "stone", "frame", "iron", "special frame")&lt;/P&gt;&lt;P&gt;attr facadeTexture = LAYER&lt;/P&gt;&lt;P&gt;attr textureScaleX = 4&lt;/P&gt;&lt;P&gt;attr textureScaleY = 4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Facade --&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; setupProjection(0, scope.xy, textureScaleX, textureScaleY)&lt;/P&gt;&lt;P&gt;&amp;nbsp; projectUV(0)&lt;/P&gt;&lt;P&gt;&amp;nbsp; texture(facadeDirectory + facadeTexture + "brick_facade_01.jpg")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This worked in that it changed the value in the connection editor to the individual prescribed attribute for every object. I'm still not sure about facade texture though. This code didn't project anything and I'm not sure how to make it more specific to differentiate between the attributes. So far I only included one image (brick) just to test.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Nov 2014 17:20:33 GMT</pubDate>
    <dc:creator>AishaPasha</dc:creator>
    <dc:date>2014-11-12T17:20:33Z</dc:date>
    <item>
      <title>Apply textures to facades based on building attributes</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/apply-textures-to-facades-based-on-building/m-p/647455#M8595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, I'm just getting started with City Engine and am trying to apply textures to facades based on building attributes (i.e. brick, wood, stone etc.). Can anyone give an example of how to write the code for this? Thx.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Oct 2014 16:16:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/apply-textures-to-facades-based-on-building/m-p/647455#M8595</guid>
      <dc:creator>AishaPasha</dc:creator>
      <dc:date>2014-10-15T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Apply textures to facades based on building attributes</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/apply-textures-to-facades-based-on-building/m-p/647456#M8596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Put in your assets folder: (find attached CGA and Assets)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;brick.jpg, wood.jpg, and stone.jpg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;BrickWoodStone.cga:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;version "2014.0"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;const facadeDirectory = "assets/BrickWoodStone/"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;attr buildingHeight = 10&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Range("brick", "wood", "stone")&lt;/P&gt;&lt;P&gt;attr facadeTexture = "brick"&lt;/P&gt;&lt;P&gt;attr textureScaleX = 4&lt;/P&gt;&lt;P&gt;attr textureScaleY = 4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BuildingFootprint --&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; # Make footprint flat by scaling to zero in y direction.&lt;/P&gt;&lt;P&gt;&amp;nbsp; s('1,0,'1)&lt;/P&gt;&lt;P&gt;&amp;nbsp; # Make footprint into mass.&lt;/P&gt;&lt;P&gt;&amp;nbsp; extrude(buildingHeight)&lt;/P&gt;&lt;P&gt;&amp;nbsp; # Pop off sides and top.&lt;/P&gt;&lt;P&gt;&amp;nbsp; comp(f) {top: Roof | side: Facade}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Roof --&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; roofGable(30)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Facade --&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; setupProjection(0, scope.xy, textureScaleX, textureScaleY)&lt;/P&gt;&lt;P&gt;&amp;nbsp; projectUV(0)&lt;/P&gt;&lt;P&gt;&amp;nbsp; texture(facadeDirectory + facadeTexture + ".jpg")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Oct 2014 20:46:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/apply-textures-to-facades-based-on-building/m-p/647456#M8596</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-10-15T20:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Apply textures to facades based on building attributes</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/apply-textures-to-facades-based-on-building/m-p/647457#M8597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;great help here, Chris !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN lang="EN-US"&gt;Matthias Buehler&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US"&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN lang="EN-US"&gt;Head of 3D Technologies&lt;/SPAN&gt;&lt;/EM&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US"&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #999999; font-size: 10pt;"&gt;&lt;SPAN lang="EN-US"&gt;twitter: @MattB3D&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US"&gt;Garsdale Design Limited &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="mailto:matthias.buehler@garsdaledesign.co.uk" target="_blank"&gt;matthias.buehler@garsdaledesign.co.uk&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.garsdaledesign.co.uk/" target="_blank"&gt;www.garsdaledesign.co.uk&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2014 13:39:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/apply-textures-to-facades-based-on-building/m-p/647457#M8597</guid>
      <dc:creator>MatthiasBuehler</dc:creator>
      <dc:date>2014-10-20T13:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: Apply textures to facades based on building attributes</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/apply-textures-to-facades-based-on-building/m-p/647458#M8598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great! Thanks for this. I was wondering though how exactly do I assign textures based on attributes already specified to the object? I have a set of historic building footprints that have information attached to them (height, # of stories, material etc) and I've been able to extrude them to correspond with their height, but I'm still not sure how to link textures to the given material. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Nov 2014 15:41:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/apply-textures-to-facades-based-on-building/m-p/647458#M8598</guid>
      <dc:creator>AishaPasha</dc:creator>
      <dc:date>2014-11-03T15:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Apply textures to facades based on building attributes</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/apply-textures-to-facades-based-on-building/m-p/647459#M8599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you give a brief example...pseudo-code or just explain the logic/goal? How do the attribute values correspond to the material choices. Is random involved, or exact/unique textures per building or per attribute value?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Nov 2014 15:46:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/apply-textures-to-facades-based-on-building/m-p/647459#M8599</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-11-03T15:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: Apply textures to facades based on building attributes</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/apply-textures-to-facades-based-on-building/m-p/647460#M8600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sure. There are no random values. I imported a shapefile of historic building footprints that have a field called "material", which specifies whether the building was constructed from brick, wood, metal, etc. I'd like to assign textures to the facades based on the material specified in that field, which are just recorded as "brick", "wood", "metal" etc. The outcome would be that all buildings specified as "brick" in the material field would receive a brick textured facade, and so on. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Nov 2014 16:13:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/apply-textures-to-facades-based-on-building/m-p/647460#M8600</guid>
      <dc:creator>AishaPasha</dc:creator>
      <dc:date>2014-11-03T16:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Apply textures to facades based on building attributes</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/apply-textures-to-facades-based-on-building/m-p/647461#M8601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So it seems this is the same rule as earlier in the post (see above CGA), but you need to use the Connection Editor. See the small icon to the left of the values in the Inspector. Clicking into that, you will see the third option is "object attribute". That is how you connect your rule to object attributes of the shapes that the rule is running on. To enable this linkage, the object attribute name must match the attribute name in your rule.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in the rule above, change this line, so that "&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;facadeTexture" matches you object attributes on the shapes&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;attr facadeTexture = "brick"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Is this what you meant?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Nov 2014 16:44:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/apply-textures-to-facades-based-on-building/m-p/647461#M8601</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-11-03T16:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: Apply textures to facades based on building attributes</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/apply-textures-to-facades-based-on-building/m-p/647462#M8602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay thanks. So this is what I have (note LAYER is the name of the attribute field):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;const facadeDirectory = "assets/brick_facade_01/"&lt;/P&gt;&lt;P&gt;attr LAYER = "brick" &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Range("brick", "stone", "frame", "iron", "special frame")&lt;/P&gt;&lt;P&gt;attr facadeTexture = LAYER&lt;/P&gt;&lt;P&gt;attr textureScaleX = 4&lt;/P&gt;&lt;P&gt;attr textureScaleY = 4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Facade --&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; setupProjection(0, scope.xy, textureScaleX, textureScaleY)&lt;/P&gt;&lt;P&gt;&amp;nbsp; projectUV(0)&lt;/P&gt;&lt;P&gt;&amp;nbsp; texture(facadeDirectory + facadeTexture + "brick_facade_01.jpg")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This worked in that it changed the value in the connection editor to the individual prescribed attribute for every object. I'm still not sure about facade texture though. This code didn't project anything and I'm not sure how to make it more specific to differentiate between the attributes. So far I only included one image (brick) just to test.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2014 17:20:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/apply-textures-to-facades-based-on-building/m-p/647462#M8602</guid>
      <dc:creator>AishaPasha</dc:creator>
      <dc:date>2014-11-12T17:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Apply textures to facades based on building attributes</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/apply-textures-to-facades-based-on-building/m-p/647463#M8603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One easy way to test this is change this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;texture(facadeDirectory + facadeTexture + "brick_facade_01.jpg")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;To this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;print(facadeDirectory + facadeTexture + "brick_facade_01.jpg")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;It should display this in the CGA console:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;assets/brick_facade_01/brick&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;brick_facade_01.jpg&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;This shows the file you are asking for. Notice you need a slash before the file name, so then change the line to this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;texture(facadeDirectory + facadeTexture + "/" + "brick_facade_01.jpg")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Or if you weren't using a literal file name:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;texture(facadeDirectory + facadeTexture + "/" + yourFileNameHere)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; line-height: 1.5;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2014 17:41:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/apply-textures-to-facades-based-on-building/m-p/647463#M8603</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-11-12T17:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: Apply textures to facades based on building attributes</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/apply-textures-to-facades-based-on-building/m-p/647464#M8604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmm, okay this actually didn't change anything. Nothing still projects. Also, just to be clear, this the correct line of code: &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;"assets/brick_facade_01/brick&lt;/SPAN&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;brick_facade_01.jpg"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2014 14:22:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/apply-textures-to-facades-based-on-building/m-p/647464#M8604</guid>
      <dc:creator>AishaPasha</dc:creator>
      <dc:date>2014-11-14T14:22:10Z</dc:date>
    </item>
  </channel>
</rss>

