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 pymel.core as pm | |
| ''' | |
| Here are some examples of how to use the pin_to_surface.py script. | |
| ''' | |
| # make a nurbsPlane | |
| oNurbs = pm.nurbsPlane(n='nurbsPlane1') | |
| # You can specify the nurbsSurface by string, PyNode transform or PyNode shape. |
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 annotations | |
| import maya.mel as mel | |
| import maya.cmds as cmds | |
| import maya.api.OpenMaya as om2 | |
| import maya.api.OpenMayaUI as omui2 | |
| import os | |
| import time | |
| import logging |
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
| # encoding: utf8 | |
| import maya.api.OpenMaya as om | |
| import math | |
| def maya_useNewAPI(): | |
| pass | |
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
| # encoding: utf8 | |
| import maya.api.OpenMaya as om | |
| import maya.api.OpenMayaUI as omui | |
| import maya.api.OpenMayaRender as omr | |
| def maya_useNewAPI(): | |
| pass |
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 maya import cmds | |
| def simple_collision_check(obj_xform, collider_shape): | |
| ''' | |
| Create a node network that checks whether an objects xform is colliding with a mesh. Returns a condition node where outputX, Y, and Z are 1 | |
| for colliding and 0 when not colliding. | |
| :param obj_xform: Path to object transform | |
| :param collider_shape: Path to mesh transform |
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
| """Reset bind pose for selected joints.""" | |
| import maya.cmds as cmds | |
| cmds.dagPose(bindPose=True, reset=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
| """Enter move-joints-mode for all skinned geo.""" | |
| import maya.cmds as cmds | |
| for skin in cmds.ls(type='skinCluster'): | |
| cmds.skinCluster(skin, edit=True, moveJointsMode=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
| import maya.cmds as cmds | |
| import maya.OpenMaya as omo | |
| # (Open Maya Old) | |
| def soft_selection_weights(): | |
| ''' create and return a list of the soft selection weights ''' | |
| #TODO: Would be nice to rewrite this using the new API. Low priority. | |
| #TODO: Debug on multiple selections | |
| # temporary hack. Turn off symmetry when reading MRichSelection until I learn to use symmetry. |
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.cmds | |
| import maya.mel as mel | |
| def SetFPS(fps): | |
| unit = 'ntscf' | |
| if fps == 15: | |
| unit = 'game' | |
| elif fps == 24: | |
| unit = 'film' | |
| elif fps == 25: |
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.cmds as cmds | |
| ''' | |
| # EXAMPLE USAGES: | |
| # Removes all unused influences from skinCluster1 | |
| remove_unused_influences('skinCluster1') | |
| # Removes the two specified joints from Body_SkinCluster, | |
| but only if they are not currently weighted to anything. | |
| remove_unused_influences('Body_SkinCluster', ['leg_L0_5_jnt', 'leg_R0_5_jnt']) |
NewerOlder