ExportAction

Introduced

1.0

Description

Exports the specified action to a file. The file formats accepted by this command are:

- External Softimage Native Binary Action (".eani") files.

- dotXSI Action (".xsi") files.

- Softimage Preset Action(".Preset") files.

- Soft3D Animation (".ani,.key,.exp") files.

Scripting Syntax

    ExportAction( Action, [FileName] )

Parameters

Parameter | Type | Description
Action | String or ActionSource | Action to export.
FileName | String | The full path to export to. Default Value: User is prompted to select location and enter a file name

Examples

Python Example

    #
    #    This example demonstrates how to export and import an action. It also
    #    shows how to create an action source from a static source and then
    #    how to access the static source from the imported action.
    #

    from win32com.client import constants as c
    Application.NewScene( "", 0 )
    root = Application.ActiveSceneRoot

    # Create a static action
    obj = root.AddGeometry( "Cone", "MeshSurface" )
    targets = [ obj.rotx.FullName, obj.roty.FullName, obj.rotz.FullName ]
    statics = [ 22.5, 90, 45 ]
    actives = [ 0, 0, 0 ]
    src = root.AddActionSource( "StoredAnimStaticAction", targets, statics, actives )

    # Export the action
    path = Application.InstallationPath( c.siProjectPath ) + "\\Actions"
    filepath = path + "\\TestImportAction.eani"
    Application.ExportAction( src, filepath )

    # Import the action into a new scene but this time in a different model
    Application.NewScene( "", 0 )
    mdl = Application.ActiveSceneRoot.AddModel()
    mdl.Name = "TestActionModel"
    newsrc = Application.ImportAction( mdl, filepath, "ImportedAction4Test", -1 )
    if ( newsrc.SourceItems.Count > 0 ) :
       Application.LogMessage( "Imported action contains these items: " );
       for itm in newsrc.SourceItems :
           datasrc = itm.Source
           Application.LogMessage( "\t" + datasrc.Name )
    else :
       Application.LogMessage( "Imported action is a(n) " + Application.ClassName(newsrc) );

    # Expected results:
    #INFO : Imported action contains these items:
    #INFO :  StaticSource
    #INFO :  StaticSource
    #INFO :  StaticSource

See Also

ImportAction

Autodesk Softimage v7.5