コード例 #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...")
コード例 #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.")
コード例 #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
コード例 #4
0
ファイル: window.py プロジェクト: marijamarkovic/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 = 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
コード例 #5
0
ファイル: edit.py プロジェクト: 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()
コード例 #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))
コード例 #7
0
ファイル: objectedit.py プロジェクト: caocao/naali
 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()        
コード例 #8
0
ファイル: pythonqt_gui.py プロジェクト: caocao/naali
    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.")
コード例 #9
0
ファイル: edit.py プロジェクト: bigjun/TundraAddons
    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")
コード例 #10
0
ファイル: objectedit.py プロジェクト: etradewind/Tundra2
    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
コード例 #11
0
ファイル: objectedit.py プロジェクト: caocao/naali
    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
コード例 #12
0
ファイル: objectedit.py プロジェクト: etradewind/Tundra2
 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")
コード例 #13
0
ファイル: window.py プロジェクト: 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
コード例 #14
0
    def on_exit(self):
        r.logInfo("Object Edit exiting...")

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

        r.logInfo("         ...exit done.")
コード例 #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
コード例 #16
0
ファイル: edit.py プロジェクト: 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")
コード例 #17
0
ファイル: objectedit.py プロジェクト: caocao/naali
    def on_exit(self):
        r.logInfo("Object Edit exiting...")

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

        r.logInfo("         ...exit done.")
コード例 #18
0
ファイル: objectedit.py プロジェクト: etradewind/Tundra2
 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()
コード例 #19
0
ファイル: objectedit.py プロジェクト: Chiru/naali
 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()
コード例 #20
0
ファイル: mediaurlhandler.py プロジェクト: Chiru/naali
 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()
コード例 #21
0
ファイル: testrunner.py プロジェクト: etradewind/Tundra2
    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")
コード例 #22
0
ファイル: webmodule_example.py プロジェクト: A-K/naali
    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.")
コード例 #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.")
コード例 #24
0
ファイル: naali.py プロジェクト: bigjun/TundraAddons
 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)))
コード例 #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()
コード例 #26
0
ファイル: edit.py プロジェクト: 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)
コード例 #27
0
ファイル: edit.py プロジェクト: 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)
コード例 #28
0
ファイル: mediaurlhandler.py プロジェクト: etradewind/Tundra2
 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()
コード例 #29
0
ファイル: testrunner.py プロジェクト: marijamarkovic/naali
    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
コード例 #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()
コード例 #31
0
ファイル: objectedit.py プロジェクト: A-K/naali
 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")
コード例 #32
0
ファイル: sceneuploader.py プロジェクト: A-K/naali
 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
コード例 #33
0
ファイル: sceneuploader.py プロジェクト: etradewind/Tundra2
 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
コード例 #34
0
ファイル: edit.py プロジェクト: 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)
コード例 #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
コード例 #36
0
ファイル: autoload.py プロジェクト: A-K/naali
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
コード例 #37
0
ファイル: edit.py プロジェクト: bigjun/TundraAddons
 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)
コード例 #38
0
ファイル: objectedit.py プロジェクト: etradewind/Tundra2
 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)
コード例 #39
0
ファイル: window.py プロジェクト: Chiru/naali
 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
コード例 #40
0
ファイル: objectedit.py プロジェクト: etradewind/Tundra2
    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)
コード例 #41
0
ファイル: objectedit.py プロジェクト: Chiru/naali
    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)
コード例 #42
0
ファイル: scenedata.py プロジェクト: marijamarkovic/naali
 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
コード例 #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
コード例 #44
0
ファイル: window.py プロジェクト: marijamarkovic/naali
    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
コード例 #45
0
ファイル: window.py プロジェクト: AlphaStaxLLC/TundraAddons
    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
コード例 #46
0
ファイル: window.py プロジェクト: marijamarkovic/naali
    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
コード例 #47
0
ファイル: autoload.py プロジェクト: A-K/naali
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)
コード例 #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
コード例 #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)
コード例 #50
0
ファイル: window.py プロジェクト: Chiru/naali
 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
コード例 #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)
コード例 #52
0
ファイル: objectedit.py プロジェクト: etradewind/Tundra2
 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"
         )
コード例 #53
0
ファイル: window.py プロジェクト: 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")
コード例 #54
0
ファイル: window.py プロジェクト: AlphaStaxLLC/TundraAddons
    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
コード例 #55
0
ファイル: objectedit.py プロジェクト: A-K/naali
    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()
コード例 #56
0
ファイル: objectedit.py プロジェクト: Chiru/naali
 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")