User Tools

Site Tools


DzElementPostLoadFileData

A DzElementData implementation that associates a file with an element after the element has been loaded into the scene.

More...

Inherits :

Constructors

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

Methods

Detailed Description

Implements a custom data item that causes a specified file to be associated with the owning element after the element has been loaded into the scene.

If the file to post-load is not a script, the path is stored but the file is not loaded.

If the file to post-load is a script:

A global transient variable named DataItem, which refers to the DzElementPostLoadFileData 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 element that owns this data item 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)

Attention:

  • The differences between this implementation and DzSimpleElementScriptData are that this implementation can reference the file path of a file that is not a script and it does not have an associated DzSettings that can be used to configure said script.

See Also:

Constructors


DzElementPostLoadFileData( 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 a given element - an element cannot have two data items with the same name.
  • persistent - If true (default), this data item will be saved with the owning element. If false, 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 an element.

See Also:

Methods


String : getPostLoadFilePath()

Return Value:

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

void : setPostLoadFilePath( String script )

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

Parameter(s):

  • file - The file path of the file.