Skip to content

Latest commit

 

History

History
251 lines (152 loc) · 6.03 KB

DOCS.md

File metadata and controls

251 lines (152 loc) · 6.03 KB

Please feel free to improve this page as needed. Thank you.

Index

FAQ

Also, see the frequently asked questions.

FAQ


How to run from code

import studiolibrary
studiolibrary.main()

Top


How to reload for development

This code removes all previously imported Studio Library modules and caches before loading.

Tip: You can also hold "Shift" when clicking the shelf button to reload the modules.

import studiolibrary
studiolibrary.reload()

import studiolibrary
studiolibrary.main()

Top


How to set the name and path from code

Create and show a library with the name "MY_PROJECT - Anim" that points to a custom path.

import studiolibrary
studiolibrary.main(name="MY_PROJECT - Anim", path="P:/MY_PROJECT/studiolibrary/anim")

Top


How to create a local and shared library

Create and show both a shared library and a local library.

import studiolibrary
studiolibrary.main(name="Local", path="C:/temp/studiolibrary/")
studiolibrary.main(name="Shared", path="P:/shared/studiolibrary/")

Top


How to create more than one library instance

In this example we create a library for the animation department, previs department and another library for a local temp folder.

Create three libraries and only show the third one. You can access the others via the settings menu.

import studiolibrary

studiolibrary.main(name="Local", path="C:/temp/studiolibrary", show=False)
studiolibrary.main(name="MY_PROJECT - Anim", path="P:/MY_PROJECT/studiolibrary/anim", show=False)
studiolibrary.main(name="MY_PROJECT - Previs", path="P:/MY_PROJECT/studiolibrary/previs")

Top


How to create a library for several projects

When implementing the Studio Library for several projects we can get the current project name and then set the name and path.

import studiolibrary

# You could use an environment variable or an in-house python module to get the project name.
project = "MY_PROJECT"

path = "/shared/libraries/" + project + "_Library"
name = project + " Library"

studiolibrary.main(name=name, path=path)

Top


How to set a library for several projects

import studiolibrary

libraries = [
    {"name":"Project1", "path":r"D:\Library_Data", "default":True, "theme":{"accentColor":"rgb(0,200,100)"}},
    {"name":"Project2", "path":r"D:\Library_Data2"},
    {"name":"Temp", "path":r"C:\temp"},
]

studiolibrary.setLibraries(libraries)
studiolibrary.main()

Top


How to debug "No object match when loading data"

Make sure “Debug mode” is checked under the settings menu. Apply the pose and it should print any strange behavior in the script editor. This can make applying poses much slower.

You might see something like...

// mutils : Cannot find matching destination object for ...
// mutils : load function took 0.38400 sec /

Top


How to fix a scene that has unknown nodes

Unknown nodes are because a plugin is missing. An easy way to fix this issue is to execute the following code in the Python script editor. The other way is to find the missing plugin and make sure it’s loaded.

# Delete all unknown nodes in the current scene
import maya.cmds
n = maya.cmds.ls(type="unknown")
if n:
    maya.cmds.delete(n)

Top


How to lock and unlock specific folders

import studiolibrary

path= "C:/MY_PROJECT/studiolibrary/anim"
name = "MY_PROJECT - Anim"
superusers = ["kurt.rathjen"]

# Unlock all folders. This is the default behaviour.
studiolibrary.main(name=name, path=path)

# Lock all folders unless you're a super user.
studiolibrary.main(name=name, path=path, superusers=superusers)

# This command will lock only folders that contain the word "Approved" in their path.
studiolibrary.main(name=name, path=path, 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, path=path, superusers=superusers, unlockFolder="Users|Shared")

Top


How to manually install

Download

Download and unzip the studiolibrary.zip file from the following link.

www.studiolibrary.com

Installation

  1. Unzip the downloaded studiolibrary.zip file.

  2. Copy the Python code below to the Maya Python script editor. Make sure the tab is Python and not MEL.

  3. Change the path variable in the Python code to the studiolibrary folder.

  4. Press Ctrl + Enter to run.

  5. Drag the Python code to the shelf.

# Python code

import os
import sys
   
# 3. REPLACE this path with the location to the unzipped `src` location. 
path = r"C:\Users\USER\Downloads\studiolibrary\src"
   
if not os.path.exists(path):
    raise IOError(r'The source path does not exist!')
   
if path not in sys.path:
    sys.path.insert(0, path)
   
import studiolibrary
studiolibrary.main()

Top