Esempio n. 1
0
 def on_exit(self):
     r.logInfo("EstateManagement exiting...")
     self.rexlogic.disconnect("OnIncomingEstateOwnerMessage(QVariantList)",
                              self.onEstateOwnerMessage)
     self.uievents.isrunning = False
     self.window.on_exit()
     r.logInfo("EstateManagement done exiting...")
Esempio n. 2
0
    def __init__(self):
        Component.__init__(self)
        #loader = QUiLoader() 
        uism = r.getUiSceneManager() #self.canvas = r.createCanvas(EXTERNAL)

        #group = QGroupBox()
        #box = QVBoxLayout(group)
        #button = QPushButton(group)
        #box.addWidget(button)
        #group.show()
        #self.canvas.AddWidget(group)

        lineedit = QLineEdit()
        self.widget = lineedit
        #lineedit.show()
        #uiprops = UiWidgetProperties("PythonQt Test")
        #uism.AddWidgetToScene(lineedit) #uiprops) #self.canvas.AddWidget(lineedit)

        uism = r.getUiSceneManager()
        uiprops = r.createUiWidgetProperty()
        uiprops.widget_name_ = "Test Widget"
        #uiprops.my_size_ = QSize(width, height)
        #self.proxywidget = uism.AddWidgetToScene(ui, uiprops)
        self.proxywidget = r.createUiProxyWidget(self.widget, uiprops)
        ##print widget, dir(widget)
        if not uism.AddProxyWidget(self.proxywidget):
            print "Adding the ProxyWidget to the bar failed."

        #self.canvas.Show()

        #QInputDialog.getText(None, "Mesh asset UUID", "Please give mesh asset UUID", QLineEdit.Normal, "")

        lineedit.connect('textChanged(QString)', self.changed)

        r.logInfo("TestGui inited.")
Esempio n. 3
0
    def __init__(self):
        Component.__init__(self)
        self.worldstream = None
        #self.worldstream = r.getServerConnection()
        self.queue = Queue.Queue()
        self.window = EstateManagementWindow(self, self.queue)
        self.uievents = UIEventManagement(self.window) 
        self.rexlogic = r.getRexLogic()
        self.appdatafolder = ""
        try:
            self.appdatafolder = r.getApplicationDataDirectory()
        except:
            r.logInfo("Unexpected error:", sys.exc_info()[0])

        self.rexlogic.connect("OnIncomingEstateOwnerMessage(QVariantList)", self.onEstateOwnerMessage)
        self.ents = []
        self.managers = {}
        self.banned = {}
        self.accesslist = {}
        self.publicestate = True
        self.nameToUuidMapCache = {}
        self.savedusers = {}
        
        #self.estatesettings = EstateSettings(self.worldstream, self)
        self.estatesettings = None
Esempio n. 4
0
    def __init__(self, uistring, queue, endApplication, controller):
        self.controller = controller
        loader = QUiLoader()
        uifile = QFile(uistring)
        ui = loader.load(uifile)
        self.gui = ui
        width = ui.size.width()
        height = ui.size.height()
        
        uism = r.getUiSceneManager()
        
        # uiprops = r.createUiWidgetProperty(1) #1 is ModuleWidget, shown at toolbar
        # uiprops.SetMenuGroup(2) #2 is server tools group
        # uiprops.widget_name_ = "Local Scene"
        
        #uiprops.my_size_ = QSize(width, height) #not needed anymore, uimodule reads it
        #self.proxywidget = r.createUiProxyWidget(ui, uiprops)
        
        self.proxywidget = r.createUiProxyWidget(ui)

        #if not uism.AddProxyWidget(self.proxywidget):
        if not uism.AddWidgetToScene(self.proxywidget):
            r.logInfo("Adding the ProxyWidget to the bar failed.")

        uism.AddWidgetToMenu(self.proxywidget, "Local Scene", "Server Tools", "./data/ui/images/menus/edbutton_LSCENE_normal.png")
            
        self.inputQueue = queue
        self.endApplication = endApplication
        
        self.tableitems = []
        
        pass
Esempio n. 5
0
File: edit.py Progetto: Ilikia/naali
 def on_logout(self, id):
     r.logInfo("Object Edit resetting due to logout")
     self.deselect_all()
     self.sels = []
     self.selection_box = None
     self.resetValues()
     self.resetManipulators()
