Class: QgsAbstractMaterialSettings

Abstract base class for material settings.

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.

Note

This is an abstract class, with methods which must be implemented by a subclass.

The following methods must be implemented: clone(), equals(), type()

List of all members, including inherited members

Class Hierarchy

Inheritance diagram of qgis.core.QgsAbstractMaterialSettings

Subclasses

QgsGoochMaterialSettings

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

QgsMetalRoughMaterialSettings

A PBR metal rough shading material used for rendering.

QgsNullMaterialSettings

Null shading material used for rendering models and scenes with native textures.

QgsPhongMaterialSettings

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

QgsPhongTexturedMaterialSettings

A Phong shading model with diffuse texture map.

QgsSimpleLineMaterialSettings

Basic shading material used for rendering simple lines as solid line components.

Enums

Property

Data definable properties.

Abstract Methods

clone

Clones the material settings.

equals

Returns True if this settings exactly matches an other settings.

type

Returns the unique type name for the material.

Methods

dataDefinedProperties

Returns the symbol material property collection, used for data defined overrides.

propertyDefinitions

Returns a reference to the material properties definition, used for data defined overrides.

setDataDefinedProperties

Sets the material property collection, used for data defined overrides.

Virtual Methods

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

readXml

Reads settings from a DOM element

writeXml

Writes settings to a DOM element

class qgis.core.QgsAbstractMaterialSettings[source]

Bases: object

class Property(*values)

Bases: IntEnum

Data definable properties.

  • Diffuse: Diffuse color

  • Ambient: Ambient color (phong material)

  • Warm: Warm color (gooch material)

  • Cool: Cool color (gooch material)

  • Specular: Specular color

abstract clone(self) QgsAbstractMaterialSettings | None[source]

Clones the material settings.

Caller takes ownership of the returned object.

Return type:

Optional[QgsAbstractMaterialSettings]

dataDefinedProperties(self) QgsPropertyCollection[source]

Returns the symbol material property collection, used for data defined overrides.

Added in version 4.2.

Return type:

QgsPropertyCollection

abstract equals(self, other: QgsAbstractMaterialSettings | None) bool[source]

Returns True if this settings exactly matches an other settings.

Added in version 3.42.

Parameters:

other (Optional[QgsAbstractMaterialSettings])

Return type:

bool

propertyDefinitions(self) dict[int, QgsPropertyDefinition]

Returns a reference to the material properties definition, used for data defined overrides.

Added in version 4.2.

Return type:

dict[int, QgsPropertyDefinition]

virtual readXml(self, element: QDomElement, a1: QgsReadWriteContext)[source]

Reads settings from a DOM element

Parameters:
setDataDefinedProperties(self, collection: QgsPropertyCollection)[source]

Sets the material property collection, used for data defined overrides.

Added in version 4.2.

Parameters:

collection (QgsPropertyCollection)

abstract type(self) str[source]

Returns the unique type name for the material.

Return type:

str

virtual writeXml(self, element: QDomElement, a1: QgsReadWriteContext)[source]

Writes settings to a DOM element

Parameters: