Class: QgsLightSource

Base class for light sources in 3d scenes.

Added in version 3.26.

Class Hierarchy

Inheritance diagram of qgis._3d.QgsLightSource

Subclasses

QgsDirectionalLightSettings

Definition of a directional light in a 3D map scene

QgsPointLightSettings

Definition of a point light in a 3D map scene

class qgis._3d.QgsLightSource[source]

Bases: object

clone(self) QgsLightSource | None[source]

Returns a copy of the light source.

Return type:

Optional[QgsLightSource]

static createFromXml(element: QDomElement, context: QgsReadWriteContext) QgsLightSource | None[source]

Creates a new light source from an XML element.

Parameters:
Return type:

Optional[QgsLightSource]

readXml(self, elem: QDomElement, context: QgsReadWriteContext = QgsReadWriteContext())[source]

Reads configuration from a DOM element previously written using writeXml().

See also

writeXml()

Parameters:
resolveReferences(self, project: QgsProject)[source]

After reading from XML, resolve references to any layers that have been read as layer IDs.

Parameters:

project (QgsProject)

type(self) Qgis.LightSourceType[source]

Returns the light source type.

Return type:

Qgis.LightSourceType

writeXml(self, doc: QDomDocument, context: QgsReadWriteContext = QgsReadWriteContext()) QDomElement[source]

Writes the light source’s configuration to a new DOM element and returns it.

See also

readXml()

Parameters:
Return type:

QDomElement