Beispiel #1
0
 def set_houdini_style(self, it=None):
     if it is None:
         self.setStyleSheet(hqt.get_h14_style(self.theme['houdini_theme']))
     else:
         theme = self.houdini_theme_cbb.currentText()
         self.setStyleSheet(hqt.get_h14_style(theme))
         self.theme_gb.setTitle(theme_group_box_text+'*')
Beispiel #2
0
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)
        ui_file_path = "{0}/scripts/widgets/projectBrowser.ui".format(
            hou.expandString('$ALS'))
        loader = QUiLoader()
        self.widget = loader.load(ui_file_path)

        self.widget.jobField.setText(hou.expandString('$JOB'))
        self.widget.mjobField.setText(hou.expandString('$MJOB'))
        self.widget.hdataField.setText(hou.expandString('$HDATA'))
        self.widget.mcacheField.setText(hou.expandString('$MCACHE'))
        self.widget.mdataField.setText(hou.expandString('$MDATA'))
        self.widget.mscenesField.setText(hou.expandString('$MSCENES'))
        self.widget.flipField.setText(hou.expandString('$PLAY'))
        self.widget.rcField.setText(hou.expandString('$RCPATH'))
        self.widget.refField.setText(hou.expandString('$REFPATH'))

        self.widget.jobButton.clicked.connect(self._projDir)
        self.widget.mjobButton.clicked.connect(self._mprojDir)
        self.widget.hdataButton.clicked.connect(self._dataDir)
        self.widget.mdataButton.clicked.connect(self._mDataDir)
        self.widget.mcacheButton.clicked.connect(self._mCacheDir)
        self.widget.mscenesButton.clicked.connect(self._mScenesDir)
        self.widget.flipButton.clicked.connect(self._flipDir)
        self.widget.rcButton.clicked.connect(self._rcpathDir)
        self.widget.refButton.clicked.connect(self._referenceDir)
        self.widget.localDataButton.clicked.connect(self._dataLocalDir)
        self.widget.storageButton.clicked.connect(self._dataStorageDir)
        self.widget.sceneButton.clicked.connect(self._openScene)

        h = QHBoxLayout(self)
        h.setContentsMargins(0, 0, 0, 0)
        h.addWidget(self.widget)
        self.widget.setStyleSheet(hqt.get_h14_style())
Beispiel #3
0
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)
        ui_file_path = "{0}/scripts/widgets/flipbook.ui".format(
            hou.expandString('$ALS'))
        loader = QUiLoader()
        self.widget = loader.load(ui_file_path)

        self.job = hou.expandString('$JOB')
        self.play = hou.expandString('$PLAY')
        self.seq = hou.expandString('$SEQ')
        self.sh = hou.expandString('$SH')
        self.width = 2048
        self.height = 858
        self.replace = 0

        h = QHBoxLayout(self)
        h.setContentsMargins(0, 0, 0, 0)
        h.addWidget(self.widget)
        self.widget.setStyleSheet(hqt.get_h14_style())

        # icon = QIcon()
        # icon.addPixmap(QPixmap("file.png"))
        # self.widget.getDirBtn.setIcon(icon)
        self.widget.getDirBtn.clicked.connect(self._getFlipPath)
        self.widget.flipbookButton.clicked.connect(self._flipWrite)
Beispiel #4
0
 def generate(self):
     if not os.path.exists(
             keywords.vex_settings.get_autocomplete_cache_file()):
         self.setStyleSheet(hqt.get_h14_style())
         self.show()
     # small pause to update ui
     QTimer.singleShot(200, self.do_generate)
Beispiel #5
0
    def initGUI(self):

        layout = QVBoxLayout()

        ## Create Menu Bar
        self._createMenuBar()

        ## Add Edit Menu
        self._createEditMenu()

        ## Add View Menu
        self._createViewMenu()

        ## Add About Menu
        self._createAboutMenu()
        layout.addWidget(self.menuBar)

        self.cacheTreeWidget = self._createCacheTree()
        layout.addWidget(self.cacheTreeWidget)
        layout.setContentsMargins(0, 0, 0, 0)

        self.setLayout(layout)

        try:
            self.setStyleSheet(hqt.get_h14_style())
        except:
            pass
Beispiel #6
0
    def initGUI(self):

        layout = QVBoxLayout()

        ## Create Menu Bar
        self._createMenuBar()

        ## Add Edit Menu
        self._createEditMenu()

        ## Add View Menu
        self._createViewMenu()

        ## Add About Menu
        self._createAboutMenu()
        layout.addWidget(self.menuBar)

        self.cacheTreeWidget = self._createCacheTree()
        layout.addWidget(self.cacheTreeWidget)
        layout.setContentsMargins(0,0,0,0)

        self.setLayout(layout)

        try:
            self.setStyleSheet(hqt.get_h14_style())
        except:
            pass
