DzMaterial Class Reference
[Object and Geometry Objects]

Base class for all material/surface types. More...

Inheritance diagram for DzMaterial:

DzElement DzRefCountedItem DzBase QObject Object DzDefaultMaterial DzShaderMaterial List of all members.

Properties

DzRenderMgr::RenderPriority renderPriority

Methods

Boolean allowsAutoBake ()
void drawHighlighted (Color color)
void enablePropagateRenderPriorityToNodes (Boolean propagateOnOff)
Array getAllMaps ()
DzTexture getBakedMap ()
Number getBaseOpacity ()
DzTexture getColorMap ()
Color getDiffuseColor ()
Number getIndex ()
String getMaterialName ()
Number getNumGLMaps ()
Number getNumUVMaps ()
DzTexture getOpacityMap ()
DzBoolProperty getPropagatePriorityControl ()
DzEnumProperty getRenderPriorityControl ()
Array getShapeList ()
DzFloatProperty getSmoothAngleControl ()
DzBoolProperty getSmoothControl ()
Number getSmoothingAngle ()
DzEnumProperty getUVSetControl ()
Boolean isColorMappable ()
Boolean isHighlighted ()
Boolean isOpacityMappable ()
Boolean isOpaque ()
Boolean isPropagateRenderPriorityToNodesEnabled ()
Boolean isSelected ()
Boolean isSmoothingOn ()
void select (Boolean onOff)
void setBakedMap (DzTexture img)
void setBaseOpacity (Number val)
void setColorMap (DzTexture img)
void setDiffuseColor (Color color)
void setOpacityMap (DzTexture img)
void setSmoothingAngle (Number angle)
void setSmoothingOn (Boolean onOff)
void stopDrawHighlight ()

Methods (Static)

DzMaterial getMaterial (Number which)
Number getNumMaterials ()

Signals

void bakedMapChanged ()
 Signature: "bakedMapChanged()"
void selectionStateChanged (DzMaterial mat, Boolean onOff)
 Signature: "selectionStateChanged(DzMaterial*,bool)"
void settingsChanged (DzMaterial mat)
 Signature: "settingsChanged(DzMaterial*)"
void settingsChanged ()
 Signature: "settingsChanged()"
void smoothingChanged ()
 Signature: "smoothingChanged()"
void uvsChanged ()
 Signature: "uvsChanged()"

Detailed Description

Base class for all material/surface types.


Member Function Documentation

Boolean DzMaterial::allowsAutoBake (  ) 

Returns:
true if the material should be baked during auto-baking.

void DzMaterial::bakedMapChanged (  )  [signal]

Signature: "bakedMapChanged()"

Transmitted when the baked map of this material changes.

void DzMaterial::drawHighlighted ( Color  color  ) 

Causes this material to be drawn with a highlight in the given color. This is used by material selection tools, etc, to give visual feedback to the user about a material in the viewport.

Parameters:
col The highlight color.

void DzMaterial::enablePropagateRenderPriorityToNodes ( Boolean  propagateOnOff  ) 

Sets whether or not this material should propagate its render priority up to all the nodes that use it. Setting this to true will also ensure that the render priority is set for nodes that the material is assigned to at a later time.

The default behaviour is to not propagate.

Parameters:
propagateOnOff Whether or not the new priority value should be applied to all nodes that use this material (this will include the top-level skeleton node when dealing with figures).

Array DzMaterial::getAllMaps (  ) 

Collects all the images that are being used by this material at the current time and inserts them into the given list if they are not already there.

DzTexture DzMaterial::getBakedMap (  ) 

Returns:
A pointer to the 'baked' map for the material. NULL if the material is not using a baked map.

Number DzMaterial::getBaseOpacity (  ) 

Returns:
The opactiy value for this material.

DzTexture DzMaterial::getColorMap (  ) 

Returns:
The color ('texture') map for this material.

Color DzMaterial::getDiffuseColor (  ) 

Returns:
The Diffuse color for this material.

Number DzMaterial::getIndex (  ) 

Returns:
The material index of this material.

DzMaterial DzMaterial::getMaterial ( Number  which  ) 

Returns:
The material with the given index

String DzMaterial::getMaterialName (  ) 

Overridden to return the name for this material.

Returns:
The name for the type of shader. (Not the name for the material instance)

Number DzMaterial::getNumGLMaps (  ) 

Returns:
The number of OpenGL texture maps necessary for rendering this material in OpenGL (e.g. one for a diffuse color map, one for an opacity map, etc.).

int DzMaterial::getNumMaterials (  ) 

Returns:
The number of materials that have been created

Number DzMaterial::getNumUVMaps (  ) 

Deprecated:
This is deprecated because its name is somewhat of a misnomer. Use getNumGLMaps instead.
Returns:
The number of OpenGL texture maps necessary for rendering this material in OpenGL (e.g. one for a diffuse color map, one for an opacity map, etc.).

DzTexture DzMaterial::getOpacityMap (  ) 

Returns:
The opacity map for this material.

DzBoolProperty DzMaterial::getPropagatePriorityControl (  ) 

Returns:
A pointer to the property that controls the render priority propagation for this material.

DzEnumProperty DzMaterial::getRenderPriorityControl (  ) 

Returns:
A pointer to the property that controls the render priority for this material.

Array DzMaterial::getShapeList (  ) 

This function is mainly provided for DAZ Script access. It is recommended that plugin developers use the much more efficient shapeListIterator() method instead.

Returns:
A list of the shapes this material is on.

DzFloatProperty DzMaterial::getSmoothAngleControl (  ) 

Returns:
A pointer to the property that controls the smoothing angle for this material.

DzBoolProperty DzMaterial::getSmoothControl (  ) 

Returns:
A pointer to the property that controls whether smoothing is enabled for this material.

Number DzMaterial::getSmoothingAngle (  ) 

Returns:
The current smoothing angle for the material.

DzEnumProperty DzMaterial::getUVSetControl (  ) 

Returns:
A pointer to the property that controls the active UV set for this material.

Boolean DzMaterial::isColorMappable (  ) 

Returns:
true if the material supports mapping of the Diffuse channel.

Boolean DzMaterial::isHighlighted (  ) 

Returns:
true if the material is currently drawn with a highlight.

Boolean DzMaterial::isOpacityMappable (  ) 

Returns:
true if the material supports mapping of the Opacity channel.

Boolean DzMaterial::isOpaque (  ) 

Overriden by derived classes to indicate if they are opaque shader types (i.e. can be drawn first in OpenGL). If not opaque, then objects that use this material will need to be sorted back to front.

Boolean DzMaterial::isPropagateRenderPriorityToNodesEnabled (  ) 

Returns:
Whether or not this material should propagate its render priority up to all the nodes that use it.

Boolean DzMaterial::isSelected (  ) 

Retrieve selection state

Returns:
true if the material is selected, false if the material is not selected.

Boolean DzMaterial::isSmoothingOn (  ) 

Returns:
true if smoothing is enabled for the material, otherwise false.

void DzMaterial::select ( Boolean  onOff  ) 

Set the selection state for this material.

Parameters:
onOff If true, the material will be selected, if false, the material will be deselected.

DzMaterial::selectionStateChanged ( DzMaterial  mat,
Boolean  onOff 
) [signal]

Signature: "selectionStateChanged(DzMaterial*,bool)"

Transmitted when the selection state of this material changes.

void DzMaterial::setBakedMap ( DzTexture  map  ) 

Set the 'baked' shader map for this material. This overrides any current material settings and just draws the map. This is useful for representing the results of off-line shaders that can not be represented in OpenGL - the results of the shader are 'baked' onto a texture map, and then applied to the material with this function.

Parameters:
img The image that will be applied to the material instead of the current material settings. If NULL, the current baked map is cleared and the material is returned to using its current settings.

void DzMaterial::setBaseOpacity ( Number  val  ) 

Set the opacity value for this material.

void DzMaterial::setColorMap ( DzTexture  img  ) 

Set the color ('texture') map for this material.

void DzMaterial::setDiffuseColor ( Color  color  ) 

Set the diffuse color for this material.

void DzMaterial::setOpacityMap ( DzTexture  img  ) 

Set the opactiy map for this material.

void DzMaterial::setSmoothingAngle ( Number  angle  ) 

Sets the smoothing angle for the material. This only has effect on the material if smoothing is enabled.

Parameters:
angle The smoothing angle for the material. Any edges on the mesh where angle of the normals of the adjacent facets is less than this value will be smoothed. Higher values mean more smoothing, lower values mean less smoothing.

void DzMaterial::setSmoothingOn ( Boolean  onOff  ) 

Sets whether or not smoothing is enabled for the material.

Parameters:
onOff If true, smoothing is applied according to the smoothing angle. If false, no smoothing is applied to the material.

DzMaterial::settingsChanged ( DzMaterial  mat  )  [signal]

Signature: "settingsChanged(DzMaterial*)"

Transmitted when one of the values of this material changes.

void DzMaterial::settingsChanged (  )  [signal]

Signature: "settingsChanged()"

Transmitted when one of the values of this material changes.

void DzMaterial::smoothingChanged (  )  [signal]

Signature: "smoothingChanged()"

Transmitted when the smoothing settings of this material change.

void DzMaterial::stopDrawHighlight (  ) 

Causes this material to stop being drawn with a highlight.

void DzMaterial::uvsChanged (  )  [signal]

Signature: "uvsChanged()"

Transmitted when the uv settings of this material change.


Member Data Documentation

DzRenderMgr::RenderPriority DzMaterial::renderPriority

The render priority for the material. Render priority controls the order in which materials are handled during a render. The higher the priority, the earlier the material will be handled. If several materials have the same render priority, those materials will be handled in an arbitrary order.

The render priority on all nodes that use this material (this will include the top-level skeleton node when dealing with figures) can automatically be set to match the material's new priority by calling enablePropagateRenderPriorityToNodes() with true before calling this method.

The default render priority is RENDER_PRIORITY_NORMAL.


Generated on Thu Sep 24 12:21:13 2009

Copyright © 2002 - 2009 DAZ 3D, Inc.