PDA

View Full Version : Looking for Maks (Marek Schneider) FXS to BVH converter


MarkInTx
04-01-2008, 02:27 AM
Hey, Suricate mentioned in another thread that Maks (Marek Schneider) wrote a stand-alone FXS to BVH converter...

Does anyone have this? I am trying to work on the other side of it (ie apply BVH straight to any rig in an FXS scene) and it would be a helpful starting point.

Anyone have it, or know Maks so they could ask? (I pinged him in a PM, but never heard back...)

I found the EXE file... butr I was hoping I could get the source so I could understand the inner workings of the FXS file without needing to backward engineer it...

Thanks!

peksi
04-01-2008, 07:59 AM
I'd say that it's probably easier to just look at fxs than trying to learn it from some source. Exception is if this source has good commenting/documentation. But what you want to do is make a empty file, then change something from that (like add a null or a keyframe) and compare what has changed. If there is something particular you are stuck with, ask about it in here, so maybe I (or anyone else in here) can help you out a bit.

MarkInTx
04-01-2008, 12:10 PM
I'd say that it's probably easier to just look at fxs than trying to learn it from some source. Exception is if this source has good commenting/documentation. But what you want to do is make a empty file, then change something from that (like add a null or a keyframe) and compare what has changed. If there is something particular you are stuck with, ask about it in here, so maybe I (or anyone else in here) can help you out a bit.

OK... well, I have a bunch of questions. Let me start with my assumptions.

Looking through the FXS File:

In Keyframe section we have:
BeginKeyframe 2 12

The 2 is the total number of keyframes. The 12 seems to be at the end of a lot of lines and is irrelevent as far as I can tell. Maybe it stands for an ASCII 12, which would be a line feed... not sure.

Then each Keyframe seems to be separated by it's number, another number (not sure what that one is, but I do see a pattern to it), and the word "Default". Not sure what default means, but it appears on every keyframe in my sample, so easy to replicate...
0.000 4095 default

Then each keyframe has a series of numbers, 13 columns by 12 rows

This is where I really start losing any sense of things. What are these numbers for? I would assume that they map somewhat to what I see in the Motion block on the animate tab.

http://digitalartistguild.com/Tests/Messiah/SampleBlock.jpg

And it sort of does:

It appears that the first column matches pretty well as Move: X and Y are 0 and the Z matches perfectly.


0 0 0 0 0 1 0 0 0 0 0 0 0

0.000000 0 0 0 0 1 0 0 0 0 0 0 0

0.473710 0 0 0 0 1 0 0 0 0 0 0 0

0 0 0 0 0 1 0 0 0 0 -0.045844 0 0.333333

0 0 0 0 0 1 0 0 0 0 -0.254818 0 0.333333

0 0 0 0 0 1 0 0 0 0 0 0 0.333333

1 0 0 0 0 1 0 0 0 0 0 0 0

1 0 0 0 0 1 0 0 0 0 0 0 0

1 0 0 0 0 1 0 0 0 0 0 0 0

0 0 0 0 0 1 0 0 0 0 0 0 0

0 0 0 0 0 1 0 0 0 0 0 0 0

0 0 0 0 0 1 0 0 0 0 0 0 0




I would assume that the next four sets in the column are the rotate scale and pivot. That maps nicely as well.

So... what are all the rest of the columns? Why is the 6th column always 1? What are the strange 0.333333's? That would seem like a representation of 1/3... Yet I did a find and replace on all of these - changing them all to 0, saved it out, and Messiah pulled the file back in and still ran exactly the same. So, maybe these aren't normally used? I'm not sure.

Things really get spun around though when I move to the next keyframe, because now nothing makes sense to me:

http://digitalartistguild.com/Tests/Messiah/SampleBlock2.jpg

0 0 0 0 0 1 0 0 0 0 0 0 0

0 0 0 0 0 1 0 0 0 0 0 0 0

0 0 0 0 0 1 0 0 0 0 0 0 0

-0.137532 0 0 0 0 1 0 0 0 -0.091688 0 0.666667 0

-0.764454 0 0 0 0 1 0 0 0 -0.509636 0 0.666667 0

0 0 0 0 0 1 0 0 0 0 0 0.666667 0

0 0 0 0 0 1 0 0 0 0 0 0 0

0 0 0 0 0 1 0 0 0 0 0 0 0

0 0 0 0 0 1 0 0 0 0 0 0 0

0 0 0 0 0 1 0 0 0 0 0 0 0

0 0 0 0 0 1 0 0 0 0 0 0 0

0 0 0 0 0 1 0 0 0 0 0 0 0



If my assumptions of the first column are true...

Why do they represent a rotation of -7.880003 as -0.137532? Is that some derivative of the Parent's motion plus this motion? For the life of me I can't figure out why they would do that... seems to me that this should only be storing the neck's rotation. But, somehow what I see on the screen is not what is in the file... so I have to be missing something.

And what does the strange: -0.091688 in the 10th column mean? It appears the 12th column that (maybe) was referring to 1/3 is now referring to 2/3... but that doesn't make sense to me either.

So, this is my problem. I don't know if Maks ever had to figure all of this out to do his FXS to BVH convertor... but my thinking is he must have. At least, he must have figured out how they are calculating the first row, because I'm thinking that is what he mapped to the BVH motion file.

Any insight would be greatly appreciated. (Gee, it would be great if PMG programmers still read this board... they could answer all of this in about 5 minutes... I know there is a spec for this file somewhere...)

peksi
04-01-2008, 12:40 PM
BeginKeyFrame x 12 tells that there are 12 channels. For example camera has 16.

Next line after that:
0.000 -1 default
-1 tells that EVERY key is active on this frame. Remember that when you have keyframe, you actually have keyframe on every channel, some are just inactive. It goes something like this, anyone correct me if I am wrong:
0 = all inactive
1 = x active
2 = y active
3 = x and y active
4 = z active
5 = x and z active
6 = y and z active
7 = x y and z active
8 = heading active
and so forth... So if you take that value and turn it into binary, you have bitfield which tells which channel is active... Now also negative values are possible, if I remember correctly it's like all the channels are active except chans defined by this negative value. Note that -1 = all channels active, but 1 = x right? Right. I am not going to test it now, but I recall you need to add one to negative value to get correct channel exclude bitfield. So -1 +1 = 0 and none of channels are excluded and therefore all channels are active.

1st value. Rotation is in radians instead of degrees.

5th value = curve type. Tcb, bezier, linear etc.

6th value = End setting from Spline block, so how it behaves after keyframed motion, does it hold last value, loop, or what. Funny thing that this gets saved in every frame, though you can only define it for whole channel.

The mystery numbers (10th & 12th) are used for bezier curves tangents, so are 11th and 13th. But you probably don't want to mess with these.

Hope that helps some.

Ulven
04-01-2008, 12:44 PM
I jotted down the things I figured out when I did the mcp loader for the walker:

BeginKeyframe [NumberOfKeyframes] [NumberOfChannelsForThisObject]
[Frame] [RandomNumber] default
[Xpos] (I just ignored the rest of the line)
[Ypos] (Again ignoring the rest of the line for this and the next ones)
[Zpos]
[Heading] (rotation is described in radians, use RTOD & DTOR or the SDK equivalent)
[Pitch]
[Bank]
[Xscale]
[Yscale]
[Zscale]
[Xpivot]
[Ypivot]
[Zpivot]

peksi
04-01-2008, 12:49 PM
Heres some more:
2nd = accel out
3rd = accel in
4th = tangent handles break settings, 0 = default, 1 = tangents separated, 2 = tangents length are equal, 3 = 1&2...

7th = tcb tension
8th = tcb continuity
9th = tcb bias

And thats about it I think.

MarkInTx
04-01-2008, 12:56 PM
Thank you both! This really helps get me started...

CGTalk Moderation
04-01-2008, 12:56 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.