User Tools

Site Tools


DzShape

A container class for a geometry and related materials, etc.

More...

Inherits :

Inherited By : DzFacetShape

Enumerations

Static Methods

DAZ Script
DzShapegetCurrentShapeForNode ( DzNode node )

Constructors

DAZ Script
DzShape ()

Methods

Signals

Detailed Description

A container class that references a DzGeometry and holds all the pertinent material definitions, etc for that geometry.

Enumerations


: GeometryType

Types of geometry available from the shape.

Since:

  • 4.11.0.163
  • BaseGeometry - The base geometry with default smoothing and UV set as loaded from file. Usually the same as getGeometry()
  • WorkingGeometry - A copy of the base geometry with the shape options applied (i.e., UV set, material smoothing, subdivision algorithm, etc).

Attention:

  • This geometry may be the same as BaseGeometry.
  • AssemblyGeometry - If this shape supports creating a geometry from multiple geometries (i.e., grafting) this is that geometry in base positions, otherwise it is the same as WorkingGeometry.

Static Methods


DzShape : getCurrentShapeForNode( DzNode node )

Parameter(s):

  • node - The node to get the current shape for.

Return Value:

  • The current shape for node (if any), otherwise null.

Since:

  • 4.9.3.62

Constructors


DzShape()

TODO: Add description.

Methods


DzError : addMaterial( DzMaterial mat )

Adds the given material to the available material list for this shape. Also sets the currently active material index.

Parameter(s):

  • newmat - The (shared) material to be added to the list of materials for this shape.

Return Value:

  • DZ_NO_ERROR on success, otherwise an appropriate error code.

void : clearMaterialSelection()

Sets the selection status to false for all materials of this shape.


DzError : createMaterial( String name )

Creates a material face group and a default material.

Parameter(s):

  • name - The name of the material face group (surface) to create.

Return Value:

  • DZ_NO_ERROR if a DzMaterialFaceGroup named name doesn't already exist on the shape (or can be created), and the shape has geometry, otherwise an appropriate error code.

DzMaterial : findMaterial( String materialName )

Finds a material on the shape by name.

Parameter(s):

  • materialName - The name of the material face group to find the material for.

Return Value:

  • The first material named materialName in the list of materials for the shape, otherwise null.

Number : findMaterialIndex( String materialName )

Parameter(s):

  • materialName - The name of the material face group to find.

Return Value:

  • The index of the first material named materialName in the list of materials for the shape, -1 if no material with that name is found.

Number : findMaterialIndex( DzMaterial mat )

Parameter(s):

  • mat - The (shared) material to find.

Return Value:

  • The index of the given material in the list, -1 if the material is not in the list for this shape.

Array : findMaterials( String materialName )

Attempts to find the materials named materialName.

Parameter(s):

  • materialName - The name of the material face group (surface) to find.

Return Value:

  • A list of the materials named materialName.

Array : getAllMaterials()

Return Value:

  • A list of all materials for this shape.

Array : getAllRenderPrioritizedMaterials()

Return Value:

  • A list of all materials on this shape, ordered by render priority from highest to lowest.

Array : getAllSelectedMaterials()

Return Value:

  • A list of all selected materials in this shape.

DzGeometry : getAssemblyGeometry()

Return Value:

  • The assembly geometry.

DzGeometry : getCurrentGeometry( GeometryType type=BaseGeometry )

Parameter(s):

  • type - The type of geometry to return.

Return Value:

  • Geometry of the specified type if it exists, otherwise the geometry from the next previous stage that does exist.

Since:

  • 4.11.0.163

DzGeometry : getGeometry()

Return Value:

  • The geometry this shape references.

DzMaterial : getMaterial( Number which )

Parameter(s):

  • which - The index of the material in the list to return.

Return Value:

  • If which is within range, the (shared) material at the index in the list for the shape, otherwise null.

DzVertexMesh : getModifiableAssemblyGeom( Boolean isRender )

Parameter(s):

  • isRender - If true, the geometry will be render-quality.

Return Value:

  • The version of the assembly geometry that can be modified.

DzNode : getNode()

Return Value:

  • The node associated with this shape (if any), otherwise null.

Since:

  • 4.9.3.62

Number : getNumMaterials()

Return Value:

  • The number of materials in the list for this shape.

DzMaterial : getSelectedMaterial( Number which )

Parameter(s):

  • which - The index of the material in the list of selected materials to return.

Return Value:

  • If which is within range, the (shared) material in the selected list for the shape.

