diff options
Diffstat (limited to 'source/blender/editors/interface/resources.c')
-rw-r--r-- | source/blender/editors/interface/resources.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 2eae452debb..5073fb8c0ae 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -45,6 +45,7 @@ #include "BLI_utildefines.h" #include "BLI_math.h" +#include "BKE_addon.h" #include "BKE_appdir.h" #include "BKE_colorband.h" #include "BKE_DerivedMesh.h" @@ -2307,13 +2308,19 @@ void init_userdef_do_versions(void) if (btheme->tipo.handle_sel_auto_clamped[3] == 0) rgba_char_args_set(btheme->tipo.handle_sel_auto_clamped, 0xf0, 0xaf, 0x90, 255); } - + +#ifdef WITH_CYCLES /* enable (Cycles) addon by default */ - if (!BLI_findstring(&U.addons, "cycles", offsetof(bAddon, module))) { - bAddon *baddon = MEM_callocN(sizeof(bAddon), "bAddon"); - BLI_strncpy(baddon->module, "cycles", sizeof(baddon->module)); - BLI_addtail(&U.addons, baddon); + BKE_addon_ensure(&U.addons, "cycles"); +#else + { + bAddon *addon = BLI_findstring(&U.addons, "cycles", offsetof(bAddon, module)); + if (addon) { + BKE_addon_free(addon); + BLI_remlink(&U.addons, addon); + } } +#endif } if (!USER_VERSION_ATLEAST(260, 5)) { |