Esempio n. 6
0
 def handleEstateUpdateMessage(self, args):    
     agentid, sessionid, transactionid, method, invoice, paramlist = args
     len = paramlist.__len__()
     if(len!=10):
         r.logInfo('malformed estateupdateinfo')
         return
     self.queue.put(('EstateUpdate', paramlist))
Esempio n. 7
0
 def remove_highlight(self, ent):
     try:
         h = ent.highlight
     except AttributeError:
         r.logInfo("objectedit.remove_highlight called for a non-hilited entity: %d" % ent.id)
     else:
         h.Hide()        
Esempio n. 8
0
    def __init__(self):
        Component.__init__(self)
        #loader = QUiLoader() 
        uism = r.getUiSceneManager() #self.canvas = r.createCanvas(EXTERNAL)

        #group = QGroupBox()
        #box = QVBoxLayout(group)
        #button = QPushButton(group)
        #box.addWidget(button)
        #group.show()
        #self.canvas.AddWidget(group)

        lineedit = QLineEdit()
        self.widget = lineedit
        #lineedit.show()
        #uiprops = UiWidgetProperties("PythonQt Test")
        #uism.AddWidgetToScene(lineedit) #uiprops) #self.canvas.AddWidget(lineedit)

        uism = r.getUiSceneManager()
        uiprops = r.createUiWidgetProperty()
        uiprops.widget_name_ = "Test Widget"
        #uiprops.my_size_ = QSize(width, height)
        #self.proxywidget = uism.AddWidgetToScene(ui, uiprops)
        self.proxywidget = r.createUiProxyWidget(self.widget, uiprops)
        ##print widget, dir(widget)
        if not uism.AddProxyWidget(self.proxywidget):
            print "Adding the ProxyWidget to the bar failed."

        #self.canvas.Show()

        #QInputDialog.getText(None, "Mesh asset UUID", "Please give mesh asset UUID", QLineEdit.Normal, "")

        lineedit.connect('textChanged(QString)', self.changed)

        r.logInfo("TestGui inited.")
Esempio n. 9
0
    def on_exit(self):
        r.logInfo("Object Edit exiting..")
        # remove selection box component and entity
        # - no need its a temporary item
        #if self.selection_box_entity is not None and self.selection_box is not None:
        #    self.selection_box_entity.RemoveComponentRaw(self.selection_box)
        #    naali.removeEntity(self.selection_box_entity)
        # Connect to key pressed signal from input context
        self.edit_inputcontext.disconnectAll()
        self.deselect_all()
        """
        # Disconnect cpp python handler
        self.cpp_python_handler.disconnect('ActivateEditing(bool)', self.on_activate_editing)
        self.cpp_python_handler.disconnect('ManipulationMode(int)', self.on_manupulation_mode_change)
        self.cpp_python_handler.disconnect('RemoveHightlight()', self.deselect_all)
        self.cpp_python_handler.disconnect('RotateValuesToNetwork(int, int, int)', self.changerot_cpp)
        self.cpp_python_handler.disconnect('ScaleValuesToNetwork(double, double, double)', self.changescale_cpp)
        self.cpp_python_handler.disconnect('PosValuesToNetwork(double, double, double)', self.changepos_cpp)
        self.cpp_python_handler.disconnect('CreateObject()', self.createObject)
        self.cpp_python_handler.disconnect('DuplicateObject()', self.duplicate)
        self.cpp_python_handler.disconnect('DeleteObject()', self.deleteObject)
        # Clean widgets
        self.cpp_python_handler.CleanPyWidgets()
        """

        r.logInfo(".. done")
