![]() |
![]() |
![]() |
Content Scripting Python World LightingFrom RexWikiEach world in realXtend has their own day cycle. Sometimes, however, one might want to override the default day cycle to create a world that has eternal sunshine for example, or perpetual night. This sample script will demonstrate how to override the default lighting conditions and ambient light in the world.
import rxactor
import rxavatar
import rxworldinfo
import sys
import math
import clr
asm = clr.LoadAssemblyByName('OpenSim.Region.ScriptEngine.Common')
Vector3 = asm.OpenSim.Region.ScriptEngine.Common.LSL_Types.Vector3
class Ambient(rxworldinfo.WorldInfo):
def GetScriptClassName():
return "testambient.Ambient"
def EventCreated(self):
super(self.__class__,self).EventCreated()
self.MyWorld.MyEventManager.onAddPresence += self.handleOnAddPresence
print "testambient.Ambient EventCreated"
def EventDestroyed(self):
self.MyWorld.MyEventManager.onAddPresence -= self.handleOnAddPresence
super(Ambient,self).EventDestroyed()
def handleOnAddPresence(self,vAvatar):
vAvatar.rexSetAmbientLight(Vector3(0,0,1), Vector3(0.1,0.1,0.1), Vector3(0.1,0.1,0.1))
The noteworthy function is: def rexSetAmbientLight(self,lightDirection,lightColour,ambientColour): where
|
||
![]() |
![]() |
![]() |

