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