User Tools

Site Tools


DzFacetMesh

Enumerations

Properties

Static Methods

Constructors

DAZ Script
DzFacetMesh ()

Methods

DAZ Script
NumberactivateFaceGroup ( String name )
voidactivateFaceGroup ( Number index )
NumberactivateMaterial ( String name )
voidactivateMaterial ( Number index )
voidaddFacet ( Array vertIndices, Array uvIndices, Number flags=0 )
voidaddFacet ( DzFacet facetIn, Number pTex=0x80000000, Number flags=0 )
voidaddPolyline ( Array vertIndices, Array uvIndices=[], Number flags=0 )
voidaddPolylineRootSegment ( Number vertIdx1, Number vertIdx2, Number flags=0 )
voidaddPolylineRootSegment ( Number vertIdx1, Number vertIdx2, Number uvIdx1, Number uvIdx2, Number flags=0 )
voidaddSegmentToLastPolyline ( Number vertexIndex )
voidaddSegmentToLastPolyline ( Number vertexIndex, Number uvIndex )
voidaddUVSet ( DzUVSet uvSet )
voidapplyFullSmoothing ()
voidapplySmoothing ( Number angle )
voidapplyUVSet ( DzUVSet uvSet )
voidclearWeightedEdges ()
voidclearWeightedVertices ()
BooleancreateFaceGroup ( String name )
NumbercreateMaterialGroup ( String name )
DzFaceGroupfindFaceGroup ( String name )
DzMaterialFaceGroupfindMaterialGroup ( String name )
NumberfindUVSetIndexByLabel ( String label )
NumbergetCurrentSubDivisionLevel ()
DzEdgegetEdge ( Number index )
DzFaceGroupgetFaceGroup ( Number index )
DzFacetgetFacet ( Number index )
DzMaterialFaceGroupgetMaterialGroup ( Number index )
DzVec3getNormal ( Number index )
NumbergetNumEdges ()
NumbergetNumFaceGroups ()
NumbergetNumFacets ()
NumbergetNumMaterialGroups ()
NumbergetNumNormals ()
NumbergetNumPolylines ()
NumbergetNumPolylineSegments ()
NumbergetNumQuads ()
NumbergetNumTris ()
NumbergetNumWeightedEdges ()
NumbergetNumWeightedVertices ()
NumbergetPolylineCageIndex ( Number polylineIdx )
NumbergetPolylineFaceGroupIndex ( Number polylineIdx )
NumbergetPolylineMaterialGroupIndex ( Number polylineIdx )
ArraygetPolylineUVIndices ( Number index )
ArraygetPolylineVertexIndices ( Number index )
SubDAlgorithmgetSubDAlgorithm ()
SubDEdgeInterpolationgetSubDEdgeInterpolation ()
SubDNormalSmoothingModegetSubDNormalSmoothingMode ()
NumbergetVertexWeight ( Number vertIdx )
ArraygetWeightedEdges ()
ArraygetWeightedVertices ()
voidinsertUVSet ( Number idx, DzUVSet uvSet )
DzErrorpreSizeFacets ( Number numFacets )
DzErrorpreSizePolylines ( Number numPolyLines, Number numTotalSegments )
voidpreSizeWeightedEdges ( Number numEdges )
voidpreSizeWeightedVertices ( Number numVerts )
voidremoveAllFacets ( Boolean removeMats, Boolean removeGroups )
voidremoveAllFacets ()
voidremoveAllPolylines ( Boolean removeMats=false, Boolean removeGroups=false )
voidremoveAllUVSets ()
DzErrorremoveFaceGroup ( String name, String defaultGrp=“” )
voidremoveFacet ( Number facetIdx )
voidremoveFacets ( DzFaceGroup grp, Boolean removeVerts=true )
DzErrorremoveMaterialGroup ( Number removeIdx, Number defaultGrpIdx, DzShape shape )
voidremovePolyline ( Number polylineIdx )
voidremoveUVSet ( Number index )
voidremoveUVSet ( DzUVSet uvSet )
voidsetEdgeWeight ( Number vertIdxA, Number vertIdxB, Number weight )
voidsetNumPolylines ( Number numPolyLines, Number numTotalSegments )
voidsetSubDAlgorithm ( SubDAlgorithm algo )
voidsetSubDEdgeInterpolation ( SubDEdgeInterpolation interp )
voidsetSubDNormalSmoothingMode ( SubDNormalSmoothingMode normalMode )
voidsetUVList ( DzMap map )
voidsetVertexWeight ( Number vertIdx, Number weight )

