User Tools

Site Tools


DzEnumProperty

An animatable enum property.

More...

Inherits :

Constructors

DAZ Script
DzEnumProperty ()
DzEnumProperty ( String name, Boolean canAnimate, Boolean isUserProperty )

Methods

Signals

Detailed Description

This class provides an animatable enumerated property that is stored and can be accessed as an integer property. It maintains a list of strings that correspond to the integer value of the property.

Constructors


DzEnumProperty()

Default Constructor. Creates a non-animatable, non-user property.


DzEnumProperty( String name, Boolean canAnimate, Boolean isUserProperty )

Parameter(s):

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

Methods


Number : addItem( String item, Number index=-1 )

Adds a string to the available choices for this property. Duplicates are not allowed.

Parameter(s):

  • item - The string to add to the list of items.
  • index - The index to insert the item at. If invalid, the item is appended to the list.

Return Value:

  • The index of the newly added item is returned, or -1 on error.

Number : findItemString( String str )

Searches the property for an item that matches the given string.

Parameter(s):

  • str - The string to find.

Return Value:

  • The index of the item that matches the given string (if any), otherwise -1.

String : getDefaultStringValue()

Return Value:

  • The string representation of the default value.

String : getItem( Number i )

Parameter(s):

  • i - The index of the item to return.

Return Value:

  • The string representation of the i'th item (if valid), otherwise an empty string.

String : getKeyStringValue( Number i )

Parameter(s):

  • i - The index of the key to return the value of.

Return Value:

  • The string representation of the i'th key value (if valid), otherwise an empty string.

Number : getNumItems()

Return Value:

  • The number of enumerated items.

String : getRawStringValue()

Return Value:

  • The string representation of the raw value (if valid), otherwise the default string.

String : getRawStringValue( DzTime tm )

Parameter(s):

  • tm - The scene time at which to get the raw value of the property.

Return Value:

  • The string representation of the raw value at the given time (if valid), otherwise the default string.

String : getStringValue( DzTime tm )

Parameter(s):

  • tm - The scene time at which to get the value.

Return Value:

  • The string representation of the value at the given time.

String : getStringValue()

Return Value:

  • The string representation of the current value.

String : getUniqueItemString( String item )

Return Value:

  • An item string that is guaranteed to be unique. If item is not already in the list, it is returned. Otherwise, a number will be appended to item to make it unique.

void : removeAllItems()

Removes all items and makes this property essentially invalid.


Boolean : removeItem( Number index )

Removes the item at the given index.

Parameter(s):

  • idx - The index of the item to remove.

Return Value:

  • true if the item was successfully removed, otherwise false.

Boolean : replaceItem( Number index, String item )

Replaces the item at the given index with the given string.

Parameter(s):

  • index - The index of the item to replace.
  • item - The new item to place into the list.

Return Value:

  • false if the index is out of range or the string is invalid (empty), otherwise true.

void : setItems( Array items )

TODO: Add description.


Boolean : setValueFromString( String str )

Sets the current value of the property to the index of the item that matches the given string.

Parameter(s):

  • str - The string to match.

Return Value:

  • true on success, false if the given string does not match an item in this property.

Boolean : setValueFromString( DzTime tm, String str )

Sets the value of the property at the given time to the index of the item that matches the given string.

Parameter(s):

  • tm - The scene time to set the value of the property at.
  • str - The string to match.

Return Value:

  • true on success, false if the given string does not match an item in this property.

Signals


void : itemListChanged()

Signature:“itemListChanged()”

Emitted when the item list (list of legal values for this property) changes.