User plugin not automatically loaded

Tech support and suggestions forum. If you only have a basic question on how to get started, please use the "newbies" forum in the community section.

Moderator: joepal

User plugin not automatically loaded

Postby ecke101 » Sat Aug 10, 2019 6:38 pm

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'):
ecke101
 
Posts: 21
Joined: Thu May 09, 2019 6:59 pm

Re: User plugin not automatically loaded

Postby Aranuvir » Tue Aug 13, 2019 8:39 pm

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.
Aranuvir
 
Posts: 1221
Joined: Sun Oct 12, 2014 2:12 pm

Re: User plugin not automatically loaded

Postby ecke101 » Tue Aug 13, 2019 9:54 pm

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.
ecke101
 
Posts: 21
Joined: Thu May 09, 2019 6:59 pm


Return to Bugs, problems and feature requests

Who is online

Users browsing this forum: No registered users and 3 guests