Last active
January 10, 2017 14:07
-
-
Save taikomatsu/b0a9eb29b19e3c890d1a to your computer and use it in GitHub Desktop.
Get MDagPath from object name
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
from maya import OpenMaya | |
import pymel.core as pm | |
def mdagpath_from_name(name): | |
if not pm.objExists(name): | |
raise MayaNodeError, name | |
slist = OpenMaya.MSelectionList() | |
slist.add(name) | |
dagpath = OpenMaya.MDagPath() | |
slist.getDagPath(0, dagpath) | |
return dagpath | |
mdagpath_from_name('obj_name') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment