FaceFX Support

FaceFX Documentation and support

Python Signals

Table of Contents

  1. actorchanged
  2. analysistextpreprocessor
  3. animationselectionchanged
  4. appshutdown
  5. appstartup
  6. currenttimechanged
  7. newanimationdataavailable
  8. phonememappingchanged
  9. phonemewordlistchanged
  10. postanalysis
  11. posteventtakecreation
  12. postsaveactor
  13. postxmlexport
  14. preloadaudio
  15. preloadtext
  16. presaveactor
  17. previewanimationsettingschanged
  18. refresh
  19. renderassetloaded
  20. renderassetloadfailed
  21. renderassetnamechanged
  22. skeletalanimationtreechanged
  23. visibletimerangechanged

Python signals allow FaceFX Studio to trigger a Python function automatically when certain actions occur.  The Python function is registered with FaceFX Studio by calling “FxStudio.connectSignal”.  connectSignal takes two Arguments: the name of the signal, and the python function to be called.   You can unregister a Python signal by calling “FxStudio.disconnectSignal” which has identical Arguments to connectSignal.


Arguments Description
- Notifies you when the actor has changed (a new actor is created, the current actor is closed, or an existing actor is loaded).
def myActorChangedSignal():
  print "Actor Changed!"
FxStudio.connectSignal("actorchanged", myActorChangedSignal)


Arguments Description
analysis text, language Allows you to change the analysis text prior to analysis.  You can scan the existing text, then add text tags for events or curves, or change the analysis text before analysis. Must return a Python Unicode string (the analysis text to use).
def myAnalysisTextPreProcessorSignal(analysisText, language):
  return "{group1|angryEvent}" + analysisText
FxStudio.connectSignal("analysistextpreprocessor", myAnalysisTextPreProcessorSignal)


Arguments Description
group name, animation name Notifies you when the animation selection has changed.
def myAnimationSelectionChangedSignal(groupName, animName): 
  print "User selected (" + groupName + ", " + animName + ")" 
FxStudio.connectSignal("animationselectionchanged", myAnimationSelectionChangedSignal)


Arguments Description
- Notifies you when the application is shutting down.
def myAppShutdownSignal():
  print "Application shutting down!"
FxStudio.connectSignal("appshutdown", myAppShutdownSignal)


Arguments Description
- Notifies you when the application is starting up.
def myAppStartupSignal():
  print "Application starting up!"
FxStudio.connectSignal("appstartup", myAppStartupSignal)


Arguments Description
newTime Notifies you when the current time has changed.
def myCurrentTimeChangedSignal(newTime):
  print "current time changed!"
FxStudio.connectSignal("currenttimechanged", myCurrentTimeChangedSignal)


Arguments Description
- Notifies you when new animation data is available. (essentially, any time your character moves in the preview window).  This signal could be used to keep an external application in synch with FaceFX Studio’s preview state.
def myNewAnimationDataAvailableSignal():
  print "new animation data is available!"
FxStudio.connectSignal("newanimationdataavailable", myNewAnimationDataAvailableSignal)


Arguments Description
- Notifies the user when the phoneme mapping has changed.
def myPhonemeMappingChangedSignal():
  print "The phoneme mapping changed!"
FxStudio.connectSignal("phonememappingchanged", myPhonemeMappingChangedSignal)


Arguments Description
- Notifies the user when the phoneme bar has been modified.
def myPhonemeWordlistChangedSignal():
  print "The phoneme & word list changed!"
FxStudio.connectSignal("phonemewordlistchanged", myPhonemeWordlistChangedSignal)


Arguments Description
group name, animation name Notifies the user when an animation has been created by analyzing audio
def myPostAnalysisSignal(groupName, animName):
  print animName + " in group " + groupName + "was just analyzed"
FxStudio.connectSignal("postanalysis", myPostAnalysisSignal)


Arguments Description
group name, animation name Notifies you when a new animation take.
def myPostEventTakeCreationSignal(groupName, animName):
  print "New Event take on (" + groupName + ", " + animName + ")"
FxStudio.connectSignal("posteventtakecreation", myPostEventTakeCreationSignal)


Arguments Description
actor path  Notifies you when a .facefx file is saved.
def myPostSaveActorSignal(actorPath):
  print "Actor was saved to " + actorPath + "." 
FxStudio.connectSignal("postsaveactor", myPostSaveActorSignal)


Arguments Description
xmlPath Notifies you when the actor has been exported to an .xml file.
def myPostXmlExportSignal(xmlPath):
  print "Exported to " + xmlPath
FxStudio.connectSignal("postxmlexport", myPostXmlExportSignal)


Arguments Description
relativePath, absolutePath Allows you to intercept audio loading and alter audio sources. Must return a Python string (path to audio; can be a relative or absolute path).
def myPreloadAudioSignal(relativePath, absolutePath):
  return relativePath
FxStudio.connectSignal("preloadaudio", myPreloadAudioSignal)


Arguments Description
initial audio path, analysis language Called prior to executing the analyze command.  Allows you to override the text file to load.  Inputs are the default text file path (in the same folder as the audio file with the same filename and the .txt file extension) and the language for analysis.  Must return a string (the path to the text file to use).

Note: Only Available in versions of FaceFX Studio with the Analyze command.

def myPreloadTextSignal(textPathInitial, analysisLanguage):
  # Change to search for text in "E:" drive
  return textPathInitial.replace("C:", "E:")
FxStudio.connectSignal("preloadtext", myPreloadTextSignal)


Arguments Description
Notifies you before a .facefx file is about to be saved.
def myPreSaveActorSignal():
  print "Actor is about to be saved." 
FxStudio.connectSignal("presaveactor", myPreSaveActorSignal)


Arguments Description
- Notifies you when the preview animation has changed
def myPreviewAnimationSettingsChangedSignal():
  print "preview animation settings changed!"
FxStudio.connectSignal("previewanimationsettingschanged", myPreviewAnimationSettingsChangedSignal)


Arguments Description
- Notifies you when the application has been refreshed (can happen frequently while dragging keys, so be careful implementing this function).
def myRefreshSignal():
  print "Refresh occurred!"
FxStudio.connectSignal("refresh", myRefreshSignal)


Arguments Description
- Notifies you when a new render asset is loaded.
def myRenderAssetLoadedSignal():
print "render asset loaded!"
FxStudio.connectSignal("renderassetloaded", myRenderAssetLoadedSignal)


Arguments Description
- Notifies you when the loading of a render asset failes.
def myRenderAssetLoadFailedSignal():
  print "render asset load failed!" 
FxStudio.connectSignal("renderassetloadfailed", myRenderAssetLoadFailedSignal)


Arguments Description
- Notifies you when the user changes the render asset name.  This signal will be followed by either a renderassetloadfailed or renderassetloaded signal.
def myRenderAssetnameChangedSignal():
  print "render asset name changed!" 
FxStudio.connectSignal("renderassetnamechanged", myRenderAssetnameChangedSignal)


Arguments Description
- Notifies you when the skeletal animation tree is updated.  The skeletal animation tree is a structure created inside of FaceFX Studio to manage full-body Ogre animations that defined by events.
def mySkeletalAnimationTreeChangedSignal(): 
  print "skeletal animation tree has changed!" 
FxStudio.connectSignal("skeletalanimationtreechanged", mySkeletalAnimationTreeChangedSignal)


Arguments Description
minTime, maxTime Notifies you when the animation time range has changed.
def myTimeRangeChangedSignal(minTime, maxTime):
  print "New TimeRange: " + str(minTime) + ":" + str(maxTime)
FxStudio.connectSignal("visibletimerangechanged", myTimeRangeChangedSignal)