CrosswalkImportMatLib

導入

v7.0

詳細

マテリアル、シェーダ、テクスチャ レイヤ、およびイメージ クリップ(関連付けられているユーザ キーワードを含む)を Crosswalk ファイル(.xsi v6.0 または .xsiml)から、指定されたマテリアル ライブラリに読み込みます。

スクリプト構文

CrosswalkImportMatLib( Filename, [MatLib] );

パラメータ

パラメータ タイプ 詳細
Filename 文字列 読み込むファイルのパスとファイル名
MatLib 文字列 読み込み先のマテリアル ライブラリのスクリプト名。 指定されていない場合は、新しいマテリアル ライブラリが作成されます。 このライブラリの名前が読み込まれたファイルにあるライブラリの名前に変更される点に注意してください。

Python の例

#
# This example shows how to export/import a material library using Crosswalk
#
app = Application
# ---------------
# Export:
app.NewScene("", False)
# Add a new material library called "MyMatLib" and make it current
app.CreateLibrary("MyMatLib")
app.SetCurrentMaterialLibrary("Sources.Materials.MyMatLib")
# Add a material to the MyMatLib library
app.SICreateMaterial("Phong", "Phong", None, None, False)
# Export the MyMatLib library
app.CrosswalkExportMatLib("C:\\temp\\MyMatLib.xsiml", "MyMatLib", False, True)
# ---------------
# Import:
app.NewScene("", False)
# Import the material library
app.CrosswalkImportMatLib("C:\\temp\\MyMatLib.xsiml")
# Expected results:
# INFO : 15 mSec - cumulative: 15 mSec
# INFO : Set version
# INFO : 2 mSec - cumulative: 36 mSec
# INFO : Converting scene info
# INFO : 7 mSec - cumulative: 51 mSec
# INFO : Converting environment
# INFO : 12 mSec - cumulative: 72 mSec
# INFO : Converting image clips
# INFO : 1 mSec - cumulative: 82 mSec
# INFO : Converting image clip animations
# INFO : 0 mSec - cumulative: 93 mSec
# INFO : Converting materials
# INFO : 35 mSec - cumulative: 139 mSec
# INFO : Converting material animations
# INFO : 12 mSec - cumulative: 160 mSec
# INFO : Writing file
# INFO : Parser recognizes a dotXSI file
# INFO : 7 mSec - cumulative: 177 mSec
# INFO : Export completed
# INFO : Parser recognizes a dotXSI file

関連項目

CrosswalkExportMatLib