Class: QgsLightSource

class qgis._3d.QgsLightSource

Bases: sip.wrapper

Base class for light sources in 3d scenes.

New in version 3.26:

Methods

clone

Returns a copy of the light source.

createFromXml

Creates a new light source from an XML element.

readXml

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

resolveReferences

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

type

Returns the light source type.

writeXml

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

clone(self) QgsLightSource

Returns a copy of the light source.

Return type

QgsLightSource

createFromXml(element: QDomElement, context: QgsReadWriteContext) QgsLightSource

Creates a new light source from an XML element.

Parameters
Return type

QgsLightSource

readXml(self, elem: QDomElement, context: QgsReadWriteContext = QgsReadWriteContext())

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

See also

writeXml()

Parameters
resolveReferences(self, project: QgsProject)

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

Parameters

project (QgsProject) –

type(self) Qgis.LightSourceType

Returns the light source type.

Return type

Qgis.LightSourceType

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

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

See also

readXml()

Parameters
Return type

QDomElement