How can i deal with current version code as a library

MakeHuman python API, python plugins, etc

Moderator: joepal

How can i deal with current version code as a library

Postby emanalsayyad » Wed Apr 20, 2011 12:59 pm

i want to ask the same question as here viewtopic.php?f=9&t=201
but in the current version . sorry i cannot understand the comments that answered this question. so How can i deal with code as a library? when i build it an error occurred " import mh ImportError: No module named mh" take in mind that i have no experience in python and this is the first time i deal with it
emanalsayyad
 
Posts: 12
Joined: Tue Apr 19, 2011 5:29 pm

Re: How can i deal with current version code as a library

Postby mflerackers » Wed Apr 20, 2011 1:07 pm

First of all remember that you can only use or link to makehuman code if your own program is licensed under the GPL 3.0 or later.

If that is the case, is your own program in C, C++ or Python?
MakeHuman project Developer
mflerackers
 
Posts: 636
Joined: Thu Feb 05, 2009 11:53 am
Location: Kyoto

Re: How can i deal with current version code as a library

Postby emanalsayyad » Wed Apr 20, 2011 1:52 pm

i wont develop a complete product to make it be licensed under GPL it will be a prototype application for me .Most probably it will be written in python
emanalsayyad
 
Posts: 12
Joined: Tue Apr 19, 2011 5:29 pm

Re: How can i deal with current version code as a library

Postby mflerackers » Wed Apr 20, 2011 2:01 pm

Do you write your own GUI in another toolkit or do you plan to use the makehuman GUI? if it is the former, you will need to replicate all functionality present in the C code mh module, if it is the latter, you can start with adapting main.py to your needs.
MakeHuman project Developer
mflerackers
 
Posts: 636
Joined: Thu Feb 05, 2009 11:53 am
Location: Kyoto

Re: How can i deal with current version code as a library

Postby emanalsayyad » Wed Apr 20, 2011 2:13 pm

thank you for your concern. yes i will write my own GUI in another toolkit what do you mean with" replicate all functionality present in the C code mh module" can you provide me more details ?
emanalsayyad
 
Posts: 12
Joined: Tue Apr 19, 2011 5:29 pm

Re: How can i deal with current version code as a library

Postby mflerackers » Wed Apr 20, 2011 2:25 pm

The C code exports a python module that defines objects and methods to build and display the meshes in OpenGL. You can't use this module in your own program as it is thightly integrated with SDL and our event loop. So you will have to either replicate the functionality of the mh module or rewrite a lot of the python code.
MakeHuman project Developer
mflerackers
 
Posts: 636
Joined: Thu Feb 05, 2009 11:53 am
Location: Kyoto

Re: How can i deal with current version code as a library

Postby emanalsayyad » Thu Apr 21, 2011 3:49 pm

it is too complex. so if i go throw the another way that i use makehuman GUI but i don't want to change the measurements of meshes with the GUI i want to pass my own Values to the main (not controlled with the GUI ) how can i do that
emanalsayyad
 
Posts: 12
Joined: Tue Apr 19, 2011 5:29 pm

Re: How can i deal with current version code as a library

Postby mflerackers » Thu Apr 21, 2011 4:00 pm

You can't pass arbitrary values to change measurements because that is not how it works (otherwise we would have let the user do that in the gui). We only have a few morphs to change hips, waist etc, and after applying the morph we measure the hips, waist etc and display it's new value. So it is kind of cheating. To implement inputting direct values you would have to use a binary search and try applying different morphs until you reach measurements which are close enough to what you inputted. If it was simple we would have already implemented it, but it is not, as some morphs influence others which makes the whole thing quite complex, so it's still on the TODO list.
MakeHuman project Developer
mflerackers
 
Posts: 636
Joined: Thu Feb 05, 2009 11:53 am
Location: Kyoto

Re: How can i deal with current version code as a library

Postby emanalsayyad » Mon Apr 25, 2011 5:25 pm

so why had the API of makehumae be made ? my knowledge about APIs is to make other application call or reuse it and you said that it is hard to integrate with and to do that i need to re-implement main.c
emanalsayyad
 
Posts: 12
Joined: Tue Apr 19, 2011 5:29 pm

Re: How can i deal with current version code as a library

Postby mflerackers » Tue Apr 26, 2011 12:00 am

This is true in case you are talking about a library, but makehuman is an application. Our API is for plugin developers, just like Blender's, Photoshop's or Skype's API. While it is possible to use makehuman inside another application, it requires a lot more time as we don't focus our efforts on that particular use case.
MakeHuman project Developer
mflerackers
 
Posts: 636
Joined: Thu Feb 05, 2009 11:53 am
Location: Kyoto

Next

Return to Python scripts

Who is online

Users browsing this forum: No registered users and 1 guest