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