PDA

View Full Version : Guts of a LW motion file...


Cman
02-20-2003, 07:20 PM
Can anyone help?
I'm trying to write a little script to read a txt file of coordinates and convert it to a LW motion file - but I cannot make sense of the *.mot file.

Any help in translating all this info?

Here's the file of a simple Null move of 3 keyframes.


LWMO
3

NumChannels 9
Channel 0
{ Envelope
3
Key -0.059999898 0 0 0 0 0 0 -1.109846 0
Key -1.1700001 2 0 0 0 0 -0.37000012 -0.18500006 0
Key -0.61500007 3 0 0 0 0 0.55484587 0 0
Behaviors 1 1
}
Channel 1
{ Envelope
3
Key 0.71000034 0 0 0 0 0 0 0 0
Key 0.71000034 2 0 0 0 0 0.0033333302 0.0016666651 0
Key 0.71500033 3 0 0 0 0 0.0049986066 0 0
Behaviors 1 1
}
Channel 2
{ Envelope
3
Key 0.049999993 0 0 0 0 0 0 0.14497986 0
Key 0.19499999 2 0 0 0 0 0.070000008 0.035000004 0
Key 0.155 3 0 0 0 0 -0.039988883 0 0
Behaviors 1 1
}
Channel 3
{ Envelope
1
Key 0 0 0 0 0 0 0 0 0
Behaviors 1 1
}
Channel 4
{ Envelope
1
Key 0 0 0 0 0 0 0 0 0
Behaviors 1 1
}
Channel 5
{ Envelope
1
Key 0 0 0 0 0 0 0 0 0
Behaviors 1 1
}
Channel 6
{ Envelope
1
Key 1 0 0 0 0 0 0 0 0
Behaviors 1 1
}
Channel 7
{ Envelope
1
Key 1 0 0 0 0 0 0 0 0
Behaviors 1 1
}
Channel 8
{ Envelope
1
Key 1 0 0 0 0 0 0 0 0
Behaviors 1 1
}

jlinhart
02-20-2003, 11:04 PM
Here's the LightWave Scene file doc:

Scene File Description (http://www.newtek.com/products/lightwave/developer/75lwsdk/docs/filefmts/lwsc.html)

Check out the Envelope section.

Here are the basics. The 9 channels are listed in this order X Position, Y Position, Z Position, Heading, Pitch, Bank, X Scale, Y Scale, Z Scale. The 3 on the line after Envelope tells you the number of keyframes for that channel.

Key -1.1700001 2 0 0 0 0 -0.37000012 -0.18500006 0

The important information after the 'Key' keywords are the Key value (-1.1700001) and the time in seconds (2). The rest of the info you can get from the docs, but it defines the curve parameters at that key.

Jason

Cman
02-21-2003, 12:09 AM
Ah ha.
Thanks for the swift reply.

Nonproductive
02-21-2003, 02:51 AM
Dunno if it'd help at all - but there is this lscript you could disect as well
http://chromecow.electrondreams.com/prefutz2.htm

Cman
02-21-2003, 03:05 AM
Interesting link.
I will explore that one.
Thanks.

CGTalk Moderation
01-14-2006, 12:00 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.