AddOverrideFromPreset (Delta)
Description
Adds an override to the Delta based on the specified preset.
Note: If there already an override in the delta, remove it before running this method.
Scripting Syntax
Delta.AddOverrideFromPreset( Name )
C# Syntax
Delta.AddOverrideFromPreset( String in_Preset );
Parameters
|
Parameter |
Type |
Description |
|
Name |
Filename of preset |
Examples
JScript Example
/*
This example demonstrates how to add an override property from a preset
and display information about the delta
*/
NewScene(null, false);
// Preset file path
var presetFile = XSIUtils.BuildPath(Application.InstallationPath(siUserPath),
"Data", "DSPresets", "Properties", "Override.Preset");
// Create the preset
CreateOverridePreset();
NewScene(null, false);
// Create a reference model from a cube
var oRoot = Application.ActiveProject.ActiveScene.Root;
var oCube = oRoot.AddGeometry("Cube", "MeshSurface");
var emdlFileRefModel = XSIUtils.BuildPath(Application.InstallationPath(siProjectPath), "Models", "MyModel.emdl");
CreateModelAndConvertToRef(oCube, emdlFileRefModel );
// Add the Delta object
var oDelta = AddDelta(oCube.Model);
// Add the override from preset
oDelta.AddOverrideFromPreset(presetFile);
UpdateReferencedModel(oCube.Model);
// This function creates the preset that will be added to the Delta
function CreateOverridePreset ( )
{
// Get the scene root
var oRoot = Application.ActiveProject.ActiveScene.Root;
// Create a cube
var oCube = oRoot.AddGeometry("Cube","MeshSurface");
// Create a reference model
var emdlFileRefModel = XSIUtils.BuildPath(Application.InstallationPath(siProjectPath), "Models", "MyModel.emdl");
CreateModelAndConvertToRef(oCube, emdlFileRefModel);
// Create the override
AddProp("Synoptic Property", oCube, "", null, null);
// Set a new value
SetValue( oCube + ".Synoptic_Property.displayname", "TestName", null);
// Save the override preset
SavePreset("Model.Delta.PropertiesAddedToRefModel", presetFile, null, null, null, false, null);
}
See Also
SOFTIMAGE|XSI v6.01