def example(): plugins = ["examplePlugin"] superusers = ["kurt.rathjen"] # Lock all folders unless you're a superuser. studiolibrary.main(superusers=superusers, plugins=plugins, add=True)
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")
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()
def test(): """ :rtype: None """ logging.basicConfig(level=logging.DEBUG) logging.info("Plugin Path:", __file__) studiolibrary.main(name="Demo", plugins=[__file__])
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)
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)
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__])
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")
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)
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()
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)
def executeMaya(self): import studiolibrary studiolibrary.main()
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")
# -*- 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")
def open_studiolibrary(): import studiolibrary studiolibrary.main()
@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()
def main(*args, **kwargs): import studiolibrary studiolibrary.main(*args, **kwargs)
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")
# -*- 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")
def studionLibrarys(): sys.path.append(r'\\octvision.com\cg\Tech\maya_sixteen\Python\OCT_anim') import studiolibrary studiolibrary.main()
def main(): from miraScripts.mayaTools import animation_tool sys.path.insert(0, os.path.dirname(animation_tool.__file__)) import studiolibrary studiolibrary.main()
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")
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")
@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()
# 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)