Class: QgsPhongMaterialSettings

class qgis._3d.QgsPhongMaterialSettings

Bases: qgis._3d.QgsAbstractMaterialSettings

Basic shading material used for rendering based on the Phong shading model with three color components: ambient, diffuse and specular.

Warning

This is not considered stable API, and may change in future QGIS releases. It is exposed to the Python bindings as a tech preview only.

QgsPhongMaterialSettings() Constructor for QgsPhongMaterialSettings.

QgsPhongMaterialSettings(QgsPhongMaterialSettings)

Methods

ambient

Returns ambient color component

ambientCoefficient

Returns the coefficient for the ambient color contribution (ie strength factor of the ambient color).

clone

rtype:

QgsPhongMaterialSettings

create

Returns a new instance of QgsPhongMaterialSettings.

diffuse

Returns diffuse color component

diffuseCoefficient

Returns the coefficient for the diffuse color contribution (ie strength factor of the diffuse color).

opacity

Returns the opacity of the surface

readXml

param elem:

setAmbient

Sets ambient color component

setAmbientCoefficient

Sets the coefficient for the ambient color contribution (ie strength factor of the ambient color).

setDiffuse

Sets diffuse color component

setDiffuseCoefficient

Sets the coefficient for the diffuse color contribution (ie strength factor of the diffuse color).

setOpacity

Sets opacity of the surface

setShininess

Sets shininess of the surface

setSpecular

Sets specular color component

setSpecularCoefficient

Sets the coefficient for the specular color contribution (ie strength factor of the specular color).

shininess

Returns shininess of the surface

specular

Returns specular color component

specularCoefficient

Returns the coefficient for the specular color contribution (ie strength factor of the specular color).

supportsTechnique

Returns True if the specified technique is supported by the Phong material.

toExportParameters

rtype:

Dict[str, str]

type

rtype:

str

writeXml

param elem:

ambient(self) QColor

Returns ambient color component

Return type:

QColor

ambientCoefficient(self) float

Returns the coefficient for the ambient color contribution (ie strength factor of the ambient color).

New in version 3.36.

Return type:

float

clone(self) QgsPhongMaterialSettings
Return type:

QgsPhongMaterialSettings

create() QgsAbstractMaterialSettings

Returns a new instance of QgsPhongMaterialSettings.

Return type:

QgsAbstractMaterialSettings

diffuse(self) QColor

Returns diffuse color component

Return type:

QColor

diffuseCoefficient(self) float

Returns the coefficient for the diffuse color contribution (ie strength factor of the diffuse color).

New in version 3.36.

Return type:

float

opacity(self) float

Returns the opacity of the surface

New in version 3.26.

Return type:

float

readXml(self, elem: QDomElement, context: QgsReadWriteContext)
Parameters:
setAmbient(self, ambient: QColor | Qt.GlobalColor)

Sets ambient color component

Parameters:

ambient (Union[QColor) –

setAmbientCoefficient(self, coefficient: float)

Sets the coefficient for the ambient color contribution (ie strength factor of the ambient color).

New in version 3.36.

Parameters:

coefficient (float) –

setDiffuse(self, diffuse: QColor | Qt.GlobalColor)

Sets diffuse color component

Parameters:

diffuse (Union[QColor) –

setDiffuseCoefficient(self, coefficient: float)

Sets the coefficient for the diffuse color contribution (ie strength factor of the diffuse color).

New in version 3.36.

Parameters:

coefficient (float) –

setOpacity(self, opacity: float)

Sets opacity of the surface

New in version 3.26.

Parameters:

opacity (float) –

setShininess(self, shininess: float)

Sets shininess of the surface

Parameters:

shininess (float) –

setSpecular(self, specular: QColor | Qt.GlobalColor)

Sets specular color component

Parameters:

specular (Union[QColor) –

setSpecularCoefficient(self, coefficient: float)

Sets the coefficient for the specular color contribution (ie strength factor of the specular color).

New in version 3.36.

Parameters:

coefficient (float) –

shininess(self) float

Returns shininess of the surface

Return type:

float

specular(self) QColor

Returns specular color component

Return type:

QColor

specularCoefficient(self) float

Returns the coefficient for the specular color contribution (ie strength factor of the specular color).

New in version 3.36.

Return type:

float

supportsTechnique(technique: QgsMaterialSettingsRenderingTechnique) bool

Returns True if the specified technique is supported by the Phong material.

Parameters:

technique (QgsMaterialSettingsRenderingTechnique) –

Return type:

bool

toExportParameters(self) Dict[str, str]
Return type:

Dict[str, str]

type(self) str
Return type:

str

writeXml(self, elem: QDomElement, context: QgsReadWriteContext)
Parameters: