User Tools

Site Tools


DzMorphDeltas

A container for the discrete vertex displacement values of a morph.

More...

Inherits :

Static Methods

DAZ Script
DzMorphDeltascalculateDeltas ( DzVertexMesh srcGeom, DzVertexMesh tgtGeom, Number tolerance=0.001 )

Constructors

DAZ Script
DzMorphDeltas ()

Methods

DAZ Script
NumberaddDelta ( Number vertIdx, DzVec3 delta, Boolean checkForDuplicates=true )
NumberaddDelta ( Number vertIdx, Number deltaX, Number deltaY, Number deltaZ, Boolean checkForDuplicates=true )
DzMorphDeltascopyDeltas ()
voidcopyDeltasTo ( DzMorphDeltas deltas )
NumbergetDeltaIndex ( Number i )
DzVec3getDeltaVec ( Number i )
NumbergetNumDeltas ()
NumbergetTargetVertexCount ()
NumbergetVertexDeltaIndex ( Number vertIdx )
BooleanhasDeltas ()
BooleanloadDeltas ()
voidpreSize ( Number nDeltas )
voidremoveAllDeltas ()
voidremoveDelta ( Number deltaIdx )
voidremoveDuplicateDeltas ()
DzMorphDeltasremoveIgnoredDeltas ()
voidremoveVertex ( Number vertIdx )
DzErrorsetDelta ( Number index, DzVec3 delta )
voidsetTargetVertexCount ( Number vertCount )
voidunLoadDeltas ()
Deprecated
voidsetVertCount ( Number vertCount )
NumbergetVertCount ()

Signals

Detailed Description

A container for a discrete list of three dimensional position changes (deltas) to the vertices of a mesh, for a morph.

See Also:

Static Methods


DzMorphDeltas : calculateDeltas( DzVertexMesh srcGeom, DzVertexMesh tgtGeom, Number tolerance=0.001 )

Calculates a delta set from two meshes.

Parameter(s):

  • srcGeom - The 'base' geometry.
  • tgtGeom - The 'morph' geometry.
  • tolerance - The minimum difference between a vertex in srcGeom and the corresponding vertex in tgtGeom to be considered; lower limit is 1e-5.

Return Value:

  • The delta set for turning srcGeom into tgtGeom. If a delta set cannot be created, or is empty, this returns null.

Since:

  • 4.9.4.85

Constructors


DzMorphDeltas()

Default constructor.

Methods


Number : addDelta( Number vertIdx, DzVec3 delta, Boolean checkForDuplicates=true )

Add a morph delta.

Parameter(s):

  • vertIdx - The index of the vertex to set delta values for.
  • pos - The delta value for the vertex.
  • checkForDuplicates - If true, the list of deltas will be checked for any previous deltas assigned to the vertex before adding the delta. Otherwise, it is assumed no deltas have been added for the specified vertex.

Return Value:

  • The index of the delta

Number : addDelta( Number vertIdx, Number deltaX, Number deltaY, Number deltaZ, Boolean checkForDuplicates=true )

Add a morph delta.

Parameter(s):

  • vertIdx - The index of the vertex to set delta values for.
  • deltaX - The X-axis value for the delta
  • deltaY - The Y-axis value for the delta
  • deltaZ - The Z-axis value for the delta
  • checkForDuplicates - If true, the list of deltas will be checked for any previous deltas assigned to the vertex before adding the delta. Otherwise, it is assumed no deltas have been added for the specified vertex.

Return Value:

  • The index of the delta.

DzMorphDeltas : copyDeltas()

Return Value:

  • A deep copy of this morph deltas.

void : copyDeltasTo( DzMorphDeltas deltas )

Copies (deep) this morph deltas to a specified morph deltas.

Parameter(s):

  • newDeltas - The morph deltas to copy to.

Number : getDeltaIndex( Number i )

Parameter(s):

  • i - The index of the delta (not vertex) to get the vertex index for.

Return Value:

  • The index of the vertex in the mesh that is affected by the specified delta (if valid), otherwise -1.

DzVec3 : getDeltaVec( Number i )

Parameter(s):

  • i - The index of the delta (not vertex) to get the vector for.

Return Value:

  • A three dimensional vector describing the value of the specified delta (if valid), otherwise an uninitialized vector - i.e., (0, 0, 0).

Number : getNumDeltas()

Return Value:

  • The number of vertices that have delta values for the owning morph.

Number : getTargetVertexCount()

Return Value:

  • The vertex count of the geometry that these morph deltas apply to.

Since:

  • 4.9.3.137

Number : getVertexDeltaIndex( Number vertIdx )

Parameter(s):

  • vertIdx - The index of the vertex in the mesh to get the delta index for.

Return Value:

  • The delta index of the specified vertex (if valid), otherwise -1.

Boolean : hasDeltas()

Return Value:

  • true if there are any deltas that exist in this set, false if the deltas have not been loaded from file yet.

Boolean : loadDeltas()

Loads the list of delta values from file if it has not already been loaded.

Return Value:

  • true if the deltas were loaded successfully, otherwise false.

See Also:


void : preSize( Number nDeltas )

Pre-sizes the deltas list.

Parameter(s):

  • nDeltas - The size the deltas list is expected to grow to.

void : removeAllDeltas()

Clears the list of delta values.

See Also:


void : removeDelta( Number deltaIdx )

Remove the specified delta.

Parameter(s):

  • deltaIdx - The index of the delta (not vertex) to be removed.

void : removeDuplicateDeltas()

Removes any duplicate deltas that are in the array. Only the earliest instance in the delta array is kept.

Attention:

  • This method is very slow.

DzMorphDeltas : removeIgnoredDeltas()

Return Value:

  • A deep copy of this deltas with the delta values that have been flagged to be ignored removed.

void : removeVertex( Number vertIdx )

Removes delta values for a specified vertex.

Parameter(s):

  • vertIdx - The index of the vertex to remove delta values for.

DzError : setDelta( Number index, DzVec3 delta )

Sets the value for a delta in the delta list.

Parameter(s):

  • index - The index of the delta (not vertex) to set the data for.
  • pos - The new value for the delta.

void : setTargetVertexCount( Number vertCount )

Sets the vertex count in the target mesh that this set of delta values applies to.

Parameter(s):

  • vertCount - The total number of vertices in the target mesh.

Since:

  • 4.9.3.137

void : unLoadDeltas()

Unloads the list of delta values (if loaded).

See Also:


void : setVertCount( Number vertCount )

Deprecated

Exists only to keep old code working. Do not use in new code. Use setTargetVertexCount() instead.


Number : getVertCount()

Deprecated

Exists only to keep old code working. Do not use in new code. Use getTargetVertexCount() instead.

Signals


void : deltaListChanged()

Signature:“deltaListChanged()”

Emitted when deltas are added to or removed from the list


void : deltaListLoaded()

Signature:“deltaListLoaded()”

Emitted when deltas are successfully loaded from file

Since:

  • 4.10.0.116

void : deltaValueChanged()

Signature:“deltaValueChanged()”

Emitted when one or more delta values have been changed