I can suggest another method:
mm.eval('python("import sys; sys.modules['%s'].Callback._doCall()")' %
__name__)

This makes sure that the module is found even if it isn't imported into the
global namespace '__main__'.
(__name__ is the name of the current module in scope)


On Mon, Sep 8, 2008 at 5:57 AM, Jakob Welner <[EMAIL PROTECTED]> wrote:

> As far as I can see this is working perfectly well. Thanks a lot for the
> tip!
> Only thing that caused problems was the prefixing of module - took me some
> minutes to figure out the error message as I misread your comments in the
> first place - but I guess you'd wanna change the __call__ method to include
> this:
>
> if __name__ != '__main__':
>       mm.eval('python("' + __name__ + '.Callback._doCall()")')
> else:
>       mm.eval('python("Callback._doCall()")')
>
> for the sake of coherency in case you should put it into pymel.
> In any case, it solved the problem and I can at last keep my code clean and
> tidy without compromising anything so thanks again.
>
>
> --
> JAKOB WELNER
> _____________
> Animator | R&D
> jakob.welner.dk
>
> >
>


-- 


- Ofer
www.mrbroken.com

--~--~---------~--~----~------------~-------~--~----~
Yours,
Maya-Python Club Team.
-~----------~----~----~----~------~----~------~--~---

Reply via email to