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 | 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:
The author of the file for this material. (Read Only)
Since:
The revision version of the asset file for this material. (Read Only)
Since:
The asset id for this material.
Since:
The modified date of the asset file for this material. (Read Only)
Since:
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:
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( shape_dz shape )
Return Value:
Since:
DzUVSet : getActiveUVSet( geometry_dz 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.
DzTexture : getBakedMap()
Return Value:
Number : getBaseOpacity()
Return Value:
DzBox3 : getBoundingBox()
TODO: Add description.
DzTexture : getColorMap()
Return Value:
Color : getDiffuseColor()
Return Value:
Return Value:
Return Value:
Number : getNumGLMaps()
Return Value:
Number : getNumUVMaps()
Deprecated
This is deprecated because its name is somewhat of a misnomer. Use getNumGLMaps instead.
Return Value:
Return Value:
DzBoolProperty : getPropagatePriorityControl()
Return Value:
DzEnumProperty : getRenderPriorityControl()
Return Value:
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()
Retrieve selection state.
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 : setOpacityMap( DzTexture img )
Set the opactiy 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.
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 : 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()”
Transmitted when the tags on this material change.
void : uvsChanged()
Signature:“uvsChanged()”
Transmitted when the uv settings of this material change.