CrosswalkExportMatLib

導入

v7.0

詳細

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

スクリプト構文

CrosswalkExportMatLib( Filename, MatLib, Binary, ExportUsedImageClipsOnly );

パラメータ

パラメータ タイプ 詳細
Filename 文字列 ファイルのパスとファイル名
MatLib 文字列 書き出すマテリアル ライブラリのスクリプト名
Binary ブール バイナリ フォーマットを使用して dotXSI ファイルを書き出す場合は true、ASCII フォーマットを使用する場合は false

デフォルト値: false

ExportUsedImageClipsOnly ブール マテリアル ライブラリに関連付けられているイメージ クリップのみを書き出す場合は true、すべてのイメージ クリップを書き出す場合は false

デフォルト値: true

JScript の例

/*
        This example shows how to export/import a material library using Crosswalk
*/
// ---------------
// Export:
NewScene(null, false);
// Add a new material library called "MyMatLib" and make it current
CreateLibrary("MyMatLib");
SetCurrentMaterialLibrary("Sources.Materials.MyMatLib");
// Add a material to the MyMatLib library
SICreateMaterial("Phong", "Phong", null, null, false);
// Export the MyMatLib library
CrosswalkExportMatLib("C:\\temp\\MyMatLib.xsiml", "MyMatLib", false, true);
// ---------------
// Import:
NewScene(null, false);
// Import the material library
CrosswalkImportMatLib("C:\\temp\\MyMatLib.xsiml" );
// ---------------
// Expected results:
// INFO : 70 mSec - cumulative: 70 mSec
// INFO : Set version
// INFO : 5 mSec - cumulative: 98 mSec
// INFO : Converting scene info
// INFO : 19 mSec - cumulative: 121 mSec
// INFO : Converting environment
// INFO : 26 mSec - cumulative: 150 mSec
// INFO : Converting image clips
// INFO : 3 mSec - cumulative: 163 mSec
// INFO : Converting image clip animations
// INFO : 2 mSec - cumulative: 170 mSec
// INFO : Converting materials
// INFO : 117 mSec - cumulative: 294 mSec
// INFO : Converting material animations
// INFO : 32 mSec - cumulative: 332 mSec
// INFO : Writing file
// INFO : Parser recognizes a dotXSI file
// INFO : 11 mSec - cumulative: 349 mSec
// INFO : Export completed
// INFO : Parser recognizes a dotXSI file

関連項目

CrosswalkImportMatLib