PDA

View Full Version : Keying Biped Rotation Animation


sdk29
12-21-2010, 03:37 PM
I am trying to create a biped animation using maxscript from individual files of joint angles. However, I'm running into two major bugs.

1. When I run my script, the animation keys are made, but no motion occurs. Then, if I save, close, and reopen the file, the biped moves.

2. The script is written now to loop over multiple files. After the script runs, the animation keys are made, but no motion occurs, just as described above. However, if I save, close, and reopen, the only node that moves is the last one.

Does anyone have any idea about how to key rotation animation? I've been searching all over the internet and no one seems to know.


(--start a local scope. You can add a MacroScript definition above to make it a button
folder = getSavePath caption:"Choose folder with joint angle files" initialDir:"C:\\Documents and Settings\\lab\Desktop\\Scott\\GRASP Room"
files = getFiles (folder + "\\*.csv")
for i = 1 to files.count do (
theFilename = files[i]
if theFilename != undefined do
( --if a valid filename picked,
local theFile = openFile theFilename --open the file
while not eof theFile do (
theObjName = readValue theFile
theObj = getNodeByName theObjName
theTime = readValue theFile
XRot = readValue theFile
YRot = readValue theFile
ZRot = readValue theFile
with animate on (
at time theTime
in coordsys local rotate theObj (eulerangles XRot YRot ZRot)
)
)
close theFile --close the file when done
)
)--end if
)--end script



Sample files

"Bip01 R Finger0",1,0,10.1565,48.3539
"Bip01 R Finger0",2,0,10.1632,48.3982
"Bip01 R Finger0",3,0,10.1685,48.4389
"Bip01 R Finger0",4,0,10.1714,48.4731
"Bip01 R Finger0",5,0,10.1712,48.4986
"Bip01 R Finger0",6,0,10.1677,48.5144
"Bip01 R Finger0",7,0,10.161,48.5208
"Bip01 R Finger0",8,0,10.152,48.5189
"Bip01 R Finger0",9,0,10.1415,48.5111
"Bip01 R Finger0",10,0,10.1307,48.5001



"Bip01 R Finger01",1,0,0,48.3539
"Bip01 R Finger01",2,0,0,48.3982
"Bip01 R Finger01",3,0,0,48.4389
"Bip01 R Finger01",4,0,0,48.4731
"Bip01 R Finger01",5,0,0,48.4986
"Bip01 R Finger01",6,0,0,48.5144
"Bip01 R Finger01",7,0,0,48.5208
"Bip01 R Finger01",8,0,0,48.5189
"Bip01 R Finger01",9,0,0,48.5111
"Bip01 R Finger01",10,0,0,48.5001

CGTalk Moderation
12-21-2010, 03:37 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.