Beispiel #7
0
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)
        ui_file_path = "{0}/scripts/widgets/datasync.ui".format(
            hou.expandString('$ALS'))
        loader = QUiLoader()

        self.widget = loader.load(ui_file_path)
        h = QHBoxLayout(self)
        h.setContentsMargins(0, 0, 0, 0)
        h.addWidget(self.widget)
        self.widget.setStyleSheet(hqt.get_h14_style())

        self.job = hou.expandString('$JOB')

        self.widget.getDirBtn.clicked.connect(self._getScenesPath)
        self.widget.startRepareBtn.clicked.connect(self._runRepare)
        self.widget.startCleanBtn.clicked.connect(self._runCleaner)
        self.widget.syncButton.clicked.connect(self._runButchSync)
        self.widget.syncGuiButton.clicked.connect(self._runGuiSync)
 def set_theme(self, theme=None):
     theme = theme or self.theme
     themes = design.get_themes()
     if theme in themes:
         theme = themes[theme]
     else:
         theme = design.defaultColors
     # ui theme
     self.hstyle = hqt.get_h14_style(theme['houdini_theme'])
     self.setStyleSheet(self.hstyle)
     # editor theme
     for i in range(self.tab.count()):
         w = self.tab.widget(i).edit
         w.apply_style(theme['name'], theme)
     self.theme = theme['name']
     self.theme_colors = theme
     self.save_settings()
     # update numbar widgets
     self.tab.update_numbars()
 def set_theme(self, theme=None):
     theme = theme or self.theme
     themes = design.get_themes()
     if theme in themes:
         theme = themes[theme]
     else:
         theme = design.defaultColors
     # ui theme
     self.hstyle = hqt.get_h14_style(theme['houdini_theme'])
     self.setStyleSheet(self.hstyle)
     # editor theme
     for i in range(self.tab.count()):
         w = self.tab.widget(i).edit
         w.apply_style(theme['name'], theme)
     self.help_wd.apply_style(theme['name'], theme)
     self.theme = theme['name']
     self.theme_colors = theme
     self.save_settings()
     # update numbar widgets
     self.tab.update_numbars()
 def generate(self):
     if not os.path.exists(keywords.vex_settings.get_autocomplete_cache_file()):
         self.setStyleSheet(hqt.get_h14_style())
         self.show()
     # small pause to update ui
     QTimer.singleShot(200, self.do_generate)
    def __init__(self):
        super(VEXEditorPanelClass, self).__init__()
        self.setupUi(self)
        ver = check_version.get_current_version()
        self.version = 'v%s.%s.%s' % (ver[0], ver[1], ver[2])
        # settings
        self.settings = vex_settings.EditorSettingsClass()
        self.theme = ''
        self.theme_colors = {}
        # self.use_help_window = False
        self.load_settings()
        self.hstyle = hqt.get_h14_style(self.theme)
        # build ui
        self.errors = error_browser.ErrorBrowserWidget()
        self.error_browser_ly.addWidget(self.errors)
        self.errors.hide()

        self.help_wd = help_window.HelpWindow(self)
        self.help_ly.addWidget(self.help_wd)
        # self.help_wd.hide()

        self.tab = tab_widget.VEXEditorTabWidget(self)
        self.tab_ly.addWidget(self.tab)
        self.tab.update_infoSignal.connect(self.set_tab_info)
        self.tab.messageSignal.connect(self.show_status_message)
        self.tab.lastClosedSignal.connect(self.last_tab_closed)
        self.tab.currentChanged.connect(self.update_help_window)

        # self.help_btn = QPushButton('H')
        # self.help_btn.setMaximumSize(QSize(20,20))

        # def toggle_help_window():
        #     res = self.help_wd.toggle_visible()
        # self.splitter.setEnabled(res)
        # if res:
        #     self.splitter.setSizes([10000,200])
        # else:
        #     self.splitter.setSizes([10000,0])
        # self.help_btn.clicked.connect(toggle_help_window)
        self.splitter.setSizes([10000, 0])
        # self.splitter.setEnabled(False)
        # self.statusBar().addPermanentWidget( self.help_btn)

        #icons
        for btn in self.load_from_file_btn, self.load_from_selected_extra_btn, self.save_current_btn, self.reload_current_btn,\
                self.blank_tab_btn, self.load_from_selected_btn:
            btn.setIconSize(QSize(30, 30))
        self.load_from_file_btn.setText('')
        self.load_from_file_btn.setIcon(QIcon(icons['header']))

        self.load_from_selected_extra_btn.setText('')
        self.load_from_selected_extra_btn.setIcon(QIcon(icons['vopnode_list']))

        self.load_from_selected_btn.setText('')
        self.load_from_selected_btn.setIcon(QIcon(icons['wrangle']))

        self.save_current_btn.setText('')
        self.save_current_btn.setIcon(QIcon(icons['save']))

        self.reload_current_btn.setText('')
        self.reload_current_btn.setIcon(QIcon(icons['reload_sourse']))

        self.blank_tab_btn.setText('')
        self.blank_tab_btn.setIcon(QIcon(icons['blank']))

        # connects
        self.load_from_selected_extra_btn.clicked.connect(self.create_parm_tab)
        self.load_from_selected_btn.clicked.connect(
            lambda: self.create_parm_tab(True))
        self.create_from_node_act.triggered.connect(self.create_parm_tab)
        self.load_from_file_btn.clicked.connect(self.create_file_tab)
        self.create_from_file_act.triggered.connect(self.create_file_tab)
        self.reload_current_btn.clicked.connect(self.tab.reload_source)
        self.reload_source_act.triggered.connect(self.tab.reload_source)
        self.save_current_btn.clicked.connect(self.tab.save_current)
        self.save_to_new_act.triggered.connect(self.tab.save_as_current)
        self.save_section_act.triggered.connect(self.tab.save_current)
        self.show_sourse_btn.clicked.connect(self.tab.select_tab_node)
        self.show_sourse_btn_2.clicked.connect(self.tab.open_tab_file)
        self.blank_tab_btn.clicked.connect(self.create_empty_tab)
        self.create_empty_act.triggered.connect(self.create_empty_tab)
        self.context_help_act.triggered.connect(self.tab.show_context_help)
        self.vex_manual_act.triggered.connect(self.tab.open_VEX_manual)
        self.manual_act.triggered.connect(
            lambda: self.open_url(vex_settings.help_url))
        self.about_act.triggered.connect(self.show_about)
        # self.save_tabs_in_hip_act.triggered.connect(self.tab.save_tabs_to_hip)
        self.load_tabs_from_hip_act.triggered.connect(
            self.tab.restore_tabs_from_hip)
        self.clear_tabs_act.triggered.connect(self.tab.clear_tabs_node)
        self.check_new_version_act.triggered.connect(
            check_version.check_version)
        for act in self.auto_create_parms_act, self.save_tabs_in_hip_act, self.use_hou_browser_act, self.help_window_act:
            act.triggered.connect(self.save_settings)
        # self.set_font_size_act.triggered.connect(self.set_font_size)
        self.live_template_editor_act.triggered.connect(
            self.open_live_template_editor)
        self.options_act.triggered.connect(self.open_options_dialog)
        self.menu_tabs.aboutToShow.connect(self.update_backup_menu)
        self.open_backup_folder_act.triggered.connect(
            lambda: webbrowser.open(vex_settings.backup_folder()))
        self.clear_backups_act.triggered.connect(self.clear_backup)
        self.open_theme_editor_act.triggered.connect(self.open_theme_editor)
        self.open_settings_folder_act.triggered.connect(
            self.open_settings_folder)
        self.find_replace_act.triggered.connect(self.tab.update_replace_dialog)

        # default visibility
        self.file_info_wd.setVisible(0)
        self.node_info_wd.setVisible(0)
        self.reload_current_btn.setEnabled(0)
        self.save_current_btn.setEnabled(0)

        # temp ui state
        # menu
        self.theme_menu()
        # save main widget to main namespace
        main['vexeditor'] = self

        # start
        self.check_tabs_exists()
        self.update_templates_menu()
        QTimer.singleShot(50, lambda: self.set_theme(self.theme))
        vex_parser.generate()
