Hello all,
I have just started with learning Python so I decided to give PyMel a
go.
I am currently creating custom meta nodes for a rigging script and I
am searching for a OO and tidy way to get info from these nodes. I
think this is called a class or subclass but I am not sure on the
terminology. So for example.
I have a metaNode with an attribute called "children"+ an int.
now I would like to something like this
myChilderenList = myMetaNode.getChilderen()
so I would like to turn a function like this below into a class (or
something similar):
def getMetaInfo(metaNode, infoType):
if infoType == 'child':
children = metaNode.getAttr('children')
return children
if infoType == 'parent':
parent = metaNode.getAttr('parent')
return parent
Does anyone have a suggestion on how I would approach this ? or if
this is even possible ?
I did see the example of creating custom classes in the PyMel examples
folder. But as far as i understood that's only for creating new
objects.
Thanks,
Red
--
http://groups.google.com/group/python_inside_maya