Yes, that's right. You could use a dictionary or an array of tuples, or
simply a module or member variable, depending on what makes most sense for
your situation. This way you would be able to look up your callback later.
Store the return from the callback creation in a manner that allows you to
associate it with your call.

If the callback is used by a particular module or package then I would add
a module or static class level var that initializes to None. Once your Maya
startup runs, you store this callback ID on the var. Then you can check to
see if that var is None later on. If its not None, you know it's been
initialized.


On Thursday, April 4, 2013, Sune wrote:

> On Wednesday, April 3, 2013 10:36:19 PM UTC+2, Sune wrote:
> > I'm adding and removing callbacks with MSceneMessage from a python
> script. I'd like to somehow query if these callbacks exist already, before
> adding them. I searched for the answer, but came up blank.
> >
> > I guess I could define these in a python plugin, then I would only ever
> have one instance, but that seems like a workaround.
> >
> > Any help would be great!
> >
> > Sune
>
> I would be likely just be adding these on start up. When adding callbacks
> all I seem to get back is their id and from their ID I would not know what
> they are, unless I keep track of that myself, that's I think is what you
> are suggesting right?
> Thanks :-)
>
> --
> 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 [email protected] <javascript:;>.
> To post to this group, send email to 
> [email protected]<javascript:;>
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to