SBLight#

This class implements all mechanisms related to lights in SAMSON which are used in rendering (path tracing). Lights have the following properties:

  • position, the default value is (0 nm, 0 nm, 40 nm)

  • color, the default value is white color

  • radius, the default value is 1 nm

  • power, the default value is 1 femtowatt

Create and add a light#
    # construct a light node
    light = SBLight("Light")

    # change the light properties
    light.setPosition(SBPosition3(SBQuantity.nm(1), SBQuantity.nm(2), SBQuantity.nm(5)))
    light.setPower(SBQuantity.femtowatt(2.0))
    light.setColor(SBColor(0, 200, 0))

    # make the operation undoable
    SAMSON.beginHolding("Add light")

    SAMSON.hold(light)
    # create a light node
    light.create()

    # add it to the active document
    SAMSON.getActiveDocument().addChild(light)

    # stop the undoable operation
    SAMSON.endHolding()

See also

SAMSON SDK: SBDDocumentLight

class samson.SBLight(*args, **kwargs)#

Bases: SBNode

This class describes a light.

Overloaded function.

  1. __init__(self: samson.SBLight) -> None

Constructs a light.

  1. __init__(self: samson.SBLight, name: str) -> None

Constructs a light with the given name.

getColor(self: samson.SBLight) samson.SBColor#

Returns the color

getDefaultPower(self: samson.SBLight) samson.SBQuantity.unitsSI#

Returns the default power

getDefaultRadius(self: samson.SBLight) samson.SBQuantity.unitsSI#

Returns the default radius

getMaximumPower(self: samson.SBLight) samson.SBQuantity.unitsSI#

Returns the maximum power

getMaximumRadius(self: samson.SBLight) samson.SBQuantity.unitsSI#

Returns the maximum radius

getMinimumPower(self: samson.SBLight) samson.SBQuantity.unitsSI#

Returns the minimum power

getMinimumRadius(self: samson.SBLight) samson.SBQuantity.unitsSI#

Returns the minimum radius

getNextLight(self: samson.SBLight) samson.SBLight#

Returns the next Light.

getPosition(self: samson.SBLight) samson.SBPhysicalVector3#

Get the position

getPower(self: samson.SBLight) samson.SBQuantity.unitsSI#

Returns the power

getPreviousLight(self: samson.SBLight) samson.SBLight#

Returns the previous Light.

getRadius(self: samson.SBLight) samson.SBQuantity.unitsSI#

Returns the radius

setColor(self: samson.SBLight, color: samson.SBColor) None#

Sets the color

setPosition(self: samson.SBLight, arg0: samson.SBPhysicalVector3) None#

Set the position

setPower(self: samson.SBLight, arg0: samson.SBQuantity.unitsSI) None#

Sets the power

setRadius(self: samson.SBLight, arg0: samson.SBQuantity.unitsSI) None#

Sets the radius

property activeFlag#