Esempio n. 10
0
    def on_mouseleftreleased(self, mouseinfo):
        self.left_button_down = False
        if self.active:  #XXX something here?
            if self.sel_activated and self.dragging:
                for ent in self.sels:
                    #~ print "LeftMouseReleased, networkUpdate call"
                    parent, children = self.parentalCheck(ent)
                    r.networkUpdate(ent.id)
                    for child in children:
                        child_id = int(child)
                        r.networkUpdate(child_id)

            self.sel_activated = True

        if self.dragging:
            self.dragging = False

        self.manipulator.stopManipulating()
        self.manipulator.showManipulator(self.sels)
        self.usingManipulator = False

        if self.selection_rect_startpos is not None:
            self.selection_rect.hide()

            rectx, recty, rectwidth, rectheight = self.selectionRectDimensions(
                mouseinfo)
            if rectwidth != 0 and rectheight != 0:
                r.logInfo("The selection rect was at: (" + str(rectx) + ", " +
                          str(recty) + ") and size was: (" + str(rectwidth) +
                          ", " + str(rectheight) + ")")
                self.selection_rect.setGeometry(0, 0, 0, 0)

            self.selection_rect_startpos = None
Esempio n. 11
0
    def LeftMouseReleased(self, mouseinfo):
        self.left_button_down = False
        if self.active: #XXX something here?
            if self.sel_activated and self.dragging:
                for ent in self.sels:
                    #~ print "LeftMouseReleased, networkUpdate call"
                    parent, children = self.parentalCheck(ent)
                    r.networkUpdate(ent.id)
                    for child in children:
                        child_id = int(child)
                        r.networkUpdate(child_id)
            
            self.sel_activated = True
        
        if self.dragging:
            self.dragging = False
            
        self.manipulator.stopManipulating()
        self.duplicateDragStart = False #XXXchange?
        
        if self.selection_rect_startpos is not None:
            self.selection_rect.hide()

            rectx, recty, rectwidth, rectheight = self.selectionRectDimensions(mouseinfo)
            if rectwidth != 0 and rectheight != 0:
                r.logInfo("The selection rect was at: (" +str(rectx) + ", " +str(recty) + ") and size was: (" +str(rectwidth) +", "+str(rectheight)+")") 
                self.selection_rect.setGeometry(0,0,0,0)
            
            self.selection_rect_startpos = None
Esempio n. 12
0
 def on_exit(self):
     r.logInfo("Object Edit exiting..")
     # Connect to key pressed signal from input context
     self.edit_inputcontext.disconnectAll()
     self.deselect_all()
     # Disconnect cpp python handler
     self.cpp_python_handler.disconnect('ActivateEditing(bool)',
                                        self.on_activate_editing)
     self.cpp_python_handler.disconnect('ManipulationMode(int)',
                                        self.on_manupulation_mode_change)
     self.cpp_python_handler.disconnect('RemoveHightlight()',
                                        self.deselect_all)
     self.cpp_python_handler.disconnect(
         'RotateValuesToNetwork(int, int, int)', self.changerot_cpp)
     self.cpp_python_handler.disconnect(
         'ScaleValuesToNetwork(double, double, double)',
         self.changescale_cpp)
     self.cpp_python_handler.disconnect(
         'PosValuesToNetwork(double, double, double)', self.changepos_cpp)
     self.cpp_python_handler.disconnect('CreateObject()', self.createObject)
     self.cpp_python_handler.disconnect('DuplicateObject()', self.duplicate)
     self.cpp_python_handler.disconnect('DeleteObject()', self.deleteObject)
     # Clean widgets
     self.cpp_python_handler.CleanPyWidgets()
     r.logInfo(".. done")
Esempio n. 13
0
File: window.py Progetto: A-K/naali
    def __init__(self, uistring, queue, endApplication, controller):
        self.controller = controller
        loader = QUiLoader()
        uifile = QFile(uistring)
        ui = loader.load(uifile)
        self.gui = ui
        width = ui.size.width()
        height = ui.size.height()

        uism = naali.ui

        # uiprops = r.createUiWidgetProperty(1) #1 is ModuleWidget, shown at toolbar
        # uiprops.SetMenuGroup(2) #2 is server tools group
        # uiprops.widget_name_ = "Local Scene"

        #uiprops.my_size_ = QSize(width, height) #not needed anymore, uimodule reads it
        #self.proxywidget = r.createUiProxyWidget(ui, uiprops)

        self.proxywidget = r.createUiProxyWidget(ui)

        #if not uism.AddProxyWidget(self.proxywidget):
        if not uism.AddWidgetToScene(self.proxywidget):
            r.logInfo("Adding the ProxyWidget to the bar failed.")

        # TODO: Due to core UI API refactor AddWidgetToMenu doesn't exist anymore.
        #uism.AddWidgetToMenu(self.proxywidget, "Local Scene", "Server Tools", "./data/ui/images/menus/edbutton_LSCENE_normal.png")

        self.inputQueue = queue
        self.endApplication = endApplication

        self.tableitems = []

        pass
