FaceFX Support

FaceFX Documentation and support

Python

FaceFX Studio supports Python for a scripting language.  Python code can be executed from the Python tab, or it can be saved out in “.py” files and executed with the exec FaceFX command.

Using the Python Tab

The python tab is a python editor built right into FaceFX Studio using wxPython.  You can execute FaceFX commands from the python shell by prepending the commands with the % character like so:

%loadactor -file ".\Samples\Slade.facefx";

Use the python tab as a test area for writing scripts. You can set variables, and even write multi-line scripts.

Writing Python .py Files

To gain easy access to FaceFX Python Functions, you need to import the appropriate modules.  The FxStudio module is imported by default, so you can reference its functions with FxStudio.functionName or simply functionName. To import the FxAnimation module,  type the following:

from FxAnimation import *

You can execute FaceFX commands from a python script using the issueCommand function like so:

FxStudio.issueCommand('loadactor -file "./Samples/Slade.facefx";')
FxStudio.issueCommand('loadactor -file "%s";'%(pythonVariable))
FxStudio.issueCommand('loadactor -file ' + pythonVariable)

Executing Python .py Files

Use the exec command to execute python scripts.  This command can be inserted into any FXL file, including those executed automatically by FaceFX Studio such as autoexec.fxl.

Reserved Python Objects

The following modules are used by FaceFX Studio internally, and over-riding these objects with user-defined variables may break python execution.  You can import these modules into your own scripts, but avoid creating variables with these names.

See Also

Python Callbacks Python Functions Samples & Help