<?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 check if an render setup layer override is applied to object X? in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/how-to-check-if-an-render-setup-layer-override-is-applied-to/m-p/7586104#M10819</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to parse all layers and check if an attribute of some objects is set-&lt;/P&gt;&lt;P&gt;As layer overrides can change these values, I need to parse all layers if the override is applied.&lt;/P&gt;&lt;P&gt;So far I have this code to get a list of overrides of all layers:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rs = renderSetup.instance()&lt;BR /&gt;rLayers = rs.getRenderLayers()&lt;/P&gt;&lt;P&gt;for layer in rLayers:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; colList= layer.getCollections()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for col in colList:&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; overrides=col.getOverrides()&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; for oride in overrides:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print("override applied to attribute "+oride.attributeName())&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But now I need to know if my object is in that layer collection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know from the UI interface that you can add objects by its absolute name or by a filter like&amp;nbsp; *myobj*.&lt;/P&gt;&lt;P&gt;But how do I get this information via script?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 30 Nov 2017 15:46:23 GMT</pubDate>
    <dc:creator>h.schoenberger</dc:creator>
    <dc:date>2017-11-30T15:46:23Z</dc:date>
    <item>
      <title>How to check if an render setup layer override is applied to object X?</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/how-to-check-if-an-render-setup-layer-override-is-applied-to/m-p/7586104#M10819</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to parse all layers and check if an attribute of some objects is set-&lt;/P&gt;&lt;P&gt;As layer overrides can change these values, I need to parse all layers if the override is applied.&lt;/P&gt;&lt;P&gt;So far I have this code to get a list of overrides of all layers:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rs = renderSetup.instance()&lt;BR /&gt;rLayers = rs.getRenderLayers()&lt;/P&gt;&lt;P&gt;for layer in rLayers:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; colList= layer.getCollections()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for col in colList:&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; overrides=col.getOverrides()&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; for oride in overrides:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print("override applied to attribute "+oride.attributeName())&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But now I need to know if my object is in that layer collection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know from the UI interface that you can add objects by its absolute name or by a filter like&amp;nbsp; *myobj*.&lt;/P&gt;&lt;P&gt;But how do I get this information via script?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 15:46:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/how-to-check-if-an-render-setup-layer-override-is-applied-to/m-p/7586104#M10819</guid>
      <dc:creator>h.schoenberger</dc:creator>
      <dc:date>2017-11-30T15:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if an render setup layer override is applied to object X?</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/how-to-check-if-an-render-setup-layer-override-is-applied-to/m-p/7592758#M10820</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For testing if the object is in a layer you could try renderLayerMembers command like below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;renderLayerMembers "myCylinder" -notIn true -renderLayers "MyRenderSetupLayer"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For collections in renderLayer, I am afraid you'll need to test them yourself. You could get a collection's selector with&amp;nbsp;col.getSelector().&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A simpleSelector could get its selection with selection() and it has an iterator path.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yours,&lt;/P&gt;
&lt;P&gt;Li&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2017 02:38:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/how-to-check-if-an-render-setup-layer-override-is-applied-to/m-p/7592758#M10820</guid>
      <dc:creator>cheng_xi_li</dc:creator>
      <dc:date>2017-12-04T02:38:40Z</dc:date>
    </item>
  </channel>
</rss>

