Class: QgsPhongMaterialSettings

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.

Class Hierarchy

Inheritance diagram of qgis._3d.QgsPhongMaterialSettings

Base classes

QgsAbstractMaterialSettings

Abstract base class for material settings.

Methods

ambient

Returns ambient color component

ambientCoefficient

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

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

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

Virtual Methods

In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsPhongMaterialSettings. See the FAQ for more details.

toExportParameters

Static Methods

create

Returns a new instance of QgsPhongMaterialSettings.

supportsTechnique

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

class qgis._3d.QgsPhongMaterialSettings[source]

Bases: QgsAbstractMaterialSettings

ambient(self) QColor[source]

Returns ambient color component

Return type:

QColor

ambientCoefficient(self) float[source]

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

Added in version 3.36.

Return type:

float

static create() QgsAbstractMaterialSettings | None[source]

Returns a new instance of QgsPhongMaterialSettings.

Return type:

Optional[QgsAbstractMaterialSettings]

diffuse(self) QColor[source]

Returns diffuse color component

Return type:

QColor

diffuseCoefficient(self) float[source]

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

Added in version 3.36.

Return type:

float

opacity(self) float[source]

Returns the opacity of the surface

Added in version 3.26.

Return type:

float

setAmbient(self, ambient: QColor | Qt.GlobalColor)[source]

Sets ambient color component

Parameters:

ambient (Union[QColor, Qt.GlobalColor])

setAmbientCoefficient(self, coefficient: float)[source]

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

Added in version 3.36.

Parameters:

coefficient (float)

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

Sets diffuse color component

Parameters:

diffuse (Union[QColor, Qt.GlobalColor])

setDiffuseCoefficient(self, coefficient: float)[source]

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

Added in version 3.36.

Parameters:

coefficient (float)

setOpacity(self, opacity: float)[source]

Sets opacity of the surface

Added in version 3.26.

Parameters:

opacity (float)

setShininess(self, shininess: float)[source]

Sets shininess of the surface

Parameters:

shininess (float)

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

Sets specular color component

Parameters:

specular (Union[QColor, Qt.GlobalColor])

setSpecularCoefficient(self, coefficient: float)[source]

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

Added in version 3.36.

Parameters:

coefficient (float)

shininess(self) float[source]

Returns shininess of the surface

Return type:

float

specular(self) QColor[source]

Returns specular color component

Return type:

QColor

specularCoefficient(self) float[source]

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

Added in version 3.36.

Return type:

float

static supportsTechnique(technique: QgsMaterialSettingsRenderingTechnique) bool[source]

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

Parameters:

technique (QgsMaterialSettingsRenderingTechnique)

Return type:

bool

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

Dict[str, str]