<?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: Collapse ModifierStack  and keep instances in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/collapse-modifierstack-and-keep-instances/m-p/13058742#M5603</link>
    <description>&lt;P&gt;Great if the code above works... Good luck either way.&lt;/P&gt;</description>
    <pubDate>Wed, 02 Oct 2024 05:00:08 GMT</pubDate>
    <dc:creator>denisT.MaxDoctor</dc:creator>
    <dc:date>2024-10-02T05:00:08Z</dc:date>
    <item>
      <title>Collapse ModifierStack  and keep instances</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/collapse-modifierstack-and-keep-instances/m-p/10150393#M5594</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need a script for collapsing the modifier stack of all selected objects. Right now the Collapse button under the Utilities panel works but loses the instances.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 02:39:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/collapse-modifierstack-and-keep-instances/m-p/10150393#M5594</guid>
      <dc:creator>rartidiello</dc:creator>
      <dc:date>2021-03-12T02:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: Collapse ModifierStack  and keep instances</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/collapse-modifierstack-and-keep-instances/m-p/10152713#M5595</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6054491"&gt;@rartidiello&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need a script for collapsing the modifier stack of all selected objects. Right now the Collapse button under the Utilities panel works but loses the instances.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;something like this...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fn collapseNodes nodes = 
(
	for node in nodes do maxops.collapsenodeto node node.modifiers.count off
)

/*
collapseNodes selection
*/&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or this...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;mapped fn collapseNodeToBase node = (maxops.collapsenodeto node node.modifiers.count off)
/*
collapseNodeToBase selection
*/&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 20:49:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/collapse-modifierstack-and-keep-instances/m-p/10152713#M5595</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2021-03-12T20:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Collapse ModifierStack  and keep instances</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/collapse-modifierstack-and-keep-instances/m-p/10153148#M5596</link>
      <description>thanks! works like a charm</description>
      <pubDate>Sat, 13 Mar 2021 02:10:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/collapse-modifierstack-and-keep-instances/m-p/10153148#M5596</guid>
      <dc:creator>rartidiello</dc:creator>
      <dc:date>2021-03-13T02:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: Collapse ModifierStack  and keep instances</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/collapse-modifierstack-and-keep-instances/m-p/11283116#M5597</link>
      <description>&lt;P&gt;Could someone help me, try to run those scripts and nothing happens at all &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 13:21:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/collapse-modifierstack-and-keep-instances/m-p/11283116#M5597</guid>
      <dc:creator>rutalauzikaite</dc:creator>
      <dc:date>2022-07-07T13:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Collapse ModifierStack  and keep instances</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/collapse-modifierstack-and-keep-instances/m-p/13058539#M5598</link>
      <description>&lt;P&gt;Can these be updated to work on 2024?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 01:38:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/collapse-modifierstack-and-keep-instances/m-p/13058539#M5598</guid>
      <dc:creator>jesped</dc:creator>
      <dc:date>2024-10-02T01:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: Collapse ModifierStack  and keep instances</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/collapse-modifierstack-and-keep-instances/m-p/13058624#M5599</link>
      <description>&lt;P&gt;what is not working in 2024?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 03:13:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/collapse-modifierstack-and-keep-instances/m-p/13058624#M5599</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-10-02T03:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: Collapse ModifierStack  and keep instances</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/collapse-modifierstack-and-keep-instances/m-p/13058665#M5600</link>
      <description>&lt;P&gt;I select one object with 'Select Dependents' enabled:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;IMG src="https://i.postimg.cc/kGrP5FWg/image.png" border="0" /&gt;&lt;/DIV&gt;&lt;P&gt;Which selects 185 objects.&lt;BR /&gt;&lt;BR /&gt;I save the script as a .ms file:&lt;BR /&gt;&lt;IMG src="https://i.postimg.cc/Gp9WJSQp/image.png" border="0" /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I run the script&amp;nbsp;&lt;BR /&gt;&lt;IMG src="https://i.postimg.cc/8zz9Nnxb/image.png" border="0" /&gt;&lt;BR /&gt;...and nothing at all happens, with either of the scripts. Am I doing something wrong? &lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This is the modifiers stack of the objects:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jesped_2-1727841138102.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1416707i7C53E1AF3B49F59D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jesped_2-1727841138102.png" alt="jesped_2-1727841138102.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Ideally, I would want to convert all those 185 objects to 'Editable Mesh', but preserving instances.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 03:54:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/collapse-modifierstack-and-keep-instances/m-p/13058665#M5600</guid>
      <dc:creator>jesped</dc:creator>
      <dc:date>2024-10-02T03:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: Collapse ModifierStack  and keep instances</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/collapse-modifierstack-and-keep-instances/m-p/13058675#M5601</link>
      <description>&lt;P&gt;first of all the executable code looks as:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;for node in selection do maxops.collapsenodeto node node.modifiers.count on&lt;/LI-CODE&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;second, dependent nodes are not exactly instances. There are other mechanics to find all instances of a node.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and third, if you do everything right, I'm pretty sure it will still work in 2027 at least.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 04:11:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/collapse-modifierstack-and-keep-instances/m-p/13058675#M5601</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-10-02T04:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: Collapse ModifierStack  and keep instances</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/collapse-modifierstack-and-keep-instances/m-p/13058705#M5602</link>
      <description>&lt;P&gt;Using 'Edit - Select Instances' didn't work either.&lt;BR /&gt;&lt;BR /&gt;But this other script did:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;if selection.count != 0 do&lt;/DIV&gt;&lt;DIV&gt;(&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;local firstInstances = #()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;for o in selection do&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;InstanceMgr.GetInstances o &amp;amp;firstOnly&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if firstOnly.count &amp;gt; 1 do&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;append firstInstances firstOnly[firstOnly.count-1]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if firstInstances.count != 0 do select firstInstances&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;for obj in $ do&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;addModifier obj (Edit_Mesh())&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;for obj in $ do&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;maxOps.CollapseNodeTo obj 1 off&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks anyway.&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 02 Oct 2024 04:34:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/collapse-modifierstack-and-keep-instances/m-p/13058705#M5602</guid>
      <dc:creator>jesped</dc:creator>
      <dc:date>2024-10-02T04:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: Collapse ModifierStack  and keep instances</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/collapse-modifierstack-and-keep-instances/m-p/13058742#M5603</link>
      <description>&lt;P&gt;Great if the code above works... Good luck either way.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 05:00:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/collapse-modifierstack-and-keep-instances/m-p/13058742#M5603</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-10-02T05:00:08Z</dc:date>
    </item>
  </channel>
</rss>

