Class: QgsPhongMaterialSettings

class qgis.3d.QgsPhongMaterialSettings

Bases: qgis._3d.QgsAbstractMaterialSettings

Constructor for QgsPhongMaterialSettings.

QgsPhongMaterialSettings(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.

Methods

ambient

Returns ambient color component

clone

rtype

QgsPhongMaterialSettings

create

Returns a new instance of QgsPhongMaterialSettings.

diffuse

Returns diffuse color component

readXml

param elem

setAmbient

Sets ambient color component

setDiffuse

Sets diffuse color component

setShininess

Sets shininess of the surface

setSpecular

Sets specular color component

shininess

Returns shininess of the surface

specular

Returns specular color component

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

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

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

Sets ambient color component

Parameters

ambient (Union[QColor) –

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

Sets diffuse color component

Parameters

diffuse (Union[QColor) –

setShininess(self, shininess: float)

Sets shininess of the surface

Parameters

shininess (float) –

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

Sets specular color component

Parameters

specular (Union[QColor) –

shininess(self) → float

Returns shininess of the surface

Return type

float

specular(self) → QColor

Returns specular color component

Return type

QColor

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