Merge branch 'blender-v4.3-release'
This commit is contained in:
@@ -1003,6 +1003,27 @@ static bool versioning_convert_strip_speed_factor(Sequence *seq, void *user_data
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool all_scenes_use(Main *bmain, const blender::Span<const char *> engines)
|
||||
{
|
||||
if (!bmain->scenes.first) {
|
||||
return false;
|
||||
}
|
||||
|
||||
LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
|
||||
bool match = false;
|
||||
for (const char *engine : engines) {
|
||||
if (STREQ(scene->r.engine, engine)) {
|
||||
match = true;
|
||||
}
|
||||
}
|
||||
if (!match) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void do_versions_after_linking_400(FileData *fd, Main *bmain)
|
||||
{
|
||||
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 400, 9)) {
|
||||
@@ -1128,10 +1149,7 @@ void do_versions_after_linking_400(FileData *fd, Main *bmain)
|
||||
}
|
||||
|
||||
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 402, 50)) {
|
||||
Scene *scene = static_cast<Scene *>(bmain->scenes.first);
|
||||
bool scene_uses_eevee_legacy = scene && STREQ(scene->r.engine, RE_engine_id_BLENDER_EEVEE);
|
||||
|
||||
if (scene_uses_eevee_legacy) {
|
||||
if (all_scenes_use(bmain, {RE_engine_id_BLENDER_EEVEE})) {
|
||||
LISTBASE_FOREACH (Object *, object, &bmain->objects) {
|
||||
versioning_eevee_shadow_settings(object);
|
||||
}
|
||||
@@ -1140,11 +1158,8 @@ void do_versions_after_linking_400(FileData *fd, Main *bmain)
|
||||
|
||||
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 402, 51)) {
|
||||
/* Convert blend method to math nodes. */
|
||||
Scene *scene = static_cast<Scene *>(bmain->scenes.first);
|
||||
bool scene_uses_eevee_legacy = scene && STREQ(scene->r.engine, RE_engine_id_BLENDER_EEVEE);
|
||||
|
||||
LISTBASE_FOREACH (Material *, material, &bmain->materials) {
|
||||
if (scene_uses_eevee_legacy) {
|
||||
if (all_scenes_use(bmain, {RE_engine_id_BLENDER_EEVEE})) {
|
||||
LISTBASE_FOREACH (Material *, material, &bmain->materials) {
|
||||
if (!material->use_nodes || material->nodetree == nullptr) {
|
||||
/* Nothing to version. */
|
||||
}
|
||||
@@ -3686,10 +3701,8 @@ void blo_do_versions_400(FileData *fd, Library * /*lib*/, Main *bmain)
|
||||
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 401, 5)) {
|
||||
/* Unify Material::blend_shadow and Cycles.use_transparent_shadows into the
|
||||
* Material::blend_flag. */
|
||||
Scene *scene = static_cast<Scene *>(bmain->scenes.first);
|
||||
bool is_eevee = scene && STR_ELEM(scene->r.engine,
|
||||
RE_engine_id_BLENDER_EEVEE,
|
||||
RE_engine_id_BLENDER_EEVEE_NEXT);
|
||||
bool is_eevee = all_scenes_use(bmain,
|
||||
{RE_engine_id_BLENDER_EEVEE, RE_engine_id_BLENDER_EEVEE_NEXT});
|
||||
LISTBASE_FOREACH (Material *, material, &bmain->materials) {
|
||||
bool transparent_shadows = true;
|
||||
if (is_eevee) {
|
||||
@@ -4434,11 +4447,7 @@ void blo_do_versions_400(FileData *fd, Library * /*lib*/, Main *bmain)
|
||||
|
||||
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 402, 39)) {
|
||||
/* Unify cast shadow property with Cycles. */
|
||||
Scene *scene = static_cast<Scene *>(bmain->scenes.first);
|
||||
/* Be conservative, if there is no scene, still try to do the conversion as that can happen for
|
||||
* append and linking. We prefer breaking EEVEE rather than breaking Cycles here. */
|
||||
bool is_eevee = scene && STREQ(scene->r.engine, RE_engine_id_BLENDER_EEVEE);
|
||||
if (!is_eevee) {
|
||||
if (!all_scenes_use(bmain, {RE_engine_id_BLENDER_EEVEE})) {
|
||||
const Light *default_light = DNA_struct_default_get(Light);
|
||||
LISTBASE_FOREACH (Light *, light, &bmain->lights) {
|
||||
IDProperty *clight = version_cycles_properties_from_ID(&light->id);
|
||||
@@ -4638,9 +4647,7 @@ void blo_do_versions_400(FileData *fd, Library * /*lib*/, Main *bmain)
|
||||
}
|
||||
|
||||
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 402, 64)) {
|
||||
Scene *scene = static_cast<Scene *>(bmain->scenes.first);
|
||||
bool is_eevee_legacy = scene && STR_ELEM(scene->r.engine, RE_engine_id_BLENDER_EEVEE);
|
||||
if (is_eevee_legacy) {
|
||||
if (all_scenes_use(bmain, {RE_engine_id_BLENDER_EEVEE})) {
|
||||
/* Re-apply versioning made for EEVEE-Next in 4.1 before it got delayed. */
|
||||
LISTBASE_FOREACH (Material *, material, &bmain->materials) {
|
||||
bool transparent_shadows = material->blend_shadow != MA_BS_SOLID;
|
||||
|
||||
Reference in New Issue
Block a user