def onOpenScene(self, event):
        """
		Load a scene from file
		"""
        wc = "3D view scene (*.3xd)|*.3xd"
        filename = GUI.Dialogs.askOpenFileName(self, "Open 3D view scene", wc, 0)
        if filename:
            state = state_pickler.load_state(open(filename[0], "r"))
            # state_pickler.set_state(self.mode, state)
            self.moduleListbox.Clear()
            self.mode.__set_pure_state__(state)
            lib.messenger.send(None, "update_module_settings")
Exemplo n.º 2
0
    def onOpenScene(self, event):
        """
		Load a scene from file
		"""
        wc = "3D view scene (*.3xd)|*.3xd"
        filename = GUI.Dialogs.askOpenFileName(self, "Open 3D view scene", wc,
                                               0)
        if filename:
            state = state_pickler.load_state(open(filename[0], "r"))
            #state_pickler.set_state(self.mode, state)
            self.moduleListbox.Clear()
            self.mode.__set_pure_state__(state)
            lib.messenger.send(None, "update_module_settings")
Exemplo n.º 3
0
	def depersist(self, filename):
		"""
		Read the given control object from a given file
		"""
		state = state_pickler.load_state(open(filename, "r"))
		state_pickler.set_state(self.control, state)