Beispiel #12
0
        super(myMenu, self).__init__()
        for i in range(10):
            self.addAction(hqt.QAction('Item %s' % i, self))

action = hqt.showUi(myMenu)
# get data from action object
print action.text()


######################################################################################## 14

# EXAMPLES HOUDINI 14

########## Simple Window
import myWidget
import hqt
w = myWidget()
w.setParent(hqt.getHouWindow())
w.setStyleSheet(hqt.get_h14_style())
w.show()

######## Insert as Panel
import hqt
#1
import myWidget
# in panel
hqt.show(myWidget.mainWindow, name='My Widget',replacePyPanel=1, hideTitleMenu=0)
# floating
hqt.show(myWidget.mainWindow, floating=1, position=(200,300), size=(300,400))

Beispiel #13
0
def get_widget():
    widget = scriptEditor.scriptEditorClass()
    widget.setStyleSheet('')
    widget.setStyleSheet(hqt.get_h14_style())
    return widget
    def __init__(self):
        super(VEXEditorPanelClass, self).__init__()
        self.setupUi(self)
        ver = check_version.get_current_version()
        self.version = 'v%s.%s.%s' % (ver[0], ver[1], ver[2])
        # settings
        self.settings = vex_settings.EditorSettingsClass()
        self.theme = ''
        self.theme_colors = {}
        self.load_settings()
        self.hstyle = hqt.get_h14_style(self.theme)
        # build ui
        self.errors = error_browser.ErrorBrowserWidget()
        self.error_browser_ly.addWidget(self.errors)
        self.errors.hide()
        self.tab = tab_widget.VEXEditorTabWidget(self)
        self.tab_ly.addWidget(self.tab)
        self.tab.update_infoSignal.connect(self.set_tab_info)
        self.tab.messageSignal.connect(self.show_status_message)
        self.tab.lastClosedSignal.connect(self.last_tab_closed)

        #icons
        for btn in self.load_from_file_btn, self.load_from_selected_extra_btn, self.save_current_btn, self.reload_current_btn,\
                self.blank_tab_btn, self.load_from_selected_btn:
            btn.setIconSize(QSize(30,30))
        self.load_from_file_btn.setText('')
        self.load_from_file_btn.setIcon(QIcon(icons['header']))

        self.load_from_selected_extra_btn.setText('')
        self.load_from_selected_extra_btn.setIcon(QIcon(icons['vopnode_list']))

        self.load_from_selected_btn.setText('')
        self.load_from_selected_btn.setIcon(QIcon(icons['wrangle']))


        self.save_current_btn.setText('')
        self.save_current_btn.setIcon(QIcon(icons['save']))

        self.reload_current_btn.setText('')
        self.reload_current_btn.setIcon(QIcon(icons['reload_sourse']))

        self.blank_tab_btn.setText('')
        self.blank_tab_btn.setIcon(QIcon(icons['blank']))

        # connects
        self.load_from_selected_extra_btn.clicked.connect(self.create_parm_tab)
        self.load_from_selected_btn.clicked.connect(lambda :self.create_parm_tab(True))
        self.create_from_node_act.triggered.connect(self.create_parm_tab)
        self.load_from_file_btn.clicked.connect(self.create_file_tab)
        self.create_from_file_act.triggered.connect(self.create_file_tab)
        self.reload_current_btn.clicked.connect(self.tab.reload_source)
        self.reload_source_act.triggered.connect(self.tab.reload_source)
        self.save_current_btn.clicked.connect(self.tab.save_current)
        self.save_section_act.triggered.connect(self.tab.save_current)
        self.show_sourse_btn.clicked.connect(self.tab.select_tab_node)
        self.show_sourse_btn_2.clicked.connect(self.tab.open_tab_file)
        self.blank_tab_btn.clicked.connect(self.create_empty_tab)
        self.create_empty_act.triggered.connect(self.create_empty_tab)
        self.context_help_act.triggered.connect(self.tab.show_context_help)
        self.vex_manual_act.triggered.connect(self.tab.open_VEX_manual)
        self.manual_act.triggered.connect(lambda :self.open_url(vex_settings.help_url))
        self.about_act.triggered.connect(self.show_about)
        # self.save_tabs_in_hip_act.triggered.connect(self.tab.save_tabs_to_hip)
        self.load_tabs_from_hip_act.triggered.connect(self.tab.restore_tabs_from_hip)
        self.clear_tabs_act.triggered.connect(self.tab.clear_tabs_node)
        self.check_new_version_act.triggered.connect(check_version.check_version)
        for act in self.auto_create_parms_act, self.save_tabs_in_hip_act, self.use_hou_browser_act:
            act.triggered.connect(self.save_settings)
        # self.set_font_size_act.triggered.connect(self.set_font_size)
        self.live_template_editor_act.triggered.connect(self.open_live_template_editor)
        self.options_act.triggered.connect(self.open_options_dialog)
        self.menu_tabs.aboutToShow.connect(self.update_backup_menu)
        self.open_backup_folder_act.triggered.connect(lambda :webbrowser.open(vex_settings.backup_folder()))
        self.clear_backups_act.triggered.connect(self.clear_backup)
        self.open_theme_editor_act.triggered.connect(self.open_theme_editor)

        # default visibility
        self.file_info_wd.setVisible(0)
        self.node_info_wd.setVisible(0)
        self.reload_current_btn.setEnabled(0)
        self.save_current_btn.setEnabled(0)

        # temp ui state
        # menu
        self.theme_menu()
        # save main widget to main namespace
        main['vexeditor'] = self

        # start
        self.check_tabs_exists()
        self.update_templates_menu()
        QTimer.singleShot(50,lambda :self.set_theme(self.theme))
        vex_parser.generate()