Message 1 of 6
animation problem

Not applicable
11-30-2011
01:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello. I'm new here and fairly new to Maxscript.
I have been working on an importer script to import 3 different files into max: a mesh file, a bone file, and an animation file.
I've successfully completed the first two (I think) but I have run into problems getting the animation right.
as you can see the problem lies within the animate on code block. I have a series of positions and rotations for each bone in each frame. Given that the bones have parents or are a child of parents. The model has a skin modifier with the bones added in. I had to do that manually as I am still working on it.
My question is am I doing something wrong with the animation because it gives weird results. I have a picture to illustrate the problem better
I have been working on an importer script to import 3 different files into max: a mesh file, a bone file, and an animation file.
I've successfully completed the first two (I think) but I have run into problems getting the animation right.
f = getOpenFileName caption: "Import Animation" types: "Animation (*.ani)|*.ani"
ReadANI f &Animation
For BoneID = 1 To Animation.BoneData.names.Count Do
(
obj = getnodebyname Animation.BoneData.names
if obj != undefined Then
(
If Animation.BoneTM == undefined Then
(
tm = Animation.BoneTM
For FrameID = 1 To Animation.FrameCount Do
(
rot = Animation.BoneFrame.Rotation
trans = Animation.BoneFrame.Translation
animate on
(
at time FrameID (obj.pos = trans; obj.rotation = rot)
)
)
)
else
(
if tm != undefined Then obj.transform = tm
)
)
)
as you can see the problem lies within the animate on code block. I have a series of positions and rotations for each bone in each frame. Given that the bones have parents or are a child of parents. The model has a skin modifier with the bones added in. I had to do that manually as I am still working on it.
My question is am I doing something wrong with the animation because it gives weird results. I have a picture to illustrate the problem better
