This file contains 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.api.OpenMaya as om2 | |
import maya.api.OpenMayaAnim as omAnim2 | |
def setNewBindPose(): | |
sel = om2.MGlobal.getActiveSelectionList() | |
jntMObj = sel.getDependNode(0) | |
jntDepNode = om2.MFnDependencyNode(jntMObj) | |
jntWMtxPlug = jntDepNode.findPlug("worldMatrix", False).elementByLogicalIndex(0) |
This file contains 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.api.OpenMaya as om2 | |
import maya.api.OpenMayaAnim as omAnim2 | |
def getSkinCluster(): | |
sel = om2.MGlobal.getActiveSelectionList() | |
shapeDagPath = sel.getDagPath(0).extendToShape() | |
shapeMeshFn = om2.MFnMesh(shapeDagPath) | |
inMeshPlug = shapeMeshFn.findPlug('inMesh', False) |
This file contains 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 FabricEngine.Core | |
import pymel.core as pm | |
from maya import cmds | |
# Create Maya Canvas Node and preset instance | |
nodeName = cmds.createNode('canvasNode', name='myGraph') | |
dummyVec3NodeName = cmds.FabricCanvasInstPreset( | |
mayaNode=nodeName, | |
execPath="", |
This file contains 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 FabricEngine.Core | |
import json | |
client = FabricEngine.Core.createClient({'guarded': True}) | |
client.registerExtensions("C:\\temp\\Exts") | |
client.loadExtension('EricTools') | |
extData = json.loads(client.getExtensionsDesc()) | |
for k, v in extData.iteritems(): | |
if k == 'EricTools': |
This file contains 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
require Math; | |
operator entry() { | |
// String to Vec3 Dict | |
Vec3 myDict[String]; | |
myDict['bob'] = Vec3(1,2,3); | |
report(myDict['bob']); | |
// Integer to String Dict |
This file contains 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
require Math; | |
operator entry() { | |
Vec3 myArray[][]; | |
Vec3 array1[]; | |
array1.push(Vec3(1,2,3)); | |
Vec3 array2[]; | |
array2.push(Vec3(3,2,1)); |
This file contains 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 MaxPlus | |
import pymxs | |
rt = pymxs.runtime | |
obj = MaxPlus.Factory.CreateHelperObject(MaxPlus.ClassIds.Point) | |
node = MaxPlus.Factory.CreateNode(obj, 'thing') | |
fabMatrixCtrlClassID = MaxPlus.Class_ID(0x06a53772, 0x7c2c7c4b) | |
fabMatrixCtrl = MaxPlus.Factory.CreateMatrix3Controller(fabMatrixCtrlClassID) |
This file contains 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 pymel.core as pm | |
import pymel.core.datatypes as dt | |
sel = pm.ls(selection=True) | |
shapeNode = pm.listRelatives(sel[0])[0] | |
pm.constructionHistory(shapeNode) | |
pm.makeIdentity(sel[0], apply=True, t=True, r=True, s=True) |
This file contains 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 MaxPlus | |
node = MaxPlus.SelectionManager.GetNodes()[0] | |
# Add Attr Holder to selected object | |
#~ attrHolder = MaxPlus.Factory.CreateObjectModifier(MaxPlus.ClassIds.EmptyModifier) | |
#~ attrHolder.SetName(MaxPlus.WStr('myObjAttrs')) | |
#~ node.AddModifier(attrHolder) | |
# Find Modifier Programmatically |
This file contains 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 MaxPlus | |
# Selected object should have Attribute Holder on it | |
for n in MaxPlus.SelectionManager.Nodes: | |
mod = n.GetModifier(0) | |
attrContainer = mod.GetCustomAttributeContainer()[0] | |
for p in attrContainer.ParameterBlock.Parameters: | |
print p.GetName() |
NewerOlder