Just a small problem. You are calling your test function while adding your
callback, so it is trying to pass the None result to it.
a = om.MEventMessage.addEventCallback('SelectionChanged',test)
Just pass the name test to it instead. The callback will be the one to
actually call it.
On Monday, December 17, 2012, illunara wrote:
> Hi everybody
> I just have a small question about openMaya, it the
> MEventMessage.addEventCallback(). Here is my try:
>
> def test():
> ... print 'test'
>
> a = om.MEventMessage.addEventCallback('SelectionChanged',test())
>
> It gives me the
>
> // Error: 'NoneType' object is not callable //
> // Warning: Failed to call script callback //
>
> Help please :(
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To post to this group, send email to
> [email protected]<javascript:;>
> .
> To unsubscribe from this group, send email to
> [email protected] <javascript:;>.
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].