super function doesn't work inside a maya python module

前端 未结 4 1382
一个人的身影
一个人的身影 2021-01-14 01:51

Somehow, this works fine in the Maya/Python script editor, but fails when it\'s inside of my module code. Anyone have any ideas?

class ControlShape(object):
         


        
4条回答
  •  -上瘾入骨i
    2021-01-14 02:34

    It is good rule of thumb if you're using the super(Class, self).__init__ that you ALWAYS call it this way. This applies to your classes that inherit from object.

    class ControlShape(object):
       def __init__(self, *args, **kwargs):
          super(ControlShape, self).__init__()
          print 'Inside ControlShape...'
    

    See if that fixes your error. Just a guess as I don't use maya, but worth a shot.

提交回复
热议问题