Created
January 10, 2022 09:30
-
-
Save lampysprites/dc20b4497a1fc21719e2289014060671 to your computer and use it in GitHub Desktop.
Browse Addon files in blender
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## EDIT space_userpref.py | |
# e.g. on windows, C:\Program Files\Blender Foundation\Blender 2.93\2.93\scripts\startup\bl_ui\space_userpref.py | |
# on windows, edit as admin | |
# CLOSE BLENDER AND BACKUP THAT FILE BEFORE STARTING!! | |
## before "class USERPREF_PT_addons(...)" | |
class USER_OT_AddonBrowse(bpy.types.Operator): | |
bl_idname = "user.browse_addon" | |
bl_label = "Browse Files" | |
path: bpy.props.StringProperty() | |
def execute(self, context): | |
from webbrowser import open | |
open(self.path) | |
return {'FINISHED'} | |
## after "sub.operator("preferences.addon_remove")", with the same number of tabs as there | |
sub.operator("user.browse_addon", icon='FILEBROWSER').path = os.path.dirname(mod.__file__) | |
# inside "classes = (...)" near the end of the file | |
USER_OT_AddonBrowse, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment