コード例 #1
0
def example():

    plugins = ["examplePlugin"]
    superusers = ["kurt.rathjen"]

    # Lock all folders unless you're a superuser.
    studiolibrary.main(superusers=superusers, plugins=plugins, add=True)
コード例 #2
0
ファイル: example1.py プロジェクト: mrharris/studiolibrary
def main():
    """The main entry point for this example."""

    # Register the item class to be shown for the valid path extensions
    studiolibrary.registerItem(ImageItem)

    studiolibrary.main(name="Example1", path="data")
コード例 #3
0
ファイル: lockplugin.py プロジェクト: mmallmann/studiolibrary
def example():

    plugins = ["examplePlugin"]
    superusers = ["kurt.rathjen"]

    # Lock all folders unless you're a superuser.
    studiolibrary.main(superusers=superusers, plugins=plugins, add=True)
コード例 #4
0
    def doIt(self, argList):
        if not os.path.exists(
                r'\\cbone-file-07\pipeline\etc\maya\scripts\studiolibrary-2.7.1\src'
        ):
            raise IOError(
                r'The source path "\\cbone-file-07\pipeline\etc\maya\scripts\studiolibrary-2.7.1\src" does not exist!'
            )

        if r'\\cbone-file-07\pipeline\etc\maya\scripts\studiolibrary-2.7.1\src' not in sys.path:
            sys.path.insert(
                0,
                r'\\cbone-file-07\pipeline\etc\maya\scripts\studiolibrary-2.7.1\src'
            )

        libraries = [{
            "name": "Default",
            "path":
            r"P:\qg1\assets\chess-board\anim\work\data\studiolibraries\Default",
            "default": True
        }, {
            "name":
            "Scratch",
            "path":
            r"P:\qg1\assets\chess-board\anim\work\data\studiolibraries\Scratch"
        }]
        import studiolibrary
        studiolibrary.setLibraries(libraries)
        studiolibrary.main()
コード例 #5
0
ファイル: demoplugin.py プロジェクト: jonntd/mira
def test():
    """
    :rtype: None
    """
    logging.basicConfig(level=logging.DEBUG)
    logging.info("Plugin Path:", __file__)

    studiolibrary.main(name="Demo", plugins=[__file__])
コード例 #6
0
ファイル: demoplugin.py プロジェクト: mmallmann/studiolibrary
def test():
    """
    :rtype: None
    """
    logging.basicConfig(level=logging.DEBUG)
    logging.info("Plugin Path:", __file__)

    studiolibrary.main(name="Demo", plugins=[__file__])
コード例 #7
0
 def showLibrary(self, name, path, **kwargs):
     """
     Show the library window which has given name and path.
     
     :type name: str
     :type path: str 
     :type kwargs: dict 
     """
     studiolibrary.main(name, path, **kwargs)
コード例 #8
0
def open_shared_lib():
    path = assets_dir()
    shared_lib = os.path.join(path, "_studiolibrary")

    if not os.path.exists(shared_lib):
        os.makedirs(shared_lib)

    studiolibrary.main(name="Project Borealis Animation Library",
                       path=shared_lib)
コード例 #9
0
 def showLibrary(self, name, path, **kwargs):
     """
     Show the library window which has given name and path.
     
     :type name: str
     :type path: str 
     :type kwargs: dict 
     """
     studiolibrary.main(name, path, **kwargs)
コード例 #10
0
ファイル: demoplugin.py プロジェクト: Italic-/maya-prefs
def test():
    """
    :rtype: None
    """
    logging.basicConfig(level=logging.DEBUG,
                        format='%(levelname)s: %(funcName)s: %(message)s')

    import studiolibrary
    logging.info("Plugin Path:", __file__)
    studiolibrary.main(name="Demo", plugins=[__file__])
コード例 #11
0
ファイル: example1.py プロジェクト: jubeyjose/maya-prefs
def main():
    """The main entry point for this example."""

    # Register the item class to the extension and ignore all jpgs that
    # contain the string "thumbnail."
    studiolibrary.registerItem(ImageItem, ".jpg", ignore="thumbnail.")
    studiolibrary.registerItem(ImageItem, ".png")
    studiolibrary.registerItem(ImageItem, ".gif")

    # Show the library with the given name and path
    studiolibrary.main(name="Example", path=dirname + "/data")
コード例 #12
0
def loadFromCommand():
    """
    """
    from optparse import OptionParser
    parser = OptionParser()
    parser.add_option('-p', '--plugins', dest='plugins', help='', metavar='PLUGINS', default='None')
    parser.add_option('-r', '--root', dest='root', help='', metavar='ROOT')
    parser.add_option('-n', '--name', dest='name', help='', metavar='NAME')
    parser.add_option('-v', '--version', dest='version', help='', metavar='VERSION')
    options, args = parser.parse_args()
    name = options.name
    plugins = eval(options.plugins)
    import studiolibrary
    studiolibrary.main(name=name, plugins=plugins)
コード例 #13
0
def showExample5():
    """
    Show two Studio Library widget instances.

    :rtype: None 
    """
    with studiolibrary.app():

        widget = studiolibrary.main(name="Example5-A", path="data")
        widget.setLocked(True)
        widget.move(100, 100)
        widget.theme().setAccentColor("rgb(250, 100, 50)")
        widget.theme().setBackgroundColor("rgb(80, 150, 120)")
        widget.show()

        widget = studiolibrary.main(name="Example5-B", path="data")
        widget.show()
コード例 #14
0
def test():
    """
    Use this code for testing inside maya. It should reload this plugin and the base plugin.
    """
    import studiolibrary

    from studiolibraryplugins import mayabaseplugin
    reload(mayabaseplugin)
    from studiolibraryplugins import animationplugin
    reload(animationplugin)

    import mutils
    import mutils.modelpanelwidget
    reload(mutils.modelpanelwidget)

    w = studiolibrary.main(name="TEMP")
    p = w.plugins()["animationplugin"]
    p.setRecord(animationplugin.Record)
    p.setInfoWidget(animationplugin.AnimationInfoWidget)
    p.setCreateWidget(animationplugin.AnimationCreateWidget)
    p.setPreviewWidget(animationplugin.AnimationPreviewWidget)
コード例 #15
0
def test():
    """
    Use this code for testing inside maya. It should reload this plugin and the base plugin.
    """
    import studiolibrary

    from studiolibraryplugins import mayabaseplugin
    reload(mayabaseplugin)
    from studiolibraryplugins import animationplugin
    reload(animationplugin)

    import mutils
    import mutils.modelpanelwidget
    reload(mutils.modelpanelwidget)

    w = studiolibrary.main(name="TEMP")
    p = w.plugins()["animationplugin"]
    p.setRecord(animationplugin.Record)
    p.setInfoWidget(animationplugin.AnimationInfoWidget)
    p.setCreateWidget(animationplugin.AnimationCreateWidget)
    p.setPreviewWidget(animationplugin.AnimationPreviewWidget)
コード例 #16
0
    def executeMaya(self):

        import studiolibrary
        studiolibrary.main()
コード例 #17
0
                if self._lockFolder.search(folder.dirname()):
                    self.window().setLocked(True)
                    return
            self.window().setLocked(False)

        # Unlock the selected folders that match the self._unlockFolder regx
        if not self._unlockFolder.match(""):
            for folder in folders or []:
                if self._unlockFolder.search(folder.dirname()):
                    self.window().setLocked(False)
                    return
            self.window().setLocked(True)


if __name__ == "__main__":

    import studiolibrary
    #root = "P:/figaro/studiolibrary/anim"
    #name = "Figaro Pho - Anim"
    superusers = ["kurt.rathjen"]
    plugins = ["examplePlugin"]

    # Lock all folders unless you're a superuser.
    studiolibrary.main(superusers=superusers, plugins=plugins, add=True)

    # This command will lock only folders that contain the word "Approved" in their path.
    #studiolibrary.main(name=name, root=root, superusers=superusers, lockFolder="Approved")

    # This command will lock all folders except folders that contain the words "Users" or "Shared" in their path.
    #studiolibrary.main(name=name, root=root, superusers=superusers, unlockFolder="Users|Shared")
コード例 #18
0
# -*- coding: UTF8 -*-
import logging

import studiolibrary

import studioqt

logging.basicConfig(
    level=logging.DEBUG,
    format='%(levelname)s: %(funcName)s: %(message)s',
    filemode='w'
)

logger = logging.getLogger("test_library")


if __name__ == "__main__":

    with studioqt.app():
        studiolibrary.main(u"Exён Шple")
コード例 #19
0
def open_studiolibrary():
    import studiolibrary
    studiolibrary.main()
