def handle_entity_created(self, ent, changetype): # fun fact: since we are called for every entity and # self.finished checked only every "update" event, # this often cleans up >1 test objects (in case any # are left over from failed tests) if ent.Id==2525429102: r.logInfo("##### found entity I need") self.select_test_ent = ent try: ec_netp = ent.network except AttributeError: if 0: print "skip entity without EC_NetworkPosition", dir(ent) else: netp = ec_netp.Position # for some reason z coord ends up as 22.25 #r.logInfo("found entity with netpos %s %s %s" % (netp.x(), netp.y(), netp.z())) if netp.x() == 42.0 and netp.y() == 42.0 and int(netp.z()) == 22: r.logInfo("found created test prim - naming, moving and deleting (finished=%s)" % self.finished) ent.prim.Name = "Seppo" ent.prim.SendObjectNameUpdate() pos = ent.placeable.position pos.setX(netp.x() + 1) #change the x-coordinate ent.placeable.position = pos r.logInfo("Moving to move to pos: %s" % pos) r.getServerConnection().SendObjectDeRezPacket( ent.Id, r.getTrashFolderId()) self.finished = True
def handle_entity_created(self, ent, changetype): # fun fact: since we are called for every entity and # self.finished checked only every "update" event, # this often cleans up >1 test objects (in case any # are left over from failed tests) if ent.Id == 2525429102: r.logInfo("##### found entity I need") self.select_test_ent = ent try: ec_netp = ent.network except AttributeError: if 0: print "skip entity without EC_NetworkPosition", dir(ent) else: netp = ec_netp.Position # for some reason z coord ends up as 22.25 #r.logInfo("found entity with netpos %s %s %s" % (netp.x(), netp.y(), netp.z())) if netp.x() == 42.0 and netp.y() == 42.0 and int(netp.z()) == 22: r.logInfo( "found created test prim - naming, moving and deleting (finished=%s)" % self.finished) ent.prim.Name = "Seppo" ent.prim.SendObjectNameUpdate() pos = ent.placeable.position pos.setX(netp.x() + 1) #change the x-coordinate ent.placeable.position = pos r.logInfo("Moving to move to pos: %s" % pos) r.getServerConnection().SendObjectDeRezPacket( ent.Id, r.getTrashFolderId()) self.finished = True
def deleteObject(self): if self.active is not None: for ent in self.sels: #r.logInfo("deleting " + str(ent.id)) ent, children = self.parentalCheck(ent) for child_id in children: child = r.getEntity(int(child_id)) #~ self.worldstream.SendObjectDeRezPacket(child.id, r.getTrashFolderId()) #~ if len(children) == 0: self.worldstream.SendObjectDeRezPacket(ent.id, r.getTrashFolderId()) #~ else: #~ r.logInfo("trying to delete a parent, need to fix this!") self.manipulator.hideManipulator() #self.hideSelector() self.deselect_all() self.sels = []
def deleteObject(self): if self.active is not None: for ent in self.sels: #r.logInfo("deleting " + str(ent.id)) ent, children = self.parentalCheck(ent) for child_id in children: child = naali.getEntity(int(child_id)) #~ self.worldstream.SendObjectDeRezPacket(child.id, r.getTrashFolderId()) #~ if len(children) == 0: self.worldstream.SendObjectDeRezPacket(ent.id, r.getTrashFolderId()) #~ else: #~ r.logInfo("trying to delete a parent, need to fix this!") self.manipulator.hideManipulator() #self.hideSelector() self.deselect_all() self.sels = []
def handle_entity_created(self, ent, changetype): # fun fact: since we are called for every entity and # self.finished checked only every "update" event, # this often cleans up >1 test objects (in case any # are left over from failed tests) ent_id = ent.Id ent = naali.getEntity(ent.Id) try: p = ent.netpos.Position except AttributeError: if 0: print "skip unplaceable entity" else: if 0: print "placeable entity created: pos", p.x(), p.y(), p.z() # for some reason z coord ends up as 22.25 if p.x() == 42.0 and p.y() == 42.0 and int(p.z()) == 22: r.logInfo("found created test prim, deleting (finished=%s)" % self.finished) r.getServerConnection().SendObjectDeRezPacket( ent_id, r.getTrashFolderId()) self.finished = True
#~ max_ent.pos = pos[0] + max.x, pos[1] + max.y, pos[2] + max.z if 0: #login - for running tests automatically print "starting opensim login" #user, pwd, server = "Test User", "test", "localhost:9000" user, pwd, server = "d d", "d", "world.evocativi.com:8002" r.startLoginOpensim(user, pwd, server) if 0: #getserverconnection test #print dir(r) #print "YO", r.getTrashFolderId() #r.deleteObject(2351241440) worldstream = r.getServerConnection() #print worldstream, dir(worldstream), worldstream.SendObjectDeRezPacket worldstream.SendObjectDeRezPacket(2891301779, r.getTrashFolderId()) #ent = r.getEntity(r.getUserAvatarId()) #worldstream.SendObjectDeletePacket(1278500474, True) #~ ent = r.getEntity(2208825114) #~ print ent if 0: #getrexlogic test l = r.getRexLogic() print l, dir(l) #class entity_id_t(int): pass #entid = entity_id_t(2) #l.SendRexPrimData(entid) if 0: #rexlogic as service with qt mechanism #from __main__ import _naali #l = _naali.GetWorldLogic()
#~ max_ent.pos = pos[0] + max.x, pos[1] + max.y, pos[2] + max.z if 0: #login - for running tests automatically print "starting opensim login" #user, pwd, server = "Test User", "test", "localhost:9000" user, pwd, server = "d d", "d", "world.evocativi.com:8002" r.startLoginOpensim(user, pwd, server) if 0: #getserver test #print dir(r) #print "YO", r.getTrashFolderId() #r.deleteObject(2351241440) worldstream = r.getServerConnection() #print worldstream, dir(worldstream), worldstream.SendObjectDeRezPacket worldstream.SendObjectDeRezPacket(2891301779, r.getTrashFolderId()) #ent = r.getEntity(r.getUserAvatarId()) #worldstream.SendObjectDeletePacket(1278500474, True) #~ ent = r.getEntity(2208825114) #~ print ent if 0: #undo tests e = r.getEntity(1752805599) print e.prim, e.uuid e_uuid = "d81432f2-28f3-4e05-ac8a-abb4b625dbe4-" worldstream = r.getServerConnection() #print worldstream, dir(worldstream), worldstream.SendObjectDeRezPacket worldstream.SendObjectUndoPacket(e.uuid) if 0: #undo tests and ent.uuid e = r.getEntity(1752805599)