User Tools

Site Tools


DzMaterial

Base class for all material types.

More...

Inherits :

Inherited By : DzBrickMaterial, DzDefaultMaterial, DzShaderMaterial and uberiraymaterial_dz

Properties

Static Methods

DAZ Script
DzMaterialgetMaterial ( Number which )
NumbergetNumMaterials ()

Methods

DAZ Script
DzMaterialduplicateOrDefaultMaterial ( DzElementDuplicateContext context )
voidenablePropagateRenderPriorityToNodes ( Boolean propagate )
DzUVSetgetActiveUVSet ( DzShape shape )
DzUVSetgetActiveUVSet ( DzGeometry geom )
ArraygetAllMaps ()
DzTexturegetBakedMap ()
NumbergetBaseOpacity ()
DzBox3getBoundingBox ()
DzTexturegetColorMap ()
ColorgetDiffuseColor ()
NumbergetIndex ()
floatgetLineEndWidth ()
DzFloatPropertygetLineEndWidthControl ()
ColorgetLinePreviewColor ()
DzColorPropertygetLinePreviewColorControl ()
floatgetLineStartWidth ()
DzFloatPropertygetLineStartWidthControl ()
floatgetLineUVWidth ()
DzFloatPropertygetLineUVWidthControl ()
StringgetMaterialName ()
NumbergetNumGLMaps ()
DzTexturegetOpacityMap ()
DzBoolPropertygetPropagatePriorityControl ()
DzEnumPropertygetRenderPriorityControl ()
ArraygetShaderLanguages ()
ArraygetShapeList ()
DzFloatPropertygetSmoothAngleControl ()
DzBoolPropertygetSmoothControl ()
NumbergetSmoothingAngle ()
ArraygetTags ()
DzStringPropertygetTagsControl ()
DzEnumPropertygetUVSetControl ()
BooleanisColorMappable ()
BooleanisHighlighted ()
BooleanisOpacityMappable ()
BooleanisOpaque ()
BooleanisPropagateRenderPriorityToNodesEnabled ()
BooleanisSelected ()
BooleanisSmoothingOn ()
BooleanmodifyAsset ()
BooleanmodifyAsset ( DzUri newUri )
BooleanneedsPtex ()
BooleanneedsTangentSpaceParams ()
voidselect ( Boolean onOff )
voidsetBakedMap ( DzTexture img )
voidsetBaseOpacity ( Number val )
voidsetColorMap ( DzTexture img )
voidsetDiffuseColor ( Color color )
voidsetLineEndWidth ( Number width )
voidsetLinePreviewColor ( Color color )
voidsetLineStartWidth ( Number width )
voidsetLineUVWidth ( Number width )
voidsetOpacityMap ( DzTexture img )
voidsetSmoothingAngle ( Number angle )
voidsetSmoothingOn ( Boolean onOff )
BooleanshadersMatch ( DzMaterial otherMat )
BooleanshouldAlwaysEmbed ()
voidstartDrawHighlight ()
voidstopDrawHighlight ()
Deprecated
NumbergetNumUVMaps ()

Signals

voidassetModified ()
voidassetWasSaved ()
voidbakedMapChanged ()
voidlineUVWidthChanged ()
voidlineWidthChanged ()
voidselectionStateChanged ( DzMaterial mat, Boolean onOff )
voidsettingsChanged ()
voidsmoothingChanged ()
voidtagsChanged ()
voiduvsChanged ()

Detailed Description

A “material” represents a collection of properties and settings that, when applied through the use of a “shader” (a small program/subroutine that describes how the settings are used), describe how the geometry associated with a 3D object interacts with light and ultimately what the surface of that 3D object looks like when rendered.

See Also:

Properties


DzAuthor : assetAuthor

Hold the author of the file for this material. (Read Only)

Since:

  • 4.8.1.21

DzVersion : assetFileRevision

Hold the revision version of the asset file for this material. (Read Only)

Since:

  • 4.8.1.21

String : assetId

Hold the asset id for this material.

Since:

  • 4.8.1.18

Date : assetModifiedDate

Hold the modified date of the asset file for this material. (Read Only)

Since:

  • 4.8.1.21

Boolean : assetNeedSave

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

Since:

  • 4.11.0.249

DzUri : assetSource

Hold the URI of the asset source for this material; 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 material. (Read Only)

