Re: Registering a python function in C

2007-09-05 Thread [EMAIL PROTECTED]
On Sep 3, 7:11 pm, fernando <[EMAIL PROTECTED]> wrote: > > Is Maya a different python build than what is contained at python.org? > > If so, I suggest you get your C program to work with the latest python > > build > > from python.org. Then see if you can get it to work with the Maya > > version.

Re: Registering a python function in C

2007-09-04 Thread Matt McCredie
> > Is Maya a different python build than what is contained at python.org? > > If so, I suggest you get your C program to work with the latest python > > build > > from python.org. Then see if you can get it to work with the Maya > > version. > > Ok, did that. If I write a normal C++ program and u

Re: Registering a python function in C

2007-09-03 Thread fernando
> Is Maya a different python build than what is contained at python.org? > If so, I suggest you get your C program to work with the latest python > build > from python.org. Then see if you can get it to work with the Maya > version. Ok, did that. If I write a normal C++ program and use the pytho

Re: Registering a python function in C

2007-08-31 Thread [EMAIL PROTECTED]
On Aug 31, 3:33 pm, fernando <[EMAIL PROTECTED]> wrote: > Thanks for the responses. To be more specific, this code is part of a > Maya plugin. The funcion MFnPlugin::registerUI takes a pointer to a > PyObject which is the function that will set up the UI for that > plugin. The code Matimus posted s

Re: Registering a python function in C

2007-08-31 Thread fernando
Thanks for the responses. To be more specific, this code is part of a Maya plugin. The funcion MFnPlugin::registerUI takes a pointer to a PyObject which is the function that will set up the UI for that plugin. The code Matimus posted seems to me exactly like what I need to do, except that maya give

Re: Registering a python function in C

2007-08-31 Thread Hrvoje Niksic
fernando <[EMAIL PROTECTED]> writes: > Could someone post an example on how to register a python function as > a callback in a C function? If I understand correctly, your C function receives a Python function (as a function object of type PyObject *), which you need to call from C. To do that, c

Re: Registering a python function in C

2007-08-30 Thread Matimus
On Aug 30, 2:21 pm, fernando <[EMAIL PROTECTED]> wrote: > Could someone post an example on how to register a python function as > a callback in a C function? It expects a pointer to PyObject... how do > I expose that? Basically, the signature of the function is > foo(PyObject* obj), where obj is th

Registering a python function in C

2007-08-30 Thread fernando
Could someone post an example on how to register a python function as a callback in a C function? It expects a pointer to PyObject... how do I expose that? Basically, the signature of the function is foo(PyObject* obj), where obj is the callback function... It's not exactly extending or embedding,