XPF Morph format
Home Up XMF File format XSF Skeleton format XRF file format XAF file format XPF Morph format Rotations

 

XPF Morph file format

Information is hard to find, so the following is based on a sample file I have been given.

The XPF format is a lot like an animation file, however in place of bone IDs it has MORPHNAME attributes and instead of translations and rotations it has WEIGHT tags.

What appears to be happening is that the target mesh has "morphs" built in, pre-programmed actions, for example the upper left eyelid closing. The XPF file "weight" numbers (ranging from 0 to 1) tell it when to apply those actions and by how much. Since the actions are built into the mesh not the XPF file the mesh can be replaced and the XPF can still work, for example if the human head is replaced with an animal head the eye movements can still work, and since the morphs are accessed by name it is safe to make meshes with less than the full set of morphs, any morph weights that don't have corresponding morphs in the mesh will simply be ignored.

<HEADER MAGIC="XPF" VERSION="919" />
<ANIMATION NUMTRACKS="29" DURATION="4">
    <TRACK NUMKEYFRAMES="121" MORPHNAME="blink.Left.Lower.Clamped">
        <KEYFRAME TIME="0">
            <WEIGHT>0</WEIGHT>
        </KEYFRAME>

The following is a list of the morph names found in the file, which presumably reflect those found in an avatar face.

blink.Left.Lower.Clamped
blink.Left.Upper.Clamped
blink.Right.Lower.Clamped
blink.Right.Upper.Clamped
eyebrow.Left.Angry.Average
eyebrow.Left.Down.Average
eyebrow.Right.Angry.Average
eyebrow.Right.Down.Average
eyebrows.Left.Sad.Average
eyebrows.Left.Up.Average
eyebrows.Right.Sad.Average
eyebrows.Right.Up.Average
Face.Additive
left.Eye.Down.Clamped
left.Eye.Left.Clamped
left.Eye.Right.Clamped
left.Eye.Up.Clamped
mouth.Frown.Exclusive
mouth.Grin.Exclusive
mouth.Mad.Exclusive
mouth.Open.Exclusive
mouth.Pucker.Exclusive
mouth.Smile.Exclusive
mouth.Surprise.Exclusive
mouth.Tongue.Exclusive
right.Eye.Down.Clamped
right.Eye.Left.Clamped
right.Eye.Right.Clamped
right.Eye.Up.Clamped

Given this list it is hoped that XPF files may be generated by text editing the same way that XAF files can.

More information on Morph names may be found at the new "Education Center":

http://www.imvu.com/creators/education_center.php?tutorial_id=2225221

where the list runs to 79 Morphs including the eye movement morphs e.g. look left, right etc.

Also see the older one at:

IMVU Developers - How to Make Avatar Heads

where you will find the above list in a better order and an explanation of the suffixes "Average, Additive, Clamped, Exclusive", which determine what action to take when multiple morph files are active. 

Average: Take the average of the weight values.

Additive: Sum the values

Clamped: Sum the values, limiting the result so it can't exceed 1

Exclusive: Only one weight value is accepted, probably the last to be applied.

Face.Additive

 The above morph does not appear to be used for animation, instead it appears to have been added as a shortcut to reshape the head without invalidating the other morphs. As such I suspect that IMVU applies a permanent weight of 1 and that XPF files should not modify it.

What is going on here is that this morph is applied constantly, but is not defined in the standard head. By adding this morph a mesher can adjust the shape of the head by small amounts without the need to adjust all the other morphs.