Blender V4.3
versioning_290.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8/* allow readfile to use deprecated functionality */
9#define DNA_DEPRECATED_ALLOW
10
11#include <algorithm>
12
13#include "BLI_listbase.h"
14#include "BLI_math_matrix.h"
15#include "BLI_math_rotation.h"
16#include "BLI_string.h"
17#include "BLI_utildefines.h"
18
19/* Define macros in `DNA_genfile.h`. */
20#define DNA_GENFILE_VERSIONING_MACROS
21
22#include "DNA_anim_types.h"
23#include "DNA_armature_types.h"
24#include "DNA_brush_types.h"
25#include "DNA_cachefile_types.h"
28#include "DNA_fluid_types.h"
29#include "DNA_genfile.h"
32#include "DNA_light_types.h"
33#include "DNA_mesh_types.h"
34#include "DNA_meshdata_types.h"
35#include "DNA_modifier_types.h"
36#include "DNA_object_types.h"
37#include "DNA_particle_types.h"
39#include "DNA_rigidbody_types.h"
40#include "DNA_screen_types.h"
41#include "DNA_sequence_types.h"
42#include "DNA_shader_fx_types.h"
43#include "DNA_space_types.h"
44#include "DNA_text_types.h"
45#include "DNA_tracking_types.h"
46#include "DNA_workspace_types.h"
47
48#undef DNA_GENFILE_VERSIONING_MACROS
49
50#include "BKE_armature.hh"
51#include "BKE_collection.hh"
52#include "BKE_colortools.hh"
53#include "BKE_cryptomatte.h"
54#include "BKE_curve.hh"
55#include "BKE_customdata.hh"
56#include "BKE_fcurve.hh"
57#include "BKE_gpencil_legacy.h"
58#include "BKE_lib_id.hh"
59#include "BKE_main.hh"
60#include "BKE_mesh.hh"
62#include "BKE_multires.hh"
63#include "BKE_node.hh"
64
65#include "IMB_imbuf.hh"
66#include "MEM_guardedalloc.h"
67
68#include "SEQ_proxy.hh"
69#include "SEQ_sequencer.hh"
70#include "SEQ_time.hh"
71
72#include "BLO_readfile.hh"
73#include "readfile.hh"
74#include "versioning_common.hh"
75
76/* Make preferences read-only, use `versioning_userdef.cc`. */
77#define U (*((const UserDef *)&U))
78
80{
82
83 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
84 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
85 LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
86 switch (sl->spacetype) {
87 case SPACE_SEQ: {
88 SpaceSeq *sseq = (SpaceSeq *)sl;
89 if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
90 render_size = eSpaceSeq_Proxy_RenderSize(sseq->render_size);
91 break;
92 }
93 }
94 }
95 }
96 }
97 }
98
99 return render_size;
100}
101
102static bool can_use_proxy(const Sequence *seq, int psize)
103{
104 if (seq->strip->proxy == nullptr) {
105 return false;
106 }
107 short size_flags = seq->strip->proxy->build_size_flags;
108 return (seq->flag & SEQ_USE_PROXY) != 0 && psize != IMB_PROXY_NONE && (size_flags & psize) != 0;
109}
110
111/* image_size is width or height depending what RNA property is converted - X or Y. */
113 const Scene *scene,
114 const char *path,
115 const int image_size,
116 const int scene_size)
117{
118 if (scene->adt == nullptr || scene->adt->action == nullptr) {
119 return;
120 }
121
122 /* Hardcoded legacy bit-flags which has been removed. */
123 const uint32_t use_transform_flag = (1 << 16);
124 const uint32_t use_crop_flag = (1 << 17);
125
126 /* Convert offset animation, but only if crop is not used. */
127 if ((seq->flag & use_transform_flag) != 0 && (seq->flag & use_crop_flag) == 0) {
128 FCurve *fcu = BKE_fcurve_find(&scene->adt->action->curves, path, 0);
129 if (fcu != nullptr && !BKE_fcurve_is_empty(fcu)) {
130 BezTriple *bezt = fcu->bezt;
131 for (int i = 0; i < fcu->totvert; i++, bezt++) {
132 /* Same math as with old_image_center_*, but simplified. */
133 bezt->vec[0][1] = (image_size - scene_size) / 2 + bezt->vec[0][1];
134 bezt->vec[1][1] = (image_size - scene_size) / 2 + bezt->vec[1][1];
135 bezt->vec[2][1] = (image_size - scene_size) / 2 + bezt->vec[2][1];
136 }
137 }
138 }
139 else { /* Else, remove offset animation. */
140 FCurve *fcu = BKE_fcurve_find(&scene->adt->action->curves, path, 0);
141 BLI_remlink(&scene->adt->action->curves, fcu);
142 BKE_fcurve_free(fcu);
143 }
144}
145
146static void seq_convert_transform_crop(const Scene *scene,
147 Sequence *seq,
148 const eSpaceSeq_Proxy_RenderSize render_size)
149{
150 if (seq->strip->transform == nullptr) {
151 seq->strip->transform = MEM_cnew<StripTransform>(__func__);
152 }
153 if (seq->strip->crop == nullptr) {
154 seq->strip->crop = MEM_cnew<StripCrop>(__func__);
155 }
156
157 StripCrop *c = seq->strip->crop;
158 StripTransform *t = seq->strip->transform;
159 int old_image_center_x = scene->r.xsch / 2;
160 int old_image_center_y = scene->r.ysch / 2;
161 int image_size_x = scene->r.xsch;
162 int image_size_y = scene->r.ysch;
163
164 /* Hard-coded legacy bit-flags which has been removed. */
165 const uint32_t use_transform_flag = (1 << 16);
166 const uint32_t use_crop_flag = (1 << 17);
167
168 const StripElem *s_elem = seq->strip->stripdata;
169 if (s_elem != nullptr) {
170 image_size_x = s_elem->orig_width;
171 image_size_y = s_elem->orig_height;
172
173 if (can_use_proxy(seq, SEQ_rendersize_to_proxysize(render_size))) {
174 image_size_x /= SEQ_rendersize_to_scale_factor(render_size);
175 image_size_y /= SEQ_rendersize_to_scale_factor(render_size);
176 }
177 }
178
179 /* Default scale. */
180 if (t->scale_x == 0.0f && t->scale_y == 0.0f) {
181 t->scale_x = 1.0f;
182 t->scale_y = 1.0f;
183 }
184
185 /* Clear crop if it was unused. This must happen before converting values. */
186 if ((seq->flag & use_crop_flag) == 0) {
187 c->bottom = c->top = c->left = c->right = 0;
188 }
189
190 if ((seq->flag & use_transform_flag) == 0) {
191 t->xofs = t->yofs = 0;
192
193 /* Reverse scale to fit for strips not using offset. */
194 float project_aspect = float(scene->r.xsch) / float(scene->r.ysch);
195 float image_aspect = float(image_size_x) / float(image_size_y);
196 if (project_aspect > image_aspect) {
197 t->scale_x = project_aspect / image_aspect;
198 }
199 else {
200 t->scale_y = image_aspect / project_aspect;
201 }
202 }
203
204 if ((seq->flag & use_crop_flag) != 0 && (seq->flag & use_transform_flag) == 0) {
205 /* Calculate image offset. */
206 float s_x = scene->r.xsch / image_size_x;
207 float s_y = scene->r.ysch / image_size_y;
208 old_image_center_x += c->right * s_x - c->left * s_x;
209 old_image_center_y += c->top * s_y - c->bottom * s_y;
210
211 /* Convert crop to scale. */
212 int cropped_image_size_x = image_size_x - c->right - c->left;
213 int cropped_image_size_y = image_size_y - c->top - c->bottom;
214 c->bottom = c->top = c->left = c->right = 0;
215 t->scale_x *= float(image_size_x) / float(cropped_image_size_x);
216 t->scale_y *= float(image_size_y) / float(cropped_image_size_y);
217 }
218
219 if ((seq->flag & use_transform_flag) != 0) {
220 /* Convert image offset. */
221 old_image_center_x = image_size_x / 2 - c->left + t->xofs;
222 old_image_center_y = image_size_y / 2 - c->bottom + t->yofs;
223
224 /* Preserve original image size. */
225 t->scale_x = t->scale_y = std::max(float(image_size_x) / float(scene->r.xsch),
226 float(image_size_y) / float(scene->r.ysch));
227
228 /* Convert crop. */
229 if ((seq->flag & use_crop_flag) != 0) {
230 c->top /= t->scale_x;
231 c->bottom /= t->scale_x;
232 c->left /= t->scale_x;
233 c->right /= t->scale_x;
234 }
235 }
236
237 t->xofs = old_image_center_x - scene->r.xsch / 2;
238 t->yofs = old_image_center_y - scene->r.ysch / 2;
239
240 char name_esc[(sizeof(seq->name) - 2) * 2], *path;
241 BLI_str_escape(name_esc, seq->name + 2, sizeof(name_esc));
242
243 path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].transform.offset_x", name_esc);
244 seq_convert_transform_animation(seq, scene, path, image_size_x, scene->r.xsch);
245 MEM_freeN(path);
246 path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].transform.offset_y", name_esc);
247 seq_convert_transform_animation(seq, scene, path, image_size_y, scene->r.ysch);
248 MEM_freeN(path);
249
250 seq->flag &= ~use_transform_flag;
251 seq->flag &= ~use_crop_flag;
252}
253
254static void seq_convert_transform_crop_lb(const Scene *scene,
255 const ListBase *lb,
256 const eSpaceSeq_Proxy_RenderSize render_size)
257{
258
259 LISTBASE_FOREACH (Sequence *, seq, lb) {
260 if (!ELEM(seq->type, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SOUND_HD)) {
261 seq_convert_transform_crop(scene, seq, render_size);
262 }
263 if (seq->type == SEQ_TYPE_META) {
264 seq_convert_transform_crop_lb(scene, &seq->seqbase, render_size);
265 }
266 }
267}
268
270 const char *path,
271 const float scale_to_fit_factor)
272{
273 if (scene->adt == nullptr || scene->adt->action == nullptr) {
274 return;
275 }
276
277 FCurve *fcu = BKE_fcurve_find(&scene->adt->action->curves, path, 0);
278 if (fcu != nullptr && !BKE_fcurve_is_empty(fcu)) {
279 BezTriple *bezt = fcu->bezt;
280 for (int i = 0; i < fcu->totvert; i++, bezt++) {
281 /* Same math as with old_image_center_*, but simplified. */
282 bezt->vec[0][1] *= scale_to_fit_factor;
283 bezt->vec[1][1] *= scale_to_fit_factor;
284 bezt->vec[2][1] *= scale_to_fit_factor;
285 }
286 }
287}
288
289static void seq_convert_transform_crop_2(const Scene *scene,
290 Sequence *seq,
291 const eSpaceSeq_Proxy_RenderSize render_size)
292{
293 const StripElem *s_elem = seq->strip->stripdata;
294 if (s_elem == nullptr) {
295 return;
296 }
297
298 StripCrop *c = seq->strip->crop;
299 StripTransform *t = seq->strip->transform;
300 int image_size_x = s_elem->orig_width;
301 int image_size_y = s_elem->orig_height;
302
303 if (can_use_proxy(seq, SEQ_rendersize_to_proxysize(render_size))) {
304 image_size_x /= SEQ_rendersize_to_scale_factor(render_size);
305 image_size_y /= SEQ_rendersize_to_scale_factor(render_size);
306 }
307
308 /* Calculate scale factor, so image fits in preview area with original aspect ratio. */
309 const float scale_to_fit_factor = std::min(float(scene->r.xsch) / float(image_size_x),
310 float(scene->r.ysch) / float(image_size_y));
311 t->scale_x *= scale_to_fit_factor;
312 t->scale_y *= scale_to_fit_factor;
313 c->top /= scale_to_fit_factor;
314 c->bottom /= scale_to_fit_factor;
315 c->left /= scale_to_fit_factor;
316 c->right /= scale_to_fit_factor;
317
318 char name_esc[(sizeof(seq->name) - 2) * 2], *path;
319 BLI_str_escape(name_esc, seq->name + 2, sizeof(name_esc));
320 path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].transform.scale_x", name_esc);
321 seq_convert_transform_animation_2(scene, path, scale_to_fit_factor);
322 MEM_freeN(path);
323 path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].transform.scale_y", name_esc);
324 seq_convert_transform_animation_2(scene, path, scale_to_fit_factor);
325 MEM_freeN(path);
326 path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].crop.min_x", name_esc);
327 seq_convert_transform_animation_2(scene, path, 1 / scale_to_fit_factor);
328 MEM_freeN(path);
329 path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].crop.max_x", name_esc);
330 seq_convert_transform_animation_2(scene, path, 1 / scale_to_fit_factor);
331 MEM_freeN(path);
332 path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].crop.min_y", name_esc);
333 seq_convert_transform_animation_2(scene, path, 1 / scale_to_fit_factor);
334 MEM_freeN(path);
335 path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].crop.max_x", name_esc);
336 seq_convert_transform_animation_2(scene, path, 1 / scale_to_fit_factor);
337 MEM_freeN(path);
338}
339
340static void seq_convert_transform_crop_lb_2(const Scene *scene,
341 const ListBase *lb,
342 const eSpaceSeq_Proxy_RenderSize render_size)
343{
344
345 LISTBASE_FOREACH (Sequence *, seq, lb) {
346 if (!ELEM(seq->type, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SOUND_HD)) {
347 seq_convert_transform_crop_2(scene, seq, render_size);
348 }
349 if (seq->type == SEQ_TYPE_META) {
350 seq_convert_transform_crop_lb_2(scene, &seq->seqbase, render_size);
351 }
352 }
353}
354
356{
357 Editing *ed = SEQ_editing_get(scene);
358
359 if (ed == nullptr) {
360 return;
361 }
362
364 /* Update ms->disp_range from meta. */
365 if (ms->disp_range[0] == ms->disp_range[1]) {
366 ms->disp_range[0] = SEQ_time_left_handle_frame_get(scene, ms->parseq);
367 ms->disp_range[1] = SEQ_time_right_handle_frame_get(scene, ms->parseq);
368 }
369
370 /* Update meta strip endpoints. */
371 SEQ_time_left_handle_frame_set(scene, ms->parseq, ms->disp_range[0]);
372 SEQ_time_right_handle_frame_set(scene, ms->parseq, ms->disp_range[1]);
373
374 /* Recalculate effects using meta strip. */
375 LISTBASE_FOREACH (Sequence *, seq, ms->oldbasep) {
376 if (seq->seq2) {
377 seq->start = seq->startdisp = max_ii(seq->seq1->startdisp, seq->seq2->startdisp);
378 seq->enddisp = min_ii(seq->seq1->enddisp, seq->seq2->enddisp);
379 }
380 }
381
382 /* Ensure that active seqbase points to active meta strip seqbase. */
383 MetaStack *active_ms = SEQ_meta_stack_active_get(ed);
384 SEQ_seqbase_active_set(ed, &active_ms->parseq->seqbase);
385 }
386}
387
389 const int node_type,
390 const char *old_name,
391 const char *new_name)
392{
393 /* Duplicate a link going into the original socket. */
394 LISTBASE_FOREACH_MUTABLE (bNodeLink *, link, &ntree->links) {
395 if (link->tonode->type == node_type) {
396 bNode *node = link->tonode;
397 bNodeSocket *dest_socket = blender::bke::node_find_socket(node, SOCK_IN, new_name);
398 BLI_assert(dest_socket);
399 if (STREQ(link->tosock->name, old_name)) {
400 blender::bke::node_add_link(ntree, link->fromnode, link->fromsock, node, dest_socket);
401 }
402 }
403 }
404
405 /* Duplicate the default value from the old socket and assign it to the new socket. */
406 LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
407 if (node->type == node_type) {
408 bNodeSocket *source_socket = blender::bke::node_find_socket(node, SOCK_IN, old_name);
409 bNodeSocket *dest_socket = blender::bke::node_find_socket(node, SOCK_IN, new_name);
410 BLI_assert(source_socket && dest_socket);
411 if (dest_socket->default_value) {
412 MEM_freeN(dest_socket->default_value);
413 }
414 dest_socket->default_value = MEM_dupallocN(source_socket->default_value);
415 }
416 }
417}
418
420{
421 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 290, 1)) {
422 /* Patch old grease pencil modifiers material filter. */
423 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
424 LISTBASE_FOREACH (GpencilModifierData *, md, &ob->greasepencil_modifiers) {
425 switch (md->type) {
428 if (gpmd->materialname[0] != '\0') {
429 gpmd->material = static_cast<Material *>(
430 BLI_findstring(&bmain->materials, gpmd->materialname, offsetof(ID, name) + 2));
431 gpmd->materialname[0] = '\0';
432 }
433 break;
434 }
437 if (gpmd->materialname[0] != '\0') {
438 gpmd->material = static_cast<Material *>(
439 BLI_findstring(&bmain->materials, gpmd->materialname, offsetof(ID, name) + 2));
440 gpmd->materialname[0] = '\0';
441 }
442 break;
443 }
446 if (gpmd->materialname[0] != '\0') {
447 gpmd->material = static_cast<Material *>(
448 BLI_findstring(&bmain->materials, gpmd->materialname, offsetof(ID, name) + 2));
449 gpmd->materialname[0] = '\0';
450 }
451 break;
452 }
455 if (gpmd->materialname[0] != '\0') {
456 gpmd->material = static_cast<Material *>(
457 BLI_findstring(&bmain->materials, gpmd->materialname, offsetof(ID, name) + 2));
458 gpmd->materialname[0] = '\0';
459 }
460 break;
461 }
464 if (gpmd->materialname[0] != '\0') {
465 gpmd->material = static_cast<Material *>(
466 BLI_findstring(&bmain->materials, gpmd->materialname, offsetof(ID, name) + 2));
467 gpmd->materialname[0] = '\0';
468 }
469 break;
470 }
473 if (gpmd->materialname[0] != '\0') {
474 gpmd->material = static_cast<Material *>(
475 BLI_findstring(&bmain->materials, gpmd->materialname, offsetof(ID, name) + 2));
476 gpmd->materialname[0] = '\0';
477 }
478 break;
479 }
482 if (gpmd->materialname[0] != '\0') {
483 gpmd->material = static_cast<Material *>(
484 BLI_findstring(&bmain->materials, gpmd->materialname, offsetof(ID, name) + 2));
485 gpmd->materialname[0] = '\0';
486 }
487 break;
488 }
491 if (gpmd->materialname[0] != '\0') {
492 gpmd->material = static_cast<Material *>(
493 BLI_findstring(&bmain->materials, gpmd->materialname, offsetof(ID, name) + 2));
494 gpmd->materialname[0] = '\0';
495 }
496 break;
497 }
500 if (gpmd->materialname[0] != '\0') {
501 gpmd->material = static_cast<Material *>(
502 BLI_findstring(&bmain->materials, gpmd->materialname, offsetof(ID, name) + 2));
503 gpmd->materialname[0] = '\0';
504 }
505 break;
506 }
509 if (gpmd->materialname[0] != '\0') {
510 gpmd->material = static_cast<Material *>(
511 BLI_findstring(&bmain->materials, gpmd->materialname, offsetof(ID, name) + 2));
512 gpmd->materialname[0] = '\0';
513 }
514 break;
515 }
518 if (gpmd->materialname[0] != '\0') {
519 gpmd->material = static_cast<Material *>(
520 BLI_findstring(&bmain->materials, gpmd->materialname, offsetof(ID, name) + 2));
521 gpmd->materialname[0] = '\0';
522 }
523 break;
524 }
527 if (gpmd->materialname[0] != '\0') {
528 gpmd->material = static_cast<Material *>(
529 BLI_findstring(&bmain->materials, gpmd->materialname, offsetof(ID, name) + 2));
530 gpmd->materialname[0] = '\0';
531 }
532 break;
533 }
536 if (gpmd->materialname[0] != '\0') {
537 gpmd->material = static_cast<Material *>(
538 BLI_findstring(&bmain->materials, gpmd->materialname, offsetof(ID, name) + 2));
539 gpmd->materialname[0] = '\0';
540 }
541 break;
542 }
545 if (gpmd->materialname[0] != '\0') {
546 gpmd->material = static_cast<Material *>(
547 BLI_findstring(&bmain->materials, gpmd->materialname, offsetof(ID, name) + 2));
548 gpmd->materialname[0] = '\0';
549 }
550 break;
551 }
552 default:
553 break;
554 }
555 }
556 }
557
558 /* Patch first frame for old files. */
559 Scene *scene = static_cast<Scene *>(bmain->scenes.first);
560 if (scene != nullptr) {
561 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
562 if (ob->type != OB_GPENCIL_LEGACY) {
563 continue;
564 }
565 bGPdata *gpd = static_cast<bGPdata *>(ob->data);
566 LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
567 bGPDframe *gpf = static_cast<bGPDframe *>(gpl->frames.first);
568 if (gpf && gpf->framenum > scene->r.sfra) {
569 bGPDframe *gpf_dup = BKE_gpencil_frame_duplicate(gpf, true);
570 gpf_dup->framenum = scene->r.sfra;
571 BLI_addhead(&gpl->frames, gpf_dup);
572 }
573 }
574 }
575 }
576 }
577
578 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 291, 1)) {
579 LISTBASE_FOREACH (Collection *, collection, &bmain->collections) {
580 if (BKE_collection_cycles_fix(bmain, collection)) {
581 printf(
582 "WARNING: Cycle detected in collection '%s', fixed as best as possible.\n"
583 "You may have to reconstruct your View Layers...\n",
584 collection->id.name);
585 }
586 }
587 }
588
589 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 291, 8)) {
602 version_node_socket_index_animdata(bmain, NTREE_SHADER, SH_NODE_BSDF_PRINCIPLED, 18, 1, 22);
603 }
604
605 /* Convert all Multires displacement to Catmull-Clark subdivision limit surface. */
606 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 292, 1)) {
607 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
608 LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
609 if (md->type == eModifierType_Multires) {
611 if (mmd->simple) {
613 }
614 }
615 }
616 }
617 }
618
619 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 292, 2)) {
620
622
623 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
624 if (scene->ed != nullptr) {
625 seq_convert_transform_crop_lb(scene, &scene->ed->seqbase, render_size);
626 }
627 }
628 }
629
630 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 292, 8)) {
631 /* Systematically rebuild pose-bones to ensure consistent ordering matching the one of bones in
632 * Armature obdata. */
633 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
634 if (ob->type == OB_ARMATURE) {
635 BKE_pose_rebuild(bmain, ob, static_cast<bArmature *>(ob->data), true);
636 }
637 }
638
639 /* Wet Paint Radius Factor */
640 LISTBASE_FOREACH (Brush *, br, &bmain->brushes) {
641 if (br->ob_mode & OB_MODE_SCULPT && br->wet_paint_radius_factor == 0.0f) {
642 br->wet_paint_radius_factor = 1.0f;
643 }
644 }
645
647 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
648 if (scene->ed != nullptr) {
649 seq_convert_transform_crop_lb_2(scene, &scene->ed->seqbase, render_size);
650 }
651 }
652 }
653
654 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 293, 16)) {
655 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
657 }
658
659 /* Add a separate socket for Grid node X and Y size. */
660 FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
661 if (ntree->type == NTREE_GEOMETRY) {
662 version_node_socket_duplicate(ntree, GEO_NODE_MESH_PRIMITIVE_GRID, "Size X", "Size Y");
663 }
665 }
666 }
667
668 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 293, 20)) {
669 /* Set zero user text objects to have a fake user. */
670 LISTBASE_FOREACH (Text *, text, &bmain->texts) {
671 if (text->id.us == 0) {
672 id_fake_user_set(&text->id);
673 }
674 }
675 }
676
683}
684
686{
687 const bool was_closed_x = panel->flag & PNL_UNUSED_1;
688 const bool was_closed_y = panel->flag & PNL_CLOSED; /* That value was the Y closed flag. */
689
690 SET_FLAG_FROM_TEST(panel->flag, was_closed_x || was_closed_y, PNL_CLOSED);
691
692 /* Clear the old PNL_CLOSEDX flag. */
693 panel->flag &= ~PNL_UNUSED_1;
694
695 LISTBASE_FOREACH (Panel *, child_panel, &panel->children) {
697 }
698}
699
701{
702 /* Change to generic named float/float3 attributes. */
703 enum {
704 CD_LOCATION = 43,
705 CD_RADIUS = 44,
706 };
707
708 for (int i = 0; i < pdata->totlayer; i++) {
709 CustomDataLayer *layer = &pdata->layers[i];
710 if (layer->type == CD_LOCATION) {
711 STRNCPY(layer->name, "Position");
712 layer->type = CD_PROP_FLOAT3;
713 }
714 else if (layer->type == CD_RADIUS) {
715 STRNCPY(layer->name, "Radius");
716 layer->type = CD_PROP_FLOAT;
717 }
718 }
719}
720
722{
723 /* Change from capital initial letter to lower case (#82693). */
724 for (int i = 0; i < pdata->totlayer; i++) {
725 CustomDataLayer *layer = &pdata->layers[i];
726 if (layer->type == CD_PROP_FLOAT3 && STREQ(layer->name, "Position")) {
727 STRNCPY(layer->name, "position");
728 }
729 else if (layer->type == CD_PROP_FLOAT && STREQ(layer->name, "Radius")) {
730 STRNCPY(layer->name, "radius");
731 }
732 }
733}
734
735/* Move FCurve handles towards the control point in such a way that the curve itself doesn't
736 * change. Since 2.91 FCurves are computed slightly differently, which requires this update to keep
737 * the same animation result. Previous versions scaled down overlapping handles during evaluation.
738 * This function applies the old correction to the actual animation data instead. */
740{
741 uint i = 1;
742 for (BezTriple *bezt = fcu->bezt; i < fcu->totvert; i++, bezt++) {
743 /* Only adjust bezier key-frames. */
744 if (bezt->ipo != BEZT_IPO_BEZ) {
745 continue;
746 }
747
748 BezTriple *nextbezt = bezt + 1;
749 const float v1[2] = {bezt->vec[1][0], bezt->vec[1][1]};
750 const float v2[2] = {bezt->vec[2][0], bezt->vec[2][1]};
751 const float v3[2] = {nextbezt->vec[0][0], nextbezt->vec[0][1]};
752 const float v4[2] = {nextbezt->vec[1][0], nextbezt->vec[1][1]};
753
754 /* If the handles have no length, no need to do any corrections. */
755 if (v1[0] == v2[0] && v3[0] == v4[0]) {
756 continue;
757 }
758
759 /* Calculate handle deltas. */
760 float delta1[2], delta2[2];
761 sub_v2_v2v2(delta1, v1, v2);
762 sub_v2_v2v2(delta2, v4, v3);
763
764 const float len1 = fabsf(delta1[0]); /* Length of handle of first key. */
765 const float len2 = fabsf(delta2[0]); /* Length of handle of second key. */
766
767 /* Overlapping handles used to be internally scaled down in previous versions.
768 * We bake the handles onto these previously virtual values. */
769 const float time_delta = v4[0] - v1[0];
770 const float total_len = len1 + len2;
771 if (total_len <= time_delta) {
772 continue;
773 }
774
775 const float factor = time_delta / total_len;
776 /* Current key-frame's right handle: */
777 madd_v2_v2v2fl(bezt->vec[2], v1, delta1, -factor); /* vec[2] = v1 - factor * delta1 */
778 /* Next key-frame's left handle: */
779 madd_v2_v2v2fl(nextbezt->vec[0], v4, delta2, -factor); /* vec[0] = v4 - factor * delta2 */
780 }
781}
782
784{
785 LISTBASE_FOREACH (Sequence *, seq, seqbase) {
786 seq->cache_flag = 0;
787 if (seq->type == SEQ_TYPE_META) {
789 }
790 }
791}
792
794{
795 LISTBASE_FOREACH_MUTABLE (bNodeLink *, link, &ntree->links) {
796 if (link->tonode->type == GEO_NODE_JOIN_GEOMETRY && !(link->tosock->flag & SOCK_MULTI_INPUT)) {
797 link->tosock = static_cast<bNodeSocket *>(link->tonode->inputs.first);
798 }
799 }
800 LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
801 if (node->type == GEO_NODE_JOIN_GEOMETRY) {
802 bNodeSocket *socket = static_cast<bNodeSocket *>(node->inputs.first);
803 socket->flag |= SOCK_MULTI_INPUT;
804 socket->limit = 4095;
805 blender::bke::node_remove_socket(ntree, node, socket->next);
806 }
807 }
808}
809
810/* NOLINTNEXTLINE: readability-function-size */
811void blo_do_versions_290(FileData *fd, Library * /*lib*/, Main *bmain)
812{
813 UNUSED_VARS(fd);
814
815 if (MAIN_VERSION_FILE_ATLEAST(bmain, 290, 2) && MAIN_VERSION_FILE_OLDER(bmain, 291, 1)) {
816 /* In this range, the extrude manifold could generate meshes with degenerated face. */
817 LISTBASE_FOREACH (Mesh *, me, &bmain->meshes) {
818 const MPoly *polys = static_cast<const MPoly *>(
819 CustomData_get_layer(&me->face_data, CD_MPOLY));
820 for (const int i : blender::IndexRange(me->faces_num)) {
821 if (polys[i].totloop == 2) {
822 bool changed;
826 me,
827 reinterpret_cast<float(*)[3]>(me->vert_positions_for_write().data()),
828 me->verts_num,
829 me->edges_for_write().data(),
830 me->edges_num,
832 &me->fdata_legacy, CD_MFACE, me->totface_legacy),
833 me->totface_legacy,
834 me->corner_verts().data(),
835 me->corner_edges_for_write().data(),
836 me->corners_num,
837 me->face_offsets().data(),
838 me->faces_num,
839 me->deform_verts_for_write().data(),
840 false,
841 true,
842 &changed);
843 break;
844 }
845 }
846 }
847 }
848
850 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 290, 2)) {
851 {
852 short id_codes[] = {ID_BR, ID_PAL};
853 for (int i = 0; i < ARRAY_SIZE(id_codes); i++) {
854 ListBase *lb = which_libbase(bmain, id_codes[i]);
856 }
857 }
858
859 if (!DNA_struct_member_exists(fd->filesdna, "SpaceImage", "float", "uv_opacity")) {
860 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
861 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
862 LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
863 if (sl->spacetype == SPACE_IMAGE) {
864 SpaceImage *sima = (SpaceImage *)sl;
865 sima->uv_opacity = 1.0f;
866 }
867 }
868 }
869 }
870 }
871
872 /* Init Grease Pencil new random curves. */
873 if (!DNA_struct_member_exists(fd->filesdna, "BrushGpencilSettings", "float", "random_hue")) {
874 LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
875 if ((brush->gpencil_settings) && (brush->gpencil_settings->curve_rand_pressure == nullptr))
876 {
877 brush->gpencil_settings->curve_rand_pressure = BKE_curvemapping_add(
878 1, 0.0f, 0.0f, 1.0f, 1.0f);
879 brush->gpencil_settings->curve_rand_strength = BKE_curvemapping_add(
880 1, 0.0f, 0.0f, 1.0f, 1.0f);
881 brush->gpencil_settings->curve_rand_uv = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
882 brush->gpencil_settings->curve_rand_hue = BKE_curvemapping_add(
883 1, 0.0f, 0.0f, 1.0f, 1.0f);
884 brush->gpencil_settings->curve_rand_saturation = BKE_curvemapping_add(
885 1, 0.0f, 0.0f, 1.0f, 1.0f);
886 brush->gpencil_settings->curve_rand_value = BKE_curvemapping_add(
887 1, 0.0f, 0.0f, 1.0f, 1.0f);
888 }
889 }
890 }
891 }
892
893 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 290, 4)) {
894 /* Clear old deprecated bit-flag from edit weights modifiers, we now use it for something else.
895 */
896 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
897 LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
898 if (md->type == eModifierType_WeightVGEdit) {
899 ((WeightVGEditModifierData *)md)->edit_flags &= ~MOD_WVG_EDIT_WEIGHTS_NORMALIZE;
900 }
901 }
902 }
903
904 /* Initialize parameters of the new Nishita sky model. */
905 if (!DNA_struct_member_exists(fd->filesdna, "NodeTexSky", "float", "sun_size")) {
906 FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
907 if (ntree->type == NTREE_SHADER) {
908 LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
909 if (node->type == SH_NODE_TEX_SKY && node->storage) {
910 NodeTexSky *tex = (NodeTexSky *)node->storage;
911 tex->sun_disc = true;
912 tex->sun_size = DEG2RADF(0.545);
913 tex->sun_elevation = M_PI_2;
914 tex->sun_rotation = 0.0f;
915 tex->altitude = 0.0f;
916 tex->air_density = 1.0f;
917 tex->dust_density = 1.0f;
918 tex->ozone_density = 1.0f;
919 }
920 }
921 }
922 }
924 }
925 }
926
927 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 290, 5)) {
928 /* New denoiser settings. */
929 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
930 IDProperty *cscene = version_cycles_properties_from_ID(&scene->id);
931
932 /* Check if any view layers had (optix) denoising enabled.
933 * Both view and render layers because conversion only happens after linking. */
934 bool use_optix = false;
935 bool use_denoising = false;
936 LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) {
937 IDProperty *cview_layer = version_cycles_properties_from_view_layer(view_layer);
938 if (cview_layer) {
939 use_denoising = use_denoising ||
940 version_cycles_property_boolean(cview_layer, "use_denoising", false);
941 use_optix = use_optix ||
942 version_cycles_property_boolean(cview_layer, "use_optix_denoising", false);
943 }
944 }
945 LISTBASE_FOREACH (SceneRenderLayer *, render_layer, &scene->r.layers) {
946 IDProperty *crender_layer = version_cycles_properties_from_render_layer(render_layer);
947 if (crender_layer) {
948 use_denoising = use_denoising ||
949 version_cycles_property_boolean(crender_layer, "use_denoising", false);
950 use_optix = use_optix ||
951 version_cycles_property_boolean(crender_layer, "use_optix_denoising", false);
952 }
953 }
954
955 if (cscene) {
956 enum {
957 DENOISER_AUTO = 0,
958 DENOISER_NLM = 1,
959 DENOISER_OPTIX = 2,
960 };
961
962 /* Enable denoiser if it was enabled for one view layer before. */
964 cscene, "denoiser", (use_optix) ? DENOISER_OPTIX : DENOISER_NLM);
965 version_cycles_property_boolean_set(cscene, "use_denoising", use_denoising);
966
967 /* Migrate Optix denoiser to new settings. */
968 if (version_cycles_property_int(cscene, "preview_denoising", 0)) {
969 version_cycles_property_boolean_set(cscene, "use_preview_denoising", true);
970 version_cycles_property_int_set(cscene, "preview_denoiser", DENOISER_AUTO);
971 }
972 }
973
974 /* Enable denoising in all view layer if there was no denoising before,
975 * so that enabling the scene settings auto enables it for all view layers. */
976 if (!use_denoising) {
977 LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) {
978 IDProperty *cview_layer = version_cycles_properties_from_view_layer(view_layer);
979 if (cview_layer) {
980 version_cycles_property_boolean_set(cview_layer, "use_denoising", true);
981 }
982 }
983 LISTBASE_FOREACH (SceneRenderLayer *, render_layer, &scene->r.layers) {
984 IDProperty *crender_layer = version_cycles_properties_from_render_layer(render_layer);
985 if (crender_layer) {
986 version_cycles_property_boolean_set(crender_layer, "use_denoising", true);
987 }
988 }
989 }
990 }
991 }
992
993 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 290, 6)) {
994 /* Transition to saving expansion for all of a modifier's sub-panels. */
995 if (!DNA_struct_member_exists(fd->filesdna, "ModifierData", "short", "ui_expand_flag")) {
996 LISTBASE_FOREACH (Object *, object, &bmain->objects) {
997 LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
998 if (md->mode & eModifierMode_Expanded_DEPRECATED) {
999 md->ui_expand_flag = UI_PANEL_DATA_EXPAND_ROOT;
1000 }
1001 else {
1002 md->ui_expand_flag = 0;
1003 }
1004 }
1005 }
1006 }
1007
1008 /* EEVEE Motion blur new parameters. */
1009 if (!DNA_struct_member_exists(fd->filesdna, "SceneEEVEE", "float", "motion_blur_depth_scale"))
1010 {
1011 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1012 scene->eevee.motion_blur_depth_scale = 100.0f;
1013 scene->eevee.motion_blur_max = 32;
1014 }
1015 }
1016
1017 if (!DNA_struct_member_exists(fd->filesdna, "SceneEEVEE", "int", "motion_blur_steps")) {
1018 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1019 scene->eevee.motion_blur_steps = 1;
1020 }
1021 }
1022
1023 /* Transition to saving expansion for all of a constraint's sub-panels. */
1024 if (!DNA_struct_member_exists(fd->filesdna, "bConstraint", "short", "ui_expand_flag")) {
1025 LISTBASE_FOREACH (Object *, object, &bmain->objects) {
1026 LISTBASE_FOREACH (bConstraint *, con, &object->constraints) {
1027 if (con->flag & CONSTRAINT_EXPAND_DEPRECATED) {
1028 con->ui_expand_flag = UI_PANEL_DATA_EXPAND_ROOT;
1029 }
1030 else {
1031 con->ui_expand_flag = 0;
1032 }
1033 }
1034 }
1035 }
1036
1037 /* Transition to saving expansion for all of grease pencil modifier's sub-panels. */
1038 if (!DNA_struct_member_exists(fd->filesdna, "GpencilModifierData", "short", "ui_expand_flag"))
1039 {
1040 LISTBASE_FOREACH (Object *, object, &bmain->objects) {
1041 LISTBASE_FOREACH (GpencilModifierData *, md, &object->greasepencil_modifiers) {
1042 if (md->mode & eGpencilModifierMode_Expanded_DEPRECATED) {
1043 md->ui_expand_flag = UI_PANEL_DATA_EXPAND_ROOT;
1044 }
1045 else {
1046 md->ui_expand_flag = 0;
1047 }
1048 }
1049 }
1050 }
1051
1052 /* Transition to saving expansion for all of an effect's sub-panels. */
1053 if (!DNA_struct_member_exists(fd->filesdna, "ShaderFxData", "short", "ui_expand_flag")) {
1054 LISTBASE_FOREACH (Object *, object, &bmain->objects) {
1055 LISTBASE_FOREACH (ShaderFxData *, fx, &object->shader_fx) {
1056 if (fx->mode & eShaderFxMode_Expanded_DEPRECATED) {
1057 fx->ui_expand_flag = UI_PANEL_DATA_EXPAND_ROOT;
1058 }
1059 else {
1060 fx->ui_expand_flag = 0;
1061 }
1062 }
1063 }
1064 }
1065
1066 /* Refactor bevel profile type to use an enum. */
1067 if (!DNA_struct_member_exists(fd->filesdna, "BevelModifierData", "short", "profile_type")) {
1068 LISTBASE_FOREACH (Object *, object, &bmain->objects) {
1069 LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
1070 if (md->type == eModifierType_Bevel) {
1072 bool use_custom_profile = bmd->flags & MOD_BEVEL_CUSTOM_PROFILE_DEPRECATED;
1073 bmd->profile_type = use_custom_profile ? MOD_BEVEL_PROFILE_CUSTOM :
1075 }
1076 }
1077 }
1078 }
1079
1080 /* Change ocean modifier values from [0, 10] to [0, 1] ranges. */
1081 LISTBASE_FOREACH (Object *, object, &bmain->objects) {
1082 LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
1083 if (md->type == eModifierType_Ocean) {
1085 omd->wave_alignment *= 0.1f;
1086 omd->sharpen_peak_jonswap *= 0.1f;
1087 }
1088 }
1089 }
1090 }
1091
1092 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 291, 1)) {
1093
1094 /* Initialize additional parameter of the Nishita sky model and change altitude unit. */
1095 if (!DNA_struct_member_exists(fd->filesdna, "NodeTexSky", "float", "sun_intensity")) {
1096 FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1097 if (ntree->type == NTREE_SHADER) {
1098 LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
1099 if (node->type == SH_NODE_TEX_SKY && node->storage) {
1100 NodeTexSky *tex = (NodeTexSky *)node->storage;
1101 tex->sun_intensity = 1.0f;
1102 tex->altitude *= 0.001f;
1103 }
1104 }
1105 }
1106 }
1108 }
1109
1110 /* Refactor bevel affect type to use an enum. */
1111 if (!DNA_struct_member_exists(fd->filesdna, "BevelModifierData", "char", "affect_type")) {
1112 LISTBASE_FOREACH (Object *, object, &bmain->objects) {
1113 LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
1114 if (md->type == eModifierType_Bevel) {
1116 const bool use_vertex_bevel = bmd->flags & MOD_BEVEL_VERT_DEPRECATED;
1117 bmd->affect_type = use_vertex_bevel ? MOD_BEVEL_AFFECT_VERTICES :
1119 }
1120 }
1121 }
1122 }
1123
1124 /* Initialize additional velocity parameter for #CacheFile's. */
1125 if (!DNA_struct_member_exists(
1126 fd->filesdna, "MeshSeqCacheModifierData", "float", "velocity_scale"))
1127 {
1128 LISTBASE_FOREACH (Object *, object, &bmain->objects) {
1129 LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
1130 if (md->type == eModifierType_MeshSequenceCache) {
1132 mcmd->velocity_scale = 1.0f;
1133 }
1134 }
1135 }
1136 }
1137
1138 if (!DNA_struct_member_exists(fd->filesdna, "CacheFile", "char", "velocity_unit")) {
1139 LISTBASE_FOREACH (CacheFile *, cache_file, &bmain->cachefiles) {
1140 STRNCPY(cache_file->velocity_name, ".velocities");
1141 cache_file->velocity_unit = CACHEFILE_VELOCITY_UNIT_SECOND;
1142 }
1143 }
1144
1145 if (!DNA_struct_member_exists(fd->filesdna, "OceanModifierData", "int", "viewport_resolution"))
1146 {
1147 LISTBASE_FOREACH (Object *, object, &bmain->objects) {
1148 LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
1149 if (md->type == eModifierType_Ocean) {
1151 omd->viewport_resolution = omd->resolution;
1152 }
1153 }
1154 }
1155 }
1156
1157 /* Remove panel X axis collapsing, a remnant of horizontal panel alignment. */
1158 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1159 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1160 LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
1161 LISTBASE_FOREACH (Panel *, panel, &region->panels) {
1163 }
1164 }
1165 }
1166 }
1167 }
1168
1169 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 291, 2)) {
1170 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1171 RigidBodyWorld *rbw = scene->rigidbody_world;
1172
1173 if (rbw == nullptr) {
1174 continue;
1175 }
1176
1177 /* The sub-step method changed from "per second" to "per frame".
1178 * To get the new value simply divide the old bullet sim FPS with the scene FPS. */
1179 rbw->substeps_per_frame /= FPS;
1180
1181 if (rbw->substeps_per_frame <= 0) {
1182 rbw->substeps_per_frame = 1;
1183 }
1184 }
1185
1186 /* PointCloud attributes. */
1187 LISTBASE_FOREACH (PointCloud *, pointcloud, &bmain->pointclouds) {
1188 do_versions_point_attributes(&pointcloud->pdata);
1189 }
1190
1191 /* Show outliner mode column by default. */
1192 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1193 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1194 LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) {
1195 if (space->spacetype == SPACE_OUTLINER) {
1196 SpaceOutliner *space_outliner = (SpaceOutliner *)space;
1197
1198 space_outliner->flag |= SO_MODE_COLUMN;
1199 }
1200 }
1201 }
1202 }
1203
1204 /* Solver and Collections for Boolean. */
1205 LISTBASE_FOREACH (Object *, object, &bmain->objects) {
1206 LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
1207 if (md->type == eModifierType_Boolean) {
1211 }
1212 }
1213 }
1214 }
1215
1216 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 291, 4) && MAIN_VERSION_FILE_ATLEAST(bmain, 291, 1)) {
1217 /* Due to a48d78ce07f4f, CustomData.totlayer and CustomData.maxlayer has been written
1218 * incorrectly. Fortunately, the size of the layers array has been written to the .blend file
1219 * as well, so we can reconstruct totlayer and maxlayer from that. */
1220 LISTBASE_FOREACH (Mesh *, mesh, &bmain->meshes) {
1221 mesh->vert_data.totlayer = mesh->vert_data.maxlayer = MEM_allocN_len(
1222 mesh->vert_data.layers) /
1223 sizeof(CustomDataLayer);
1224 mesh->edge_data.totlayer = mesh->edge_data.maxlayer = MEM_allocN_len(
1225 mesh->edge_data.layers) /
1226 sizeof(CustomDataLayer);
1227 /* We can be sure that mesh->fdata is empty for files written by 2.90. */
1228 mesh->corner_data.totlayer = mesh->corner_data.maxlayer = MEM_allocN_len(
1229 mesh->corner_data.layers) /
1230 sizeof(CustomDataLayer);
1231 mesh->face_data.totlayer = mesh->face_data.maxlayer = MEM_allocN_len(
1232 mesh->face_data.layers) /
1233 sizeof(CustomDataLayer);
1234 }
1235 }
1236
1237 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 291, 5)) {
1238 /* Fix fcurves to allow for new bezier handles behavior (#75881 and D8752). */
1239 LISTBASE_FOREACH (bAction *, act, &bmain->actions) {
1240 LISTBASE_FOREACH (FCurve *, fcu, &act->curves) {
1241 /* Only need to fix Bezier curves with at least 2 key-frames. */
1242 if (fcu->totvert < 2 || fcu->bezt == nullptr) {
1243 continue;
1244 }
1246 }
1247 }
1248
1249 LISTBASE_FOREACH (Collection *, collection, &bmain->collections) {
1250 collection->color_tag = COLLECTION_COLOR_NONE;
1251 }
1252 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1253 /* Old files do not have a master collection, but it will be created by
1254 * `BKE_collection_master_add()`. */
1255 if (scene->master_collection) {
1256 scene->master_collection->color_tag = COLLECTION_COLOR_NONE;
1257 }
1258 }
1259
1260 /* Add custom profile and bevel mode to curve bevels. */
1261 if (!DNA_struct_member_exists(fd->filesdna, "Curve", "char", "bevel_mode")) {
1262 LISTBASE_FOREACH (Curve *, curve, &bmain->curves) {
1263 if (curve->bevobj != nullptr) {
1264 curve->bevel_mode = CU_BEV_MODE_OBJECT;
1265 }
1266 else {
1267 curve->bevel_mode = CU_BEV_MODE_ROUND;
1268 }
1269 }
1270 }
1271
1272 /* Ensure that new viewport display fields are initialized correctly. */
1273 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1274 LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1275 if (md->type == eModifierType_Fluid) {
1277 if (fmd->domain != nullptr) {
1278 if (!fmd->domain->coba_field && fmd->domain->type == FLUID_DOMAIN_TYPE_LIQUID) {
1280 }
1281 fmd->domain->grid_scale = 1.0;
1282 fmd->domain->gridlines_upper_bound = 1.0;
1284 const float grid_lines[4] = {1.0, 0.0, 0.0, 1.0};
1285 copy_v4_v4(fmd->domain->gridlines_range_color, grid_lines);
1286 }
1287 }
1288 }
1289 }
1290 }
1291
1292 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 291, 6)) {
1293 /* Darken Inactive Overlay. */
1294 if (!DNA_struct_member_exists(fd->filesdna, "View3DOverlay", "float", "fade_alpha")) {
1295 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1296 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1297 LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1298 if (sl->spacetype == SPACE_VIEW3D) {
1299 View3D *v3d = (View3D *)sl;
1300 v3d->overlay.fade_alpha = 0.40f;
1302 }
1303 }
1304 }
1305 }
1306 }
1307
1308 /* Unify symmetry as a mesh property. */
1309 if (!DNA_struct_member_exists(fd->filesdna, "Mesh", "char", "symmetry")) {
1310 LISTBASE_FOREACH (Mesh *, mesh, &bmain->meshes) {
1311 /* The previous flags used to store mesh symmetry in edit-mode match the new ones that are
1312 * used in #Mesh.symmetry. */
1313 mesh->symmetry = mesh->editflag & (ME_SYMMETRY_X | ME_SYMMETRY_Y | ME_SYMMETRY_Z);
1314 }
1315 }
1316
1317 /* Alembic importer: allow vertex interpolation by default. */
1318 LISTBASE_FOREACH (Object *, object, &bmain->objects) {
1319 LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
1320 if (md->type != eModifierType_MeshSequenceCache) {
1321 continue;
1322 }
1323
1326 }
1327 }
1328 }
1329
1330 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 291, 7)) {
1331 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1332 scene->r.simplify_volumes = 1.0f;
1333 }
1334 }
1335
1336 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 291, 8)) {
1337 if (!DNA_struct_member_exists(fd->filesdna, "WorkSpaceDataRelation", "int", "parentid")) {
1338 LISTBASE_FOREACH (WorkSpace *, workspace, &bmain->workspaces) {
1340 WorkSpaceDataRelation *, relation, &workspace->hook_layout_relations)
1341 {
1342 relation->parent = blo_read_get_new_globaldata_address(fd, relation->parent);
1343 BLI_assert(relation->parentid == 0);
1344 if (relation->parent != nullptr) {
1345 LISTBASE_FOREACH (wmWindowManager *, wm, &bmain->wm) {
1346 wmWindow *win = static_cast<wmWindow *>(
1347 BLI_findptr(&wm->windows, relation->parent, offsetof(wmWindow, workspace_hook)));
1348 if (win != nullptr) {
1349 relation->parentid = win->winid;
1350 break;
1351 }
1352 }
1353 if (relation->parentid == 0) {
1355 false,
1356 "Found a valid parent for workspace data relation, but no valid parent id.");
1357 }
1358 }
1359 if (relation->parentid == 0) {
1360 BLI_freelinkN(&workspace->hook_layout_relations, relation);
1361 }
1362 }
1363 }
1364 }
1365
1366 /* UV/Image show overlay option. */
1367 if (!DNA_struct_exists(fd->filesdna, "SpaceImageOverlay")) {
1368 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1369 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1370 LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) {
1371 if (space->spacetype == SPACE_IMAGE) {
1372 SpaceImage *sima = (SpaceImage *)space;
1374 }
1375 }
1376 }
1377 }
1378 }
1379
1380 /* Ensure that particle systems generated by fluid modifier have correct phystype. */
1381 LISTBASE_FOREACH (ParticleSettings *, part, &bmain->particles) {
1383 {
1384 part->phystype = PART_PHYS_NO;
1385 }
1386 }
1387 }
1388
1389 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 291, 9)) {
1390 /* Remove options of legacy UV/Image editor */
1391 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1392 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1393 LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1394 switch (sl->spacetype) {
1395 case SPACE_IMAGE: {
1396 SpaceImage *sima = (SpaceImage *)sl;
1397 sima->flag &= ~(SI_FLAG_UNUSED_20);
1398 break;
1399 }
1400 }
1401 }
1402 }
1403 }
1404
1405 if (!DNA_struct_member_exists(
1406 fd->filesdna, "FluidModifierData", "float", "fractions_distance"))
1407 {
1408 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1409 LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1410 if (md->type == eModifierType_Fluid) {
1412 if (fmd->domain) {
1413 fmd->domain->fractions_distance = 0.5;
1414 }
1415 }
1416 }
1417 }
1418 }
1419 }
1420
1421 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 292, 1)) {
1422 {
1423 const int LEGACY_REFINE_RADIAL_DISTORTION_K1 = (1 << 2);
1424
1425 LISTBASE_FOREACH (MovieClip *, clip, &bmain->movieclips) {
1426 MovieTracking *tracking = &clip->tracking;
1427 MovieTrackingSettings *settings = &tracking->settings;
1428 int new_refine_camera_intrinsics = 0;
1429
1430 if (settings->refine_camera_intrinsics & REFINE_FOCAL_LENGTH) {
1431 new_refine_camera_intrinsics |= REFINE_FOCAL_LENGTH;
1432 }
1433
1434 if (settings->refine_camera_intrinsics & REFINE_PRINCIPAL_POINT) {
1435 new_refine_camera_intrinsics |= REFINE_PRINCIPAL_POINT;
1436 }
1437
1438 /* The end goal is to enable radial distortion refinement if either K1 or K2 were set for
1439 * refinement. It is enough to only check for L1 it was not possible to refine K2 without
1440 * K1. */
1441 if (settings->refine_camera_intrinsics & LEGACY_REFINE_RADIAL_DISTORTION_K1) {
1442 new_refine_camera_intrinsics |= REFINE_RADIAL_DISTORTION;
1443 }
1444
1445 settings->refine_camera_intrinsics = new_refine_camera_intrinsics;
1446 }
1447 }
1448 }
1449
1450 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 292, 5)) {
1451 /* Initialize the opacity of the overlay wireframe */
1452 if (!DNA_struct_member_exists(fd->filesdna, "View3DOverlay", "float", "wireframe_opacity")) {
1453 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1454 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1455 LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1456 if (sl->spacetype == SPACE_VIEW3D) {
1457 View3D *v3d = (View3D *)sl;
1458 v3d->overlay.wireframe_opacity = 1.0f;
1459 }
1460 }
1461 }
1462 }
1463 }
1464
1465 /* Replace object hidden filter with inverted object visible filter. */
1466 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1467 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1468 LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) {
1469 if (space->spacetype == SPACE_OUTLINER) {
1470 SpaceOutliner *space_outliner = (SpaceOutliner *)space;
1471 if (space_outliner->filter_state == SO_FILTER_OB_HIDDEN) {
1472 space_outliner->filter_state = SO_FILTER_OB_VISIBLE;
1473 space_outliner->filter |= SO_FILTER_OB_STATE_INVERSE;
1474 }
1475 }
1476 }
1477 }
1478 }
1479
1480 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1481 LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1482 if (md->type == eModifierType_WeightVGProximity) {
1484 if (wmd->cmap_curve == nullptr) {
1485 wmd->cmap_curve = BKE_curvemapping_add(1, 0.0, 0.0, 1.0, 1.0);
1487 }
1488 }
1489 }
1490 }
1491
1492 /* PointCloud attributes names. */
1493 LISTBASE_FOREACH (PointCloud *, pointcloud, &bmain->pointclouds) {
1494 do_versions_point_attribute_names(&pointcloud->pdata);
1495 }
1496
1497 /* Cryptomatte render pass */
1498 if (!DNA_struct_member_exists(fd->filesdna, "ViewLayer", "short", "cryptomatte_levels")) {
1499 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1500 LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) {
1501 view_layer->cryptomatte_levels = 6;
1502 view_layer->cryptomatte_flag = VIEW_LAYER_CRYPTOMATTE_ACCURATE;
1503 }
1504 }
1505 }
1506 }
1507
1508 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 292, 7)) {
1509 /* Make all IDProperties used as interface of geometry node trees overridable. */
1510 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1511 LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1512 if (md->type == eModifierType_Nodes) {
1514 IDProperty *nmd_properties = nmd->settings.properties;
1515
1516 BLI_assert(nmd_properties->type == IDP_GROUP);
1517 LISTBASE_FOREACH (IDProperty *, nmd_socket_idprop, &nmd_properties->data.group) {
1518 nmd_socket_idprop->flag |= IDP_FLAG_OVERRIDABLE_LIBRARY;
1519 }
1520 }
1521 }
1522 }
1523
1524 /* EEVEE/Cycles Volumes consistency */
1525 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1526 /* Remove Volume Transmittance render pass from each view layer. */
1527 LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) {
1528 view_layer->eevee.render_passes &= ~EEVEE_RENDER_PASS_UNUSED_8;
1529 }
1530
1531 /* Rename Render-layer Socket `VolumeScatterCol` to `VolumeDir`. */
1532 if (scene->nodetree) {
1533 LISTBASE_FOREACH (bNode *, node, &scene->nodetree->nodes) {
1534 if (node->type == CMP_NODE_R_LAYERS) {
1535 LISTBASE_FOREACH (bNodeSocket *, output_socket, &node->outputs) {
1536 const char *volume_scatter = "VolumeScatterCol";
1537 if (STREQLEN(output_socket->name, volume_scatter, MAX_NAME)) {
1538 STRNCPY(output_socket->name, RE_PASSNAME_VOLUME_LIGHT);
1539 }
1540 }
1541 }
1542 }
1543 }
1544 }
1545
1546 /* Convert `NodeCryptomatte->storage->matte_id` to `NodeCryptomatte->storage->entries` */
1547 if (!DNA_struct_exists(fd->filesdna, "CryptomatteEntry")) {
1548 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1549 if (scene->nodetree) {
1550 LISTBASE_FOREACH (bNode *, node, &scene->nodetree->nodes) {
1551 if (node->type == CMP_NODE_CRYPTOMATTE_LEGACY) {
1552 NodeCryptomatte *storage = (NodeCryptomatte *)node->storage;
1553 char *matte_id = storage->matte_id;
1554 if (matte_id == nullptr || strlen(storage->matte_id) == 0) {
1555 continue;
1556 }
1558 }
1559 }
1560 }
1561 }
1562 }
1563
1564 /* Overlay elements in the sequencer. */
1565 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1566 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1567 LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1568 if (sl->spacetype == SPACE_SEQ) {
1569 SpaceSeq *sseq = (SpaceSeq *)sl;
1572 }
1573 }
1574 }
1575 }
1576 }
1577
1578 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 292, 8)) {
1579 LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
1580 LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
1581 if (STREQ(node->idname, "GeometryNodeRandomAttribute")) {
1582 STRNCPY(node->idname, "GeometryLegacyNodeAttributeRandomize");
1583 }
1584 }
1585 }
1586
1587 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1588 if (scene->toolsettings->sequencer_tool_settings == nullptr) {
1589 scene->toolsettings->sequencer_tool_settings = SEQ_tool_settings_init();
1590 }
1591 }
1592 }
1593
1594 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 292, 9)) {
1595 /* Default properties editors to auto outliner sync. */
1596 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1597 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1598 LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) {
1599 if (space->spacetype == SPACE_PROPERTIES) {
1600 SpaceProperties *space_properties = (SpaceProperties *)space;
1601 space_properties->outliner_sync = PROPERTIES_SYNC_AUTO;
1602 }
1603 }
1604 }
1605 }
1606
1607 /* Ensure that new viscosity strength field is initialized correctly. */
1608 if (!DNA_struct_member_exists(fd->filesdna, "FluidModifierData", "float", "viscosity_value")) {
1609 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1610 LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1611 if (md->type == eModifierType_Fluid) {
1613 if (fmd->domain != nullptr) {
1614 fmd->domain->viscosity_value = 0.05;
1615 }
1616 }
1617 }
1618 }
1619 }
1620 }
1621
1622 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 292, 10)) {
1623 if (!DNA_struct_exists(fd->filesdna, "NodeSetAlpha")) {
1624 FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1625 if (ntree->type != NTREE_COMPOSIT) {
1626 continue;
1627 }
1628 LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
1629 if (node->type != CMP_NODE_SETALPHA) {
1630 continue;
1631 }
1632 NodeSetAlpha *storage = MEM_cnew<NodeSetAlpha>("NodeSetAlpha");
1634 node->storage = storage;
1635 }
1636 }
1638 }
1639
1640 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1641 Editing *ed = SEQ_editing_get(scene);
1642 if (ed == nullptr) {
1643 continue;
1644 }
1647 }
1648 }
1649
1650 /* Enable "Save as Render" option for file output node by default (apply view transform to image
1651 * on save) */
1652 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 292, 11)) {
1653 FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1654 if (ntree->type == NTREE_COMPOSIT) {
1655 LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
1656 if (node->type == CMP_NODE_OUTPUT_FILE) {
1657 LISTBASE_FOREACH (bNodeSocket *, sock, &node->inputs) {
1659 sock->storage);
1660 simf->save_as_render = true;
1661 }
1662 }
1663 }
1664 }
1665 }
1667 }
1668
1669 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 293, 1)) {
1670 FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1671 if (ntree->type == NTREE_GEOMETRY) {
1672 version_node_socket_name(ntree, GEO_NODE_MESH_BOOLEAN, "Geometry A", "Geometry 1");
1673 version_node_socket_name(ntree, GEO_NODE_MESH_BOOLEAN, "Geometry B", "Geometry 2");
1674 }
1675 }
1677
1678 /* Init grease pencil default curve resolution. */
1679 if (!DNA_struct_member_exists(fd->filesdna, "bGPdata", "int", "curve_edit_resolution")) {
1680 LISTBASE_FOREACH (bGPdata *, gpd, &bmain->gpencils) {
1681 gpd->curve_edit_resolution = GP_DEFAULT_CURVE_RESOLUTION;
1683 }
1684 }
1685 /* Init grease pencil curve editing error threshold. */
1686 if (!DNA_struct_member_exists(fd->filesdna, "bGPdata", "float", "curve_edit_threshold")) {
1687 LISTBASE_FOREACH (bGPdata *, gpd, &bmain->gpencils) {
1688 gpd->curve_edit_threshold = GP_DEFAULT_CURVE_ERROR;
1689 gpd->curve_edit_corner_angle = GP_DEFAULT_CURVE_EDIT_CORNER_ANGLE;
1690 }
1691 }
1692 }
1693
1694 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 292, 14) ||
1695 ((bmain->versionfile == 293) && !MAIN_VERSION_FILE_ATLEAST(bmain, 293, 1)))
1696 {
1697 FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1698 if (ntree->type != NTREE_GEOMETRY) {
1699 continue;
1700 }
1701 LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
1702 if (node->type == GEO_NODE_OBJECT_INFO && node->storage == nullptr) {
1704 sizeof(NodeGeometryObjectInfo), __func__);
1706 node->storage = data;
1707 }
1708 }
1709 }
1711 }
1712
1713 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 293, 1)) {
1714 /* Grease pencil layer transform matrix. */
1715 if (!DNA_struct_member_exists(fd->filesdna, "bGPDlayer", "float", "location[0]")) {
1716 LISTBASE_FOREACH (bGPdata *, gpd, &bmain->gpencils) {
1717 LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
1718 zero_v3(gpl->location);
1719 zero_v3(gpl->rotation);
1720 copy_v3_fl(gpl->scale, 1.0f);
1721 loc_eul_size_to_mat4(gpl->layer_mat, gpl->location, gpl->rotation, gpl->scale);
1722 invert_m4_m4(gpl->layer_invmat, gpl->layer_mat);
1723 }
1724 }
1725 }
1726 /* Fix Fill factor for grease pencil fill brushes. */
1727 LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
1728 if ((brush->gpencil_settings) && (brush->gpencil_settings->fill_factor == 0.0f)) {
1729 brush->gpencil_settings->fill_factor = 1.0f;
1730 }
1731 }
1732 }
1733
1734 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 293, 5)) {
1735 /* Change Nishita sky model Altitude unit. */
1736 FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1737 if (ntree->type == NTREE_SHADER) {
1738 LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
1739 if (node->type == SH_NODE_TEX_SKY && node->storage) {
1740 NodeTexSky *tex = (NodeTexSky *)node->storage;
1741 tex->altitude *= 1000.0f;
1742 }
1743 }
1744 }
1745 }
1747 }
1748
1749 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 293, 6)) {
1750 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1751 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1752 LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) {
1753 /* Enable Outliner render visibility column. */
1754 if (space->spacetype == SPACE_OUTLINER) {
1755 SpaceOutliner *space_outliner = (SpaceOutliner *)space;
1756 space_outliner->show_restrict_flags |= SO_RESTRICT_RENDER;
1757 }
1758 }
1759 }
1760 }
1761 }
1762
1763 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 293, 7)) {
1764 FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1765 if (ntree->type == NTREE_GEOMETRY) {
1767 }
1768 }
1770 }
1771
1772 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 293, 9)) {
1773 if (!DNA_struct_member_exists(fd->filesdna, "SceneEEVEE", "float", "bokeh_overblur")) {
1774 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1775 scene->eevee.bokeh_neighbor_max = 10.0f;
1776 scene->eevee.bokeh_overblur = 5.0f;
1777 }
1778 }
1779
1780 /* Add sub-panels for FModifiers, which requires a field to store expansion. */
1781 if (!DNA_struct_member_exists(fd->filesdna, "FModifier", "short", "ui_expand_flag")) {
1782 LISTBASE_FOREACH (bAction *, act, &bmain->actions) {
1783 LISTBASE_FOREACH (FCurve *, fcu, &act->curves) {
1784 LISTBASE_FOREACH (FModifier *, fcm, &fcu->modifiers) {
1785 SET_FLAG_FROM_TEST(fcm->ui_expand_flag,
1786 fcm->flag & FMODIFIER_FLAG_EXPANDED,
1788 }
1789 }
1790 }
1791 }
1792 }
1793
1794 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 293, 10)) {
1795 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1796 /* Fix old scene with too many samples that were not being used.
1797 * Now they are properly used and might produce a huge slowdown.
1798 * So we clamp to what the old max actual was. */
1799 if (scene->eevee.volumetric_shadow_samples > 32) {
1800 scene->eevee.volumetric_shadow_samples = 32;
1801 }
1802 }
1803 }
1804
1805 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 293, 11)) {
1806 LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
1807 if (ntree->type == NTREE_GEOMETRY) {
1808 LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
1809 if (STREQ(node->idname, "GeometryNodeSubdivisionSurfaceSimple")) {
1810 STRNCPY(node->idname, "GeometryNodeSubdivide");
1811 }
1812 if (STREQ(node->idname, "GeometryNodeSubdivisionSurface")) {
1813 STRNCPY(node->idname, "GeometryNodeSubdivideSmooth");
1814 }
1815 }
1816 }
1817 }
1818 }
1819
1820 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 293, 12)) {
1821 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1822 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1823 LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1824 switch (sl->spacetype) {
1825 case SPACE_SEQ: {
1826 SpaceSeq *sseq = (SpaceSeq *)sl;
1827 if (ELEM(sseq->render_size,
1832 {
1833 sseq->flag |= SEQ_USE_PROXIES;
1834 }
1835 if (sseq->render_size == SEQ_RENDER_SIZE_FULL) {
1837 }
1838 }
1839 }
1840 }
1841 }
1842 }
1843
1844 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1845 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1846 LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1847 if (sl->spacetype == SPACE_SPREADSHEET) {
1848 ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
1849 &sl->regionbase;
1851 regionbase, RGN_TYPE_FOOTER, "footer for spreadsheet", RGN_TYPE_HEADER);
1852 if (new_footer != nullptr) {
1853 new_footer->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_TOP :
1855 }
1856 }
1857 }
1858 }
1859 }
1860 }
1861
1862 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 293, 13)) {
1863 LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
1864 if (ntree->type == NTREE_GEOMETRY) {
1865 LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
1866 if (STREQ(node->idname, "GeometryNodeSubdivideSmooth")) {
1867 STRNCPY(node->idname, "GeometryNodeSubdivisionSurface");
1868 }
1869 }
1870 }
1871 }
1872 }
1873
1874 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 293, 14)) {
1875 if (!DNA_struct_member_exists(fd->filesdna, "Light", "float", "diff_fac")) {
1876 LISTBASE_FOREACH (Light *, light, &bmain->lights) {
1877 light->diff_fac = 1.0f;
1878 light->volume_fac = 1.0f;
1879 }
1880 }
1881 }
1882
1883 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 293, 15)) {
1884 LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
1885 if (ntree->type == NTREE_GEOMETRY) {
1886 LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
1887 if (STREQ(node->idname, "GeometryNodeMeshPlane")) {
1888 STRNCPY(node->idname, "GeometryNodeMeshGrid");
1889 }
1890 }
1891 }
1892 }
1893 }
1894
1895 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 293, 16)) {
1896 FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1897 if (ntree->type == NTREE_GEOMETRY) {
1898 version_node_socket_name(ntree, GEO_NODE_MESH_PRIMITIVE_GRID, "Size", "Size X");
1899 }
1901 }
1902
1903 /* The CU_2D flag has been removed. */
1904 LISTBASE_FOREACH (Curve *, cu, &bmain->curves) {
1905#define CU_2D (1 << 3)
1906 ListBase *nurbs = BKE_curve_nurbs_get(cu);
1907 bool is_2d = true;
1908
1909 LISTBASE_FOREACH (Nurb *, nu, nurbs) {
1910 if (nu->flag & CU_2D) {
1911 nu->flag &= ~CU_2D;
1912 }
1913 else {
1914 is_2d = false;
1915 }
1916 }
1917#undef CU_2D
1918 if (!is_2d && CU_IS_2D(cu)) {
1919 cu->flag |= CU_3D;
1920 }
1921 }
1922 }
1923
1924 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 293, 18)) {
1925 if (!DNA_struct_member_exists(fd->filesdna, "bArmature", "float", "axes_position")) {
1926 /* Convert the axes draw position to its old default (tip of bone). */
1927 LISTBASE_FOREACH (bArmature *, arm, &bmain->armatures) {
1928 arm->axes_position = 1.0;
1929 }
1930 }
1931
1932 /* Initialize the spread parameter for area lights. */
1933 if (!DNA_struct_member_exists(fd->filesdna, "Light", "float", "area_spread")) {
1934 LISTBASE_FOREACH (Light *, la, &bmain->lights) {
1935 la->area_spread = DEG2RADF(180.0f);
1936 }
1937 }
1938
1939 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1940 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1941 LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1942 if (sl->spacetype == SPACE_NODE) {
1943 SpaceNode *snode = (SpaceNode *)sl;
1944 LISTBASE_FOREACH (bNodeTreePath *, path, &snode->treepath) {
1945 STRNCPY(path->display_name, path->node_name);
1946 }
1947 }
1948 }
1949 }
1950 }
1951
1952 /* Consolidate node and final evaluation modes. */
1953 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1954 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1955 LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1956 if (sl->spacetype == SPACE_SPREADSHEET) {
1957 SpaceSpreadsheet *sspreadsheet = (SpaceSpreadsheet *)sl;
1958 if (sspreadsheet->object_eval_state == 2) {
1960 }
1961 }
1962 }
1963 }
1964 }
1965 }
1966
1967 /* Set default value for the new bisect_threshold parameter in the mirror modifier. */
1968 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 293, 19)) {
1969 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1970 LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1971 if (md->type == eModifierType_Mirror) {
1973 /* This was the previous hard-coded value. */
1974 mmd->bisect_threshold = 0.001f;
1975 }
1976 }
1977 }
1978
1979 LISTBASE_FOREACH (Curve *, cu, &bmain->curves) {
1980 /* Turn on clamping as this was implicit before. */
1981 cu->flag |= CU_PATH_CLAMP;
1982 }
1983 }
1984
1991}
void BKE_pose_rebuild(Main *bmain, Object *ob, bArmature *arm, bool do_id_user)
Definition armature.cc:2767
bool BKE_collection_cycles_fix(Main *bmain, Collection *collection)
void BKE_curvemapping_init(CurveMapping *cumap)
CurveMapping * BKE_curvemapping_add(int tot, float minx, float miny, float maxx, float maxy)
Definition colortools.cc:90
void BKE_cryptomatte_matte_id_to_entries(struct NodeCryptomatte *node_storage, const char *matte_id)
#define CU_IS_2D(cu)
Definition BKE_curve.hh:86
ListBase * BKE_curve_nurbs_get(Curve *cu)
Definition curve.cc:4965
CustomData interface, see also DNA_customdata_types.h.
const void * CustomData_get_layer(const CustomData *data, eCustomDataType type)
void * CustomData_get_layer_for_write(CustomData *data, eCustomDataType type, int totelem)
FCurve * BKE_fcurve_find(ListBase *list, const char rna_path[], int array_index)
bool BKE_fcurve_is_empty(const FCurve *fcu)
void BKE_fcurve_free(FCurve *fcu)
struct bGPDframe * BKE_gpencil_frame_duplicate(const struct bGPDframe *gpf_src, bool dup_strokes)
void BKE_main_id_repair_duplicate_names_listbase(Main *bmain, ListBase *lb)
Definition lib_id.cc:1235
void id_fake_user_set(ID *id)
Definition lib_id.cc:389
ListBase * which_libbase(Main *bmain, short type)
Definition main.cc:842
#define MAIN_VERSION_FILE_ATLEAST(main, ver, subver)
Definition BKE_main.hh:572
#define MAIN_VERSION_FILE_OLDER(main, ver, subver)
Definition BKE_main.hh:576
bool BKE_mesh_validate_arrays(Mesh *mesh, float(*vert_positions)[3], unsigned int verts_num, blender::int2 *edges, unsigned int edges_num, MFace *legacy_faces, unsigned int legacy_faces_num, const int *corner_verts, int *corner_edges, unsigned int corners_num, const int *face_offsets, unsigned int faces_num, MDeformVert *dverts, bool do_verbose, bool do_fixes, bool *r_change)
void BKE_mesh_legacy_convert_loops_to_corners(Mesh *mesh)
void BKE_mesh_legacy_convert_polys_to_offsets(Mesh *mesh)
void multires_do_versions_simple_to_catmull_clark(Object *object, MultiresModifierData *mmd)
#define SH_NODE_TEX_SKY
Definition BKE_node.hh:931
#define FOREACH_NODETREE_END
Definition BKE_node.hh:870
#define FOREACH_NODETREE_BEGIN(bmain, _nodetree, _id)
Definition BKE_node.hh:860
#define BLI_assert(a)
Definition BLI_assert.h:50
#define BLI_assert_msg(a, msg)
Definition BLI_assert.h:57
void * BLI_findstring(const struct ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:90
#define LISTBASE_FOREACH(type, var, list)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:269
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
#define LISTBASE_FOREACH_BACKWARD(type, var, list)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:130
void * BLI_findptr(const struct ListBase *listbase, const void *ptr, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
#define M_PI_2
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
void loc_eul_size_to_mat4(float R[4][4], const float loc[3], const float eul[3], const float size[3])
#define DEG2RADF(_deg)
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void madd_v2_v2v2fl(float r[2], const float a[2], const float b[2], float f)
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE void zero_v3(float r[3])
char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
#define STRNCPY(dst, src)
Definition BLI_string.h:593
size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
unsigned int uint
#define ARRAY_SIZE(arr)
#define UNUSED_VARS(...)
#define STREQLEN(a, b, n)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define ELEM(...)
#define STREQ(a, b)
external readfile function prototypes.
@ ID_PAL
@ ID_BR
@ IDP_GROUP
@ IDP_FLAG_OVERRIDABLE_LIBRARY
@ CACHEFILE_VELOCITY_UNIT_SECOND
Object groups, one object can be in many groups at once.
@ COLLECTION_COLOR_NONE
@ CU_3D
@ CU_PATH_CLAMP
@ CU_BEV_MODE_OBJECT
@ CU_BEV_MODE_ROUND
@ BEZT_IPO_BEZ
struct CustomDataLayer CustomDataLayer
@ CD_PROP_FLOAT
@ CD_PROP_FLOAT3
#define MAX_NAME
Definition DNA_defs.h:50
@ FLUID_DOMAIN_FIELD_PHI
@ FLUID_DOMAIN_TYPE_LIQUID
blenloader genfile private function prototypes
#define GP_DEFAULT_CURVE_EDIT_CORNER_ANGLE
#define GP_DEFAULT_CURVE_RESOLUTION
#define GP_DEFAULT_CURVE_ERROR
@ GP_DATA_CURVE_ADAPTIVE_RESOLUTION
@ eGpencilModifierType_Array
@ eGpencilModifierType_Noise
@ eGpencilModifierType_Mirror
@ eGpencilModifierType_Color
@ eGpencilModifierType_Multiply
@ eGpencilModifierType_Texture
@ eGpencilModifierType_Subdiv
@ eGpencilModifierType_Lattice
@ eGpencilModifierType_Opacity
@ eGpencilModifierType_Hook
@ eGpencilModifierType_Simplify
@ eGpencilModifierType_Smooth
@ eGpencilModifierType_Thick
@ eGpencilModifierType_Offset
@ VIEW_LAYER_CRYPTOMATTE_ACCURATE
@ ME_SYMMETRY_X
@ ME_SYMMETRY_Y
@ ME_SYMMETRY_Z
@ MOD_MESHSEQ_INTERPOLATE_VERTICES
@ eBooleanModifierSolver_Float
@ MOD_BEVEL_AFFECT_EDGES
@ MOD_BEVEL_AFFECT_VERTICES
@ eModifierType_Mirror
@ eModifierType_WeightVGProximity
@ eModifierType_Boolean
@ eModifierType_Fluid
@ eModifierType_MeshSequenceCache
@ eModifierType_Ocean
@ eModifierType_Nodes
@ eModifierType_Bevel
@ eModifierType_WeightVGEdit
@ eModifierType_Multires
@ MOD_BEVEL_PROFILE_CUSTOM
@ MOD_BEVEL_PROFILE_SUPERELLIPSE
@ eBooleanModifierFlag_Object
@ NTREE_SHADER
@ NTREE_GEOMETRY
@ NTREE_COMPOSIT
@ SOCK_IN
@ CMP_NODE_SETALPHA_MODE_REPLACE_ALPHA
@ SOCK_MULTI_INPUT
@ GEO_NODE_TRANSFORM_SPACE_RELATIVE
@ OB_MODE_SCULPT
Object is a sort of wrapper for general info.
@ OB_ARMATURE
@ OB_GPENCIL_LEGACY
@ PART_FLUID_FLIP
@ PART_FLUID_BUBBLE
@ PART_FLUID_FOAM
@ PART_FLUID_SPRAY
@ PART_PHYS_NO
Types and defines for representing Rigid Body entities.
#define RE_PASSNAME_VOLUME_LIGHT
#define FPS
@ RGN_ALIGN_BOTTOM
@ RGN_ALIGN_TOP
@ UI_PANEL_DATA_EXPAND_ROOT
@ RGN_TYPE_FOOTER
@ RGN_TYPE_HEADER
@ PNL_UNUSED_1
@ PNL_CLOSED
@ SEQ_CACHE_STORE_RAW
@ SEQ_CACHE_STORE_FINAL_OUT
@ SEQ_TYPE_SOUND_RAM
@ SEQ_TYPE_SOUND_HD
@ SEQ_TYPE_META
@ SEQ_USE_PROXY
@ SI_FLAG_UNUSED_20
@ SI_OVERLAY_SHOW_OVERLAYS
eSpaceSeq_Proxy_RenderSize
@ SEQ_RENDER_SIZE_PROXY_25
@ SEQ_RENDER_SIZE_PROXY_75
@ SEQ_RENDER_SIZE_PROXY_50
@ SEQ_RENDER_SIZE_FULL
@ SEQ_RENDER_SIZE_PROXY_100
@ SPACE_OUTLINER
@ SPACE_NODE
@ SPACE_SPREADSHEET
@ SPACE_PROPERTIES
@ SPACE_SEQ
@ SPACE_IMAGE
@ SPACE_VIEW3D
@ SEQ_TIMELINE_SHOW_STRIP_DURATION
@ SEQ_TIMELINE_SHOW_STRIP_SOURCE
@ SEQ_TIMELINE_SHOW_STRIP_NAME
@ SO_RESTRICT_RENDER
@ SO_FILTER_OB_STATE_INVERSE
@ SO_MODE_COLUMN
@ SO_FILTER_OB_VISIBLE
@ SO_FILTER_OB_HIDDEN
@ SPREADSHEET_OBJECT_EVAL_STATE_EVALUATED
@ SEQ_DRAW_IMG_IMBUF
@ SEQ_USE_PROXIES
@ SEQ_SHOW_OVERLAY
@ PROPERTIES_SYNC_AUTO
@ REFINE_PRINCIPAL_POINT
@ REFINE_RADIAL_DISTORTION
@ REFINE_FOCAL_LENGTH
@ USER_HEADER_BOTTOM
@ V3D_OVERLAY_FADE_INACTIVE
@ IMB_PROXY_NONE
Read Guarded memory(de)allocation.
ATTR_WARN_UNUSED_RESULT const BMVert * v2
unsigned int U
Definition btGjkEpa3.h:78
#define printf
@ DENOISER_OPTIX
Definition denoise.h:14
#define offsetof(t, d)
#define fabsf(x)
draw_view in_light_buf[] float
size_t(* MEM_allocN_len)(const void *vmemh)
Definition mallocn.cc:36
void MEM_freeN(void *vmemh)
Definition mallocn.cc:105
void *(* MEM_callocN)(size_t len, const char *str)
Definition mallocn.cc:42
void *(* MEM_dupallocN)(const void *vmemh)
Definition mallocn.cc:39
bNodeLink * node_add_link(bNodeTree *ntree, bNode *fromnode, bNodeSocket *fromsock, bNode *tonode, bNodeSocket *tosock)
Definition node.cc:2912
void node_remove_socket(bNodeTree *ntree, bNode *node, bNodeSocket *sock)
Definition node.cc:2405
bNodeSocket * node_find_socket(bNode *node, eNodeSocketInOut in_out, StringRef identifier)
Definition node.cc:1829
int SEQ_rendersize_to_proxysize(int render_size)
Definition proxy.cc:67
double SEQ_rendersize_to_scale_factor(int render_size)
Definition proxy.cc:82
void * blo_read_get_new_globaldata_address(FileData *fd, const void *adr)
Definition readfile.cc:1478
SequencerToolSettings * SEQ_tool_settings_init()
Definition sequencer.cc:342
void SEQ_seqbase_active_set(Editing *ed, ListBase *seqbase)
Definition sequencer.cc:425
Editing * SEQ_editing_get(const Scene *scene)
Definition sequencer.cc:262
MetaStack * SEQ_meta_stack_active_get(const Editing *ed)
Definition sequencer.cc:448
unsigned int uint32_t
Definition stdint.h:80
void SEQ_time_right_handle_frame_set(const Scene *scene, Sequence *seq, int timeline_frame)
void SEQ_time_left_handle_frame_set(const Scene *scene, Sequence *seq, int timeline_frame)
int SEQ_time_left_handle_frame_get(const Scene *, const Sequence *seq)
int SEQ_time_right_handle_frame_get(const Scene *scene, const Sequence *seq)
float vec[3][3]
CustomDataLayer * layers
ListBase seqbase
ListBase metastack
BezTriple * bezt
unsigned int totvert
SDNA * filesdna
Definition readfile.hh:87
struct FluidDomainSettings * domain
ListBase group
Definition DNA_ID.h:146
IDPropertyData data
Definition DNA_ID.h:168
char type
Definition DNA_ID.h:154
Definition DNA_ID.h:413
void * first
ListBase brushes
Definition BKE_main.hh:235
ListBase scenes
Definition BKE_main.hh:210
ListBase wm
Definition BKE_main.hh:239
ListBase actions
Definition BKE_main.hh:233
ListBase texts
Definition BKE_main.hh:227
ListBase meshes
Definition BKE_main.hh:213
ListBase movieclips
Definition BKE_main.hh:242
ListBase lights
Definition BKE_main.hh:220
ListBase nodetrees
Definition BKE_main.hh:234
ListBase particles
Definition BKE_main.hh:236
ListBase materials
Definition BKE_main.hh:216
ListBase pointclouds
Definition BKE_main.hh:252
ListBase armatures
Definition BKE_main.hh:232
ListBase curves
Definition BKE_main.hh:214
ListBase screens
Definition BKE_main.hh:225
short versionfile
Definition BKE_main.hh:137
ListBase workspaces
Definition BKE_main.hh:246
ListBase collections
Definition BKE_main.hh:231
ListBase gpencils
Definition BKE_main.hh:240
ListBase objects
Definition BKE_main.hh:212
ListBase cachefiles
Definition BKE_main.hh:245
Sequence * parseq
struct NodesModifierSettings settings
struct IDProperty * properties
ListBase children
SpaceImageOverlay overlay
ListBase treepath
short render_size
StripProxy * proxy
StripTransform * transform
StripElem * stripdata
StripCrop * crop
View3DOverlay overlay
struct bNodeSocket * next
void * default_value
ListBase nodes
ListBase links
static void seq_convert_transform_animation_2(const Scene *scene, const char *path, const float scale_to_fit_factor)
static void version_node_socket_duplicate(bNodeTree *ntree, const int node_type, const char *old_name, const char *new_name)
static void seq_convert_transform_crop_lb_2(const Scene *scene, const ListBase *lb, const eSpaceSeq_Proxy_RenderSize render_size)
static void seq_convert_transform_crop(const Scene *scene, Sequence *seq, const eSpaceSeq_Proxy_RenderSize render_size)
static void version_node_join_geometry_for_multi_input_socket(bNodeTree *ntree)
static void seq_convert_transform_crop_lb(const Scene *scene, const ListBase *lb, const eSpaceSeq_Proxy_RenderSize render_size)
static bool can_use_proxy(const Sequence *seq, int psize)
static void do_versions_291_fcurve_handles_limit(FCurve *fcu)
void do_versions_after_linking_290(FileData *, Main *bmain)
static void seq_convert_transform_crop_2(const Scene *scene, Sequence *seq, const eSpaceSeq_Proxy_RenderSize render_size)
static void seq_convert_transform_animation(const Sequence *seq, const Scene *scene, const char *path, const int image_size, const int scene_size)
static void panels_remove_x_closed_flag_recursive(Panel *panel)
#define CU_2D
static void do_versions_strip_cache_settings_recursive(const ListBase *seqbase)
void blo_do_versions_290(FileData *fd, Library *, Main *bmain)
static void do_versions_point_attributes(CustomData *pdata)
static eSpaceSeq_Proxy_RenderSize get_sequencer_render_size(Main *bmain)
static void seq_update_meta_disp_range(Scene *scene)
static void do_versions_point_attribute_names(CustomData *pdata)
void version_cycles_property_int_set(IDProperty *idprop, const char *name, int value)
IDProperty * version_cycles_properties_from_ID(ID *id)
int version_cycles_property_int(IDProperty *idprop, const char *name, int default_value)
IDProperty * version_cycles_properties_from_render_layer(SceneRenderLayer *render_layer)
ARegion * do_versions_add_region_if_not_found(ListBase *regionbase, int region_type, const char *allocname, int link_after_region_type)
void version_node_socket_index_animdata(Main *bmain, const int node_tree_type, const int node_type, const int socket_index_orig, const int socket_index_offset, const int total_number_of_sockets)
void version_node_socket_name(bNodeTree *ntree, const int node_type, const char *old_name, const char *new_name)
bool version_cycles_property_boolean(IDProperty *idprop, const char *name, bool default_value)
IDProperty * version_cycles_properties_from_view_layer(ViewLayer *view_layer)
void version_cycles_property_boolean_set(IDProperty *idprop, const char *name, bool value)