Skip to content

Commit

Permalink
meta snippet to enable addon using text register
Browse files Browse the repository at this point in the history
  • Loading branch information
Pullusb committed Oct 10, 2023
1 parent 25395df commit 412669a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions snippets/meta/enable_snippets_library_addon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Enable Snippets Library addon (useful stored as a registered text to enable when opening a specific file)

import addon_utils

for a in addon_utils.modules():
if hasattr(a, 'bl_info') and a.bl_info.get('name'):
if a.bl_info['name'] == 'Snippets Library':
if not addon_utils.check('snippetsLibrary')[1]:
print('Enabling Snippets Library addon')
addon_utils.enable('snippetsLibrary')

break

0 comments on commit 412669a

Please sign in to comment.