I am here with the hope to find the answer, I am stuck at a prolemo…
I have a class GUI():
def init(self):
constructor
that has two methods one is
def update(self):
do some task and return
and second methods is createUI(self):
now in this second method I have few attrColorSliderGrp & attrControlGrp
cmds.attrControlGrp("contour",attribute='conturSG.miContourWidth')
cmds.attrColorSliderGrp("ColorSlider", l='Color', at='WireframeSG.miContourColor')
cmds.scriptJob(parent="contour",e=["SelectionChanged","update()"])
but the problem lies with in the scriptJob event’s second argument call to update method…
everytime a selection is changed i get error saying[I]
Error: name ‘update’ is not defined
Traceback (most recent call last):
File “<maya console>”, line 1, in <module>
NameError: name ‘update’ is not defined # [/I]
i tried to use explcit call
inst=GUI(self.message)
the second argument for event as GUI.update(inst)
still didnt work end up with similar erro then i tried to use partial i got error saying # NameError: name ‘partial’ is not defined #
how should i pass the second argument to event in case of scriptJob … I am stuck here … :(:
I dont get any error and everything goes smooth if I am not using OOP’s approach… but their must be somepart I am missing that I am not doing right…