-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
meta snippet to enable addon using text register
- Loading branch information
Showing
1 changed file
with
12 additions
and
0 deletions.
There are no files selected for viewing
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
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 |