python - Python 类型方法和 Maya 变换节点上的类型函数有什么区别?

标签 python maya pymel

标题中的问题

示例代码:

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

最佳答案

看看这个简单的例子。您正在尝试比较两个不同的东西 - Joint 类方法 type 和 python 内置函数 type - 他们有相同的名字,所有:

class Joint():
    def type(self):
        return u'joint'

>>> j = Joint()
>>> j.type()
'joint'
>>> type(j)
<class '__main__.Joint'>

关于python - Python 类型方法和 Maya 变换节点上的类型函数有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34084333/

相关文章:

python - 使用 Python 在更大的列表中查找兼容列表

api - MDGModifier 返回值

python - Maya 2017 中的透明窗口

python - 我的 .bat 文件在使用 `python` 后无法读取行

c++ - 如何在 Maya Api 中对齐顶点和法线?

python - 如何在 Maya 中的重复对象上选择特定边缘?

python - 本地测试 GAE-python27-django 项目

python - 如何设置 Fabric 任务的工作目录?

python - 根据另一个列表对一个列表进行排序,长度不均匀

python - 在 MEL 中使用 Stand Output 进行打印