def doDelete(self): """ Delete all selected objects from the simulator. """ selected = editor.getSelected() if selected: for obj in selected: if obj.opensim.uuid: self.simrt.Delete(obj.opensim.uuid)
def doDeRezObject(self): """ DeRez all active objects into inventory. """ selected = editor.getSelected() if selected: for obj in selected: if obj.opensim.uuid: editor.set_loading_state(obj, 'TAKING') self.simrt.DeRezObject(obj.opensim.uuid)
def checkObjects(self): """ Check objects during operator process. This is the main place to perform checks on objects to see if we have to send any updates. Note at the moment also processUpdate performs some checks. """ selected = set(editor.getSelected()) all_selected = set() # look for changes in objects for obj in selected: obj_id = self.get_uuid(obj) if obj_id in self.selected and obj.as_pointer() == self.selected[obj_id].pointer: if obj.name != obj.opensim.name: if not obj.name.startswith('opensim') and not obj.name.startswith(obj.opensim.name): print("Sending New Name", obj.name, obj.opensim.name) self.simrt.SetName(obj_id, obj.name) obj.opensim.name = obj.name print(obj.opensim.name)
def checkObjects(self): """ Check objects during operator process. This is the main place to perform checks on objects to see if we have to send any updates. Note at the moment also processUpdate performs some checks. """ selected = set(editor.getSelected()) all_selected = set() # look for changes in objects for obj in selected: obj_id = self.get_uuid(obj) if obj_id in self.selected and obj.as_pointer( ) == self.selected[obj_id].pointer: if obj.name != obj.opensim.name: if not obj.name.startswith( 'opensim') and not obj.name.startswith( obj.opensim.name): print("Sending New Name", obj.name, obj.opensim.name) self.simrt.SetName(obj_id, obj.name) obj.opensim.name = obj.name print(obj.opensim.name)
def processUpdates(self): """ Process all pending updates up to the configured time budget. """ starttime = time.time() self._last_time = time.time() framebudget = float(self.exportSettings.rt_budget)/1000.0 try: self.pool.poll() except NoResultsPending: pass try: self.workpool.poll() except NoResultsPending: pass props = self.exportSettings if props.kbytesPerSecond*1024 != self._lastthrottle: self.simrt.Throttle(props.kbytesPerSecond*1024) # check consistency self.checkUuidConsistency(set(editor.getSelected())) # per second checks if time.time() - self.second_start > 1: self.checkPool() self.second_budget = 0 self.second_start = time.time() for check_cb in self._module_cb["check"]: check_cb(starttime, framebudget) self.checkObjects() # process command queue if time.time() - starttime < framebudget: self.processCommandQueue(starttime, framebudget) # redraw if we have commands left if len(self.command_queue): self.queueRedraw()
def processUpdates(self): """ Process all pending updates up to the configured time budget. """ starttime = time.time() self._last_time = time.time() framebudget = float(self.exportSettings.rt_budget) / 1000.0 try: self.pool.poll() except NoResultsPending: pass try: self.workpool.poll() except NoResultsPending: pass props = self.exportSettings if props.kbytesPerSecond * 1024 != self._lastthrottle: self.simrt.Throttle(props.kbytesPerSecond * 1024) # check consistency self.checkUuidConsistency(set(editor.getSelected())) # per second checks if time.time() - self.second_start > 1: self.checkPool() self.second_budget = 0 self.second_start = time.time() for check_cb in self._module_cb["check"]: check_cb(starttime, framebudget) self.checkObjects() # process command queue if time.time() - starttime < framebudget: self.processCommandQueue(starttime, framebudget) # redraw if we have commands left if len(self.command_queue): self.queueRedraw()
def processView(self): """ Process any needed updates from the view. """ self.stats[9] += 1 selected = set(editor.getSelected()) all_selected = set() # changes in our own avatar agent = self.findWithUUID(self.agent_id) if agent: self.processUpdate(agent) # look for changes in objects for obj in selected: obj_id = self.get_uuid(obj) if obj_id in self.selected and obj.as_pointer() == self.selected[obj_id].pointer: self.processUpdate(obj) all_selected.add(obj_id) # update selection if not all_selected == self.sim_selection: self.simrt.Select(*all_selected) self.sim_selection = all_selected
def processView(self): """ Process any needed updates from the view. """ self.stats[9] += 1 selected = set(editor.getSelected()) all_selected = set() # changes in our own avatar agent = self.findWithUUID(self.agent_id) if agent: self.processUpdate(agent) # look for changes in objects for obj in selected: obj_id = self.get_uuid(obj) if obj_id in self.selected and obj.as_pointer( ) == self.selected[obj_id].pointer: self.processUpdate(obj) all_selected.add(obj_id) # update selection if not all_selected == self.sim_selection: self.simrt.Select(*all_selected) self.sim_selection = all_selected
def getSelected(self): """ Get the selected objects, possibly proxyed into editor objects. """ return editor.getSelected()