- Joined
- Sep 9, 2008
- Messages
- 1,947
- Reaction score
- 391
yes I will release it soon. I want to clean it up a little bit more and add some more features to it.
I'm going to post the animation code for this. If anyone has anykind of experience in coding maxscript especially for animations, do lend a hand. Otherwise this project will not get very far.
I'm going to post the animation code for this. If anyone has anykind of experience in coding maxscript especially for animations, do lend a hand. Otherwise this project will not get very far.
Code:
f = getOpenFileName caption: "Import Animation" types: "Animation (*.ani)|*.ani"
ReadANI f &Animation
local curBoneFrame, nextBoneFrame
For BoneID = 1 To Animation.BoneData.names.Count Do (
obj = getnodebyname Animation.BoneData.names[BoneID]
if obj != undefined Then
(
if Animation.BoneTM[BoneID] == undefined Then
(
For FrameID = 1 To Animation.FrameCount Do (
Frame = Animation.BoneFrame[BoneID]
if Frame == undefined Then ( return 0 ) else
(
CurFrame = Frame[FrameID]
--curBoneFrame = Animation.BoneFrame[BoneID][FrameID]
if (FrameID + 1) >= Animation.FrameCount Then ( nextBoneFrame = Animation.BoneFrame[BoneID][Animation.FrameCount] ) else ( nextBoneFrame = Animation.BoneFrame[BoneID][(FrameID+1)])
-- Get QuatSlerp
quatSlerp = slerp CurFrame.Rotation nextBoneFrame.Rotation Animation.PerSLERP
-- GetVecLerp
vecLerp = lerp CurFrame.Translation nextBoneFrame.Translation 1
-- Make new Rotation Matrix
mQ = quatSlerp as matrix3
-- Make new Translation
local mTemp = mQ
mTemp.row4 = vecLerp
format "Frame:% MatTemp:%\n" FrameID mTemp
if FrameID == Animation.FrameCount Then FrameID = Animation.FrameCount else FrameID += 1
if obj.parent != 0 Then (
with animate on (
at time FrameID
(
in coordsys parent obj.rotation = mQ;
in coordsys parent obj.pos = vecLerp
)
)
) else (
with animate on (
at time FrameID
(
in coordsys local obj.rotation.x_rotation = mQ;
in coordsys local obj.pos = vecLerp
)
)
)
)
)
)
)
)
Last edited:

