Esempio n. 1
0
 def test_export_queue(self):
     queue = core.ComponentQueue()
     comp1 = Component(sphere_name='sphere1')
     queue.add(comp1)
     comp2 = Component(sphere_name='sphere2')
     queue.add(comp2)
     file_path = self.get_temp_filename('queue.json')
     queue.export(file_path)
     queue = core.load_queue(file_path)
     queue.execute()
     self.assertTrue(cmds.objExists('sphere1'))
     self.assertTrue(cmds.objExists('sphere2'))
Esempio n. 2
0
 def test_export_queue(self):
     queue = core.ComponentQueue()
     comp1 = Component('sphere1')
     queue.add(comp1)
     comp2 = Component('sphere2')
     queue.add(comp2)
     file_path = self.get_temp_filename('queue.json')
     queue.export(file_path)
     queue = core.load_queue(file_path)
     queue.execute()
     self.assertTrue(cmds.objExists('sphere1'))
     self.assertTrue(cmds.objExists('sphere2'))
Esempio n. 3
0
    def load_queue(self, file_path=None):
        """Load the specified queue.  If not queue is specified, display a dialog to load a queue from disk.

        :param file_path: Optional path of a queue to load.
        """
        if file_path is None:
            file_path = QtWidgets.QFileDialog.getOpenFileName(
                self, 'Load Component Queue', '', 'json files (*.json)', '',
                QtWidgets.QFileDialog.DontUseNativeDialog)[0]
        if file_path:
            queue = core.load_queue(file_path)
            self.queue_widget.set_queue(queue)
            save_recent_queues(file_path)
            self.populate_recent_queue_menu()
Esempio n. 4
0
File: window.py Progetto: cgdzg/cmt
    def load_queue(self, file_path=None):
        """Load the specified queue.  If not queue is specified, display a dialog to load a queue from disk.

        :param file_path: Optional path of a queue to load.
        """
        if file_path is None:
            file_path = QtGui.QFileDialog.getOpenFileName(self,
                                                          'Load Component Queue',
                                                          '',
                                                          'json files (*.json)',
                                                          '',
                                                          QtGui.QFileDialog.DontUseNativeDialog)[0]
        if file_path:
            queue = core.load_queue(file_path)
            self.queue_widget.set_queue(queue)
            save_recent_queues(file_path)
            self.populate_recent_queue_menu()