DAZ Studio implementation of property links (aka ERC).
Inherits :
DAZ Script | |
---|---|
ERCKeyInterpolation | { LINEAR_INTERP, CONSTANT_INTERP, TCB_INTERP } |
ERCType | { ERCDeltaAdd, ERCDivideInto, ERCDivideBy, ERCMultiply, ERCSubtract, ERCAdd, ERCKeyed } |
DAZ Script |
---|
DzERCLink () |
DzERCLink ( DzERCLink copyFrom, DzNumericProperty property=undefined ) |
DzERCLink ( ERCType type, DzNumericProperty property, Number scalar=1.0, Number addend=0.0 ) |
DzERCLink ( DzNumericProperty property, Number scalar=1.0, Number addend=0.0 ) |
DAZ Script | |
---|---|
Number | addKeyValue ( Number key, Number value ) |
Number | addKeyValue ( Number key, Number value, Number t, Number c, Number b ) |
void | clearKeys () |
DzERCLink | duplicate ( DzNumericProperty newProperty=undefined ) |
Number | findKeyIndex ( Number key ) |
DzNumericProperty | getCurrentProperty () |
Number | getKey ( Number which ) |
Number | getKeyOpValue ( Number val ) |
Number | getKeyParamB ( Number which ) |
Number | getKeyParamC ( Number which ) |
Number | getKeyParamT ( Number which ) |
Number | getKeyValue ( Number which ) |
Number | getNumKeyValues () |
DzNumericProperty | getProperty () |
void | presizeKeys ( Number count ) |
Boolean | removeKeyValue ( Number which ) |
void | setProperty ( DzNumericProperty prop ) |
void | ercSourcePropertyRemoved ( DzProperty prop ) |
void | keyChanged ( Number which ) |
void | keyInterpolationChanged () |
void | keysListChanged () |
void | propertyDeleted ( DzProperty prop ) |
void | saveWithOutputChanged () |
void | scalarChanged () |
void | stageChanged () |
void | typeChanged () |
This numeric controller implements an algorithm that is based on the value of another property. There are six formulas which correspond to the ERCType of the object - the default ERCType is ERCDeltaAdd. The formulas are:
Where:
As an example of ERC in action, lets say that there are 3 properties A, B, and C. B is linked to A with a 'ERCDeltaAdd' DzERCLink with a multiplier of 1.0 and an additive value of 0.0. C is linked to B with a 'ERCDeltaAdd' DzERCLink with a multiplier of 2.0 and an additive value of 1.0. So, if the keyed value of A is 10.0, B is 0.0, and C is 0.0, the final values of the properties would be calculated as:
A = 10.0 B = 0.0 + (10.0 * 1.0) + 0.0 = 10.0 C = 0.0 + (10.0 * 2.0) + 1.0 = 21.0
If B and C have keyed values - for example B is 5.0 and C is 2.0 - the final property values would be calculated as:
A = 10.0 B = 5.0 + (10.0 * 1.0) + 0.0 = 15.0 C = 2.0 + (15.0 * 2.0) + 1.0 = 33.0
The types of key interpolation that can be represented by a DzERCLink of the 'ERCKeyed' type.
—–
The types of ERC that can be represented by this class.
v
is the current value of the property this link resides on.c
is the current value of the control property that drives this linkm
is the scalar of this linka
is the addend of this linkv
is the current value of the property this link resides on.c
is the current value of the control property that drives this linka
is the addend of this linkv
is the current value of the property this link resides on.c
is the current value of the control property that drives this linka
is the addend of this linkv
is the current value of the property this link resides on.c
is the current value of the control property that drives this linka
is the addend of this linkv
is the current value of the property this link resides on.c
is the current value of the control property that drives this linka
is the addend of this linkv
is the current value of the property this link resides on.c
is the current value of the control property that drives this linka
is the addend of this linkv
is the current value of the property this link resides on.c
is the current value of the control property that drives this linkP
is a parametric curve defined by the KeyValues array.Holds whether or not the controller is evaluated and applied.
Holds the addend value for the link.
Holds whether or not the link will be automatically redirected when its owner is 'Fit To' another figure.
Holds whether or not the link is a user-link.
ERCKeyInterpolation : keyInterpolation
Holds the interpolation mode for links of the ERCKeyed type.
Holds whether the controller will be saved with the output property (the property that owns the link), or the input property (the linked property).
Holds the scalar (multiplier) value for links of the ERCDeltaAdd type.
Holds the type of operation the link will perform when evaluated and applied.
Default constructor.
DzERCLink( DzERCLink copyFrom, DzNumericProperty property=undefined )
TODO: Add description.
DzERCLink( ERCType type, DzNumericProperty property, Number scalar=1.0, Number addend=0.0 )
Creates a controller that is driven by property
.
Parameter(s):
DzERCLink( DzNumericProperty property, Number scalar=1.0, Number addend=0.0 )
Creates a controller that is driven by property
.
Parameter(s):
Number : addKeyValue( Number key, Number value )
Adds a keyed value to the link if the type is ERCKeyed and the interpolation mode is LINEAR_INTERP or CONSTANT_INTERP.
Parameter(s):
Return Value:
Number : addKeyValue( Number key, Number value, Number t, Number c, Number b )
Adds a keyed value to the link if the type is ERCKeyed and the interpolation mode is TCB_INTERP.
Parameter(s):
Return Value:
void : clearKeys()
Clears all keyed values for links of the ERCKeyed type.
DzERCLink : duplicate( DzNumericProperty newProperty=undefined )
Makes a deep copy of this link.
Parameter(s):
Return Value:
Number : findKeyIndex( Number key )
Parameter(s):
Return Value:
key
, otherwise -1.DzNumericProperty : getCurrentProperty()
Return Value:
Number : getKey( Number which )
Parameter(s):
Return Value:
which
is within the range of keyed values, the key at which
, otherwise 0.Number : getKeyOpValue( Number val )
Parameter(s):
Return Value:
tm
, otherwise 0.Number : getKeyParamB( Number which )
Parameter(s):
Return Value:
which
is within the range of keyed values, and the interpolation mode is TCB_INTERP, the bias value at which
, otherwise 0.Number : getKeyParamC( Number which )
Parameter(s):
Return Value:
which
is within the range of keyed values, and the interpolation mode is TCB_INTERP, the continuity value at which
, otherwise 0.Number : getKeyParamT( Number which )
Parameter(s):
Return Value:
which
is within the range of keyed values, and the interpolation mode is TCB_INTERP, the tension value at which
, otherwise 0.Number : getKeyValue( Number which )
Parameter(s):
Return Value:
which
is within the range of keyed values, the value at which
, otherwise 0.Return Value:
DzNumericProperty : getProperty()
Return Value:
void : presizeKeys( Number count )
Presizes the array of keyed values in order to improve the performance of adding keyed values.
Parameter(s):
Boolean : removeKeyValue( Number which )
Removes a keyed value from the link if the link type is ERCKeyed.
Parameter(s):
Return Value:
true
if which
is within the range of keyed values, otherwise false
.void : setProperty( DzNumericProperty prop )
Sets the property that drives this link.
Parameter(s):
void : ercSourcePropertyRemoved( DzProperty prop )
TODO: Add description.
void : keyChanged( Number which )
TODO: Add description.
void : keyInterpolationChanged()
TODO: Add description.
void : keysListChanged()
TODO: Add description.
void : propertyDeleted( DzProperty prop )
Signature:“propertyDeleted(DzProperty*)”
Emitted when the source property or current property is deleted.
Parameter(s):
void : saveWithOutputChanged()
TODO: Add description.
void : scalarChanged()
TODO: Add description.
void : stageChanged()
TODO: Add description.
void : typeChanged()
TODO: Add description.