Signals

Detailed Description

This facet mesh handles polygons in a general manner. DAZ Studio converts all higher order polygons to triangles and quadrangles.

Enumerations


: SubDAlgorithm

The different subdivision algorithms.

  • Catmark - An algorithm (as implemented by OpenSubdiv) devised by Edwin Catmull and Jim Clark that produces only quadrilaterals, and applies smoothing to this mesh.
  • Bilinear - An algorithm (as implemented by OpenSubdiv) that divides each edge of a polygon without applying any smoothing/averaging.
  • Loop - An algorithm (as implemented by OpenSubdiv) devised by Charles Loop that supports meshes consisting of only triangles, where each triangle is divided into four smaller triangles.
  • DzCatmullClark - The implementation of the algorithm devised by Edwin Catmull and Jim Clark in use by the application prior to the integration of OpenSubdiv.

: SubDEdgeInterpolation

The different types of edge interpolation for subdivision.

  • SoftCornersEdges - Soft Corners on edges for subdivision.
  • SharpCornersEdges - Sharp Corners on edges for subdivision.
  • SharpEdges - Sharp Edges for subdivision.

: SubDNormalSmoothingMode

The different types of normal smoothing for subdivision.

Since:

  • 4.10.0.114
  • SmoothAllNormals - Interpolates all normals for subdivision; this is the only behavior prior to 4.10.0.96.
  • PreserveCageSmoothing - Attempts to preserve sharp edges present in the cage mesh; not compatible with 3Delight Catmark, legacy DzCatmullClark, or Bilinear.

Properties


DzAuthor : assetAuthor

Holds the author of the file for this mesh. (Read Only)

Since:

  • 4.8.1.21

DzVersion : assetFileRevision

Holds the revision version of the asset file for this mesh. (Read Only)

Since:

  • 4.8.1.21

String : assetId

Holds the asset id for this mesh.

Since:

  • 4.8.1.18

Array : assetIdAliases

Holds the asset id aliases for this mesh.


Date : assetModifiedDate

Holds the modified date of the asset file for this mesh. (Read Only)

Since:

  • 4.8.1.21

Boolean : assetNeedSave

Holds whether or not the asset for this mesh needs to be saved. (Read Only)

Since:

  • 4.11.0.249

DzUri : assetSource

Holds the URI of the asset source for this mesh; only valid when the asset is in an embedded state - i.e. modified. (Read Only)

Since:

  • 4.8.1.21

DzUri : assetUri

Holds the asset URI for this mesh. (Read Only)

Since:

  • 4.8.1.18

String : extendedAssetIds

Holds additional ids that this mesh extends.

Since:

  • 4.12.2.44

Array : nameAliases

Holds the name aliases for this mesh.

Static Methods


Number : getInfiniteSharpValueWeightValue()

Return Value:

  • The value of subdivision weight that indicates infinite sharpness.

Since:

  • 4.6.3.39

String : getOpenSubdivVersion()

Return Value:

  • A string representation of the version of OpenSubdiv in use.

Since:

  • 4.9.2.18

Constructors


DzFacetMesh()

Default Constructor.

Methods


Number : activateFaceGroup( String name )

Activates the given face group - all faces added after this call will be added to the group. If the named group is not found, a new empty group by that name is created and made active.

Parameter(s):

  • name - The name of the face group to activate.

Return Value:

  • The index of the group that was activated.

void : activateFaceGroup( Number index )

Activates the given face group - all faces added after this call will be added to the group.

Parameter(s):

  • index - The index of the face group to activate. If the index exceeds the number of groups current on this mesh, then groups are created until the number of groups is equal to the requested index.

Number : activateMaterial( String name )

Activates the given material group - all faces added after this call will be added to the material.

Parameter(s):

  • name - The name of the material group to activate. If a material group with the given name does not exist, one will be created.

Return Value:

  • The index of the material group that was activated.

void : activateMaterial( Number index )

Activates the given material group - all faces added after this call will be added to the material.

Parameter(s):

  • index - The index of the material group to activate.

void : addFacet( Array vertIndices, Array uvIndices, Number flags=0 )

Adds a facet to this mesh.

Parameter(s):

  • vertIndices - A list of indices into the vertex list for the new face.
  • uvIndices - A list of indices into the texture coordinate list for the new texture coordinates.
  • flags - The flags for the facet; use 0 for no flags.

Attention:

  • The method requires 4 integer values to be present in both the vertIndices and uvIndices lists. If the face is a triangle, make the last value -1.

void : addFacet( DzFacet facetIn, Number pTex=0x80000000, Number flags=0 )

Adds a facet to this mesh.

Parameter(s):

  • facetIn - The facet to add to this mesh.
  • pTex - The Ptex index for the facet; set to DZ_INT_MIN to just use next avaible value.
  • flags - The flags for the facet; use 0 for no flags.

void : addPolyline( Array vertIndices, Array uvIndices=[], Number flags=0 )

Adds a line to this mesh.

Parameter(s):

  • vertIndices - A list of indices into the vertex list for the new line.
  • uvIndices - A list of indices into the texture coordinate list for the new texture coordinates.
  • flags - The flags for the line; use 0 for no flags.

Since:

  • 4.11.0.36

void : addPolylineRootSegment( Number vertIdx1, Number vertIdx2, Number flags=0 )

Adds a polyline to this mesh with a single root segment.

Parameter(s):

  • vertIdx1 - The first vertex index.
  • vertIdx2 - The second vertex index.
  • flags - The flags for the line; use 0 for no flags.

See Also:

Since:

  • 4.11.0.174

void : addPolylineRootSegment( Number vertIdx1, Number vertIdx2, Number uvIdx1, Number uvIdx2, Number flags=0 )

Adds a polyline to this mesh with a single root segment.

Parameter(s):

  • vertIdx1 - The first vertex index.
  • vertIdx2 - The second vertex index.
  • uvIdx1 - The first uv index.
  • uvIdx2 - The second uv index.
  • flags - The flags for the line; use 0 for no flags.

See Also:

Since:

  • 4.11.0.174

void : addSegmentToLastPolyline( Number vertexIndex )

Adds a segment to the last polyline in the list.

Parameter(s):

  • vertexIndex - The index of the vertex to extend the polyline to.

Attention:

  • Behavior is undefined if there are no polylines in this mesh.

Since:

  • 4.11.0.36

void : addSegmentToLastPolyline( Number vertexIndex, Number uvIndex )

Adds a segment to the last polyline.

Parameter(s):

  • vertexIndex - The index of the vertex to extend the polyline to.
  • uvIndex - The index of the UV coordinate to extend the polyline to.

Attention:

  • Behavior is undefined if there are no polylines in this mesh.

Since:

  • 4.11.0.36

void : addUVSet( DzUVSet uvSet )

Adds a UV set to this mesh.

Parameter(s):

  • map - The UV set to add.

void : applyFullSmoothing()

Changes the normal index on all facets such that all verticies have smooth normals.


void : applySmoothing( Number angle )

Changes the normal index on all facets such that adjacent facets with less than the specified angle between them have smooth normals.

Parameter(s):

  • angle - The angle between adjacent facets to smooth if below.

void : applyUVSet( DzUVSet uvSet )

Applies a set of texture coordinates to this mesh.

Parameter(s):

  • uvset - The UV set to apply.

void : clearWeightedEdges()

Removes all subdivison weight for all edges of this mesh.

Since:

  • 4.11.0.151

void : clearWeightedVertices()

Removes subdivison weight for all vertices of this mesh.

Since:

  • 4.11.0.151

Boolean : createFaceGroup( String name )

Creates a face group with the given name - all faces added after this call will be added to the group.

Parameter(s):

  • name - The name of the face group to create. If a face group with the given name already exists, a new group will not be created.

