v1.0
animmixer
指定のアクションをファイルに書き出します。 このコマンドで使用できるファイル形式は次のとおりです。
- 外部の Softimage ネイティブ バイナリ アクション(".eani")ファイル
- dotXSI アクション(".xsi")ファイル
- Softimage プリセット アクション(".Preset")ファイル
ExportAction( Action, [FileName] ); |
| パラメータ | タイプ | 詳細 |
|---|---|---|
| Action | 文字列 または ActionSource | 書き出しするアクション |
| FileName | 文字列 | 書き出し先への完全パス
デフォルト値:ユーザは、ファイルの場所の選択とファイル名の入力を要求されます。 |
#
# 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
|