コード例 #1
0
ファイル: sol_ui.py プロジェクト: Vimkxi/vmTools
    def _new_handle(self, fast=False, sol_data=None):
        """
        Creates a new SolHandle node and its associated plugin.
        :param fast: bool. Fast mode creates the ndoe from selection.
        :param sol_data: Vars.HANDLE_DATA.
               Only passed to add a widget from an existing handle node.
        :return: None
        """

        # Get new sol infos
        if fast and sol_data is None:
            sol_data = Method.create_handle()

        elif sol_data is None:
            sol_data = Dialogs.NewHandle.new()

        # Process
        if sol_data:

            # Create widgets and set global
            sol_item = SolControlItem(sol_data, self._global_solo)

            # Connect events
            sol_item.soloChanged.connect(self._item_switch_solo)
            sol_item.lightChanged.connect(self._item_light_changed)
            sol_item.labelCreated.connect(lambda l: self.main_tabs.addTab(l))
            # Use lambda to ignore string tuple
            sol_item.labelsChanged.connect(lambda: self._filter_items())

            # Add to list (insert -1 since last item is a stretcher)
            self.main_list.insertWidget(self.main_list.count() - 1, sol_item)
            self._filter_items()
コード例 #2
0
ファイル: sol_dialogs.py プロジェクト: Vimkxi/vmTools
    def _new_complete(self):

        if not self.ui_led_01.text():
            pmc.displayWarning("Please enter a name for the Sol handle.")
            return

        self.return_data = Method.create_handle(
            name=self.ui_led_01.text(),
            camera=self.ui_led_02.text(),
            light=self.ui_led_03.text(),
            geometry=self.ui_led_04.text()
        )
        self.accept()