Trouble Loading Plugin on OSX

MakeHuman python API, python plugins, etc

Moderator: joepal

Re: Trouble Loading Plugin on OSX

Postby joepal » Tue Jun 06, 2017 6:53 pm

This is the first I ever hear anything about something called "IMKClient". I don't know what that is.

I'd recommend running from source on linux if you want to do development. My environment is ubuntu 16.04.

See this for some hints on setup: http://www.makehumancommunity.org/wiki/ ... rom_source (there's an apt-get line a bit down).

If you want to follow the head of the development, you can opt for running the python3 port of MH found here: https://github.com/makehumancommunity/makehuman. To my knowledge MHAPI works with this.
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4465
Joined: Wed Jun 04, 2008 11:20 am

Re: Trouble Loading Plugin on OSX

Postby lychrel » Thu Jun 08, 2017 3:49 pm

Only just saw this because I didn't notice that the topic had accrued a second page... oops.

Thanks! I'll try that. It's cool that MakeHuman is getting a Python 3 release, too.
lychrel
 
Posts: 16
Joined: Mon Jun 05, 2017 7:29 pm

Re: Trouble Loading Plugin on OSX

Postby lychrel » Fri Jun 09, 2017 9:05 pm

I'm now running on the latest release of Ubuntu, and now I can get error messages! After moving _avatar and 0_modeling_all_measurements into the folder, I got this output when starting MakeHuman:
Code: Select all
Loading plugins
Importing plugin 0_model_all_measurements
Could not load 0_model_all_measurements
Traceback (most recent call last):
    File "./core/mhmain.py", line 530, in loadPlugin
        module = imp.load_module(name, fp, pathname, description)
    File "plugins/0_model_all_measurements.py", line 16, in <module>
        G.app.mhapi.avatar.model_all([10]*20)
        AttributeError: 'MHApplication' object has no attribute 'mhapi'


I figured that I shouldn't reference mhapi as a part of G until mhapi itself had been loaded, so I renamed the plugin to 8_model_all_measurements.py and ran again. After some debugging I got a more complicated error:

Image

so I guess I could either remove 0_model_a_measurement.py so that the modifiers aren't loaded before I load them, or simply access them via the human. The latter seems like a smarter idea, but I'm not sure how to do it.
lychrel
 
Posts: 16
Joined: Mon Jun 05, 2017 7:29 pm

Re: Trouble Loading Plugin on OSX

Postby lychrel » Fri Jun 09, 2017 10:49 pm

It's running!

I made some changes and it's now definitely modifying the person based on the list of values I provide. I guess I should re-implement 0_model_a_measurement (I moved it out of the plugins folder to quickly bypass the aforementioned error) to make sure it's doing what I think it is (or I can just drop debug prints everywhere).

Once I mess around with it a bit more, I'll try to make it work with the socket server. I can also submit a pull request to mhapi once I clean up the code sufficiently (and make it play nice with the existing plugins) -- seems like a functionality people might like to use.
lychrel
 
Posts: 16
Joined: Mon Jun 05, 2017 7:29 pm

Re: Trouble Loading Plugin on OSX

Postby lychrel » Sat Jun 10, 2017 1:11 am

I was looking through the mhapi code and realized I could probably access the modifiers like this:
Code: Select all
modifier = self.human.getModifier(modifierName)
modifier.setValue(power)


I'll try that out soon.
lychrel
 
Posts: 16
Joined: Mon Jun 05, 2017 7:29 pm

Re: Trouble Loading Plugin on OSX

Postby lychrel » Sat Jun 10, 2017 1:56 am

update: it only works "within range": i.e., it will move the measurement as close as it can to the correct value (and resolution can be increased by the number of tries allowed), but if it can place a measurement at, say, 30 cm max, then it can only reach 30 cm of a 40 cm supplied measurement. I'm looking further into why this is—i.e., why it can't just change that one vertex group, human proportions be damned—but I guess that's a good thing to have when trying to generate people, even procedural ones.
lychrel
 
Posts: 16
Joined: Mon Jun 05, 2017 7:29 pm

Previous

Return to Python scripts

Who is online

Users browsing this forum: No registered users and 1 guest

cron