コード例 #1
0
    def on_export(self):
        all_rigs = core.find()

        path, _ = QtGui.QFileDialog.getSaveFileName(
            caption="File Save (.json)", filter="JSON (*.json)")
        if path:
            libSerialization.export_json_file_maya(all_rigs, path)
コード例 #2
0
ファイル: uiLogic.py プロジェクト: goujin/omtk
    def import_networks(self, *args, **kwargs):
        path = '/home/rlessard/Desktop/test.json'

        self.roots = core.find()
        self.root = next(iter(self.roots), None)

        # Create a rig instance if the scene is empty.
        if self.root is None:
            self.root = core.create()
            self.roots = [self.root]
            self.export_networks()  # Create network tree in the scene
コード例 #3
0
    def import_networks(self, *args, **kwargs):
        self.roots = core.find()
        self.root = next(iter(self.roots), None)

        # Create a rig instance if the scene is empty.
        if self.root is None:
            self.root = core.create()
            self.roots = [self.root]
            self.export_networks()  # Create network tree in the scene

        self.update_internal_data()
コード例 #4
0
    def import_networks(self, *args, **kwargs):
        self.roots = core.find()
        self.root = next(iter(self.roots), None)

        # Create a rig instance if the scene is empty.
        if self.root is None:
            self.root = core.create()
            self.roots = [self.root]
            self.export_networks()  # Create network tree in the scene

        self.ui.widget_modules.set_rigs(self.roots)
        self.ui.widget_jnts.set_rig(self.root)
        self.ui.widget_meshes.set_rig(self.root)
コード例 #5
0
ファイル: main_window.py プロジェクト: renaudll/omtk
    def import_networks(self, *args, **kwargs):
        self.roots = core.find()
        self.root = next(iter(self.roots), None)

        # Create a rig instance if the scene is empty.
        if self.root is None:
            self.root = core.create()
            self.roots = [self.root]
            self.export_networks()  # Create network tree in the scene

        self.ui.widget_modules.set_rigs(self.roots)
        self.ui.widget_jnts.set_rig(self.root)
        self.ui.widget_meshes.set_rig(self.root)
コード例 #6
0
ファイル: uiLogic.py プロジェクト: goujin/omtk
    def on_import(self):
        path, _ = QtGui.QFileDialog.getOpenFileName(caption="File Save (.json)", filter="JSON (*.json)")
        if not path:
            return

        new_rigs = libSerialization.import_json_file_maya(path)
        if not new_rigs:
            return

        # Remove previous rigs
        all_rigs = core.find()
        for rig in all_rigs:
            if rig._network.exists():
                pymel.delete(rig._network)

        for rig in filter(None, new_rigs):
            libSerialization.export_network(rig)

        self.on_update()
コード例 #7
0
    def on_import(self):
        path, _ = QtGui.QFileDialog.getOpenFileName(
            caption="File Save (.json)", filter="JSON (*.json)")
        if not path:
            return

        new_rigs = libSerialization.import_json_file_maya(path)
        if not new_rigs:
            return

        # Remove previous rigs
        all_rigs = core.find()
        for rig in all_rigs:
            if rig._network.exists():
                pymel.delete(rig._network)

        for rig in filter(None, new_rigs):
            libSerialization.export_network(rig)

        self.on_update()
コード例 #8
0
ファイル: uiLogic.py プロジェクト: goujin/omtk
    def on_export(self):
        all_rigs = core.find()

        path, _ = QtGui.QFileDialog.getSaveFileName(caption="File Save (.json)", filter="JSON (*.json)")
        if path:
            libSerialization.export_json_file_maya(all_rigs, path)