Esempio n. 1
0
def version_updater(logging_level=logging.WARNING):
    """helper function for version_updater UI for Maya
    """
    # connect to db
    from anima.utils import do_db_setup
    do_db_setup()

    # set Qt lib
    set_qt_lib()

    from anima.ui import version_updater
    from anima.env import mayaEnv
    m = mayaEnv.Maya()

    import pymel
    m.name = "Maya%s" % str(pymel.versions.current())[0:4]

    logger.setLevel(logging_level)

    # generate a reference_resolution
    # global version_updater_dialog
    # if version_updater_dialog is None:
    #     version_updater_dialog = version_updater.UI(environment=m)
    # else:
    #     version_updater_dialog.show()

    # set the parent object to the maya main window
    version_updater.UI(environment=m, parent=mayaEnv.get_maya_main_window())
Esempio n. 2
0
def unknown_plugin_cleaner_ui():
    """UI for Unknown plugin cleaner which cleans unknown plugin entries from
    the selected *.ma files
    """
    from anima.ui.lib import QtWidgets
    from anima.env.mayaEnv import get_maya_main_window
    maya_main_window = get_maya_main_window()

    dialog = QtWidgets.QFileDialog(maya_main_window, "Choose file")
    dialog.setNameFilter("Maya Files (*.ma)")
    dialog.setFileMode(QtWidgets.QFileDialog.AnyFile)
    if dialog.exec_():
        file_path = dialog.selectedFiles()[0]
        if file_path:
            from anima.ui import progress_dialog

            pc = UnknownPluginCleaner(path=file_path, show_progress=True)
            result = pc.clean()
            if result:
                QtWidgets.QMessageBox.information(
                    maya_main_window,
                    'Cleaned',
                    'Cleaned:<br><br>%s' % os.path.basename(file_path),
                )
            else:
                QtWidgets.QMessageBox.information(
                    maya_main_window,
                    'Clean',
                    'The file was clean:<br><br>%s' %
                    os.path.basename(file_path),
                )
Esempio n. 3
0
def version_creator(logging_level=logging.WARNING):
    """Helper function for version_creator UI for Maya
    """
    # connect to db
    from anima.utils import do_db_setup
    do_db_setup()

    # use PySide for Maya 2014
    # and PySide2 for Maya 2017
    set_qt_lib()

    from anima.ui import version_creator
    from anima.env import mayaEnv
    m = mayaEnv.Maya()

    import pymel
    m.name = "Maya%s" % str(pymel.versions.current())[0:4]

    logger.setLevel(logging_level)

    # global version_creator_dialog
    # if version_creator_dialog is None:
    #     version_creator_dialog = version_creator.UI(environment=m)
    # else:
    #     version_creator_dialog.show()

    # set the parent object to the maya main window
    version_creator.UI(environment=m, parent=mayaEnv.get_maya_main_window())
Esempio n. 4
0
 def create_joints_on_curve_ui(cls):
     """Creates joints on selected curve
     """
     from anima.env import mayaEnv
     main_window = mayaEnv.get_maya_main_window()
     jocd = JointOnCurveDialog(parent=main_window)
     jocd.show()
Esempio n. 5
0
def version_updater(logging_level=logging.WARNING):
    """helper function for version_updater UI for Maya
    """
    # connect to db
    from anima.utils import do_db_setup
    do_db_setup()

    # set Qt lib
    set_qt_lib()

    from anima.ui import version_updater
    from anima.env import mayaEnv
    m = mayaEnv.Maya()

    import pymel
    m.name = "Maya%s" % str(pymel.versions.current())[0:4]

    logger.setLevel(logging_level)

    # generate a reference_resolution
    # global version_updater_dialog
    # if version_updater_dialog is None:
    #     version_updater_dialog = version_updater.UI(environment=m)
    # else:
    #     version_updater_dialog.show()

    # set the parent object to the maya main window
    version_updater.UI(environment=m, parent=mayaEnv.get_maya_main_window())
Esempio n. 6
0
def version_creator(logging_level=logging.WARNING):
    """Helper function for version_creator UI for Maya
    """
    # connect to db
    from anima.utils import do_db_setup
    do_db_setup()

    # use PySide for Maya 2014
    # and PySide2 for Maya 2017
    set_qt_lib()

    from anima.ui import version_creator
    from anima.env import mayaEnv
    m = mayaEnv.Maya()

    import pymel
    m.name = "Maya%s" % str(pymel.versions.current())[0:4]

    logger.setLevel(logging_level)

    # global version_creator_dialog
    # if version_creator_dialog is None:
    #     version_creator_dialog = version_creator.UI(environment=m)
    # else:
    #     version_creator_dialog.show()

    # set the parent object to the maya main window
    version_creator.UI(environment=m, parent=mayaEnv.get_maya_main_window())
Esempio n. 7
0
    def publish_checker(cls):
        """Opens the Publish Checker window without publishing the current
        scene
        """
        import functools
        from anima.env import mayaEnv
        m = mayaEnv.Maya()
        version = m.get_current_version()

        # create the publish window
        from anima.ui import publish_checker
        dialog = publish_checker.UI(environment=m,
                                    publish_callback=None,
                                    version=version,
                                    parent=mayaEnv.get_maya_main_window())
        dialog.auto_delete_new_version_on_exit = False
        dialog.show()
Esempio n. 8
0
def version_dialog(logging_level=logging.WARNING, mode=2):
    """Helper function for version_dialog UI for Maya
    """
    # connect to db
    from anima.utils import do_db_setup
    do_db_setup()

    # use PySide for Maya 2014
    # and PySide2 for Maya 2017
    set_qt_lib()

    from anima.ui import version_dialog
    from anima.env import mayaEnv
    m = mayaEnv.Maya()

    import pymel
    m.name = "Maya%s" % str(pymel.versions.current())[0:4]

    logger.setLevel(logging_level)

    # set the parent object to the maya main window
    version_dialog.UI(environment=m, parent=mayaEnv.get_maya_main_window(), mode=mode)