This Python script is not maintained and was replaced by the more robust Rust version below:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // HACK: Workaround since a maya project's scripts folder is not added | |
| // to the PYTHONPATH by default | |
| // WARN: only one userSetup.mel is loaded. | |
| // using this script will prevent several viz scripts from running | |
| // Github issue has been logged and will be resolved on the viz/pipeline end | |
| // given that a userSetup script should be available to... well, users. | |
| // HACK: sourcing a mel file that sources other files is known to cause |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [ -z "$1" ]; then | |
| printf "%bPlease pass a name for the new shelf (e.g. model_tools)%b\n" "${FG_RED}" "${NORMAL}" | |
| exit 1 | |
| fi | |
| name=$1 | |
| generate_shelf_empty() { | |
| cat << EOF > ${new_shelf} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Not all print statements in maya show up in Command Line output bar | |
| # This is an alternative to pymel's display* print statements | |
| import pymel.core as pm | |
| def mprint(*args): | |
| print_args = ("//",) + args + ("//\n",) | |
| pm.mel.mprint(*print_args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import maya.utils | |
| import maya.OpenMaya | |
| def deferOnlyInteractive(func, *args, **kwargs): | |
| if maya.OpenMaya.MGlobal.mayaState() == maya.OpenMaya.MGlobal.kInteractive: | |
| maya.utils.executeDeferred(func, *args, **kwargs) | |
| else: | |
| print("Execution of interactive function {0} was skipped in non-interactive mode" | |
| "".format(func.__name__)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import print_function | |
| import pymel.core as pm | |
| def openPort(port=":7002", **kwargs): | |
| print("Opening command port", port) | |
| commandPortWrapper(port, False, **kwargs) | |
| def closePort(port=":7002", **kwargs): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import print_function | |
| import pymel.core as pm | |
| import pymel.core.nodetypes as nt | |
| from pymel.core import (PyNode, MayaAttributeError, MayaNodeError) | |
| cmds = pm.cmds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import print_function | |
| import pymel.core as pm | |
| objPath = pm.workspace.path.joinpath("OBJ", "exports") | |
| for obj in objPath.files(): | |
| pm.importFile(obj, gr=False, type="OBJ", options="mo=1;lo=0") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import print_function | |
| import pymel.core as pm | |
| driver, driven = pm.selected() | |
| # NOTE: PyNode.Attribute.rotatePivot.set() may be equivalent | |
| pm.move(driven.rotatePivot, *driver.getTranslation(worldSpace=True)) | |
| pm.move(driven.scalePivot, *driver.getTranslation(worldSpace=True)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| main() { | |
| usage="${FG_CYAN}usage: removeStudent filename.ma${NORMAL}" | |
| if [ -z "${1}" ]; then | |
| echo -e "${FG_RED}Filename not given${NORMAL}" | |
| echo -e ${usage} | |
| elif [ ! -e "${1}" ]; then | |
| echo -e "${FG_RED}Filename ${1} does not exist${NORMAL}" |
NewerOlder