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/blend_validate.c2
-rw-r--r--source/blender/blenloader/intern/readblenentry.c8
-rw-r--r--source/blender/blenloader/intern/readfile.c6
-rw-r--r--source/blender/blenloader/intern/versioning_290.c46
-rw-r--r--source/blender/blenloader/intern/versioning_userdef.c23
5 files changed, 53 insertions, 32 deletions
diff --git a/source/blender/blenloader/intern/blend_validate.c b/source/blender/blenloader/intern/blend_validate.c
index 2848aac2c77..c281e2fa643 100644
--- a/source/blender/blenloader/intern/blend_validate.c
+++ b/source/blender/blenloader/intern/blend_validate.c
@@ -148,7 +148,7 @@ bool BLO_main_validate_libraries(Main *bmain, ReportList *reports)
}
}
- BLI_linklist_free(names, free);
+ BLI_linklist_freeN(names);
}
BLO_blendhandle_close(bh);
diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c
index 7a527b82e9f..1aecba5ba90 100644
--- a/source/blender/blenloader/intern/readblenentry.c
+++ b/source/blender/blenloader/intern/readblenentry.c
@@ -134,7 +134,7 @@ void BLO_blendhandle_print_sizes(BlendHandle *bh, void *fp)
* \param bh: The blendhandle to access.
* \param ofblocktype: The type of names to get.
* \param tot_names: The length of the returned list.
- * \return A BLI_linklist of strings. The string links should be freed with malloc.
+ * \return A BLI_linklist of strings. The string links should be freed with #MEM_freeN().
*/
LinkNode *BLO_blendhandle_get_datablock_names(BlendHandle *bh, int ofblocktype, int *tot_names)
{
@@ -147,7 +147,7 @@ LinkNode *BLO_blendhandle_get_datablock_names(BlendHandle *bh, int ofblocktype,
if (bhead->code == ofblocktype) {
const char *idname = blo_bhead_id_name(fd, bhead);
- BLI_linklist_prepend(&names, strdup(idname + 2));
+ BLI_linklist_prepend(&names, BLI_strdup(idname + 2));
tot++;
}
else if (bhead->code == ENDB) {
@@ -254,7 +254,7 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype, int *to
* (e.g. "Scene", "Mesh", "Light", etc.).
*
* \param bh: The blendhandle to access.
- * \return A BLI_linklist of strings. The string links should be freed with malloc.
+ * \return A BLI_linklist of strings. The string links should be freed with #MEM_freeN().
*/
LinkNode *BLO_blendhandle_get_linkable_groups(BlendHandle *bh)
{
@@ -272,7 +272,7 @@ LinkNode *BLO_blendhandle_get_linkable_groups(BlendHandle *bh)
const char *str = BKE_idtype_idcode_to_name(bhead->code);
if (BLI_gset_add(gathered, (void *)str)) {
- BLI_linklist_prepend(&names, strdup(str));
+ BLI_linklist_prepend(&names, BLI_strdup(str));
}
}
}
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 2c10dd446f1..9ce767b7ce1 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2834,10 +2834,8 @@ static void lib_link_workspace_layout_restore(struct IDNameLib_Map *id_map,
tselem->id = NULL;
}
}
- if (space_outliner->treehash) {
- /* rebuild hash table, because it depends on ids too */
- space_outliner->storeflag |= SO_TREESTORE_REBUILD;
- }
+ /* rebuild hash table, because it depends on ids too */
+ space_outliner->storeflag |= SO_TREESTORE_REBUILD;
}
}
else if (sl->spacetype == SPACE_NODE) {
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c
index 9278ff51b8d..a98e7c46f10 100644
--- a/source/blender/blenloader/intern/versioning_290.c
+++ b/source/blender/blenloader/intern/versioning_290.c
@@ -181,7 +181,7 @@ static void seq_convert_transform_crop(const Scene *scene,
/* Convert offset animation, but only if crop is not used. */
if ((seq->flag & use_transform_flag) != 0 && (seq->flag & use_crop_flag) == 0) {
char name_esc[(sizeof(seq->name) - 2) * 2], *path;
- BLI_strescape(name_esc, seq->name + 2, sizeof(name_esc));
+ BLI_str_escape(name_esc, seq->name + 2, sizeof(name_esc));
path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].transform.offset_x", name_esc);
seq_convert_transform_animation(scene, path, image_size_x);
@@ -408,7 +408,7 @@ void do_versions_after_linking_290(Main *bmain, ReportList *UNUSED(reports))
const size_t node_name_escaped_max_length = (node_name_length * 2);
char *node_name_escaped = MEM_mallocN(node_name_escaped_max_length + 1,
"escaped name");
- BLI_strescape(node_name_escaped, node->name, node_name_escaped_max_length);
+ BLI_str_escape(node_name_escaped, node->name, node_name_escaped_max_length);
char *rna_path_prefix = BLI_sprintfN("nodes[\"%s\"].inputs", node_name_escaped);
BKE_animdata_fix_paths_rename_all_ex(
@@ -483,6 +483,13 @@ void do_versions_after_linking_290(Main *bmain, ReportList *UNUSED(reports))
}
}
}
+
+ /* Wet Paint Radius Factor */
+ for (Brush *br = bmain->brushes.first; br; br = br->id.next) {
+ if (br->ob_mode & OB_MODE_SCULPT && br->wet_paint_radius_factor == 0.0f) {
+ br->wet_paint_radius_factor = 1.0f;
+ }
+ }
}
static void panels_remove_x_closed_flag_recursive(Panel *panel)
@@ -1164,17 +1171,7 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
- /**
- * Versioning code until next subversion bump goes here.
- *
- * \note Be sure to check when bumping the version:
- * - "versioning_userdef.c", #blo_do_versions_userdef
- * - "versioning_userdef.c", #do_versions_theme
- *
- * \note Keep this message at the bottom of the function.
- */
- {
- /* Keep this block, even when empty. */
+ if (!MAIN_VERSION_ATLEAST(bmain, 292, 5)) {
/* Initialize the opacity of the overlay wireframe */
if (!DNA_struct_elem_find(fd->filesdna, "View3DOverlay", "float", "wireframe_opacity")) {
for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
@@ -1223,5 +1220,28 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
LISTBASE_FOREACH (PointCloud *, pointcloud, &bmain->pointclouds) {
do_versions_point_attribute_names(&pointcloud->pdata);
}
+
+ /* Cryptomatte render pass */
+ if (!DNA_struct_elem_find(fd->filesdna, "ViewLayer", "short", "cryptomatte_levels")) {
+ LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
+ LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) {
+ view_layer->cryptomatte_levels = 6;
+ view_layer->cryptomatte_flag = VIEW_LAYER_CRYPTOMATTE_ACCURATE;
+ }
+ }
+ }
+ }
+
+ /**
+ * Versioning code until next subversion bump goes here.
+ *
+ * \note Be sure to check when bumping the version:
+ * - "versioning_userdef.c", #blo_do_versions_userdef
+ * - "versioning_userdef.c", #do_versions_theme
+ *
+ * \note Keep this message at the bottom of the function.
+ */
+ {
+ /* Keep this block, even when empty. */
}
}
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c
index f9050183dda..7bc11317bb4 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -246,6 +246,19 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
FROM_DEFAULT_V4_UCHAR(space_graph.vertex_active);
}
+ if (!USER_VERSION_ATLEAST(292, 5)) {
+ for (int i = 0; i < COLLECTION_COLOR_TOT; ++i) {
+ FROM_DEFAULT_V4_UCHAR(collection_color[i].color);
+ }
+ FROM_DEFAULT_V4_UCHAR(space_sequencer.row_alternate);
+ FROM_DEFAULT_V4_UCHAR(space_node.nodeclass_geometry);
+ FROM_DEFAULT_V4_UCHAR(space_node.nodeclass_attribute);
+ }
+
+ if (!USER_VERSION_ATLEAST(292, 6)) {
+ FROM_DEFAULT_V4_UCHAR(space_node.nodeclass_shader);
+ }
+
/**
* Versioning code until next subversion bump goes here.
*
@@ -257,12 +270,6 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
*/
{
/* Keep this block, even when empty. */
- for (int i = 0; i < COLLECTION_COLOR_TOT; ++i) {
- FROM_DEFAULT_V4_UCHAR(collection_color[i].color);
- }
- FROM_DEFAULT_V4_UCHAR(space_sequencer.row_alternate);
- FROM_DEFAULT_V4_UCHAR(space_node.nodeclass_geometry);
- FROM_DEFAULT_V4_UCHAR(space_node.nodeclass_attribute);
}
#undef FROM_DEFAULT_V4_UCHAR
@@ -814,10 +821,6 @@ void blo_do_versions_userdef(UserDef *userdef)
userdef->uiflag &= ~USER_UIFLAG_UNUSED_3;
}
- if (!USER_VERSION_ATLEAST(292, 4)) {
- userdef->animation_flag = USER_ANIM_SHOW_CHANNEL_GROUP_COLORS;
- }
-
/**
* Versioning code until next subversion bump goes here.
*