Skip To Content

LightSettings

CityEngine Light Settings.

 

Methods defined here:

getAmbientIntensity

getAmbientIntensity(self):

Gets AmbientIntensity field. Ambient intensity (0 = min, 1 = max).

@return: Value of AmbientIntensity field.  [float]

@example:
# print current ambient intensity
lightSettings = ce.getLighting()
print lightSettings.getAmbientIntensity()

getAmbientOcclusionAttenuation

getAmbientOcclusionAttenuation(self):

Gets AmbientOcclusionAttenuation field. Screen space ambient occlusion attenuation (0 = min, 1 = max).

@return: Value of AmbientOcclusionAttenuation field.  [float]

@example:
# print current ambient occlusion attenuation
lightSettings = ce.getLighting()
print lightSettings.getAmbientOcclusionAttenuation()

getAmbientOcclusionRadius

getAmbientOcclusionRadius(self):

Gets AmbientOcclusionRadius field. Radius in meters.

@return: Value of AmbientOcclusionRadius field.  [float]

@example:
# print current ambient occlusion radius
lightSettings = ce.getLighting()
print lightSettings.getAmbientOcclusionRadius()

getAmbientOcclusionSamples

getAmbientOcclusionSamples(self):

Gets AmbientOcclusionSamples field. Number of screen space ambient occlusion samples.

@return: Value of AmbientOcclusionSamples field.  ["AMBIENT_OCCLUSION_SAMPLES_INTERACTIVE", "AMBIENT_OCCLUSION_SAMPLES_LOWEST", "AMBIENT_OCCLUSION_SAMPLES_LOW", "AMBIENT_OCCLUSION_SAMPLES_HIGH", "AMBIENT_OCCLUSION_SAMPLES_HIGHEST"] [str]

@example:
# print current ambient occlusion sample count
lightSettings = ce.getLighting()
print lightSettings.getAmbientOcclusionSamples()

getLightMonth

getLightMonth(self):

Gets LightMonth field. Month (1-12).

@return: Value of LightMonth field.  [int]

@example:
# print current light month
lightSettings = ce.getLighting()
print lightSettings.getLightMonth()

getLightTimeZone

getLightTimeZone(self):

Gets LightTimeZone field. Relative to UTC (-12 to +12).

@return: Value of LightTimeZone field.  [int]

@example:
# print current light time zone
lightSettings = ce.getLighting()
print lightSettings.getLightTimeZone()

getLightTime

getLightTime(self):

Gets LightTime field. Time of day (0-24).

@return: Value of LightTime field.  [float]

@example:
# print current light time
lightSettings = ce.getLighting()
print lightSettings.getLightTime()

getRadiusMode

getRadiusMode(self):

Gets RadiusMode field. Determines how radius is calculated.

@return: Value of RadiusMode field.  ["RADIUS_MODE_INTERACTIVE", "RADIUS_MODE_MANUAL"] [str]

@example:
# print current ambient occlusion radius mode setting
lightSettings = ce.getLighting()
print lightSettings.getRadiusMode()

getShadowAttenuation

getShadowAttenuation(self):

Gets ShadowAttenuation field. Shadow attenuation (0 = min, 1 = max).

@return: Value of ShadowAttenuation field.  [float]

@example:
# print current shadow attenuation
lightSettings = ce.getLighting()
print lightSettings.getShadowAttenuation()

getShadowQuality

getShadowQuality(self):

Gets ShadowQuality field. Shadow Quality (low, medium, high).

@return: Value of ShadowQuality field.  ["SHADOW_LOW", "SHADOW_MEDIUM", "SHADOW_HIGH", "SHADOW_INTERACTIVE"] [str]

@example:
# print current shadow quality setting
lightSettings = ce.getLighting()
print lightSettings.getShadowQuality()

getSolarAzimuthAngle

getSolarAzimuthAngle(self):

Gets SolarAzimuthAngle field. Longitude angle of incidence (0=north, 90=east, 180=south, 270=west).

@return: Value of SolarAzimuthAngle field.  [float]

@example:
# print current light alimuth angle (in degrees)
lightSettings = ce.getLighting()
print lightSettings.getSolarAzimuthAngle()

getSolarElevationAngle

getSolarElevationAngle(self):

