<?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: fetch dynamic array of node pointers in SDK in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/fetch-dynamic-array-of-node-pointers-in-sdk/m-p/5551427#M15516</link>
    <description>&lt;P&gt;Got it, someone sent me some samples....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;////INodeTab way

INodeTab nodes;
for (auto i = 0; i &amp;lt; ip-&amp;gt;GetSelNodeCount(); ++i)
      nodes.AppendNode(ip-&amp;gt;GetSelNode(i));

or

//// MaxSDK::Array

MaxSDK::Array&amp;lt;INode*&amp;gt; nodes;
for (auto i = 0; i &amp;lt; ip-&amp;gt;GetSelNodeCount(); ++i)
      nodes.append(ip-&amp;gt;GetSelNode(i));


or 

////std::vector

std::vector&amp;lt;INode*&amp;gt; nodes;
for (auto i = 0; i &amp;lt; ip-&amp;gt;GetSelNodeCount(); ++i)
      nodes.push_back(ip-&amp;gt;GetSelNode(i));

&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;All work well.&lt;/P&gt;</description>
    <pubDate>Sat, 21 Mar 2015 11:26:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-03-21T11:26:44Z</dc:date>
    <item>
      <title>fetch dynamic array of node pointers in SDK</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/fetch-dynamic-array-of-node-pointers-in-sdk/m-p/5550774#M15514</link>
      <description>&lt;P&gt;How would you handle a fetch of node pointers to use later?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;int N_Count = ip-&amp;gt;GetSelNodeCount();
INode *MyNodes;
MyNodes = new INode[N_Count];

for (int i = 0; i &amp;lt; ip-&amp;gt;GetSelNodeCount(); i++){
	MyNodes[i] = ip-&amp;gt;GetSelNode(i);
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2015 17:41:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/fetch-dynamic-array-of-node-pointers-in-sdk/m-p/5550774#M15514</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-20T17:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: fetch dynamic array of node pointers in SDK</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/fetch-dynamic-array-of-node-pointers-in-sdk/m-p/5551390#M15515</link>
      <description>&lt;P&gt;It depends if you expect any changes in scene structure&amp;nbsp;between your calls.&lt;/P&gt;&lt;P&gt;If the scene will not change than it should be fine, though you might consider INodeTab for this.&lt;/P&gt;&lt;P&gt;Otherwise it's best to store&amp;nbsp;Animatable::GetHandleByAnim and get INode* back with&amp;nbsp;Animatable::GetAnimByHandle (just test if it's not NULL, like for deleted nodes).&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Mar 2015 08:09:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/fetch-dynamic-array-of-node-pointers-in-sdk/m-p/5551390#M15515</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-21T08:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: fetch dynamic array of node pointers in SDK</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/fetch-dynamic-array-of-node-pointers-in-sdk/m-p/5551427#M15516</link>
      <description>&lt;P&gt;Got it, someone sent me some samples....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;////INodeTab way

INodeTab nodes;
for (auto i = 0; i &amp;lt; ip-&amp;gt;GetSelNodeCount(); ++i)
      nodes.AppendNode(ip-&amp;gt;GetSelNode(i));

or

//// MaxSDK::Array

MaxSDK::Array&amp;lt;INode*&amp;gt; nodes;
for (auto i = 0; i &amp;lt; ip-&amp;gt;GetSelNodeCount(); ++i)
      nodes.append(ip-&amp;gt;GetSelNode(i));


or 

////std::vector

std::vector&amp;lt;INode*&amp;gt; nodes;
for (auto i = 0; i &amp;lt; ip-&amp;gt;GetSelNodeCount(); ++i)
      nodes.push_back(ip-&amp;gt;GetSelNode(i));

&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;All work well.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Mar 2015 11:26:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/fetch-dynamic-array-of-node-pointers-in-sdk/m-p/5551427#M15516</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-21T11:26:44Z</dc:date>
    </item>
  </channel>
</rss>

