Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r--source/blender/blenloader/intern/readfile.c16
-rw-r--r--source/blender/blenloader/intern/versioning_280.c2
-rw-r--r--source/blender/blenloader/intern/versioning_290.c44
-rw-r--r--source/blender/blenloader/intern/versioning_300.c214
-rw-r--r--source/blender/blenloader/intern/versioning_common.cc28
-rw-r--r--source/blender/blenloader/intern/versioning_common.h6
-rw-r--r--source/blender/blenloader/intern/versioning_defaults.c6
-rw-r--r--source/blender/blenloader/intern/versioning_userdef.c8
8 files changed, 254 insertions, 70 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 3e9ea8db758..15653264211 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -4500,7 +4500,8 @@ static void add_loose_objects_to_scene(Main *mainvar,
* or for a collection when *lib has been set. */
LISTBASE_FOREACH (Object *, ob, &mainvar->objects) {
bool do_it = (ob->id.tag & LIB_TAG_DOIT) != 0;
- if (do_it || ((ob->id.tag & LIB_TAG_INDIRECT) && (ob->id.tag & LIB_TAG_PRE_EXISTING) == 0)) {
+ if (do_it ||
+ ((ob->id.tag & LIB_TAG_INDIRECT) != 0 && (ob->id.tag & LIB_TAG_PRE_EXISTING) == 0)) {
if (do_append) {
if (ob->id.us == 0) {
do_it = true;
@@ -4560,6 +4561,17 @@ static void add_loose_object_data_to_scene(Main *mainvar,
active_collection = lc->collection;
}
+ /* Do not re-instantiate obdata IDs that are already instantiated by an object. */
+ LISTBASE_FOREACH (Object *, ob, &mainvar->objects) {
+ if ((ob->id.tag & LIB_TAG_PRE_EXISTING) == 0 && ob->data != NULL) {
+ ID *obdata = ob->data;
+ BLI_assert(ID_REAL_USERS(obdata) > 0);
+ if ((obdata->tag & LIB_TAG_PRE_EXISTING) == 0) {
+ obdata->tag &= ~LIB_TAG_DOIT;
+ }
+ }
+ }
+
/* Loop over all ID types, instancing object-data for ID types that have support for it. */
ListBase *lbarray[INDEX_ID_MAX];
int i = set_listbasepointers(mainvar, lbarray);
@@ -4648,7 +4660,7 @@ static void add_collections_to_scene(Main *mainvar,
LISTBASE_FOREACH (CollectionObject *, coll_ob, &collection->gobject) {
Object *ob = coll_ob->ob;
if ((ob->id.tag & (LIB_TAG_PRE_EXISTING | LIB_TAG_DOIT | LIB_TAG_INDIRECT)) == 0 &&
- (ob->id.lib == lib) && (object_in_any_scene(bmain, ob) == 0)) {
+ (ob->id.lib == lib) && (object_in_any_scene(bmain, ob) == false)) {
do_add_collection = true;
break;
}
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index e87e201368e..7ad21b9f1ed 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -3416,7 +3416,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
case SPACE_FILE: {
SpaceFile *sfile = (SpaceFile *)sl;
if (sfile->params) {
- sfile->params->flag &= ~(FILE_PARAMS_FLAG_UNUSED_1 | FILE_PARAMS_FLAG_UNUSED_6 |
+ sfile->params->flag &= ~(FILE_APPEND_SET_FAKEUSER | FILE_APPEND_RECURSIVE |
FILE_OBDATA_INSTANCE);
}
break;
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c
index 5860d60537f..7693dc5c8fb 100644
--- a/source/blender/blenloader/intern/versioning_290.c
+++ b/source/blender/blenloader/intern/versioning_290.c
@@ -831,33 +831,6 @@ static void do_versions_strip_cache_settings_recursive(const ListBase *seqbase)
}
}
-static void version_node_socket_name(bNodeTree *ntree,
- const int node_type,
- const char *old_name,
- const char *new_name)
-{
- LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
- if (node->type == node_type) {
- LISTBASE_FOREACH (bNodeSocket *, socket, &node->inputs) {
- if (STREQ(socket->name, old_name)) {
- strcpy(socket->name, new_name);
- }
- if (STREQ(socket->identifier, old_name)) {
- strcpy(socket->identifier, new_name);
- }
- }
- LISTBASE_FOREACH (bNodeSocket *, socket, &node->outputs) {
- if (STREQ(socket->name, old_name)) {
- strcpy(socket->name, new_name);
- }
- if (STREQ(socket->identifier, old_name)) {
- strcpy(socket->identifier, new_name);
- }
- }
- }
- }
-}
-
static void version_node_join_geometry_for_multi_input_socket(bNodeTree *ntree)
{
LISTBASE_FOREACH_MUTABLE (bNodeLink *, link, &ntree->links) {
@@ -1121,8 +1094,6 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
if (md->type == eModifierType_MeshSequenceCache) {
MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *)md;
mcmd->velocity_scale = 1.0f;
- mcmd->vertex_velocities = NULL;
- mcmd->num_vertices = 0;
}
}
}
@@ -1588,7 +1559,7 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
if (ntree->type == NTREE_GEOMETRY) {
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
- if (node->type == GEO_NODE_ATTRIBUTE_MATH && node->storage == NULL) {
+ if (node->type == GEO_NODE_LEGACY_ATTRIBUTE_MATH && node->storage == NULL) {
const int old_use_attibute_a = (1 << 0);
const int old_use_attibute_b = (1 << 1);
NodeAttributeMath *data = MEM_callocN(sizeof(NodeAttributeMath), "NodeAttributeMath");
@@ -1749,7 +1720,7 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
continue;
}
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
- if (node->type == GEO_NODE_POINT_INSTANCE && node->storage == NULL) {
+ if (node->type == GEO_NODE_LEGACY_POINT_INSTANCE && node->storage == NULL) {
NodeGeometryPointInstance *data = (NodeGeometryPointInstance *)MEM_callocN(
sizeof(NodeGeometryPointInstance), __func__);
data->instance_type = node->custom1;
@@ -1766,7 +1737,7 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
if (ntree->type == NTREE_GEOMETRY) {
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
- if (node->type == GEO_NODE_ATTRIBUTE_MATH) {
+ if (node->type == GEO_NODE_LEGACY_ATTRIBUTE_MATH) {
NodeAttributeMath *data = (NodeAttributeMath *)node->storage;
data->input_type_c = GEO_NODE_ATTRIBUTE_INPUT_ATTRIBUTE;
}
@@ -1825,7 +1796,7 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
continue;
}
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
- if (node->type == GEO_NODE_ATTRIBUTE_RANDOMIZE && node->storage == NULL) {
+ if (node->type == GEO_NODE_LEGACY_ATTRIBUTE_RANDOMIZE && node->storage == NULL) {
NodeAttributeRandomize *data = (NodeAttributeRandomize *)MEM_callocN(
sizeof(NodeAttributeRandomize), __func__);
data->data_type = node->custom1;
@@ -1861,7 +1832,7 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
if (ntree->type == NTREE_GEOMETRY) {
- version_node_socket_name(ntree, GEO_NODE_ATTRIBUTE_PROXIMITY, "Result", "Distance");
+ version_node_socket_name(ntree, GEO_NODE_LEGACY_ATTRIBUTE_PROXIMITY, "Result", "Distance");
}
}
FOREACH_NODETREE_END;
@@ -1870,7 +1841,8 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
if (!MAIN_VERSION_ATLEAST(bmain, 293, 10)) {
FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
if (ntree->type == NTREE_GEOMETRY) {
- version_node_socket_name(ntree, GEO_NODE_ATTRIBUTE_PROXIMITY, "Location", "Position");
+ version_node_socket_name(
+ ntree, GEO_NODE_LEGACY_ATTRIBUTE_PROXIMITY, "Location", "Position");
}
}
FOREACH_NODETREE_END;
@@ -1964,7 +1936,7 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
if (ntree->type == NTREE_GEOMETRY) {
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
- if (node->type == GEO_NODE_ATTRIBUTE_FILL) {
+ if (node->type == GEO_NODE_LEGACY_ATTRIBUTE_FILL) {
node->custom2 = ATTR_DOMAIN_AUTO;
}
}
diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c
index 862b5bdb318..2ac98a11e18 100644
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@ -37,6 +37,8 @@
#include "DNA_constraint_types.h"
#include "DNA_curve_types.h"
#include "DNA_genfile.h"
+#include "DNA_gpencil_modifier_types.h"
+#include "DNA_lineart_types.h"
#include "DNA_listBase.h"
#include "DNA_material_types.h"
#include "DNA_modifier_types.h"
@@ -238,6 +240,16 @@ static void do_versions_idproperty_bones_recursive(Bone *bone)
}
}
+static void do_versions_idproperty_seq_recursive(ListBase *seqbase)
+{
+ LISTBASE_FOREACH (Sequence *, seq, seqbase) {
+ version_idproperty_ui_data(seq->prop);
+ if (seq->type == SEQ_TYPE_META) {
+ do_versions_idproperty_seq_recursive(&seq->seqbase);
+ }
+ }
+}
+
/**
* For every data block that supports them, initialize the new IDProperty UI data struct based on
* the old more complicated storage. Assumes only the top level of IDProperties below the parent
@@ -298,9 +310,7 @@ static void do_versions_idproperty_ui_data(Main *bmain)
/* Sequences. */
LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
if (scene->ed != NULL) {
- LISTBASE_FOREACH (Sequence *, seq, &scene->ed->seqbase) {
- version_idproperty_ui_data(seq->prop);
- }
+ do_versions_idproperty_seq_recursive(&scene->ed->seqbase);
}
}
}
@@ -447,7 +457,7 @@ void do_versions_after_linking_300(Main *bmain, ReportList *UNUSED(reports))
continue;
}
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
- if (node->type != GEO_NODE_ATTRIBUTE_SAMPLE_TEXTURE) {
+ if (node->type != GEO_NODE_LEGACY_ATTRIBUTE_SAMPLE_TEXTURE) {
continue;
}
if (node->id == NULL) {
@@ -527,33 +537,6 @@ static void version_switch_node_input_prefix(Main *bmain)
FOREACH_NODETREE_END;
}
-static void version_node_socket_name(bNodeTree *ntree,
- const int node_type,
- const char *old_name,
- const char *new_name)
-{
- LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
- if (node->type == node_type) {
- LISTBASE_FOREACH (bNodeSocket *, socket, &node->inputs) {
- if (STREQ(socket->name, old_name)) {
- strcpy(socket->name, new_name);
- }
- if (STREQ(socket->identifier, old_name)) {
- strcpy(socket->identifier, new_name);
- }
- }
- LISTBASE_FOREACH (bNodeSocket *, socket, &node->outputs) {
- if (STREQ(socket->name, old_name)) {
- strcpy(socket->name, new_name);
- }
- if (STREQ(socket->identifier, old_name)) {
- strcpy(socket->identifier, new_name);
- }
- }
- }
- }
-}
-
static bool replace_bbone_len_scale_rnapath(char **p_old_path, int *p_index)
{
char *old_path = *p_old_path;
@@ -658,6 +641,141 @@ static bNodeSocket *do_version_replace_float_size_with_vector(bNodeTree *ntree,
return new_socket;
}
+static bool geometry_node_is_293_legacy(const short node_type)
+{
+ switch (node_type) {
+ /* Not legacy: No attribute inputs or outputs. */
+ case GEO_NODE_TRIANGULATE:
+ case GEO_NODE_EDGE_SPLIT:
+ case GEO_NODE_TRANSFORM:
+ case GEO_NODE_BOOLEAN:
+ case GEO_NODE_SUBDIVISION_SURFACE:
+ case GEO_NODE_IS_VIEWPORT:
+ case GEO_NODE_MESH_SUBDIVIDE:
+ case GEO_NODE_MESH_PRIMITIVE_CUBE:
+ case GEO_NODE_MESH_PRIMITIVE_CIRCLE:
+ case GEO_NODE_MESH_PRIMITIVE_UV_SPHERE:
+ case GEO_NODE_MESH_PRIMITIVE_CYLINDER:
+ case GEO_NODE_MESH_PRIMITIVE_ICO_SPHERE:
+ case GEO_NODE_MESH_PRIMITIVE_CONE:
+ case GEO_NODE_MESH_PRIMITIVE_LINE:
+ case GEO_NODE_MESH_PRIMITIVE_GRID:
+ case GEO_NODE_BOUNDING_BOX:
+ case GEO_NODE_CURVE_RESAMPLE:
+ case GEO_NODE_INPUT_MATERIAL:
+ case GEO_NODE_MATERIAL_REPLACE:
+ case GEO_NODE_CURVE_LENGTH:
+ case GEO_NODE_CONVEX_HULL:
+ case GEO_NODE_SEPARATE_COMPONENTS:
+ case GEO_NODE_CURVE_PRIMITIVE_STAR:
+ case GEO_NODE_CURVE_PRIMITIVE_SPIRAL:
+ case GEO_NODE_CURVE_PRIMITIVE_QUADRATIC_BEZIER:
+ case GEO_NODE_CURVE_PRIMITIVE_BEZIER_SEGMENT:
+ case GEO_NODE_CURVE_PRIMITIVE_CIRCLE:
+ case GEO_NODE_VIEWER:
+ case GEO_NODE_CURVE_PRIMITIVE_LINE:
+ case GEO_NODE_CURVE_PRIMITIVE_QUADRILATERAL:
+ case GEO_NODE_CURVE_FILL:
+ case GEO_NODE_CURVE_TRIM:
+ case GEO_NODE_CURVE_TO_MESH:
+ return false;
+
+ /* Not legacy: Newly added with fields patch. */
+ case GEO_NODE_INPUT_POSITION:
+ case GEO_NODE_SET_POSITION:
+ case GEO_NODE_INPUT_INDEX:
+ case GEO_NODE_INPUT_NORMAL:
+ case GEO_NODE_ATTRIBUTE_CAPTURE:
+ return false;
+
+ /* Maybe legacy: Might need special attribute handling, depending on design. */
+ case GEO_NODE_SWITCH:
+ case GEO_NODE_JOIN_GEOMETRY:
+ case GEO_NODE_ATTRIBUTE_REMOVE:
+ case GEO_NODE_OBJECT_INFO:
+ case GEO_NODE_COLLECTION_INFO:
+ return false;
+
+ /* Maybe legacy: Transferred *all* attributes before, will not transfer all built-ins now. */
+ case GEO_NODE_CURVE_ENDPOINTS:
+ case GEO_NODE_CURVE_TO_POINTS:
+ return false;
+
+ /* Maybe legacy: Special case for grid names? Or finish patch from level set branch to generate
+ * a mesh for all grids in the volume. */
+ case GEO_NODE_VOLUME_TO_MESH:
+ return false;
+
+ /* Legacy: Attribute operation completely replaced by field nodes. */
+ case GEO_NODE_LEGACY_ATTRIBUTE_RANDOMIZE:
+ case GEO_NODE_LEGACY_ATTRIBUTE_MATH:
+ case GEO_NODE_LEGACY_ATTRIBUTE_FILL:
+ case GEO_NODE_LEGACY_ATTRIBUTE_MIX:
+ case GEO_NODE_LEGACY_ATTRIBUTE_COLOR_RAMP:
+ case GEO_NODE_LEGACY_ATTRIBUTE_COMPARE:
+ case GEO_NODE_LEGACY_POINT_ROTATE:
+ case GEO_NODE_LEGACY_ALIGN_ROTATION_TO_VECTOR:
+ case GEO_NODE_LEGACY_POINT_SCALE:
+ case GEO_NODE_LEGACY_ATTRIBUTE_SAMPLE_TEXTURE:
+ case GEO_NODE_ATTRIBUTE_VECTOR_ROTATE:
+ case GEO_NODE_LEGACY_ATTRIBUTE_CURVE_MAP:
+ case GEO_NODE_LEGACY_ATTRIBUTE_MAP_RANGE:
+ case GEO_NODE_LECAGY_ATTRIBUTE_CLAMP:
+ case GEO_NODE_LEGACY_ATTRIBUTE_VECTOR_MATH:
+ case GEO_NODE_LEGACY_ATTRIBUTE_COMBINE_XYZ:
+ case GEO_NODE_LEGACY_ATTRIBUTE_SEPARATE_XYZ:
+ return true;
+
+ /* Legacy: Replaced by field node depending on another geometry. */
+ case GEO_NODE_LEGACY_RAYCAST:
+ case GEO_NODE_LEGACY_ATTRIBUTE_TRANSFER:
+ case GEO_NODE_LEGACY_ATTRIBUTE_PROXIMITY:
+ return true;
+
+ /* Legacy: Simple selection attribute input. */
+ case GEO_NODE_LEGACY_MESH_TO_CURVE:
+ case GEO_NODE_LEGACY_POINT_SEPARATE:
+ case GEO_NODE_LEGACY_CURVE_SELECT_HANDLES:
+ case GEO_NODE_LEGACY_CURVE_SPLINE_TYPE:
+ case GEO_NODE_LEGACY_CURVE_REVERSE:
+ case GEO_NODE_LEGACY_MATERIAL_ASSIGN:
+ case GEO_NODE_LEGACY_CURVE_SET_HANDLES:
+ return true;
+
+ /* Legacy: More complex attribute inputs or outputs. */
+ case GEO_NODE_LEGACY_DELETE_GEOMETRY: /* Needs field input, domain drop-down. */
+ case GEO_NODE_LEGACY_CURVE_SUBDIVIDE: /* Needs field count input. */
+ case GEO_NODE_LEGACY_POINTS_TO_VOLUME: /* Needs field radius input. */
+ case GEO_NODE_LEGACY_SELECT_BY_MATERIAL: /* Output anonymous attribute. */
+ case GEO_NODE_LEGACY_POINT_TRANSLATE: /* Needs field inputs. */
+ case GEO_NODE_LEGACY_POINT_INSTANCE: /* Needs field inputs. */
+ case GEO_NODE_LEGACY_POINT_DISTRIBUTE: /* Needs field input, remove max for random mode. */
+ case GEO_NODE_LEGACY_ATTRIBUTE_CONVERT: /* Attribute Capture, Store Attribute. */
+ return true;
+ }
+ return false;
+}
+
+static void version_geometry_nodes_change_legacy_names(bNodeTree *ntree)
+{
+ LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
+ if (geometry_node_is_293_legacy(node->type)) {
+ if (strstr(node->idname, "Legacy")) {
+ /* Make sure we haven't changed this idname already, better safe than sorry. */
+ continue;
+ }
+
+ char temp_idname[sizeof(node->idname)];
+ BLI_strncpy(temp_idname, node->idname, sizeof(node->idname));
+
+ BLI_snprintf(node->idname,
+ sizeof(node->idname),
+ "GeometryNodeLegacy%s",
+ temp_idname + strlen("GeometryNode"));
+ }
+ }
+}
+
/* NOLINTNEXTLINE: readability-function-size */
void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
{
@@ -1199,6 +1317,40 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
+ if (!MAIN_VERSION_ATLEAST(bmain, 300, 22)) {
+ LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
+ if (ntree->type == NTREE_GEOMETRY) {
+ version_geometry_nodes_change_legacy_names(ntree);
+ }
+ }
+ if (!DNA_struct_elem_find(
+ fd->filesdna, "LineartGpencilModifierData", "bool", "use_crease_on_smooth")) {
+ LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
+ if (ob->type == OB_GPENCIL) {
+ LISTBASE_FOREACH (GpencilModifierData *, md, &ob->greasepencil_modifiers) {
+ if (md->type == eGpencilModifierType_Lineart) {
+ LineartGpencilModifierData *lmd = (LineartGpencilModifierData *)md;
+ lmd->calculation_flags |= LRT_USE_CREASE_ON_SMOOTH_SURFACES;
+ }
+ }
+ }
+ }
+ }
+
+ for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
+ LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
+ LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
+ if (sl->spacetype == SPACE_FILE) {
+ SpaceFile *sfile = (SpaceFile *)sl;
+ if (sfile->asset_params) {
+ sfile->asset_params->base_params.recursion_level = FILE_SELECT_MAX_RECURSIONS;
+ }
+ }
+ }
+ }
+ }
+ }
+
/**
* Versioning code until next subversion bump goes here.
*
diff --git a/source/blender/blenloader/intern/versioning_common.cc b/source/blender/blenloader/intern/versioning_common.cc
index 208c02b60d1..3f13d1ec12e 100644
--- a/source/blender/blenloader/intern/versioning_common.cc
+++ b/source/blender/blenloader/intern/versioning_common.cc
@@ -22,6 +22,7 @@
#include <cstring>
+#include "DNA_node_types.h"
#include "DNA_screen_types.h"
#include "BLI_listbase.h"
@@ -85,3 +86,30 @@ ID *do_versions_rename_id(Main *bmain,
}
return id;
}
+
+void version_node_socket_name(bNodeTree *ntree,
+ const int node_type,
+ const char *old_name,
+ const char *new_name)
+{
+ LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
+ if (node->type == node_type) {
+ LISTBASE_FOREACH (bNodeSocket *, socket, &node->inputs) {
+ if (STREQ(socket->name, old_name)) {
+ BLI_strncpy(socket->name, new_name, sizeof(socket->name));
+ }
+ if (STREQ(socket->identifier, old_name)) {
+ BLI_strncpy(socket->identifier, new_name, sizeof(socket->name));
+ }
+ }
+ LISTBASE_FOREACH (bNodeSocket *, socket, &node->outputs) {
+ if (STREQ(socket->name, old_name)) {
+ BLI_strncpy(socket->name, new_name, sizeof(socket->name));
+ }
+ if (STREQ(socket->identifier, old_name)) {
+ BLI_strncpy(socket->identifier, new_name, sizeof(socket->name));
+ }
+ }
+ }
+ }
+}
diff --git a/source/blender/blenloader/intern/versioning_common.h b/source/blender/blenloader/intern/versioning_common.h
index 47e0b74a3e4..c1fe2b591cd 100644
--- a/source/blender/blenloader/intern/versioning_common.h
+++ b/source/blender/blenloader/intern/versioning_common.h
@@ -23,6 +23,7 @@
struct ARegion;
struct ListBase;
struct Main;
+struct bNodeTree;
#ifdef __cplusplus
extern "C" {
@@ -38,6 +39,11 @@ ID *do_versions_rename_id(Main *bmain,
const char *name_src,
const char *name_dst);
+void version_node_socket_name(struct bNodeTree *ntree,
+ const int node_type,
+ const char *old_name,
+ const char *new_name);
+
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index 2cce4ed8f9d..f94b0020fe8 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -52,6 +52,7 @@
#include "BKE_brush.h"
#include "BKE_colortools.h"
#include "BKE_curveprofile.h"
+#include "BKE_customdata.h"
#include "BKE_gpencil.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
@@ -552,6 +553,11 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
mesh->flag |= ME_REMESH_FIX_POLES | ME_REMESH_REPROJECT_VOLUME;
BKE_mesh_smooth_flag_set(mesh, false);
}
+ else {
+ /* Remove sculpt-mask data in default mesh objects for all non-sculpt templates. */
+ CustomData_free_layers(&mesh->vdata, CD_PAINT_MASK, mesh->totvert);
+ CustomData_free_layers(&mesh->ldata, CD_GRID_PAINT_MASK, mesh->totloop);
+ }
}
for (Camera *camera = bmain->cameras.first; camera; camera = camera->id.next) {
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c
index 0042ff29dc2..19f6c1cbbf6 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -885,6 +885,14 @@ void blo_do_versions_userdef(UserDef *userdef)
BKE_addon_ensure(&userdef->addons, "pose_library");
}
+ if (!USER_VERSION_ATLEAST(300, 21)) {
+ /* Deprecated userdef->flag USER_SAVE_PREVIEWS */
+ userdef->file_preview_type = (userdef->flag & USER_FLAG_UNUSED_5) ? USER_FILE_PREVIEW_CAMERA :
+ USER_FILE_PREVIEW_NONE;
+ /* Clear for reuse. */
+ userdef->flag &= ~USER_FLAG_UNUSED_5;
+ }
+
/**
* Versioning code until next subversion bump goes here.
*