Gets SolarElevationAngle field. Latitude angle of incidence (90 degrees means light from top i.e. high noon).

@return: Value of SolarElevationAngle field.  [float]

@example:
# print current light elevation angle (in degrees)
lightSettings = ce.getLighting()
print lightSettings.getSolarElevationAngle()

getSolarIntensity

getSolarIntensity(self):

Gets SolarIntensity field. Sun intensity (0 = min, 1 = max).

@return: Value of SolarIntensity field.  [float]

@example:
# print current solar intensity
lightSettings = ce.getLighting()
print lightSettings.getSolarIntensity()

getSunPosSource

getSunPosSource(self):

Gets SunPosSource field. time/date or manual entry of angles.

@return: Value of SunPosSource field.  ["SUN_POSITION_SOURCE_TIME_DATE", "SUN_POSITION_SOURCE_DIRECT_ANGLE_ENTRY"] [str]

@example:
# print current sun position source
lightSettings = ce.getLighting()
print lightSettings.getSunPosSource()

setAmbientIntensity

setAmbientIntensity(self, floatValue):

Sets AmbientIntensity field. Ambient intensity (0 = min, 1 = max).

@param floatValue: the new value. [float]

@example:
# set the solar intensity to 0.3
lightSettings = ce.getLighting()
lightSettings.setAmbientIntensity(0.3)
ce.setLighting(lightSettings)

setAmbientOcclusionAttenuation

setAmbientOcclusionAttenuation(self, floatValue):

Sets AmbientOcclusionAttenuation field. Screen space ambient occlusion attenuation (0 = min, 1 = max).

@param floatValue: the new value. [float]

@example:
# set the ambient occlusion attenuation to 0.4
lightSettings = ce.getLighting()
lightSettings.setAmbientOcclusionAttenuation(0.4)
ce.setLighting(lightSettings)

setAmbientOcclusionRadius

setAmbientOcclusionRadius(self, floatValue):

Sets AmbientOcclusionRadius field. Radius in meters.

@param floatValue: the new value. [float]

@example:
# set the ambient occlusion radius to 6
lightSettings = ce.getLighting()
lightSettings.setAmbientOcclusionRadius(6.0)
ce.setLighting(lightSettings)

setAmbientOcclusionSamples

setAmbientOcclusionSamples(self, enumValue):

Sets AmbientOcclusionSamples field. Number of screen space ambient occlusion samples.

@param enumValue: the new value ["AMBIENT_OCCLUSION_SAMPLES_INTERACTIVE", "AMBIENT_OCCLUSION_SAMPLES_LOWEST", "AMBIENT_OCCLUSION_SAMPLES_LOW", "AMBIENT_OCCLUSION_SAMPLES_HIGH", "AMBIENT_OCCLUSION_SAMPLES_HIGHEST"]. [str]

@example:
# set the ambient occlusion sample count to high
lightSettings = ce.getLighting()
lightSettings.setAmbientOcclusionSamples(LightSettings.AMBIENT_OCCLUSION_SAMPLES_HIGH)
ce.setLighting(lightSettings)

setLightMonth

setLightMonth(self, intValue):

Sets LightMonth field. Month (1-12).

@param intValue: the new value. [int]

@example:
# set the light month to July
lightSettings = ce.getLighting()
lightSettings.setLightMonth(7)
ce.setLighting(lightSettings)

setLightTimeZone

setLightTimeZone(self, intValue):

Sets LightTimeZone field. Relative to UTC (-12 to +12).

@param intValue: the new value. [int]

@example:
# set the light time zone to +2
lightSettings = ce.getLighting()
lightSettings.setLightTimeZone(2.0)
ce.setLighting(lightSettings)

setLightTime

setLightTime(self, floatValue):

Sets LightTime field. Time of day (0-24).

@param floatValue: the new value. [float]

@example:
# set the light time to 10am
lightSettings = ce.getLighting()
lightSettings.setLightTime(10.0)
ce.setLighting(lightSettings)

setRadiusMode

setRadiusMode(self, enumValue):

Sets RadiusMode field. Determines how radius is calculated.

@param enumValue: the new value ["RADIUS_MODE_INTERACTIVE", "RADIUS_MODE_MANUAL"]. [str]

