<?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: Biped joint angle animation in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/biped-joint-angle-animation/m-p/4179936#M21021</link>
    <description>I modified the script and got the forearm to rotate, which is great. Unfortunately it only reads one line of the file and stops. Any ideas?&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;(--start a local scope. You can add a MacroScript definition above to make it a button&lt;BR /&gt;--pick the file:&lt;BR /&gt;local theFilename = getOpenFileName types:"Comma Separated Values (*.CSV)|*.CSV|All Files (*.*)|*.*"&lt;BR /&gt;if theFilename != undefined do ( --if a valid filename picked,&lt;BR /&gt;    local theFile = openFile theFilename --open the file&lt;BR /&gt;    while not eof theFile do ( &lt;BR /&gt;       theObjName = readValue theFile&lt;BR /&gt;       theObj = getNodeByName theObjName&lt;BR /&gt;       theTime = readValue theFile&lt;BR /&gt;       XRot = readValue theFile&lt;BR /&gt;       YRot = readValue theFile&lt;BR /&gt;       ZRot = readValue theFile&lt;BR /&gt;       rot_obj = eulerangles XRot YRot -ZRot&lt;BR /&gt;       with animate on&lt;BR /&gt;          at time theTime&lt;BR /&gt;             rotate theObj rot_obj&lt;BR /&gt;    ) &lt;BR /&gt;    close theFile --close the file when done&lt;BR /&gt;)--end if&lt;BR /&gt;)--end script &lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;"Bip01 R Forearm", 10, 0, 0, 36 &lt;BR /&gt;"Bip01 R Forearm", 20, 0, 0, 72&lt;BR /&gt;"Bip01 R Forearm", 30, 0, 0, 108&lt;BR /&gt;"Bip01 R Forearm", 40, 0, 0, 144&lt;BR /&gt;"Bip01 R Forearm", 50, 0, 0, 180&lt;BR /&gt;"Bip01 R Forearm", 60, 0, 0, 216&lt;BR /&gt;"Bip01 R Forearm", 70, 0, 0, 252&lt;BR /&gt;"Bip01 R Forearm", 80, 0, 0, 288&lt;BR /&gt;"Bip01 R Forearm", 90, 0, 0, 324&lt;BR /&gt;"Bip01 R Forearm", 100, 0, 0, 360&lt;BR /&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 02 Dec 2010 19:30:45 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-12-02T19:30:45Z</dc:date>
    <item>
      <title>Biped joint angle animation</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/biped-joint-angle-animation/m-p/4179931#M21016</link>
      <description>Autodesk 3ds Max 2011 x64 - Student Version&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I have a rigged biped and would like to input finger joint rotations using MaxScript. I have the rotation for each joint at a given time step and want to write a script that creates an animation from this data.&lt;BR /&gt;&lt;BR /&gt;The goal is to have something similar to &lt;BR /&gt;&lt;A href="http://area.autodesk.com/forum/Autodesk-3ds-Max/maxscript/import-xyz-into-max-using-dummy-object/" target="_blank"&gt;http://area.autodesk.com/forum/Autodesk-3ds-Max/maxscript/import-xyz-into-max-using-dummy-object/&lt;/A&gt;&lt;BR /&gt;except that I would like to be able to specify which joint to rotate and use rotation instead of move position. They are all finger joints, so the rotations should be pretty simple and mostly across one rotation axis.&lt;BR /&gt;&lt;BR /&gt;I am brand new to MaxScript so a template similar to the one posted above would be great, but any help that will point me in the right direction is appreciated. I have been scouring the online forums and haven't had much luck for what seems to be a straight-foward problem.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Mon, 29 Nov 2010 22:22:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/biped-joint-angle-animation/m-p/4179931#M21016</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-11-29T22:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Biped joint angle animation</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/biped-joint-angle-animation/m-p/4179932#M21017</link>
      <description>Can you post the data file&amp;amp;#40;s&amp;amp;#41; (zip and attach)?&lt;BR /&gt;&lt;BR /&gt;The script you linked to is a good starting point, but there are a couple of issues.&lt;BR /&gt;&lt;BR /&gt;Firstly, that script is creating a dummy object, yours will have to determine (one way or another) the object to which the rotation is to be applied. This depends on exactly what is in the data file. If the data is only the rotations (one file per object) then you'd have to select the object then run the script with the correct data file. If all the data is in one file, each line of the data will need the object name as well as the time and the rotation values.&lt;BR /&gt;&lt;BR /&gt;Rotations can be tricky - they're not as simple as positions, especially as Biped uses Quaternions instead of the normal Euler XYZ controllers. There may well be some maths involved to convert the data into a usable form.</description>
      <pubDate>Tue, 30 Nov 2010 11:31:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/biped-joint-angle-animation/m-p/4179932#M21017</guid>
      <dc:creator>Steve_Curley</dc:creator>
      <dc:date>2010-11-30T11:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Biped joint angle animation</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/biped-joint-angle-animation/m-p/4179933#M21018</link>
      <description>Right now the data is in a MATLAB structure array. MATLAB is a technical computing program for engineers which is able to collect and process matrices in different forms. The current storage of the data has all the time stamps in one location and the corresponding angles for each joint in different locations. Currently, there is no file to read because the data is distributed and I'm not sure what the most efficient format will be. If someone can recommend a format I will recompile the data and post it in a .zip file.</description>
      <pubDate>Tue, 30 Nov 2010 18:19:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/biped-joint-angle-animation/m-p/4179933#M21018</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-11-30T18:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: Biped joint angle animation</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/biped-joint-angle-animation/m-p/4179934#M21019</link>
      <description>Simplest would be an ordinary text file.&lt;BR /&gt;Object name, Frame, XRot, YRot, ZRot&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;"Bip001 R Finger01", 25, 10, 20, 30&lt;BR /&gt;"Bip001 R Finger01", 50, 10, 40, 30&lt;BR /&gt;"Bip001 R Finger02", 25, 10, 20, 30&lt;BR /&gt;"Bip001 R Finger02", 50, 10, 45, 30&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;With respect to the script in the thread linked to above.&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;   while not eof theFile do&lt;BR /&gt;      ( &lt;BR /&gt;       theObjName = readValue theFile&lt;BR /&gt;       theObj = getNodeByName theObjName&lt;BR /&gt;       theTime = readValue theFile&lt;BR /&gt;       XRot = readValue theFile&lt;BR /&gt;       YRot = readValue theFile&lt;BR /&gt;       ZRot = readValue theFile&lt;BR /&gt;       with animate on&lt;BR /&gt;          at time theTime&lt;BR /&gt;-- this is the bit to be worked out...&lt;BR /&gt;             theObj.rotation = point3 XRot YRot ZRot&lt;BR /&gt;       )&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;In principle - that is not necessarily runnable code. If you search for Quaternions in the main Max Help there's a section on Biped. Also Quat Values in the MXS help. Sadly, not an area I'm too familiar with.</description>
      <pubDate>Tue, 30 Nov 2010 19:28:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/biped-joint-angle-animation/m-p/4179934#M21019</guid>
      <dc:creator>Steve_Curley</dc:creator>
      <dc:date>2010-11-30T19:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: Biped joint angle animation</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/biped-joint-angle-animation/m-p/4179935#M21020</link>
      <description>Great, that gives me something to get my hands dirty with at least. I appreciate the help.</description>
      <pubDate>Tue, 30 Nov 2010 22:08:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/biped-joint-angle-animation/m-p/4179935#M21020</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-11-30T22:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: Biped joint angle animation</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/biped-joint-angle-animation/m-p/4179936#M21021</link>
      <description>I modified the script and got the forearm to rotate, which is great. Unfortunately it only reads one line of the file and stops. Any ideas?&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;(--start a local scope. You can add a MacroScript definition above to make it a button&lt;BR /&gt;--pick the file:&lt;BR /&gt;local theFilename = getOpenFileName types:"Comma Separated Values (*.CSV)|*.CSV|All Files (*.*)|*.*"&lt;BR /&gt;if theFilename != undefined do ( --if a valid filename picked,&lt;BR /&gt;    local theFile = openFile theFilename --open the file&lt;BR /&gt;    while not eof theFile do ( &lt;BR /&gt;       theObjName = readValue theFile&lt;BR /&gt;       theObj = getNodeByName theObjName&lt;BR /&gt;       theTime = readValue theFile&lt;BR /&gt;       XRot = readValue theFile&lt;BR /&gt;       YRot = readValue theFile&lt;BR /&gt;       ZRot = readValue theFile&lt;BR /&gt;       rot_obj = eulerangles XRot YRot -ZRot&lt;BR /&gt;       with animate on&lt;BR /&gt;          at time theTime&lt;BR /&gt;             rotate theObj rot_obj&lt;BR /&gt;    ) &lt;BR /&gt;    close theFile --close the file when done&lt;BR /&gt;)--end if&lt;BR /&gt;)--end script &lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;"Bip01 R Forearm", 10, 0, 0, 36 &lt;BR /&gt;"Bip01 R Forearm", 20, 0, 0, 72&lt;BR /&gt;"Bip01 R Forearm", 30, 0, 0, 108&lt;BR /&gt;"Bip01 R Forearm", 40, 0, 0, 144&lt;BR /&gt;"Bip01 R Forearm", 50, 0, 0, 180&lt;BR /&gt;"Bip01 R Forearm", 60, 0, 0, 216&lt;BR /&gt;"Bip01 R Forearm", 70, 0, 0, 252&lt;BR /&gt;"Bip01 R Forearm", 80, 0, 0, 288&lt;BR /&gt;"Bip01 R Forearm", 90, 0, 0, 324&lt;BR /&gt;"Bip01 R Forearm", 100, 0, 0, 360&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Dec 2010 19:30:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/biped-joint-angle-animation/m-p/4179936#M21021</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-12-02T19:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: Biped joint angle animation</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/biped-joint-angle-animation/m-p/4179937#M21022</link>
      <description>It is erroring out on the rotate line - I did warn you the code may not be runnable. You should always open the Maxscript Listener when testing scripts as that is where any error messages will be.&lt;BR /&gt;Without that line the script does read all the lines in the file.&lt;BR /&gt;&lt;BR /&gt;First thing is the object name in the file - Max2011 changed the default naming so the 1st Biped will be Bip001 NOT Bip01. This causes theObj to be undefined and thus causes the error.&lt;BR /&gt;&lt;BR /&gt;Second problem is that although the script does create keys on the Forearm, and they exist if you open the Workbench (with the forearm selected), there appears to be no motion, though the arm has moved from it's original (created) position.&lt;BR /&gt;&lt;BR /&gt;"Ordinary" Maxscript I can generally deal with, but I don't know enough about Biped animation and there's a LOT about it in the Maxscript help.&lt;BR /&gt;We could do with a Biped guru about now...</description>
      <pubDate>Thu, 02 Dec 2010 20:44:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/biped-joint-angle-animation/m-p/4179937#M21022</guid>
      <dc:creator>Steve_Curley</dc:creator>
      <dc:date>2010-12-02T20:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: Biped joint angle animation</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/biped-joint-angle-animation/m-p/4179938#M21023</link>
      <description>So I got the script to work, but there are a few funny bugs that I haven't been able to work out.&lt;BR /&gt;&lt;BR /&gt;1. When I run the script, the keys are made, but the model doesn't move. However, if I save the model, close it, and reopen it, the model will move and everything works as expected.&lt;BR /&gt;&lt;BR /&gt;2. When I run the script using the file for one node, all the keys are made and the MaxScript Listener window says: OK. However, when I try to run the script again for the second node, it gives me the error: -- Runtime error: fileIn: can't open file - "test.ms". If I use a small test file instead of the real file, I don't get this runtime error and can run multiple nodes without restarting the scene.&lt;BR /&gt;&lt;BR /&gt;Right now I have a separate file for each node. I would like to be able to run all the nodes at one time. I imagine this would look like selecting a folder and running the script for each file in the folder, but I'm not sure about the best way to accomplish this.&lt;BR /&gt;&lt;BR /&gt;Any advice about the bugs or the best way to run multiple files would be appreciated. Below is the MaxScript, the snippet of the real file, and the test file.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Scott&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;(--start a local scope. You can add a MacroScript definition above to make it a button&lt;BR /&gt;--pick the file:&lt;BR /&gt;local theFilename = getOpenFileName types:"Comma Separated Values (*.CSV)|*.CSV|All Files (*.*)|*.*"&lt;BR /&gt;if theFilename != undefined do ( --if a valid filename picked,&lt;BR /&gt;    local theFile = openFile theFilename --open the file&lt;BR /&gt;    while not eof theFile do ( &lt;BR /&gt; theObjName = readValue theFile&lt;BR /&gt;        theObj = getNodeByName theObjName&lt;BR /&gt;        theTime = readValue theFile&lt;BR /&gt;        XRot = readValue theFile&lt;BR /&gt;        YRot = readValue theFile&lt;BR /&gt;        ZRot = readValue theFile&lt;BR /&gt; with animate on (&lt;BR /&gt; at time theTime&lt;BR /&gt; in coordsys local rotate theObj (eulerangles XRot YRot ZRot)&lt;BR /&gt; )&lt;BR /&gt; ) &lt;BR /&gt;    close theFile --close the file when done&lt;BR /&gt;)--end if&lt;BR /&gt;)--end script &lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;"Bip01 R Finger0",1,0,10.1565,48.3539&lt;BR /&gt;"Bip01 R Finger0",2,0,10.1632,48.3982&lt;BR /&gt;"Bip01 R Finger0",3,0,10.1685,48.4389&lt;BR /&gt;"Bip01 R Finger0",4,0,10.1714,48.4731&lt;BR /&gt;"Bip01 R Finger0",5,0,10.1712,48.4986&lt;BR /&gt;"Bip01 R Finger0",6,0,10.1677,48.5144&lt;BR /&gt;"Bip01 R Finger0",7,0,10.161,48.5208&lt;BR /&gt;"Bip01 R Finger0",8,0,10.152,48.5189&lt;BR /&gt;"Bip01 R Finger0",9,0,10.1415,48.5111&lt;BR /&gt;"Bip01 R Finger0",10,0,10.1307,48.5001&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;"Bip01 R Finger11", 0, 0,0,0&lt;BR /&gt;"Bip01 R Finger11", 20, 0,0,45&lt;BR /&gt;"Bip01 R Finger11", 40, 0,0,90&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Dec 2010 19:59:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/biped-joint-angle-animation/m-p/4179938#M21023</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-12-20T19:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Biped joint angle animation</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/biped-joint-angle-animation/m-p/4179939#M21024</link>
      <description>How are you running the script? &lt;BR /&gt;&lt;BR /&gt;Maxscript (menu) &amp;gt; Run Script?&lt;BR /&gt;Loading it into the editor and running with Ctrl+E?&lt;BR /&gt;Running it in the Listener itself?&lt;BR /&gt;&lt;BR /&gt;I'm not sure why you're getting a problem, nothing stands out as being glaringly obviously wrong.&lt;BR /&gt;&lt;BR /&gt;To iterate over a folder full of files, use the getFiles() function then loop over the array returned by it. Either nest the existing code (without the getting of the filename) inside that loop, or turn the existing code into a function and call it passing each file as a parameter. I would try and fix the other problem first though.</description>
      <pubDate>Mon, 20 Dec 2010 20:45:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/biped-joint-angle-animation/m-p/4179939#M21024</guid>
      <dc:creator>Steve_Curley</dc:creator>
      <dc:date>2010-12-20T20:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: Biped joint angle animation</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/biped-joint-angle-animation/m-p/4179940#M21025</link>
      <description>I was using filein "--.ms" but now I created a MacroScript button to use instead.&lt;BR /&gt;&lt;BR /&gt;I found one problem. I was choosing a file in a different folder, therefore changing my local directory, which is why the script wouldn't run the second time. When I moved the script file into the same folder as the .csv files I was able to run the script multiple times.&lt;BR /&gt;&lt;BR /&gt;Thanks for the tip about multiple files, I'll try it out.</description>
      <pubDate>Mon, 20 Dec 2010 20:58:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/biped-joint-angle-animation/m-p/4179940#M21025</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-12-20T20:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Biped joint angle animation</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/biped-joint-angle-animation/m-p/4179941#M21026</link>
      <description>Ahh. Always specify a full path, that way you can have the files anywhere you need them. If using network(ed) drives, use UNC paths in preference to mapped drives.</description>
      <pubDate>Mon, 20 Dec 2010 21:39:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/biped-joint-angle-animation/m-p/4179941#M21026</guid>
      <dc:creator>Steve_Curley</dc:creator>
      <dc:date>2010-12-20T21:39:31Z</dc:date>
    </item>
  </channel>
</rss>

