<?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 Re: How to select faces by Its Material? in Maya Shading, Lighting and Rendering Forum</title>
    <link>https://forums.autodesk.com/t5/maya-shading-lighting-and/how-to-select-faces-by-its-material/m-p/9248175#M24414</link>
    <description>&lt;P&gt;Hi, I really need this script to work, as I have multiple objects which have multiple shaders assigned. However, I'm receiving this error for a given material:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error: ValueError: file &amp;lt;maya console&amp;gt; line 6: No object matches name: Metal.oc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"Metal" is the shader I'm trying to switch out with a different one on my selected object. Can this be fixed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My specs:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maya '20&lt;/P&gt;&lt;P&gt;Win10 64bit&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much in advance.&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jan 2020 22:23:18 GMT</pubDate>
    <dc:creator>andymc4997</dc:creator>
    <dc:date>2020-01-13T22:23:18Z</dc:date>
    <item>
      <title>How to select faces by Its Material?</title>
      <link>https://forums.autodesk.com/t5/maya-shading-lighting-and/how-to-select-faces-by-its-material/m-p/5974046#M24408</link>
      <description>&lt;P&gt;Is there a way I can select all the faces which are assigned to a certain material?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 16:23:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-shading-lighting-and/how-to-select-faces-by-its-material/m-p/5974046#M24408</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-05T16:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to select faces by Its Material?</title>
      <link>https://forums.autodesk.com/t5/maya-shading-lighting-and/how-to-select-faces-by-its-material/m-p/5974141#M24409</link>
      <description>&lt;P&gt;Go into the hypershader and right click on a shader and select select objects by material.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 17:10:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-shading-lighting-and/how-to-select-faces-by-its-material/m-p/5974141#M24409</guid>
      <dc:creator>J450NP13</dc:creator>
      <dc:date>2016-01-05T17:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to select faces by Its Material?</title>
      <link>https://forums.autodesk.com/t5/maya-shading-lighting-and/how-to-select-faces-by-its-material/m-p/8822046#M24410</link>
      <description>&lt;P&gt;this is not an answer to selecting faces, only objects with said materials. If you have an object with multiple materials then this can be a problem.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 19:31:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-shading-lighting-and/how-to-select-faces-by-its-material/m-p/8822046#M24410</guid>
      <dc:creator>jewboy0117</dc:creator>
      <dc:date>2019-05-29T19:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to select faces by Its Material?</title>
      <link>https://forums.autodesk.com/t5/maya-shading-lighting-and/how-to-select-faces-by-its-material/m-p/8889443#M24411</link>
      <description>&lt;P&gt;If you follow the steps above, you can selected faces with different materials in the same object.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 02:18:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-shading-lighting-and/how-to-select-faces-by-its-material/m-p/8889443#M24411</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-04T02:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to select faces by Its Material?</title>
      <link>https://forums.autodesk.com/t5/maya-shading-lighting-and/how-to-select-faces-by-its-material/m-p/9137313#M24412</link>
      <description>&lt;P&gt;The problem is only when you want to select the faces of only one of many objects that have this particular shader between many others. If you have one object with multi materials, it select only the faces with your choice on the object.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Nov 2019 18:02:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-shading-lighting-and/how-to-select-faces-by-its-material/m-p/9137313#M24412</guid>
      <dc:creator>Climber_FX</dc:creator>
      <dc:date>2019-11-09T18:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to select faces by Its Material?</title>
      <link>https://forums.autodesk.com/t5/maya-shading-lighting-and/how-to-select-faces-by-its-material/m-p/9146512#M24413</link>
      <description>&lt;P&gt;Use this Python script.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;import maya.cmds as mc
# select object or face
b = mc.ls(sl=1)[0].split("[")[0] # remember a token for comparison below
mc.hyperShade(smn=1) # that will select the shader
s = mc.ls(sl=1)[0] # remember the selected shader
sg = mc.listConnections(s+".oc", s=0, d=1)[0] # figure out the shading group
# select the faces of the same object with same shader attached
l = []
for o in mc.sets(sg, q=1):
    if b not in o: continue
    l.append(o)
mc.select(l)&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Nov 2019 13:42:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-shading-lighting-and/how-to-select-faces-by-its-material/m-p/9146512#M24413</guid>
      <dc:creator>Christoph_Schaedl</dc:creator>
      <dc:date>2019-11-14T13:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to select faces by Its Material?</title>
      <link>https://forums.autodesk.com/t5/maya-shading-lighting-and/how-to-select-faces-by-its-material/m-p/9248175#M24414</link>
      <description>&lt;P&gt;Hi, I really need this script to work, as I have multiple objects which have multiple shaders assigned. However, I'm receiving this error for a given material:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error: ValueError: file &amp;lt;maya console&amp;gt; line 6: No object matches name: Metal.oc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"Metal" is the shader I'm trying to switch out with a different one on my selected object. Can this be fixed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My specs:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maya '20&lt;/P&gt;&lt;P&gt;Win10 64bit&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 22:23:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-shading-lighting-and/how-to-select-faces-by-its-material/m-p/9248175#M24414</guid>
      <dc:creator>andymc4997</dc:creator>
      <dc:date>2020-01-13T22:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to select faces by Its Material?</title>
      <link>https://forums.autodesk.com/t5/maya-shading-lighting-and/how-to-select-faces-by-its-material/m-p/9819671#M24415</link>
      <description>&lt;P&gt;Hi Andy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you need to select another shader, specify the index (change 0 by another index) :&lt;/P&gt;&lt;PRE&gt;s = mc.ls(sl=1)[0]&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the ".oc" problem, replace :&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;sg = mc.listConnections(s+".oc", s=0, d=1)[0]&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;with :&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;sg = mc.listConnections(s, s=0, d=1)[0]&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 23 Oct 2020 05:51:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-shading-lighting-and/how-to-select-faces-by-its-material/m-p/9819671#M24415</guid>
      <dc:creator>kopacabana</dc:creator>
      <dc:date>2020-10-23T05:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to select faces by Its Material?</title>
      <link>https://forums.autodesk.com/t5/maya-shading-lighting-and/how-to-select-faces-by-its-material/m-p/10526876#M24416</link>
      <description>sux&lt;BR /&gt;</description>
      <pubDate>Sat, 07 Aug 2021 00:43:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-shading-lighting-and/how-to-select-faces-by-its-material/m-p/10526876#M24416</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-07T00:43:36Z</dc:date>
    </item>
  </channel>
</rss>

