SIImportDotXSIFile

カテゴリ

ファイル

詳細

dotXSI ファイルを読み込みします。 読み込み ファイルは、拡張子.xsi を持つ dotXSI フォーマットでなければなりません。

このコマンドにはメイン メニューからアクセスできます。[ファイル] > [書き出し] > [dotXSI]を選択した後、必要な読み込み オプションを選択し、[OK]をクリックします。 このコマンドはImportDotXSIコマンドと同じ機能を持ちますが、ユーザに読み込みオプションの入力を要求しない点が異なります。

このコマンドは、インターネットからのファイルのダウンロードに対応しています。 ファイル名に URL を指定すると、コマンドが実行される前にそのファイルがローカルにダウンロードされます。

スクリプト構文

SIImportDotXSIFile( FileName, [Parent] );

パラメータ

パラメータ タイプ 詳細
FileName 文字列 読み込みする dotXSI ファイルの名前
Parent 文字列 親として使用するオブジェクトまたはモデル

VBScript の例

'---------------------------------------------------------
' VBScript example : Importing and exporting a dotXSI file.
' This example uses the SIImportDotXSIFile and SIExportDotXSIFile
' commands, which do not prompt for the user for validation of 
' import/export parameters like ImportDotXSI and ExportDotXSI.
'---------------------------------------------------------
' Create a model, with some primitives.
dim ExportRoot
SICreateModel , "ExportRoot", , ExportRoot
CreatePrim "Torus", "MeshSurface", "Torus", ExportRoot
CreatePrim "Cube", "NurbsSurface", "Cube", ExportRoot
' Since we are not getting a dialog to modify dotXSIExport options,
' We can specify them here, if we wish. To see what each parameter corresponds to,
' goto the .spdl file, <InstallationPath>\Application\spdl\C3DdotXSIExportOpt.spdl.
SetValue "dotXSIExportOptions.project_name", ActiveProject.Name
SetValue "dotXSIExportOptions.output_file_format", 1 ' 0 = Binary, 1 = Ascii
SetValue "dotXSIExportOptions.output_file_format_version", 360 ' "3.0" = 300, "3.5" = 350, "3.6" = 360
SetValue "dotXSIExportOptions.sceneroot", False
SetValue "dotXSIExportOptions.polymesh", True
SetValue "dotXSIExportOptions.tesselation", False
SetValue "dotXSIExportOptions.nrbssrf", True
SetValue "dotXSIExportOptions.nrbscrv", True
SetValue "dotXSIExportOptions.animall", True
SetValue "dotXSIExportOptions.constraint", True
SetValue "dotXSIExportOptions.custompset", True
' Now specify to export the model to a dotXSI file
dotXSIFile = Application.InstallationPath( siUserPath ) & "\MyModel.xsi"
SIExportDotXSIFile ExportRoot, dotXSIFile
' Now delete the primitives and model, and re-import them.
DeleteObj "ExportRoot.Torus"
DeleteObj "ExportRoot.Cube"
DeleteObj "ExportRoot"
' Again, since we do not get a dialog box to change import options, change them
' now programmatically. To see what each parameter corresponds to, goto the
' .spdl file, <InstallationPath>\Application\spdl\C3DdotXSIImportOpt.spdl.
SetValue "dotXSIImportOptions.anim_import", True
SetValue "dotXSIImportOptions.classical_scaling", True
SetValue "dotXSIImportOptions.mat_import", True
SetValue "dotXSIImportOptions.txt_import", True
' Now import the same model that was just exported.
SIImportDotXSIFile dotXSIFile
'---------------------------------------------------------
' Output from this script (user specifies ok on both dialogs):
'INFO : "4004 - Begin: Export .xsi file"
'INFO : "4005 - End: Export .xsi file"
'INFO : "4002 - Begin: Import .xsi file"
'INFO : "4003 - End: Import .xsi file"
' Object: ExportRoot.Torus
' Object: ExportRoot.Cube
'---------------------------------------------------------

関連項目

ImportDotXSI ExportDotXSI ImportModel SIExportDotXSIFile