Blender V5.0
versioning_270.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
9#include "BLI_utildefines.h"
10
11#include <string>
12
13/* allow readfile to use deprecated functionality */
14#define DNA_DEPRECATED_ALLOW
15
16/* Define macros in `DNA_genfile.h`. */
17#define DNA_GENFILE_VERSIONING_MACROS
18
19#include "DNA_anim_types.h"
20#include "DNA_armature_types.h"
21#include "DNA_brush_types.h"
22#include "DNA_camera_types.h"
23#include "DNA_cloth_types.h"
25#include "DNA_fluid_types.h"
27#include "DNA_light_types.h"
28#include "DNA_linestyle_types.h"
29#include "DNA_mask_types.h"
30#include "DNA_mesh_types.h"
31#include "DNA_modifier_types.h"
32#include "DNA_object_types.h"
33#include "DNA_particle_types.h"
35#include "DNA_rigidbody_types.h"
36#include "DNA_screen_types.h"
37#include "DNA_sequence_types.h"
38#include "DNA_space_types.h"
39#include "DNA_userdef_types.h"
40#include "DNA_view3d_types.h"
42
43#include "DNA_genfile.h"
44
45#undef DNA_GENFILE_VERSIONING_MACROS
46
47#include "BKE_anim_data.hh"
48#include "BKE_animsys.h"
49#include "BKE_colortools.hh"
50#include "BKE_customdata.hh"
51#include "BKE_fcurve_driver.h"
52#include "BKE_main.hh"
53#include "BKE_mask.h"
54#include "BKE_modifier.hh"
55#include "BKE_node.hh"
57#include "BKE_scene.hh"
58#include "BKE_screen.hh"
59#include "DNA_material_types.h"
60
61#include "SEQ_effects.hh"
62#include "SEQ_iterator.hh"
63
64#include "BLI_listbase.h"
65#include "BLI_math_matrix.h"
66#include "BLI_math_rotation.h"
67#include "BLI_math_vector.h"
68#include "BLI_string.h"
69#include "BLI_string_utf8.h"
70#include "BLI_string_utils.hh"
71
72#include "BLT_translation.hh"
73
74#include "BLO_readfile.hh"
75
76#include "NOD_composite.hh"
77#include "NOD_socket.hh"
78
79#include "readfile.hh"
80
81#include "MEM_guardedalloc.h"
82
83/* Make preferences read-only, use `versioning_userdef.cc`. */
84#define U (*((const UserDef *)&U))
85
86/* ************************************************** */
87/* GP Palettes API (Deprecated) */
88
89/* add a new gp-palette */
91{
92 bGPDpalette *palette;
93
94 /* check that list is ok */
95 if (gpd == nullptr) {
96 return nullptr;
97 }
98
99 /* allocate memory and add to end of list */
100 palette = MEM_callocN<bGPDpalette>("bGPDpalette");
101
102 /* add to datablock */
103 BLI_addtail(&gpd->palettes, palette);
104
105 /* set basic settings */
106 /* auto-name */
107 STRNCPY_UTF8(palette->info, name);
108 BLI_uniquename(&gpd->palettes,
109 palette,
110 DATA_("GP_Palette"),
111 '.',
112 offsetof(bGPDpalette, info),
113 sizeof(palette->info));
114
115 /* return palette */
116 return palette;
117}
118
119/* add a new gp-palettecolor */
121{
122 bGPDpalettecolor *palcolor;
123
124 /* check that list is ok */
125 if (palette == nullptr) {
126 return nullptr;
127 }
128
129 /* allocate memory and add to end of list */
130 palcolor = MEM_callocN<bGPDpalettecolor>("bGPDpalettecolor");
131
132 /* add to datablock */
133 BLI_addtail(&palette->colors, palcolor);
134
135 /* set basic settings */
136 copy_v4_v4(palcolor->color, U.gpencil_new_layer_col);
137 ARRAY_SET_ITEMS(palcolor->fill, 1.0f, 1.0f, 1.0f);
138
139 /* auto-name */
140 STRNCPY_UTF8(palcolor->info, name);
141 BLI_uniquename(&palette->colors,
142 palcolor,
143 DATA_("Color"),
144 '.',
146 sizeof(palcolor->info));
147
148 /* return palette color */
149 return palcolor;
150}
151
159{
160 if (stab->rot_track_legacy) {
162 stab->tot_rot_track++;
164 }
165 }
166 stab->rot_track_legacy = nullptr; /* this field is now ignored */
167}
168
170{
171 LISTBASE_FOREACH (bConstraint *, con, lb) {
172 if (con->type == CONSTRAINT_TYPE_TRANSFORM) {
174 const float deg_to_rad_f = DEG2RADF(1.0f);
175
176 if (data->from == TRANS_ROTATION) {
177 mul_v3_fl(data->from_min, deg_to_rad_f);
178 mul_v3_fl(data->from_max, deg_to_rad_f);
179 }
180
181 if (data->to == TRANS_ROTATION) {
182 mul_v3_fl(data->to_min, deg_to_rad_f);
183 mul_v3_fl(data->to_max, deg_to_rad_f);
184 }
185 }
186 }
187}
188
190{
191 LISTBASE_FOREACH (bConstraint *, con, lb) {
192 if (con->type == CONSTRAINT_TYPE_TRANSFORM) {
194
195 if (data->from == TRANS_ROTATION) {
196 copy_v3_v3(data->from_min_rot, data->from_min);
197 copy_v3_v3(data->from_max_rot, data->from_max);
198 }
199 else if (data->from == TRANS_SCALE) {
200 copy_v3_v3(data->from_min_scale, data->from_min);
201 copy_v3_v3(data->from_max_scale, data->from_max);
202 }
203
204 if (data->to == TRANS_ROTATION) {
205 copy_v3_v3(data->to_min_rot, data->to_min);
206 copy_v3_v3(data->to_max_rot, data->to_max);
207 }
208 else if (data->to == TRANS_SCALE) {
209 copy_v3_v3(data->to_min_scale, data->to_min);
210 copy_v3_v3(data->to_max_scale, data->to_max);
211 }
212 }
213 }
214}
215
217{
218 LISTBASE_FOREACH (bConstraint *, con, lb) {
219 if (con->type == CONSTRAINT_TYPE_STRETCHTO) {
221 data->bulge_min = 1.0f;
222 data->bulge_max = 1.0f;
223 }
224 }
225}
226
228{
229 LISTBASE_FOREACH (ARegion *, region, regionbase) {
230 if (region->regiontype == RGN_TYPE_UI) {
231 /* already exists */
232 return;
233 }
234 if (region->regiontype == RGN_TYPE_WINDOW) {
235 /* add new region here */
236 ARegion *region_new = BKE_area_region_new();
237
238 BLI_insertlinkbefore(regionbase, region, region_new);
239
240 region_new->regiontype = RGN_TYPE_UI;
241 region_new->alignment = RGN_ALIGN_RIGHT;
242 region_new->flag = RGN_FLAG_HIDDEN;
243
244 return;
245 }
246 }
247}
248
250{
251 LISTBASE_FOREACH (Bone *, bone, lb) {
252 bone->scale_in_x = bone->scale_in_z = 1.0f;
253 bone->scale_out_x = bone->scale_out_z = 1.0f;
254
255 do_version_bones_super_bbone(&bone->childbase);
256 }
257}
258
259/* TODO(sergey): Consider making it somewhat more generic function in BLI_anim.h. */
261 const char *prefix,
262 const char *old_prop_name,
263 const char *new_prop_name)
264{
265 const char *old_path = BLI_sprintfN("%s.%s", prefix, old_prop_name);
266 if (STREQ(fcu->rna_path, old_path)) {
267 MEM_freeN(fcu->rna_path);
268 fcu->rna_path = BLI_sprintfN("%s.%s", prefix, new_prop_name);
269 }
270 MEM_freeN((char *)old_path);
271}
272
273static void do_version_hue_sat_node(bNodeTree *ntree, bNode *node)
274{
275 if (node->storage == nullptr) {
276 return;
277 }
278
279 /* Convert value from old storage to new sockets. */
280 NodeHueSat *nhs = static_cast<NodeHueSat *>(node->storage);
282 bNodeSocket *saturation = blender::bke::node_find_socket(*node, SOCK_IN, "Saturation");
283 bNodeSocket *value = blender::bke::node_find_socket(*node, SOCK_IN, "Value");
284 if (hue == nullptr) {
286 *ntree, *node, SOCK_IN, SOCK_FLOAT, PROP_FACTOR, "Hue", "Hue");
287 }
288 if (saturation == nullptr) {
290 *ntree, *node, SOCK_IN, SOCK_FLOAT, PROP_FACTOR, "Saturation", "Saturation");
291 }
292 if (value == nullptr) {
294 *ntree, *node, SOCK_IN, SOCK_FLOAT, PROP_FACTOR, "Value", "Value");
295 }
296
297 ((bNodeSocketValueFloat *)hue->default_value)->value = nhs->hue;
298 ((bNodeSocketValueFloat *)saturation->default_value)->value = nhs->sat;
299 ((bNodeSocketValueFloat *)value->default_value)->value = nhs->val;
300 /* Take care of possible animation. */
301 AnimData *adt = BKE_animdata_from_id(&ntree->id);
302 if (adt != nullptr && adt->action != nullptr) {
303 char node_name_esc[sizeof(node->name) * 2];
304 BLI_str_escape(node_name_esc, node->name, sizeof(node_name_esc));
305 const char *prefix = BLI_sprintfN("nodes[\"%s\"]", node_name_esc);
306 LISTBASE_FOREACH (FCurve *, fcu, &adt->action->curves) {
307 if (STRPREFIX(fcu->rna_path, prefix)) {
308 anim_change_prop_name(fcu, prefix, "color_hue", "inputs[1].default_value");
309 anim_change_prop_name(fcu, prefix, "color_saturation", "inputs[2].default_value");
310 anim_change_prop_name(fcu, prefix, "color_value", "inputs[3].default_value");
311 }
312 }
313 MEM_freeN((char *)prefix);
314 }
315 /* Free storage, it is no longer used. */
316 MEM_freeN(node->storage);
317 node->storage = nullptr;
318}
319
321{
322 int pass_index = 0;
323 const char *sockname;
324 for (bNodeSocket *sock = static_cast<bNodeSocket *>(node->outputs.first);
325 sock && pass_index < 31;
326 sock = static_cast<bNodeSocket *>(sock->next), pass_index++)
327 {
328 if (sock->storage == nullptr) {
329 NodeImageLayer *sockdata = MEM_callocN<NodeImageLayer>("node image layer");
330 sock->storage = sockdata;
332
333 if (pass_index == 0) {
334 sockname = "Image";
335 }
336 else if (pass_index == 1) {
337 sockname = "Alpha";
338 }
339 else {
340 sockname = node_cmp_rlayers_sock_to_pass(pass_index);
341 }
342 STRNCPY_UTF8(sock->name, sockname);
343 }
344 }
345}
346
348{
349 LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
350 if (node->type_legacy == CMP_NODE_R_LAYERS) {
351 /* First we make sure existing sockets have proper names.
352 * This is important because otherwise verification will
353 * drop links from sockets which were renamed.
354 */
356 /* Make sure new sockets are properly created. */
357 node_verify_sockets(ntree, node, false);
358 /* Make sure all possibly created sockets have proper storage. */
360 }
361 }
362}
363
364static char *replace_bbone_easing_rnapath(char *old_path)
365{
366 char *new_path = nullptr;
367
368 /* NOTE: This will break paths for any bones/custom-properties
369 * which happen be named after the bbone property id's
370 */
371 if (strstr(old_path, "bbone_in")) {
372 new_path = BLI_string_replaceN(old_path, "bbone_in", "bbone_easein");
373 }
374 else if (strstr(old_path, "bbone_out")) {
375 new_path = BLI_string_replaceN(old_path, "bbone_out", "bbone_easeout");
376 }
377
378 if (new_path) {
379 MEM_freeN(old_path);
380 return new_path;
381 }
382
383 return old_path;
384}
385
387{
388 /* F-Curve's path (for bbone_in/out) */
389 if (fcu->rna_path) {
391 }
392
393 /* Driver -> Driver Vars (for bbone_in/out) */
394 if (fcu->driver) {
395 LISTBASE_FOREACH (DriverVar *, dvar, &fcu->driver->variables) {
397 if (dtar->rna_path) {
398 dtar->rna_path = replace_bbone_easing_rnapath(dtar->rna_path);
399 }
400 }
402 }
403 }
404
405 /* FModifiers -> Stepped (for frame_start/end) */
406 if (fcu->modifiers.first) {
407 LISTBASE_FOREACH (FModifier *, fcm, &fcu->modifiers) {
408 if (fcm->type == FMODIFIER_TYPE_STEPPED) {
409 FMod_Stepped *data = static_cast<FMod_Stepped *>(fcm->data);
410
411 /* Modifier doesn't work if the modifier's copy of start/end frame are both 0
412 * as those were only getting written to the fcm->data copy (#52009)
413 */
414 if ((fcm->sfra == fcm->efra) && (fcm->sfra == 0)) {
415 fcm->sfra = data->start_frame;
416 fcm->efra = data->end_frame;
417 }
418 }
419 }
420 }
421}
422
423static bool strip_update_proxy_cb(Strip *strip, void * /*user_data*/)
424{
425 strip->stereo3d_format = MEM_callocN<Stereo3dFormat>("Stereo Display 3d Format");
426
427#define STRIP_USE_PROXY_CUSTOM_DIR (1 << 19)
428#define STRIP_USE_PROXY_CUSTOM_FILE (1 << 21)
429 if (strip->data && strip->data->proxy && !strip->data->proxy->storage) {
430 if (strip->flag & STRIP_USE_PROXY_CUSTOM_DIR) {
432 }
433 if (strip->flag & STRIP_USE_PROXY_CUSTOM_FILE) {
435 }
436 }
437#undef STRIP_USE_PROXY_CUSTOM_DIR
438#undef STRIP_USE_PROXY_CUSTOM_FILE
439 return true;
440}
441
442static bool strip_update_effectdata_cb(Strip *strip, void * /*user_data*/)
443{
444 if (strip->type != STRIP_TYPE_TEXT) {
445 return true;
446 }
447
448 if (strip->effectdata == nullptr) {
450 effect_handle.init(strip);
451 }
452
453 TextVars *data = static_cast<TextVars *>(strip->effectdata);
454 if (data->color[3] == 0.0f) {
455 copy_v4_fl(data->color, 1.0f);
456 data->shadow_color[3] = 1.0f;
457 }
458 return true;
459}
460
461/* NOLINTNEXTLINE: readability-function-size */
462void blo_do_versions_270(FileData *fd, Library * /*lib*/, Main *bmain)
463{
464 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 270, 0)) {
465
466 if (!DNA_struct_member_exists(fd->filesdna, "BevelModifierData", "float", "profile")) {
467 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
468 LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
469 if (md->type == eModifierType_Bevel) {
471 bmd->profile = 0.5f;
473 }
474 }
475 }
476 }
477
478 /* nodes don't use fixed node->id any more, clean up */
479 FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
480 if (ntree->type == NTREE_COMPOSIT) {
481 LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
483 node->id = nullptr;
484 }
485 }
486 }
487 }
489
490 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
491 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
492 LISTBASE_FOREACH (SpaceLink *, space_link, &area->spacedata) {
493 if (space_link->spacetype == SPACE_CLIP) {
494 SpaceClip *space_clip = (SpaceClip *)space_link;
495 if (space_clip->mode != SC_MODE_MASKEDIT) {
496 space_clip->mode = SC_MODE_TRACKING;
497 }
498 }
499 }
500 }
501 }
502
503 if (!DNA_struct_member_exists(
504 fd->filesdna, "MovieTrackingSettings", "float", "default_weight"))
505 {
506 LISTBASE_FOREACH (MovieClip *, clip, &bmain->movieclips) {
507 clip->tracking.settings.default_weight = 1.0f;
508 }
509 }
510 }
511
512 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 270, 1)) {
513 /* Update Transform constraint (another deg -> rad stuff). */
514 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
516
517 if (ob->pose) {
518 /* Bones constraints! */
519 LISTBASE_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
521 }
522 }
523 }
524 }
525
526 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 270, 2)) {
527 /* Mesh smoothresh_legacy deg->rad. */
528 LISTBASE_FOREACH (Mesh *, me, &bmain->meshes) {
529 me->smoothresh_legacy = DEG2RADF(me->smoothresh_legacy);
530 }
531 }
532
533 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 270, 3)) {
534 LISTBASE_FOREACH (FreestyleLineStyle *, linestyle, &bmain->linestyles) {
535 linestyle->flag |= LS_NO_SORTING;
536 linestyle->sort_key = LS_SORT_KEY_DISTANCE_FROM_CAMERA;
537 linestyle->integration_type = LS_INTEGRATION_MEAN;
538 }
539 }
540
541 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 270, 4)) {
542 /* ui_previews were not handled correctly when copying areas,
543 * leading to corrupted files (see #39847).
544 * This will always reset situation to a valid state.
545 */
546 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
547 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
548 LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
549 ListBase *lb = (sl == area->spacedata.first) ? &area->regionbase : &sl->regionbase;
550 LISTBASE_FOREACH (ARegion *, region, lb) {
551 BLI_listbase_clear(&region->ui_previews);
552 }
553 }
554 }
555 }
556 }
557
558 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 270, 5)) {
559 /* Update Transform constraint (again :|). */
560 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
562
563 if (ob->pose) {
564 /* Bones constraints! */
565 LISTBASE_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
567 }
568 }
569 }
570 }
571
572 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 271, 0)) {
573 if (!DNA_struct_member_exists(fd->filesdna, "RenderData", "BakeData", "bake")) {
574 LISTBASE_FOREACH (Scene *, sce, &bmain->scenes) {
575 sce->r.bake.flag = R_BAKE_CLEAR;
576 sce->r.bake.width = 512;
577 sce->r.bake.height = 512;
578 sce->r.bake.margin = 16;
579 sce->r.bake.normal_space = R_BAKE_SPACE_TANGENT;
580 sce->r.bake.normal_swizzle[0] = R_BAKE_POSX;
581 sce->r.bake.normal_swizzle[1] = R_BAKE_POSY;
582 sce->r.bake.normal_swizzle[2] = R_BAKE_POSZ;
583 STRNCPY(sce->r.bake.filepath, U.renderdir);
584
585 sce->r.bake.im_format.planes = R_IMF_PLANES_RGBA;
586 sce->r.bake.im_format.imtype = R_IMF_IMTYPE_PNG;
587 sce->r.bake.im_format.depth = R_IMF_CHAN_DEPTH_8;
588 sce->r.bake.im_format.quality = 90;
589 sce->r.bake.im_format.compress = 15;
590 }
591 }
592
593 if (!DNA_struct_member_exists(fd->filesdna, "FreestyleLineStyle", "float", "texstep")) {
594 LISTBASE_FOREACH (FreestyleLineStyle *, linestyle, &bmain->linestyles) {
595 linestyle->flag |= LS_TEXTURE;
596 linestyle->texstep = 1.0;
597 }
598 }
599
600 {
601 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
602 int num_layers = BLI_listbase_count(&scene->r.layers);
603 scene->r.actlay = min_ff(scene->r.actlay, num_layers - 1);
604 }
605 }
606 }
607
608 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 271, 1)) {
609 if (!DNA_struct_member_exists(fd->filesdna, "Material", "float", "line_col[4]")) {
610 LISTBASE_FOREACH (Material *, mat, &bmain->materials) {
611 mat->line_col[0] = mat->line_col[1] = mat->line_col[2] = 0.0f;
612 mat->line_col[3] = mat->alpha;
613 }
614 }
615 }
616
617 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 271, 3)) {
618 LISTBASE_FOREACH (Brush *, br, &bmain->brushes) {
619 br->fill_threshold = 0.2f;
620 }
621
622 if (!DNA_struct_member_exists(fd->filesdna, "BevelModifierData", "int", "mat")) {
623 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
624 LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
625 if (md->type == eModifierType_Bevel) {
627 bmd->mat = -1;
628 }
629 }
630 }
631 }
632 }
633
634 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 271, 6)) {
635 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
636 LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
637 if (md->type == eModifierType_ParticleSystem) {
639 if (pmd->psys && pmd->psys->clmd) {
640 pmd->psys->clmd->sim_parms->vel_damping = 1.0f;
641 }
642 }
643 }
644 }
645 }
646
647 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 272, 1)) {
648 LISTBASE_FOREACH (Brush *, br, &bmain->brushes) {
649 if ((br->ob_mode & OB_MODE_SCULPT) &&
651 {
652 br->alpha = 1.0f;
653 }
654 }
655 }
656
657 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 272, 2)) {
658 if (!DNA_struct_member_exists(fd->filesdna, "Image", "float", "gen_color")) {
659 LISTBASE_FOREACH (Image *, image, &bmain->images) {
660 image->gen_color[3] = 1.0f;
661 }
662 }
663
664 if (!DNA_struct_member_exists(fd->filesdna, "bStretchToConstraint", "float", "bulge_min")) {
665 /* Update Transform constraint (again :|). */
666 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
668
669 if (ob->pose) {
670 /* Bones constraints! */
671 LISTBASE_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
672 do_version_constraints_stretch_to_limits(&pchan->constraints);
673 }
674 }
675 }
676 }
677 }
678
679 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 273, 1)) {
680#define BRUSH_RAKE (1 << 7)
681#define BRUSH_RANDOM_ROTATION (1 << 25)
682
683 LISTBASE_FOREACH (Brush *, br, &bmain->brushes) {
684 if (br->flag & BRUSH_RAKE) {
685 br->mtex.brush_angle_mode |= MTEX_ANGLE_RAKE;
686 br->mask_mtex.brush_angle_mode |= MTEX_ANGLE_RAKE;
687 }
688 else if (br->flag & BRUSH_RANDOM_ROTATION) {
689 br->mtex.brush_angle_mode |= MTEX_ANGLE_RANDOM;
690 br->mask_mtex.brush_angle_mode |= MTEX_ANGLE_RANDOM;
691 }
692 br->mtex.random_angle = 2.0 * M_PI;
693 br->mask_mtex.random_angle = 2.0 * M_PI;
694 }
695 }
696
697#undef BRUSH_RAKE
698#undef BRUSH_RANDOM_ROTATION
699
700 /* Customizable Safe Areas */
701 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 273, 2)) {
702 if (!DNA_struct_member_exists(fd->filesdna, "Scene", "DisplaySafeAreas", "safe_areas")) {
703 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
704 copy_v2_fl2(scene->safe_areas.title, 3.5f / 100.0f, 3.5f / 100.0f);
705 copy_v2_fl2(scene->safe_areas.action, 10.0f / 100.0f, 5.0f / 100.0f);
706 copy_v2_fl2(scene->safe_areas.title_center, 17.5f / 100.0f, 5.0f / 100.0f);
707 copy_v2_fl2(scene->safe_areas.action_center, 15.0f / 100.0f, 5.0f / 100.0f);
708 }
709 }
710 }
711
712 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 273, 3)) {
713 LISTBASE_FOREACH (ParticleSettings *, part, &bmain->particles) {
714 if (part->clumpcurve) {
715 part->child_flag |= PART_CHILD_USE_CLUMP_CURVE;
716 }
717 if (part->roughcurve) {
718 part->child_flag |= PART_CHILD_USE_ROUGH_CURVE;
719 }
720 }
721 }
722
723 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 273, 6)) {
724 if (!DNA_struct_member_exists(fd->filesdna, "ClothSimSettings", "float", "bending_damping")) {
725 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
726 LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
727 if (md->type == eModifierType_Cloth) {
729 clmd->sim_parms->bending_damping = 0.5f;
730 }
731 else if (md->type == eModifierType_ParticleSystem) {
733 if (pmd->psys->clmd) {
734 pmd->psys->clmd->sim_parms->bending_damping = 0.5f;
735 }
736 }
737 }
738 }
739 }
740
741 if (!DNA_struct_member_exists(fd->filesdna, "ParticleSettings", "float", "clump_noise_size")) {
742 LISTBASE_FOREACH (ParticleSettings *, part, &bmain->particles) {
743 part->clump_noise_size = 1.0f;
744 }
745 }
746
747 if (!DNA_struct_member_exists(fd->filesdna, "ParticleSettings", "int", "kink_extra_steps")) {
748 LISTBASE_FOREACH (ParticleSettings *, part, &bmain->particles) {
749 part->kink_extra_steps = 4;
750 }
751 }
752
753 if (!DNA_struct_member_exists(fd->filesdna, "MTex", "float", "kinkampfac")) {
754 LISTBASE_FOREACH (ParticleSettings *, part, &bmain->particles) {
755 for (int a = 0; a < MAX_MTEX; a++) {
756 MTex *mtex = part->mtex[a];
757 if (mtex) {
758 mtex->kinkampfac = 1.0f;
759 }
760 }
761 }
762 }
763
764 if (!DNA_struct_member_exists(fd->filesdna, "HookModifierData", "char", "flag")) {
765 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
766 LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
767 if (md->type == eModifierType_Hook) {
770 }
771 }
772 }
773 }
774
775 if (!DNA_struct_member_exists(fd->filesdna, "NodePlaneTrackDeformData", "char", "flag")) {
776 FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
777 if (ntree->type == NTREE_COMPOSIT) {
778 LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
779 if (ELEM(node->type_legacy, CMP_NODE_PLANETRACKDEFORM)) {
781 node->storage);
782 data->flag = 0;
783 data->motion_blur_samples = 16;
784 data->motion_blur_shutter = 0.5f;
785 }
786 }
787 }
788 }
790 }
791
792 if (!DNA_struct_member_exists(fd->filesdna, "Camera", "GPUDOFSettings", "gpu_dof")) {
793 LISTBASE_FOREACH (Camera *, ca, &bmain->cameras) {
794 ca->gpu_dof.fstop = 128.0f;
795 ca->gpu_dof.focal_length = 1.0f;
796 ca->gpu_dof.focus_distance = 1.0f;
797 ca->gpu_dof.sensor = 1.0f;
798 }
799 }
800 }
801
802 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 273, 8)) {
803 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
804 LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
805 const std::string old_name = md->name;
806 BKE_modifier_unique_name(&ob->modifiers, md);
807 if (old_name != md->name) {
808 printf(
809 "Warning: Object '%s' had several modifiers with the "
810 "same name, renamed one of them to '%s'.\n",
811 ob->id.name + 2,
812 md->name);
813 }
814 }
815 }
816 }
817
818 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 273, 9)) {
819 /* Make sure sequencer preview area limits zoom */
820 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
821 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
822 LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
823 if (sl->spacetype == SPACE_SEQ) {
824 LISTBASE_FOREACH (ARegion *, region, &sl->regionbase) {
825 if (region->regiontype == RGN_TYPE_PREVIEW) {
826 region->v2d.keepzoom |= V2D_LIMITZOOM;
827 region->v2d.minzoom = 0.001f;
828 region->v2d.maxzoom = 1000.0f;
829 break;
830 }
831 }
832 }
833 }
834 }
835 }
836 }
837
838 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 274, 1)) {
839 /* particle systems need to be forced to redistribute for jitter mode fix */
840 {
841 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
842 LISTBASE_FOREACH (ParticleSystem *, psys, &ob->particlesystem) {
843 if ((psys->pointcache->flag & PTCACHE_BAKED) == 0) {
844 psys->recalc |= ID_RECALC_PSYS_RESET;
845 }
846 }
847 }
848 }
849 }
850
851 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 274, 4)) {
852 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
854 SceneRenderView *srv = static_cast<SceneRenderView *>(scene->r.views.first);
856
858 srv = static_cast<SceneRenderView *>(scene->r.views.last);
860
861 if (scene->ed) {
862 blender::seq::foreach_strip(&scene->ed->seqbase, strip_update_proxy_cb, nullptr);
863 }
864 }
865
866 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
867 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
868 LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
869 switch (sl->spacetype) {
870 case SPACE_VIEW3D: {
871 View3D *v3d = (View3D *)sl;
874 v3d->stereo3d_convergence_alpha = 0.15f;
875 v3d->stereo3d_volume_alpha = 0.05f;
876 break;
877 }
878 case SPACE_IMAGE: {
879 SpaceImage *sima = (SpaceImage *)sl;
880 sima->iuser.flag |= IMA_SHOW_STEREO;
881 break;
882 }
883 }
884 }
885 }
886 }
887
888 LISTBASE_FOREACH (Camera *, cam, &bmain->cameras) {
889 cam->stereo.interocular_distance = 0.065f;
890 cam->stereo.convergence_distance = 30.0f * 0.065f;
891 }
892
893 LISTBASE_FOREACH (Image *, ima, &bmain->images) {
894 ima->stereo3d_format = MEM_callocN<Stereo3dFormat>("Image Stereo 3d Format");
895
896 if (ima->packedfile) {
897 ImagePackedFile *imapf = MEM_mallocN<ImagePackedFile>("Image Packed File");
898 BLI_addtail(&ima->packedfiles, imapf);
899
900 imapf->packedfile = ima->packedfile;
901 STRNCPY(imapf->filepath, ima->filepath);
902 ima->packedfile = nullptr;
903 }
904 }
905
906 LISTBASE_FOREACH (wmWindowManager *, wm, &bmain->wm) {
907 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
908 win->stereo3d_format = MEM_callocN<Stereo3dFormat>("Stereo Display 3d Format");
909 }
910 }
911 }
912
913 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 274, 6)) {
914 if (!DNA_struct_member_exists(fd->filesdna, "FileSelectParams", "int", "thumbnail_size")) {
915 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
916 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
917 LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
918 if (sl->spacetype == SPACE_FILE) {
919 SpaceFile *sfile = (SpaceFile *)sl;
920
921 if (sfile->params) {
922 sfile->params->thumbnail_size = 128;
923 }
924 }
925 }
926 }
927 }
928 }
929
930 if (!DNA_struct_member_exists(fd->filesdna, "RenderData", "short", "simplify_subsurf_render"))
931 {
932 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
933 scene->r.simplify_subsurf_render = scene->r.simplify_subsurf;
934 scene->r.simplify_particles_render = scene->r.simplify_particles;
935 }
936 }
937
938 if (!DNA_struct_member_exists(fd->filesdna, "DecimateModifierData", "float", "defgrp_factor"))
939 {
940 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
941 LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
942 if (md->type == eModifierType_Decimate) {
944 dmd->defgrp_factor = 1.0f;
945 }
946 }
947 }
948 }
949 }
950
951 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 275, 3)) {
952#define BRUSH_TORUS (1 << 1)
953 LISTBASE_FOREACH (Brush *, br, &bmain->brushes) {
954 br->flag &= ~BRUSH_TORUS;
955 }
956#undef BRUSH_TORUS
957 }
958
959 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 276, 2)) {
960 if (!DNA_struct_member_exists(fd->filesdna, "bPoseChannel", "float", "custom_scale")) {
961 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
962 if (ob->pose) {
963 LISTBASE_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
964 pchan->custom_scale = 1.0f;
965 }
966 }
967 }
968 }
969
970#define RV3D_VIEW_PERSPORTHO 7
971 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
972 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
973 LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
974 if (sl->spacetype == SPACE_VIEW3D) {
975 ListBase *lb = (sl == area->spacedata.first) ? &area->regionbase : &sl->regionbase;
976 LISTBASE_FOREACH (ARegion *, region, lb) {
977 if (region->regiontype == RGN_TYPE_WINDOW) {
978 if (region->regiondata) {
979 RegionView3D *rv3d = static_cast<RegionView3D *>(region->regiondata);
980 if (rv3d->view == RV3D_VIEW_PERSPORTHO) {
981 rv3d->view = RV3D_VIEW_USER;
982 }
983 }
984 }
985 }
986 break;
987 }
988 }
989 }
990 }
991#undef RV3D_VIEW_PERSPORTHO
992
993#define LA_YF_PHOTON 5
994 LISTBASE_FOREACH (Light *, la, &bmain->lights) {
995 if (la->type == LA_YF_PHOTON) {
996 la->type = LA_LOCAL;
997 }
998 }
999#undef LA_YF_PHOTON
1000 }
1001
1002 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 276, 3)) {
1003 if (!DNA_struct_member_exists(
1004 fd->filesdna, "RenderData", "CurveMapping", "mblur_shutter_curve"))
1005 {
1006 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1007 CurveMapping *curve_mapping = &scene->r.mblur_shutter_curve;
1008 BKE_curvemapping_set_defaults(curve_mapping, 1, 0.0f, 0.0f, 1.0f, 1.0f, HD_AUTO);
1009 BKE_curvemapping_init(curve_mapping);
1010 BKE_curvemap_reset(curve_mapping->cm,
1011 &curve_mapping->clipr,
1014 }
1015 }
1016 }
1017
1018 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 276, 4)) {
1019 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1020 ToolSettings *ts = scene->toolsettings;
1021 if (!DNA_struct_member_exists(fd->filesdna, "ToolSettings", "char", "gpencil_v3d_align")) {
1024 }
1025 }
1026
1027 LISTBASE_FOREACH (bGPdata *, gpd, &bmain->gpencils) {
1028 bool enabled = false;
1029
1030 /* Ensure that the data-block's onion-skinning toggle flag
1031 * stays in sync with the status of the actual layers. */
1032 LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
1033 if (gpl->flag & GP_LAYER_ONIONSKIN) {
1034 enabled = true;
1035 }
1036 }
1037
1038 if (enabled) {
1039 gpd->flag |= GP_DATA_SHOW_ONIONSKINS;
1040 }
1041 else {
1042 gpd->flag &= ~GP_DATA_SHOW_ONIONSKINS;
1043 }
1044 }
1045 }
1046 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 276, 5)) {
1047 /* Important to clear all non-persistent flags from older versions here,
1048 * otherwise they could collide with any new persistent flag we may add in the future. */
1049 MainListsArray lbarray = BKE_main_lists_get(*bmain);
1050 int a = lbarray.size();
1051 while (a--) {
1052 LISTBASE_FOREACH (ID *, id, lbarray[a]) {
1053 id->flag &= ID_FLAG_FAKEUSER;
1054
1055 /* NOTE: This is added in 4.1 code.
1056 *
1057 * Original commit (3fcf535d2e) forgot to handle embedded IDs. Fortunately, back then, the
1058 * only embedded IDs that existed were the NodeTree ones, and the current API to access
1059 * them should still be valid on code from 9 years ago. */
1061 if (node_tree) {
1062 node_tree->id.flag &= ID_FLAG_FAKEUSER;
1063 }
1064 }
1065 }
1066 }
1067
1068 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 276, 7)) {
1069 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1070 scene->r.bake.pass_filter = R_BAKE_PASS_FILTER_ALL;
1071 }
1072 }
1073
1074 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 277, 1)) {
1075 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1076 ParticleEditSettings *pset = &scene->toolsettings->particle;
1077 for (int a = 0; a < ARRAY_SIZE(pset->brush); a++) {
1078 if (pset->brush[a].strength > 1.0f) {
1079 pset->brush[a].strength *= 0.01f;
1080 }
1081 }
1082 }
1083
1084 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1085 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1086 LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1087 ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
1088 &sl->regionbase;
1089 /* Bug: Was possible to add preview region to sequencer view by using AZones. */
1090 if (sl->spacetype == SPACE_SEQ) {
1091 SpaceSeq *sseq = (SpaceSeq *)sl;
1092 if (sseq->view == SEQ_VIEW_SEQUENCE) {
1093 LISTBASE_FOREACH (ARegion *, region, regionbase) {
1094 /* remove preview region for sequencer-only view! */
1095 if (region->regiontype == RGN_TYPE_PREVIEW) {
1096 region->flag |= RGN_FLAG_HIDDEN;
1097 region->alignment = RGN_ALIGN_NONE;
1098 break;
1099 }
1100 }
1101 }
1102 }
1103 /* Remove old deprecated region from file-browsers. */
1104 else if (sl->spacetype == SPACE_FILE) {
1105 LISTBASE_FOREACH (ARegion *, region, regionbase) {
1106 if (region->regiontype == RGN_TYPE_CHANNELS) {
1107 /* Free old deprecated 'channel' region... */
1108 BKE_area_region_free(nullptr, region);
1109 BLI_freelinkN(regionbase, region);
1110 break;
1111 }
1112 }
1113 }
1114 }
1115 }
1116 }
1117
1118 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1119 CurvePaintSettings *cps = &scene->toolsettings->curve_paint_settings;
1120 if (cps->error_threshold == 0) {
1121 cps->curve_type = CU_BEZIER;
1123 cps->error_threshold = 8;
1124 cps->radius_max = 1.0f;
1125 cps->corner_angle = DEG2RADF(70.0f);
1126 }
1127 }
1128
1129 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1130 if (scene->ed) {
1131 blender::seq::foreach_strip(&scene->ed->seqbase, strip_update_effectdata_cb, nullptr);
1132 }
1133 }
1134
1135 /* Adding "Properties" region to DopeSheet */
1136 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1137 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1138 /* handle pushed-back space data first */
1139 LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1140 if (sl->spacetype == SPACE_ACTION) {
1141 SpaceAction *saction = (SpaceAction *)sl;
1143 }
1144 }
1145
1146 /* active spacedata info must be handled too... */
1147 if (area->spacetype == SPACE_ACTION) {
1149 }
1150 }
1151 }
1152 }
1153
1154 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 277, 2)) {
1155 if (!DNA_struct_member_exists(fd->filesdna, "Bone", "float", "scale_in_x")) {
1156 LISTBASE_FOREACH (bArmature *, arm, &bmain->armatures) {
1157 do_version_bones_super_bbone(&arm->bonebase);
1158 }
1159 }
1160 if (!DNA_struct_member_exists(fd->filesdna, "bPoseChannel", "float", "scale_in_x")) {
1161 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1162 if (ob->pose) {
1163 LISTBASE_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
1164 /* see do_version_bones_super_bbone()... */
1165 pchan->scale_in_x = pchan->scale_in_z = 1.0f;
1166 pchan->scale_out_x = pchan->scale_out_z = 1.0f;
1167
1168 /* also make sure some legacy (unused for over a decade) flags are unset,
1169 * so that we can reuse them for stuff that matters now...
1170 * (i.e. POSE_IK_MAT, (unknown/unused x 4), POSE_HAS_IK)
1171 *
1172 * These seem to have been runtime flags used by the IK solver, but that stuff
1173 * should be able to be recalculated automatically anyway, so it should be fine.
1174 */
1175 pchan->flag &= ~((1 << 3) | (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7) | (1 << 8));
1176 }
1177 }
1178 }
1179 }
1180
1181 LISTBASE_FOREACH (Camera *, camera, &bmain->cameras) {
1182 if (camera->stereo.pole_merge_angle_from == 0.0f &&
1183 camera->stereo.pole_merge_angle_to == 0.0f)
1184 {
1185 camera->stereo.pole_merge_angle_from = DEG2RADF(60.0f);
1186 camera->stereo.pole_merge_angle_to = DEG2RADF(75.0f);
1187 }
1188 }
1189
1190 if (!DNA_struct_member_exists(fd->filesdna, "NormalEditModifierData", "float", "mix_limit")) {
1191 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1192 LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1193 if (md->type == eModifierType_NormalEdit) {
1195 nemd->mix_limit = DEG2RADF(180.0f);
1196 }
1197 }
1198 }
1199 }
1200
1201 if (!DNA_struct_member_exists(
1202 fd->filesdna, "BooleanModifierData", "float", "double_threshold"))
1203 {
1204 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1205 LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1206 if (md->type == eModifierType_Boolean) {
1208 bmd->double_threshold = 1e-6f;
1209 }
1210 }
1211 }
1212 }
1213
1214 LISTBASE_FOREACH (Brush *, br, &bmain->brushes) {
1215 if (br->sculpt_brush_type == SCULPT_BRUSH_TYPE_FLATTEN) {
1216 br->flag |= BRUSH_ACCUMULATE;
1217 }
1218 }
1219
1220 if (!DNA_struct_member_exists(fd->filesdna, "ClothSimSettings", "float", "time_scale")) {
1221 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1222 LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1223 if (md->type == eModifierType_Cloth) {
1225 clmd->sim_parms->time_scale = 1.0f;
1226 }
1227 else if (md->type == eModifierType_ParticleSystem) {
1229 if (pmd->psys->clmd) {
1230 pmd->psys->clmd->sim_parms->time_scale = 1.0f;
1231 }
1232 }
1233 }
1234 }
1235 }
1236 }
1237
1238 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 277, 3)) {
1239 /* ------- init of grease pencil initialization --------------- */
1240 if (!DNA_struct_member_exists(fd->filesdna, "bGPDstroke", "bGPDpalettecolor", "*palcolor")) {
1241 /* Convert Grease Pencil to new palettes/brushes
1242 * Loop all strokes and create the palette and all colors
1243 */
1244 LISTBASE_FOREACH (bGPdata *, gpd, &bmain->gpencils) {
1245 if (BLI_listbase_is_empty(&gpd->palettes)) {
1246 /* create palette */
1247 bGPDpalette *palette = BKE_gpencil_palette_addnew(gpd, "GP_Palette");
1248 LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
1249 /* create color using layer name */
1250 bGPDpalettecolor *palcolor = BKE_gpencil_palettecolor_addnew(palette, gpl->info);
1251 if (palcolor != nullptr) {
1252 /* set color attributes */
1253 copy_v4_v4(palcolor->color, gpl->color);
1254 copy_v4_v4(palcolor->fill, gpl->fill);
1255
1256 if (gpl->flag & GP_LAYER_HIDE) {
1257 palcolor->flag |= PC_COLOR_HIDE;
1258 }
1259 if (gpl->flag & GP_LAYER_LOCKED) {
1260 palcolor->flag |= PC_COLOR_LOCKED;
1261 }
1262 if (gpl->flag & GP_LAYER_ONIONSKIN) {
1263 palcolor->flag |= PC_COLOR_ONIONSKIN;
1264 }
1265 if (gpl->flag & GP_LAYER_VOLUMETRIC) {
1266 palcolor->flag |= PC_COLOR_VOLUMETRIC;
1267 }
1268
1269 /* set layer opacity to 1 */
1270 gpl->opacity = 1.0f;
1271
1272 /* set tint color */
1273 ARRAY_SET_ITEMS(gpl->tintcolor, 0.0f, 0.0f, 0.0f, 0.0f);
1274
1275 /* flush relevant layer-settings to strokes */
1276 LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) {
1277 LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
1278 /* set stroke to palette and force recalculation */
1279 STRNCPY_UTF8(gps->colorname, gpl->info);
1280 gps->thickness = gpl->thickness;
1281
1282 /* set alpha strength to 1 */
1283 for (int i = 0; i < gps->totpoints; i++) {
1284 gps->points[i].strength = 1.0f;
1285 }
1286 }
1287 }
1288 }
1289 }
1290 }
1291 }
1292 }
1293 /* ------- end of grease pencil initialization --------------- */
1294 }
1295
1296 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 278, 0)) {
1297 if (!DNA_struct_member_exists(fd->filesdna, "MovieTrackingTrack", "float", "weight_stab")) {
1298 LISTBASE_FOREACH (MovieClip *, clip, &bmain->movieclips) {
1299 const MovieTracking *tracking = &clip->tracking;
1300 LISTBASE_FOREACH (MovieTrackingObject *, tracking_object, &tracking->objects) {
1301 const ListBase *tracksbase = (tracking_object->flag & TRACKING_OBJECT_CAMERA) ?
1302 &tracking->tracks_legacy :
1303 &tracking_object->tracks;
1304 LISTBASE_FOREACH (MovieTrackingTrack *, track, tracksbase) {
1305 track->weight_stab = track->weight;
1306 }
1307 }
1308 }
1309 }
1310
1311 if (!DNA_struct_member_exists(
1312 fd->filesdna, "MovieTrackingStabilization", "int", "tot_rot_track"))
1313 {
1314 LISTBASE_FOREACH (MovieClip *, clip, &bmain->movieclips) {
1315 if (clip->tracking.stabilization.rot_track_legacy) {
1316 migrate_single_rot_stabilization_track_settings(&clip->tracking.stabilization);
1317 }
1318 if (clip->tracking.stabilization.scale == 0.0f) {
1319 /* ensure init.
1320 * Was previously used for auto-scale only,
1321 * now used always (as "target scale") */
1322 clip->tracking.stabilization.scale = 1.0f;
1323 }
1324 /* blender prefers 1-based frame counting;
1325 * thus using frame 1 as reference typically works best */
1326 clip->tracking.stabilization.anchor_frame = 1;
1327 /* by default show the track lists expanded, to improve "discoverability" */
1328 clip->tracking.stabilization.flag |= TRACKING_SHOW_STAB_TRACKS;
1329 }
1330 }
1331 }
1332 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 278, 2)) {
1333 if (!DNA_struct_member_exists(fd->filesdna, "FFMpegCodecData", "int", "ffmpeg_preset")) {
1334 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1335 /* "medium" is the preset FFmpeg uses when no presets are given. */
1336 scene->r.ffcodecdata.ffmpeg_preset = FFM_PRESET_MEDIUM;
1337 }
1338 }
1339 if (!DNA_struct_member_exists(fd->filesdna, "FFMpegCodecData", "int", "constant_rate_factor"))
1340 {
1341 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1342 /* fall back to behavior from before we introduced CRF for old files */
1343 scene->r.ffcodecdata.constant_rate_factor = FFM_CRF_NONE;
1344 }
1345 }
1346
1347 if (!DNA_struct_member_exists(fd->filesdna, "FluidModifierData", "float", "slice_per_voxel")) {
1348 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1349 LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1350 if (md->type == eModifierType_Fluid) {
1352 if (fmd->domain) {
1353 fmd->domain->slice_per_voxel = 5.0f;
1354 fmd->domain->slice_depth = 0.5f;
1355 fmd->domain->display_thickness = 1.0f;
1356 }
1357 }
1358 }
1359 }
1360 }
1361 }
1362
1363 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 278, 3)) {
1364 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1365 if (scene->toolsettings != nullptr) {
1366 ToolSettings *ts = scene->toolsettings;
1367 ParticleEditSettings *pset = &ts->particle;
1368 for (int a = 0; a < ARRAY_SIZE(pset->brush); a++) {
1369 if (pset->brush[a].count == 0) {
1370 pset->brush[a].count = 10;
1371 }
1372 }
1373 }
1374 }
1375
1376 if (!DNA_struct_member_exists(fd->filesdna, "RigidBodyCon", "float", "spring_stiffness_ang_x"))
1377 {
1378 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1379 RigidBodyCon *rbc = ob->rigidbody_constraint;
1380 if (rbc) {
1381 rbc->spring_stiffness_ang_x = 10.0;
1382 rbc->spring_stiffness_ang_y = 10.0;
1383 rbc->spring_stiffness_ang_z = 10.0;
1384 rbc->spring_damping_ang_x = 0.5;
1385 rbc->spring_damping_ang_y = 0.5;
1386 rbc->spring_damping_ang_z = 0.5;
1387 }
1388 }
1389 }
1390
1391 /* constant detail for sculpting is now a resolution value instead of
1392 * a percentage, we reuse old DNA struct member but convert it */
1393 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1394 if (scene->toolsettings != nullptr) {
1395 ToolSettings *ts = scene->toolsettings;
1396 if (ts->sculpt && ts->sculpt->constant_detail != 0.0f) {
1397 ts->sculpt->constant_detail = 100.0f / ts->sculpt->constant_detail;
1398 }
1399 }
1400 }
1401 }
1402
1403 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 278, 4)) {
1404 const float sqrt_3 = float(M_SQRT3);
1405 LISTBASE_FOREACH (Brush *, br, &bmain->brushes) {
1406 br->fill_threshold /= sqrt_3;
1407 }
1408
1409 /* Custom motion paths */
1410 if (!DNA_struct_member_exists(fd->filesdna, "bMotionPath", "int", "line_thickness")) {
1411 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1412 if (bMotionPath *mpath = ob->mpath) {
1413 mpath->color[0] = 1.0f;
1414 mpath->color[1] = 0.0f;
1415 mpath->color[2] = 0.0f;
1416 mpath->line_thickness = 1;
1417 mpath->flag |= MOTIONPATH_FLAG_LINES;
1418 }
1419 /* bones motion path */
1420 if (ob->pose) {
1421 LISTBASE_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
1422 if (bMotionPath *mpath = pchan->mpath) {
1423 mpath->color[0] = 1.0f;
1424 mpath->color[1] = 0.0f;
1425 mpath->color[2] = 0.0f;
1426 mpath->line_thickness = 1;
1427 mpath->flag |= MOTIONPATH_FLAG_LINES;
1428 }
1429 }
1430 }
1431 }
1432 }
1433 }
1434
1435 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 278, 5)) {
1436 /* Mask primitive adding code was not initializing correctly id_type of its points' parent. */
1437 LISTBASE_FOREACH (Mask *, mask, &bmain->masks) {
1438 LISTBASE_FOREACH (MaskLayer *, mlayer, &mask->masklayers) {
1439 LISTBASE_FOREACH (MaskSpline *, mspline, &mlayer->splines) {
1440 int i = 0;
1441 for (MaskSplinePoint *mspoint = mspline->points; i < mspline->tot_point; mspoint++, i++)
1442 {
1443 if (mspoint->parent.id_type == 0) {
1444 BKE_mask_parent_init(&mspoint->parent);
1445 }
1446 }
1447 }
1448 }
1449 }
1450
1451 /* Fix for #50736, Glare comp node using same var for two different things. */
1452 if (!DNA_struct_member_exists(fd->filesdna, "NodeGlare", "char", "star_45")) {
1453 FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1454 if (ntree->type == NTREE_COMPOSIT) {
1456 LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
1457 if (node->type_legacy == CMP_NODE_GLARE) {
1458 NodeGlare *ndg = static_cast<NodeGlare *>(node->storage);
1459 switch (ndg->type) {
1461 ndg->streaks = ndg->angle;
1462 break;
1464 ndg->star_45 = ndg->angle != 0;
1465 break;
1466 default:
1467 break;
1468 }
1469 }
1470 }
1471 }
1472 }
1474 }
1475
1476 if (!DNA_struct_member_exists(fd->filesdna, "SurfaceDeformModifierData", "float", "mat[4][4]"))
1477 {
1478 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1479 LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1480 if (md->type == eModifierType_SurfaceDeform) {
1482 unit_m4(smd->mat);
1483 }
1484 }
1485 }
1486 }
1487
1488 FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1489 if (ntree->type == NTREE_COMPOSIT) {
1491 }
1492 }
1494 }
1495
1496 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 279, 0)) {
1497 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1498 if (scene->r.im_format.exr_codec == R_IMF_EXR_CODEC_DWAB) {
1499 scene->r.im_format.exr_codec = R_IMF_EXR_CODEC_DWAA;
1500 }
1501 }
1502
1503 /* Fix related to VGroup modifiers creating named defgroup CD layers! See #51520. */
1504 LISTBASE_FOREACH (Mesh *, me, &bmain->meshes) {
1505 CustomData_set_layer_name(&me->vert_data, CD_MDEFORMVERT, 0, "");
1506 }
1507 }
1508
1509 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 279, 3)) {
1510 if (!DNA_struct_member_exists(fd->filesdna, "FluidDomainSettings", "float", "clipping")) {
1511 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1512 LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1513 if (md->type == eModifierType_Fluid) {
1515 if (fmd->domain) {
1516 fmd->domain->clipping = 1e-3f;
1517 }
1518 }
1519 }
1520 }
1521 }
1522 }
1523
1524 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 279, 4)) {
1525 /* Fix for invalid state of screen due to bug in older versions. */
1526 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1527 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1528 if (area->full && screen->state == SCREENNORMAL) {
1529 area->full = nullptr;
1530 }
1531 }
1532 }
1533
1534 if (!DNA_struct_member_exists(fd->filesdna, "Brush", "float", "falloff_angle")) {
1535 LISTBASE_FOREACH (Brush *, br, &bmain->brushes) {
1536 br->falloff_angle = DEG2RADF(80);
1537 /* These flags are used for new features. They are not related to `falloff_angle`. */
1540 }
1541
1542 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1543 ToolSettings *ts = scene->toolsettings;
1544 for (int i = 0; i < 2; i++) {
1545 VPaint *vp = i ? ts->vpaint : ts->wpaint;
1546 if (vp != nullptr) {
1547 /* remove all other flags */
1549 }
1550 }
1551 }
1552 }
1553
1554 /* Simple deform modifier no longer assumes Z axis (X for bend type).
1555 * Must set previous defaults. */
1556 if (!DNA_struct_member_exists(fd->filesdna, "SimpleDeformModifierData", "char", "deform_axis"))
1557 {
1558 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1559 LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1560 if (md->type == eModifierType_SimpleDeform) {
1562 smd->deform_axis = 2;
1563 }
1564 }
1565 }
1566 }
1567
1568 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1569 int preset = scene->r.ffcodecdata.ffmpeg_preset;
1570 if (preset == FFM_PRESET_NONE || preset >= FFM_PRESET_GOOD) {
1571 continue;
1572 }
1573 if (preset <= FFM_PRESET_FAST) {
1574 preset = FFM_PRESET_REALTIME;
1575 }
1576 else if (preset >= FFM_PRESET_SLOW) {
1577 preset = FFM_PRESET_BEST;
1578 }
1579 else {
1580 preset = FFM_PRESET_GOOD;
1581 }
1582 scene->r.ffcodecdata.ffmpeg_preset = preset;
1583 }
1584
1585 if (!DNA_struct_member_exists(
1586 fd->filesdna, "ParticleInstanceModifierData", "float", "particle_amount"))
1587 {
1588 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1589 LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1590 if (md->type == eModifierType_ParticleInstance) {
1593 pimd->particle_amount = 1.0f;
1594 }
1595 }
1596 }
1597 }
1598 }
1599}
1600
1602{
1603 /* To be added to next subversion bump! */
1604 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 279, 0)) {
1605 FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1606 if (ntree->type == NTREE_COMPOSIT) {
1608 LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
1609 if (node->type_legacy == CMP_NODE_HUE_SAT) {
1610 do_version_hue_sat_node(ntree, node);
1611 }
1612 }
1613 }
1614 }
1616 }
1617
1618 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 279, 2)) {
1619 /* B-Bones (bbone_in/out -> bbone_easein/out) + Stepped FMod Frame Start/End fix */
1621 }
1622}
AnimData * BKE_animdata_from_id(const ID *id)
Definition anim_data.cc:83
void BKE_fcurves_main_cb(struct Main *bmain, blender::FunctionRef< void(ID *, FCurve *)> func)
void BKE_curvemap_reset(CurveMap *cuma, const rctf *clipr, int preset, CurveMapSlopeType slope)
void BKE_curvemapping_set_defaults(CurveMapping *cumap, int tot, float minx, float miny, float maxx, float maxy, short default_handle_type)
Definition colortools.cc:40
void BKE_curvemapping_init(CurveMapping *cumap)
CustomData interface, see also DNA_customdata_types.h.
bool CustomData_set_layer_name(CustomData *data, eCustomDataType type, int n, blender::StringRef name)
#define DRIVER_TARGETS_LOOPER_BEGIN(dvar)
#define DRIVER_TARGETS_LOOPER_END
MainListsArray BKE_main_lists_get(Main &bmain)
Definition main.cc:987
#define MAIN_VERSION_FILE_ATLEAST(main, ver, subver)
Definition BKE_main.hh:658
std::array< ListBase *, INDEX_ID_MAX - 1 > MainListsArray
Definition BKE_main.hh:645
void BKE_mask_parent_init(struct MaskParent *parent)
void BKE_modifier_unique_name(ListBase *modifiers, ModifierData *md)
#define FOREACH_NODETREE_END
Definition BKE_node.hh:881
#define FOREACH_NODETREE_BEGIN(bmain, _nodetree, _id)
Definition BKE_node.hh:871
#define CMP_NODE_HUE_SAT
#define CMP_NODE_GLARE
#define CMP_NODE_PLANETRACKDEFORM
#define CMP_NODE_OUTPUT_FILE
#define CMP_NODE_COMPOSITE_DEPRECATED
#define CMP_NODE_R_LAYERS
SceneRenderView * BKE_scene_add_render_view(Scene *sce, const char *name)
Definition scene.cc:2712
ARegion * BKE_area_region_new()
Definition screen.cc:387
void BKE_area_region_free(SpaceType *st, ARegion *region)
Definition screen.cc:597
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE void BLI_listbase_clear(ListBase *lb)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:270
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:111
int BLI_listbase_count(const ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:524
void BLI_insertlinkbefore(ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
Definition listbase.cc:371
MINLINE float min_ff(float a, float b)
#define M_SQRT3
#define DEG2RADF(_deg)
#define M_PI
void unit_m4(float m[4][4])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void copy_v2_fl2(float v[2], float x, float y)
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void copy_v4_fl(float r[4], float f)
char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
char * STRNCPY(char(&dst)[N], const char *src)
Definition BLI_string.h:693
size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define STRNCPY_UTF8(dst, src)
void BLI_uniquename(const struct ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_maxncpy) ATTR_NONNULL(1
char * BLI_string_replaceN(const char *__restrict str, const char *__restrict substr_old, const char *__restrict substr_new) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
#define STRPREFIX(a, b)
#define ARRAY_SIZE(arr)
#define ARRAY_SET_ITEMS(...)
#define ELEM(...)
#define STREQ(a, b)
external readfile function prototypes.
#define DATA_(msgid)
@ ID_RECALC_PSYS_RESET
Definition DNA_ID.h:1083
@ ID_FLAG_FAKEUSER
Definition DNA_ID.h:769
@ MOTIONPATH_FLAG_LINES
@ FMODIFIER_TYPE_STEPPED
@ SCULPT_BRUSH_TYPE_GRAB
@ SCULPT_BRUSH_TYPE_SNAKE_HOOK
@ BRUSH_GRAB_ACTIVE_VERTEX
@ BRUSH_ORIGINAL_PLANE
@ BRUSH_ACCUMULATE
@ BRUSH_FRONTFACE_FALLOFF
@ BRUSH_SCENE_SPACING
@ BRUSH_INVERT_TO_SCRAPE_FILL
@ CURVE_PRESET_MAX
@ CONSTRAINT_TYPE_TRANSFORM
@ CONSTRAINT_TYPE_STRETCHTO
@ TRANS_ROTATION
@ CU_BEZIER
@ HD_AUTO
@ CD_MDEFORMVERT
blenloader genfile private function prototypes
@ GP_DATA_SHOW_ONIONSKINS
@ IMA_SHOW_STEREO
@ LA_LOCAL
@ LS_INTEGRATION_MEAN
@ LS_NO_SORTING
@ LS_SORT_KEY_DISTANCE_FROM_CAMERA
@ eModifierType_ParticleSystem
@ eModifierType_Boolean
@ eModifierType_SimpleDeform
@ eModifierType_NormalEdit
@ eModifierType_Cloth
@ eModifierType_Fluid
@ eModifierType_Hook
@ eModifierType_SurfaceDeform
@ eModifierType_ParticleInstance
@ eModifierType_Bevel
@ eModifierType_Decimate
@ MOD_BEVEL_AMT_OFFSET
@ eHook_Falloff_InvSquare
@ eParticleInstanceSpace_World
@ NTREE_COMPOSIT
@ SOCK_IN
@ SOCK_FLOAT
@ CMP_NODE_GLARE_STREAKS
@ CMP_NODE_GLARE_SIMPLE_STAR
@ OB_MODE_SCULPT
Object is a sort of wrapper for general info.
@ PART_CHILD_USE_CLUMP_CURVE
@ PART_CHILD_USE_ROUGH_CURVE
@ PTCACHE_BAKED
Types and defines for representing Rigid Body entities.
@ R_IMF_EXR_CODEC_DWAB
@ R_IMF_EXR_CODEC_DWAA
#define STEREO_LEFT_NAME
@ FFM_PRESET_GOOD
@ FFM_PRESET_REALTIME
@ FFM_PRESET_NONE
@ FFM_PRESET_BEST
@ R_BAKE_POSY
@ R_BAKE_POSZ
@ R_BAKE_POSX
@ R_BAKE_SPACE_TANGENT
@ R_IMF_PLANES_RGBA
@ VP_FLAG_VGROUP_RESTRICT
@ FFM_CRF_NONE
@ R_IMF_CHAN_DEPTH_8
@ R_BAKE_CLEAR
@ GP_PROJECT_VIEWSPACE
#define STEREO_LEFT_SUFFIX
#define STEREO_RIGHT_NAME
#define STEREO_RIGHT_SUFFIX
#define R_BAKE_PASS_FILTER_ALL
@ CURVE_PAINT_FLAG_CORNERS_DETECT
@ STEREO_3D_ID
@ R_IMF_IMTYPE_PNG
@ RGN_ALIGN_RIGHT
@ RGN_ALIGN_NONE
@ SCREENNORMAL
@ RGN_TYPE_CHANNELS
@ RGN_TYPE_UI
@ RGN_TYPE_WINDOW
@ RGN_TYPE_PREVIEW
@ RGN_FLAG_HIDDEN
@ SEQ_STORAGE_PROXY_CUSTOM_FILE
@ SEQ_STORAGE_PROXY_CUSTOM_DIR
@ STRIP_TYPE_TEXT
@ SPACE_CLIP
@ SPACE_ACTION
@ SPACE_FILE
@ SPACE_SEQ
@ SPACE_IMAGE
@ SPACE_VIEW3D
@ SEQ_VIEW_SEQUENCE
@ SC_MODE_TRACKING
@ SC_MODE_MASKEDIT
@ MTEX_ANGLE_RANDOM
@ MTEX_ANGLE_RAKE
@ TRACK_USE_2D_STAB_ROT
@ TRACKING_SHOW_STAB_TRACKS
@ TRACKING_OBJECT_CAMERA
@ V2D_LIMITZOOM
@ RV3D_VIEW_USER
@ V3D_S3D_DISPPLANE
Read Guarded memory(de)allocation.
@ PROP_FACTOR
Definition RNA_types.hh:251
#define MAX_MTEX
Definition Stroke.h:31
#define U
BMesh const char void * data
nullptr float
#define offsetof(t, d)
#define printf(...)
bool enabled
void * MEM_mallocN(size_t len, const char *str)
Definition mallocn.cc:128
void * MEM_callocN(size_t len, const char *str)
Definition mallocn.cc:118
void MEM_freeN(void *vmemh)
Definition mallocn.cc:113
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
bNodeSocket * node_find_socket(bNode &node, eNodeSocketInOut in_out, StringRef identifier)
Definition node.cc:2532
void node_tree_set_type(bNodeTree &ntree)
Definition node.cc:2254
bNodeSocket * node_add_static_socket(bNodeTree &ntree, bNode &node, eNodeSocketInOut in_out, int type, int subtype, StringRefNull identifier, StringRefNull name)
Definition node.cc:3197
bNodeTree * node_tree_from_id(ID *id)
Definition node.cc:4568
void foreach_strip(ListBase *seqbase, ForEachFunc callback, void *user_data)
Definition iterator.cc:59
EffectHandle strip_effect_handle_get(Strip *strip)
Definition effects.cc:290
const char * node_cmp_rlayers_sock_to_pass(int sock_index)
void node_verify_sockets(bNodeTree *ntree, bNode *node, bool do_id_user)
const char * name
bAction * action
struct ClothSimSettings * sim_parms
CurveMap cm[4]
char * rna_path
ChannelDriver * driver
ListBase modifiers
SDNA * filesdna
Definition readfile.hh:105
unsigned short thumbnail_size
struct FluidDomainSettings * domain
Definition DNA_ID.h:414
short flag
Definition DNA_ID.h:438
struct PackedFile * packedfile
char filepath[1024]
void * first
float kinkampfac
ListBase brushes
Definition BKE_main.hh:302
ListBase masks
Definition BKE_main.hh:312
ListBase scenes
Definition BKE_main.hh:278
ListBase wm
Definition BKE_main.hh:307
ListBase meshes
Definition BKE_main.hh:281
ListBase movieclips
Definition BKE_main.hh:311
ListBase lights
Definition BKE_main.hh:288
ListBase particles
Definition BKE_main.hh:303
ListBase materials
Definition BKE_main.hh:284
ListBase linestyles
Definition BKE_main.hh:313
ListBase cameras
Definition BKE_main.hh:289
ListBase armatures
Definition BKE_main.hh:299
ListBase screens
Definition BKE_main.hh:292
ListBase images
Definition BKE_main.hh:286
ListBase gpencils
Definition BKE_main.hh:309
ListBase objects
Definition BKE_main.hh:280
MovieTrackingTrack * rot_track_legacy
ParticleBrushData brush[7]
struct ParticleSystem * psys
struct ClothModifierData * clmd
float constant_detail
FileSelectParams * params
struct ImageUser iuser
StripProxy * proxy
struct Stereo3dFormat * stereo3d_format
StripData * data
void * effectdata
struct ParticleEditSettings particle
char stereo3d_camera
float stereo3d_volume_alpha
short stereo3d_flag
float stereo3d_convergence_alpha
ListBase curves
void * default_value
ListBase nodes
char name[64]
void * storage
ListBase outputs
void(* init)(Strip *strip)
i
Definition text_draw.cc:230
#define STRIP_USE_PROXY_CUSTOM_DIR
#define STRIP_USE_PROXY_CUSTOM_FILE
static void do_version_hue_sat_node(bNodeTree *ntree, bNode *node)
static void do_version_bones_super_bbone(ListBase *lb)
static bool strip_update_proxy_cb(Strip *strip, void *)
#define LA_YF_PHOTON
#define BRUSH_RAKE
static void do_version_action_editor_properties_region(ListBase *regionbase)
static void do_version_bbone_easing_fcurve_fix(ID *, FCurve *fcu)
void blo_do_versions_270(FileData *fd, Library *, Main *bmain)
#define BRUSH_TORUS
#define RV3D_VIEW_PERSPORTHO
static bGPDpalette * BKE_gpencil_palette_addnew(bGPdata *gpd, const char *name)
void do_versions_after_linking_270(Main *bmain)
static bGPDpalettecolor * BKE_gpencil_palettecolor_addnew(bGPDpalette *palette, const char *name)
static void do_versions_compositor_render_passes_storage(bNode *node)
#define BRUSH_RANDOM_ROTATION
static void do_version_constraints_radians_degrees_270_1(ListBase *lb)
static void do_version_constraints_stretch_to_limits(ListBase *lb)
static char * replace_bbone_easing_rnapath(char *old_path)
static void do_version_constraints_radians_degrees_270_5(ListBase *lb)
static void anim_change_prop_name(FCurve *fcu, const char *prefix, const char *old_prop_name, const char *new_prop_name)
static void migrate_single_rot_stabilization_track_settings(MovieTrackingStabilization *stab)
static void do_versions_compositor_render_passes(bNodeTree *ntree)
static bool strip_update_effectdata_cb(Strip *strip, void *)