Skip to content

Instantly share code, notes, and snippets.

@lampysprites
Created January 10, 2022 09:30
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lampysprites/dc20b4497a1fc21719e2289014060671 to your computer and use it in GitHub Desktop.
Save lampysprites/dc20b4497a1fc21719e2289014060671 to your computer and use it in GitHub Desktop.
Browse Addon files in blender
## 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