<?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 Is it possible to move a constraint map based on th xz coordinates of the current view? in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-move-a-constraint-map-based-on/m-p/751856#M9908</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to be able to automatically shift a map with a radial gradient (say black to white) for controlling the level of detail. If the center of the radial gradient is always right below my viewpoint, I could use the grey levels to change the level of detail as a function of the distance from the viewpoint. Could this be done with Python?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Sep 2017 20:44:34 GMT</pubDate>
    <dc:creator>NicolaiSteinø</dc:creator>
    <dc:date>2017-09-11T20:44:34Z</dc:date>
    <item>
      <title>Is it possible to move a constraint map based on th xz coordinates of the current view?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-move-a-constraint-map-based-on/m-p/751856#M9908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to be able to automatically shift a map with a radial gradient (say black to white) for controlling the level of detail. If the center of the radial gradient is always right below my viewpoint, I could use the grey levels to change the level of detail as a function of the distance from the viewpoint. Could this be done with Python?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Sep 2017 20:44:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-move-a-constraint-map-based-on/m-p/751856#M9908</guid>
      <dc:creator>NicolaiSteinø</dc:creator>
      <dc:date>2017-09-11T20:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to move a constraint map based on th xz coordinates of the current view?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-move-a-constraint-map-based-on/m-p/751857#M9909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A href="https://community.esri.com/migrated-users/33322" target="_blank"&gt;Nicolai Steinø&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, this is possible with a function layer (reference point is the center).&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/377845_pastedImage_2.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Here is a simple CGA rule that colors buildings by LOD:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;attr LOD &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;

@StartRule
Lot &lt;SPAN class="operator token"&gt;--&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;extrude&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;rand&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;10&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;30&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; ColorByLOD

ColorByLOD &lt;SPAN class="operator token"&gt;--&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="keyword token"&gt;case&lt;/SPAN&gt; LOD &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;color&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="keyword token"&gt;case&lt;/SPAN&gt; LOD &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;color&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="keyword token"&gt;case&lt;/SPAN&gt; LOD &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;color&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;color&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Make sure the rule attribute LOD is connected to the layer attribute:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/377867_pastedImage_3.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;When you move the camera, call the following python script:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; scripting &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# get a CityEngine instance&lt;/SPAN&gt;
ce &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; CE&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; __name__ &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'__main__'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; l &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ce&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getObjectsFrom&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ce&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;scene&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; ce&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isLayer&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; ce&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;withName&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"'LOD"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; CameraPoI &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ce&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;get3DViews&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getCameraPoI&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ce&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;setAttributeLayerExtents&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;l&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;CameraPoI&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;CameraPoI&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3000&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3000&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ce&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;setLayerAttributes&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;l&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"attr LOD = sin(u * 180) * sin(v * 180) * 4"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; sceneShapes &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ce&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getObjectsFrom&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ce&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;scene&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; ce&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isShape&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ce&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;generateModels&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;sceneShapes&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then your city should look like this:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/377844_pastedImage_1.png" style="width: 620px; height: 489px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:55:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-move-a-constraint-map-based-on/m-p/751857#M9909</guid>
      <dc:creator>ThomasFuchs</dc:creator>
      <dc:date>2021-12-12T07:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to move a constraint map based on th xz coordinates of the current view?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-move-a-constraint-map-based-on/m-p/751858#M9910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is genuinely cool! Thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Oct 2017 12:10:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-move-a-constraint-map-based-on/m-p/751858#M9910</guid>
      <dc:creator>NicolaiSteinø</dc:creator>
      <dc:date>2017-10-11T12:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to move a constraint map based on th xz coordinates of the current view?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-move-a-constraint-map-based-on/m-p/751859#M9911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Amazing!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;"Make sure the rule attribute LOD is connected to the layer attribute"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;How do you do that? &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Oct 2017 09:02:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-move-a-constraint-map-based-on/m-p/751859#M9911</guid>
      <dc:creator>AbeleGiandoso</dc:creator>
      <dc:date>2017-10-12T09:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to move a constraint map based on th xz coordinates of the current view?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-move-a-constraint-map-based-on/m-p/751860#M9912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the Inspector, click on the drop down arrow next to the rule attribute (see Thomas's screenshot) -&amp;gt; Connect Attribute -&amp;gt; Layer attribute -&amp;gt; select&amp;nbsp;LOD.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Oct 2017 13:38:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/is-it-possible-to-move-a-constraint-map-based-on/m-p/751860#M9912</guid>
      <dc:creator>CherylLau</dc:creator>
      <dc:date>2017-10-13T13:38:52Z</dc:date>
    </item>
  </channel>
</rss>

