Trouble Loading Plugin on OSX

MakeHuman python API, python plugins, etc

Moderator: joepal

Trouble Loading Plugin on OSX

Postby lychrel » Tue Jun 06, 2017 2:39 pm

I've been following the general steps detailed here

http://www.makehumancommunity.org/forum/viewtopic.php?f=15&t=13398&start=30

to implement a plugin. I want to take a list of 20 measurements and apply them to the current model. First, I wrote a namespace for 1_mhapi, _avatar.py, which pulls partly from 0_modeling_a_measurement.py:

_avatar.py
https://gist.github.com/lychrel/954e3fa0c279f1e08104519b02055fed
Code: Select all
#!/usr/bin/python

from namespace import NameSpace

import mh
import humanmodifier
import material
import gui
import gui3d
import log
import os
import algos3d
import events3d
from cStringIO import StringIO
from core import G
from codecs import open

import math
import numpy as np
import guicommon
import module3d
import getpath
import guimodifier
import language

class Avatar(NameSpace):
    """this namespace wraps the model_all avatar generation function"""

    def __init__(self,api):
        self.api = api
        NameSpace.__init__(self)
        self.human = api.internals.getHuman()
        self.trace()
        self.ruler = Ruler()

    @property
    def measure(mod_name):
        return modifiers[mod_name].fullName   

    def getMeasure(self, measure):
        human = G.app.selectedHuman
        measure = self.ruler.getMeasure(human, measure)
        return measure

    def displayToData(modifier, modifier_name, measurement):
        # make measurement jive with ruler
        mod_name_ruler = 'measure/' + modifier_name + '-decr|incr'     # this part is silly
        modValue = 0.0        # start all values at 0.0
        goal = float(value)             # standalone
        measure = getMeasure(mod_name_ruler)
        minValue = -1.0
        maxValue = 1.0
        if math.fabs(measure - goal) < 0.01:
            return modValue                           # modifier val (start at 0.0)
        else:
            tries = 10
            while tries:
                if math.fabs(measure - goal) < 0.01:
                    break;
                if goal < measure:
                    maxValue = modValue
                    if value == minValue:
                        break
                    modValue = minValue + (modValue - minValue) / 2.0
                    modifier.updateValue(modValue, 0)
                    measure = getMeasure(mod_name_ruler)            # new measurement method
                else:
                    minValue = modValue
                    if value == maxValue:
                        break
                    modValue = modValue + (maxValue - modValue) / 2.0
                    modifier.updateValue(modValue, 0)
                    measure = getMeasure(mod_name_ruler)           # new measurement method
                tries -= 1
        return modValue

    def model_all(self, measurements):

        modifier_names = ['measure-neck-circ',
                         'measure-neck-height',
                         'measure-upperarm-circ',
                         'measure-upperarm-length',
                         'measure-lowerarm-length',
                         'measure-wrist-circ',
                         'measure-frontchest-dist',
                         'measure-bust-circ',
                         'measure-underbust-circ',
                         'measure-waist-circ',
                         'measure-napetowaist-dist',
                         'measure-waisttohip-dist',
                         'measure-shoulder-dist',
                         'measure-hips-circ',
                         'measure-upperleg-height',
                         'measure-thigh-circ',
                         'measure-lowerleg-height',
                         'measure-calf-circ',
                         'measure-knee-circ',
                         'measure-ankle-circ']

        # create/init all modifiers! (is this the right way to do it?)
        modifiers = humanmodifier.loadModifiers(getpath.getSysDataPath('modifiers/measurement_modifiers.json'), app.selectedHuman)

        # apply all other measurements
        for mod, name, meas in zip(modifiers, modifier_names, measurements):
            displayToData(mod, name, meas)

"""
Ruler class for measuring mesh
"""

