<?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: Make Reference in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/make-reference/m-p/11011918#M4397</link>
    <description>&lt;P&gt;There's an unexpected issue when the code above is run.&lt;/P&gt;&lt;P&gt;If the instances have a modifier stack, Max will duplicate those modifiers on top of the reference.&lt;/P&gt;&lt;P&gt;Here's an update to that code that works around it.&lt;/P&gt;&lt;P&gt;I'm not certain if there is a more elegant solution, but this gets the job done.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(&lt;BR /&gt;theMods = #()&lt;BR /&gt;myArray = #()&lt;/P&gt;&lt;P&gt;fn InstToRef instArray =&lt;BR /&gt;(&lt;BR /&gt;instancemgr.makeobjectsunique instArray #individual&lt;BR /&gt;tmpNode = copy instArray[1]&lt;BR /&gt;referencereplace instArray tmpNode&lt;BR /&gt;for i in 1 to theMods.count do&lt;BR /&gt;(&lt;BR /&gt;addModifier tmpNode theMods[i]&lt;BR /&gt;)&lt;BR /&gt;delete tmpNode&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;myArray = selection as array&lt;BR /&gt;&lt;BR /&gt;for i = myArray[1].modifiers.count to 1 by -1 do&lt;BR /&gt;(&lt;BR /&gt;append theMods myArray[1].modifiers[i]&lt;BR /&gt;deleteModifier myArray[1] i&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;InstToRef myArray&lt;BR /&gt;)&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>Thu, 17 Mar 2022 16:22:11 GMT</pubDate>
    <dc:creator>mbreathes</dc:creator>
    <dc:date>2022-03-17T16:22:11Z</dc:date>
    <item>
      <title>Make Reference</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/make-reference/m-p/10986264#M4395</link>
      <description>&lt;P&gt;Just wondering what I can type to turn a couple hundred selected instances in to references. The listener doesn't seem to record that action. Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Mar 2022 00:05:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/make-reference/m-p/10986264#M4395</guid>
      <dc:creator>GeoffKornfeld</dc:creator>
      <dc:date>2022-03-06T00:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: Make Reference</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/make-reference/m-p/11009671#M4396</link>
      <description>&lt;P&gt;fn InstToRef instArray =&lt;BR /&gt;(&lt;BR /&gt;instancemgr.makeobjectsunique instArray #individual&lt;BR /&gt;tmpNode = copy instArray[1]&lt;BR /&gt;referencereplace instArray tmpNode&lt;BR /&gt;delete tmpNode&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;myArray = selection as array&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;InstToRef myArray&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, 16 Mar 2022 20:21:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/make-reference/m-p/11009671#M4396</guid>
      <dc:creator>mbreathes</dc:creator>
      <dc:date>2022-03-16T20:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: Make Reference</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/make-reference/m-p/11011918#M4397</link>
      <description>&lt;P&gt;There's an unexpected issue when the code above is run.&lt;/P&gt;&lt;P&gt;If the instances have a modifier stack, Max will duplicate those modifiers on top of the reference.&lt;/P&gt;&lt;P&gt;Here's an update to that code that works around it.&lt;/P&gt;&lt;P&gt;I'm not certain if there is a more elegant solution, but this gets the job done.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(&lt;BR /&gt;theMods = #()&lt;BR /&gt;myArray = #()&lt;/P&gt;&lt;P&gt;fn InstToRef instArray =&lt;BR /&gt;(&lt;BR /&gt;instancemgr.makeobjectsunique instArray #individual&lt;BR /&gt;tmpNode = copy instArray[1]&lt;BR /&gt;referencereplace instArray tmpNode&lt;BR /&gt;for i in 1 to theMods.count do&lt;BR /&gt;(&lt;BR /&gt;addModifier tmpNode theMods[i]&lt;BR /&gt;)&lt;BR /&gt;delete tmpNode&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;myArray = selection as array&lt;BR /&gt;&lt;BR /&gt;for i = myArray[1].modifiers.count to 1 by -1 do&lt;BR /&gt;(&lt;BR /&gt;append theMods myArray[1].modifiers[i]&lt;BR /&gt;deleteModifier myArray[1] i&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;InstToRef myArray&lt;BR /&gt;)&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>Thu, 17 Mar 2022 16:22:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/make-reference/m-p/11011918#M4397</guid>
      <dc:creator>mbreathes</dc:creator>
      <dc:date>2022-03-17T16:22:11Z</dc:date>
    </item>
  </channel>
</rss>

