Retargeter Python Commands [MotionBuilder]

Brian Genna -

**This article is unfinished.**

 

When you install Retargeter Pro 4.0+ for MotionBuilder, with it you'll have access to a suite of Python commands that allow you to build batch scripts.  With these commands you can create scripts to automate your Faceware animation pipeline to create, edit, and manage any number of shots.

 

Initializing the Python Commands

In the script example below, we'll create an instance of the commands with the namespace "mb".  Be sure to change the path below to your installation directory.  After running the snippet of code below, you'll have access to all Retargeter Python commands under the "mb" namespace.

----------------------------------

import imp

RetargeterCommands = imp.load_source('RetargeterCommands', 'C:/Program Files/Faceware/Retargeter 4.0/MotionBuilder/2013(64)/RetargeterCommands.py')

mb = RetargeterCommands.RetargeterCommands()

----------------------------------

Python Command Usage

 

mb.addpose - Adds a Pose to a Face Group

Usage:

  • Arguments: Face Group (String), Scene Frame Number (Integer), Description (String)
  • Example: mb.addpose("Brows", 10, "PoseName")



mb.addretargetrange - Add a new Range

Usage:

  • Arguments: Face Group (String), Name of Frame Range (String), Frame Range (String)
  • Example: mb.addretargetrange("Brows", "Not All", "1-10")

 

mb.addsharedpose - Adds the pose to the Shared Pose Database.

Usage:

  • Arguments: Face Group (String), Scene Frame Number(Integer)
  • Example: mb.addsharedpose("Brows", 10)

 

mb.applysharedposetoscene - Applies Shared Pose to Scene

Usage:

  • Arguments: Face Group(String), Name of Video(String), Scene Frame Number (Integer)
  • Example: mb.applysharedposetoscene("Brows", "Shot_Name", 0)

 

mb.backup -  Creates a Backup Point

Usage:

  • Arguments: Name Of Folder(String)
  • Example: mb.backup("FolderName")



mb.clearallkeys - Clears all keyframes within the specified group and range.

Usage:

  • Arguments: Face Group(String), Frame Range Name (String)
  • Example: mb.clearallkeys("Brows", "All Frames")




mb.copypose - Makes a Copy of a Pose

Usage:

  • Arguments: Face Group(String), Scene Frame Source(Integer), Scene Frame Destination(Integer), New Name of Pose(String)
  • Example: mb.copypose("Brows", 0, 10, "CopiedPose")



mb.createnetworkdatabase - Creates a Shared Pose Database

Usage:

  • Arguments: Shared Pose Database File Path (String)
  • Example: mb.createnetworkdatabase("c:/test.db")




mb.defaultcurrentframe - Sets all controllers in specified Pose Group to their default value on the current frame.

Usage:

  • Arguments: Face Group(String)
  • Example: mb.defaultcurrentframe("Brows")



mb.deletepose - Deletes the pose on the specified frame.

Usage:

  • Arguments: Face Group(String), Scene Frame Number(Integer)
  • Example: mb.deletepose("Brows", 10)

 


mb.deleteretargetingrange - Deletes a Range

Usage:

  • Arguments: Face Group(String), Frame Range Name(String)
  • Example: mb.deleteretargetingrange("Brows", "Not All")



mb.deletesharedpose - Deletes a Shared Pose from the Shared Pose Database

Usage:

  • Arguments: Face Group(String), Video Title(String), Scene Frame Number(Integer)
  • Example: mb.deletesharedpose("Brows", "Shot_Name", 0)



mb.editretargetingrange - Edit an existing Frame Range

Usage:

  • Arguments: Face Group (String), Current Frame Range Name (String), New Frame Range Name (String), Pruning (Integer), Prune Spacing (Integer), Smoothing (Integer), Master Control (String), Frame Range (String), Autosolve (Boolean), Pose Weight (Integer)
  • Example: mb.editretargetingrange("Brows", "All Frames", "Not All", 0, 0, 0, "", "1-10", False, 1)

 

mb.exportposegroupkeys - Exports Face Group Keys to Text File

Usage:

  • Arguments: Face Group(String), Output Directory(String)
  • Example: mb.exportposegroupkeys("Brows", "c:/test.txt")



mb.getautoposes - Gets a number of AutoPoses on the Face Group and Frame Range specified.

Usage:

  • Arguments: Face Group (String), Frame Range Name (String), Number Of Poses (Integer)
  • Example: mb.getautoposes("Brows", "All Frames", 3)



mb.loadperformance - Loads a Performance in Retargeter

Usage:

  • Arguments:  .FWR File Path (String), Character Setup File Path (String), Set Frame Rate On or Off (Boolean), Set Playback Range to Match Video On or Off (Boolean), Import Audio On or Off (Boolean), Import Video On or Off (Boolean), Use AutoSolve On or Off (Boolean)
  • Example: mb.loadperformance("D:/MyFile.fwr", "D:/MyCharacter.xml", True, True, True, True, True)



mb.movepose  -  Moves a pose from one frame to another.

Usage:

  • Arguments: Face Group (String), Origin Scene Frame Number (Integer) Destination Scene Frame Number (Integer), Description (String)
  • Example: mb.movepose("Brows", 10, 20, "MovedPose")



mb.reloadretargetingresults - Reloads Retargeting Results.

Usage:

  • Arguments: Face Group (String), Frame Range Name (String)
  • Example: mb.reloadretargetingresults("Brows", "All Frames")

 

mb.restore - Restores scene from a Backup.

Usage:

  • Arguments: Backup Name (String)
  • Example: mb.restore("FolderName")

 

mb.reverttoposes - Reverts to poses only. Removes in-between animation.

Usage:

  • Arguments: Face Group (String), Frame Range Name (String)
  • Example: mb.reverttoposes("Brows", "All Frames")



mb.runretargeting -  Retargets a Pose Group and Frame Range

Usage:

  • Arguments: Face Group (String), Frame Range Name (String),Scene Frame Number (Integer), On or Off (Boolean)
  • Example: mb.runretargeting("Brows", "All Frames", 0, True)



mb.setnetworkdatabase - Loads a Shared Pose Database

Usage:

  • Arguments: Shared Pose File Location (String)
  • Example: mb.setnetworkdatabase("D:/Shared_Poses.imdb")

 

mb.setplaybackrange - Sets the timeline to match the video’s range.

Usage:

  • Arguments: Range of Integers EG: 1-100
  • Example: mb.setplaybackrange(1-100)

 

mb.setposename - Sets the description of the specified pose.

Usage:

  •  Arguments: Face Group (String), Scene Frame Number (Integer), Description (String)
  • Example: mb.setposename("Brows", 1, "SetName")

 

mb.setsceneframeoffset - Sets the scene’s frame offset for current job.

Usage:

  • Arguments: Offset (Integer)
  • Example: mb.setsceneframeoffset(0)

 

mb.updatepose - Updates an existing Pose.

Usage:

  • Arguments: Face Group (String), Scene Frame Number (Integer)
  • Example: mb.updatepose("Brows", 0)

 

mb.updateposeselected - Turns a Pose on or off.

Usage:

  • Arguments: Face Group (String), Frame Range Name (String), Scene Frame Number (Integer),  On or Off (Boolean)
  • Example: mb.updateposeselected("Brows", "All Frames", 0, True)



mb.updatesharedposes - Updates the user’s shared poses if the database has been updated.

Usage:

  • Arguments: Face Group (String), Face Group (String), Face Group (String)
  • Example: mb.updatesharedposes("Brows", "Eyes", "Mouth")

 

 

Have more questions? Submit a request

Comments

this.location="http://support.facewaretech.com"
Powered by Zendesk