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 | |
| ''' | |
| An Autodesk Maya PyMEL script that calculates a pole vector position | |
| based on 3 input PyNode objects. example: leg, knee, ankle bones. | |
| Chris Lesage chris@rigmarolestudio.com | |
| ''' | |
| def calculate_pole_vector(p1, p2, p3, poleDistance=1): | |
| """ |
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
| # this is an example script how ngSkinTools can be automated | |
| # to configure left-right influence mapping | |
| # this example assumes that the scene has a skinned pPlane1 | |
| # which has ngSkinTools info already initialized. if not, | |
| # see http://www.ngskintools.com/documentation/api/mll-interface.html | |
| # for tips to how to do that programatically | |
| # for this we use "manual mapping overrides" feature: | |
| # the same where you can correct automatic associations by hand, | |
| # only this time we choose to 'bake' the whole mapping using the |
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 ngSkinTools.importExport import JsonImporter | |
| from ngSkinTools.influenceMapping import InfluenceMapping | |
| from ngSkinTools.mllInterface import MllInterface | |
| from ngSkinTools.ui.events import LayerEvents | |
| from ngSkinTools.ui.layerDataModel import LayerDataModel | |
| def ngSkinToolsImport(fileName, targetMesh): | |
| ''' | |
| loads a JSON file (previously exported with ngSkinTools exporter) and loads data onto provided mesh. |
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
| print "-------------------------------------------" | |
| import sys | |
| import os | |
| from maya import cmds | |
| print "Environment info:" | |
| print "Maya version:", cmds.about(installedVersion=True) | |
| print "Maya API version:", cmds.about(apiVersion=True) | |
| print cmds.about(operatingSystem=True), cmds.about(operatingSystemVersion=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
| """ | |
| This is a test for Autodesk Maya to demonstrate that when skin cluster inputs are not transform nodes, | |
| Maya simply crashes using MFnSkinCluster.setWeights() API call. | |
| 1. Run this script a few times to demonstrate that everything works as expected: you have a simple skinned mesh, | |
| and you set weights for single joint, single vertex. | |
| 2. set "enable_bug_and_crash_maya" to True and rerun script - might need few reruns of the script. | |
| Eventually, maya crashes. | |
| """ |
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 cProfile | |
| import pstats | |
| from random import random | |
| class SampleObject: | |
| def __init__(self): | |
| self.sample_data = random() | |
| class SampleObjectNew(object): |