Cleanup: move cycles addon check out of versioning
This commit is contained in:
@@ -94,11 +94,6 @@ if(WITH_ALEMBIC)
|
|||||||
add_definitions(-DWITH_ALEMBIC)
|
add_definitions(-DWITH_ALEMBIC)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Needed for versioning userdef.
|
|
||||||
if(WITH_CYCLES)
|
|
||||||
add_definitions(-DWITH_CYCLES)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
blender_add_lib(bf_blenloader "${SRC}" "${INC}" "${INC_SYS}")
|
blender_add_lib(bf_blenloader "${SRC}" "${INC}" "${INC_SYS}")
|
||||||
|
|
||||||
# needed so writefile.c can use dna_type_offsets.h
|
# needed so writefile.c can use dna_type_offsets.h
|
||||||
|
@@ -42,21 +42,22 @@
|
|||||||
/* Disallow access to global userdef. */
|
/* Disallow access to global userdef. */
|
||||||
#define U (_error_)
|
#define U (_error_)
|
||||||
|
|
||||||
#define USER_VERSION_ATLEAST(ver, subver) MAIN_VERSION_ATLEAST(userdef, ver, subver)
|
|
||||||
|
|
||||||
static void do_versions_theme(UserDef *userdef, bTheme *btheme)
|
static void do_versions_theme(UserDef *userdef, bTheme *btheme)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#define USER_VERSION_ATLEAST(ver, subver) MAIN_VERSION_ATLEAST(userdef, ver, subver)
|
||||||
if (!USER_VERSION_ATLEAST(280, 20)) {
|
if (!USER_VERSION_ATLEAST(280, 20)) {
|
||||||
memcpy(btheme, &U_theme_default, sizeof(*btheme));
|
memcpy(btheme, &U_theme_default, sizeof(*btheme));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#undef USER_VERSION_ATLEAST
|
#undef USER_VERSION_ATLEAST
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/* patching UserDef struct and Themes */
|
/* patching UserDef struct and Themes */
|
||||||
void BLO_version_defaults_userpref_blend(Main *bmain, UserDef *userdef)
|
void BLO_version_defaults_userpref_blend(Main *bmain, UserDef *userdef)
|
||||||
{
|
{
|
||||||
|
|
||||||
#define USER_VERSION_ATLEAST(ver, subver) MAIN_VERSION_ATLEAST(bmain, ver, subver)
|
#define USER_VERSION_ATLEAST(ver, subver) MAIN_VERSION_ATLEAST(bmain, ver, subver)
|
||||||
|
|
||||||
/* the UserDef struct is not corrected with do_versions() .... ugh! */
|
/* the UserDef struct is not corrected with do_versions() .... ugh! */
|
||||||
@@ -330,14 +331,9 @@ void BLO_version_defaults_userpref_blend(Main *bmain, UserDef *userdef)
|
|||||||
// we default to the first audio device
|
// we default to the first audio device
|
||||||
userdef->audiodevice = 0;
|
userdef->audiodevice = 0;
|
||||||
|
|
||||||
/* Not versioning, just avoid errors. */
|
|
||||||
#ifndef WITH_CYCLES
|
|
||||||
BKE_addon_remove_safe(&userdef->addons, "cycles");
|
|
||||||
#endif
|
|
||||||
/* this timer uses U */
|
|
||||||
// XXX reset_autosave();
|
|
||||||
|
|
||||||
for (bTheme *btheme = userdef->themes.first; btheme; btheme = btheme->next) {
|
for (bTheme *btheme = userdef->themes.first; btheme; btheme = btheme->next) {
|
||||||
do_versions_theme(userdef, btheme);
|
do_versions_theme(userdef, btheme);
|
||||||
}
|
}
|
||||||
|
#undef USER_VERSION_ATLEAST
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -43,6 +43,7 @@
|
|||||||
#include "BLI_utildefines.h"
|
#include "BLI_utildefines.h"
|
||||||
#include "BLI_math.h"
|
#include "BLI_math.h"
|
||||||
|
|
||||||
|
#include "BKE_addon.h"
|
||||||
#include "BKE_appdir.h"
|
#include "BKE_appdir.h"
|
||||||
#include "BKE_main.h"
|
#include "BKE_main.h"
|
||||||
#include "BKE_mesh_runtime.h"
|
#include "BKE_mesh_runtime.h"
|
||||||
@@ -1199,5 +1200,13 @@ void init_userdef_do_versions(Main *bmain)
|
|||||||
|
|
||||||
/* signal for evaluated mesh to use colorband */
|
/* signal for evaluated mesh to use colorband */
|
||||||
/* run in case this was on and is now off in the user prefs [#28096] */
|
/* run in case this was on and is now off in the user prefs [#28096] */
|
||||||
BKE_mesh_runtime_color_band_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight) : NULL, UI_GetTheme()->tv3d.vertex_unreferenced);
|
BKE_mesh_runtime_color_band_store(
|
||||||
|
(U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight) : NULL,
|
||||||
|
UI_GetTheme()->tv3d.vertex_unreferenced);
|
||||||
|
|
||||||
|
/* Not versioning, just avoid errors. */
|
||||||
|
#ifndef WITH_CYCLES
|
||||||
|
BKE_addon_remove_safe(&U.addons, "cycles");
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user