Esempio n. 14
0
    def on_exit(self):
        r.logInfo("Object Edit exiting...")

        self.deselect_all()
        self.window.on_exit()

        r.logInfo("         ...exit done.")
Esempio n. 15
0
 def exit(self):
     r.logInfo("Circuits manager stopping...")
     self.m.send(
         Exit(), "on_exit"
     )  #am not running the manager properly so the stop doesn't propagate to components. fix when switch to dev branch of circuits XXX
     self.m.stop(
     )  #was not going to components now so made the exit event above as a quick fix
Esempio n. 16
0
File: edit.py Progetto: Ilikia/naali
 def on_exit(self):
     r.logInfo("Object Edit exiting..")
     # remove selection box component and entity
     # - no need its a temporary item
     #if self.selection_box_entity is not None and self.selection_box is not None:
     #    self.selection_box_entity.RemoveComponentRaw(self.selection_box)
     #    naali.removeEntity(self.selection_box_entity)
     # Connect to key pressed signal from input context
     self.edit_inputcontext.disconnectAll()
     self.deselect_all()
     
     """
     # Disconnect cpp python handler
     self.cpp_python_handler.disconnect('ActivateEditing(bool)', self.on_activate_editing)
     self.cpp_python_handler.disconnect('ManipulationMode(int)', self.on_manupulation_mode_change)
     self.cpp_python_handler.disconnect('RemoveHightlight()', self.deselect_all)
     self.cpp_python_handler.disconnect('RotateValuesToNetwork(int, int, int)', self.changerot_cpp)
     self.cpp_python_handler.disconnect('ScaleValuesToNetwork(double, double, double)', self.changescale_cpp)
     self.cpp_python_handler.disconnect('PosValuesToNetwork(double, double, double)', self.changepos_cpp)
     self.cpp_python_handler.disconnect('CreateObject()', self.createObject)
     self.cpp_python_handler.disconnect('DuplicateObject()', self.duplicate)
     self.cpp_python_handler.disconnect('DeleteObject()', self.deleteObject)
     # Clean widgets
     self.cpp_python_handler.CleanPyWidgets()
     """
     
     r.logInfo(".. done")
Esempio n. 17
0
    def on_exit(self):
        r.logInfo("Object Edit exiting...")

        self.deselect_all()
        self.window.on_exit()  

        r.logInfo("         ...exit done.")
Esempio n. 18
0
 def on_logout(self, id):
     r.logInfo("Object Edit resetting due to logout")
     self.deselect_all()
     self.sels = []
     self.selection_box = None
     self.resetValues()
     self.resetManipulators()
Esempio n. 19
0
 def removeSoundRuler(self, ent):
     if ent.prim and ent.prim.SoundID and ent.prim.SoundID not in (u'', '00000000-0000-0000-0000-000000000000'):
         try:
             sr = ent.soundruler
         except AttributeError:
             r.logInfo("objectedit.removeSoundRuler called for an object without one: %d" % ent.id)
         else:
             sr.Hide()
Esempio n. 20
0
 def create_playback_widget(self):
     if len(self.type) > 0 and naali.mediaplayerservice is not None:
         if naali.mediaplayerservice.IsMimeTypeSupported(self.type):
             self.playback_widget = naali.mediaplayerservice.GetPlayerWidget(str(self.__url))
             self.__media_player_service_used = True
             r.logInfo("Media content supported for video playback: " + str(self.__url))
             return
     self.playback_widget = PythonQt.QtWebKit.QWebView()
Esempio n. 21
0
    def sceneadded(self, name):
        #r.logInfo("CreateDestroy sceneadded called")
        self.scene = naali.getScene(name)

        self.scene.connect(
            "EntityCreated(Scene::Entity*, AttributeChange::Type)",
            self.handle_entity_created)
        r.logInfo("EntityCreated callback registered")
