Authored by Greg Zaal (gregzaal) on Sep 14 2014, 4:42 PM.
"Like" token, awarded by vklidu.
Currently when there are multiple copies of the same addon (such as one in master and one that was installed manually), an error is shown in the Addons tab of the user preferences stating "Multiple addons with the same name found! / likely a problem with the script search path. / (see console for details)". The user then has to open the console (or on linux/mac, restart blender from a terminal), read through the big mess of text and figure out where the duplicates are and then go delete one of them manually.
This patch attempts to improve the usability of how the user would solve this issue.
It lists the addons that have duplicates, and then lists the two duplicate files, providing a delete button to remove those files and resolve the issue directly in Blender.
I couldn't find an existing operator that could delete a file given only its path, so I wrote one at the top of space_userpref.py. I'm pretty sure that's not the right place for such an operator, but I don't know where is. The operator also removes the item in the addon_utils.error_duplicates list corresponding to the addon.
Finally, one limitation: if there are more than two duplicates of the same addon, it'll only show one pair in the list. When you delete one of the two, it'll appear as if the problem is solved, however when restarting blender next it'll show the error again, this time with a different pair of files. How it detects the duplicate modules confuses me a bit, so I couldn't think of a way to solve this.
Greg Zaal (gregzaal) retitled this revision from to "Multiple addons with the same name found!" - added list of duplicates with delete button.
Greg Zaal (gregzaal) updated this object.
Greg Zaal (gregzaal) set the repository for this revision to rB Blender.
Greg Zaal (gregzaal) added a project: BF Blender.
Campbell Barton (campbellbarton) added a reviewer: Greg Zaal (gregzaal).
I can see why you might want to do this, but addons can also be directories (packages), and those directories don't necessarily have write permissions.
In corner cases, deleting may be incorrect (one addon may be accessed from 2+ paths, via symlinks) - so deleting the file may remove both.
This is an exceptional case, its possible for users to end up in this situation (hence the warning), but I rather keep this as something the user resolves outside of Blender in a file manager.
can we have a solution to see the duplicate addons?
Maybe one button "Duplicate addons" under Support level area.
One intermediate solution is to just have them listed there without the removal operator.
To save space they could be under a expandable prop.
I can apply the UI part of this patch, so that people are at least capable of finding out what's going on without checking the console.
If you can do that with a UI then is great ( I don't want to make changes into Blender 3D over development team).
Greg Zaal (gregzaal) updated this revision to Diff 7542.
Greg Zaal (gregzaal) edited reviewers, added: Campbell Barton (campbellbarton); removed: Greg Zaal (gregzaal).
Made some changes to the patch.
Added support for UTF-8 errors, add-on duplicates files group the files including the user script folder, reorganized the UI with the show/hide buttons, clearer output in the console.