<?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: Why doesn't this work? Mesh Animation import in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/why-doesn-t-this-work-mesh-animation-import/m-p/4161632#M21777</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;I noticed you are referring to the object with its name instead of the object as I was doing? I guess I could do either? &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;Only because mine was a "code snippet" - an example - not designed to be used "as is" within another script. Using variables to hold the nodes is the usual way to deal with them, as you already are.&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt; I see the curlies around the "v" , I assume that is the array syntax.. &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;Round brackets (parentheses) for declaring an array, curley brackets (braces) for declaring a bitarray.&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;I did notice that with the method I used, there were a number of verts that were not connected correctly. &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;Without all the files to test I'm not sure why. If they have the same number of vertices, and they "match" correctly (the vertex number on the base object matches the same vertex on the imported object (in relation to the surrounding ones) then it looks like it should work.</description>
    <pubDate>Thu, 22 Jul 2010 19:50:43 GMT</pubDate>
    <dc:creator>Steve_Curley</dc:creator>
    <dc:date>2010-07-22T19:50:43Z</dc:date>
    <item>
      <title>Why doesn't this work? Mesh Animation import</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/why-doesn-t-this-work-mesh-animation-import/m-p/4161624#M21769</link>
      <description>I am trying to use a script form a Max6 book to import a number of meshes and create a single vert animated mesh from them. They were all exported from a meshmorph frame sequence. &lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;fn importMeshAnimation inName ext=&lt;BR /&gt;(&lt;BR /&gt;inFiles = GetFiles (GetDir #export + "/"+ inName + "_*" +"."+ext)&lt;BR /&gt;if inFiles.count &amp;gt; 0 do&lt;BR /&gt;(&lt;BR /&gt; sort inFiles&lt;BR /&gt; max create mode&lt;BR /&gt; with redraw off&lt;BR /&gt; (&lt;BR /&gt; importFile inFiles #noPrompt&lt;BR /&gt; baseObj = selection&lt;BR /&gt; baseObj.name = uniqueName (inName+"_Base")&lt;BR /&gt; vertCount = baseObj.numVerts&lt;BR /&gt; animateVertex baseObj #all&lt;BR /&gt; filesCount = inFiles.count&lt;BR /&gt; for f = 2 to filesCount do&lt;BR /&gt; (&lt;BR /&gt; --max select none -- deselect everything&lt;BR /&gt; pushPrompt ("Importing Mesh "+f as string+" of "+filesCount as string)&lt;BR /&gt; importFile inFiles&lt;F&gt; #noprompt&lt;BR /&gt; currentObj = selection&lt;BR /&gt; for v = 1 to  vertCount do&lt;BR /&gt; (&lt;BR /&gt; animate on at time (f-1)&lt;BR /&gt; --baseObj&lt;V&gt;.value = getVert currentObj v&lt;BR /&gt;                                -- OR&lt;BR /&gt; vertVal = getVert currentObj v&lt;BR /&gt; setVert baseObj v vertVal&lt;BR /&gt;&lt;BR /&gt; format "v = %\n" v&lt;BR /&gt; )&lt;BR /&gt; delete currentObj&lt;BR /&gt; )&lt;BR /&gt; pushPrompt "Import Finished"&lt;BR /&gt; )&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;importMeshAnimation "Meshtest" "3ds"&lt;BR /&gt; &lt;/V&gt;&lt;/F&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;This script imports the first mesh and uses it as the Base mesh to build the animation on. In my case there are 328 verts in the mesh. &lt;BR /&gt;&lt;BR /&gt;But when it gets to the first time through the "f" loop it fils and reports:&lt;BR /&gt;&lt;BR /&gt;"Runtime error: Mesh vertex index out of range: 328"&lt;BR /&gt;&lt;BR /&gt;If I specify vertCount-1 in the 'v' loop it works but the mesh has that one less vert than the original. &lt;BR /&gt;&lt;BR /&gt;Is there another script somewhere to do this? This one looks logical to me. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The reason I am doing this is to try and get the result of a displace space warp and then use turbosmooth on it. Since I can not place the turbosmooth above a space warp binding in Max&lt;BR /&gt;&lt;BR /&gt;any help appreciated! &lt;BR /&gt;&lt;BR /&gt;JOna</description>
      <pubDate>Wed, 21 Jul 2010 11:57:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/why-doesn-t-this-work-mesh-animation-import/m-p/4161624#M21769</guid>
      <dc:creator>jonavark</dc:creator>
      <dc:date>2010-07-21T11:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't this work? Mesh Animation import</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/why-doesn-t-this-work-mesh-animation-import/m-p/4161625#M21770</link>
      <description>Try printing out the vertex counts of the base and current objects (I realise they should be the same, but you never know...).&lt;BR /&gt;&lt;BR /&gt;Also, read up on setVert - there's an explicit warning regarding vertex animation (use meshop.setVert instead, and remember to do an update as well).</description>
      <pubDate>Wed, 21 Jul 2010 19:03:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/why-doesn-t-this-work-mesh-animation-import/m-p/4161625#M21770</guid>
      <dc:creator>Steve_Curley</dc:creator>
      <dc:date>2010-07-21T19:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't this work? Mesh Animation import</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/why-doesn-t-this-work-mesh-animation-import/m-p/4161626#M21771</link>
      <description>Thanks Steve. I will try the meshop.SetVert call instead. I am printing out the vert numbers... seems ok. I'll post the results here. &lt;BR /&gt;&lt;BR /&gt;Thanks again. &lt;BR /&gt;&lt;BR /&gt;jona</description>
      <pubDate>Wed, 21 Jul 2010 20:03:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/why-doesn-t-this-work-mesh-animation-import/m-p/4161626#M21771</guid>
      <dc:creator>jonavark</dc:creator>
      <dc:date>2010-07-21T20:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't this work? Mesh Animation import</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/why-doesn-t-this-work-mesh-animation-import/m-p/4161627#M21772</link>
      <description>So.. Here's what I did&lt;BR /&gt;&lt;PRE&gt; for v = 1 to  vertCount do&lt;BR /&gt; (&lt;BR /&gt; animate on at time (f-1)&lt;BR /&gt; --baseObj&lt;V&gt;.value = getVert currentObj v&lt;BR /&gt; --vertVal = getVert currentObj v&lt;BR /&gt; --setVert baseObj v vertVal&lt;BR /&gt; nV = getVert currentObj v&lt;BR /&gt;&lt;BR /&gt; meshOp.setVert baseObj v nV&lt;BR /&gt;&lt;BR /&gt; format "v = %\n" v&lt;BR /&gt; )&lt;BR /&gt;&lt;/V&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;And here is what I get:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;--  Frame:&lt;BR /&gt;--   baseObj: $Meshtest_Base01&lt;BR /&gt;--   filesCount: 101&lt;BR /&gt;--   inName: "Meshtest"&lt;BR /&gt;--   ext: "3ds"&lt;BR /&gt;--   inFiles: #("E:\pulseweapons\export/Meshtest_0000.3ds", "E:\pulseweapons--   vertCount: 328&lt;BR /&gt;-- Runtime error: Mesh vertex index out of range: 328&lt;BR /&gt;OK&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Still somewhat perplexed..</description>
      <pubDate>Wed, 21 Jul 2010 21:09:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/why-doesn-t-this-work-mesh-animation-import/m-p/4161627#M21772</guid>
      <dc:creator>jonavark</dc:creator>
      <dc:date>2010-07-21T21:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't this work? Mesh Animation import</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/why-doesn-t-this-work-mesh-animation-import/m-p/4161628#M21773</link>
      <description>Ha.. I did some more checking and in fact, the meshes are indeed different vert counts. &lt;BR /&gt;&lt;BR /&gt;So either  of my methods probably should have worked. I must have done the export with e smooth on it. Thanks for the tip on the meshOp class.&lt;BR /&gt;&lt;BR /&gt;If that was the problem, then I will not post another response.</description>
      <pubDate>Wed, 21 Jul 2010 21:15:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/why-doesn-t-this-work-mesh-animation-import/m-p/4161628#M21773</guid>
      <dc:creator>jonavark</dc:creator>
      <dc:date>2010-07-21T21:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't this work? Mesh Animation import</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/why-doesn-t-this-work-mesh-animation-import/m-p/4161629#M21774</link>
      <description>Well... that was the problem but I wanted to mention that my meshOp calls didn't seem to work. I had to revert to the :&lt;BR /&gt;&lt;BR /&gt;baseObj&lt;V&gt;.value = getVert currentObj v&lt;BR /&gt;&lt;BR /&gt;instead of:&lt;BR /&gt;&lt;BR /&gt; nV = meshOp.getVert currentObj v&lt;BR /&gt; meshOp.setVert baseObj v nV&lt;BR /&gt;&lt;BR /&gt;Any insight helpful!&lt;/V&gt;</description>
      <pubDate>Thu, 22 Jul 2010 06:53:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/why-doesn-t-this-work-mesh-animation-import/m-p/4161629#M21774</guid>
      <dc:creator>jonavark</dc:creator>
      <dc:date>2010-07-22T06:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't this work? Mesh Animation import</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/why-doesn-t-this-work-mesh-animation-import/m-p/4161630#M21775</link>
      <description>Works here. The vertlist parameter is an array, not a single value, and there's a warning in the help that it should be a bitarray not a normal one.&lt;BR /&gt;&lt;BR /&gt;Create a Plane (150*150), 1 seg in each direction (4 verts). Convert to editable Mesh, run the script below.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;(&lt;BR /&gt;animateVertex $Plane01 #all&lt;BR /&gt;with animate on&lt;BR /&gt;   (&lt;BR /&gt;   v = 0&lt;BR /&gt;   for tim = 20 to 80 by 20 do&lt;BR /&gt;      (&lt;BR /&gt;      at time tim&lt;BR /&gt;         (&lt;BR /&gt;         v += 1&lt;BR /&gt;         vPos = getvert $Plane01 v&lt;BR /&gt;         vPos.z = tim&lt;BR /&gt;         meshop.setvert $Plane01 #{v} vPos&lt;BR /&gt;         )&lt;BR /&gt;      )&lt;BR /&gt;   )&lt;BR /&gt;)&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Jul 2010 09:24:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/why-doesn-t-this-work-mesh-animation-import/m-p/4161630#M21775</guid>
      <dc:creator>Steve_Curley</dc:creator>
      <dc:date>2010-07-22T09:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't this work? Mesh Animation import</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/why-doesn-t-this-work-mesh-animation-import/m-p/4161631#M21776</link>
      <description>Thanks again Steve. I will try this. Day3 of Maxscripting!  &lt;BR /&gt;&lt;BR /&gt;I noticed you are referring to the object with its name instead of the object as I was doing? I guess I could do either?   I see the curlies around the "v" , I assume that is the array syntax.. &lt;BR /&gt;&lt;BR /&gt;I did notice that with the method I used, there were a number of verts that were not connected correctly. &lt;BR /&gt;&lt;BR /&gt;thanks!&lt;BR /&gt;&lt;BR /&gt;Jona</description>
      <pubDate>Thu, 22 Jul 2010 18:14:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/why-doesn-t-this-work-mesh-animation-import/m-p/4161631#M21776</guid>
      <dc:creator>jonavark</dc:creator>
      <dc:date>2010-07-22T18:14:04Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't this work? Mesh Animation import</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/why-doesn-t-this-work-mesh-animation-import/m-p/4161632#M21777</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;I noticed you are referring to the object with its name instead of the object as I was doing? I guess I could do either? &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;Only because mine was a "code snippet" - an example - not designed to be used "as is" within another script. Using variables to hold the nodes is the usual way to deal with them, as you already are.&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt; I see the curlies around the "v" , I assume that is the array syntax.. &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;Round brackets (parentheses) for declaring an array, curley brackets (braces) for declaring a bitarray.&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;I did notice that with the method I used, there were a number of verts that were not connected correctly. &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;Without all the files to test I'm not sure why. If they have the same number of vertices, and they "match" correctly (the vertex number on the base object matches the same vertex on the imported object (in relation to the surrounding ones) then it looks like it should work.</description>
      <pubDate>Thu, 22 Jul 2010 19:50:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/why-doesn-t-this-work-mesh-animation-import/m-p/4161632#M21777</guid>
      <dc:creator>Steve_Curley</dc:creator>
      <dc:date>2010-07-22T19:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't this work? Mesh Animation import</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/why-doesn-t-this-work-mesh-animation-import/m-p/4161633#M21778</link>
      <description>Thank you very much for your generous assistance.</description>
      <pubDate>Fri, 23 Jul 2010 00:20:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/why-doesn-t-this-work-mesh-animation-import/m-p/4161633#M21778</guid>
      <dc:creator>jonavark</dc:creator>
      <dc:date>2010-07-23T00:20:10Z</dc:date>
    </item>
  </channel>
</rss>

