User Tools

Site Tools


DzSimpleSceneScriptData

A DzSimpleSceneData implementation that executes a script after the scene has been loaded.

More...

Inherits :

Constructors

DAZ Script
DzSimpleSceneScriptData ( String name, Boolean persistent=true )

Methods

DAZ Script
StringgetScriptFilePath ()
voidsetScriptFilePath ( String script )

Detailed Description

Implements a custom data item that causes a specified script to be executed after the scene has been loaded.

A global transient variable named DataItem, which refers to the DzSimpleSceneScriptData that invoked the execution of the script, is provided to the script in the global context at runtime. Attempts to use this global variable outside of the associated script will result in a ReferenceError.

A global transient variable named FileIOSettings, which refers to the DzFileIOSettings that was used when the scene was loaded, is provided to the script in the global context at runtime. Attempts to use this global variable outside of the associated script will result in a ReferenceError. (since 4.9.4.109)

If the DzSettings for this data item contains a boolean setting named RunOnce set to true, the specified script will be run once and then this data item will be deleted from the scene.

See Also:

Constructors


DzSimpleSceneScriptData( String name, Boolean persistent=true )

Default constructor.

Parameter(s):

  • name - The name for this data item. This must be unique for all data items on the scene - a scene cannot have two data items with the same name.
  • persistent - If true, this data item will be saved with the scene. If false (default), this data item will not be saved.

Attention:

  • It is the developer's responsibility to manage the lifetime of this object. This can be accomplished most easily by adding it to the list of data items owned by the scene.

See Also:

Methods


String : getScriptFilePath()

Return Value:

  • The file path of the script for this data item (if any), otherwise an empty string.

void : setScriptFilePath( String script )

Sets the file path of the script for this data item.

Parameter(s):

  • script - The file path of the script.