def version_dialog(lib='PySide'): """Helper function for version_dialog UI for Photoshop It uses with PySide by default you can opt to use PyQt4 instead by setting the ``lib`` argument to "PyQt4". :param str lib: choose a lib, one of ["PySide", "PyQt4"] :return: None """ # connect to db do_db_setup() from anima.ui import SET_PYSIDE, SET_PYQT4 if lib == 'PySide': SET_PYSIDE() elif lib == 'PyQt4': SET_PYQT4() from anima.env import photoshop reload(photoshop) p = photoshop.Photoshop() from anima.ui import version_dialog reload(version_dialog) # display only warning messages import logging logging.getLogger(version_dialog.__name__).setLevel(logging.WARNING) logging.getLogger("anima.ui").setLevel(logging.WARNING) logging.getLogger("anima.ui.models").setLevel(logging.WARNING) logging.getLogger("anima.env.photoshop").setLevel(logging.WARNING) logging.getLogger("stalker.db").setLevel(logging.WARNING) version_dialog.UI(environment=p)
def version_dialog(lib='PySide', logging_level=logging.WARNING, parent=None): """Helper function for version_dialog UI for Fusion It uses with PySide by default you can opt to use PyQt4 instead by setting the ``lib`` argument to "PyQt4". :param str lib: choose a lib, one of ["PySide", "PyQt4"] :param logging_level: :return: None """ # connect to db from anima.utils import do_db_setup do_db_setup() from anima.ui import SET_PYSIDE, SET_PYQT4 if lib == 'PySide': SET_PYSIDE() elif lib == 'PyQt4': SET_PYQT4() from anima.env import fusion reload(fusion) fusion_env = fusion.Fusion() fusion_env.name = 'Fusion' from anima.ui import version_dialog logger.setLevel(logging_level) version_dialog.UI(environment=fusion_env, parent=parent)
def set_qt_lib(): if nuke.NUKE_VERSION_MAJOR < 10 or (nuke.NUKE_VERSION_MAJOR == 11): from anima.ui import SET_PYSIDE2 SET_PYSIDE2() else: from anima.ui import SET_PYSIDE SET_PYSIDE()
def set_qt_lib(): import nuke if nuke.NUKE_VERSION_MAJOR > 10: from anima.ui import SET_PYSIDE2 SET_PYSIDE2() else: from anima.ui import SET_PYSIDE SET_PYSIDE()
def edl_importer(): """Helper script for AVID edl importer """ from anima.ui import SET_PYSIDE SET_PYSIDE() from anima.ui import edl_importer reload(edl_importer) edl_importer.UI()
# -*- coding: utf-8 -*- # Copyright (c) 2012-2019, Anima Istanbul # # This module is part of anima and is released under the MIT # License: http://www.opensource.org/licenses/MIT import hou from anima import logger if hou.applicationVersion()[0] <= 15: from anima.ui import SET_PYSIDE from anima.utils import do_db_setup SET_PYSIDE() else: from anima.ui import SET_PYSIDE2 from anima.utils import do_db_setup SET_PYSIDE2() class Executor(object): """Executor that binds the UI element to Houdini event loop """ def __init__(self): self.application = None from anima.ui.lib import QtCore self.event_loop = QtCore.QEventLoop() def exec_(self, app, dialog): self.application = app app_version = hou.applicationVersion()[0]