On Tuesday, March 12, 2013 5:22:55 AM UTC-7, simon payne wrote:
> Does anyone know if it is possible to inherit the pymel Transform class ?
>
> myObj = pymel.core.nodetypes.Transform('pCube1')
> myObj.getTranslation()
> # Result: dt.Vector([0.0, 0.0, 0.0]) #
>
> ....so....using the class Transform is fine. but.... :
>
>
> class myNewClass(pymel.core.nodetypes.Transform):
> def __init__(self):
> pass
>
>
> results in :
> # TypeError: Determined type is Transform, which is not a subclass of desired
> type myNewClass #
>
> ???? Any ideas?
It is. Kind of tricky. Been meaning to do a post about how to do it. I'll put
it on the top of my list and post link here.
Answers are here if you want to decrypt on your own:
https://github.com/LumaPictures/pymel/blob/master/examples/customClasses.py
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.