Esempio n. 22
0
    def on_exit(self):
        r.logInfo("TestGui starting exit...")
        
        #qtmod = r.getQtModule()
        #qtmod.DeleteCanvas(self.canvas)

        uism = naali.ui
        uism.RemoveProxyWidgetFromScene(self.proxywidget)
        r.logInfo("TestGui proxywidget removed from scene.")
Esempio n. 23
0
    def on_exit(self):
        r.logInfo("TestGui starting exit...")

        #qtmod = r.getQtModule()
        #qtmod.DeleteCanvas(self.canvas)

        uism = naali.ui
        uism.RemoveProxyWidgetFromScene(self.proxywidget)
        r.logInfo("TestGui proxywidget removed from scene.")
Esempio n. 24
0
 def write(self, msg):
     self.buf += msg
     while '\n' in self.buf:
         line, self.buf = self.buf.split("\n", 1)
         try:
             r.logInfo(line)
         except ValueError:
             pass #somehow this isn't a string always
             r.logInfo("logging prob from py print: is not a string? " + str(type(line)))
Esempio n. 25
0
 def remove_highlight(self, ent):
     try:
         h = ent.highlight
     except AttributeError:
         r.logInfo(
             "objectedit.remove_highlight called for a non-hilited entity: %d"
             % ent.id)
     else:
         h.Hide()
Esempio n. 26
0
File: edit.py Progetto: Ilikia/naali
 def remove_highlight(self, ent):
     try:
         h = ent.highlight
     except AttributeError:
         try:
             r.logInfo("objectedit.remove_highlight called for a non-hilighted entity: %d" % ent.id)
         except ValueError:
             r.logInfo("objectedit.remove_highlight called, but entity already removed")
     else:
         ent.RemoveComponentRaw(h)
Esempio n. 27
0
File: edit.py Progetto: Ilikia/naali
 def remove_selected(self, ent):
     try:
         s = ent.selected
     except:
         try:
             r.logInfo("objectedit.remove_selected called for a non-selected entity: %d" % ent.id)
         except ValueError:
             r.logInfo("objectedit.remove_selected called, but entity already removed")
     else:
         ent.RemoveComponentRaw(s)
Esempio n. 28
0
 def create_playback_widget(self):
     if len(self.type) > 0 and naali.mediaplayerservice is not None:
         if naali.mediaplayerservice.IsMimeTypeSupported(self.type):
             self.playback_widget = naali.mediaplayerservice.GetPlayerWidget(
                 str(self.__url))
             self.__media_player_service_used = True
             r.logInfo("Media content supported for video playback: " +
                       str(self.__url))
             return
     self.playback_widget = PythonQt.QtWebKit.QWebView()
Esempio n. 29
0
    def update(self, deltatime):
        prev = None
        try:
            status = self.testgen.next()
        except StopIteration:
            # print "Test finished"
            return 

        if status:
            r.logInfo("Test state: " + str(status))
            prev = status
Esempio n. 30
0
 def removeSoundRuler(self, ent):
     if ent.prim and ent.prim.SoundID and ent.prim.SoundID not in (
             u'', '00000000-0000-0000-0000-000000000000'):
         try:
             sr = ent.soundruler
         except AttributeError:
             r.logInfo(
                 "objectedit.removeSoundRuler called for an object without one: %d"
                 % ent.id)
         else:
             sr.Hide()
Esempio n. 31
0
 def removeSoundRuler(self, ent):
     try:
         if ent.prim and ent.prim.SoundID and ent.prim.SoundID not in (u'', '00000000-0000-0000-0000-000000000000'):
             try:
                 sr = ent.soundruler
             except AttributeError:
                 r.logInfo("objectedit.removeSoundRuler called for an object without one: %d" % ent.id)
             else:
                 ent.RemoveComponentRaw(sr)
     except AttributeError:
         r.logInfo("objectedit.removeSoundRuler: entity already removed. Prim doesn't exist anymore")
Esempio n. 32
0
 def parseCapsUrl(self, cap_url):
     r.logInfo(cap_url)
     url_split = cap_url.split(':')
     if(url_split.__len__<3):
         r.logInfo("mallformed cap url for scene upload")
         return False
     surl = url_split[1]
     self.host = surl.split('/')[2]
     port_path = url_split[2]
     self.port = int(port_path.split('/')[0])
     self.path = "/".join(port_path.split('/')[1:])
     return True
