Search code examples
pythonmayapymel

What is the difference between the Python type method and the type function on a Maya Transform Node?


Question in title

Example code:

>>> j.type()
u'joint'
>>> type(j)
<class 'pymel.core.nodetypes.Joint'>

Solution

  • Look at this simple example. You are trying to compare two different things - Joint class method type and python built-in function type - they have same names, that all:

    class Joint():
        def type(self):
            return u'joint'
    
    >>> j = Joint()
    >>> j.type()
    'joint'
    >>> type(j)
    <class '__main__.Joint'>