Beispiel #1
0
def applymesh(ent, meshuuid):
    try:
        ent.mesh
    except AttributeError:
        ent.prim.MeshID = meshuuid #new
    else:
        ent.mesh.SetMesh(meshuuid)        
    r.sendRexPrimData(ent.id)
Beispiel #2
0
def applymesh(ent, meshuuid):
    try:
        ent.mesh
    except AttributeError:
        ent.prim.MeshID = meshuuid  #new
    else:
        ent.mesh.SetMesh(meshuuid)
    r.sendRexPrimData(ent.id)
Beispiel #3
0
def applymesh(ent, meshuuid):
    #ent.meshid = meshuuid #old
    if ent.mesh is not None:
        ent.mesh.SetMesh(meshuuid)
        #r.logDebug("Mesh asset UUID after before sending to server: %s" % ent.mesh)
    else:
        ent.prim.MeshID = meshuuid  #new

    r.sendRexPrimData(ent.id)
Beispiel #4
0
def applymesh(ent, meshuuid):
    try:
        ent.mesh
    except AttributeError:
        ent.prim.MeshID = meshuuid #new
        #r.logDebug("Mesh asset UUID after before sending to server: %s" % ent.mesh)
    else:
        ent.mesh.SetMesh(meshuuid)        
        #ent.prim.MeshID = meshuuid # change meshuuid
    r.sendRexPrimData(ent.id)
Beispiel #5
0
def applymesh(ent, meshuuid):
    #ent.meshid = meshuuid #old
    if ent.mesh is not None:
        ent.mesh.SetMesh(meshuuid)
        #r.logDebug("Mesh asset UUID after before sending to server: %s" % ent.mesh)
    else:
        ent.prim.MeshID = meshuuid #new
        
    r.sendRexPrimData(ent.id)
        #~ r.logDebug("Mesh asset UUID after prim data sent to server: %s" % ent.mesh)
Beispiel #6
0
 def applyAction(self):
     ent = self.mainedit.active
     if self.combobox is not None and ent is not None:
         qprim = ent.id.prim
         mats = qprim.Materials
         asset_type_text = self.combobox.currentText
         
         asset_type = PRIMTYPES_REVERSED[asset_type_text] #need to encode to something else?
         mats[self.index]  = (asset_type, self.text)
         qprim.Materials = mats
         
         r.sendRexPrimData(ent.id)
         
         self.deactivateButtons()
Beispiel #7
0
 def applyAction(self):
     ent = self.mainedit.active
     if self.combobox is not None and ent is not None:
         qprim = ent.prim
         mats = qprim.Materials
         asset_type_text = self.combobox.currentText
         
         asset_type = PRIMTYPES_REVERSED[asset_type_text] #need to encode to something else?
         mats[self.index]  = (asset_type, self.text)
         qprim.Materials = mats
         
         r.sendRexPrimData(ent.id)
         
         self.deactivateButtons()
Beispiel #8
0
def applyaudio(ent, audiouuid, soundRadius, soundVolume):
    try:
        ent.sound
    except AttributeError:
        ent.prim.SoundID = audiouuid
        # default radius and volume
        ent.prim.SoundRadius = soundRadius
        ent.prim.SoundVolume = soundVolume
    else:
        ent.prim.SoundID = audiouuid
        ent.prim.SoundRadius = soundRadius
        ent.prim.SoundVolume = soundVolume
        ent.sound.SetSound(audiouuid, ent.placeable.Position, ent.prim.SoundRadius, ent.prim.SoundVolume)
    soundRulerUpdate(ent)
    r.sendRexPrimData(ent.id)
Beispiel #9
0
def applyanimation(ent, animationuuid, animationname, animationrate):
    ent.prim.AnimationPackageID = animationuuid
    ent.prim.AnimationName = animationname
    ent.prim.AnimationRate = animationrate

    try:
        ent.mesh
    except:
        return

    try:
        ac = ent.animationcontroller
    except:
        ent.createComponent('EC_OgreAnimationController')
        ac = ent.animationcontroller
        ac.SetMeshEntity(ent.mesh)
    r.sendRexPrimData(ent.id)
Beispiel #10
0
def applyanimation(ent, animationuuid, animationname, animationrate):
    ent.prim.AnimationPackageID = animationuuid
    ent.prim.AnimationName = animationname
    ent.prim.AnimationRate = animationrate

    try:
        ent.mesh
    except:
        return

    try:
        ac = ent.animationcontroller
    except:
        ent.GetOrCreateComponentRaw('EC_AnimationController')
        ac = ent.animationcontroller
        ac.SetNetworkSyncEnabled(False)
        ac.SetMeshEntity(ent.mesh)
    r.sendRexPrimData(ent.id)
Beispiel #11
0
def applyaudio(ent, audiouuid, soundRadius, soundVolume):
    # First try to get an existing sound component (EC_AttachedSound)
    try:
        ent.sound
    except AttributeError:
        # It didn't exist, so we only set the ID, radius and volume.
        # The network roundtrip will ensure that a sound component 
        # (EC_AttachedSound) will be created
        ent.prim.SoundID = audiouuid
        ent.prim.SoundRadius = soundRadius
        ent.prim.SoundVolume = soundVolume
    else:
        ent.prim.SoundID = audiouuid
        ent.prim.SoundRadius = soundRadius
        ent.prim.SoundVolume = soundVolume
        ent.sound.SetSound(audiouuid, ent.placeable.Position, ent.prim.SoundRadius, ent.prim.SoundVolume)
    soundRulerUpdate(ent)
    r.sendRexPrimData(ent.id)
Beispiel #12
0
def applyanimation(ent, animationuuid, animationname, animationrate):
    ent.prim.AnimationPackageID = animationuuid
    ent.prim.AnimationName = animationname
    ent.prim.AnimationRate = animationrate

    try:
        ent.mesh
    except:
        return

    try:
        ac = ent.animationcontroller
    except:
        ent.GetOrCreateComponentRaw('EC_AnimationController')
        ac = ent.animationcontroller
        ac.SetNetworkSyncEnabled(False)
        ac.SetMeshEntity(ent.mesh)
    r.sendRexPrimData(ent.id)
Beispiel #13
0
def applyaudio(ent, audiouuid, soundRadius, soundVolume):
    # First try to get an existing sound component (EC_AttachedSound)
    try:
        ent.sound
    except AttributeError:
        # It didn't exist, so we only set the ID, radius and volume.
        # The network roundtrip will ensure that a sound component
        # (EC_AttachedSound) will be created
        ent.prim.SoundID = audiouuid
        ent.prim.SoundRadius = soundRadius
        ent.prim.SoundVolume = soundVolume
    else:
        ent.prim.SoundID = audiouuid
        ent.prim.SoundRadius = soundRadius
        ent.prim.SoundVolume = soundVolume
        ent.sound.SetSound(audiouuid, ent.placeable.Position,
                           ent.prim.SoundRadius, ent.prim.SoundVolume)
    soundRulerUpdate(ent)
    r.sendRexPrimData(ent.id)
Beispiel #14
0
if 0: #test changing the mesh asset a prim is using
    ent_id = 2088826433
    #print arkku_id, type(arkku_id)
    ent = naali.getEntity(ent_id)
    print "Test entity:", ent
    print ent.mesh
    #ent.mesh = 1 #should raise an exception
    #ruukku = "681b1680-fab5-4203-83a7-c567571c6acf"
    #penkki = "04d335b6-8f0c-480e-a941-33517bf438d8"
    jack = "6b9cf239-d1ec-4290-8bc7-f5ac51288dea" #on w.r.o:9000
    ent.mesh.SetMesh(jack) #"35da6174-8743-4026-a83e-18b23984120d"
    print "new mesh set:", ent.mesh
    
    print "sending prim data update to server"
    r.sendRexPrimData(ent.id) #arkku
    print "..done", ent.mesh
    
if 0: #property editor tests
    #print r.c
    #print r, dir(r)
    pe = r.getPropertyEditor()
    #print pe, pe.setObject, pe.show
    pe.setObject(r.c.widget)
    pe.show()
    
if 0: #getting args from outside to run tests automatically
    import os
    naaliargs = os.getenv('NAALIARGS')
    print naaliargs
Beispiel #15
0
 def applyMaterial(self, ent, matinfo, index):
     qprim = ent.prim
     mats = qprim.Materials
     mats[index] = matinfo
     qprim.Materials = mats
     r.sendRexPrimData(ent.id)
Beispiel #16
0
 def applyMaterial(self, ent, matinfo, index):
     qprim =ent.prim
     mats = qprim.Materials
     mats[index]  = matinfo
     qprim.Materials = mats
     r.sendRexPrimData(ent.id)
Beispiel #17
0
    print r.getCameraRight()

if 0:  #test changing the mesh asset a prim is using
    ent_id = 1659586053  #penkki, arkku was: 2461025163
    #print arkku_id, type(arkku_id)
    ent = r.getEntity(ent_id)
    print "Test entity:", ent
    print ent.mesh
    ent.mesh = 1  #should raise an exception
    ruukku = "681b1680-fab5-4203-83a7-c567571c6acf"
    penkki = "04d335b6-8f0c-480e-a941-33517bf438d8"
    ent.mesh = penkki  #"35da6174-8743-4026-a83e-18b23984120d"
    print "new mesh set:", ent.mesh

    print "sending prim data update to server"
    r.sendRexPrimData(ent.id)  #arkku
    print "..done", ent.mesh

if 0:  #testing vector3/quat wrapping
    #import PythonQt
    #print PythonQt.__dict__.has_key("Core::Vector3df")
    #Vector3 = PythonQt.__dict__["Core::Vector3df"]
    from PythonQt import *
    from editgui.conversions import *

    print "Creating Vectors:"
    vec = Vector3df(0, 0, 0)
    print "vec1 (%.1f, %.1f, %.1f)" % (vec.x(), vec.y(), vec.z())

    vec2 = Vector3df(1, 1, 1)
    print "vec2 (%.1f, %.1f, %.1f)" % (vec2.x(), vec2.y(), vec2.z())