Esempio n. 33
0
 def parseCapsUrl(self, cap_url):
     r.logInfo(cap_url)
     url_split = cap_url.split(':')
     if (url_split.__len__ < 3):
         r.logInfo("mallformed cap url for scene upload")
         return False
     surl = url_split[1]
     self.host = surl.split('/')[2]
     port_path = url_split[2]
     self.port = int(port_path.split('/')[0])
     self.path = "/".join(port_path.split('/')[1:])
     return True
Esempio n. 34
0
File: edit.py Progetto: Ilikia/naali
    def highlight(self, ent):
        try:
            ent.highlight
        except AttributeError:
            ent.GetOrCreateComponentRaw("EC_Highlight")

        h = ent.highlight
    
        if not h.IsVisible():
            h.Show()
        else:
            r.logInfo("objectedit.highlight called for an already hilited entity: %d" % ent.id)
Esempio n. 35
0
def read_inis():
    thisdir = os.path.split(os.path.abspath(__file__))[0]
    for inifile in glob(os.path.join(thisdir, "*.ini")):
        cp = ConfigParser()
        cp.read([inifile])
        for s in cp.sections():
            cfdict = dict(cp.items(s))
            try:
                modname, compname = s.rsplit('.', 1)
            except ValueError:
                r.logInfo("bad config section in " + inifile + ": " + s)
                continue

            yield modname, compname, cfdict
Esempio n. 36
0
def read_inis():
    thisdir = os.path.split(os.path.abspath(__file__))[0]
    for inifile in glob(os.path.join(thisdir, "*.ini")):
        cp = ConfigParser()
        cp.read([inifile])
        for s in cp.sections():
            cfdict = dict(cp.items(s))
            try:
                modname, compname = s.rsplit('.', 1)
            except ValueError:
                r.logInfo("bad config section in " + inifile + ": " + s)
                continue

            yield modname, compname, cfdict
Esempio n. 37
0
 def remove_selected(self, ent):
     try:
         s = ent.selected
     except:
         try:
             r.logInfo(
                 "objectedit.remove_selected called for a non-selected entity: %d"
                 % ent.id)
         except ValueError:
             r.logInfo(
                 "objectedit.remove_selected called, but entity already removed"
             )
     else:
         ent.RemoveComponentRaw(s)
Esempio n. 38
0
 def remove_highlight(self, ent):
     try:
         h = ent.highlight
     except AttributeError:
         try:
             r.logInfo(
                 "objectedit.remove_highlight called for a non-hilighted entity: %d"
                 % ent.id)
         except ValueError:
             r.logInfo(
                 "objectedit.remove_highlight called, but entity already removed"
             )
     else:
         ent.RemoveComponentRaw(h)
Esempio n. 39
0
 def on_exit(self):
     try:
         # end incoming loop
         self.controller.isrunning = 0
         
         self.proxywidget.hide()
         uism = r.getUiSceneManager()
         uism.RemoveWidgetFromMenu(self.proxywidget)
         uism.RemoveWidgetFromScene(self.proxywidget)
         return True
     except:
         r.logInfo("Estate Window failure:")
         traceback.print_exc()
         return False
Esempio n. 40
0
    def highlight(self, ent):
        try:
            ent.highlight
        except AttributeError:
            ent.GetOrCreateComponentRaw("EC_Highlight")

        h = ent.highlight

        if not h.IsVisible():
            h.Show()
        else:
            r.logInfo(
                "objectedit.highlight called for an already hilited entity: %d"
                % ent.id)
Esempio n. 41
0
    def highlight(self, ent):
        try:
            ent.highlight
        except AttributeError:
            ent.createComponent("EC_Highlight")
            #print "created a new Highlight component"

        h = ent.highlight
        #print type(h), h
    
        if not h.IsVisible():
            h.Show()
        else:
            r.logInfo("objectedit.highlight called for an already hilited entity: %d" % ent.id)
