ImportPrefs

Description

Imports a saved .DSPrefs file. It is required to have a .DSPrefs file saved on disk to execute this command.

This command is not directly accessible from the user interface, however you can achieve a similar result using the InstallAddon command. From the "Install Add-On" dialog box, press the browse button (...). From the file selection dialog, change the "File types" field to Preferences (old format), and then select the .DSPrefs file. Then press Install in the "Install Add-On" dialog box.

DSPref files can no longer be created in XSI. The information that used to be stored in them is now contained in XSI addons.

Note: This command imports ALL the presets saved in the file.

Scripting Syntax

ImportPrefs( [FileName] )

Parameters

Parameter

Type

Description

FileName

String

Name of the file to import

Default Value: A file browser will prompt for a file if no filename is provided.

Examples

VBScript Example

'---------------------------------------------------------
' Example of loading a DSPrefs file.
'---------------------------------------------------------
NewScene , false

' Load a DSPrefs file, containing a layout to set all display views at once.
PrefFile = Application.InstallationPath( siFactoryPath ) & "\Data\XSI_SAMPLES\Toolbars\Viewing_Toolbar_AllViewsDisplay.DSPrefs"
ImportPrefs PrefFile

' Now create a primitive, so that it will look different in all views.
CreatePrim "Sphere", "MeshSurface", "View-O-Sphere"
ApplyShader "OGL1Pass", "View-O-Sphere"
CreateProjection "View-o-Sphere", siTxtSpherical, siTxtDefaultSpherical, "Texture_Support", "Texture_Projection"
SetInstanceDataValue , "View-o-Sphere.Material.RealTime.out.previous.out.previous.out.previous.out.tspace_id", "Texture_Projection"

'---------------------------------------------------------
' Output from this script:
'  Object : View-O-Sphere.
'
' In the "Set All View Display Model" dialog that appears (as a result of the
' ImportPrefs command), press the different buttons to see that all displays
' change corresponding to the button pressed.
'---------------------------------------------------------

See Also

InstallAddon

CreateToolbar

CreateToolbarButton

CreateScriptCommand



SOFTIMAGE|XSI v6.01     

Return to Softimage XSI Index