Page 1 of 1

User plugin not automatically loaded

PostPosted: Sat Aug 10, 2019 6:38 pm
by ecke101
I am developing a user plugin but it doesn't load automatically so every time I start MakeHuman I had to go to the settings and click "Activate plugins".
While I wrote this I found the problem in mhmain.py.. the self.getSetting('activeUserPlugins') list contains user plugin names without ".py" but the code checks for the file-name including ".py".

edit: oops changed it because only if it is a file it should remove the last 3 letters.

I fixed it by changing mhmain.py:
Code: Select all
row 553:
--elif os.path.isfile(location) and file.endswith('.py') and not file.startswith('_') and file in self.getSetting('activeUserPlugins'):
++elif os.path.isfile(location) and file.endswith('.py') and not file.startswith('_') and file[:-3] in self.getSetting('activeUserPlugins'):

Re: User plugin not automatically loaded

PostPosted: Tue Aug 13, 2019 8:39 pm
by Aranuvir
Thanks for posting, nice find! Sorry for my late reaction, I've been out of town...
The fix is in the repo, now (commit^). Could you recheck? For no certain reason I prefer using os.path as much as possible on path strings, though your solution is correct, too.

Re: User plugin not automatically loaded

PostPosted: Tue Aug 13, 2019 9:54 pm
by ecke101
Yes that makes sense, and it works. I don't think your late reaction was a problem in this case.. Not a very critical bug I guess. :) But I like the fact that someone responds. Not like when you report a bug to big companies and never hear anything.