Esempio n. 42
0
 def safeCopy(self, srcPath, dstPath, fname, olList):
     # check if file exists
     if (os.access(dstPath, os.F_OK)):
         #r.logInfo("File allready exists:")
         #r.logInfo(dstPath)
         olList.append(fname)
     else:
         #print "Copying ", srcPath, " to ", dstPath
         if (os.access(srcPath, os.F_OK)):
             shutil.copyfile(srcPath, dstPath)
         else:
             r.logInfo("File defined does not exist:")
             r.logInfo(fname)
             olList.append(fname)  # not removed when unloading
Esempio n. 43
0
 def safeCopy(self, srcPath, dstPath, fname, olList):
     # check if file exists
     if os.access(dstPath, os.F_OK):
         # r.logInfo("File allready exists:")
         # r.logInfo(dstPath)
         olList.append(fname)
     else:
         # print "Copying ", srcPath, " to ", dstPath
         if os.access(srcPath, os.F_OK):
             shutil.copyfile(srcPath, dstPath)
         else:
             r.logInfo("File defined does not exist:")
             r.logInfo(fname)
             olList.append(fname)  # not removed when unloading
Esempio n. 44
0
    def on_exit(self):
        try:
            # end incoming loop
            self.controller.isrunning = 0

            self.proxywidget.hide()
            uism = r.getUiSceneManager()
            uism.RemoveWidgetFromMenu(self.proxywidget)
            uism.RemoveWidgetFromScene(self.proxywidget)
            return True
        except:
            r.logInfo("Estate Window failure:")
            traceback.print_exc()
            return False
Esempio n. 45
0
    def on_exit(self):
        try:
            # end incoming loop
            self.controller.isrunning = 0

            self.proxywidget.hide()
            uism = naali.ui
            # TODO: Due to core UI API refactor RemoveWidgetFromMenu doesn't exist anymore.
            # uism.RemoveWidgetFromMenu(self.proxywidget)
            uism.RemoveWidgetFromScene(self.proxywidget)
            return True
        except:
            r.logInfo("Estate Window failure:")
            traceback.print_exc()
            return False
Esempio n. 46
0
    def on_exit(self):
        try:
            # end incoming loop
            self.endmethod()
            self.queue.put('__end__', 'none')

            self.proxywidget.hide()
            uism = r.getUiSceneManager()
            uism.RemoveWidgetFromMenu(self.proxywidget)
            uism.RemoveWidgetFromScene(self.proxywidget)
            return True
        except:
            r.logInfo("LocalSceneWindow failure:")
            traceback.print_exc()
            return False
Esempio n. 47
0
def load(circuitsmanager):
    for klass, cfg in modules:
        #~ modinst = klass()
        #~ circuitsmanager += modinst
        #print klass
        try:
            if cfg:
                modinst = klass(cfsection=cfg)
            else:
                modinst = klass()
        except Exception, exc:
            r.logInfo("failed to instantiate pymodule %s" % klass)
            r.logInfo(traceback.format_exc())
        else:
            circuitsmanager += modinst # Equivalent to: tm.register(m)
Esempio n. 48
0
    def on_exit(self):
        try:
            # end incoming loop
            self.controller.isrunning = 0

            self.proxywidget.hide()
            uism = naali.ui
            # TODO: Due to core UI API refactor RemoveWidgetFromMenu doesn't exist anymore.
            #uism.RemoveWidgetFromMenu(self.proxywidget)
            uism.RemoveWidgetFromScene(self.proxywidget)
            return True
        except:
            r.logInfo("Estate Window failure:")
            traceback.print_exc()
            return False
Esempio n. 49
0
def load(circuitsmanager):
    for klass, cfg in modules:
        #~ modinst = klass()
        #~ circuitsmanager += modinst
        #print klass
        try:
            if cfg:
                modinst = klass(cfsection=cfg)
            else:
                modinst = klass()
        except Exception, exc:
            r.logInfo("failed to instantiate pymodule %s" % klass)
            r.logInfo(traceback.format_exc())
        else:
            circuitsmanager += modinst  # Equivalent to: tm.register(m)
Esempio n. 50
0
 def on_exit(self):
     try:
         # end incoming loop
         self.endmethod()
         self.queue.put('__end__', 'none')
         
         self.proxywidget.hide()
         uism = r.getUiSceneManager()
         uism.RemoveWidgetFromMenu(self.proxywidget)
         uism.RemoveWidgetFromScene(self.proxywidget)
         return True
     except:
         r.logInfo("LocalSceneWindow failure:")
         traceback.print_exc()
         return False
Esempio n. 51
0
    def highlight(self, ent):
        try:
            ent.highlight
        except AttributeError:
            ent.createComponent("EC_Highlight")
            #print "created a new Highlight component"

        h = ent.highlight
        #print type(h), h

        if not h.IsVisible():
            h.Show()
        else:
            r.logInfo(
                "objectedit.highlight called for an already hilited entity: %d"
                % ent.id)
Esempio n. 52
0
 def removeSoundRuler(self, ent):
     try:
         if ent.prim and ent.prim.SoundID and ent.prim.SoundID not in (
                 u'', '00000000-0000-0000-0000-000000000000'):
             try:
                 sr = ent.soundruler
             except AttributeError:
                 r.logInfo(
                     "objectedit.removeSoundRuler called for an object without one: %d"
                     % ent.id)
             else:
                 ent.RemoveComponentRaw(sr)
     except AttributeError:
         r.logInfo(
             "objectedit.removeSoundRuler: entity already removed. Prim doesn't exist anymore"
         )
Esempio n. 53
0
File: window.py Progetto: A-K/naali
 def processIncoming(self):
     """ for receiving input message events from other threads """
     while(self.inputQueue.qsize()):
         try:
             title, msg = self.inputQueue.get(0)
             if(title=="__end__"):
                 self.controller.isrunning = 0
                 return
             if(title=="__unload__"):
                 self.controller.unloadScene()
                 return
             self.displayMessage(title, msg)
         except Queue.Empty:
             pass
         except:
             r.logInfo("Exception in processIncoming, LocalScene window")
Esempio n. 54
0
    def on_exit(self):
        try:
            # end incoming loop
            self.endmethod()
            self.queue.put("__end__", "none")

            self.proxywidget.hide()
            uism = naali.ui
            # TODO: Due to core UI API refactor RemoveWidgetFromMenu doesn't exist anymore.
            # uism.RemoveWidgetFromMenu(self.proxywidget)
            uism.RemoveWidgetFromScene(self.proxywidget)
            return True
        except:
            r.logInfo("LocalSceneWindow failure:")
            traceback.print_exc()
            return False
Esempio n. 55
0
    def deselect_all(self):
        if len(self.sels) > 0:
            for ent in self.sels:
                self.remove_highlight(ent)
                self.removeSoundRuler(ent)
                try:
                    self.worldstream.SendObjectDeselectPacket(ent.id)
                except ValueError:
                    r.logInfo("objectedit.deselect_all: entity doesn't exist anymore")
            self.sels = []
           
            self.hideManipulator()

            self.prev_mouse_abs_x = 0
            self.prev_mouse_abs_y = 0
            self.canmove = False
            self.window.deselected()
Esempio n. 56
0
 def on_exit(self):
     r.logInfo("Object Edit exiting..")
     # Connect to key pressed signal from input context
     self.edit_inputcontext.disconnectAll()
     self.deselect_all()
     # Disconnect cpp python handler
     self.cpp_python_handler.disconnect('ActivateEditing(bool)', self.on_activate_editing)
     self.cpp_python_handler.disconnect('ManipulationMode(int)', self.on_manupulation_mode_change)
     self.cpp_python_handler.disconnect('RemoveHightlight()', self.deselect_all)
     self.cpp_python_handler.disconnect('RotateValuesToNetwork(int, int, int)', self.changerot_cpp)
     self.cpp_python_handler.disconnect('ScaleValuesToNetwork(double, double, double)', self.changescale_cpp)
     self.cpp_python_handler.disconnect('PosValuesToNetwork(double, double, double)', self.changepos_cpp)
     self.cpp_python_handler.disconnect('CreateObject()', self.createObject)
     self.cpp_python_handler.disconnect('DuplicateObject()', self.duplicate)
     self.cpp_python_handler.disconnect('DeleteObject()', self.deleteObject)
     # Clean widgets
     self.cpp_python_handler.CleanPyWidgets()
     r.logInfo(".. done")