Page 1 of 2

Python interpreter in Makehuman

PostPosted: Thu Apr 21, 2011 8:54 am
by emanalsayyad
Where Can i find the Python interpreter in the makehuman ?

Re: Python interpreter in Makehuman

PostPosted: Thu Apr 21, 2011 9:19 am
by mflerackers
It's in main.c.

Re: Python interpreter in Makehuman

PostPosted: Thu Apr 21, 2011 10:55 am
by emanalsayyad
i mean python interpreter in the application which i add functionality in it like the interpreter in blender
really, i cannot run main.c or main.py what can i do ?

Re: Python interpreter in Makehuman

PostPosted: Thu Apr 21, 2011 11:08 am
by mflerackers
The interpreter is created in main.c, which needs to be build as either a module or an application. It also exports the mh library which takes care of windowing, input and opengl. The main.py script is called by main.c when the application is executed, alternatively you can run main.py (using python.exe) if you built the module.

Re: Python interpreter in Makehuman

PostPosted: Thu Apr 21, 2011 7:56 pm
by emanalsayyad
sorry but where is the pin point i want to see the python interpreter which enable me to add functionality "The MakeHuman application incorporates a complete Python interpreter enabling you to add Python functionality to the a released version of the application without having to install any development software" this quot is from the makehuman developer guide that means the interpreter is in the MH application itself but where ?

Re: Python interpreter in Makehuman

PostPosted: Fri Apr 22, 2011 1:22 am
by mflerackers
Py_Initialize() on line 782 of src/main.c. See also http://docs.python.org/extending/embedding.html.

Re: Python interpreter in Makehuman

PostPosted: Fri Apr 22, 2011 9:02 pm
by Manuel
emanalsayyad wrote:sorry but where is the pin point i want to see the python interpreter which enable me to add functionality "The MakeHuman application incorporates a complete Python interpreter enabling you to add Python functionality to the a released version of the application without having to install any development software" this quot is from the makehuman developer guide that means the interpreter is in the MH application itself but where ?


makehuman itself is the interpreter. You can write new commands or plugins in python to add new functions. Most of API are defined in the "core" folder, take a look: they are python modules that define the python API...

Re: Python interpreter in Makehuman

PostPosted: Fri Apr 22, 2011 9:45 pm
by emanalsayyad
makehuman itself is the interpreter. You can write new commands or plugins in python to add new functions. Most of API are defined in the "core" folder, take a look: they are python modules that define the python API...
i had took a look at the core folder .. is that mean that i can write my applicaiton with python on eclipse and use the APIs of MH to integrate and receive results from makehuman? if that true how can i see the the API of the makehuman in my application in order to integrate with it, is it like the SDK of the programs that when i install it gives me ability to call the APIs of the programs

another mean had reached to me that the makehuman it self has an interpreter which could be opened in its GUI and i can add functionality in it specially the following statement say that i can add functionality without installing any development software

"The MakeHuman application incorporates a complete Python interpreter enabling you to add Python functionality to the a released version of the application without having to install any development software"
which one is true ?

Re: Python interpreter in Makehuman

PostPosted: Sat Apr 23, 2011 1:25 am
by mflerackers
Like I said, you can either run makehuman.exe, which links to python26.dll and creates an interpreter, then loads main.py. Or you can run main.py using python.exe, in that case mh.pyd is used. makehuman.exe and mh.pyd contain exactly the same code, just one is an application and the other one a library. If you write your own application in python, it is easier to work with mh.pyd.

Re: Python interpreter in Makehuman

PostPosted: Sat Apr 23, 2011 8:38 pm
by emanalsayyad
sorry for my inexperienced manner ,
when i run makehuman.exe this error appeared to me
'import site' failed; use -v for traceback
Version 1.0.0
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "main.py", line 813, in <module>
application = MHApplication()
File "main.py", line 161, in __init__
self.scene3d.update()
File "./core\module3d.py", line 1295, in update
self.attach(obj)
File "./core\module3d.py", line 1272, in attach
obj.object3d.transparentQuads = obj.transparentQuads
AttributeError: 'mh.object3D' object has no attribute 'transparentQuads'
Could not run main Python script