<?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 multiple polygons by material ID in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-select-multiple-polygons-by-material-id/m-p/9730255#M18367</link>
    <description>&lt;P&gt;this list of id - name corresponds to the list of submaterial names of the applied multimaterial. which can be accessed as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$.material.names&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS. the order of names in the material names and poly-id name list can be different. As far as I remember, for poly it is always ascending order of ids. For material, name order corresponds to the order in the list of id, which can be anything.&lt;/P&gt;&lt;P&gt;see:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;$ .material.materialIDList&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Sep 2020 17:05:52 GMT</pubDate>
    <dc:creator>denisT.MaxDoctor</dc:creator>
    <dc:date>2020-09-04T17:05:52Z</dc:date>
    <item>
      <title>How to select multiple polygons by material ID</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-select-multiple-polygons-by-material-id/m-p/4247868#M18362</link>
      <description>Hello-&lt;BR /&gt;&lt;BR /&gt;I am wondering if anyone knows how I can simplify a process.&lt;BR /&gt;&lt;BR /&gt;I have a model with duplicate materials in multi/sub-object material, but the materials have different names.&lt;BR /&gt;&lt;BR /&gt;What I want to do is select those Material IDs and assign them the same ID.&lt;BR /&gt;&lt;BR /&gt;From the Listener:&lt;BR /&gt;&lt;BR /&gt;$.EditablePoly.selectByMaterial 7&lt;BR /&gt;$.EditablePoly.setMaterialIndex 5&lt;BR /&gt;$.EditablePoly.selectByMaterial 71&lt;BR /&gt;$.EditablePoly.setMaterialIndex 5&lt;BR /&gt;$.EditablePoly.selectByMaterial 72&lt;BR /&gt;$.EditablePoly.setMaterialIndex 5&lt;BR /&gt;$.EditablePoly.selectByMaterial 73&lt;BR /&gt;$.EditablePoly.setMaterialIndex 5&lt;BR /&gt;$.EditablePoly.selectByMaterial 74&lt;BR /&gt;$.EditablePoly.setMaterialIndex 5&lt;BR /&gt;$.EditablePoly.selectByMaterial 75&lt;BR /&gt;$.EditablePoly.setMaterialIndex 5&lt;BR /&gt;&lt;BR /&gt;If I know the IDs I want to change, can I input them all at once (i.e 80, 81, 82, 83, 84, etc...)?&lt;BR /&gt;&lt;BR /&gt;Thanks for the help!</description>
      <pubDate>Thu, 17 May 2012 15:39:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-select-multiple-polygons-by-material-id/m-p/4247868#M18362</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-17T15:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to select multiple polygons by material ID</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-select-multiple-polygons-by-material-id/m-p/4247869#M18363</link>
      <description>Have you tried with a for loop. If your matID's are in order you can do something like this:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;for i = 70 to 85 by 1 do &lt;BR /&gt;  (&lt;BR /&gt;   $.EditablePoly.selectByMaterial i&lt;BR /&gt;   $.EditablePoly.setMaterialIndex 5&lt;BR /&gt;  )&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 May 2012 00:41:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-select-multiple-polygons-by-material-id/m-p/4247869#M18363</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-28T00:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to select multiple polygons by material ID</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-select-multiple-polygons-by-material-id/m-p/4247870#M18364</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;BR /&gt;...&lt;BR /&gt;What I want to do is select those Material IDs and assign them the same ID.&lt;BR /&gt;...&lt;BR /&gt;If I know the IDs I want to change, can I input them all at once (i.e 80, 81, 82, 83, 84, &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;You not need to select first this faces to be able to set new mtlID.&lt;BR /&gt;That process is slow.&lt;BR /&gt;This function will do the job.(works only with editable poly objects)&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;fn findAndSetMtlID obj findIDs: newID: selectFaces: = if isKindOf obj Editable_Poly do&lt;BR /&gt;(&lt;BR /&gt; local getfaceID = polyop.getFaceMatID&lt;BR /&gt; local facesList = #{}&lt;BR /&gt; for f in obj.faces as bitarray where finditem findIDs (getfaceID obj f) != 0 do append facesList f&lt;BR /&gt; if facesList.numberset != 0 then polyop.setFaceMatID obj facesList newID else false&lt;BR /&gt; if selectFaces == on do obj.selectedfaces = facesList&lt;BR /&gt;)&lt;BR /&gt;mtlArr = #(75,76,77,78,79,80)&lt;BR /&gt;findAndSetMtlID $ findIDs:mtlArr newID:5 selectFaces:off &lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 02 Jun 2012 19:20:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-select-multiple-polygons-by-material-id/m-p/4247870#M18364</guid>
      <dc:creator>barigazy</dc:creator>
      <dc:date>2012-06-02T19:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to select multiple polygons by material ID</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-select-multiple-polygons-by-material-id/m-p/4247871#M18365</link>
      <description>Thanks guys-&lt;BR /&gt;&lt;BR /&gt;I will give these methods a try.&lt;BR /&gt;&lt;BR /&gt;I appreciate the help!&lt;BR /&gt;&lt;BR /&gt;-Jonny5isAlive</description>
      <pubDate>Sun, 03 Jun 2012 01:40:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-select-multiple-polygons-by-material-id/m-p/4247871#M18365</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-03T01:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to select multiple polygons by material ID</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-select-multiple-polygons-by-material-id/m-p/9729338#M18366</link>
      <description>&lt;P&gt;Hello;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm interrested by this post. My issue is : i have a hunded of CivilView cars in my model. CivilView car have a multi/subobject material depending on the model of the car.&lt;/P&gt;&lt;P&gt;If i poly edit a car i can select the body of the car simply by clicking the sub material in the Polygons Material IDs lists (just below set ID). I'd like to fetch this material list butr i can't find the command.&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="Capture.PNG" style="width: 362px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/815101i085190E5519E4FB3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for help&lt;/P&gt;</description>
      <pubDate>Fri, 04 Sep 2020 08:54:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-select-multiple-polygons-by-material-id/m-p/9729338#M18366</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-04T08:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to select multiple polygons by material ID</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-select-multiple-polygons-by-material-id/m-p/9730255#M18367</link>
      <description>&lt;P&gt;this list of id - name corresponds to the list of submaterial names of the applied multimaterial. which can be accessed as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$.material.names&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS. the order of names in the material names and poly-id name list can be different. As far as I remember, for poly it is always ascending order of ids. For material, name order corresponds to the order in the list of id, which can be anything.&lt;/P&gt;&lt;P&gt;see:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;$ .material.materialIDList&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Sep 2020 17:05:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-select-multiple-polygons-by-material-id/m-p/9730255#M18367</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2020-09-04T17:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to select multiple polygons by material ID</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-select-multiple-polygons-by-material-id/m-p/9730938#M18368</link>
      <description>&lt;P&gt;Thanks Denis. Unfortunatly it's not the solution.&lt;/P&gt;&lt;P&gt;A CivilView car material consist in 26 submaterials. The first 9 are different body colors, they are the ones i want to play with.&lt;/P&gt;&lt;P&gt;I need to access the used submaterial list which i can find in the polygons material IDs section.&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="Annotation 2020-09-04 110553.png" style="width: 364px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/815493iCD2E6715E87E9D24/image-size/large?v=v2&amp;amp;px=999" role="button" title="Annotation 2020-09-04 110553.png" alt="Annotation 2020-09-04 110553.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The function you gave me sends me back the whole list of submaterials.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attach an exemple file of CivilView cars.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Sep 2020 05:24:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-select-multiple-polygons-by-material-id/m-p/9730938#M18368</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-05T05:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to select multiple polygons by material ID</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-select-multiple-polygons-by-material-id/m-p/9731332#M18369</link>
      <description>&lt;P&gt;Some of us have misunderstood something ...&lt;/P&gt;&lt;P&gt;I repeat once more -&lt;/P&gt;&lt;P&gt;to get the Editable_Poly object's id names list, you need to ask the applied multi-material name list. The index of the name corresponds to the index in the Material ID list.&lt;/P&gt;&lt;P&gt;Thus, if you know the name of the sub material and use what I explained above, you can select faces as the following:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;fn selectByMaterialName poly name = 
(
	if iskindof poly Editable_Poly and iskindof (mat = poly.material) MultiMaterial do
	(
		if (k = finditem mat.names name) &amp;gt; 0 do
		(
			id = mat.materialIDList[k]
			poly.selectByMaterial id clearCurrentSelection:on
		)
	)
)

/* 
selectByMaterialName poly name
*/&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where poly is the current edit object and the face sub-object selection level used&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Sep 2020 16:18:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-select-multiple-polygons-by-material-id/m-p/9731332#M18369</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2020-09-05T16:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to select multiple polygons by material ID</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-select-multiple-polygons-by-material-id/m-p/9731948#M18370</link>
      <description>&lt;P&gt;Thanks Denis. I found a workaround. But i'll try your function.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Sep 2020 12:38:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-select-multiple-polygons-by-material-id/m-p/9731948#M18370</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-06T12:38:38Z</dc:date>
    </item>
  </channel>
</rss>

