<?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 Bake Light and Shadows with python in VRED Forum</title>
    <link>https://forums.autodesk.com/t5/vred-forum/bake-light-and-shadows-with-python/m-p/12904172#M328</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I would like to bake the Ambient Occlusion to vertices with python, I probably missing something cause once I execute it, it just erases my previous Ambient Occlusion and keep it blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the code:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;def bakeAO():
    node_ptrs = vrNodeService.getSelectedNodes()
    
    # illuminationBakeSettings
    illuminationBakeSetting_ptr = vrdIlluminationBakeSettings()
    
    illuminationBakeSetting_ptr.setAmbientOcclusionMaximumDistance(3000.0)
    illuminationBakeSetting_ptr.setAmbientOcclusionMinimumDistance(1.0)
    illuminationBakeSetting_ptr.setAmbientOcclusionWeight(vrBakeTypes.AmbientOcclusionWeight.Uniform)
    illuminationBakeSetting_ptr.setColorBleeding(False)
    illuminationBakeSetting_ptr.setDirectIlluminationMode(vrBakeTypes.DirectIlluminationMode.AmbientOcclusion)
    illuminationBakeSetting_ptr.setIndirectIllumination(False)

    # textureBakeSettings
    textureSetting_ptr = vrdTextureBakeSettings()
    
    vrBakeService.bakeToTexture(node_ptrs, illuminationBakeSetting_ptr, textureSetting_ptr, replaceTextureBake=True)

bakeAO()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the default settings I tried to reproduce:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="the settings intended..." style="width: 554px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1388015i9011D2A48A3715CB/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="the settings intended..." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;the settings intended...&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jul 2024 02:50:04 GMT</pubDate>
    <dc:creator>mfontan9</dc:creator>
    <dc:date>2024-07-18T02:50:04Z</dc:date>
    <item>
      <title>Bake Light and Shadows with python</title>
      <link>https://forums.autodesk.com/t5/vred-forum/bake-light-and-shadows-with-python/m-p/12904172#M328</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I would like to bake the Ambient Occlusion to vertices with python, I probably missing something cause once I execute it, it just erases my previous Ambient Occlusion and keep it blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the code:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;def bakeAO():
    node_ptrs = vrNodeService.getSelectedNodes()
    
    # illuminationBakeSettings
    illuminationBakeSetting_ptr = vrdIlluminationBakeSettings()
    
    illuminationBakeSetting_ptr.setAmbientOcclusionMaximumDistance(3000.0)
    illuminationBakeSetting_ptr.setAmbientOcclusionMinimumDistance(1.0)
    illuminationBakeSetting_ptr.setAmbientOcclusionWeight(vrBakeTypes.AmbientOcclusionWeight.Uniform)
    illuminationBakeSetting_ptr.setColorBleeding(False)
    illuminationBakeSetting_ptr.setDirectIlluminationMode(vrBakeTypes.DirectIlluminationMode.AmbientOcclusion)
    illuminationBakeSetting_ptr.setIndirectIllumination(False)

    # textureBakeSettings
    textureSetting_ptr = vrdTextureBakeSettings()
    
    vrBakeService.bakeToTexture(node_ptrs, illuminationBakeSetting_ptr, textureSetting_ptr, replaceTextureBake=True)

bakeAO()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the default settings I tried to reproduce:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="the settings intended..." style="width: 554px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1388015i9011D2A48A3715CB/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="the settings intended..." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;the settings intended...&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 02:50:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/bake-light-and-shadows-with-python/m-p/12904172#M328</guid>
      <dc:creator>mfontan9</dc:creator>
      <dc:date>2024-07-18T02:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: Bake Light and Shadows with python</title>
      <link>https://forums.autodesk.com/t5/vred-forum/bake-light-and-shadows-with-python/m-p/12904618#M329</link>
      <description>&lt;P&gt;The old vertex baking is currently not exposed in the new python API, you will have to use the vrAmbientOcclusion Module of the Python V1 API. The BakeService currently is only for texture baking.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 07:42:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/bake-light-and-shadows-with-python/m-p/12904618#M329</guid>
      <dc:creator>michael_nikelsky</dc:creator>
      <dc:date>2024-07-18T07:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Bake Light and Shadows with python</title>
      <link>https://forums.autodesk.com/t5/vred-forum/bake-light-and-shadows-with-python/m-p/12904631#M330</link>
      <description>&lt;P&gt;Alright, it's confusing, but you saved my day!&lt;BR /&gt;Thank you&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2176632"&gt;@michael_nikelsky&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 07:50:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/bake-light-and-shadows-with-python/m-p/12904631#M330</guid>
      <dc:creator>mfontan9</dc:creator>
      <dc:date>2024-07-18T07:50:03Z</dc:date>
    </item>
  </channel>
</rss>