コード例 #20
0
        @type parent: QtGui.QWidget
        @type record: Record
        """
        mayabaseplugin.InfoWidget.__init__(self, *args, **kwargs)
        studiolibrary.loadUi(self)


class SelectionSetPreviewWidget(mayabaseplugin.PreviewWidget):

    def __init__(self, *args, **kwargs):
        """
        @type parent: QtGui.QWidget
        @type record: Record
        """
        mayabaseplugin.PreviewWidget.__init__(self, *args, **kwargs)


class SelectionSetCreateWidget(mayabaseplugin.CreateWidget):

    def __init__(self, *args, **kwargs):
        """
        @type parent: QtGui.QWidget
        @type record: Record
        """
        mayabaseplugin.CreateWidget.__init__(self, *args, **kwargs)


if __name__ == "__main__":
    import studiolibrary
    studiolibrary.main()
コード例 #21
0
def main(*args, **kwargs):
    import studiolibrary
    studiolibrary.main(*args, **kwargs)
コード例 #22
0
        if not env:
            env = self.environment()

        if env:
            for var in env:
                os.environ.setdefault(var, "")
                if studiolibrary.isWindows():
                    os.environ[var] = ";".join(env[var])
                else:
                    os.environ[var] = ":".join(env[var])

    def run(self, cmd=None, env=None):
        try:
            from subprocess import Popen, PIPE, STDOUT

            self.setEnvironment(env)

            if not cmd:
                cmd = self.command()
            print cmd
            p = Popen(cmd, shell=False, stdin=PIPE, stdout=PIPE)
        except:
            import traceback
            print traceback.format_exc()


if __name__ == "__main__":
    import studiolibrary
    studiolibrary.main(plugins=["launcherplugin.launcher"], name="Launcher")

コード例 #23
0
# -*- coding: UTF8 -*-
import logging

import studiolibrary

import studioqt

logging.basicConfig(level=logging.DEBUG,
                    format='%(levelname)s: %(funcName)s: %(message)s',
                    filemode='w')

logger = logging.getLogger("test_library")

if __name__ == "__main__":

    with studioqt.app():
        library = studiolibrary.main(lockFolder="Malcolm")
コード例 #24
0
def studionLibrarys():
    sys.path.append(r'\\octvision.com\cg\Tech\maya_sixteen\Python\OCT_anim')
    import studiolibrary
    studiolibrary.main()
コード例 #25
0
def main():
    from miraScripts.mayaTools import animation_tool
    sys.path.insert(0, os.path.dirname(animation_tool.__file__))
    import studiolibrary
    studiolibrary.main()
コード例 #26
0
ファイル: lockplugin.py プロジェクト: qeeji/studiolibrary
                    self.window().setLocked(True)
                    return
            self.window().setLocked(False)

        # Unlock the selected folders that match the self._unlockFolder regx
        if not self._unlockFolder.match(""):
            for folder in folders or []:
                if self._unlockFolder.search(folder.dirname()):
                    self.window().setLocked(False)
                    return
            self.window().setLocked(True)


if __name__ == "__main__":

    import studiolibrary

    # root = "P:/figaro/studiolibrary/anim"
    # name = "Figaro Pho - Anim"
    superusers = ["kurt.rathjen"]
    plugins = ["examplePlugin"]

    # Lock all folders unless you're a superuser.
    studiolibrary.main(superusers=superusers, plugins=plugins, add=True)

    # This command will lock only folders that contain the word "Approved" in their path.
    # studiolibrary.main(name=name, root=root, superusers=superusers, lockFolder="Approved")

    # This command will lock all folders except folders that contain the words "Users" or "Shared" in their path.
    # studiolibrary.main(name=name, root=root, superusers=superusers, unlockFolder="Users|Shared")
コード例 #27
0
    def setEnvironment(self, env=None):
        if not env:
            env = self.environment()

        if env:
            for var in env:
                os.environ.setdefault(var, "")
                if studiolibrary.isWindows():
                    os.environ[var] = ";".join(env[var])
                else:
                    os.environ[var] = ":".join(env[var])

    def run(self, cmd=None, env=None):
        try:
            from subprocess import Popen, PIPE, STDOUT

            self.setEnvironment(env)

            if not cmd:
                cmd = self.command()
            print cmd
            p = Popen(cmd, shell=False, stdin=PIPE, stdout=PIPE)
        except:
            import traceback
            print traceback.format_exc()


if __name__ == "__main__":
    import studiolibrary
    studiolibrary.main(plugins=["launcherplugin.launcher"], name="Launcher")
コード例 #28
0
        @param action:
        """
        action.trigger()
        event = QtGui.QKeyEvent(QtCore.QEvent.KeyPress, QtCore.Qt.Key_Escape,
                                QtCore.Qt.NoModifier)
        if isinstance(action.parent().parent(), QtGui.QMenu):
            QtCore.QCoreApplication.postEvent(action.parent().parent(), event)
        else:
            QtCore.QCoreApplication.postEvent(action.parent(), event)


class ExtendedLabel(QtGui.QLabel):
    def __init__(self, *args, **kwargs):
        """
        @param args:
        @param kwargs:
        """
        QtGui.QLabel.__init__(self, *args, **kwargs)
        self.setFixedHeight(20)

    def mouseReleaseEvent(self, ev):
        """
        @param ev:
        """
        self.emit(QtCore.SIGNAL('clicked'))


if __name__ == "__main__":
    import studiolibrary
    studiolibrary.main()
コード例 #29
0
# An example for how to lock specific folders using the lockRegExp param

import studiolibrary

if __name__ == "__main__":

    # Use the studiolibrary.app context for creating a QApplication instance
    with studiolibrary.app():

        # Lock all folders that contain the words "icon" & "Pixar" in the path
        lockRegExp = "icon|Pixar"

        studiolibrary.main(name="Example3", path="data", lockRegExp=lockRegExp)