def __init__(self,parent,name="unnamed",type=None):
        plObjInterface.__init__(self,parent,name,type)
        try: #Quick, dirty fix for NameError bug with classes from alc_GeomClasses
            self.ambient = RGBA('1.0','1.0','1.0','1.0',type=1)
        except NameError:
            #print "Damnit! Need reimport alc_GeomClasses.py"
            from alc_GeomClasses import RGBA,hsMatrix44
            self.ambient = RGBA('1.0','1.0','1.0','1.0',type=1)

        self.diffuse = RGBA()
        self.specular = RGBA()

        self.LightToLocal = hsMatrix44()
        self.LocalToLight = hsMatrix44()
        self.LightToWorld = hsMatrix44()
        self.WorldToLight = hsMatrix44()

        self.fProjection = UruObjectRef(self.getVersion()) #plLayerInterface
        self.softvol = UruObjectRef(self.getVersion()) #plSoftVolume
        self.scenenode = UruObjectRef(self.getVersion()) #Dunno

        self.visregs = hsTArray([],self.getVersion()) #plVisRegion[]
示例#2
0
    def __init__(self, parent, name="unnamed", type=None):
        plObjInterface.__init__(self, parent, name, type)
        try:  #Quick, dirty fix for NameError bug with classes from alc_GeomClasses
            self.ambient = RGBA('1.0', '1.0', '1.0', '1.0', type=1)
        except NameError:
            #print "Damnit! Need reimport alc_GeomClasses.py"
            from alc_GeomClasses import RGBA, hsMatrix44
            self.ambient = RGBA('1.0', '1.0', '1.0', '1.0', type=1)

        self.diffuse = RGBA()
        self.specular = RGBA()

        self.LightToLocal = hsMatrix44()
        self.LocalToLight = hsMatrix44()
        self.LightToWorld = hsMatrix44()
        self.WorldToLight = hsMatrix44()

        self.fProjection = UruObjectRef(self.getVersion())  #plLayerInterface
        self.softvol = UruObjectRef(self.getVersion())  #plSoftVolume
        self.scenenode = UruObjectRef(self.getVersion())  #Dunno

        self.visregs = hsTArray([], self.getVersion())  #plVisRegion[]
示例#3
0
class plLightInfo(plObjInterface):  #Type 0x54 (Uru)

    Props = \
    { \
        "kDisable"              : 0, \
        "kLPObsolete"           : 1, \
        "kLPCastShadows"        : 2, \
        "kLPMovable"            : 3, \
        "kLPHasIncludes"        : 4, \
        "kLPIncludesChars"      : 5, \
        "kLP_OBSOLECTE_0"       : 6, \
        "kLPOverAll"            : 7, \
        "kLPHasSpecular"        : 8, \
        "kLPShadowOnly"         : 9, \
        "kLPShadowLightGroup"   : 10, \
        "kLPForceProj"          : 11, \
        "kNumProps"             : 12  \
    }

    scriptProps = \
    { \
        "disable"              : 0, \
        "obsolete"             : 1, \
        "castshadows"          : 2, \
        "movable"              : 3, \
        "hasincludes"          : 4, \
        "includeschars"        : 5, \
        "obsolecte_0"          : 6, \
        "overall"              : 7, \
        "hasspecular"          : 8, \
        "shadowonly"           : 9, \
        "shadowlightgroup"     : 10, \
        "forceproj"            : 11, \
    }

    def __init__(self, parent, name="unnamed", type=None):
        plObjInterface.__init__(self, parent, name, type)
        try:  #Quick, dirty fix for NameError bug with classes from alc_GeomClasses
            self.ambient = RGBA('1.0', '1.0', '1.0', '1.0', type=1)
        except NameError:
            #print "Damnit! Need reimport alc_GeomClasses.py"
            from alc_GeomClasses import RGBA, hsMatrix44
            self.ambient = RGBA('1.0', '1.0', '1.0', '1.0', type=1)

        self.diffuse = RGBA()
        self.specular = RGBA()

        self.LightToLocal = hsMatrix44()
        self.LocalToLight = hsMatrix44()
        self.LightToWorld = hsMatrix44()
        self.WorldToLight = hsMatrix44()

        self.fProjection = UruObjectRef(self.getVersion())  #plLayerInterface
        self.softvol = UruObjectRef(self.getVersion())  #plSoftVolume
        self.scenenode = UruObjectRef(self.getVersion())  #Dunno

        self.visregs = hsTArray([], self.getVersion())  #plVisRegion[]

    def read(self, buf):
        plObjInterface.read(self, buf)
        self.ambient.read(buf)
        self.diffuse.read(buf)
        self.specular.read(buf)
        self.LightToLocal.read(buf)
        self.LocalToLight.read(buf)
        self.LightToWorld.read(buf)
        self.WorldToLight.read(buf)
        self.fProjection.read(buf)
        self.softvol.read(buf)
        self.scenenode.read(buf)

        self.visregs.read(buf)

    def write(self, buf):
        plObjInterface.write(self, buf)
        self.ambient.write(buf)
        self.diffuse.write(buf)
        self.specular.write(buf)
        self.LightToLocal.write(buf)
        self.LocalToLight.write(buf)
        self.LightToWorld.write(buf)
        self.WorldToLight.write(buf)
        self.fProjection.write(buf)
        self.softvol.write(buf)
        self.scenenode.write(buf)

        self.visregs.write(buf)

    def changePageRaw(self, sid, did, stype, dtype):
        plObjInterface.changePageRaw(self, sid, did, stype, dtype)
        self.softvol.changePageRaw(sid, did, stype, dtype)
        self.layerint.changePageRaw(sid, did, stype, dtype)
        self.scenenode.changePageRaw(sid, did, stype, dtype)
        self.visregs.changePageRaw(sid, did, stype, dtype)

    def _Import(scnobj, prp, obj):
        # Lights
        for li in scnobj.data1.vector:
            if li.Key.object_type in [0x55, 0x56, 0x57]:
                light = prp.findref(li)
                light.data.import_obj(obj)
                break
        # Shadows
        for sh in scnobj.data1.vector:
            if sh.Key.object_type in [0xD5, 0xD6]:
                shadow = prp.findref(sh)
                shadow.data.import_obj(obj)

    Import = staticmethod(_Import)
