|
@@ -98,30 +98,40 @@ class DirectLights(NodePath):
|
|
|
self.create('directional')
|
|
self.create('directional')
|
|
|
|
|
|
|
|
def allOn(self):
|
|
def allOn(self):
|
|
|
- """ Turn on all DIRECT lights """
|
|
|
|
|
|
|
+ """
|
|
|
|
|
+ Turn on all DIRECT lights
|
|
|
|
|
+ """
|
|
|
for light in self.lightDict.values():
|
|
for light in self.lightDict.values():
|
|
|
self.setOn(light)
|
|
self.setOn(light)
|
|
|
# Make sure there is a default material
|
|
# Make sure there is a default material
|
|
|
render.setMaterial(Material())
|
|
render.setMaterial(Material())
|
|
|
|
|
|
|
|
def allOff(self):
|
|
def allOff(self):
|
|
|
- """ Turn off all DIRECT lights """
|
|
|
|
|
|
|
+ """
|
|
|
|
|
+ Turn off all DIRECT lights
|
|
|
|
|
+ """
|
|
|
for light in self.lightDict.values():
|
|
for light in self.lightDict.values():
|
|
|
self.setOff(light)
|
|
self.setOff(light)
|
|
|
|
|
|
|
|
def toggle(self):
|
|
def toggle(self):
|
|
|
- """ Toggles light attribute, but doesn't toggle individual lights """
|
|
|
|
|
|
|
+ """
|
|
|
|
|
+ Toggles light attribute, but doesn't toggle individual lights
|
|
|
|
|
+ """
|
|
|
if render.node().hasAttrib(LightAttrib.getClassType()):
|
|
if render.node().hasAttrib(LightAttrib.getClassType()):
|
|
|
self.allOff()
|
|
self.allOff()
|
|
|
else:
|
|
else:
|
|
|
self.allOn()
|
|
self.allOn()
|
|
|
|
|
|
|
|
def setOn(self, directLight):
|
|
def setOn(self, directLight):
|
|
|
- """ setOn(directLight) """
|
|
|
|
|
|
|
+ """
|
|
|
|
|
+ Turn on the given directLight
|
|
|
|
|
+ """
|
|
|
render.setLight(directLight)
|
|
render.setLight(directLight)
|
|
|
|
|
|
|
|
def setOff(self, directLight):
|
|
def setOff(self, directLight):
|
|
|
- """ setOff(directLight)"""
|
|
|
|
|
|
|
+ """
|
|
|
|
|
+ Turn off the given directLight
|
|
|
|
|
+ """
|
|
|
render.clearLight(directLight)
|
|
render.clearLight(directLight)
|
|
|
|
|
|
|
|
|
|
|