Blender  V3.3
versioning_250.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #ifndef WIN32
8 # include <unistd.h> /* for read close */
9 #else
10 # include "BLI_winstuff.h"
11 # include "winsock2.h"
12 # include <io.h> /* for open close read */
13 #endif
14 
15 /* allow readfile to use deprecated functionality */
16 #define DNA_DEPRECATED_ALLOW
17 
18 #include "DNA_anim_types.h"
19 #include "DNA_armature_types.h"
20 #include "DNA_brush_types.h"
21 #include "DNA_camera_types.h"
22 #include "DNA_cloth_types.h"
23 #include "DNA_constraint_types.h"
24 #include "DNA_fluid_types.h"
25 #include "DNA_ipo_types.h"
26 #include "DNA_key_types.h"
27 #include "DNA_lattice_types.h"
28 #include "DNA_light_types.h"
29 #include "DNA_material_types.h"
30 #include "DNA_mesh_types.h"
31 #include "DNA_meshdata_types.h"
32 #include "DNA_node_types.h"
34 #include "DNA_object_force_types.h"
35 #include "DNA_object_types.h"
36 #include "DNA_screen_types.h"
37 #include "DNA_sdna_types.h"
38 #include "DNA_sequence_types.h"
39 #include "DNA_sound_types.h"
40 #include "DNA_space_types.h"
41 #include "DNA_view3d_types.h"
42 #include "DNA_world_types.h"
43 
44 #include "MEM_guardedalloc.h"
45 
46 #include "BLI_blenlib.h"
47 #include "BLI_math.h"
48 #include "BLI_utildefines.h"
49 
50 #include "BKE_anim_data.h"
51 #include "BKE_anim_visualization.h"
52 #include "BKE_armature.h"
53 #include "BKE_colortools.h"
54 #include "BKE_global.h" /* for G */
55 #include "BKE_lib_id.h"
56 #include "BKE_main.h"
57 #include "BKE_modifier.h"
58 #include "BKE_multires.h"
59 #include "BKE_node_tree_update.h"
60 #include "BKE_particle.h"
61 #include "BKE_pointcache.h"
62 #include "BKE_screen.h"
63 #include "BKE_sound.h"
64 #include "BKE_texture.h"
65 
66 #include "SEQ_iterator.h"
67 
68 #include "NOD_socket.h"
69 
70 #include "BLO_readfile.h"
71 
72 #include "readfile.h"
73 
74 #include <errno.h>
75 
76 /* Make preferences read-only, use versioning_userdef.c. */
77 #define U (*((const UserDef *)&U))
78 
79 /* 2.50 patch */
81 {
82  ARegion *region = MEM_callocN(sizeof(ARegion), "area region from do_versions");
83 
84  BLI_addtail(lb, region);
85  region->regiontype = RGN_TYPE_HEADER;
86  if (area->headertype == 1) {
87  region->alignment = RGN_ALIGN_BOTTOM;
88  }
89  else {
90  region->alignment = RGN_ALIGN_TOP;
91  }
92 
93  /* initialize view2d data for header region, to allow panning */
94  /* is copy from ui_view2d.c */
96  region->v2d.keepofs = V2D_LOCKOFS_Y;
97  region->v2d.keeptot = V2D_KEEPTOT_STRICT;
99  region->v2d.flag = (V2D_PIXELOFS_X | V2D_PIXELOFS_Y);
100 }
101 
103 {
104  /* XXX a bit ugly still, copied from space_sequencer */
105  /* NOTE: if you change values here, also change them in space_sequencer.c, sequencer_new */
106  region->regiontype = RGN_TYPE_PREVIEW;
107  region->alignment = RGN_ALIGN_TOP;
108  region->flag |= RGN_FLAG_HIDDEN;
110  region->v2d.minzoom = 0.00001f;
111  region->v2d.maxzoom = 100000.0f;
112  region->v2d.tot.xmin = -960.0f; /* 1920 width centered */
113  region->v2d.tot.ymin = -540.0f; /* 1080 height centered */
114  region->v2d.tot.xmax = 960.0f;
115  region->v2d.tot.ymax = 540.0f;
116  region->v2d.min[0] = 0.0f;
117  region->v2d.min[1] = 0.0f;
118  region->v2d.max[0] = 12000.0f;
119  region->v2d.max[1] = 12000.0f;
120  region->v2d.cur = region->v2d.tot;
121  region->v2d.align = V2D_ALIGN_FREE; /* `(V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y)` */
122  region->v2d.keeptot = V2D_KEEPTOT_FREE;
123 }
124 
126 {
127  ARegion *region;
128  ARegion *region_main;
129 
130  if (sl) {
131  /* first channels for ipo action nla... */
132  switch (sl->spacetype) {
133  case SPACE_GRAPH:
134  region = MEM_callocN(sizeof(ARegion), "area region from do_versions");
135  BLI_addtail(lb, region);
136  region->regiontype = RGN_TYPE_CHANNELS;
137  region->alignment = RGN_ALIGN_LEFT;
139 
140  /* for some reason, this doesn't seem to go auto like for NLA... */
141  region = MEM_callocN(sizeof(ARegion), "area region from do_versions");
142  BLI_addtail(lb, region);
143  region->regiontype = RGN_TYPE_UI;
144  region->alignment = RGN_ALIGN_RIGHT;
145  region->v2d.scroll = V2D_SCROLL_RIGHT;
146  region->v2d.flag = RGN_FLAG_HIDDEN;
147  break;
148 
149  case SPACE_ACTION:
150  region = MEM_callocN(sizeof(ARegion), "area region from do_versions");
151  BLI_addtail(lb, region);
152  region->regiontype = RGN_TYPE_CHANNELS;
153  region->alignment = RGN_ALIGN_LEFT;
154  region->v2d.scroll = V2D_SCROLL_BOTTOM;
156  break;
157 
158  case SPACE_NLA:
159  region = MEM_callocN(sizeof(ARegion), "area region from do_versions");
160  BLI_addtail(lb, region);
161  region->regiontype = RGN_TYPE_CHANNELS;
162  region->alignment = RGN_ALIGN_LEFT;
163  region->v2d.scroll = V2D_SCROLL_BOTTOM;
165 
166  /* for some reason, some files still don't get this auto */
167  region = MEM_callocN(sizeof(ARegion), "area region from do_versions");
168  BLI_addtail(lb, region);
169  region->regiontype = RGN_TYPE_UI;
170  region->alignment = RGN_ALIGN_RIGHT;
171  region->v2d.scroll = V2D_SCROLL_RIGHT;
172  region->v2d.flag = RGN_FLAG_HIDDEN;
173  break;
174 
175  case SPACE_NODE:
176  region = MEM_callocN(sizeof(ARegion), "nodetree area for node");
177  BLI_addtail(lb, region);
178  region->regiontype = RGN_TYPE_UI;
179  region->alignment = RGN_ALIGN_LEFT;
182  /* temporarily hide it */
183  region->flag = RGN_FLAG_HIDDEN;
184  break;
185  case SPACE_FILE:
186  region = MEM_callocN(sizeof(ARegion), "nodetree area for node");
187  BLI_addtail(lb, region);
188  region->regiontype = RGN_TYPE_CHANNELS;
189  region->alignment = RGN_ALIGN_LEFT;
190 
191  region = MEM_callocN(sizeof(ARegion), "ui area for file");
192  BLI_addtail(lb, region);
193  region->regiontype = RGN_TYPE_UI;
194  region->alignment = RGN_ALIGN_TOP;
195  break;
196  case SPACE_SEQ:
197  region_main = (ARegion *)lb->first;
198  for (; region_main; region_main = region_main->next) {
199  if (region_main->regiontype == RGN_TYPE_WINDOW) {
200  break;
201  }
202  }
203  region = MEM_callocN(sizeof(ARegion), "preview area for sequencer");
204  BLI_insertlinkbefore(lb, region_main, region);
206  break;
207  case SPACE_VIEW3D:
208  /* toolbar */
209  region = MEM_callocN(sizeof(ARegion), "toolbar for view3d");
210 
211  BLI_addtail(lb, region);
212  region->regiontype = RGN_TYPE_TOOLS;
213  region->alignment = RGN_ALIGN_LEFT;
214  region->flag = RGN_FLAG_HIDDEN;
215 
216  /* tool properties */
217  region = MEM_callocN(sizeof(ARegion), "tool properties for view3d");
218 
219  BLI_addtail(lb, region);
222  region->flag = RGN_FLAG_HIDDEN;
223 
224  /* buttons/list view */
225  region = MEM_callocN(sizeof(ARegion), "buttons for view3d");
226 
227  BLI_addtail(lb, region);
228  region->regiontype = RGN_TYPE_UI;
229  region->alignment = RGN_ALIGN_RIGHT;
230  region->flag = RGN_FLAG_HIDDEN;
231 #if 0
232  case SPACE_PROPERTIES:
233  /* context UI region */
234  region = MEM_callocN(sizeof(ARegion), "area region from do_versions");
235  BLI_addtail(lb, region);
236  region->regiontype = RGN_TYPE_UI;
237  region->alignment = RGN_ALIGN_RIGHT;
238 
239  break;
240 #endif
241  }
242  }
243 
244  /* main region */
245  region = MEM_callocN(sizeof(ARegion), "area region from do_versions");
246 
247  BLI_addtail(lb, region);
248  region->winrct = area->totrct;
249 
250  region->regiontype = RGN_TYPE_WINDOW;
251 
252  if (sl) {
253  /* if active spacetype has view2d data, copy that over to main region */
254  /* and we split view3d */
255  switch (sl->spacetype) {
256  case SPACE_VIEW3D:
258  break;
259 
260  case SPACE_OUTLINER: {
261  SpaceOutliner *space_outliner = (SpaceOutliner *)sl;
262 
263  memcpy(&region->v2d, &space_outliner->v2d, sizeof(View2D));
264 
265  region->v2d.scroll &= ~V2D_SCROLL_LEFT;
269  region->v2d.keeptot = V2D_KEEPTOT_STRICT;
270  region->v2d.minzoom = region->v2d.maxzoom = 1.0f;
271  // region->v2d.flag |= V2D_IS_INIT;
272  break;
273  }
274  case SPACE_GRAPH: {
275  SpaceGraph *sipo = (SpaceGraph *)sl;
276  memcpy(&region->v2d, &sipo->v2d, sizeof(View2D));
277 
278  /* init mainarea view2d */
281 
282  region->v2d.min[0] = FLT_MIN;
283  region->v2d.min[1] = FLT_MIN;
284 
285  region->v2d.max[0] = MAXFRAMEF;
286  region->v2d.max[1] = FLT_MAX;
287 
288  // region->v2d.flag |= V2D_IS_INIT;
289  break;
290  }
291  case SPACE_NLA: {
292  SpaceNla *snla = (SpaceNla *)sl;
293  memcpy(&region->v2d, &snla->v2d, sizeof(View2D));
294 
295  region->v2d.tot.ymin = (float)(-area->winy) / 3.0f;
296  region->v2d.tot.ymax = 0.0f;
297 
299  region->v2d.scroll |= V2D_SCROLL_RIGHT;
300  region->v2d.align = V2D_ALIGN_NO_POS_Y;
302  break;
303  }
304  case SPACE_ACTION: {
305  SpaceAction *saction = (SpaceAction *)sl;
306 
307  /* We totally reinit the view for the Action Editor,
308  * as some old instances had some weird cruft set. */
309  region->v2d.tot.xmin = -20.0f;
310  region->v2d.tot.ymin = (float)(-area->winy) / 3.0f;
311  region->v2d.tot.xmax = (float)((area->winx > 120) ? (area->winx) : 120);
312  region->v2d.tot.ymax = 0.0f;
313 
314  region->v2d.cur = region->v2d.tot;
315 
316  region->v2d.min[0] = 0.0f;
317  region->v2d.min[1] = 0.0f;
318 
319  region->v2d.max[0] = MAXFRAMEF;
320  region->v2d.max[1] = FLT_MAX;
321 
322  region->v2d.minzoom = 0.01f;
323  region->v2d.maxzoom = 50;
325  region->v2d.scroll |= V2D_SCROLL_RIGHT;
326  region->v2d.keepzoom = V2D_LOCKZOOM_Y;
327  region->v2d.align = V2D_ALIGN_NO_POS_Y;
329 
330  /* for old files with ShapeKey editors open + an action set, clear the action as
331  * it doesn't make sense in the new system (i.e. violates concept that ShapeKey edit
332  * only shows ShapeKey-rooted actions only)
333  */
334  if (saction->mode == SACTCONT_SHAPEKEY) {
335  saction->action = NULL;
336  }
337  break;
338  }
339  case SPACE_SEQ: {
340  SpaceSeq *sseq = (SpaceSeq *)sl;
341  memcpy(&region->v2d, &sseq->v2d, sizeof(View2D));
342 
345  region->v2d.align = V2D_ALIGN_NO_NEG_Y;
346  region->v2d.flag |= V2D_IS_INIT;
347  break;
348  }
349  case SPACE_NODE: {
350  SpaceNode *snode = (SpaceNode *)sl;
351  memcpy(&region->v2d, &snode->v2d, sizeof(View2D));
352 
355  break;
356  }
357  case SPACE_PROPERTIES: {
358  SpaceProperties *sbuts = (SpaceProperties *)sl;
359  memcpy(&region->v2d, &sbuts->v2d, sizeof(View2D));
360 
362  break;
363  }
364  case SPACE_FILE: {
365  // SpaceFile *sfile = (SpaceFile *)sl;
366  region->v2d.tot.xmin = region->v2d.tot.ymin = 0;
367  region->v2d.tot.xmax = region->winx;
368  region->v2d.tot.ymax = region->winy;
369  region->v2d.cur = region->v2d.tot;
370  region->regiontype = RGN_TYPE_WINDOW;
374  break;
375  }
376  case SPACE_TEXT: {
377  SpaceText *st = (SpaceText *)sl;
378  st->flags |= ST_FIND_WRAP;
379  }
380  // case SPACE_XXX: // FIXME... add other ones
381  // memcpy(&region->v2d, &((SpaceXxx *)sl)->v2d, sizeof(View2D));
382  // break;
383  }
384  }
385 }
386 
388 {
389  ScrArea *area;
390  SpaceLink *sl;
391 
392  /* add regions */
393  for (area = screen->areabase.first; area; area = area->next) {
394  /* we keep headertype variable to convert old files only */
395  if (area->headertype) {
396  area_add_header_region(area, &area->regionbase);
397  }
398 
399  area_add_window_regions(area, area->spacedata.first, &area->regionbase);
400 
401  /* Space image-select is deprecated. */
402  for (sl = area->spacedata.first; sl; sl = sl->next) {
403  if (sl->spacetype == SPACE_IMASEL) {
404  sl->spacetype = SPACE_EMPTY; /* spacedata then matches */
405  }
406  }
407 
408  /* space sound is deprecated */
409  for (sl = area->spacedata.first; sl; sl = sl->next) {
410  if (sl->spacetype == SPACE_SOUND) {
411  sl->spacetype = SPACE_EMPTY; /* spacedata then matches */
412  }
413  }
414 
415  /* pushed back spaces also need regions! */
416  if (area->spacedata.first) {
417  sl = area->spacedata.first;
418  for (sl = sl->next; sl; sl = sl->next) {
419  if (area->headertype) {
421  }
423  }
424  }
425  }
426 }
427 
428 static void versions_gpencil_add_main(Main *bmain, ListBase *lb, ID *id, const char *name)
429 {
430  BLI_addtail(lb, id);
431  id->us = 1;
432  id->flag = LIB_FAKEUSER;
433  *((short *)id->name) = ID_GD;
434 
435  BKE_id_new_name_validate(bmain, lb, id, name, false);
436  /* alphabetic insertion: is in BKE_id_new_name_validate */
437 
438  if ((id->tag & LIB_TAG_TEMP_MAIN) == 0) {
440  }
441 
442  if (G.debug & G_DEBUG) {
443  printf("Converted GPencil to ID: %s\n", id->name + 2);
444  }
445 }
446 
448 {
449  ScrArea *area;
450  SpaceLink *sl;
451 
452  /* add regions */
453  for (area = screen->areabase.first; area; area = area->next) {
454  for (sl = area->spacedata.first; sl; sl = sl->next) {
455  if (sl->spacetype == SPACE_VIEW3D) {
456  View3D *v3d = (View3D *)sl;
457  if (v3d->gpd) {
458  versions_gpencil_add_main(main, &main->gpencils, (ID *)v3d->gpd, "GPencil View3D");
459  v3d->gpd = NULL;
460  }
461  }
462  else if (sl->spacetype == SPACE_NODE) {
463  SpaceNode *snode = (SpaceNode *)sl;
464  if (snode->gpd) {
465  versions_gpencil_add_main(main, &main->gpencils, (ID *)snode->gpd, "GPencil Node");
466  snode->gpd = NULL;
467  }
468  }
469  else if (sl->spacetype == SPACE_SEQ) {
470  SpaceSeq *sseq = (SpaceSeq *)sl;
471  if (sseq->gpd) {
472  versions_gpencil_add_main(main, &main->gpencils, (ID *)sseq->gpd, "GPencil Node");
473  sseq->gpd = NULL;
474  }
475  }
476  else if (sl->spacetype == SPACE_IMAGE) {
477  SpaceImage *sima = (SpaceImage *)sl;
478 #if 0 /* see comment on r28002 */
479  if (sima->gpd) {
480  versions_gpencil_add_main(main, &main->gpencil, (ID *)sima->gpd, "GPencil Image");
481  sima->gpd = NULL;
482  }
483 #else
484  sima->gpd = NULL;
485 #endif
486  }
487  }
488  }
489 }
490 
492 {
493  Object *ob;
494  ModifierData *md;
496 
497  for (ob = main->objects.first; ob; ob = ob->id.next) {
498  for (md = ob->modifiers.first; md; md = md->next) {
499  if (md->type == eModifierType_MeshDeform) {
500  mmd = (MeshDeformModifierData *)md;
501 
502  if (mmd->bindcos) {
503  /* make bindcos NULL in order to trick older versions
504  * into thinking that the mesh was not bound yet */
505  mmd->bindcagecos = mmd->bindcos;
506  mmd->bindcos = NULL;
507 
509  }
510  }
511  }
512  }
513 }
514 
516 {
517  bConstraint *con;
518 
519  for (con = lb->first; con; con = con->next) {
520  if (con->type == CONSTRAINT_TYPE_KINEMATIC) {
522  data->poleangle *= (float)(M_PI / 180.0);
523  }
524  else if (con->type == CONSTRAINT_TYPE_ROTLIMIT) {
525  bRotLimitConstraint *data = con->data;
526 
527  data->xmin *= (float)(M_PI / 180.0);
528  data->xmax *= (float)(M_PI / 180.0);
529  data->ymin *= (float)(M_PI / 180.0);
530  data->ymax *= (float)(M_PI / 180.0);
531  data->zmin *= (float)(M_PI / 180.0);
532  data->zmax *= (float)(M_PI / 180.0);
533  }
534  }
535 }
536 
537 static void do_version_bone_roll_256(Bone *bone)
538 {
539  Bone *child;
540  float submat[3][3];
541 
542  copy_m3_m4(submat, bone->arm_mat);
543  mat3_to_vec_roll(submat, NULL, &bone->arm_roll);
544 
545  for (child = bone->childbase.first; child; child = child->next) {
547  }
548 }
549 
550 /* deprecated, only keep this for readfile.c */
551 /* XXX Deprecated function to add a socket in ntree->inputs/ntree->outputs list
552  * (previously called node_group_add_socket). This function has been superseded
553  * by the implementation of proxy nodes. It is still necessary though
554  * for do_versions of pre-2.56.2 code (r35033), so later proxy nodes
555  * can be generated consistently from ntree socket lists.
556  */
558  const char *name,
559  int type,
560  int in_out)
561 {
562  // bNodeSocketType *stype = ntreeGetSocketType(type);
563  bNodeSocket *gsock = MEM_callocN(sizeof(bNodeSocket), "bNodeSocket");
564 
565  BLI_strncpy(gsock->name, name, sizeof(gsock->name));
566  gsock->type = type;
567 
568  gsock->next = gsock->prev = NULL;
569  gsock->link = NULL;
570  /* assign new unique index */
571  gsock->own_index = ngroup->cur_index++;
572  gsock->limit = (in_out == SOCK_IN ? 0xFFF : 1);
573 
574  // if (stype->value_structsize > 0)
575  // gsock->default_value = MEM_callocN(stype->value_structsize, "default socket value");
576 
577  BLI_addtail(in_out == SOCK_IN ? &ngroup->inputs : &ngroup->outputs, gsock);
578 
580 
581  return gsock;
582 }
583 
584 /* Create default_value structs for node sockets from the internal bNodeStack value.
585  * These structs were used from 2.59.2 on, but are replaced in the subsequent do_versions for
586  * custom nodes by generic ID property values. This conversion happened _after_ do_versions
587  * originally due to messy type initialization for node sockets.
588  * Now created here intermediately for convenience and to keep do_versions consistent.
589  *
590  * Node compatibility code is gross ...
591  */
593 {
594  bNodeSocketValueFloat *valfloat;
595  bNodeSocketValueVector *valvector;
596  bNodeSocketValueRGBA *valrgba;
597 
598  if (sock->default_value) {
599  return;
600  }
601 
602  switch (sock->type) {
603  case SOCK_FLOAT:
604  valfloat = sock->default_value = MEM_callocN(sizeof(bNodeSocketValueFloat),
605  "default socket value");
606  valfloat->value = sock->ns.vec[0];
607  valfloat->min = sock->ns.min;
608  valfloat->max = sock->ns.max;
609  valfloat->subtype = PROP_NONE;
610  break;
611  case SOCK_VECTOR:
612  valvector = sock->default_value = MEM_callocN(sizeof(bNodeSocketValueVector),
613  "default socket value");
614  copy_v3_v3(valvector->value, sock->ns.vec);
615  valvector->min = sock->ns.min;
616  valvector->max = sock->ns.max;
617  valvector->subtype = PROP_NONE;
618  break;
619  case SOCK_RGBA:
620  valrgba = sock->default_value = MEM_callocN(sizeof(bNodeSocketValueRGBA),
621  "default socket value");
622  copy_v4_v4(valrgba->value, sock->ns.vec);
623  break;
624  }
625 }
626 
628 {
629  Main *bmain = (Main *)user_data;
630  if (seq->type == SEQ_TYPE_SOUND_HD) {
631  char str[FILE_MAX];
632  BLI_join_dirfile(str, sizeof(str), seq->strip->dir, seq->strip->stripdata->name);
634  seq->sound = BKE_sound_new_file(bmain, str);
635  }
636 #define SEQ_USE_PROXY_CUSTOM_DIR (1 << 19)
637 #define SEQ_USE_PROXY_CUSTOM_FILE (1 << 21)
638  /* don't know, if anybody used that this way, but just in case, upgrade to new way... */
639  if ((seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) && !(seq->flag & SEQ_USE_PROXY_CUSTOM_DIR)) {
640  BLI_snprintf(seq->strip->proxy->dir, FILE_MAXDIR, "%s/BL_proxy", seq->strip->dir);
641  }
642 #undef SEQ_USE_PROXY_CUSTOM_DIR
643 #undef SEQ_USE_PROXY_CUSTOM_FILE
644  return true;
645 }
646 
647 static bool seq_set_volume_cb(Sequence *seq, void *UNUSED(user_data))
648 {
649  seq->volume = 1.0f;
650  return true;
651 }
652 
653 static bool seq_set_sat_cb(Sequence *seq, void *UNUSED(user_data))
654 {
655  if (seq->sat == 0.0f) {
656  seq->sat = 1.0f;
657  }
658  return true;
659 }
660 
661 static bool seq_set_pitch_cb(Sequence *seq, void *UNUSED(user_data))
662 {
663  seq->pitch = 1.0f;
664  return true;
665 }
666 
667 /* NOLINTNEXTLINE: readability-function-size */
669 {
670  /* WATCH IT!!!: pointers from libdata have not been converted */
671 
672  if (bmain->versionfile < 250) {
673  bScreen *screen;
674  Scene *scene;
675  Base *base;
676  Material *ma;
677  Camera *cam;
678  Curve *cu;
679  Scene *sce;
680  Tex *tx;
681  ParticleSettings *part;
682  Object *ob;
683 #if 0
684  PTCacheID *pid;
685  ListBase pidlist;
686 #endif
687 
688  bSound *sound;
689 
690  for (sound = bmain->sounds.first; sound; sound = sound->id.next) {
691  if (sound->newpackedfile) {
692  sound->packedfile = sound->newpackedfile;
693  sound->newpackedfile = NULL;
694  }
695  }
696 
697  for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
698  if (scene->ed && scene->ed->seqbasep) {
700  }
701  }
702 
703  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
705  do_versions_gpencil_2_50(bmain, screen);
706  }
707 
708  /* shader, composite and texture node trees have id.name empty, put something in
709  * to have them show in RNA viewer and accessible otherwise.
710  */
711  for (ma = bmain->materials.first; ma; ma = ma->id.next) {
712  if (ma->nodetree && ma->nodetree->id.name[0] == '\0') {
713  strcpy(ma->nodetree->id.name, "NTShader Nodetree");
714  }
715  }
716 
717  /* and composite trees */
718  for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
719  enum { R_PANORAMA = (1 << 10) };
720  if (sce->nodetree && sce->nodetree->id.name[0] == '\0') {
721  strcpy(sce->nodetree->id.name, "NTCompositing Nodetree");
722  }
723 
724  /* move to cameras */
725  if (sce->r.mode & R_PANORAMA) {
726  for (base = sce->base.first; base; base = base->next) {
727  ob = blo_do_versions_newlibadr(fd, lib, base->object);
728 
729  if (ob->type == OB_CAMERA && !ob->id.lib) {
730  cam = blo_do_versions_newlibadr(fd, lib, ob->data);
731  cam->flag |= CAM_PANORAMA;
732  }
733  }
734 
735  sce->r.mode &= ~R_PANORAMA;
736  }
737  }
738 
739  /* and texture trees */
740  for (tx = bmain->textures.first; tx; tx = tx->id.next) {
741  bNode *node;
742 
743  if (tx->nodetree) {
744  if (tx->nodetree->id.name[0] == '\0') {
745  strcpy(tx->nodetree->id.name, "NTTexture Nodetree");
746  }
747 
748  /* which_output 0 is now "not specified" */
749  for (node = tx->nodetree->nodes.first; node; node = node->next) {
750  if (node->type == TEX_NODE_OUTPUT) {
751  node->custom1++;
752  }
753  }
754  }
755  }
756 
757  /* particle draw and render types */
758  for (part = bmain->particles.first; part; part = part->id.next) {
759  if (part->draw_as) {
760  if (part->draw_as == PART_DRAW_DOT) {
761  part->ren_as = PART_DRAW_HALO;
762  part->draw_as = PART_DRAW_REND;
763  }
764  else if (part->draw_as <= PART_DRAW_AXIS) {
765  part->ren_as = PART_DRAW_HALO;
766  }
767  else {
768  part->ren_as = part->draw_as;
769  part->draw_as = PART_DRAW_REND;
770  }
771  }
772  part->path_end = 1.0f;
773  part->clength = 1.0f;
774  }
775 
776  /* set old pointcaches to have disk cache flag */
777  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
778 
779 #if 0
780  BKE_ptcache_ids_from_object(&pidlist, ob);
781 
782  for (pid = pidlist.first; pid; pid = pid->next) {
783  pid->cache->flag |= PTCACHE_DISK_CACHE;
784  }
785 
786  BLI_freelistN(&pidlist);
787 #endif
788  }
789 
790  /* type was a mixed flag & enum. move the 2d flag elsewhere */
791  for (cu = bmain->curves.first; cu; cu = cu->id.next) {
792  Nurb *nu;
793 
794  for (nu = cu->nurb.first; nu; nu = nu->next) {
795  nu->type &= CU_TYPE;
796  }
797  }
798  }
799 
800  if (!MAIN_VERSION_ATLEAST(bmain, 250, 1)) {
801  Object *ob;
802  Tex *tex;
803  Scene *sce;
804  ToolSettings *ts;
805 #if 0
806  PTCacheID *pid;
807  ListBase pidlist;
808 #endif
809 
810  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
811 #if 0
812  BKE_ptcache_ids_from_object(&pidlist, ob);
813 
814  for (pid = pidlist.first; pid; pid = pid->next) {
815  if (BLI_listbase_is_empty(pid->ptcaches)) {
816  pid->ptcaches->first = pid->ptcaches->last = pid->cache;
817  }
818  }
819 
820  BLI_freelistN(&pidlist);
821 #endif
822 
823  if (ob->totcol && ob->matbits == NULL) {
824  int a;
825 
826  ob->matbits = MEM_calloc_arrayN(ob->totcol, sizeof(char), "ob->matbits");
827  for (a = 0; a < ob->totcol; a++) {
828  ob->matbits[a] = (ob->colbits & (1 << a)) != 0;
829  }
830  }
831  }
832 
833  /* texture filter */
834  for (tex = bmain->textures.first; tex; tex = tex->id.next) {
835  if (tex->afmax == 0) {
836  tex->afmax = 8;
837  }
838  }
839 
840  for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
841  ts = sce->toolsettings;
842  if (!ts->uv_selectmode || ts->vgroup_weight == 0.0f) {
844 
845  /* The auto-keying setting should be taken from the user-preferences
846  * but the user-preferences version may not have correct flags set
847  * (i.e. will result in blank box when enabled). */
848  ts->autokey_mode = U.autokey_mode;
849  if (ts->autokey_mode == 0) {
850  ts->autokey_mode = 2; /* 'add/replace' but not on */
851  }
853  ts->vgroup_weight = 1.0f;
854  }
855  }
856  }
857 
858  if (!MAIN_VERSION_ATLEAST(bmain, 250, 2)) {
859  Object *ob;
860 
861  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
862  if (ob->flag & 8192) { /* OB_POSEMODE = 8192. */
863  ob->mode |= OB_MODE_POSE;
864  }
865  }
866  }
867 
868  if (!MAIN_VERSION_ATLEAST(bmain, 250, 4)) {
869  Scene *sce;
870  Object *ob;
871  ParticleSettings *part;
872  bool do_gravity = false;
873 
874  for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
875  if (sce->unit.scale_length == 0.0f) {
876  sce->unit.scale_length = 1.0f;
877  }
878  }
879 
880  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
881  /* fluid-sim stuff */
884  if (fluidmd) {
885  fluidmd->fss->fmd = fluidmd;
886  }
887 
888  /* rotation modes were added,
889  * but old objects would now default to being 'quaternion based' */
890  ob->rotmode = ROT_MODE_EUL;
891  }
892 
893  for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
894  if (sce->audio.main == 0.0f) {
895  sce->audio.main = 1.0f;
896  }
897 
899  sce->r.ffcodecdata.audio_volume = sce->audio.main;
900  sce->audio.distance_model = 2;
901  sce->audio.doppler_factor = 1.0f;
902  sce->audio.speed_of_sound = 343.3f;
903  }
904 
905  /* Add default gravity to scenes */
906  for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
907  if ((sce->physics_settings.flag & PHYS_GLOBAL_GRAVITY) == 0 &&
909  sce->physics_settings.gravity[0] = sce->physics_settings.gravity[1] = 0.0f;
910  sce->physics_settings.gravity[2] = -9.81f;
912  do_gravity = true;
913  }
914  }
915 
916  /* Assign proper global gravity weights for dynamics
917  * (only z-coordinate is taken into account) */
918  if (do_gravity) {
919  for (part = bmain->particles.first; part; part = part->id.next) {
920  part->effector_weights->global_gravity = part->acc[2] / -9.81f;
921  }
922  }
923 
924  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
925  ModifierData *md;
926 
927  if (do_gravity) {
928  for (md = ob->modifiers.first; md; md = md->next) {
930  ob, eModifierType_Cloth);
931  if (clmd) {
933  -9.81f;
934  }
935  }
936 
937  if (ob->soft) {
938  ob->soft->effector_weights->global_gravity = ob->soft->grav / 9.81f;
939  }
940  }
941 
942  /* Normal wind shape is plane */
943  if (ob->pd) {
944  if (ob->pd->forcefield == PFIELD_WIND) {
945  ob->pd->shape = PFIELD_SHAPE_PLANE;
946  }
947 
948  if (ob->pd->flag & PFIELD_PLANAR) {
949  ob->pd->shape = PFIELD_SHAPE_PLANE;
950  }
951  else if (ob->pd->flag & PFIELD_SURFACE) {
953  }
954 
955  ob->pd->flag |= PFIELD_DO_LOCATION;
956  }
957  }
958  }
959 
960  if (!MAIN_VERSION_ATLEAST(bmain, 250, 6)) {
961  Object *ob;
962 
963  /* New variables for axis-angle rotations and/or quaternion rotations were added,
964  * and need proper initialization */
965  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
966  /* new variables for all objects */
967  ob->quat[0] = 1.0f;
968  ob->rotAxis[1] = 1.0f;
969 
970  /* bones */
971  if (ob->pose) {
972  bPoseChannel *pchan;
973 
974  for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
975  /* Just need to initialize rotation axis properly. */
976  pchan->rotAxis[1] = 1.0f;
977  }
978  }
979  }
980  }
981 
982  if (!MAIN_VERSION_ATLEAST(bmain, 250, 7)) {
983  Mesh *me;
984  Nurb *nu;
985  Lattice *lt;
986  Curve *cu;
987  Key *key;
988  const float *data;
989  int a, tot;
990 
991  /* shape keys are no longer applied to the mesh itself, but rather
992  * to the evaluated #Mesh / #DispList, so here we ensure that the basis
993  * shape key is always set in the mesh coordinates. */
994  for (me = bmain->meshes.first; me; me = me->id.next) {
995  if ((key = blo_do_versions_newlibadr(fd, lib, me->key)) && key->refkey) {
996  data = key->refkey->data;
997  tot = MIN2(me->totvert, key->refkey->totelem);
998 
999  for (a = 0; a < tot; a++, data += 3) {
1000  copy_v3_v3(me->mvert[a].co, data);
1001  }
1002  }
1003  }
1004 
1005  for (lt = bmain->lattices.first; lt; lt = lt->id.next) {
1006  if ((key = blo_do_versions_newlibadr(fd, lib, lt->key)) && key->refkey) {
1007  data = key->refkey->data;
1008  tot = MIN2(lt->pntsu * lt->pntsv * lt->pntsw, key->refkey->totelem);
1009 
1010  for (a = 0; a < tot; a++, data += 3) {
1011  copy_v3_v3(lt->def[a].vec, data);
1012  }
1013  }
1014  }
1015 
1016  for (cu = bmain->curves.first; cu; cu = cu->id.next) {
1017  if ((key = blo_do_versions_newlibadr(fd, lib, cu->key)) && key->refkey) {
1018  data = key->refkey->data;
1019 
1020  for (nu = cu->nurb.first; nu; nu = nu->next) {
1021  if (nu->bezt) {
1022  BezTriple *bezt = nu->bezt;
1023 
1024  for (a = 0; a < nu->pntsu; a++, bezt++) {
1025  copy_v3_v3(bezt->vec[0], data);
1026  data += 3;
1027  copy_v3_v3(bezt->vec[1], data);
1028  data += 3;
1029  copy_v3_v3(bezt->vec[2], data);
1030  data += 3;
1031  bezt->tilt = *data;
1032  data++;
1033  }
1034  }
1035  else if (nu->bp) {
1036  BPoint *bp = nu->bp;
1037 
1038  for (a = 0; a < nu->pntsu * nu->pntsv; a++, bp++) {
1039  copy_v3_v3(bp->vec, data);
1040  data += 3;
1041  bp->tilt = *data;
1042  data++;
1043  }
1044  }
1045  }
1046  }
1047  }
1048  }
1049 
1050  if (!MAIN_VERSION_ATLEAST(bmain, 250, 8)) {
1051  {
1052  Scene *sce = bmain->scenes.first;
1053  while (sce) {
1054  if (sce->r.frame_step == 0) {
1055  sce->r.frame_step = 1;
1056  }
1057 
1058  sce = sce->id.next;
1059  }
1060  }
1061 
1062  {
1063  /* ensure all nodes have unique names */
1064  bNodeTree *ntree = bmain->nodetrees.first;
1065  while (ntree) {
1066  bNode *node = ntree->nodes.first;
1067 
1068  while (node) {
1070  node = node->next;
1071  }
1072 
1073  ntree = ntree->id.next;
1074  }
1075  }
1076 
1077  {
1078  Object *ob = bmain->objects.first;
1079  while (ob) {
1080  /* shaded mode disabled for now */
1081  if (ob->dt == OB_MATERIAL) {
1082  ob->dt = OB_TEXTURE;
1083  }
1084  ob = ob->id.next;
1085  }
1086  }
1087 
1088  {
1089  bScreen *screen;
1090  ScrArea *area;
1091  SpaceLink *sl;
1092 
1093  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
1094  for (area = screen->areabase.first; area; area = area->next) {
1095  for (sl = area->spacedata.first; sl; sl = sl->next) {
1096  if (sl->spacetype == SPACE_VIEW3D) {
1097  View3D *v3d = (View3D *)sl;
1098  if (v3d->drawtype == OB_MATERIAL) {
1099  v3d->drawtype = OB_SOLID;
1100  }
1101  }
1102  }
1103  }
1104  }
1105  }
1106 
1107  /* only convert old 2.50 files with color management */
1108  if (bmain->versionfile == 250) {
1109  Scene *sce = bmain->scenes.first;
1110  Material *ma = bmain->materials.first;
1111  Tex *tex = bmain->textures.first;
1112  int i, convert = 0;
1113 
1114  /* convert to new color management system:
1115  * while previously colors were stored as srgb,
1116  * now they are stored as linear internally,
1117  * with screen gamma correction in certain places in the UI. */
1118 
1119  /* don't know what scene is active, so we'll convert if any scene has it enabled... */
1120  while (sce) {
1121  if (sce->r.color_mgt_flag & R_COLOR_MANAGEMENT) {
1122  convert = 1;
1123  }
1124  sce = sce->id.next;
1125  }
1126 
1127  if (convert) {
1128  while (ma) {
1129  srgb_to_linearrgb_v3_v3(&ma->r, &ma->r);
1130  srgb_to_linearrgb_v3_v3(&ma->specr, &ma->specr);
1131  ma = ma->id.next;
1132  }
1133 
1134  while (tex) {
1135  if (tex->coba) {
1136  ColorBand *band = (ColorBand *)tex->coba;
1137  for (i = 0; i < band->tot; i++) {
1138  CBData *data = band->data + i;
1139  srgb_to_linearrgb_v3_v3(&data->r, &data->r);
1140  }
1141  }
1142  tex = tex->id.next;
1143  }
1144  }
1145  }
1146  }
1147 
1148  if (!MAIN_VERSION_ATLEAST(bmain, 250, 9)) {
1149  Scene *sce;
1150  Mesh *me;
1151  Object *ob;
1152 
1153  for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
1154  if (!sce->toolsettings->particle.selectmode) {
1156  }
1157  }
1158 
1159  if (bmain->versionfile == 250 && bmain->subversionfile > 1) {
1160  for (me = bmain->meshes.first; me; me = me->id.next) {
1162  }
1163 
1164  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
1167 
1168  if (mmd) {
1169  mmd->totlvl--;
1170  mmd->lvl--;
1171  mmd->sculptlvl = mmd->lvl;
1172  mmd->renderlvl = mmd->lvl;
1173  }
1174  }
1175  }
1176  }
1177 
1178  if (!MAIN_VERSION_ATLEAST(bmain, 250, 10)) {
1179  Object *ob;
1180 
1181  /* properly initialize hair clothsim data on old files */
1182  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
1183  ModifierData *md;
1184  for (md = ob->modifiers.first; md; md = md->next) {
1185  if (md->type == eModifierType_Cloth) {
1186  ClothModifierData *clmd = (ClothModifierData *)md;
1187  if (clmd->sim_parms->velocity_smooth < 0.01f) {
1188  clmd->sim_parms->velocity_smooth = 0.0f;
1189  }
1190  }
1191  }
1192  }
1193  }
1194 
1195  /* fix bad area setup in subversion 10 */
1196  if (bmain->versionfile == 250 && bmain->subversionfile == 10) {
1197  /* fix for new view type in sequencer */
1198  bScreen *screen;
1199  ScrArea *area;
1200  SpaceLink *sl;
1201 
1202  /* remove all preview window in wrong spaces */
1203  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
1204  for (area = screen->areabase.first; area; area = area->next) {
1205  for (sl = area->spacedata.first; sl; sl = sl->next) {
1206  if (sl->spacetype != SPACE_SEQ) {
1207  ARegion *region;
1208  ListBase *regionbase;
1209 
1210  if (sl == area->spacedata.first) {
1211  regionbase = &area->regionbase;
1212  }
1213  else {
1214  regionbase = &sl->regionbase;
1215  }
1216 
1217  for (region = regionbase->first; region; region = region->next) {
1218  if (region->regiontype == RGN_TYPE_PREVIEW) {
1219  break;
1220  }
1221  }
1222 
1223  if (region && (region->regiontype == RGN_TYPE_PREVIEW)) {
1225  BKE_area_region_free(st, region);
1226  BLI_freelinkN(regionbase, region);
1227  }
1228  }
1229  }
1230  }
1231  }
1232  }
1233 
1234  if (!MAIN_VERSION_ATLEAST(bmain, 250, 11)) {
1235  {
1236  /* fix for new view type in sequencer */
1237  bScreen *screen;
1238  ScrArea *area;
1239  SpaceLink *sl;
1240 
1241  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
1242  for (area = screen->areabase.first; area; area = area->next) {
1243  for (sl = area->spacedata.first; sl; sl = sl->next) {
1244  if (sl->spacetype == SPACE_SEQ) {
1245  ARegion *region;
1246  ARegion *region_main;
1247  ListBase *regionbase;
1248  SpaceSeq *sseq = (SpaceSeq *)sl;
1249 
1250  if (sl == area->spacedata.first) {
1251  regionbase = &area->regionbase;
1252  }
1253  else {
1254  regionbase = &sl->regionbase;
1255  }
1256 
1257  if (sseq->view == 0) {
1258  sseq->view = SEQ_VIEW_SEQUENCE;
1259  }
1260  if (sseq->mainb == 0) {
1261  sseq->mainb = SEQ_DRAW_IMG_IMBUF;
1262  }
1263 
1264  region_main = (ARegion *)regionbase->first;
1265  for (; region_main; region_main = region_main->next) {
1266  if (region_main->regiontype == RGN_TYPE_WINDOW) {
1267  break;
1268  }
1269  }
1270  region = MEM_callocN(sizeof(ARegion), "preview area for sequencer");
1271  BLI_insertlinkbefore(regionbase, region_main, region);
1273  }
1274  }
1275  }
1276  }
1277  }
1278  }
1279 
1280  if (!MAIN_VERSION_ATLEAST(bmain, 250, 12)) {
1281  Object *ob;
1282  Brush *brush;
1283 
1284  /* anim viz changes */
1285  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
1286  /* initialize object defaults */
1287  animviz_settings_init(&ob->avs);
1288 
1289  /* if armature, copy settings for pose from armature data
1290  * performing initialization where appropriate
1291  */
1292  if (ob->pose && ob->data) {
1293  bArmature *arm = blo_do_versions_newlibadr(fd, lib, ob->data);
1294  if (arm) { /* XXX: why does this fail in some cases? */
1295  bAnimVizSettings *avs = &ob->pose->avs;
1296 
1297  /* path settings --------------------- */
1298  /* ranges */
1299  avs->path_bc = 10;
1300  avs->path_ac = 10;
1301 
1302  avs->path_sf = 1;
1303  avs->path_ef = 250;
1304 
1305  /* flags */
1306  if (arm->pathflag & ARM_PATH_FNUMS) {
1308  }
1309  if (arm->pathflag & ARM_PATH_KFRAS) {
1311  }
1312  if (arm->pathflag & ARM_PATH_KFNOS) {
1314  }
1315 
1316  /* bake flags */
1317  if (arm->pathflag & ARM_PATH_HEADS) {
1319  }
1320 
1321  /* type */
1322  if (arm->pathflag & ARM_PATH_ACFRA) {
1324  }
1325 
1326  /* stepsize */
1327  avs->path_step = 1;
1328  }
1329  else {
1331  }
1332  }
1333  }
1334 
1335  /* brush texture changes */
1336  for (brush = bmain->brushes.first; brush; brush = brush->id.next) {
1337  BKE_texture_mtex_default(&brush->mtex);
1339  }
1340  }
1341 
1342  if (!MAIN_VERSION_ATLEAST(bmain, 250, 13)) {
1343  /* NOTE: if you do more conversion, be sure to do it outside of this and
1344  * increase subversion again, otherwise it will not be correct */
1345  Object *ob;
1346 
1347  /* convert degrees to radians for internal use */
1348  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
1349  bPoseChannel *pchan;
1350 
1352 
1353  if (ob->pose) {
1354  for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
1355  pchan->limitmin[0] *= (float)(M_PI / 180.0);
1356  pchan->limitmin[1] *= (float)(M_PI / 180.0);
1357  pchan->limitmin[2] *= (float)(M_PI / 180.0);
1358  pchan->limitmax[0] *= (float)(M_PI / 180.0);
1359  pchan->limitmax[1] *= (float)(M_PI / 180.0);
1360  pchan->limitmax[2] *= (float)(M_PI / 180.0);
1361 
1363  }
1364  }
1365  }
1366  }
1367 
1368  if (!MAIN_VERSION_ATLEAST(bmain, 250, 14)) {
1369  /* fix for bad View2D extents for Animation Editors */
1370  bScreen *screen;
1371  ScrArea *area;
1372  SpaceLink *sl;
1373 
1374  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
1375  for (area = screen->areabase.first; area; area = area->next) {
1376  for (sl = area->spacedata.first; sl; sl = sl->next) {
1377  ListBase *regionbase;
1378  ARegion *region;
1379 
1380  if (sl == area->spacedata.first) {
1381  regionbase = &area->regionbase;
1382  }
1383  else {
1384  regionbase = &sl->regionbase;
1385  }
1386 
1387  if (ELEM(sl->spacetype, SPACE_ACTION, SPACE_NLA)) {
1388  for (region = (ARegion *)regionbase->first; region; region = region->next) {
1389  if (region->regiontype == RGN_TYPE_WINDOW) {
1390  region->v2d.cur.ymax = region->v2d.tot.ymax = 0.0f;
1391  region->v2d.cur.ymin = region->v2d.tot.ymin = (float)(-area->winy) / 3.0f;
1392  }
1393  }
1394  }
1395  }
1396  }
1397  }
1398  }
1399 
1400  if (!MAIN_VERSION_ATLEAST(bmain, 250, 17)) {
1401  Scene *sce;
1402 
1403  /* initialize to sane default so toggling on border shows something */
1404  for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
1405  if (sce->r.border.xmin == 0.0f && sce->r.border.ymin == 0.0f && sce->r.border.xmax == 0.0f &&
1406  sce->r.border.ymax == 0.0f) {
1407  sce->r.border.xmin = 0.0f;
1408  sce->r.border.ymin = 0.0f;
1409  sce->r.border.xmax = 1.0f;
1410  sce->r.border.ymax = 1.0f;
1411  }
1412 
1413  if ((sce->r.ffcodecdata.flags & FFMPEG_MULTIPLEX_AUDIO) == 0) {
1414  sce->r.ffcodecdata.audio_codec = 0x0; /* `CODEC_ID_NONE` */
1415  }
1416  if (sce->ed) {
1418  }
1419  }
1420 
1421  /* particle brush strength factor was changed from int to float */
1422  for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
1424  int a;
1425 
1426  for (a = 0; a < ARRAY_SIZE(pset->brush); a++) {
1427  pset->brush[a].strength /= 100.0f;
1428  }
1429  }
1430 
1431  /* sequencer changes */
1432  {
1433  bScreen *screen;
1434  ScrArea *area;
1435  SpaceLink *sl;
1436 
1437  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
1438  for (area = screen->areabase.first; area; area = area->next) {
1439  for (sl = area->spacedata.first; sl; sl = sl->next) {
1440  if (sl->spacetype == SPACE_SEQ) {
1441  ARegion *region_preview;
1442  ListBase *regionbase;
1443 
1444  if (sl == area->spacedata.first) {
1445  regionbase = &area->regionbase;
1446  }
1447  else {
1448  regionbase = &sl->regionbase;
1449  }
1450 
1451  region_preview = (ARegion *)regionbase->first;
1452  for (; region_preview; region_preview = region_preview->next) {
1453  if (region_preview->regiontype == RGN_TYPE_PREVIEW) {
1454  break;
1455  }
1456  }
1457  if (region_preview && (region_preview->regiontype == RGN_TYPE_PREVIEW)) {
1458  sequencer_init_preview_region(region_preview);
1459  }
1460  }
1461  }
1462  }
1463  }
1464  } /* sequencer changes */
1465  }
1466 
1467  if (bmain->versionfile <= 251) { /* 2.5.1 had no subversions */
1468  bScreen *screen;
1469 
1470  /* Blender 2.5.2 - subversion 0 introduced a new setting: V3D_HIDE_OVERLAYS.
1471  * This bit was used in the past for V3D_TRANSFORM_SNAP, which is now deprecated.
1472  * Here we clear it for old files so they don't come in with V3D_HIDE_OVERLAYS set,
1473  * which would cause cameras, lights, etc to become invisible */
1474  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
1475  ScrArea *area;
1476  for (area = screen->areabase.first; area; area = area->next) {
1477  SpaceLink *sl;
1478  for (sl = area->spacedata.first; sl; sl = sl->next) {
1479  if (sl->spacetype == SPACE_VIEW3D) {
1480  View3D *v3d = (View3D *)sl;
1481  v3d->flag2 &= ~V3D_HIDE_OVERLAYS;
1482  }
1483  }
1484  }
1485  }
1486  }
1487 
1488  if (!MAIN_VERSION_ATLEAST(bmain, 252, 1)) {
1489  Brush *brush;
1490  Object *ob;
1491  Scene *scene;
1492  bNodeTree *ntree;
1493 
1494  for (brush = bmain->brushes.first; brush; brush = brush->id.next) {
1495  if (brush->curve) {
1496  brush->curve->preset = CURVE_PRESET_SMOOTH;
1497  }
1498  }
1499 
1500  /* properly initialize active flag for fluidsim modifiers */
1501  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
1502  ModifierData *md;
1503  for (md = ob->modifiers.first; md; md = md->next) {
1504  if (md->type == eModifierType_Fluidsim) {
1506  fmd->fss->flag |= OB_FLUIDSIM_ACTIVE;
1508  }
1509  }
1510  }
1511 
1512  /* adjustment to color balance node values */
1513  for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
1514  if (scene->nodetree) {
1516 
1517  while (node) {
1518  if (node->type == CMP_NODE_COLORBALANCE) {
1519  NodeColorBalance *n = (NodeColorBalance *)node->storage;
1520  n->lift[0] += 1.0f;
1521  n->lift[1] += 1.0f;
1522  n->lift[2] += 1.0f;
1523  }
1524  node = node->next;
1525  }
1526  }
1527  }
1528  /* check inside node groups too */
1529  for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) {
1530  bNode *node = ntree->nodes.first;
1531 
1532  while (node) {
1533  if (node->type == CMP_NODE_COLORBALANCE) {
1534  NodeColorBalance *n = (NodeColorBalance *)node->storage;
1535  n->lift[0] += 1.0f;
1536  n->lift[1] += 1.0f;
1537  n->lift[2] += 1.0f;
1538  }
1539 
1540  node = node->next;
1541  }
1542  }
1543  }
1544 
1545  /* old-track -> constraints (this time we're really doing it!) */
1546  if (!MAIN_VERSION_ATLEAST(bmain, 252, 2)) {
1547  Object *ob;
1548 
1549  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
1551  }
1552  }
1553 
1554  if (!MAIN_VERSION_ATLEAST(bmain, 252, 5)) {
1555  bScreen *screen;
1556 
1557  /* Image editor scopes */
1558  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
1559  ScrArea *area;
1560 
1561  for (area = screen->areabase.first; area; area = area->next) {
1562  SpaceLink *sl;
1563 
1564  for (sl = area->spacedata.first; sl; sl = sl->next) {
1565  if (sl->spacetype == SPACE_IMAGE) {
1566  SpaceImage *sima = (SpaceImage *)sl;
1567  BKE_scopes_new(&sima->scopes);
1568  }
1569  }
1570  }
1571  }
1572  }
1573 
1574  if (bmain->versionfile < 253) {
1575  Object *ob;
1576  Scene *scene;
1577  bScreen *screen;
1578  Tex *tex;
1579  Brush *brush;
1580 
1581  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
1582  ScrArea *area;
1583  for (area = screen->areabase.first; area; area = area->next) {
1584  SpaceLink *sl;
1585 
1586  for (sl = area->spacedata.first; sl; sl = sl->next) {
1587  if (sl->spacetype == SPACE_NODE) {
1588  SpaceNode *snode = (SpaceNode *)sl;
1589  ListBase *regionbase;
1590  ARegion *region;
1591 
1592  if (sl == area->spacedata.first) {
1593  regionbase = &area->regionbase;
1594  }
1595  else {
1596  regionbase = &sl->regionbase;
1597  }
1598 
1599  if (snode->v2d.minzoom > 0.09f) {
1600  snode->v2d.minzoom = 0.09f;
1601  }
1602  if (snode->v2d.maxzoom < 2.31f) {
1603  snode->v2d.maxzoom = 2.31f;
1604  }
1605 
1606  for (region = regionbase->first; region; region = region->next) {
1607  if (region->regiontype == RGN_TYPE_WINDOW) {
1608  if (region->v2d.minzoom > 0.09f) {
1609  region->v2d.minzoom = 0.09f;
1610  }
1611  if (region->v2d.maxzoom < 2.31f) {
1612  region->v2d.maxzoom = 2.31f;
1613  }
1614  }
1615  }
1616  }
1617  }
1618  }
1619  }
1620 
1621  do_version_mdef_250(bmain);
1622 
1623  /* parent type to modifier */
1624  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
1625  if (ob->parent) {
1626  Object *parent = (Object *)blo_do_versions_newlibadr(fd, lib, ob->parent);
1627  if (parent) { /* parent may not be in group */
1628  enum { PARCURVE = 1 };
1629  if (parent->type == OB_ARMATURE && ob->partype == PARSKEL) {
1630  ArmatureModifierData *amd;
1631  bArmature *arm = (bArmature *)blo_do_versions_newlibadr(fd, lib, parent->data);
1632 
1634  amd->object = ob->parent;
1635  BLI_addtail((ListBase *)&ob->modifiers, amd);
1636  amd->deformflag = arm->deformflag;
1637  ob->partype = PAROBJECT;
1638  }
1639  else if (parent->type == OB_LATTICE && ob->partype == PARSKEL) {
1640  LatticeModifierData *lmd;
1641 
1643  lmd->object = ob->parent;
1644  BLI_addtail((ListBase *)&ob->modifiers, lmd);
1645  ob->partype = PAROBJECT;
1646  }
1647  else if (parent->type == OB_CURVES_LEGACY && ob->partype == PARCURVE) {
1648  CurveModifierData *cmd;
1649 
1651  cmd->object = ob->parent;
1652  BLI_addtail((ListBase *)&ob->modifiers, cmd);
1653  ob->partype = PAROBJECT;
1654  }
1655  }
1656  }
1657  }
1658 
1659  /* initialize scene active layer */
1660  for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
1661  int i;
1662  for (i = 0; i < 20; i++) {
1663  if (scene->lay & (1 << i)) {
1664  scene->layact = 1 << i;
1665  break;
1666  }
1667  }
1668  }
1669 
1670  for (tex = bmain->textures.first; tex; tex = tex->id.next) {
1671  /* If you're picky, this isn't correct until we do a version bump
1672  * since you could set saturation to be 0.0. */
1673  if (tex->saturation == 0.0f) {
1674  tex->saturation = 1.0f;
1675  }
1676  }
1677 
1678  {
1679  Curve *cu;
1680  for (cu = bmain->curves.first; cu; cu = cu->id.next) {
1681  cu->smallcaps_scale = 0.75f;
1682  }
1683  }
1684 
1685  for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
1686  if (scene->ed) {
1688  }
1689  }
1690 
1691  /* GSOC 2010 Sculpt - New settings for Brush */
1692 
1693  for (brush = bmain->brushes.first; brush; brush = brush->id.next) {
1694  /* Sanity Check */
1695 
1696  /* infinite number of dabs */
1697  if (brush->spacing == 0) {
1698  brush->spacing = 10;
1699  }
1700 
1701  /* will have no effect */
1702  if (brush->alpha == 0) {
1703  brush->alpha = 1.0f;
1704  }
1705 
1706  /* bad radius */
1707  if (brush->unprojected_radius == 0) {
1708  brush->unprojected_radius = 0.125f;
1709  }
1710 
1711  /* unusable size */
1712  if (brush->size == 0) {
1713  brush->size = 35;
1714  }
1715 
1716  /* can't see overlay */
1717  if (brush->texture_overlay_alpha == 0) {
1718  brush->texture_overlay_alpha = 33;
1719  }
1720 
1721  /* same as draw brush */
1722  if (brush->crease_pinch_factor == 0) {
1723  brush->crease_pinch_factor = 0.5f;
1724  }
1725 
1726  /* will sculpt no vertices */
1727  if (brush->plane_trim == 0) {
1728  brush->plane_trim = 0.5f;
1729  }
1730 
1731  /* same as smooth stroke off */
1732  if (brush->smooth_stroke_radius == 0) {
1733  brush->smooth_stroke_radius = 75;
1734  }
1735 
1736  /* will keep cursor in one spot */
1737  if (brush->smooth_stroke_radius == 1) {
1738  brush->smooth_stroke_factor = 0.9f;
1739  }
1740 
1741  /* same as dots */
1742  if (brush->rate == 0) {
1743  brush->rate = 0.1f;
1744  }
1745 
1746  /* New Settings */
1747  if (!MAIN_VERSION_ATLEAST(bmain, 252, 5)) {
1748  brush->flag |= BRUSH_SPACE_ATTEN; /* Explicitly enable adaptive space. */
1749 
1750  /* spacing was originally in pixels, convert it to percentage for new version
1751  * size should not be zero due to sanity check above
1752  */
1753  brush->spacing = (int)(100 * ((float)brush->spacing) / ((float)brush->size));
1754 
1755  if (brush->add_col[0] == 0 && brush->add_col[1] == 0 && brush->add_col[2] == 0) {
1756  brush->add_col[0] = 1.00f;
1757  brush->add_col[1] = 0.39f;
1758  brush->add_col[2] = 0.39f;
1759  }
1760 
1761  if (brush->sub_col[0] == 0 && brush->sub_col[1] == 0 && brush->sub_col[2] == 0) {
1762  brush->sub_col[0] = 0.39f;
1763  brush->sub_col[1] = 0.39f;
1764  brush->sub_col[2] = 1.00f;
1765  }
1766  }
1767  }
1768  }
1769 
1770  /* GSOC Sculpt 2010 - Sanity check on Sculpt/Paint settings */
1771  if (bmain->versionfile < 253) {
1772  Scene *sce;
1773  for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
1774  if (sce->toolsettings->sculpt_paint_unified_alpha == 0) {
1775  sce->toolsettings->sculpt_paint_unified_alpha = 0.5f;
1776  }
1777 
1778  if (sce->toolsettings->sculpt_paint_unified_unprojected_radius == 0) {
1779  sce->toolsettings->sculpt_paint_unified_unprojected_radius = 0.125f;
1780  }
1781 
1782  if (sce->toolsettings->sculpt_paint_unified_size == 0) {
1783  sce->toolsettings->sculpt_paint_unified_size = 35;
1784  }
1785  }
1786  }
1787 
1788  if (!MAIN_VERSION_ATLEAST(bmain, 253, 1)) {
1789  Object *ob;
1790 
1791  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
1792  ModifierData *md;
1793 
1794  for (md = ob->modifiers.first; md; md = md->next) {
1795  if (md->type == eModifierType_Fluid) {
1796  FluidModifierData *fmd = (FluidModifierData *)md;
1797 
1798  if ((fmd->type & MOD_FLUID_TYPE_DOMAIN) && fmd->domain) {
1799  fmd->domain->vorticity = 2.0f;
1800  fmd->domain->time_scale = 1.0f;
1801 
1802  if (!(fmd->domain->flags & (1 << 4))) {
1803  continue;
1804  }
1805 
1806  /* delete old MOD_SMOKE_INITVELOCITY flag */
1807  fmd->domain->flags &= ~(1 << 4);
1808 
1809  /* for now just add it to all flow objects in the scene */
1810  {
1811  Object *ob2;
1812  for (ob2 = bmain->objects.first; ob2; ob2 = ob2->id.next) {
1813  ModifierData *md2;
1814  for (md2 = ob2->modifiers.first; md2; md2 = md2->next) {
1815  if (md2->type == eModifierType_Fluid) {
1816  FluidModifierData *fmd2 = (FluidModifierData *)md2;
1817 
1818  if ((fmd2->type & MOD_FLUID_TYPE_FLOW) && fmd2->flow) {
1820  }
1821  }
1822  }
1823  }
1824  }
1825  }
1826  else if ((fmd->type & MOD_FLUID_TYPE_FLOW) && fmd->flow) {
1827  fmd->flow->vel_multi = 1.0f;
1828  }
1829  }
1830  }
1831  }
1832  }
1833 
1834  if (!MAIN_VERSION_ATLEAST(bmain, 255, 1)) {
1835  Brush *br;
1836  ParticleSettings *part;
1837  bScreen *screen;
1838 
1839  for (br = bmain->brushes.first; br; br = br->id.next) {
1840  if (br->ob_mode == 0) {
1841  br->ob_mode = OB_MODE_ALL_PAINT;
1842  }
1843  }
1844 
1845  for (part = bmain->particles.first; part; part = part->id.next) {
1846  if (part->boids) {
1847  part->boids->pitch = 1.0f;
1848  }
1849 
1850  part->flag &= ~PART_HAIR_REGROW; /* this was a deprecated flag before */
1851  part->kink_amp_clump = 1.0f; /* keep old files looking similar */
1852  }
1853 
1854  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
1855  ScrArea *area;
1856  for (area = screen->areabase.first; area; area = area->next) {
1857  SpaceLink *sl;
1858  for (sl = area->spacedata.first; sl; sl = sl->next) {
1859  if (sl->spacetype == SPACE_INFO) {
1860  SpaceInfo *sinfo = (SpaceInfo *)sl;
1861  ARegion *region;
1862 
1863  sinfo->rpt_mask = INFO_RPT_OP;
1864 
1865  for (region = area->regionbase.first; region; region = region->next) {
1866  if (region->regiontype == RGN_TYPE_WINDOW) {
1867  region->v2d.scroll = (V2D_SCROLL_RIGHT);
1868  region->v2d.align = V2D_ALIGN_NO_NEG_X |
1869  V2D_ALIGN_NO_NEG_Y; /* align bottom left */
1870  region->v2d.keepofs = V2D_LOCKOFS_X;
1872  V2D_KEEPASPECT);
1873  region->v2d.keeptot = V2D_KEEPTOT_BOUNDS;
1874  region->v2d.minzoom = region->v2d.maxzoom = 1.0f;
1875  }
1876  }
1877  }
1878  }
1879  }
1880  }
1881  }
1882 
1883  if (!MAIN_VERSION_ATLEAST(bmain, 255, 3)) {
1884  Object *ob;
1885 
1886  /* ocean res is now squared, reset old ones - will be massive */
1887  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
1888  ModifierData *md;
1889  for (md = ob->modifiers.first; md; md = md->next) {
1890  if (md->type == eModifierType_Ocean) {
1891  OceanModifierData *omd = (OceanModifierData *)md;
1892  omd->resolution = 7;
1893  omd->oceancache = NULL;
1894  }
1895  }
1896  }
1897  }
1898 
1899  if (bmain->versionfile < 256) {
1900  bScreen *screen;
1901  ScrArea *area;
1902  Key *key;
1903 
1904  /* Fix for sample line scope initializing with no height */
1905  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
1906  area = screen->areabase.first;
1907  while (area) {
1908  SpaceLink *sl;
1909  for (sl = area->spacedata.first; sl; sl = sl->next) {
1910  if (sl->spacetype == SPACE_IMAGE) {
1911  SpaceImage *sima = (SpaceImage *)sl;
1912  if (sima->sample_line_hist.height == 0) {
1913  sima->sample_line_hist.height = 100;
1914  }
1915  }
1916  }
1917  area = area->next;
1918  }
1919  }
1920 
1921  /* old files could have been saved with slidermin = slidermax = 0.0, but the UI in
1922  * 2.4x would never reveal this to users as a dummy value always ended up getting used
1923  * instead
1924  */
1925  for (key = bmain->shapekeys.first; key; key = key->id.next) {
1926  KeyBlock *kb;
1927 
1928  for (kb = key->block.first; kb; kb = kb->next) {
1929  if (IS_EQF(kb->slidermin, kb->slidermax) && IS_EQF(kb->slidermax, 0.0f)) {
1930  kb->slidermax = kb->slidermin + 1.0f;
1931  }
1932  }
1933  }
1934  }
1935 
1936  if (!MAIN_VERSION_ATLEAST(bmain, 256, 1)) {
1937  /* fix for bones that didn't have arm_roll before */
1938  bArmature *arm;
1939  Bone *bone;
1940  Object *ob;
1941 
1942  for (arm = bmain->armatures.first; arm; arm = arm->id.next) {
1943  for (bone = arm->bonebase.first; bone; bone = bone->next) {
1945  }
1946  }
1947 
1948  /* fix for objects which have zero dquat's
1949  * since this is multiplied with the quat rather than added */
1950  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
1951  if (is_zero_v4(ob->dquat)) {
1952  unit_qt(ob->dquat);
1953  }
1954  if (is_zero_v3(ob->drotAxis) && ob->drotAngle == 0.0f) {
1955  unit_axis_angle(ob->drotAxis, &ob->drotAngle);
1956  }
1957  }
1958  }
1959 
1960  if (!MAIN_VERSION_ATLEAST(bmain, 256, 2)) {
1961  bNodeTree *ntree;
1962  bNode *node;
1963  bNodeSocket *sock, *gsock;
1964  bNodeLink *link;
1965 
1966  /* node sockets are not exposed automatically any more,
1967  * this mimics the old behavior by adding all unlinked sockets to groups.
1968  */
1969  for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) {
1970  /* this adds copies and links from all unlinked internal sockets to group inputs/outputs. */
1971 
1972  /* first make sure the own_index for new sockets is valid */
1973  for (node = ntree->nodes.first; node; node = node->next) {
1974  for (sock = node->inputs.first; sock; sock = sock->next) {
1975  if (sock->own_index >= ntree->cur_index) {
1976  ntree->cur_index = sock->own_index + 1;
1977  }
1978  }
1979  for (sock = node->outputs.first; sock; sock = sock->next) {
1980  if (sock->own_index >= ntree->cur_index) {
1981  ntree->cur_index = sock->own_index + 1;
1982  }
1983  }
1984  }
1985 
1986  /* add ntree->inputs/ntree->outputs sockets for all unlinked sockets in the group tree. */
1987  for (node = ntree->nodes.first; node; node = node->next) {
1988  for (sock = node->inputs.first; sock; sock = sock->next) {
1989  if (!sock->link && !nodeSocketIsHidden(sock)) {
1990 
1992  ntree, sock->name, sock->type, SOCK_IN);
1993 
1994  /* initialize the default socket value */
1995  copy_v4_v4(gsock->ns.vec, sock->ns.vec);
1996 
1997  /* XXX nodeAddLink does not work with incomplete (node==NULL) links any longer,
1998  * have to create these directly here.
1999  * These links are updated again in subsequent do_version!
2000  */
2001  link = MEM_callocN(sizeof(bNodeLink), "link");
2002  BLI_addtail(&ntree->links, link);
2003  link->fromnode = NULL;
2004  link->fromsock = gsock;
2005  link->tonode = node;
2006  link->tosock = sock;
2008 
2009  sock->link = link;
2010  }
2011  }
2012  for (sock = node->outputs.first; sock; sock = sock->next) {
2013  if (nodeCountSocketLinks(ntree, sock) == 0 && !nodeSocketIsHidden(sock)) {
2015  ntree, sock->name, sock->type, SOCK_OUT);
2016 
2017  /* initialize the default socket value */
2018  copy_v4_v4(gsock->ns.vec, sock->ns.vec);
2019 
2020  /* XXX nodeAddLink does not work with incomplete (node==NULL) links any longer,
2021  * have to create these directly here.
2022  * These links are updated again in subsequent do_version!
2023  */
2024  link = MEM_callocN(sizeof(bNodeLink), "link");
2025  BLI_addtail(&ntree->links, link);
2026  link->fromnode = node;
2027  link->fromsock = sock;
2028  link->tonode = NULL;
2029  link->tosock = gsock;
2031 
2032  gsock->link = link;
2033  }
2034  }
2035  }
2036 
2037  /* External group node socket need to adjust their own_index to point at
2038  * associated 'ntree' inputs/outputs internal sockets. This happens in
2039  * do_versions_after_linking_250, after lib linking. */
2040  }
2041  }
2042 
2043  if (!MAIN_VERSION_ATLEAST(bmain, 256, 3)) {
2044  bScreen *screen;
2045  Brush *brush;
2046  Object *ob;
2047  ParticleSettings *part;
2048 
2049  /* redraws flag in SpaceTime has been moved to Screen level */
2050  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
2051  if (screen->redraws_flag == 0) {
2052  /* just initialize to default? */
2053  /* XXX: we could also have iterated through areas,
2054  * and taken them from the first timeline available... */
2056  }
2057  }
2058 
2059  for (brush = bmain->brushes.first; brush; brush = brush->id.next) {
2060  if (brush->height == 0) {
2061  brush->height = 0.4f;
2062  }
2063  }
2064 
2065  /* Replace 'rim material' option for in offset. */
2066  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
2067  ModifierData *md;
2068  for (md = ob->modifiers.first; md; md = md->next) {
2069  if (md->type == eModifierType_Solidify) {
2071  if (smd->flag & MOD_SOLIDIFY_RIM_MATERIAL) {
2072  smd->mat_ofs_rim = 1;
2073  smd->flag &= ~MOD_SOLIDIFY_RIM_MATERIAL;
2074  }
2075  }
2076  }
2077  }
2078 
2079  /* particle draw color from material */
2080  for (part = bmain->particles.first; part; part = part->id.next) {
2081  if (part->draw & PART_DRAW_MAT_COL) {
2082  part->draw_col = PART_DRAW_COL_MAT;
2083  }
2084  }
2085  }
2086 
2087  if (0) {
2088  if (!MAIN_VERSION_ATLEAST(bmain, 256, 6)) {
2089  for (Mesh *me = bmain->meshes.first; me; me = me->id.next) {
2090  /* Vertex normal calculation from legacy 'MFace' has been removed.
2091  * update after calculating polygons in file reading code instead. */
2092  }
2093  }
2094  }
2095 
2096  if (!MAIN_VERSION_ATLEAST(bmain, 256, 2)) {
2097  /* update blur area sizes from 0..1 range to 0..100 percentage */
2098  Scene *scene;
2099  bNode *node;
2100  for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
2101  if (scene->nodetree) {
2102  for (node = scene->nodetree->nodes.first; node; node = node->next) {
2103  if (node->type == CMP_NODE_BLUR) {
2104  NodeBlurData *nbd = node->storage;
2105  nbd->percentx *= 100.0f;
2106  nbd->percenty *= 100.0f;
2107  }
2108  }
2109  }
2110  }
2111  }
2112 
2113  if (!MAIN_VERSION_ATLEAST(bmain, 258, 1)) {
2114  /* screen view2d settings were not properly initialized T27164.
2115  * v2d->scroll caused the bug but best reset other values too
2116  * which are in old blend files only.
2117  * Need to make less ugly - possibly an iterator? */
2118  bScreen *screen;
2119 
2120  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
2121  ScrArea *area;
2122  /* add regions */
2123  for (area = screen->areabase.first; area; area = area->next) {
2124  SpaceLink *sl = area->spacedata.first;
2125  if (sl->spacetype == SPACE_IMAGE) {
2126  ARegion *region;
2127  for (region = area->regionbase.first; region; region = region->next) {
2128  if (region->regiontype == RGN_TYPE_WINDOW) {
2129  View2D *v2d = &region->v2d;
2130  v2d->minzoom = v2d->maxzoom = v2d->scroll = v2d->keeptot = v2d->keepzoom =
2131  v2d->keepofs = v2d->align = 0;
2132  }
2133  }
2134  }
2135 
2136  for (sl = area->spacedata.first; sl; sl = sl->next) {
2137  if (sl->spacetype == SPACE_IMAGE) {
2138  ARegion *region;
2139  for (region = sl->regionbase.first; region; region = region->next) {
2140  if (region->regiontype == RGN_TYPE_WINDOW) {
2141  View2D *v2d = &region->v2d;
2142  v2d->minzoom = v2d->maxzoom = v2d->scroll = v2d->keeptot = v2d->keepzoom =
2143  v2d->keepofs = v2d->align = 0;
2144  }
2145  }
2146  }
2147  }
2148  }
2149  }
2150 
2151  {
2152  ParticleSettings *part;
2153  for (part = bmain->particles.first; part; part = part->id.next) {
2154  /* Initialize particle billboard scale */
2155  part->bb_size[0] = part->bb_size[1] = 1.0f;
2156  }
2157  }
2158  }
2159 
2160  if (!MAIN_VERSION_ATLEAST(bmain, 259, 1)) {
2161  {
2162  Scene *scene;
2163 
2164  for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
2166  scene->audio.volume = 1.0f;
2167  if (scene->ed) {
2169  }
2170  }
2171  }
2172 
2173  {
2174  bScreen *screen;
2175  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
2176  ScrArea *area;
2177 
2178  /* add regions */
2179  for (area = screen->areabase.first; area; area = area->next) {
2180  SpaceLink *sl = area->spacedata.first;
2181  if (sl->spacetype == SPACE_SEQ) {
2182  ARegion *region;
2183  for (region = area->regionbase.first; region; region = region->next) {
2184  if (region->regiontype == RGN_TYPE_WINDOW) {
2185  if (region->v2d.min[1] == 4.0f) {
2186  region->v2d.min[1] = 0.5f;
2187  }
2188  }
2189  }
2190  }
2191  for (sl = area->spacedata.first; sl; sl = sl->next) {
2192  if (sl->spacetype == SPACE_SEQ) {
2193  ARegion *region;
2194  for (region = sl->regionbase.first; region; region = region->next) {
2195  if (region->regiontype == RGN_TYPE_WINDOW) {
2196  if (region->v2d.min[1] == 4.0f) {
2197  region->v2d.min[1] = 0.5f;
2198  }
2199  }
2200  }
2201  }
2202  }
2203  }
2204  }
2205  }
2206 
2207  {
2208  /* Make "auto-clamped" handles a per-keyframe setting instead of per-FCurve
2209  *
2210  * We're only patching F-Curves in Actions here, since it is assumed that most
2211  * drivers out there won't be using this (and if they are, they're in the minority).
2212  * While we should aim to fix everything ideally, in practice it's far too hard
2213  * to get to every animdata block, not to mention the performance hit that'd have
2214  */
2215  bAction *act;
2216  FCurve *fcu;
2217 
2218  for (act = bmain->actions.first; act; act = act->id.next) {
2219  for (fcu = act->curves.first; fcu; fcu = fcu->next) {
2220  BezTriple *bezt;
2221  uint i = 0;
2222 
2223  /* only need to touch curves that had this flag set */
2224  if ((fcu->flag & FCURVE_AUTO_HANDLES) == 0) {
2225  continue;
2226  }
2227  if ((fcu->totvert == 0) || (fcu->bezt == NULL)) {
2228  continue;
2229  }
2230 
2231  /* only change auto-handles to auto-clamped */
2232  for (bezt = fcu->bezt; i < fcu->totvert; i++, bezt++) {
2233  if (bezt->h1 == HD_AUTO) {
2234  bezt->h1 = HD_AUTO_ANIM;
2235  }
2236  if (bezt->h2 == HD_AUTO) {
2237  bezt->h2 = HD_AUTO_ANIM;
2238  }
2239  }
2240 
2241  fcu->flag &= ~FCURVE_AUTO_HANDLES;
2242  }
2243  }
2244  }
2245  }
2246 
2247  if (!MAIN_VERSION_ATLEAST(bmain, 259, 2)) {
2248  {
2249  /* Convert default socket values from bNodeStack */
2250  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
2251  bNode *node;
2252  bNodeSocket *sock;
2253 
2254  for (node = ntree->nodes.first; node; node = node->next) {
2255  for (sock = node->inputs.first; sock; sock = sock->next) {
2257  }
2258  for (sock = node->outputs.first; sock; sock = sock->next) {
2260  }
2261  }
2262 
2263  for (sock = ntree->inputs.first; sock; sock = sock->next) {
2265  }
2266  for (sock = ntree->outputs.first; sock; sock = sock->next) {
2268  }
2269 
2271  }
2273  }
2274 
2275  {
2276  /* Initialize group tree nodetypes.
2277  * These are used to distinguish tree types and
2278  * associate them with specific node types for polling.
2279  */
2280  bNodeTree *ntree;
2281  /* all node trees in bmain->nodetree are considered groups */
2282  for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) {
2283  ntree->nodetype = NODE_GROUP;
2284  }
2285  }
2286  }
2287 
2288  if (!MAIN_VERSION_ATLEAST(bmain, 259, 4)) {
2289  {
2290  /* Adaptive time step for particle systems */
2291  ParticleSettings *part;
2292  for (part = bmain->particles.first; part; part = part->id.next) {
2293  part->courant_target = 0.2f;
2294  part->time_flag &= ~PART_TIME_AUTOSF;
2295  }
2296  }
2297  }
2298 }
2299 
2300 /* updates group node socket identifier so that
2301  * external links to/from the group node are preserved.
2302  */
2304 {
2305  bNodeTree *ngroup = (bNodeTree *)gnode->id;
2306  bNodeSocket *sock;
2307  bNodeLink *link;
2308 
2309  for (sock = gnode->outputs.first; sock; sock = sock->next) {
2310  int old_index = sock->to_index;
2311 
2312  for (link = ngroup->links.first; link; link = link->next) {
2313  if (link->tonode == NULL && link->fromsock->own_index == old_index) {
2314  strcpy(sock->identifier, link->fromsock->identifier);
2315  /* deprecated */
2316  sock->own_index = link->fromsock->own_index;
2317  sock->to_index = 0;
2318  sock->groupsock = NULL;
2319  }
2320  }
2321  }
2322  for (sock = gnode->inputs.first; sock; sock = sock->next) {
2323  int old_index = sock->to_index;
2324 
2325  for (link = ngroup->links.first; link; link = link->next) {
2326  if (link->fromnode == NULL && link->tosock->own_index == old_index) {
2327  strcpy(sock->identifier, link->tosock->identifier);
2328  /* deprecated */
2329  sock->own_index = link->tosock->own_index;
2330  sock->to_index = 0;
2331  sock->groupsock = NULL;
2332  }
2333  }
2334  }
2335 }
2336 
2338 {
2339  if (!MAIN_VERSION_ATLEAST(bmain, 256, 2)) {
2340  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
2341  /* updates external links for all group nodes in a tree */
2342  bNode *node;
2343  for (node = ntree->nodes.first; node; node = node->next) {
2344  if (node->type == NODE_GROUP) {
2345  bNodeTree *ngroup = (bNodeTree *)node->id;
2346  if (ngroup) {
2348  }
2349  }
2350  }
2351  }
2353  }
2354 
2355  if (!MAIN_VERSION_ATLEAST(bmain, 258, 0)) {
2356  /* Some very old (original comments claim pre-2.57) versioning that was wrongly done in
2357  * lib-linking code... Putting it here just to be sure (this is also checked at runtime anyway
2358  * by `action_idcode_patch_check`). */
2359  ID *id;
2360  FOREACH_MAIN_ID_BEGIN (bmain, id) {
2361  AnimData *adt = BKE_animdata_from_id(id);
2362  if (adt != NULL) {
2363  /* Fix actions' id-roots (i.e. if they come from a pre 2.57 .blend file). */
2364  if ((adt->action) && (adt->action->idroot == 0)) {
2365  adt->action->idroot = GS(id->name);
2366  }
2367  if ((adt->tmpact) && (adt->tmpact->idroot == 0)) {
2368  adt->tmpact->idroot = GS(id->name);
2369  }
2370 
2371  LISTBASE_FOREACH (NlaTrack *, nla_track, &adt->nla_tracks) {
2372  LISTBASE_FOREACH (NlaStrip *, nla_strip, &nla_track->strips) {
2373  if ((nla_strip->act) && (nla_strip->act->idroot == 0)) {
2374  nla_strip->act->idroot = GS(id->name);
2375  }
2376  }
2377  }
2378  }
2379  }
2381  }
2382 }
typedef float(TangentPoint)[2]
struct AnimData * BKE_animdata_from_id(const struct ID *id)
void animviz_settings_init(struct bAnimVizSettings *avs)
void mat3_to_vec_roll(const float mat[3][3], float r_vec[3], float *r_roll)
Definition: armature.c:2056
void BKE_scopes_new(struct Scopes *scopes)
Definition: colortools.c:1773
bool CustomData_free_layer_active(struct CustomData *data, int type, int totelem)
Definition: customdata.cc:2895
@ G_DEBUG
Definition: BKE_global.h:174
void BKE_lib_libblock_session_uuid_ensure(struct ID *id)
Definition: lib_id.c:1140
bool BKE_id_new_name_validate(struct Main *bmain, struct ListBase *lb, struct ID *id, const char *name, bool do_linked_data) ATTR_NONNULL(1
#define FOREACH_MAIN_ID_END
Definition: BKE_main.h:367
#define MAIN_VERSION_ATLEAST(main, ver, subver)
Definition: BKE_main.h:427
const char * BKE_main_blendfile_path(const struct Main *bmain) ATTR_NONNULL()
#define FOREACH_MAIN_ID_BEGIN(_bmain, _id)
Definition: BKE_main.h:361
void BKE_modifier_mdef_compact_influences(struct ModifierData *md)
struct ModifierData * BKE_modifiers_findby_type(const struct Object *ob, ModifierType type)
struct ModifierData * BKE_modifier_new(int type)
void nodeUniqueName(struct bNodeTree *ntree, struct bNode *node)
Definition: node.cc:2127
#define CMP_NODE_COLORBALANCE
Definition: BKE_node.h:1255
int nodeSocketIsHidden(const struct bNodeSocket *sock)
#define FOREACH_NODETREE_END
Definition: BKE_node.h:1058
#define TEX_NODE_OUTPUT
Definition: BKE_node.h:1347
#define FOREACH_NODETREE_BEGIN(bmain, _nodetree, _id)
Definition: BKE_node.h:1048
int nodeCountSocketLinks(const struct bNodeTree *ntree, const struct bNodeSocket *sock)
#define CMP_NODE_BLUR
Definition: BKE_node.h:1206
void BKE_ntree_update_tag_interface(struct bNodeTree *ntree)
void BKE_ntree_update_tag_all(struct bNodeTree *ntree)
void BKE_ntree_update_tag_link_added(struct bNodeTree *ntree, struct bNodeLink *link)
void BKE_ptcache_ids_from_object(struct ListBase *lb, struct Object *ob, struct Scene *scene, int duplis)
Definition: pointcache.c:1250
void BKE_screen_view3d_do_versions_250(struct View3D *v3d, ListBase *regions)
Definition: screen.c:1441
void BKE_area_region_free(struct SpaceType *st, struct ARegion *region)
Definition: screen.c:626
struct SpaceType * BKE_spacetype_from_id(int spaceid)
Definition: screen.c:353
struct bSound * BKE_sound_new_file(struct Main *main, const char *filepath)
void BKE_texture_mtex_default(struct MTex *mtex)
Definition: texture.c:384
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
Definition: BLI_listbase.h:269
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:336
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:239
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition: listbase.c:466
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:80
void BLI_insertlinkbefore(struct ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
Definition: listbase.c:340
#define M_PI
Definition: BLI_math_base.h:20
MINLINE void srgb_to_linearrgb_v3_v3(float linear[3], const float srgb[3])
void copy_m3_m4(float m1[3][3], const float m2[4][4])
Definition: math_matrix.c:87
void unit_qt(float q[4])
Definition: math_rotation.c:27
void unit_axis_angle(float axis[3], float *angle)
Definition: math_rotation.c:19
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE bool is_zero_v4(const float a[4]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE bool is_zero_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
#define FILE_MAX
#define FILE_MAXDIR
bool BLI_path_abs(char *path, const char *basepath) ATTR_NONNULL()
Definition: path_util.c:897
void BLI_join_dirfile(char *__restrict dst, size_t maxlen, const char *__restrict dir, const char *__restrict file) ATTR_NONNULL()
Definition: path_util.c:1531
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
Definition: string.c:64
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
unsigned int uint
Definition: BLI_sys_types.h:67
#define ARRAY_SIZE(arr)
#define UNUSED(x)
#define ELEM(...)
#define MIN2(a, b)
#define IS_EQF(a, b)
Compatibility-like things for windows.
external readfile function prototypes.
@ LIB_TAG_TEMP_MAIN
Definition: DNA_ID.h:757
@ LIB_FAKEUSER
Definition: DNA_ID.h:630
@ ID_GD
Definition: DNA_ID_enums.h:71
@ MOTIONPATH_BAKE_HEADS
@ MOTIONPATH_TYPE_ACFRA
@ MOTIONPATH_VIEW_KFNOS
@ MOTIONPATH_VIEW_FNUMS
@ MOTIONPATH_VIEW_KFRAS
@ ROT_MODE_EUL
@ SACTCONT_SHAPEKEY
@ BRUSH_SPACE_ATTEN
@ CURVE_PRESET_SMOOTH
@ CONSTRAINT_TYPE_ROTLIMIT
@ CONSTRAINT_TYPE_KINEMATIC
@ CU_TYPE
@ HD_AUTO_ANIM
@ HD_AUTO
@ FLUID_FLOW_INITVELOCITY
@ eModifierType_MeshDeform
@ eModifierType_Solidify
@ eModifierType_Fluidsim
@ eModifierType_Curve
@ eModifierType_Lattice
@ eModifierType_Cloth
@ eModifierType_Fluid
@ eModifierType_Ocean
@ eModifierType_Armature
@ eModifierType_Multires
@ MOD_FLUID_TYPE_DOMAIN
@ MOD_FLUID_TYPE_FLOW
@ SOCK_OUT
@ SOCK_IN
@ SOCK_VECTOR
@ SOCK_FLOAT
@ SOCK_RGBA
#define OB_MODE_ALL_PAINT
@ OB_TEXTURE
@ OB_SOLID
@ OB_MATERIAL
@ OB_MODE_POSE
#define OB_FLUIDSIM_ACTIVE
#define OB_FLUIDSIM_OVERRIDE_TIME
#define PFIELD_SHAPE_SURFACE
#define PFIELD_PLANAR
#define PFIELD_SURFACE
#define PFIELD_SHAPE_PLANE
#define PFIELD_DO_LOCATION
Object is a sort of wrapper for general info.
@ OB_LATTICE
@ OB_CAMERA
@ OB_ARMATURE
@ OB_CURVES_LEGACY
@ PARSKEL
@ PAROBJECT
#define PART_DRAW_DOT
#define PART_DRAW_HALO
#define PART_DRAW_COL_MAT
#define PART_TIME_AUTOSF
#define PART_DRAW_REND
#define PART_DRAW_AXIS
@ PART_DRAW_MAT_COL
#define PART_HAIR_REGROW
@ PTCACHE_DISK_CACHE
#define SCE_SELECT_PATH
#define PHYS_GLOBAL_GRAVITY
#define MAXFRAMEF
#define SCE_SELECT_VERTEX
#define UV_SELECT_VERTEX
@ R_COLOR_MANAGEMENT
@ RGN_FLAG_HIDDEN
@ RGN_TYPE_CHANNELS
@ RGN_TYPE_UI
@ RGN_TYPE_WINDOW
@ RGN_TYPE_PREVIEW
@ RGN_TYPE_HEADER
@ RGN_TYPE_TOOLS
@ RGN_TYPE_TOOL_PROPS
@ RGN_ALIGN_BOTTOM
@ RGN_ALIGN_LEFT
@ RGN_ALIGN_TOP
@ RGN_ALIGN_RIGHT
@ RGN_SPLIT_PREV
@ TIME_ALL_3D_WIN
@ TIME_ALL_ANIM_WIN
@ SEQ_TYPE_SOUND_HD
@ SPACE_TEXT
@ SPACE_ACTION
@ SPACE_OUTLINER
@ SPACE_NODE
@ SPACE_FILE
@ SPACE_PROPERTIES
@ SPACE_NLA
@ SPACE_SEQ
@ SPACE_EMPTY
@ SPACE_IMAGE
@ SPACE_GRAPH
@ SPACE_VIEW3D
@ SPACE_INFO
@ SEQ_VIEW_SEQUENCE
@ INFO_RPT_OP
@ ST_FIND_WRAP
@ SEQ_DRAW_IMG_IMBUF
@ V2D_KEEPTOT_BOUNDS
@ V2D_KEEPTOT_FREE
@ V2D_KEEPTOT_STRICT
@ V2D_LOCKOFS_X
@ V2D_LOCKOFS_Y
@ V2D_LIMITZOOM
@ V2D_LOCKZOOM_X
@ V2D_KEEPZOOM
@ V2D_KEEPASPECT
@ V2D_LOCKZOOM_Y
@ V2D_PIXELOFS_X
@ V2D_IS_INIT
@ V2D_PIXELOFS_Y
@ V2D_VIEWSYNC_AREA_VERTICAL
@ V2D_SCROLL_LEFT
@ V2D_SCROLL_VERTICAL_HANDLES
@ V2D_SCROLL_RIGHT
@ V2D_SCROLL_BOTTOM
@ V2D_SCROLL_HORIZONTAL_HANDLES
@ V2D_ALIGN_NO_NEG_X
@ V2D_ALIGN_NO_NEG_Y
@ V2D_ALIGN_NO_POS_Y
@ V2D_ALIGN_FREE
#define V3D_HIDE_OVERLAYS
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
NODE_GROUP
@ PROP_NONE
Definition: RNA_types.h:126
int main(int argc, char *argv[])
unsigned int U
Definition: btGjkEpa3.h:78
OperationNode * node
Scene scene
void * user_data
bNodeTree * ntree
DRWShaderLibrary * lib
#define str(s)
#define GS(x)
Definition: iris.c:225
void SEQ_for_each_callback(ListBase *seqbase, SeqForEachFunc callback, void *user_data)
Definition: iterator.c:76
void *(* MEM_calloc_arrayN)(size_t len, size_t size, const char *str)
Definition: mallocn.c:32
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
#define G(x, y, z)
static unsigned a[3]
Definition: RandGen.cpp:78
uint convert(uint c, uint inbits, uint outbits)
Definition: PixelFormat.h:45
static void area(int d1, int d2, int e1, int e2, float weights[2])
static const pxr::TfToken st("st", pxr::TfToken::Immortal)
void * blo_do_versions_newlibadr(FileData *fd, const void *lib, const void *adr)
Definition: readfile.c:1632
void blo_do_version_old_trackto_to_constraints(struct Object *ob)
static void do_gravity(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, float bstrength)
Definition: sculpt.c:3063
struct ARegion * next
short alignment
short regiontype
bAction * action
bAction * tmpact
ListBase nla_tracks
float doppler_factor
float speed_of_sound
float vec[4]
float tilt
struct Base * next
struct Object * object
uint8_t h1
float vec[3][3]
uint8_t h2
float arm_mat[4][4]
struct Bone * next
ListBase childbase
float arm_roll
float alpha
float add_col[4]
struct MTex mtex
int texture_overlay_alpha
float unprojected_radius
float smooth_stroke_factor
short ob_mode
int smooth_stroke_radius
struct CurveMapping * curve
float plane_trim
float height
float sub_col[4]
float crease_pinch_factor
struct MTex mask_mtex
float rate
short flag
struct ClothSimSettings * sim_parms
struct EffectorWeights * effector_weights
CBData data[32]
struct Object * object
struct Key * key
float smallcaps_scale
ListBase nurb
ListBase seqbase
ListBase * seqbasep
struct FCurve * next
BezTriple * bezt
short flag
unsigned int totvert
struct FluidDomainSettings * domain
struct FluidFlowSettings * flow
struct FluidsimSettings * fss
struct FluidsimModifierData * fmd
Definition: DNA_ID.h:368
int tag
Definition: DNA_ID.h:387
struct Library * lib
Definition: DNA_ID.h:372
void * next
Definition: DNA_ID.h:369
char name[66]
Definition: DNA_ID.h:378
float slidermax
Definition: DNA_key_types.h:58
float slidermin
Definition: DNA_key_types.h:57
struct KeyBlock * next
Definition: DNA_key_types.h:25
void * data
Definition: DNA_key_types.h:50
ID id
Definition: DNA_key_types.h:63
ListBase block
Definition: DNA_key_types.h:84
KeyBlock * refkey
Definition: DNA_key_types.h:72
struct Object * object
struct Key * key
struct BPoint * def
void * last
Definition: DNA_listBase.h:31
void * first
Definition: DNA_listBase.h:31
float co[3]
Definition: BKE_main.h:121
ListBase brushes
Definition: BKE_main.h:193
ListBase scenes
Definition: BKE_main.h:168
short subversionfile
Definition: BKE_main.h:125
ListBase textures
Definition: BKE_main.h:175
ListBase actions
Definition: BKE_main.h:191
ListBase meshes
Definition: BKE_main.h:171
ListBase nodetrees
Definition: BKE_main.h:192
ListBase particles
Definition: BKE_main.h:194
ListBase materials
Definition: BKE_main.h:174
ListBase lattices
Definition: BKE_main.h:177
ListBase sounds
Definition: BKE_main.h:188
ListBase shapekeys
Definition: BKE_main.h:181
ListBase armatures
Definition: BKE_main.h:190
ListBase curves
Definition: BKE_main.h:172
ListBase screens
Definition: BKE_main.h:183
short versionfile
Definition: BKE_main.h:125
ListBase objects
Definition: BKE_main.h:170
struct bNodeTree * nodetree
struct MVert * mvert
int totvert
int totface
CustomData fdata
struct Key * key
struct ModifierData * next
ListBase strips
struct Nurb * next
short type
BezTriple * bezt
BPoint * bp
short partype
ListBase constraints
struct bPose * pose
ListBase modifiers
float dquat[4]
char * matbits
struct PartDeflect * pd
struct SoftBody * soft
float drotAxis[3]
float quat[4]
short rotmode
float rotAxis[3]
float drotAngle
struct Object * parent
void * data
bAnimVizSettings avs
struct OceanCache * oceancache
struct ListBase * ptcaches
struct PTCacheID * next
struct PointCache * cache
ParticleBrushData brush[7]
struct BoidSettings * boids
struct EffectorWeights * effector_weights
struct FFMpegCodecData ffcodecdata
struct bNodeTree * nodetree
struct PhysicsSettings physics_settings
struct ToolSettings * toolsettings
struct Editing * ed
struct RenderData r
struct UnitSettings unit
struct AudioData audio
struct bSound * sound
struct EffectorWeights * effector_weights
bAction * action
struct Scopes scopes
struct Histogram sample_line_hist
struct bGPdata * gpd
struct bGPdata * gpd
struct bGPdata * gpd
char name[256]
StripProxy * proxy
StripElem * stripdata
char dir[768]
float saturation
struct ColorBand * coba
struct bNodeTree * nodetree
struct ParticleEditSettings particle
short flag
float minzoom
short align
short keeptot
float max[2]
short keepzoom
short keepofs
float min[2]
short scroll
float maxzoom
ListBase curves
ListBase bonebase
struct bConstraint * next
char name[64]
struct bNodeLink * link
struct bNodeSocket * next
struct bNodeSocket * prev
void * default_value
ListBase nodes
ListBase inputs
ListBase links
ListBase outputs
ListBase inputs
struct ID * id
ListBase outputs
ListBase constraints
struct bPoseChannel * next
ListBase chanbase
bAnimVizSettings avs
short redraws_flag
ListBase areabase
struct PackedFile * packedfile
struct PackedFile * newpackedfile
float xmax
Definition: DNA_vec_types.h:69
float xmin
Definition: DNA_vec_types.h:69
float ymax
Definition: DNA_vec_types.h:70
float ymin
Definition: DNA_vec_types.h:70
static void versions_gpencil_add_main(Main *bmain, ListBase *lb, ID *id, const char *name)
static bNodeSocket * do_versions_node_group_add_socket_2_56_2(bNodeTree *ngroup, const char *name, int type, int in_out)
static void do_versions_windowmanager_2_50(bScreen *screen)
void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
void do_versions_after_linking_250(Main *bmain)
#define SEQ_USE_PROXY_CUSTOM_DIR
static void lib_node_do_versions_group_indices(bNode *gnode)
static bool seq_set_pitch_cb(Sequence *seq, void *UNUSED(user_data))
static bool seq_set_volume_cb(Sequence *seq, void *UNUSED(user_data))
#define SEQ_USE_PROXY_CUSTOM_FILE
static void do_versions_gpencil_2_50(Main *main, bScreen *screen)
static void do_version_constraints_radians_degrees_250(ListBase *lb)
static bool seq_sound_proxy_update_cb(Sequence *seq, void *user_data)
static void area_add_window_regions(ScrArea *area, SpaceLink *sl, ListBase *lb)
static void do_version_bone_roll_256(Bone *bone)
static void do_version_mdef_250(Main *main)
static void sequencer_init_preview_region(ARegion *region)
static void do_versions_socket_default_value_259(bNodeSocket *sock)
static bool seq_set_sat_cb(Sequence *seq, void *UNUSED(user_data))
static void area_add_header_region(ScrArea *area, ListBase *lb)