Return Value:

  • true if the face group was created, otherwise false.

Number : createMaterialGroup( String name )

Creates a material group with the given name - all faces added after this call will be added to the material.

Parameter(s):

  • name - The name of the material group to create. If a material group with the given name already exists, a new group will not be created.

Return Value:

  • The index of the material group that was created (or found).

DzFaceGroup : findFaceGroup( String name )

Return Value:

  • The face group with the given name (if any), otherwise null.

DzMaterialFaceGroup : findMaterialGroup( String name )

Return Value:

  • The material group with the given name (if any), otherwise null.

Number : findUVSetIndexByLabel( String label )

Searches the geometry for a UV set with the given label.

Parameter(s):

  • label - The label of the UV set to find.

Return Value:

  • The index of the UV set with the matching label, or -1 if none was found.

Number : getCurrentSubDivisionLevel()

Return Value:

  • The current level of subdivision for this mesh.

DzEdge : getEdge( Number index )

Parameter(s):

  • index - The index of the edge to get.

Return Value:

  • The edge at the given index, or an invalid edge if index is out of range.

DzFaceGroup : getFaceGroup( Number index )

Return Value:

  • The face group at the given index (if valid), otherwise null.

DzFacet : getFacet( Number index )

Parameter(s):

  • index - The index of the facet to return.

Return Value:

  • The facet at the given index in this mesh.

DzMaterialFaceGroup : getMaterialGroup( Number index )

Parameter(s):

  • index - The index of the desired material group.

Return Value:

  • The material group at the given index (if any), otherwise null.

DzVec3 : getNormal( Number index )

Parameter(s):

  • index - The index of the normal to return.

Return Value:

  • The normal at the given index in this mesh.

Number : getNumEdges()

Return Value:

  • The number of edges in this mesh.

Number : getNumFaceGroups()

Return Value:

  • The number of face groups in this mesh.

Number : getNumFacets()

Return Value:

  • The number of facets in this mesh.

Number : getNumMaterialGroups()

Return Value:

  • The number of material groups in this mesh.

Number : getNumNormals()

Return Value:

  • The number of normals in this mesh.

Number : getNumPolylines()

Return Value:

  • The number of polylines in this mesh.

Since:

  • 4.11.0.36

Number : getNumPolylineSegments()

Return Value:

  • The number of polyline segments in this mesh.

Since:

  • 4.11.0.36

Number : getNumQuads()

Return Value:

  • The number of quadrilaterals (4-sided facets) in this mesh.

Attention:

  • This function is provided for convenience. The return value is not stored; in the case of a mesh that enables subdivision and the level is greater than 0, this value is implied by the algorithm used; in the case of a mesh that does not enable subdivision (or does but only at level 0 - which does not change the facet count), this value is counted.

See Also:

Since:

  • 4.11.0.260

Number : getNumTris()

Return Value:

  • The number of triangles (3-sided facets) in this mesh.

Attention:

  • This function is provided for convenience. The return value is not stored; in the case of a mesh that enables subdivision and the level is greater than 0, this value is implied by the algorithm used; in the case of a mesh that does not enable subdivision (or does but only at level 0 - which does not change the facet count), this value is counted.

See Also:

Since:

  • 4.11.0.260

Number : getNumWeightedEdges()

Return Value:

  • The number of subdivision weighted edges on this mesh (if subdivision is enabled), otherwise 0.

Since:

  • 4.5.2.19

Number : getNumWeightedVertices()

Return Value:

  • The number of subdivision weighted vertices on this mesh (if subdivision is enabled), otherwise 0.

Since:

  • 4.5.2.19

Number : getPolylineCageIndex( Number polylineIdx )

Parameter(s):

  • polylineIdx - The index of the polyline.

Return Value:

  • The cage index for the specified polyline (if valid), otherwise -1.

Since:

  • 4.11.0.36

Number : getPolylineFaceGroupIndex( Number polylineIdx )

Parameter(s):

  • polylineIdx - The index of the polyline.

Return Value:

  • The face group index for the specified polyline (if valid), otherwise -1.

Since:

  • 4.11.0.36

Number : getPolylineMaterialGroupIndex( Number polylineIdx )

