User Tools

Site Tools


DzFileProperty

A static (non-animatable) string property that holds a file path.

More...

Inherits :

Enumerations

Constructors

DAZ Script
DzFileProperty ()
DzFileProperty ( String name, Boolean isUserProperty )

Methods

Signals

Detailed Description

Attention:

  • Attempts to save and restore as relative path when possible.

Enumerations


: FileType

The behavior of the property, as presented to the user.

  • FileSave - The user will be prompted with a 'Save As' type dialog when browsing for a file.
  • FileOpen - The user will be prompted with an 'Open' type dialog when browsing for a file.
  • Dir - The user will be prompted with a 'Select Folder' type dialog when browsing for a directory.
  • FileLoad - If a file has been specified, the file will be loaded when the user clicks a load button. If a file has not been specified, or this property's display text is empty, this behaves the same as FileOpen. See Also: getDisplayText()
  • setDisplayText()
  • loadFile() Since: 4.20.0.3

Constructors


DzFileProperty()

Default Constructor. Creates a non-user property.


DzFileProperty( String name, Boolean isUserProperty )

Parameter(s):

  • name - The name of this property.
  • isUserProperty - If true, creates a user property; user properties are properties that can be added/deleted by users.

Methods


String : getAbsolutePath( String path )

Parameter(s):

  • path - The (relative) path of the file.

Return Value:

  • The absolute path of the file specified by the given path

String : getDisplayText()

Return Value:

  • The display text for this property (if any), otherwise an empty string.

Since:

  • 4.20.0.3

String : getFilter()

Gets the filter value.


FileType : getType()

Gets the file type.


Boolean : loadFile()

Causes the file specified in the value of this property to be loaded.

Attention:

  • If the file specified in the value of this property is a script, a global transient variable named Property, which refers to this property, 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. If the file specified in the value of this property is NOT a script, the absolute path of the file is sent to DzContentMgr::openFile() and merged with the scene.

Return Value:

  • true if the file is load successfully, otherwise false.

Since:

  • 4.20.0.3

void : setDisplayText( String text )

TODO: Add description.


void : setFilter( String filter )

Sets the value to use as a file extension filter.

Parameter(s):

  • filter - The filter to set. This should be in the form “FilterName (*.ext1 *.ext2 *.ext3)”.

Attention:

  • If this property is of the type SaveFile, and if the save file is not given an extension by the user, then the first extension listed will be added to the filename. The filter is not checked if setValue() is used.

void : setType( FileType type )

Sets the file type for the property.

Parameter(s):

  • type - The file type to set.

Signals


void : displayTextChanged()

Signature:“displayTextChanged()”

Emitted when the display text for the property changes.


void : filterChanged()

Signature:“filterChanged()”

Emitted when the filter for the property changes.