<?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 select shading group in Mel? in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/how-to-select-shading-group-in-mel/m-p/12238437#M802</link>
    <description>&lt;P&gt;Hi, today I was surprised to find out I can't store a shading group in a variable and then use that variable to select it. I created a blinn shader and manually selected it's shading group node, then I ran in the script editor&lt;/P&gt;&lt;P&gt;string $temp[] = `ls -sl`;&lt;/P&gt;&lt;P&gt;select $temp;&lt;/P&gt;&lt;P&gt;And that doesn't select my shading group, is there something I'm missing here?&lt;/P&gt;</description>
    <pubDate>Wed, 13 Sep 2023 18:39:22 GMT</pubDate>
    <dc:creator>malcolm_341</dc:creator>
    <dc:date>2023-09-13T18:39:22Z</dc:date>
    <item>
      <title>How to select shading group in Mel?</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/how-to-select-shading-group-in-mel/m-p/12238437#M802</link>
      <description>&lt;P&gt;Hi, today I was surprised to find out I can't store a shading group in a variable and then use that variable to select it. I created a blinn shader and manually selected it's shading group node, then I ran in the script editor&lt;/P&gt;&lt;P&gt;string $temp[] = `ls -sl`;&lt;/P&gt;&lt;P&gt;select $temp;&lt;/P&gt;&lt;P&gt;And that doesn't select my shading group, is there something I'm missing here?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 18:39:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/how-to-select-shading-group-in-mel/m-p/12238437#M802</guid>
      <dc:creator>malcolm_341</dc:creator>
      <dc:date>2023-09-13T18:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to select shading group in Mel?</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/how-to-select-shading-group-in-mel/m-p/12238536#M803</link>
      <description>&lt;P&gt;Shading Groups,(SG) are sets&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;When you select a set (using mel/python) , it selects the items in the set by default.&lt;/P&gt;&lt;P&gt;&amp;nbsp;( this works this way for all sets)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but&amp;nbsp; ,if you want to select the set itself. you want to use the noExpand flag (-ne -noExpand )&lt;/P&gt;&lt;P&gt;so if you run&amp;nbsp;&lt;/P&gt;&lt;P&gt;string $sel[] = `ls -sl`;&lt;/P&gt;&lt;P&gt;select -ne $sel;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but be aware that mel will return a single object from ls -sl if you have a single object. but an array , if you have multiple objects&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so if you select multiple shaderGroups., you want to index the array&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;string $sel[] = `ls -sl`;&lt;/P&gt;&lt;P&gt;select -ne $sel[0];&lt;BR /&gt;select -ne $sel[1];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hth&lt;/P&gt;&lt;P&gt;-=s&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;&amp;nbsp;&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;</description>
      <pubDate>Wed, 13 Sep 2023 19:32:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/how-to-select-shading-group-in-mel/m-p/12238536#M803</guid>
      <dc:creator>stephenkmann</dc:creator>
      <dc:date>2023-09-13T19:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to select shading group in Mel?</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/how-to-select-shading-group-in-mel/m-p/12240917#M804</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1068756"&gt;@stephenkmann&lt;/a&gt;&amp;nbsp;&amp;nbsp; That did the trick, thanks! I didn't know about this set workflow.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2023 16:52:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/how-to-select-shading-group-in-mel/m-p/12240917#M804</guid>
      <dc:creator>malcolm_341</dc:creator>
      <dc:date>2023-09-14T16:52:47Z</dc:date>
    </item>
  </channel>
</rss>