class Ruler:

    """
  This class contains ...
  """

    def __init__(self):

        # these are tables of vertex indices for each body measurement of interest
        # TODO define in data file?

        self.Measures = {}
        self.Measures['measure/measure-neck-circ-decr|incr'] = [7514,10358,7631,7496,7488,7489,7474,7475,7531,7537,7543,7549,7555,7561,7743,7722,856,1030,1051,850,844,838,832,826,820,756,755,770,769,777,929,3690,804,800,808,801,799,803,7513,7515,7521,7514]
        self.Measures['measure/measure-neck-height-decr|incr'] = [853,854,855,856,857,858,1496,1491]


        self.Measures['measure/measure-upperarm-circ-decr|incr']=[8383,8393,8392,8391,8390,8394,8395,8399,10455,10516,8396,8397,8398,8388,8387,8386,10431,8385,8384,8389]
        self.Measures['measure/measure-upperarm-length-decr|incr'] = [8274,10037]

        self.Measures['measure/measure-lowerarm-length-decr|incr'] = [10040,10548]
        self.Measures['measure/measure-wrist-circ-decr|incr']=[10208,10211,10212,10216,10471,10533,10213,10214,10215,10205,10204,10203,10437,10202,10201,10206,10200,10210,10209,10208]

        self.Measures['measure/measure-frontchest-dist-decr|incr']=[1437,8125]
        self.Measures['measure/measure-bust-circ-decr|incr']=[8439,8455,8462,8446,8478,8494,8557,8510,8526,8542,10720,10601,10603,10602,10612,10611,10610,10613,10604,10605,10606,3942,3941,3940,3950,3947,3948,3949,3938,3939,3937,4065,1870,1854,1838,1885,1822,1806,1774,1790,1783,1767,1799,8471]
        self.Measures['measure/measure-underbust-circ-decr|incr'] = [10750,10744,10724,10725,10748,10722,10640,10642,10641,10651,10650,10649,10652,10643,10644,10645,10646,10647,10648,3988,3987,3986,3985,3984,3983,3982,3992,3989,3990,3991,3980,3981,3979,4067,4098,4073,4072,4094,4100,4082,4088, 4088]
        self.Measures['measure/measure-waist-circ-decr|incr'] = [4121,10760,10757,10777,10776,10779,10780,10778,10781,10771,10773,10772,10775,10774,10814,10834,10816,10817,10818,10819,10820,10821,4181,4180,4179,4178,4177,4176,4175,4196,4173,4131,4132,4129,4130,4128,4138,4135,4137,4136,4133,4134,4108,4113,4118,4121]
        self.Measures['measure/measure-napetowaist-dist-decr|incr']=[1491,4181]
        self.Measures['measure/measure-waisttohip-dist-decr|incr']=[4121,4341]
        self.Measures['measure/measure-shoulder-dist-decr|incr'] = [7478,8274]

        self.Measures['measure/measure-hips-circ-decr|incr'] = [4341,10968,10969,10971,10970,10967,10928,10927,10925,10926,10923,10924,10868,10875,10861,10862,4228,4227,4226,4242,4234,4294,4293,4296,4295,4297,4298,4342,4345,4346,4344,4343,4361,4341]

        self.Measures['measure/measure-upperleg-height-decr|incr'] = [10970,11230]
        self.Measures['measure/measure-thigh-circ-decr|incr'] = [11071,11080,11081,11086,11076,11077,11074,11075,11072,11073,11069,11070,11087,11085,11084,12994,11083,11082,11079,11071]

        self.Measures['measure/measure-lowerleg-height-decr|incr'] = [11225,12820]
        self.Measures['measure/measure-calf-circ-decr|incr'] = [11339,11336,11353,11351,11350,13008,11349,11348,11345,11337,11344,11346,11347,11352,11342,11343,11340,11341,11338,11339]

        self.Measures['measure/measure-ankle-circ-decr|incr'] = [11460,11464,11458,11459,11419,11418,12958,12965,12960,12963,12961,12962,12964,12927,13028,12957,11463,11461,11457,11460]
        self.Measures['measure/measure-knee-circ-decr|incr'] = [11223,11230,11232,11233,11238,11228,11229,11226,11227,11224,11225,11221,11222,11239,11237,11236,13002,11235,11234,11223]




        self._validate()

    def _validate(self):
        """
        Verify currectness of ruler specification
        """
        names = []
        for n,v in self.Measures.items():
            if len(v) % 2 != 0:
                names.append(n)
        if len(names) > 0:
            raise RuntimeError("One or more measurement rulers contain an uneven number of vertex indices. It's required that they are pairs indicating the begin and end point of every line to draw. Rulers with uneven index count: %s" % ", ".join(names))

    def getMeasure(self, human, measurementname):
        measure = 0
        vindex1 = self.Measures[measurementname][0]
        for vindex2 in self.Measures[measurementname]:
            vec = human.meshData.coord[vindex1] - human.meshData.coord[vindex2]
            measure += math.sqrt(vec.dot(vec))
            vindex1 = vindex2

        return 10.0 * measure    # removed non-metric mode



and then I tried to write a plugin meant to test it:

10_modeling_all_measurements.py
https://gist.github.com/lychrel/2d657db92ad7a1b846e3bddbca0ac23a
Code: Select all
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-

import math
import numpy as np
import guicommon
import module3d
import humanmodifier
import gui
import log
import getpath
from core import G
import guimodifier
import language

class Test(object):
    def __init__(self, __measurements):
        self.measurements = __measurements
        self.mhm = G.app.mhapi.avatar.model_all(self.measurements)

def load(app):
    """
        Plugin load function, needed by design.
        """
    category = app.getCategory('Modelling')
   
    test = Test([10]*20)


# TODO ??
#taskview.showGroup('neck')

def unload(app):
pass



I moved _avatar into the 1_mhapi folder with the other namespaces and the plugin into MakeHuman/resources/plugins (I'm on OSX), but I couldn't get it to load. When running Makehuman from the executable in the application's MacOS directory, I get the following output:

Code: Select all
/Applications/MakeHuman/MakeHuman.app/Contents/MacOS/MakeHuman ; exit;
MakeHuman Copyright (C) 2001-2017 http://www.makehuman.org
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. For details use the option --license

Cannot open file '/Applications/MakeHuman/MakeHuman.app/Contents/Resources/icons/makehuman_bg.svg', because: No such file or directory
Cannot open file '/Applications/MakeHuman/MakeHuman.app/Contents/Resources/icons/makehuman_bg.svg', because: No such file or directory
QPixmap::scaled: Pixmap is a null pixmap
QPixmap::scaled: Pixmap is a null pixmap
2017-06-06 10:21:20.882 MakeHuman[63993:960753] IMKClient Stall detected, *please Report* your user scenario attaching a spindump (or sysdiagnose) that captures the problem - (imkxpc_attributesForCharacterIndex:reply:) block performed very slowly (2.00 secs).
TRACE 1_mhapi.namespace.__init__():19
TRACE 1_mhapi.api.__init__():10
TRACE 1_mhapi.namespace.__init__():19
TRACE 1_mhapi._assets.__init__():18
TRACE 1_mhapi.namespace.__init__():19
TRACE 1_mhapi._internals.__init__():18
TRACE 1_mhapi.namespace.__init__():19
TRACE 1_mhapi._mesh.__init__():11
TRACE 1_mhapi.namespace.__init__():19
TRACE 1_mhapi._locations.__init__():15
TRACE 1_mhapi.namespace.__init__():19
TRACE 1_mhapi._version.__init__():12
abort: no repository found in '/Applications/MakeHuman/MakeHuman.app/Contents' (.hg not found)!
TRACE 1_mhapi.namespace.__init__():19
TRACE 1_mhapi._viewport.__init__():11
TRACE 1_mhapi.namespace.__init__():19
TRACE 1_mhapi._internals.getHuman():22
TRACE 1_mhapi._modifiers.__init__():25
TRACE 1_mhapi.namespace.__init__():19
TRACE 1_mhapi._ui.__init__():67
libpng warning: iCCP: known incorrect sRGB profile
TRACE 1_mhapi._locations.getSystemDataPath():36
TRACE 1_mhapi._locations.getUserDataPath():49
TRACE 1_mhapi._locations.getUserHomePath():41
TRACE 1_mhapi._locations.getSystemDataPath():36
TRACE 1_mhapi._locations.getUserDataPath():49


which doesn't even mention any errors in _avatar.py or my plugin.

Am I skipping some step or doing something obviously incorrect? I'm not sure what to make of those error messages, as they don't seem to pertain to the plugin I wrote. I'm relatively new to MakeHuman, and I'd greatly appreciate any help I can get.
Last edited by lychrel on Tue Jun 06, 2017 5:42 pm, edited 2 times in total.
lychrel
 
Posts: 16
Joined: Mon Jun 05, 2017 7:29 pm

Re: Trouble Loading Plugin (with MHAPI)

Postby joepal » Tue Jun 06, 2017 2:43 pm

Yes. You need to also add _avatar.py to the api.py file; https://github.com/makehumancommunity/c ... api/api.py

You could also consider whether what you want to do actually needs modifying MHAPI as such, or if it would suffice to implement a new plugin using MHAPI. For an example of the latter, see https://github.com/makehumancommunity/c ... etdownload
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4473
Joined: Wed Jun 04, 2008 11:20 am

Re: Trouble Loading Plugin (with MHAPI)

Postby lychrel » Tue Jun 06, 2017 3:01 pm

Thanks so much! I'll try that and get back to you.
lychrel
 
Posts: 16
Joined: Mon Jun 05, 2017 7:29 pm

Re: Trouble Loading Plugin (with MHAPI)

Postby joepal » Tue Jun 06, 2017 3:05 pm

Anyway, if you think up cool new functionality, pull requests are welcome here: https://github.com/makehumancommunity/c ... gins-mhapi

(MHAPI was moved to a separate new repo)
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4473
Joined: Wed Jun 04, 2008 11:20 am

Re: Trouble Loading Plugin (with MHAPI)

Postby lychrel » Tue Jun 06, 2017 3:21 pm

Update: I updated api.py and deleted its concordant pyc file, expecting MakeHuman to automatically generate a new one. It didn't -- is that normal? -- so I manually re-compiled it. Unfortunately, nothing discernibly different happened after this.

If I could just get some relevant error messages... I'm sure there's something wrong in _avatar.py, so I'd expect a crash with a trace. Do modules just not load anything that doesn't work? Perhaps my load function is incorrect? I'm still a bit shady on how modules are loaded, so I took the loading code from a different plugin.

I'm modifying mhapi itself because I want to wrap the function calls for use with the socket server plugin; my goal is to run a script that can call one function with a list of 20 measurements and generate the model with them.

If I'm ever able to test the darn thing, I'd love to submit it as a pull request! I've seen some threads on here about procedural modeling.
lychrel
 
Posts: 16
Joined: Mon Jun 05, 2017 7:29 pm

Re: Trouble Loading Plugin (with MHAPI)

Postby joepal » Tue Jun 06, 2017 3:34 pm

Yes, if you want to wrap stuff for socket, then it makes sense.

My guess is you're missing something trivial, such as editing the wrong code file. From looking through your code files they don't seem to be wrong in themselves, although I didn't test it.

Try adding the following to the bottom of api.py:

Code: Select all
        print("NOW IMPORTING AVATAR")
        from ._avatar import Avatar
        self.avatar = Avatar(self)
        print("AFTER IMPORTING AVATAR")


If the print statements don't show up in the output, I'd start looking at if you've linked to the wrong code file or something.

Maybe you could also add a print statement to the load method in the plugin to see if that actually runs.
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4473
Joined: Wed Jun 04, 2008 11:20 am

Re: Trouble Loading Plugin (with MHAPI)

Postby lychrel » Tue Jun 06, 2017 3:45 pm

Well, this is interesting. api.py seems to load _avatar successfully:

Code: Select all
NOW IMPORTING AVATAR
TRACE 1_mhapi.namespace.__init__():19
TRACE 1_mhapi._internals.getHuman():22
TRACE 1_mhapi._avatar.__init__():47
AFTER IMPORTING AVATAR


but a print statement inside 10_modeling_all_measurement's load function never prints, and the plugin never gets a .pyc. Assuming the trace() call is just supposed to print that one line, it seems I've succeeded in adding an (untested) namespace to mhapi, but not in loading a plugin.
lychrel
 
Posts: 16
Joined: Mon Jun 05, 2017 7:29 pm

Re: Trouble Loading Plugin (with MHAPI)

Postby joepal » Tue Jun 06, 2017 5:12 pm

Well, then at least you know the problem lies with the plugin file rather than with MHAPI.

Not having a mac, I'd assume the plugin file is never found in the first place. You could enter something like

Code: Select all
lsdjkhlsdkfjhs
    dhgsdklhgsdklfhs
          dhgsdlkjfhgsdlkhg


... in it to see if that generates a syntax error. But given that there's no pyc, I'd say MH never discovers it.

Can you paste an output of "ls -l [full path to where you put the plugin file]"?

Searching the forums for other posts related to plugins and mac, only reasonably similar I find is this: viewtopic.php?f=13&t=11815&p=28887&hilit=mac+plugin#p28887
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4473
Joined: Wed Jun 04, 2008 11:20 am

Re: Trouble Loading Plugin (with MHAPI)

Postby lychrel » Tue Jun 06, 2017 5:23 pm

When I run what you suggested, I get the following output (my plugin, 10_model_measurements.py -- I had the name wrong -- is just before 1_mhapi):

Code: Select all
ls -l /Applications/MakeHuman/MakeHuman.app/Contents/Resources/plugins
total 1376
-rw-r--r--@  1 jackburker  admin   1496 Mar  7 04:20 0_modeling_0_modifiers.py
-rw-r--r--   1 jackburker  admin   1854 Jun  6 10:21 0_modeling_0_modifiers.pyc
-rw-r--r--@  1 jackburker  admin   7979 Mar  7 04:20 0_modeling_8_random.py
-rw-r--r--   1 jackburker  admin   7476 Jun  6 10:21 0_modeling_8_random.pyc
-rw-r--r--@  1 jackburker  admin   7250 Mar  7 04:20 0_modeling_9_custom_targets.py
-rw-r--r--   1 jackburker  admin   8057 Jun  6 10:21 0_modeling_9_custom_targets.pyc
-rw-r--r--@  1 jackburker  admin  14643 Mar  7 04:20 0_modeling_a_measurement.py
-rw-r--r--   1 jackburker  admin  17317 Jun  6 10:21 0_modeling_a_measurement.pyc
-rw-r--r--@  1 jackburker  admin  23458 Mar  7 04:20 0_modeling_background.py
-rw-r--r--   1 jackburker  admin  23718 Jun  6 10:21 0_modeling_background.pyc
-rw-r--r--@  1 jackburker  admin    655 Jun  6 11:40 10_model_measurements.py
drwxr-xr-x@ 31 jackburker  admin   1054 Jun  6 11:38 1_mhapi
-rw-r--r--@  1 jackburker  admin   6797 Mar  7 04:20 2_foot_posing.py
-rw-r--r--   1 jackburker  admin   6240 Jun  6 10:21 2_foot_posing.pyc
-rw-r--r--@  1 jackburker  admin  10442 Mar  7 04:20 2_posing_expression.py
-rw-r--r--   1 jackburker  admin  10168 Jun  6 10:21 2_posing_expression.pyc
-rw-r--r--@  1 jackburker  admin   8228 Mar  7 04:20 3_libraries_clothes_chooser.py
-rw-r--r--   1 jackburker  admin   9288 Jun  6 10:21 3_libraries_clothes_chooser.pyc
-rw-r--r--@  1 jackburker  admin   2859 Mar  7 04:20 3_libraries_eye_chooser.py
-rw-r--r--   1 jackburker  admin   3567 Jun  6 10:21 3_libraries_eye_chooser.pyc
-rw-r--r--@  1 jackburker  admin   2364 Mar  7 04:20 3_libraries_eyebrows.py
-rw-r--r--   1 jackburker  admin   3056 Jun  6 10:21 3_libraries_eyebrows.pyc
-rw-r--r--@  1 jackburker  admin   2372 Mar  7 04:20 3_libraries_eyelashes.py
-rw-r--r--   1 jackburker  admin   3069 Jun  6 10:21 3_libraries_eyelashes.pyc
-rw-r--r--@  1 jackburker  admin  11275 Mar  7 04:20 3_libraries_material_chooser.py
-rw-r--r--   1 jackburker  admin  10835 Jun  6 10:21 3_libraries_material_chooser.pyc
-rw-r--r--@  1 jackburker  admin   2336 Mar  7 04:20 3_libraries_polygon_hair_chooser.py
-rw-r--r--   1 jackburker  admin   3134 Jun  6 10:21 3_libraries_polygon_hair_chooser.pyc
-rw-r--r--@  1 jackburker  admin  10110 Mar  7 04:20 3_libraries_pose.py
-rw-r--r--   1 jackburker  admin  10808 Jun  6 10:21 3_libraries_pose.pyc
-rw-r--r--@  1 jackburker  admin   5226 Mar  7 04:20 3_libraries_proxy_chooser.py
-rw-r--r--   1 jackburker  admin   6444 Jun  6 10:21 3_libraries_proxy_chooser.pyc
drwxr-xr-x@  7 jackburker  admin    238 Jun  6 10:21 3_libraries_skeleton
-rw-r--r--@  1 jackburker  admin   2342 Mar  7 04:20 3_libraries_teeth.py
-rw-r--r--   1 jackburker  admin   3021 Jun  6 10:21 3_libraries_teeth.pyc
-rw-r--r--@  1 jackburker  admin   2348 Mar  7 04:20 3_libraries_tongue.py
-rw-r--r--   1 jackburker  admin   3030 Jun  6 10:21 3_libraries_tongue.pyc
-rw-r--r--@  1 jackburker  admin   2833 Mar  7 04:20 4_rendering_9_viewer.py
-rw-r--r--   1 jackburker  admin   3630 Jun  6 10:21 4_rendering_9_viewer.pyc
drwxr-xr-x@  6 jackburker  admin    204 Jun  6 10:21 4_rendering_opengl
-rw-r--r--@  1 jackburker  admin   2203 Mar  7 04:20 4_rendering_scene.py
-rw-r--r--   1 jackburker  admin   2945 Jun  6 10:21 4_rendering_scene.pyc
-rw-r--r--@  1 jackburker  admin   7922 Mar  7 04:20 5_settings_0_settings.py
-rw-r--r--   1 jackburker  admin   9796 Jun  6 10:21 5_settings_0_settings.pyc
-rw-r--r--@  1 jackburker  admin   3531 Mar  7 04:20 5_settings_mouse.py
-rw-r--r--   1 jackburker  admin   4736 Jun  6 10:21 5_settings_mouse.pyc
-rw-r--r--@  1 jackburker  admin   4201 Mar  7 04:20 5_settings_shortcuts.py
-rw-r--r--   1 jackburker  admin   5538 Jun  6 10:21 5_settings_shortcuts.pyc
-rw-r--r--@  1 jackburker  admin   4240 Mar  7 04:20 6_help.py
-rw-r--r--   1 jackburker  admin   4971 Jun  6 10:21 6_help.pyc
-rw-r--r--@  1 jackburker  admin   3779 Mar  7 04:20 7_data.py
-rw-r--r--   1 jackburker  admin   4898 Jun  6 10:21 7_data.pyc
-rw-r--r--@  1 jackburker  admin   6422 Mar  7 04:20 7_example.py
-rw-r--r--   1 jackburker  admin   5913 Jun  6 10:21 7_example.pyc
-rw-r--r--@  1 jackburker  admin   8879 Mar  7 04:20 7_expression_mixer.py
-rw-r--r--   1 jackburker  admin  10559 Jun  6 10:21 7_expression_mixer.pyc
-rw-r--r--@  1 jackburker  admin   2479 Mar  7 04:20 7_logging.py
-rw-r--r--   1 jackburker  admin   3624 Jun  6 10:21 7_logging.pyc
-rw-r--r--@  1 jackburker  admin  30300 Mar  7 04:20 7_material_editor.py
-rw-r--r--   1 jackburker  admin  34142 Jun  6 10:21 7_material_editor.pyc
-rw-r--r--@  1 jackburker  admin   5880 Mar  7 04:20 7_profile.py
-rw-r--r--   1 jackburker  admin   8921 Jun  6 10:21 7_profile.pyc
-rw-r--r--@  1 jackburker  admin  13139 Mar  7 04:20 7_scene_editor.py
-rw-r--r--   1 jackburker  admin  17724 Jun  6 10:21 7_scene_editor.pyc
-rw-r--r--@  1 jackburker  admin  36022 Mar  7 04:20 7_scripting.py
-rw-r--r--   1 jackburker  admin  33726 Jun  6 10:21 7_scripting.pyc
-rw-r--r--@  1 jackburker  admin   6313 Mar  7 04:20 7_shell.py
-rw-r--r--   1 jackburker  admin   7255 Jun  6 10:21 7_shell.pyc
-rw-r--r--@  1 jackburker  admin   3664 Mar  7 04:20 7_targets.py
-rw-r--r--   1 jackburker  admin   5180 Jun  6 10:21 7_targets.pyc
drwxr-xr-x@ 12 jackburker  admin    408 Jun  6 10:21 8_asseteditor
drwxr-xr-x@  6 jackburker  admin    204 Jun  6 10:21 8_community_assets
drwxr-xr-x@ 12 jackburker  admin    408 Jun  6 10:21 8_server_socket
drwxr-xr-x@  4 jackburker  admin    136 Jun  6 10:21 9_export_bvh
drwxr-xr-x@ 10 jackburker  admin    340 Jun  6 10:21 9_export_collada
drwxr-xr-x@ 16 jackburker  admin    544 Jun  6 10:21 9_export_fbx
-rw-r--r--@  1 jackburker  admin   1796 Mar  7 04:20 9_export_light.py
-rw-r--r--   1 jackburker  admin   2751 Jun  6 10:21 9_export_light.pyc
drwxr-xr-x@  5 jackburker  admin    170 Jun  6 10:21 9_export_obj
drwxr-xr-x@  6 jackburker  admin    204 Jun  6 10:21 9_export_ogre
drwxr-xr-x@  5 jackburker  admin    170 Jun  6 10:21 9_export_stl
-rw-r--r--@  1 jackburker  admin   1771 Mar  7 04:20 9_export_uvmap.py
-rw-r--r--   1 jackburker  admin   2728 Jun  6 10:21 9_export_uvmap.pyc
-rwxr-xr-x@  1 jackburker  admin   1882 Mar 21 14:05 README.md
drwxr-xr-x@  3 jackburker  admin    102 Mar 21 14:05 blender_distribution
drwxr-xr-x@  3 jackburker  admin    102 Mar 21 14:05 blender_source


The plugin is in the correct directory, verified both by the discussion you linked and by the fact that all the other plugins in the dir are loading correctly.

I tried putting junk text into the plugin, to no avail. It's evidently just not even loading the script.

Strange how it's definitely checking the other plugins...
Last edited by lychrel on Tue Jun 06, 2017 5:49 pm, edited 1 time in total.
lychrel
 
Posts: 16
Joined: Mon Jun 05, 2017 7:29 pm

Re: Trouble Loading Plugin (with MHAPI)

Postby lychrel » Tue Jun 06, 2017 5:33 pm

Using chmod to give the plugin executable permission also didn't change anything. I tried separating the plugin into a directory with an __init__ script that imports the test class, as the successful Mac user did in the discussion you linked, but that didn't change anything, either.

The only clue I can see is an error before the mhapi traces:

Code: Select all
QPixmap::scaled: Pixmap is a null pixmap
QPixmap::scaled: Pixmap is a null pixmap
2017-06-06 13:49:43.754 MakeHuman[77826:1177823] IMKClient Stall detected, *please Report* your user scenario attaching a spindump (or sysdiagnose) that captures the problem - (imkxpc_attributesForCharacterIndex:reply:) block performed very slowly (2.08 secs).
TRACE 1_mhapi.namespace.__init__():19


Since I indexed my plugin with 0 (and previously, with 10, which may have put it before 1_mhapi), is it possible that this OSX warning is relevant to my issue? (I included the first mhapi trace for reference.) Maybe MakeHuman attempted to load my plugin, failed as OSX threw this "IMKClient Stall", and eventually moved on to the others? Even if it is related, though, I don't see how it's helpful, unless that Makehuman[77826:1177823] is some sort of stack trace.

What's your development environment? I can try this on Linux or Windows, though the latter will put me out of my CLI element.
lychrel
 
Posts: 16
Joined: Mon Jun 05, 2017 7:29 pm

Next

Return to Python scripts

Who is online

Users browsing this forum: No registered users and 1 guest