Base class for all material types.
Inherits :
Inherited By : DzBrickMaterial, DzDefaultMaterial, DzShaderMaterial and uberiraymaterial_dz
DAZ Script | |
---|---|
DzMaterial | getMaterial ( Number which ) |
Number | getNumMaterials () |
void | assetModified () |
void | assetWasSaved () |
void | bakedMapChanged () |
void | lineUVWidthChanged () |
void | lineWidthChanged () |
void | selectionStateChanged ( DzMaterial mat, Boolean onOff ) |
void | settingsChanged () |
void | smoothingChanged () |
void | tagsChanged () |
void | uvsChanged () |
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:
Hold the author of the file for this material. (Read Only)
Since:
Hold the revision version of the asset file for this material. (Read Only)
Since:
Hold the asset id for this material.
Since:
Hold the modified date of the asset file for this material. (Read Only)
Since:
Holds whether or not the asset for this modifier needs to be saved. (Read Only)
Since:
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:
Holds the asset URI for this material. (Read Only)
Since:
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.
DzMaterial : getMaterial( Number which )
Return Value:
Return Value:
DzMaterial : duplicateOrDefaultMaterial( DzElementDuplicateContext context )
Parameter(s):
Return Value:
Since:
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):
DzUVSet : getActiveUVSet( DzShape shape )
Return Value:
Since:
DzUVSet : getActiveUVSet( DzGeometry geom )
Return Value:
Since:
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:
DzTexture : getBakedMap()
Return Value:
Number : getBaseOpacity()
Return Value:
DzBox3 : getBoundingBox()
Return Value:
DzTexture : getColorMap()
Return Value:
Color : getDiffuseColor()
Return Value:
Return Value:
float : getLineEndWidth()
Return Value:
Since:
DzFloatProperty : getLineEndWidthControl()
Return Value:
Since:
Return Value:
Since:
DzColorProperty : getLinePreviewColorControl()
Return Value:
Since:
float : getLineStartWidth()
Return Value:
Since:
DzFloatProperty : getLineStartWidthControl()
Return Value:
Since:
float : getLineUVWidth()
Return Value:
Since:
DzFloatProperty : getLineUVWidthControl()
Return Value:
Since:
Return Value:
Number : getNumGLMaps()
Return Value:
Return Value:
DzBoolProperty : getPropagatePriorityControl()
Return Value:
DzEnumProperty : getRenderPriorityControl()
Return Value:
Return Value:
Since:
Array : getShapeList()
Return Value:
DzFloatProperty : getSmoothAngleControl()
Return Value:
DzBoolProperty : getSmoothControl()
Return Value:
Return Value:
Return Value:
Since:
DzStringProperty : getTagsControl()
Return Value:
Since:
DzEnumProperty : getUVSetControl()
Return Value:
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
.Return Value:
true
if the material supports mapping of the Opacity channel, otherwise false
.Return Value:
true
if this material is opaque, otherwise false
.Boolean : isPropagateRenderPriorityToNodesEnabled()
Return Value:
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):
Return Value:
true
if the asset was successfully marked as modified, otherwise false
.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):
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):
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):
Since:
void : setLinePreviewColor( Color color )
Sets whether or not smoothing is enabled for the material.
Parameter(s):
Since:
void : setLineStartWidth( Number width )
Parameter(s):
Since:
void : setLineUVWidth( Number width )
Parameter(s):
Since:
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):
void : setSmoothingOn( Boolean onOff )
Sets whether or not smoothing is enabled for the material.
Parameter(s):
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.
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.
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:
void : lineWidthChanged()
Signature:“lineWidthChanged()”
Emitted when the start or end line width changes
Since:
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.