You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Result: One error as below is returned: # Error: MayaNodeError: file /Applications/Autodesk/maya2020/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.7/site-packages/pymel/core/nodetypes.py line 1323: Maya Node does not exist (or is not unique):: u'None' #
In Maya 2019, it returns persp.
The text was updated successfully, but these errors were encountered:
As a workaround, I'm using this function, which splits the long name of the node by the pipe character and then makes a new PyNode from the first non-empty item in the list. Not sure if it'll work in all situations but it's sufficient for my needs.
importpymel.coreaspmdefget_root(node):
# longName is of the format '|root|parent|child', starting with an initial pipelong_name=node.longName()
parent_names=long_name.split(u'|')
return (Noneiflen(parent_names) <=1elsepm.PyNode(u'|{}'.format(parent_names[1])))
Run the following script in Maya 2020
import pymel.core as pm
py_node = pm.PyNode("persp")
root_node = py_node.root()
print(root_node)
Result: One error as below is returned:
# Error: MayaNodeError: file /Applications/Autodesk/maya2020/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.7/site-packages/pymel/core/nodetypes.py line 1323: Maya Node does not exist (or is not unique):: u'None' #
In Maya 2019, it returns persp.
The text was updated successfully, but these errors were encountered: