#
# 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
|