Try this:
def create(self, name='file', addPlace2dTexture=True):
texture.create(self,name=name)
On Thu, Jun 18, 2009 at 3:52 PM, sberger <[email protected]> wrote:
>
> Hi guys, I have this problem that i have no idea how to fix.
>
> I have a base class:
> class texture(shadingNode):
> def __init__(self, node=''):
> shadingNode.__init__(self, node)
> self.nodeType = 'texture'
> def create(self, name='texture'):
> return self.__init__(mc.shadingNode(self.nodeType,
> asTexture=True,
> name=name))
>
> Then I have a second class that inherit from the first one.
> Now I would like to override the create method to add an argument.
> I have no idea how to create this method override
>
> This is what I have now...
> class file(texture):
> """ my maya file node class """
> def __init__(self, node=''):
> texture.__init__(self, node)
> self.nodeType = 'file'
> self.place2dTexture = ''
> self.setDefaultOutput('outColor')
> def create(self, name='file', addPlace2dTexture=True):
> self.create(name=name)
> if addPlace2dTexture:
> self.addPlace2dTextureNode()
> return self
>
> But when I call it like that:
> myFile = file().create()
>
> I get recursion error from python.
>
> Anyone know how to do this?
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---