Since:

  • 4.8.1.18

DzRenderMgr::RenderPriority : 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 DzRenderMgr::RENDER_PRIORITY_NORMAL.

Static Methods


DzMaterial : getMaterial( Number which )

Return Value:

  • The material with the given index.

Number : getNumMaterials()

Return Value:

  • The number of materials that have been created

Methods


DzMaterial : duplicateOrDefaultMaterial( DzElementDuplicateContext context )

Parameter(s):

  • context - The context of the material to duplicate.

Return Value:

  • The duplicate material if a material could be duplicated, otherwise a DzDefaultMaterial.

Since:

  • 4.6.2.104

void : enablePropagateRenderPriorityToNodes( Boolean propagate )

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.

Parameter(s):

  • 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).

DzUVSet : getActiveUVSet( DzShape shape )

Return Value:

  • The UV set that is used by this material for the given shape. May be NULL if the shape does not have any UV Sets.

Since:

  • 4.9.3.69

DzUVSet : getActiveUVSet( DzGeometry geom )

Return Value:

  • The UV set that is used by this material for the given geometry. May be NULL if the geometry does not have any UV Sets.

Since:

  • 4.9.3.69

Array : 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.

Return Value:

  • A list of DzTextures currently used by this material.

DzTexture : getBakedMap()

Return Value:

  • The 'baked' map for the material. NULL if the material is not using a baked map.

Number : getBaseOpacity()

Return Value:

  • The opacity value for this material.

DzBox3 : getBoundingBox()

Return Value:

  • The bounding box for this material.

DzTexture : getColorMap()

Return Value:

  • The color ('texture') map for this material.

Color : getDiffuseColor()

Return Value:

  • The diffuse color for this material.

Number : getIndex()

Return Value:

  • The material index of this material.

float : getLineEndWidth()

Return Value:

  • The current line end width.

Since:

  • 4.11.0.76

DzFloatProperty : getLineEndWidthControl()

Return Value:

  • The property that controls the desired end width of a line.

Since:

  • 4.11.0.76

Color : getLinePreviewColor()

Return Value:

  • The current line preview color.

Since:

  • 4.11.0.76

DzColorProperty : getLinePreviewColorControl()

Return Value:

  • The property that controls the color or lines for preview.

Since:

  • 4.11.0.76

float : getLineStartWidth()

Return Value:

  • The current line start width.

Since:

  • 4.11.0.76

DzFloatProperty : getLineStartWidthControl()

Return Value:

  • The property that controls the desired start width of a line.

Since:

  • 4.11.0.76

float : getLineUVWidth()

Return Value:

  • The current line UV width.

Since:

  • 4.11.0.109

DzFloatProperty : getLineUVWidthControl()

Return Value:

  • The property that controls the desired UV width of a line.

Since:

  • 4.11.0.109

String : getMaterialName()

Return Value:

  • The name for the type of shader (not the name for the material instance).

Number : getNumGLMaps()

Return Value:

  • 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 : getOpacityMap()

Return Value:

  • The opacity map for this material.

DzBoolProperty : getPropagatePriorityControl()

Return Value:

  • The property that controls the render priority propagation for this material.

DzEnumProperty : getRenderPriorityControl()

Return Value:

  • The property that controls the render priority for this material.

Array : getShaderLanguages()

Return Value:

  • A list of the shader languages employed by this material.

Since:

  • 4.20.0.6

Array : getShapeList()

Return Value:

  • A list of the shapes this material is on.

DzFloatProperty : getSmoothAngleControl()

Return Value:

  • The property that controls the smoothing angle for this material.

DzBoolProperty : getSmoothControl()

Return Value:

  • The property that controls whether smoothing is enabled for this material.

Number : getSmoothingAngle()

Return Value:

  • The current smoothing angle for the material.

Array : getTags()

Return Value:

  • A list of (trimmed) tags on this material.

Since:

  • 4.7.1.29

DzStringProperty : getTagsControl()

Return Value:

  • The property that holds the tags for this material.

Since:

  • 4.7.1.29

DzEnumProperty : getUVSetControl()

Return Value:

  • The property that controls the active UV set for this material.

Boolean : isColorMappable()

Return Value:

  • true if the material supports mapping of the Diffuse channel, otherwise false.

Boolean : isHighlighted()

Return Value:

  • true if the material is currently drawn with a highlight, otherwise false.

Boolean : isOpacityMappable()

Return Value:

  • true if the material supports mapping of the Opacity channel, otherwise false.

Boolean : isOpaque()

Return Value:

  • true if this material is opaque, otherwise false.

Boolean : isPropagateRenderPriorityToNodesEnabled()

Return Value:

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

Boolean : isSelected()

Return Value:

  • true if the material is selected, otherwise false.

Boolean : isSmoothingOn()

Return Value:

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

Boolean : modifyAsset()

Marks the asset as being modified. Makes the current author the author of the file.

Return Value:

  • true if the asset was successfully marked as modified, otherwise false.

Boolean : modifyAsset( DzUri newUri )

Marks the asset as being modified. Makes the current author the author of the file. Sets the file URI for the asset to the given URI.

Parameter(s):

  • newUri - The new file URI to set for the asset.

Return Value:

  • true if the asset was successfully marked as modified, otherwise false.

Boolean : needsPtex()

TODO: Add description.


Boolean : needsTangentSpaceParams()

Return Value:

  • true if the rendering geometry needs the additional dPds and dPdsM parameters for shaders, otherwise false.

void : select( Boolean onOff )

Set the selection state for this material.

Parameter(s):

  • onOff - If true, the material will be selected. If false, the material will be deselected.

void : setBakedMap( DzTexture img )

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.

Parameter(s):

  • 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 : setBaseOpacity( Number val )

Set the opacity value for this material.


void : setColorMap( DzTexture img )

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


void : setDiffuseColor( Color color )

Set the diffuse color for this material.


void : setLineEndWidth( Number width )

Parameter(s):

  • width - The desired width for the line end.

Since:

  • 4.11.0.76

void : setLinePreviewColor( Color color )

Sets whether or not smoothing is enabled for the material.

Parameter(s):

  • color - The color to use for preview lines.

Since:

  • 4.11.0.76

void : setLineStartWidth( Number width )

Parameter(s):

  • width - The desired width for the line start.

Since:

  • 4.11.0.76

void : setLineUVWidth( Number width )

Parameter(s):

  • width - The desired width for the line UV.

Since:

  • 4.11.0.109

void : setOpacityMap( DzTexture img )

Set the opacity map for this material.


void : setSmoothingAngle( Number angle )

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

Parameter(s):

  • 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 : setSmoothingOn( Boolean onOff )

Sets whether or not smoothing is enabled for the material.

Parameter(s):

  • onOff - If true, smoothing is applied according to the smoothing angle. If false, no smoothing is applied to the material.

Boolean : shadersMatch( DzMaterial otherMat )

Return Value:

  • true if these materials are using the same shaders, otherwise false.

Default implementation returns true if the materials are the same class.


Boolean : shouldAlwaysEmbed()

Return Value:

  • true if this material should always embed into a DSON scene, otherwise false.

void : startDrawHighlight()

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


void : stopDrawHighlight()

Causes this material to stop being drawn with a highlight.


Number : getNumUVMaps()

Deprecated

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

Signals


void : assetModified()

Signature:“assetModified()”

Emitted when the material has been modified.


void : assetWasSaved()

Signature:“assetWasSaved()”

Emitted after the material has been saved.


void : bakedMapChanged()

Signature:“bakedMapChanged()”

Transmitted when the baked map of this material changes.


void : lineUVWidthChanged()

Signature:“lineUVWidthChanged()”

Emitted when the UV line width changes

Since:

  • 4.11.0.109

void : lineWidthChanged()

Signature:“lineWidthChanged()”

Emitted when the start or end line width changes

Since:

  • 4.11.0.76

void : selectionStateChanged( DzMaterial mat, Boolean onOff )

Signature:“selectionStateChanged(DzMaterial*,bool)”

Transmitted when the selection state of this material changes.


void : settingsChanged()

Signature:“settingsChanged()”

Transmitted when one of the values of this material changes.


void : smoothingChanged()

Signature:“smoothingChanged()”

Transmitted when the smoothing settings of this material change.


void : tagsChanged()

Signature:“tagsChanged()”

Emitted when the tags on this material change.


void : uvsChanged()

Signature:“uvsChanged()”

Transmitted when the uv settings of this material change.