Merge branch 'blender-v4.0-release'

This commit is contained in:
Campbell Barton
2023-11-02 16:10:37 +11:00
3 changed files with 76 additions and 1 deletions
+4 -1
View File
@@ -87,7 +87,7 @@ Aristotelis Dossas <teldosas>
Arnaud Degroote <arnaud.degroote@isae-supaero.fr>
Arno Mayrhofer <azrael3000>
Arto Kitula <arto.kitula@gmail.com>
Arye Ramaty <BelgaratTheGrey>
Arye Ramaty <aryeramaty@gmail.com>
Arystanbek Dyussenov <arystan.d@gmail.com>
Asad-ullah Khan <kh4n>
Asher <ThatAsherGuy>
@@ -189,6 +189,7 @@ Domino Marama <domino@dominodesigns.info>
Dontsov Valentin <@blend4web.com>
Dorian <BD3D>
Doug Hammond <doughammond@hamsterfight.co.uk>
Douglas Paul <douglas.w.paul@gmail.com>
Ed Halley <ed@halley.cc>
Edgar Roman Cervantes <redvant>
Edmund Kapusniak <edmundmk>
@@ -265,6 +266,7 @@ Indy Ray <ScatteredRay>
Inês Almeida <britalmeida@gmail.com>
Ish Bosamiya <ish_bosamiya>
Israel Medina <imedina>
Ivan Kosarev <mail@ivankosarev.com>
Ivan Perevala <ivpe>
Iyad Ahmed <iyadahmed430@gmail.com>
Jack Andersen <someemail@gmail.com>
@@ -450,6 +452,7 @@ Mike Pan <mike.c.pan@gmail.com>
Mikhail Matrosov <ktdfly>
Mikhail Rachinskiy <alm>
Mikkel Gjoel <mikkelgjoel>
Milan Davidović <milan.davidovic@protonmail.com>
Milan Jaros <jar091>
Mitchell Stokes <mogurijin@gmail.com>
Monique Dewanchand <m.dewanchand@atmind.nl>
@@ -43,6 +43,8 @@
#include "BLI_string.h"
#include "BLI_string_ref.hh"
#include "BKE_anim_data.h"
#include "BKE_animsys.h"
#include "BKE_armature.h"
#include "BKE_attribute.h"
#include "BKE_curve.h"
@@ -242,6 +244,60 @@ static void version_bonegroups_to_bonecollections(Main *bmain)
}
}
static void version_principled_bsdf_update_animdata(ID *owner_id, bNodeTree *ntree)
{
ID *id = &ntree->id;
AnimData *adt = BKE_animdata_from_id(id);
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
if (node->type != SH_NODE_BSDF_PRINCIPLED) {
continue;
}
char node_name_escaped[MAX_NAME * 2];
BLI_str_escape(node_name_escaped, node->name, sizeof(node_name_escaped));
std::string prefix = "nodes[\"" + std::string(node_name_escaped) + "\"].inputs";
/* Remove animdata for inputs 18 (Transmission Roughness) and 3 (Subsurface Color). */
BKE_animdata_fix_paths_remove(id, (prefix + "[18]").c_str());
BKE_animdata_fix_paths_remove(id, (prefix + "[3]").c_str());
/* Order is important here: If we e.g. want to change A->B and B->C, but perform A->B first,
* then later we don't know whether a B entry is an original B (and therefore should be
* changed to C) or used to be A and was already handled.
* In practise, going reverse mostly works, the two notable dependency chains are:
* - 8->13, then 2->8, then 9->2 (13 was changed before)
* - 1->9, then 6->1 (9 was changed before)
* - 4->10, then 21->4 (10 was changed before)
*
* 0 (Base Color) and 17 (Transmission) are fine as-is. */
std::pair<int, int> remap_table[] = {
{20, 27}, /* Emission Strength */
{19, 26}, /* Emission */
{16, 3}, /* IOR */
{15, 19}, /* Clearcoat Roughness */
{14, 18}, /* Clearcoat */
{13, 25}, /* Sheen Tint */
{12, 23}, /* Sheen */
{11, 15}, /* Anisotropic Rotation */
{10, 14}, /* Anisotropic */
{8, 13}, /* Specular Tint */
{2, 8}, /* Subsurface Radius */
{9, 2}, /* Roughness */
{7, 12}, /* Specular */
{1, 9}, /* Subsurface Scale */
{6, 1}, /* Metallic */
{5, 11}, /* Subsurface Anisotropy */
{4, 10}, /* Subsurface IOR */
{21, 4} /* Alpha */
};
for (const auto &entry : remap_table) {
BKE_animdata_fix_paths_rename(
id, adt, owner_id, prefix.c_str(), nullptr, nullptr, entry.first, entry.second, false);
}
}
}
void do_versions_after_linking_400(FileData *fd, Main *bmain)
{
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 400, 9)) {
@@ -312,6 +368,16 @@ void do_versions_after_linking_400(FileData *fd, Main *bmain)
}
}
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 400, 24)) {
FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
if (ntree->type == NTREE_SHADER) {
/* Convert animdata on the Principled BSDF sockets. */
version_principled_bsdf_update_animdata(id, ntree);
}
}
FOREACH_NODETREE_END;
}
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 400, 34)) {
BKE_mesh_legacy_face_map_to_generic(bmain);
}
@@ -92,6 +92,9 @@ def canonical_author_map() -> Dict[str, str]:
"Aras Pranckevicius <aras@nesnausk.org>": (
"Aras Pranckevicius <aras_p>",
),
"Arye Ramaty <aryeramaty@gmail.com>": (
"Arye Ramaty <BelgaratTheGrey>",
),
"Bastien Montagne <bastien@blender.org>": (
"Bastien Montagne (@mont29) <>",
"Bastien Montagne <b.mont29@gmail.com>",
@@ -307,6 +310,9 @@ def canonical_author_map() -> Dict[str, str]:
"Ish Bosamiya <ishbosamiya>",
"Ish Bosamiya <ishbosamiya@gmail.com>",
),
"Ivan Kosarev <mail@ivankosarev.com>": (
"kosarev <kosarev@noreply.localhost>",
),
"Iyad Ahmed <iyadahmed430@gmail.com>": (
"Iyad Ahmed <iyadahmed2001>",
),