Timeline for How to install an add-on from a workspace template init file?
Current License: CC BY-SA 4.0
15 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 11, 2020 at 10:53 | vote | accept | tintwotin | ||
Oct 11, 2020 at 10:52 | answer | added | tintwotin | timeline score: 0 | |
Sep 21, 2020 at 7:45 | comment | added | tintwotin | Not that it solves the problem, but add a little more info about templates: docs.blender.org/manual/en/latest/advanced/app_templates.html | |
Sep 11, 2020 at 8:02 | comment | added | tintwotin | No need to register. Installing and enabling the add-ons as the script does in the updated first post works, but only when Load Factory Settings is run. It doesn't seem like the init file actually is run when selecting the template at start-up. Which is odd, or even a bug? | |
Sep 11, 2020 at 7:03 | comment | added | batFINGER | register method. | |
Sep 11, 2020 at 7:03 | comment | added | batFINGER | Would consider making an addon that installs the template and associates itself to the workspace. A choice is to have one umbrella addon with all your tools (still favour this) or one for each ... or a bit of both. Also adding a folder named scripts with addons, startup etc subfolders to system path is another way to make a group of addons available without having to do much. Haven't done much on this front, but have an nvim based scripting workspace in mind, am looking for answers re templates with great interest. On question front have you tried importing and calling the | |
Sep 11, 2020 at 5:09 | comment | added | tintwotin |
@batFINGER I realized that the init file is only called when using Load Factory Settings bpy.ops.wm.read_factory_settings(app_template="Script_Editing") , but if you do from the init file, you'll end up in a loop. A catch 22 situation.
|
|
Sep 10, 2020 at 18:58 | history | edited | tintwotin | CC BY-SA 4.0 |
New code
|
Sep 6, 2020 at 13:00 | comment | added | tintwotin | I've tried adding this instead: blender.stackexchange.com/a/135045/37272 for installing and enabling as add-ons, but it didn't work for me either. That would be the preferable way to do it. Registering all things from inside the add-ons will be a lot of work in most cases, so I would prefer not to do this. | |
Sep 6, 2020 at 12:48 | comment | added | batFINGER |
Yep. The classes should be registered in the register method. As is will only do this in main thread. Will notice many addons call register from main thread. if __name__ == "__main__": register() This is to emulate what happens when addon is registered, ie it is imported and the register method called. That is what would do here. Import and call register, or install as addon and enable for that workspace.
|
|
Sep 6, 2020 at 12:30 | comment | added | tintwotin | I've added it as a link above. Thank you. | |
Sep 6, 2020 at 12:30 | history | edited | tintwotin | CC BY-SA 4.0 |
added 49 characters in body
|
Sep 6, 2020 at 11:21 | comment | added | batFINGER |
Code (or example) of playback_functions.py would add clarity. eg If it was an addon or in startup or modules folder or is a registered script in blend file would be automatically imported as a module and have its register method called.
|
|
Sep 6, 2020 at 10:52 | history | edited | tintwotin | CC BY-SA 4.0 |
deleted 5 characters in body; edited title
|
Sep 6, 2020 at 10:07 | history | asked | tintwotin | CC BY-SA 4.0 |