Python interpreter in Makehuman

MakeHuman python API, python plugins, etc

Moderator: joepal

Python interpreter in Makehuman

Postby emanalsayyad » Thu Apr 21, 2011 8:54 am

Where Can i find the Python interpreter in the makehuman ?
emanalsayyad
 
Posts: 12
Joined: Tue Apr 19, 2011 5:29 pm

Re: Python interpreter in Makehuman

Postby mflerackers » Thu Apr 21, 2011 9:19 am

It's in main.c.
MakeHuman project Developer
mflerackers
 
Posts: 636
Joined: Thu Feb 05, 2009 11:53 am
Location: Kyoto

Re: Python interpreter in Makehuman

Postby emanalsayyad » Thu Apr 21, 2011 10:55 am

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 ?
emanalsayyad
 
Posts: 12
Joined: Tue Apr 19, 2011 5:29 pm

Re: Python interpreter in Makehuman

Postby mflerackers » Thu Apr 21, 2011 11:08 am

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.
MakeHuman project Developer
mflerackers
 
Posts: 636
Joined: Thu Feb 05, 2009 11:53 am
Location: Kyoto

Re: Python interpreter in Makehuman

Postby emanalsayyad » Thu Apr 21, 2011 7:56 pm

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 ?
emanalsayyad
 
Posts: 12
Joined: Tue Apr 19, 2011 5:29 pm

Re: Python interpreter in Makehuman

Postby mflerackers » Fri Apr 22, 2011 1:22 am

Py_Initialize() on line 782 of src/main.c. See also http://docs.python.org/extending/embedding.html.
MakeHuman project Developer
mflerackers
 
Posts: 636
Joined: Thu Feb 05, 2009 11:53 am
Location: Kyoto

Re: Python interpreter in Makehuman

Postby Manuel » Fri Apr 22, 2011 9:02 pm

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...
Manuel
 

Re: Python interpreter in Makehuman

Postby emanalsayyad » Fri Apr 22, 2011 9:45 pm

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 ?
emanalsayyad
 
Posts: 12
Joined: Tue Apr 19, 2011 5:29 pm

Re: Python interpreter in Makehuman

Postby mflerackers » Sat Apr 23, 2011 1:25 am

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.
MakeHuman project Developer
mflerackers
 
Posts: 636
Joined: Thu Feb 05, 2009 11:53 am
Location: Kyoto

Re: Python interpreter in Makehuman

Postby emanalsayyad » Sat Apr 23, 2011 8:38 pm

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
emanalsayyad
 
Posts: 12
Joined: Tue Apr 19, 2011 5:29 pm

Next

Return to Python scripts

Who is online

Users browsing this forum: No registered users and 1 guest

cron