class Connector(object):...def SetLoc(self):...# Thet move() command does not return anything# so nothing useful is being set here##self.basePos=mc.move(0,0,0, self.baseLoc)#self.topPos=mc.move(0,10,0,self.topLoc)
class Spring(Connector):def __init__(self, *args):
# When you make this call, the Connector's# constructor will do all of its work, which includes# calling Connector.SetLoc()super(Spring,self).__init__(*args)# This doesn't really do anything for a number of reasons# 1) Its a method reference on a temporary Connector object# 2) SetLoc takes no parameters# 3) SetLoc returns nothing##locs=Connector().SetLoc#self.SetSpring(locs)self.SetSpring()# We don't really need to pass locators to# this method. Spring is a subclass of Connector,# meaning that is has access to all of the attributes# already established by Connector##def SetSpring(self, locs):def SetSpring(self):...# If we just want to move the locators, we already# have the reference.##self.basePos=mc.move(0,25,0, locs(self.baseLoc))#self.topPos=mc.move(0,40,0,locs(self.topLoc))mc.move(0, 25, 0, self.baseLoc)mc.move(0, 40, 0, self.topLoc)
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/88ccabda-2fff-4df6-a1bb-f538bb248b8d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Sure. Feel free to update with more questions as you explore.
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/5e9b3ebc-19b6-4d95-933c-e43800e9c58e%40googlegroups.com.