Parameter(s):

  • polylineIdx - The index of the polyline.

Return Value:

  • The material group index for the specified polyline (if valid), otherwise -1.

Since:

  • 4.11.0.36

Array : getPolylineUVIndices( Number index )

Parameter(s):

  • index - The index of the polyline.

Return Value:

  • The polyline texture coordinate indices (if valid), otherwise an empty list.

Since:

  • 4.11.0.36

Array : getPolylineVertexIndices( Number index )

Parameter(s):

  • index - The index of the polyline.

Return Value:

  • The polyline vertex indices (if valid), otherwise an empty list.

Since:

  • 4.11.0.36

SubDAlgorithm : getSubDAlgorithm()

Return Value:

  • The SubDAlgorithm type for rendering Subdivision meshes.

SubDEdgeInterpolation : getSubDEdgeInterpolation()

Return Value:

  • The edge interpolation type for rendering Subdivision meshes.

SubDNormalSmoothingMode : getSubDNormalSmoothingMode()

Return Value:

  • The SubDNormalSmoothingMode type for rendering Subdivision meshes.

Since:

  • 4.10.0.101

Number : getVertexWeight( Number vertIdx )

Parameter(s):

  • vertIdx - The index of the vertex.

Return Value:

  • The subdivision weight for the specified vertex (if subdivision is enabled), otherwise -1.

Since:

  • 4.5.2.19

Array : getWeightedEdges()

Return Value:

  • A list of the subdivision weighted edges on this mesh (if subdivision is enabled), otherwise an empty list.

Since:

  • 4.5.2.19

Array : getWeightedVertices()

Return Value:

  • A list of the subdivision weighted vertices on this mesh (if subdivision is enabled), otherwise an empty list.

Since:

  • 4.5.2.19

void : insertUVSet( Number idx, DzUVSet uvSet )

Inserts a UV set for this mesh in the specified position.

Parameter(s):

  • idx - The index to insert the UV set at.
  • map - The UV set to insert.

DzError : preSizeFacets( Number numFacets )

Sets the number of facets on this mesh.

Parameter(s):

  • numFacets - The number of facets to pre-size to.

Return Value:

  • DZ_NO_ERROR if successful, otherwise an appropriate error code.

DzError : preSizePolylines( Number numPolyLines, Number numTotalSegments )

Pre-sizes the polylines set.

Parameter(s):

  • numPolylines - The number of polylines.
  • numTotalSegments - The total number of segments across all of the polylines.

Return Value:

  • DZ_NO_ERROR if successful, otherwise an appropriate error code.

Since:

  • 4.11.0.36

void : preSizeWeightedEdges( Number numEdges )

Sets the number of subdivision weighted edges on this mesh (if subdivision is enabled).

Parameter(s):

  • numEdges - The number of weighted edges to pre-size to.

Since:

  • 4.5.2.19

void : preSizeWeightedVertices( Number numVerts )

Sets the number of subdivision weighted vertices on this mesh (if subdivision is enabled).

Parameter(s):

  • numVerts - The number of weighted vertices to pre-size to.

Since:

  • 4.5.2.19

void : removeAllFacets( Boolean removeMats, Boolean removeGroups )

Removes all facets from this mesh.

Parameter(s):

  • removeMats - If true, removes all of the current material groups.
  • removeGroups - If true, removes all of the current face groups.

void : removeAllFacets()

Removes all facets from this mesh without removing any face groups or material groups.


void : removeAllPolylines( Boolean removeMats=false, Boolean removeGroups=false )

Removes all polylines.

Parameter(s):

  • removeMats - If true, removes material face groups that become empty as a result of removing the polylines.
  • removeGroups - If true, removes face groups that become empty as a result of removing the polylines.

Since:

  • 4.11.0.36

void : removeAllUVSets()

Removes all UV sets from this mesh.


DzError : removeFaceGroup( String name, String defaultGrp=“” )

Removes the face group from this mesh.

Parameter(s):

  • name - The name of the face group to remove.
  • defaultGrp - The name of the default group that facets in name will be assigned to.

Return Value:

  • DZ_NO_ERROR on success, otherwise an appropriate error code.