class plLightInfo(plObjInterface):                          #Type 0x54 (Uru)

    Props = \
    { \
        "kDisable"              : 0, \
        "kLPObsolete"           : 1, \
        "kLPCastShadows"        : 2, \
        "kLPMovable"            : 3, \
        "kLPHasIncludes"        : 4, \
        "kLPIncludesChars"      : 5, \
        "kLP_OBSOLECTE_0"       : 6, \
        "kLPOverAll"            : 7, \
        "kLPHasSpecular"        : 8, \
        "kLPShadowOnly"         : 9, \
        "kLPShadowLightGroup"   : 10, \
        "kLPForceProj"          : 11, \
        "kNumProps"             : 12  \
    }

    scriptProps = \
    { \
        "disable"              : 0, \
        "obsolete"             : 1, \
        "castshadows"          : 2, \
        "movable"              : 3, \
        "hasincludes"          : 4, \
        "includeschars"        : 5, \
        "obsolecte_0"          : 6, \
        "overall"              : 7, \
        "hasspecular"          : 8, \
        "shadowonly"           : 9, \
        "shadowlightgroup"     : 10, \
        "forceproj"            : 11, \
    }

    def __init__(self,parent,name="unnamed",type=None):
        plObjInterface.__init__(self,parent,name,type)
        try: #Quick, dirty fix for NameError bug with classes from alc_GeomClasses
            self.ambient = RGBA('1.0','1.0','1.0','1.0',type=1)
        except NameError:
            #print "Damnit! Need reimport alc_GeomClasses.py"
            from alc_GeomClasses import RGBA,hsMatrix44
            self.ambient = RGBA('1.0','1.0','1.0','1.0',type=1)

        self.diffuse = RGBA()
        self.specular = RGBA()

        self.LightToLocal = hsMatrix44()
        self.LocalToLight = hsMatrix44()
        self.LightToWorld = hsMatrix44()
        self.WorldToLight = hsMatrix44()

        self.fProjection = UruObjectRef(self.getVersion()) #plLayerInterface
        self.softvol = UruObjectRef(self.getVersion()) #plSoftVolume
        self.scenenode = UruObjectRef(self.getVersion()) #Dunno

        self.visregs = hsTArray([],self.getVersion()) #plVisRegion[]

    def read(self,buf):
        plObjInterface.read(self,buf)
        self.ambient.read(buf)
        self.diffuse.read(buf)
        self.specular.read(buf)
        self.LightToLocal.read(buf)
        self.LocalToLight.read(buf)
        self.LightToWorld.read(buf)
        self.WorldToLight.read(buf)
        self.fProjection.read(buf)
        self.softvol.read(buf)
        self.scenenode.read(buf)


        self.visregs.read(buf)

    def write(self,buf):
        plObjInterface.write(self,buf)
        self.ambient.write(buf)
        self.diffuse.write(buf)
        self.specular.write(buf)
        self.LightToLocal.write(buf)
        self.LocalToLight.write(buf)
        self.LightToWorld.write(buf)
        self.WorldToLight.write(buf)
        self.fProjection.write(buf)
        self.softvol.write(buf)
        self.scenenode.write(buf)

        self.visregs.write(buf)

    def changePageRaw(self,sid,did,stype,dtype):
        plObjInterface.changePageRaw(self,sid,did,stype,dtype)
        self.softvol.changePageRaw(sid,did,stype,dtype)
        self.layerint.changePageRaw(sid,did,stype,dtype)
        self.scenenode.changePageRaw(sid,did,stype,dtype)
        self.visregs.changePageRaw(sid,did,stype,dtype)

    def _Import(scnobj,prp,obj):
        # Lights
        for li in  scnobj.data1.vector:
            if li.Key.object_type in [0x55,0x56,0x57]:
                light=prp.findref(li)
                light.data.import_obj(obj)
                break
        # Shadows
        for sh in  scnobj.data1.vector:
            if sh.Key.object_type in [0xD5,0xD6]:
                shadow=prp.findref(sh)
                shadow.data.import_obj(obj)

    Import = staticmethod(_Import)