v7.0
指定されたマテリアル ライブラリを Crosswalk ファイル(.xsi v6.0 または .xsiml)に書き出します。 ファイルには、1 つのマテリアル ライブラリと、それに関連するすべてマテリアル、シェーダ、テクスチャ レイヤ、およびイメージ クリップ(関連付けられているユーザ キーワードを含む)が含まれます。
CrosswalkExportMatLib( Filename, MatLib, Binary, ExportUsedImageClipsOnly ); |
| パラメータ | タイプ | 説明 |
|---|---|---|
| Filename | 文字列 | ファイルのパスとファイル名 |
| MatLib | 文字列 | 書き出すマテリアル ライブラリのスクリプト名 |
| Binary | Boolean |
バイナリ フォーマットを使用して dotXSI ファイルを書き出す場合は true、ASCII フォーマットを使用する場合は false デフォルト値: false |
| ExportUsedImageClipsOnly | Boolean |
マテリアル ライブラリに関連付けられているイメージ クリップのみを書き出す場合は true、すべてのイメージ クリップを書き出す場合は false デフォルト値:true |
/*
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 |