Class: QgsMaterialRegistry

Registry of available 3d material settings classes.

QgsMaterialRegistry is not usually directly created, but rather accessed through QgsApplication.materialRegistry().

Added in version 3.16.

List of all members, including inherited members

Methods

addMaterialSettingsType

Registers a new material settings type.

createMaterialSettings

Creates a new instance of the material settings of the specified type.

materialSettingsMetadata

Returns metadata for specified material settings type.

materialSettingsTypes

Returns a list of all available material settings types.

populate

Populates the registry with standard material types.

class qgis.core.QgsMaterialRegistry[source]

Bases: object

addMaterialSettingsType(self, metadata: QgsMaterialSettingsAbstractMetadata | None) bool[source]

Registers a new material settings type. Takes ownership of the metadata instance.

Parameters:

metadata (Optional[QgsMaterialSettingsAbstractMetadata])

Return type:

bool

createMaterialSettings(self, type: str | None) QgsAbstractMaterialSettings | None

Creates a new instance of the material settings of the specified type.

The caller takes ownership of the returned object.

Returns None if the specified type is not found in the registry.

Parameters:

type (Optional[str])

Return type:

Optional[QgsAbstractMaterialSettings]

materialSettingsMetadata(self, type: str | None) QgsMaterialSettingsAbstractMetadata | None[source]

Returns metadata for specified material settings type. Returns None if not found

Parameters:

type (Optional[str])

Return type:

Optional[QgsMaterialSettingsAbstractMetadata]

materialSettingsTypes(self) list[str][source]

Returns a list of all available material settings types.

Return type:

list[str]

populate(self) bool[source]

Populates the registry with standard material types. If called on a non-empty registry then this will have no effect and will return False.

Return type:

bool