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