Thanks alot fellas. The someList = getSomeList() was kind of were I
On Jan 7, 11:24 pm, "Ofer Koren" <
kor...@gmail.com> wrote:
> Another way, somewhat similar to lambdas but without those 'buggy'
> behaviours, is to use a 'callback' object:
> class Callback:
> def __init__(self,func,*args,**kwargs):
> self.func = func
> self.args = args
> self.kwargs = kwargs
> def __call__(self,*args, **kwargs):
> return self.func(*self.args, **self.kwargs)
>
> def someDef(theList, someParameter):
> ....
>
> cmds.button(command = Callback(someDef, someList, someParameter = 2))
>
> (FYI - Pymel has a more robust version of this object which supports Undo:
> from pymel import Callback)
>