File format

Hi,

I've used FaceFX a few years ago. At the time, we were using ".fxe" files that were containing the data of the target poses for all the frames of an anim.

I now use a lot more recent version (2013) and I'd like to know if there's any file format now that contains that info alone? The idea is that we have more than one pipeline for facial animation (common point is the posing system), so I may want to simply convert your file (like the fxe) to our one file format.

Thanx

Permalink

Hi,

You can read about the various file formats here: http://facefx.com/documentation/2013/W37

I'm not sure what data you're looking for. If you're looking for the weight curves that drive the poses, those curves are in the animations which could be in the .facefx files or the .animset files. You're not limited to those files, though. In FaceFX Studio you can export to XML and get that data there, or you can access the data through Python and write out whatever format you wish.

If you want a traditional "mocap" style data format with bone transforms at each frame you will need to use the FaceFX SDK to compute the bone transforms and write out your custom format that way.

- Jamie

Permalink

What we want is some kind of animset with a collapsed face graph or, in other words, an animset that contains curves only for the basic bone poses we get from 3DSMAX.

When Steeve (animator) exports a collapsed actor to XML, the curves we have for the single animation contained in the XML are just like we want. But then, it doesn't seem natural to use an actor XML instead of an animset.

I'll explain you our workflow and maybe you could identify what's best for us:
FOR all WAVs
Generate a facial animation

It can't be simpler than that! On the engine side, when we detect a dependency on a FaceFx animation, we convert the latter to our binarized facial animation format. To do so, we need to evaluate all the curves in the FaceFx animation and output keys for OUR bone poses (the one we get from 3DSMAX). So, if the curves in the FaceFx animation file directly contain our bone poses, it's a pretty straightforward operation.

Can you please indicate what's the best way of generating the animation in the format we want?

Permalink

Hi,

If you just want to collapse the graph down to contain only bone pose nodes and animations to only contain bone pose curves, you should try the fgcollapse command: http://facefx.com/documentation/2013/W189

That command will bake all animations so that only "target" nodes are left in the graph and only "target" curves are left in the animations.

- Jamie

Permalink

What I want is to output one ".animset" file per WAV (or, if you want, one file per animation). I know it goes a bit against the idea of an animset...

I tried collapsing an actor with the "fgcollapse" console command. It seems to work but, then, if I export an animation contained in the collapsed actor, it seems like the exported ".animset" file is not based on the target poses we get from 3DSMAX.

Is that normal or is there something not setup properly in our actor?

Permalink

fgcollapse will ignore "mounted" animation sets. If you are mounting these sets, that could be your problem. If, however, you open the actor, analyze a wav file and put it in a new group or a non-mounted group (one that is inside the actor and not in a .animset file), then collapse, then open the collapsed actor file and export the animation group to a .animset file it will be "collapsed".

The fgcollapse command is creating a new .facefx file (with FG-Collapsed in the file name), so you need to open that file and export the animation group to a .animset file. Basically don't use .animset files until you create them by exporting from a collapsed actor file.

Also, you don't _have_ to use .animset files. Animations are stored in the .facefx file itself. .animset files are just for storing groups of animations that can be streamed in and out of your game. .facefx files contain the face graph and animations. You export a .animset file from the .facefx file when you don't want those animations always resident in memory for the entire duration of the game.

When you batch analyze, it will be difficult to put every animation in its own unique group. The options there are to use Python to find all of the wav files and issue commands to create groups, select the group, and analyze each wav individually with the analyze command; or organize your wav files on disk so that each wav file is in its own unique directory.

Permalink

I think you want to write a python function that takes the path to an existing .facefx file, an audio file, and an output .animset file. Then you call the function for all of your audio. The below code works, but you will have to indent the function, as the formatting gets lost in the post:

import tempfile
import os
import re
import FxStudio

def LoadAnalyzeCollapseExport(facefx_file, audio_file, animset_file):

animGroupName = "exportGroup"

collapsed_actor = tempfile.gettempdir() + '\\' + os.path.basename(re.sub('\.facefx', '-FG_Collapsed.facefx', facefx_file))

temp_actor = tempfile.gettempdir() + '\\' + os.path.basename(facefx_file)

# Load the actor file that contains the face graph you want.
FxStudio.issueCommand('loadActor -file ' + facefx_file)

# Analyze the audio (Unlimted versions of Studio only)
FxStudio.issueCommand('analyze -audio ' + audio_file + ' -group ' + animGroupName)

# Save a temporary file
FxStudio.issueCommand('saveActor -file ' + temp_actor)

# Collapse the animation down to the bone poses.
FxStudio.issueCommand('fgcollapse -file "{0}" -output "{1}"'.format(temp_actor, collapsed_actor))

# Load the Collapsed actor
FxStudio.issueCommand('loadActor -file ' + collapsed_actor)

# Select the group prior to exporting it.
FxStudio.issueCommand('select -type "animgroup" -names ' + animGroupName)

# Export the collapsed animset
FxStudio.issueCommand('animSet -export ' + animGroupName + ' -to ' + animset_file)

# Save the tempory actor to avoid warnings (you can also turn them off with g_unattended console variable)
FxStudio.issueCommand('saveActor -file ' + temp_actor)

Permalink

Thank you very much Jamie for your detailed answer.

I wrote an FXL file that follows step by step your indications and it works. I do get a "collapsed" animset.

Note that I surely see the purpose of the "facefx" and "animset" files but, without going into the details, it's just that we need to specify a unique file for each animation we'll refer to. Then, we output in our own binary format.

Permalink

Thanks very much Doug for your post. I've missed it before writting my own code.

The code you wrote is pretty much in line with the one I wrote in a FXL file, except that mine was hardcoded for a single file test case. So I'll switch to yours if it works, then.

Permalink

Hi,

Working with Sami and Steeve, I have C++ code using the sdk to generate separate animset files like Sami explained, however, is it possible to collapse the actor directly via the SDK instead of creating a new file and then reading it again? I found the "FxCompiledFaceGraph::IsNodeTypeRelevantForCollapse" function in the SDK doc, but no other function related to how to generate it. Thank you!

Permalink

Please send SDK and code related questions to support [at] oc3ent.com

- Jamie