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/readblenentry.c49
-rw-r--r--source/blender/blenloader/intern/readfile.c45
-rw-r--r--source/blender/blenloader/intern/readfile.h9
-rw-r--r--source/blender/blenloader/intern/versioning_250.c1
-rw-r--r--source/blender/blenloader/intern/versioning_260.c2
-rw-r--r--source/blender/blenloader/intern/versioning_270.c5
-rw-r--r--source/blender/blenloader/intern/versioning_290.c241
-rw-r--r--source/blender/blenloader/intern/versioning_cycles.c15
-rw-r--r--source/blender/blenloader/intern/versioning_defaults.c12
-rw-r--r--source/blender/blenloader/intern/versioning_legacy.c1
-rw-r--r--source/blender/blenloader/intern/versioning_userdef.c8
-rw-r--r--source/blender/blenloader/intern/writefile.c10
12 files changed, 356 insertions, 42 deletions
diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c
index 1aecba5ba90..296480fc2e4 100644
--- a/source/blender/blenloader/intern/readblenentry.c
+++ b/source/blender/blenloader/intern/readblenentry.c
@@ -40,6 +40,7 @@
#include "DNA_genfile.h"
#include "DNA_sdna_types.h"
+#include "BKE_icons.h"
#include "BKE_idtype.h"
#include "BKE_main.h"
@@ -160,6 +161,51 @@ LinkNode *BLO_blendhandle_get_datablock_names(BlendHandle *bh, int ofblocktype,
}
/**
+ * Gets the names and asset-data (if ID is an asset) of all the data-blocks in a file of a certain
+ * type (e.g. all the scene names in a file).
+ *
+ * \param bh: The blendhandle to access.
+ * \param ofblocktype: The type of names to get.
+ * \param tot_info_items: The length of the returned list.
+ * \return A BLI_linklist of BLODataBlockInfo *. The links and #BLODataBlockInfo.asset_data should
+ * be freed with MEM_freeN.
+ */
+LinkNode *BLO_blendhandle_get_datablock_info(BlendHandle *bh, int ofblocktype, int *tot_info_items)
+{
+ FileData *fd = (FileData *)bh;
+ LinkNode *infos = NULL;
+ BHead *bhead;
+ int tot = 0;
+
+ for (bhead = blo_bhead_first(fd); bhead; bhead = blo_bhead_next(fd, bhead)) {
+ if (bhead->code == ofblocktype) {
+ struct BLODataBlockInfo *info = MEM_mallocN(sizeof(*info), __func__);
+ const char *name = blo_bhead_id_name(fd, bhead) + 2;
+
+ STRNCPY(info->name, name);
+
+ /* Lastly, read asset data from the following blocks. */
+ info->asset_data = blo_bhead_id_asset_data_address(fd, bhead);
+ if (info->asset_data) {
+ bhead = blo_read_asset_data_block(fd, bhead, &info->asset_data);
+ /* blo_read_asset_data_block() reads all DATA heads and already advances bhead to the next
+ * non-DATA one. Go back, so the loop doesn't skip the non-DATA head. */
+ bhead = blo_bhead_prev(fd, bhead);
+ }
+
+ BLI_linklist_prepend(&infos, info);
+ tot++;
+ }
+ else if (bhead->code == ENDB) {
+ break;
+ }
+ }
+
+ *tot_info_items = tot;
+ return infos;
+}
+
+/**
* Gets the previews of all the data-blocks in a file of a certain type
* (e.g. all the scene previews in a file).
*
@@ -203,6 +249,7 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype, int *to
if (looking) {
if (bhead->SDNAnr == DNA_struct_find_nr(fd->filesdna, "PreviewImage")) {
prv = BLO_library_read_struct(fd, bhead, "PreviewImage");
+
if (prv) {
memcpy(new_prv, prv, sizeof(PreviewImage));
if (prv->rect[0] && prv->w[0] && prv->h[0]) {
@@ -217,6 +264,7 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype, int *to
new_prv->rect[0] = NULL;
new_prv->w[0] = new_prv->h[0] = 0;
}
+ BKE_previewimg_finish(new_prv, 0);
if (prv->rect[1] && prv->w[1] && prv->h[1]) {
bhead = blo_bhead_next(fd, bhead);
@@ -230,6 +278,7 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype, int *to
new_prv->rect[1] = NULL;
new_prv->w[1] = new_prv->h[1] = 0;
}
+ BKE_previewimg_finish(new_prv, 1);
MEM_freeN(prv);
}
}
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 9ce767b7ce1..bccc7150523 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -44,7 +44,9 @@
#define DNA_DEPRECATED_ALLOW
#include "DNA_anim_types.h"
+#include "DNA_asset_types.h"
#include "DNA_cachefile_types.h"
+#include "DNA_collection_types.h"
#include "DNA_fileglobal_types.h"
#include "DNA_genfile.h"
#include "DNA_key_types.h"
@@ -53,6 +55,7 @@
#include "DNA_packedFile_types.h"
#include "DNA_sdna_types.h"
#include "DNA_sound_types.h"
+#include "DNA_vfont_types.h"
#include "DNA_volume_types.h"
#include "DNA_workspace_types.h"
@@ -71,6 +74,7 @@
#include "BKE_anim_data.h"
#include "BKE_animsys.h"
+#include "BKE_asset.h"
#include "BKE_collection.h"
#include "BKE_global.h" /* for G */
#include "BKE_idprop.h"
@@ -955,12 +959,21 @@ static BHead *blo_bhead_read_full(FileData *fd, BHead *thisblock)
}
#endif /* USE_BHEAD_READ_ON_DEMAND */
-/* Warning! Caller's responsibility to ensure given bhead **is** and ID one! */
+/* Warning! Caller's responsibility to ensure given bhead **is** an ID one! */
const char *blo_bhead_id_name(const FileData *fd, const BHead *bhead)
{
return (const char *)POINTER_OFFSET(bhead, sizeof(*bhead) + fd->id_name_offs);
}
+/* Warning! Caller's responsibility to ensure given bhead **is** an ID one! */
+AssetMetaData *blo_bhead_id_asset_data_address(const FileData *fd, const BHead *bhead)
+{
+ BLI_assert(BKE_idtype_idcode_is_valid(bhead->code));
+ return (fd->id_asset_data_offs >= 0) ?
+ *(AssetMetaData **)POINTER_OFFSET(bhead, sizeof(*bhead) + fd->id_asset_data_offs) :
+ NULL;
+}
+
static void decode_blender_header(FileData *fd)
{
char header[SIZEOFBLENDERHEADER], num[4];
@@ -1038,6 +1051,8 @@ static bool read_file_dna(FileData *fd, const char **r_error_message)
/* used to retrieve ID names from (bhead+1) */
fd->id_name_offs = DNA_elem_offset(fd->filesdna, "ID", "char", "name[]");
BLI_assert(fd->id_name_offs != -1);
+ fd->id_asset_data_offs = DNA_elem_offset(
+ fd->filesdna, "ID", "AssetMetaData", "*asset_data");
return true;
}
@@ -2358,6 +2373,11 @@ static void direct_link_id_common(
return;
}
+ if (id->asset_data) {
+ BLO_read_data_address(reader, &id->asset_data);
+ BKE_asset_metadata_read(reader, id->asset_data);
+ }
+
/*link direct data of ID properties*/
if (id->properties) {
BLO_read_data_address(reader, &id->properties);
@@ -2731,6 +2751,7 @@ static void lib_link_workspace_layout_restore(struct IDNameLib_Map *id_map,
SpaceFile *sfile = (SpaceFile *)sl;
sfile->op = NULL;
sfile->previews_timer = NULL;
+ sfile->tags = FILE_TAG_REBUILD_MAIN_FILES;
}
else if (sl->spacetype == SPACE_ACTION) {
SpaceAction *saction = (SpaceAction *)sl;
@@ -3606,6 +3627,27 @@ static BHead *read_libblock(FileData *fd,
/** \} */
/* -------------------------------------------------------------------- */
+/** \name Read Asset Data
+ * \{ */
+
+BHead *blo_read_asset_data_block(FileData *fd, BHead *bhead, AssetMetaData **r_asset_data)
+{
+ BLI_assert(BKE_idtype_idcode_is_valid(bhead->code));
+
+ bhead = read_data_into_datamap(fd, bhead, "asset-data read");
+
+ BlendDataReader reader = {fd};
+ BLO_read_data_address(&reader, r_asset_data);
+ BKE_asset_metadata_read(&reader, *r_asset_data);
+
+ oldnewmap_clear(fd->datamap);
+
+ return bhead;
+}
+
+/** \} */
+
+/* -------------------------------------------------------------------- */
/** \name Read Global Data
* \{ */
@@ -3863,6 +3905,7 @@ static BHead *read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead)
BLO_read_list(reader, &user->user_menus);
BLO_read_list(reader, &user->addons);
BLO_read_list(reader, &user->autoexec_paths);
+ BLO_read_list(reader, &user->asset_libraries);
LISTBASE_FOREACH (wmKeyMap *, keymap, &user->user_keymaps) {
keymap->modal_items = NULL;
diff --git a/source/blender/blenloader/intern/readfile.h b/source/blender/blenloader/intern/readfile.h
index fb950e37da8..c724cc32051 100644
--- a/source/blender/blenloader/intern/readfile.h
+++ b/source/blender/blenloader/intern/readfile.h
@@ -34,16 +34,13 @@
#include "zlib.h"
struct BLOCacheStorage;
-struct GSet;
struct IDNameLib_Map;
struct Key;
struct MemFile;
struct Object;
struct OldNewMap;
-struct PartEff;
struct ReportList;
struct UserDef;
-struct View3D;
typedef struct IDNameLib_Map IDNameLib_Map;
@@ -112,6 +109,9 @@ typedef struct FileData {
int fileversion;
/** Used to retrieve ID names from (bhead+1). */
int id_name_offs;
+ /** Used to retrieve asset data from (bhead+1). NOTE: This may not be available in old files,
+ * will be -1 then! */
+ int id_asset_data_offs;
/** For do_versions patching. */
int globalf, fileflags;
@@ -159,6 +159,8 @@ void blo_end_packed_pointer_map(FileData *fd, struct Main *oldmain);
void blo_add_library_pointer_map(ListBase *old_mainlist, FileData *fd);
void blo_make_old_idmap_from_main(FileData *fd, struct Main *bmain);
+BHead *blo_read_asset_data_block(FileData *fd, BHead *bhead, struct AssetMetaData **r_asset_data);
+
void blo_cache_storage_init(FileData *fd, struct Main *bmain);
void blo_cache_storage_old_bmain_clear(FileData *fd, struct Main *bmain_old);
void blo_cache_storage_end(FileData *fd);
@@ -170,6 +172,7 @@ BHead *blo_bhead_next(FileData *fd, BHead *thisblock);
BHead *blo_bhead_prev(FileData *fd, BHead *thisblock);
const char *blo_bhead_id_name(const FileData *fd, const BHead *bhead);
+struct AssetMetaData *blo_bhead_id_asset_data_address(const FileData *fd, const BHead *bhead);
/* do versions stuff */
diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c
index c86ad639216..b282a978e8a 100644
--- a/source/blender/blenloader/intern/versioning_250.c
+++ b/source/blender/blenloader/intern/versioning_250.c
@@ -46,6 +46,7 @@
#include "DNA_meshdata_types.h"
#include "DNA_node_types.h"
#include "DNA_object_fluidsim_types.h"
+#include "DNA_object_force_types.h"
#include "DNA_object_types.h"
#include "DNA_screen_types.h"
#include "DNA_sdna_types.h"
diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c
index c33f2a8cad5..c336239ec59 100644
--- a/source/blender/blenloader/intern/versioning_260.c
+++ b/source/blender/blenloader/intern/versioning_260.c
@@ -28,11 +28,13 @@
#include "DNA_camera_types.h"
#include "DNA_cloth_types.h"
#include "DNA_constraint_types.h"
+#include "DNA_dynamicpaint_types.h"
#include "DNA_fluid_types.h"
#include "DNA_genfile.h"
#include "DNA_key_types.h"
#include "DNA_light_types.h"
#include "DNA_linestyle_types.h"
+#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_fluidsim_types.h"
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index adc2b55b350..046749e4691 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -64,6 +64,7 @@
#include "BKE_scene.h"
#include "BKE_screen.h"
#include "BKE_tracking.h"
+#include "DNA_material_types.h"
#include "SEQ_sequencer.h"
@@ -301,7 +302,9 @@ static void do_version_hue_sat_node(bNodeTree *ntree, bNode *node)
/* Take care of possible animation. */
AnimData *adt = BKE_animdata_from_id(&ntree->id);
if (adt != NULL && adt->action != NULL) {
- const char *prefix = BLI_sprintfN("nodes[\"%s\"]", node->name);
+ char node_name_esc[sizeof(node->name) * 2];
+ BLI_str_escape(node_name_esc, node->name, sizeof(node_name_esc));
+ const char *prefix = BLI_sprintfN("nodes[\"%s\"]", node_name_esc);
for (FCurve *fcu = adt->action->curves.first; fcu != NULL; fcu = fcu->next) {
if (STRPREFIX(fcu->rna_path, prefix)) {
anim_change_prop_name(fcu, prefix, "color_hue", "inputs[1].default_value");
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c
index a98e7c46f10..4df681002a0 100644
--- a/source/blender/blenloader/intern/versioning_290.c
+++ b/source/blender/blenloader/intern/versioning_290.c
@@ -29,6 +29,7 @@
#include "DNA_anim_types.h"
#include "DNA_brush_types.h"
#include "DNA_cachefile_types.h"
+#include "DNA_collection_types.h"
#include "DNA_constraint_types.h"
#include "DNA_fluid_types.h"
#include "DNA_genfile.h"
@@ -52,6 +53,7 @@
#include "BKE_armature.h"
#include "BKE_collection.h"
#include "BKE_colortools.h"
+#include "BKE_cryptomatte.h"
#include "BKE_fcurve.h"
#include "BKE_gpencil.h"
#include "BKE_lib_id.h"
@@ -72,6 +74,29 @@
/* Make preferences read-only, use versioning_userdef.c. */
#define U (*((const UserDef *)&U))
+static eSpaceSeq_Proxy_RenderSize get_sequencer_render_size(Main *bmain)
+{
+ eSpaceSeq_Proxy_RenderSize render_size = 100;
+
+ for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
+ LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
+ LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
+ switch (sl->spacetype) {
+ case SPACE_SEQ: {
+ SpaceSeq *sseq = (SpaceSeq *)sl;
+ if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
+ render_size = sseq->render_size;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return render_size;
+}
+
/* image_size is width or height depending what RNA property is converted - X or Y. */
static void seq_convert_transform_animation(const Scene *scene,
const char *path,
@@ -210,6 +235,84 @@ static void seq_convert_transform_crop_lb(const Scene *scene,
}
}
+static void seq_convert_transform_animation_2(const Scene *scene,
+ const char *path,
+ const float scale_to_fit_factor)
+{
+ if (scene->adt == NULL || scene->adt->action == NULL) {
+ return;
+ }
+
+ FCurve *fcu = BKE_fcurve_find(&scene->adt->action->curves, path, 0);
+ if (fcu != NULL && !BKE_fcurve_is_empty(fcu)) {
+ BezTriple *bezt = fcu->bezt;
+ for (int i = 0; i < fcu->totvert; i++, bezt++) {
+ /* Same math as with old_image_center_*, but simplified. */
+ bezt->vec[1][1] *= scale_to_fit_factor;
+ }
+ }
+}
+
+static void seq_convert_transform_crop_2(const Scene *scene,
+ Sequence *seq,
+ const eSpaceSeq_Proxy_RenderSize render_size)
+{
+ const StripElem *s_elem = SEQ_render_give_stripelem(seq, seq->start);
+ if (s_elem == NULL) {
+ return;
+ }
+
+ StripCrop *c = seq->strip->crop;
+ StripTransform *t = seq->strip->transform;
+ int image_size_x = s_elem->orig_width;
+ int image_size_y = s_elem->orig_height;
+
+ if (SEQ_can_use_proxy(seq, SEQ_rendersize_to_proxysize(render_size))) {
+ image_size_x /= SEQ_rendersize_to_scale_factor(render_size);
+ image_size_y /= SEQ_rendersize_to_scale_factor(render_size);
+ }
+
+ /* Calculate scale factor, so image fits in preview area with original aspect ratio. */
+ const float scale_to_fit_factor = MIN2((float)scene->r.xsch / (float)image_size_x,
+ (float)scene->r.ysch / (float)image_size_y);
+ t->scale_x *= scale_to_fit_factor;
+ t->scale_y *= scale_to_fit_factor;
+ c->top /= scale_to_fit_factor;
+ c->bottom /= scale_to_fit_factor;
+ c->left /= scale_to_fit_factor;
+ c->right /= scale_to_fit_factor;
+
+ char name_esc[(sizeof(seq->name) - 2) * 2], *path;
+ BLI_str_escape(name_esc, seq->name + 2, sizeof(name_esc));
+ path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].crop.min_x", name_esc);
+ seq_convert_transform_animation_2(scene, path, 1 / scale_to_fit_factor);
+ MEM_freeN(path);
+ path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].crop.max_x", name_esc);
+ seq_convert_transform_animation_2(scene, path, 1 / scale_to_fit_factor);
+ MEM_freeN(path);
+ path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].crop.min_y", name_esc);
+ seq_convert_transform_animation_2(scene, path, 1 / scale_to_fit_factor);
+ MEM_freeN(path);
+ path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].crop.max_x", name_esc);
+ seq_convert_transform_animation_2(scene, path, 1 / scale_to_fit_factor);
+ MEM_freeN(path);
+}
+
+static void seq_convert_transform_crop_lb_2(const Scene *scene,
+ const ListBase *lb,
+ const eSpaceSeq_Proxy_RenderSize render_size)
+{
+
+ LISTBASE_FOREACH (Sequence *, seq, lb) {
+ if (seq->type != SEQ_TYPE_SOUND_RAM) {
+ seq_convert_transform_crop_2(scene, seq, render_size);
+ }
+ if (seq->type == SEQ_TYPE_META) {
+ seq_convert_transform_crop_lb_2(scene, &seq->seqbase, render_size);
+ }
+ }
+}
+
void do_versions_after_linking_290(Main *bmain, ReportList *UNUSED(reports))
{
if (!MAIN_VERSION_ATLEAST(bmain, 290, 1)) {
@@ -439,25 +542,35 @@ void do_versions_after_linking_290(Main *bmain, ReportList *UNUSED(reports))
if (!MAIN_VERSION_ATLEAST(bmain, 292, 2)) {
- eSpaceSeq_Proxy_RenderSize render_size = 100;
+ eSpaceSeq_Proxy_RenderSize render_size = get_sequencer_render_size(bmain);
- for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
- LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
- LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
- switch (sl->spacetype) {
- case SPACE_SEQ: {
- SpaceSeq *sseq = (SpaceSeq *)sl;
- render_size = sseq->render_size;
- break;
- }
- }
- }
+ LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
+ if (scene->ed != NULL) {
+ seq_convert_transform_crop_lb(scene, &scene->ed->seqbase, render_size);
}
}
+ }
+ if (!MAIN_VERSION_ATLEAST(bmain, 292, 8)) {
+ /* Systematically rebuild posebones to ensure consistent ordering matching the one of bones in
+ * Armature obdata. */
+ LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
+ if (ob->type == OB_ARMATURE) {
+ BKE_pose_rebuild(bmain, ob, ob->data, true);
+ }
+ }
+
+ /* 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;
+ }
+ }
+
+ eSpaceSeq_Proxy_RenderSize render_size = get_sequencer_render_size(bmain);
LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
if (scene->ed != NULL) {
- seq_convert_transform_crop_lb(scene, &scene->ed->seqbase, render_size);
+ seq_convert_transform_crop_lb_2(scene, &scene->ed->seqbase, render_size);
}
}
}
@@ -474,21 +587,6 @@ void do_versions_after_linking_290(Main *bmain, ReportList *UNUSED(reports))
*/
{
/* Keep this block, even when empty. */
-
- /* Systematically rebuild posebones to ensure consistent ordering matching the one of bones in
- * Armature obdata. */
- LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
- if (ob->type == OB_ARMATURE) {
- BKE_pose_rebuild(bmain, ob, ob->data, true);
- }
- }
- }
-
- /* 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;
- }
}
}
@@ -1232,6 +1330,93 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
+ if (!MAIN_VERSION_ATLEAST(bmain, 292, 7)) {
+ /* Make all IDProperties used as interface of geometry node trees overridable. */
+ LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
+ LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
+ if (md->type == eModifierType_Nodes) {
+ NodesModifierData *nmd = (NodesModifierData *)md;
+ IDProperty *nmd_properties = nmd->settings.properties;
+
+ BLI_assert(nmd_properties->type == IDP_GROUP);
+ LISTBASE_FOREACH (IDProperty *, nmd_socket_idprop, &nmd_properties->data.group) {
+ nmd_socket_idprop->flag |= IDP_FLAG_OVERRIDABLE_LIBRARY;
+ }
+ }
+ }
+ }
+
+ /* EEVEE/Cycles Volumes consistency */
+ for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) {
+ /* Remove Volume Transmittance render pass from each view layer. */
+ LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) {
+ view_layer->eevee.render_passes &= ~EEVEE_RENDER_PASS_UNUSED_8;
+ }
+
+ /* Rename Renderlayer Socket `VolumeScatterCol` to `VolumeDir` */
+ if (scene->nodetree) {
+ LISTBASE_FOREACH (bNode *, node, &scene->nodetree->nodes) {
+ if (node->type == CMP_NODE_R_LAYERS) {
+ LISTBASE_FOREACH (bNodeSocket *, output_socket, &node->outputs) {
+ const char *volume_scatter = "VolumeScatterCol";
+ if (STREQLEN(output_socket->name, volume_scatter, MAX_NAME)) {
+ BLI_strncpy(output_socket->name, RE_PASSNAME_VOLUME_LIGHT, MAX_NAME);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /* Convert `NodeCryptomatte->storage->matte_id` to `NodeCryptomatte->storage->entries` */
+ if (!DNA_struct_find(fd->filesdna, "CryptomatteEntry")) {
+ LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
+ if (scene->nodetree) {
+ LISTBASE_FOREACH (bNode *, node, &scene->nodetree->nodes) {
+ if (node->type == CMP_NODE_CRYPTOMATTE) {
+ NodeCryptomatte *storage = (NodeCryptomatte *)node->storage;
+ char *matte_id = storage->matte_id;
+ if (matte_id == NULL || strlen(storage->matte_id) == 0) {
+ continue;
+ }
+ BKE_cryptomatte_matte_id_to_entries(NULL, storage, storage->matte_id);
+ MEM_SAFE_FREE(storage->matte_id);
+ }
+ }
+ }
+ }
+ }
+
+ /* Overlay elements in the sequencer. */
+ LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
+ LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
+ LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
+ if (sl->spacetype == SPACE_SEQ) {
+ SpaceSeq *sseq = (SpaceSeq *)sl;
+ sseq->flag |= (SEQ_SHOW_STRIP_OVERLAY | SEQ_SHOW_STRIP_NAME | SEQ_SHOW_STRIP_SOURCE |
+ SEQ_SHOW_STRIP_DURATION);
+ }
+ }
+ }
+ }
+ }
+
+ if (!MAIN_VERSION_ATLEAST(bmain, 292, 8)) {
+ LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
+ LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
+ if (STREQ(node->idname, "GeometryNodeRandomAttribute")) {
+ STRNCPY(node->idname, "GeometryNodeAttributeRandomize");
+ }
+ }
+ }
+
+ LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
+ if (scene->ed != NULL) {
+ scene->toolsettings->sequencer_tool_settings = SEQ_tool_settings_init();
+ }
+ }
+ }
+
/**
* Versioning code until next subversion bump goes here.
*
diff --git a/source/blender/blenloader/intern/versioning_cycles.c b/source/blender/blenloader/intern/versioning_cycles.c
index 19e392734f0..631abe10ddc 100644
--- a/source/blender/blenloader/intern/versioning_cycles.c
+++ b/source/blender/blenloader/intern/versioning_cycles.c
@@ -840,12 +840,14 @@ static void update_mapping_node_fcurve_rna_path_callback(ID *UNUSED(id),
fcurve->rna_path = BLI_sprintfN("%s.%s", data->nodePath, "inputs[3].default_value");
}
else if (data->minimumNode && BLI_str_endswith(old_fcurve_rna_path, "max")) {
- fcurve->rna_path = BLI_sprintfN(
- "nodes[\"%s\"].%s", data->minimumNode->name, "inputs[1].default_value");
+ char node_name_esc[sizeof(data->minimumNode->name) * 2];
+ BLI_str_escape(node_name_esc, data->minimumNode->name, sizeof(node_name_esc));
+ fcurve->rna_path = BLI_sprintfN("nodes[\"%s\"].%s", node_name_esc, "inputs[1].default_value");
}
else if (data->maximumNode && BLI_str_endswith(old_fcurve_rna_path, "min")) {
- fcurve->rna_path = BLI_sprintfN(
- "nodes[\"%s\"].%s", data->maximumNode->name, "inputs[1].default_value");
+ char node_name_esc[sizeof(data->maximumNode->name) * 2];
+ BLI_str_escape(node_name_esc, data->maximumNode->name, sizeof(node_name_esc));
+ fcurve->rna_path = BLI_sprintfN("nodes[\"%s\"].%s", node_name_esc, "inputs[1].default_value");
}
if (fcurve->rna_path != old_fcurve_rna_path) {
@@ -955,7 +957,10 @@ static void update_mapping_node_inputs_and_properties(bNodeTree *ntree)
MEM_freeN(node->storage);
node->storage = NULL;
- char *nodePath = BLI_sprintfN("nodes[\"%s\"]", node->name);
+ char node_name_esc[sizeof(node->name) * 2];
+ BLI_str_escape(node_name_esc, node->name, sizeof(node_name_esc));
+
+ char *nodePath = BLI_sprintfN("nodes[\"%s\"]", node_name_esc);
MappingNodeFCurveCallbackData data = {nodePath, minimumNode, maximumNode};
BKE_fcurves_id_cb(&ntree->id, update_mapping_node_fcurve_rna_path_callback, &data);
MEM_freeN(nodePath);
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index 48a24755250..198f65b9794 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -37,6 +37,7 @@
#include "DNA_curveprofile_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_light_types.h"
+#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
@@ -181,7 +182,8 @@ static void blo_update_defaults_screen(bScreen *screen,
}
else if (area->spacetype == SPACE_SEQ) {
SpaceSeq *seq = area->spacedata.first;
- seq->flag |= SEQ_SHOW_MARKERS | SEQ_SHOW_FCURVES | SEQ_ZOOM_TO_FIT;
+ seq->flag |= SEQ_SHOW_MARKERS | SEQ_SHOW_FCURVES | SEQ_ZOOM_TO_FIT | SEQ_SHOW_STRIP_OVERLAY |
+ SEQ_SHOW_STRIP_SOURCE | SEQ_SHOW_STRIP_NAME | SEQ_SHOW_STRIP_DURATION;
}
else if (area->spacetype == SPACE_TEXT) {
/* Show syntax and line numbers in Script workspace text editor. */
@@ -737,6 +739,14 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
brush->sculpt_tool = SCULPT_TOOL_DISPLACEMENT_ERASER;
}
+ brush_name = "Multires Displacement Smear";
+ brush = BLI_findstring(&bmain->brushes, brush_name, offsetof(ID, name) + 2);
+ if (!brush) {
+ brush = BKE_brush_add(bmain, brush_name, OB_MODE_SCULPT);
+ id_us_min(&brush->id);
+ brush->sculpt_tool = SCULPT_TOOL_DISPLACEMENT_SMEAR;
+ }
+
/* Use the same tool icon color in the brush cursor */
for (brush = bmain->brushes.first; brush; brush = brush->id.next) {
if (brush->ob_mode & OB_MODE_SCULPT) {
diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c
index d654a0e30bd..6f459339675 100644
--- a/source/blender/blenloader/intern/versioning_legacy.c
+++ b/source/blender/blenloader/intern/versioning_legacy.c
@@ -49,6 +49,7 @@
#include "DNA_nla_types.h"
#include "DNA_node_types.h"
#include "DNA_object_fluidsim_types.h"
+#include "DNA_object_force_types.h"
#include "DNA_object_types.h"
#include "DNA_screen_types.h"
#include "DNA_sdna_types.h"
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c
index 7bc11317bb4..f1572c563bf 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -31,6 +31,7 @@
#endif
#include "DNA_anim_types.h"
+#include "DNA_collection_types.h"
#include "DNA_curve_types.h"
#include "DNA_scene_types.h"
#include "DNA_space_types.h"
@@ -43,6 +44,7 @@
#include "BKE_idprop.h"
#include "BKE_keyconfig.h"
#include "BKE_main.h"
+#include "BKE_preferences.h"
#include "BLO_readfile.h"
@@ -328,9 +330,6 @@ void blo_do_versions_userdef(UserDef *userdef)
#define USER_VERSION_ATLEAST(ver, subver) MAIN_VERSION_ATLEAST(userdef, ver, subver)
/* the UserDef struct is not corrected with do_versions() .... ugh! */
- if (userdef->wheellinescroll == 0) {
- userdef->wheellinescroll = 3;
- }
if (userdef->menuthreshold1 == 0) {
userdef->menuthreshold1 = 5;
userdef->menuthreshold2 = 2;
@@ -832,6 +831,9 @@ void blo_do_versions_userdef(UserDef *userdef)
*/
{
/* Keep this block, even when empty. */
+ if (BLI_listbase_is_empty(&userdef->asset_libraries)) {
+ BKE_preferences_asset_library_default_add(userdef);
+ }
}
LISTBASE_FOREACH (bTheme *, btheme, &userdef->themes) {
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 11fe240620a..0a4f2fde93f 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -93,6 +93,7 @@
/* allow writefile to use deprecated functionality (for forward compatibility code) */
#define DNA_DEPRECATED_ALLOW
+#include "DNA_collection_types.h"
#include "DNA_fileglobal_types.h"
#include "DNA_genfile.h"
#include "DNA_sdna_types.h"
@@ -755,6 +756,10 @@ static void write_userdef(BlendWriter *writer, const UserDef *userdef)
BLO_write_struct(writer, bPathCompare, path_cmp);
}
+ LISTBASE_FOREACH (const bUserAssetLibrary *, asset_library, &userdef->asset_libraries) {
+ BLO_write_struct(writer, bUserAssetLibrary, asset_library);
+ }
+
LISTBASE_FOREACH (const uiStyle *, style, &userdef->uistyles) {
BLO_write_struct(writer, uiStyle, style);
}
@@ -1369,6 +1374,11 @@ void BLO_write_float_array(BlendWriter *writer, uint num, const float *data_ptr)
BLO_write_raw(writer, sizeof(float) * (size_t)num, data_ptr);
}
+void BLO_write_double_array(BlendWriter *writer, uint num, const double *data_ptr)
+{
+ BLO_write_raw(writer, sizeof(double) * (size_t)num, data_ptr);
+}
+
void BLO_write_pointer_array(BlendWriter *writer, uint num, const void *data_ptr)
{
BLO_write_raw(writer, sizeof(void *) * (size_t)num, data_ptr);