@example:
# set the ambient occlusion radius mode to manual
lightSettings = ce.getLighting()
lightSettings.setRadiusMode(LightSettings.RADIUS_MODE_MANUAL)
ce.setLighting(lightSettings)

setShadowAttenuation

setShadowAttenuation(self, floatValue):

Sets ShadowAttenuation field. Shadow attenuation (0 = min, 1 = max).

@param floatValue: the new value. [float]

@example:
# set the shadow attenuation to 0.5
lightSettings = ce.getLighting()
lightSettings.setShadowAttenuation(0.5)
ce.setLighting(lightSettings)

setShadowQuality

setShadowQuality(self, enumValue):

Sets ShadowQuality field. Shadow Quality (low, medium, high).

@param enumValue: the new value ["SHADOW_LOW", "SHADOW_MEDIUM", "SHADOW_HIGH", "SHADOW_INTERACTIVE"]. [str]

@example:
# set the shadow quality to high
lightSettings = ce.getLighting()
lightSettings.setShadowQuality(LightSettings.SHADOW_HIGH)
ce.setLighting(lightSettings)

setSolarAzimuthAngle

setSolarAzimuthAngle(self, floatValue):

Sets SolarAzimuthAngle field. Longitude angle of incidence (0=north, 90=east, 180=south, 270=west).

@param floatValue: the new value. [float]

@example:
# set the light azimuth to 225 degrees (SW)
lightSettings = ce.getLighting()
lightSettings.setSolarAzimuthAngle(225.0)
ce.setLighting(lightSettings)

setSolarElevationAngle

setSolarElevationAngle(self, floatValue):

Sets SolarElevationAngle field. Latitude angle of incidence (90 degrees means light from top i.e. high noon).

@param floatValue: the new value. [float]

@example:
# set the light elevation to 15 degrees
lightSettings = ce.getLighting()
lightSettings.setSolarElevationAngle(25.0)
ce.setLighting(lightSettings)

setSolarIntensity

setSolarIntensity(self, floatValue):

Sets SolarIntensity field. Sun intensity (0 = min, 1 = max).

@param floatValue: the new value. [float]

@example:
# set the solar intensity to 0.2
lightSettings = ce.getLighting()
lightSettings.setSolarIntensity(0.2)
ce.setLighting(lightSettings)

setSunPosSource

setSunPosSource(self, enumValue):

Sets SunPosSource field. time/date or manual entry of angles.

@param enumValue: the new value ["SUN_POSITION_SOURCE_TIME_DATE", "SUN_POSITION_SOURCE_DIRECT_ANGLE_ENTRY"]. [str]

@example:
# set the light source to time & date
lightSettings = ce.getLighting()
lightSettings.setSunPosSource(LightSettings.SUN_POSITION_SOURCE_TIME_DATE)
ce.setLighting(lightSettings)

Constants

This class defines the following constants:

AMBIENT_OCCLUSION_SAMPLES_HIGH = 'AMBIENT_OCCLUSION_SAMPLES_HIGH'
AMBIENT_OCCLUSION_SAMPLES_HIGHEST = 'AMBIENT_OCCLUSION_SAMPLES_HIGHEST'
AMBIENT_OCCLUSION_SAMPLES_INTERACTIVE = 'AMBIENT_OCCLUSION_SAMPLES_INTERACTIVE'
AMBIENT_OCCLUSION_SAMPLES_LOW = 'AMBIENT_OCCLUSION_SAMPLES_LOW'
AMBIENT_OCCLUSION_SAMPLES_LOWEST = 'AMBIENT_OCCLUSION_SAMPLES_LOWEST'
RADIUS_MODE_INTERACTIVE = 'RADIUS_MODE_INTERACTIVE'
RADIUS_MODE_MANUAL = 'RADIUS_MODE_MANUAL'
SHADOW_HIGH = 'SHADOW_HIGH'
SHADOW_INTERACTIVE = 'SHADOW_INTERACTIVE'
SHADOW_LOW = 'SHADOW_LOW'
SHADOW_MEDIUM = 'SHADOW_MEDIUM'
SUN_POSITION_SOURCE_DIRECT_ANGLE_ENTRY = 'SUN_POSITION_SOURCE_DIRECT_ANGLE_ENTRY'
SUN_POSITION_SOURCE_TIME_DATE = 'SUN_POSITION_SOURCE_TIME_DATE'