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