<?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 How to Write  .cgamat file in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-write-cgamat-file/m-p/1588392#M11516</link>
    <description>&lt;P&gt;cityengine 2023.1&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I&lt;/SPAN&gt; &lt;SPAN class=""&gt;need&lt;/SPAN&gt; &lt;SPAN class=""&gt;to&lt;/SPAN&gt; &lt;SPAN class=""&gt;create&lt;/SPAN&gt; &lt;SPAN class=""&gt;a&lt;/SPAN&gt; &lt;SPAN class=""&gt;material&lt;/SPAN&gt; &lt;SPAN class=""&gt;to&lt;/SPAN&gt; &lt;SPAN class=""&gt;then&lt;/SPAN&gt; &lt;SPAN class=""&gt;apply&lt;/SPAN&gt; &lt;SPAN class=""&gt;it&lt;/SPAN&gt; &lt;SPAN class=""&gt;to&lt;/SPAN&gt; &lt;SPAN class=""&gt;the&lt;/SPAN&gt; &lt;SPAN class=""&gt;shapes (gcamat)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://doc.arcgis.com/en/cityengine/latest/cga/cga-set-material.htm" target="_blank" rel="noopener"&gt;setMaterial operation—ArcGIS CityEngine Resources | Documentation&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 23 Feb 2025 20:25:09 GMT</pubDate>
    <dc:creator>josegudalupemeridajardinez</dc:creator>
    <dc:date>2025-02-23T20:25:09Z</dc:date>
    <item>
      <title>How to Write  .cgamat file</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-write-cgamat-file/m-p/1588392#M11516</link>
      <description>&lt;P&gt;cityengine 2023.1&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I&lt;/SPAN&gt; &lt;SPAN class=""&gt;need&lt;/SPAN&gt; &lt;SPAN class=""&gt;to&lt;/SPAN&gt; &lt;SPAN class=""&gt;create&lt;/SPAN&gt; &lt;SPAN class=""&gt;a&lt;/SPAN&gt; &lt;SPAN class=""&gt;material&lt;/SPAN&gt; &lt;SPAN class=""&gt;to&lt;/SPAN&gt; &lt;SPAN class=""&gt;then&lt;/SPAN&gt; &lt;SPAN class=""&gt;apply&lt;/SPAN&gt; &lt;SPAN class=""&gt;it&lt;/SPAN&gt; &lt;SPAN class=""&gt;to&lt;/SPAN&gt; &lt;SPAN class=""&gt;the&lt;/SPAN&gt; &lt;SPAN class=""&gt;shapes (gcamat)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://doc.arcgis.com/en/cityengine/latest/cga/cga-set-material.htm" target="_blank" rel="noopener"&gt;setMaterial operation—ArcGIS CityEngine Resources | Documentation&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Feb 2025 20:25:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-write-cgamat-file/m-p/1588392#M11516</guid>
      <dc:creator>josegudalupemeridajardinez</dc:creator>
      <dc:date>2025-02-23T20:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to Write  .cgamat file</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-write-cgamat-file/m-p/1589343#M11520</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/839156"&gt;@josegudalupemeridajardinez&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the question.&lt;BR /&gt;Just select a CGA Model (or any static model). Then to create .cgamat files you can use the CityEngine CGA Material Encoder option in the&amp;nbsp;&lt;EM&gt;File &amp;gt; Export Models...&lt;/EM&gt;&amp;nbsp;dialog.&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ThomasFuchs_0-1740559694300.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/126290i7091126AC73066A2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ThomasFuchs_0-1740559694300.png" alt="ThomasFuchs_0-1740559694300.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://doc.arcgis.com/en/cityengine/latest/help/help-export-models-overview.htm" target="_blank" rel="noopener"&gt;Export a model—ArcGIS CityEngine Resources | Documentation&lt;/A&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;P&gt;The material descriptions of a CGA model are collected and written into individual subdirectories. Each subdirectory contains all the material—including the used textures—which can be copied into a folder of assets, for example. The name of the subdirectory and the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;.cgamat&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;file is the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://doc.arcgis.com/en/cityengine/2024.1/cga/cga-material-attribute.htm" target="_blank" rel="noopener"&gt;&lt;SPAN class=""&gt;material.name&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;attribute but is made unique if there are several materials with the same name.&lt;/P&gt;&lt;P&gt;The &amp;lt;matName&amp;gt;&lt;SPAN class=""&gt;.cgamat&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;file is in CSV format, as is the result of the CGA function:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;getMaterial(used, changed)&lt;/SPAN&gt;.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;.cgamat files are simple plain text file contain name of&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://doc.arcgis.com/en/cityengine/latest/cga/cga-material-attribute.htm" target="_self" rel="nofollow noopener noreferrer"&gt;material attributes&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and its value seperated by a comma:&lt;/P&gt;&lt;PRE&gt;metallic,0
roughness,1
colormap,Textures/Grass_Dry_10x10_Brown_Color.jpg
colormap.su,0.1
colormap.sv,0.1
normalmap,Textures/Grass_10x10_Normal.jpg
normalmap.rw, 0
normalmap.su,0.1
normalmap.sv,0.1
...&lt;/PRE&gt;&lt;P&gt;Note: You can also find some material files in the ESRI.lib under &lt;EM&gt;/assets/Materials.&amp;nbsp;&lt;/EM&gt;Only materials stored here are shown in the Material Browser.&amp;nbsp;&lt;A href="https://doc.arcgis.com/en/cityengine/latest/help/help-esri-lib-webstyles.htm#ESRI_SECTION1_FEC3CD4B72B648EB949C00C0DBFAC588" target="_blank"&gt;ESRI.lib—ArcGIS CityEngine Resources | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;To apply a &lt;EM&gt;&lt;SPAN class=""&gt;.cgamat&lt;/SPAN&gt;&amp;nbsp;file&lt;/EM&gt; on a shape, you need to set the path first. Then&amp;nbsp;use the&amp;nbsp;&lt;A href="https://doc.arcgis.com/en/cityengine/latest/cga/cga-set-material.htm" target="_blank" rel="noopener nofollow noreferrer"&gt;setMaterial operation—ArcGIS CityEngine Resources | Documentation&lt;/A&gt; and project the material on every face:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;version "2024.1"

@MaterialFile
attr cgaMat = "/ESRI.lib/assets/Materials/Generic/Wood/Wood_Standard_10x10.cgamat"

@StartRule
SetMaterial --&amp;gt; 
	setMaterial( readMaterial(cgaMat) )
    comp(f) { all :  
	    setupProjection(0, scope.xy, 1, 1)
	    projectUV(0)
	    Material.
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2025 09:33:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-write-cgamat-file/m-p/1589343#M11520</guid>
      <dc:creator>ThomasFuchs</dc:creator>
      <dc:date>2025-02-26T09:33:39Z</dc:date>
    </item>
  </channel>
</rss>