Since:

  • 4.11.0.200

void : removeFacet( Number facetIdx )

Removes the facet at the given index from this mesh.

Parameter(s):

  • facetIdx - The index of the facet to remove.

void : removeFacets( DzFaceGroup grp, Boolean removeVerts=true )

Removes the facets in the given group from this mesh. This will traverse all the face and material groups and remove the facets referred to.

Parameter(s):

  • grp - The group of facets to remove.
  • removeVerts - Not used; has no affect; remains for SDK compatibility only.

DzError : removeMaterialGroup( Number removeIdx, Number defaultGrpIdx, DzShape shape )

Removes the given material group index from all of the facets. Assigns any facets that are removed to the default group. If the default group does not exist one is created on the shape that is passed in.

Parameter(s):

  • removeIdx - The index of the material group to be removed.
  • defaultGrpIdx - The index of the material group for facets to be reassigned to. If -1, a new “<default>” group will be created.
  • shape - The shape to remove the material from.

void : removePolyline( Number polylineIdx )

Removes the polyline at the given index.

Parameter(s):

  • polylineIdx - The index of the polyline to remove.

Since:

  • 4.11.0.36

void : removeUVSet( Number index )

Removes the UV set at the specified index from this mesh.

Parameter(s):

  • index - The index of the UV set to remove.

void : removeUVSet( DzUVSet uvSet )

Removes a UV set from this mesh.

Parameter(s):

  • map - The new UV set to remove.

void : setEdgeWeight( Number vertIdxA, Number vertIdxB, Number weight )

Sets the subdivision weight of the specified edge (if subdivision is enabled).

Parameter(s):

  • vertIdxA - The first vertex index of the edge.
  • vertIdxB - The second vertex index of the edge.
  • weight - The subdivision weight.

Since:

  • 4.5.2.19

void : setNumPolylines( Number numPolyLines, Number numTotalSegments )

Sets the number polylines.

Parameter(s):

  • numPolyLines - The number of polylines.
  • numTotalSegments - The total number of segments across all of the polylines.

Since:

  • 4.11.0.36

void : setSubDAlgorithm( SubDAlgorithm algo )

Sets the algorithm for subdivision meshes.

Parameter(s):

  • algo - The subdivision algorithm to set.

void : setSubDEdgeInterpolation( SubDEdgeInterpolation interp )

Sets the edge interpolation type for rendering Subdivision meshes.

Parameter(s):

  • interp - The SubDEdgeInterpolation type to set.

void : setSubDNormalSmoothingMode( SubDNormalSmoothingMode normalMode )

Sets the normal smmothing mode for subdivision meshes.

Parameter(s):

  • normalMode - The subdivision normal calculation mode to set.

Since:

  • 4.10.0.101

void : setUVList( DzMap map )

Sets the texture coordinates for this mesh.

Parameter(s):

  • map - The new UV set for this mesh.

void : setVertexWeight( Number vertIdx, Number weight )

Sets the subdivision weight for the specified vertex (if subdivision is enabled).

Parameter(s):

  • vertIdx - The index of the vertex.
  • weight - The subdivision weight.

Since:

  • 4.5.2.19

Signals


void : assetModified()

Signature:“assetModified()”

Emitted when the asset for this mesh has been modified.


void : assetWasSaved()

Signature:“assetWasSaved()”

Emitted when the asset for this mesh has been saved.


void : edgeSelectionChanged()

Signature:“edgeSelectionChanged()”

Emitted when the edge selection for this mesh has changed.


void : facetSelectionChanged()

Signature:“facetSelectionChanged()”

Emitted when the facet selection for this mesh has changed.


void : polylineSelectionChanged()

Signature:“polylineSelectionChanged()”

Emitted when the polyline selection for this mesh has changed.


void : subDivisionEnabled( Boolean onOff )

Signature:“subDivisionEnabled(bool)”

Emitted when the state of subdivision for this mesh changes.

Parameter(s):

  • onOff - The state that subdivision has been changed to.

void : uvListChanged()

Signature:“uvListChanged()”

Emitted when the list of UV sets for this mesh has changed.