Boolean : hasAssemblyGeometry()

Return Value:

  • true if this shape assembles multiple geometries together, otherwise false.

Boolean : hasDifferentRenderThanDraw()

Return Value:

  • true if the shape needs to build differently for render than for OpenGL draw, otherwise false.

DzError : insertMaterial( DzMaterial mat, Number index=-1 )

Inserts the given material at the given index in the material list, or appends to the list of index is < 0 or out of range. Also sets the currently active material index.

Parameter(s):

  • mat - The (shared) material to be added to the list of materials for this shape.
  • index - The index at which to insert the material. If -1, it will be appended to the end of the material list.

Return Value:

  • DZ_NO_ERROR on success, otherwise an appropriate error code.

DzError : removeMaterial( DzMaterial mat )

Removes the given material from this shape. Also removes any references to this materal that existed on any faces.

Parameter(s):

  • mat - The (shared) material to be removed from the list of materials for this shape.

Return Value:

  • DZ_NO_ERROR on success, otherwise an appropriate error code.

DzError : removeMaterialByName( String materialName, String defaultName=“” )

Parameter(s):

  • materialName - The name of the material face group to remove.
  • defaultName - The name of the material face group to assign the removed materials faces to. If empty a default is used.

Return Value:

  • DZ_NO_ERROR on success, otherwise an appropriate error code.

DzError : replaceMaterial( DzMaterial currentMat, DzMaterial newMat )

Attempts to find and replace the given material with the new material.

Parameter(s):

  • currentMat - The (shared) material to be replaced.
  • newMat - The (shared) material to be added.

Return Value:

  • DZ_NO_ERROR on success, otherwise an appropriate error code.

Signals


void : aboutToFinalize( DzVertexMesh mesh )

Signature:“aboutToFinalize(DzVertexMesh*)”

Emitted when the mesh for this shape is about to be finalized.

Parameter(s):

  • mesh - The mesh that is about to be finalized.

void : aboutToReplaceMaterial( DzMaterial currentMat, DzMaterial newMat )

Signature:“aboutToReplaceMaterial(DzMaterial*,DzMaterial*)”

Emitted when a material associated with this shape is about to replaced with another material.

Since:

  • 4.15.1.97

void : assemblyChanged()

Signature:“assemblyChanged()”

Emitted when the assembly has changed.


void : assemblyNeedsConfigurationCheck()

Signature:“assemblyNeedsConfigurationCheck()”

Emitted when assembly needs to be checked before build.

Since:

  • 4.9.2.23

void : geomChanged()

Signature:“geomChanged()”

Emitted when the geometry referenced by this shape changes or is swapped out.


void : materialAdded( DzMaterial mat )

Signature:“materialAdded(DzMaterial*)”

Emitted after a material has been added to the shape.

Parameter(s):

  • mat - The material that was added to the shape.

void : materialChanged()

Signature:“materialChanged()”

Emitted when a material associated with this shape changes.


void : materialListChanged()

Signature:“materialListChanged()”

Emitted after a material has been added to or removed from the shape.


void : materialRemoved( DzMaterial mat )

Signature:“materialRemoved(DzMaterial*)”

Emitted after a material has been removed from the shape.

Parameter(s):

  • mat - The material that was removed from the shape.

void : materialReplaced( DzMaterial oldMat, DzMaterial newMat )

Signature:“materialReplaced(DzMaterial*,DzMaterial*)”

Emitted when a material associated with this shape is replaced with another material.

Since:

  • 4.15.1.97

void : materialSelected( DzMaterial mat )

Signature:“materialSelected(DzMaterial*)”

Emitted after a material used by this shape is selected.

Parameter(s):

  • mat - The material that was selected.

void : materialSelectionChanged()

Signature:“materialSelectionChanged()”

Emitted after a material used by this shape is selected or deselected.


void : materialUnselected( DzMaterial mat )

Signature:“materialUnselected(DzMaterial*)”

Emitted after a material used by this shape is deselected.

Parameter(s):

  • mat - The material that was deselected.

void : smoothingChanged()

Signature:“smoothingChanged()”

Emitted when the smoothing settings for the shape have changed.


void : subdivisonChanged()

Signature:“subdivisonChanged()”

Emitted when subdivision for the shape has changed.


void : uvsChanged()

Signature:“uvsChanged()”

Emitted when the current UV set has changed.


void : vertexSelectionChanged()

Signature:“vertexSelectionChanged()”

Emitted when vertex selection for the shape has changed.