Blender  V3.3
versioning_legacy.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
8 #include <limits.h>
9 
10 #ifndef WIN32
11 # include <unistd.h> /* for read close */
12 #else
13 # include "BLI_winstuff.h"
14 # include "winsock2.h"
15 # include <io.h> /* for open close read */
16 #endif
17 
18 /* allow readfile to use deprecated functionality */
19 #define DNA_DEPRECATED_ALLOW
20 
21 #include "DNA_armature_types.h"
22 #include "DNA_camera_types.h"
23 #include "DNA_collection_types.h"
24 #include "DNA_constraint_types.h"
25 #include "DNA_effect_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_nla_types.h"
33 #include "DNA_node_types.h"
35 #include "DNA_object_force_types.h"
36 #include "DNA_object_types.h"
37 #include "DNA_screen_types.h"
38 #include "DNA_sdna_types.h"
39 #include "DNA_sequence_types.h"
40 #include "DNA_sound_types.h"
41 #include "DNA_space_types.h"
42 #include "DNA_vfont_types.h"
43 #include "DNA_view3d_types.h"
44 #include "DNA_world_types.h"
45 
46 #include "MEM_guardedalloc.h"
47 
48 #include "BLI_blenlib.h"
49 #include "BLI_math.h"
50 #include "BLI_utildefines.h"
51 
52 #include "BKE_action.h"
53 #include "BKE_armature.h"
54 #include "BKE_colortools.h"
55 #include "BKE_constraint.h"
56 #include "BKE_deform.h"
57 #include "BKE_fcurve.h"
58 #include "BKE_lattice.h"
59 #include "BKE_main.h" /* for Main */
60 #include "BKE_mesh.h" /* for ME_ defines (patching) */
61 #include "BKE_modifier.h"
62 #include "BKE_object.h"
63 #include "BKE_particle.h"
64 #include "BKE_pointcache.h"
65 
66 #include "SEQ_iterator.h"
67 #include "SEQ_sequencer.h"
68 
69 #include "NOD_socket.h"
70 
71 #include "BLO_readfile.h"
72 
73 #include "readfile.h"
74 
75 #include "PIL_time.h"
76 
77 #include <errno.h>
78 
79 /* Make preferences read-only, use versioning_userdef.c. */
80 #define U (*((const UserDef *)&U))
81 
82 static void vcol_to_fcol(Mesh *me)
83 {
84  MFace *mface;
85  uint *mcol, *mcoln, *mcolmain;
86  int a;
87 
88  if (me->totface == 0 || me->mcol == NULL) {
89  return;
90  }
91 
92  mcoln = mcolmain = MEM_malloc_arrayN(me->totface, sizeof(int[4]), "mcoln");
93  mcol = (uint *)me->mcol;
94  mface = me->mface;
95  for (a = me->totface; a > 0; a--, mface++) {
96  mcoln[0] = mcol[mface->v1];
97  mcoln[1] = mcol[mface->v2];
98  mcoln[2] = mcol[mface->v3];
99  mcoln[3] = mcol[mface->v4];
100  mcoln += 4;
101  }
102 
103  MEM_freeN(me->mcol);
104  me->mcol = (MCol *)mcolmain;
105 }
106 
108 {
109  Bone *child;
110  float vec[3];
111 
112  /* head */
113  copy_v3_v3(bone->arm_head, bone->arm_mat[3]);
114 
115  /* tail is in current local coord system */
116  copy_v3_v3(vec, bone->arm_mat[1]);
117  mul_v3_fl(vec, bone->length);
118  add_v3_v3v3(bone->arm_tail, bone->arm_head, vec);
119 
120  for (child = bone->childbase.first; child; child = child->next) {
122  }
123 }
124 
125 static void bone_version_238(ListBase *lb)
126 {
127  Bone *bone;
128 
129  for (bone = lb->first; bone; bone = bone->next) {
130  if (bone->rad_tail == 0.0f && bone->rad_head == 0.0f) {
131  bone->rad_head = 0.25f * bone->length;
132  bone->rad_tail = 0.1f * bone->length;
133 
134  bone->dist -= bone->rad_head;
135  if (bone->dist <= 0.0f) {
136  bone->dist = 0.0f;
137  }
138  }
139  bone_version_238(&bone->childbase);
140  }
141 }
142 
143 static void bone_version_239(ListBase *lb)
144 {
145  Bone *bone;
146 
147  for (bone = lb->first; bone; bone = bone->next) {
148  if (bone->layer == 0) {
149  bone->layer = 1;
150  }
151  bone_version_239(&bone->childbase);
152  }
153 }
154 
156 {
157  bNode *node;
158 
159  if (ntree->type == NTREE_COMPOSIT) {
160  for (node = ntree->nodes.first; node; node = node->next) {
161  if (node->type == CMP_NODE_BLUR) {
162  if (node->storage == NULL) {
163  NodeBlurData *nbd = MEM_callocN(sizeof(NodeBlurData), "node blur patch");
164  nbd->sizex = node->custom1;
165  nbd->sizey = node->custom2;
166  nbd->filtertype = R_FILTER_QUAD;
167  node->storage = nbd;
168  }
169  }
170  else if (node->type == CMP_NODE_VECBLUR) {
171  if (node->storage == NULL) {
172  NodeBlurData *nbd = MEM_callocN(sizeof(NodeBlurData), "node blur patch");
173  nbd->samples = node->custom1;
174  nbd->maxspeed = node->custom2;
175  nbd->fac = 1.0f;
176  node->storage = nbd;
177  }
178  }
179  }
180  }
181 }
182 
184 {
185  bNode *node;
186 
187  if (ntree->type == NTREE_COMPOSIT) {
188  for (node = ntree->nodes.first; node; node = node->next) {
189  if (node->type == CMP_NODE_HUE_SAT) {
190  if (node->storage) {
191  NodeHueSat *nhs = node->storage;
192  if (nhs->val == 0.0f) {
193  nhs->val = 1.0f;
194  }
195  }
196  }
197  }
198  }
199 }
200 
202 {
203  bNode *node;
204  NodeTwoFloats *ntf;
205  ID *nodeid;
206  Image *image;
207  ImageUser *iuser;
208 
209  if (ntree->type == NTREE_COMPOSIT) {
210  for (node = ntree->nodes.first; node; node = node->next) {
211  if (node->type == CMP_NODE_ALPHAOVER) {
212  if (!node->storage) {
213  ntf = MEM_callocN(sizeof(NodeTwoFloats), "NodeTwoFloats");
214  node->storage = ntf;
215  if (node->custom1) {
216  ntf->x = 1.0f;
217  }
218  }
219  }
220 
221  /* fix for temporary flag changes during 245 cycle */
222  nodeid = blo_do_versions_newlibadr(fd, lib, node->id);
223  if (node->storage && nodeid && GS(nodeid->name) == ID_IM) {
224  image = (Image *)nodeid;
225  iuser = node->storage;
226  if (iuser->flag & IMA_OLD_PREMUL) {
227  iuser->flag &= ~IMA_OLD_PREMUL;
228  }
229  if (iuser->flag & IMA_DO_PREMUL) {
230  image->flag &= ~IMA_OLD_PREMUL;
231  image->alpha_mode = IMA_ALPHA_STRAIGHT;
232  }
233  }
234  }
235  }
236 }
237 
239 {
240  IDProperty *loop;
241  int i;
242 
243  for (loop = prop->data.group.first, i = 0; loop; loop = loop->next, i++) {
244  if (loop->type == IDP_GROUP) {
246  }
247  }
248 
249  if (prop->len != i) {
250  printf("Found and fixed bad id property group length.\n");
251  prop->len = i;
252  }
253 }
254 
256 {
257  ID *id;
258 
259  for (id = idlist.first; id; id = id->next) {
260  if (id->properties) {
262  }
263  }
264 }
265 
266 static void customdata_version_242(Mesh *me)
267 {
268  CustomDataLayer *layer;
269  MTFace *mtf;
270  MCol *mcol;
271  TFace *tf;
272  int a, mtfacen, mcoln;
273 
274  if (!me->vdata.totlayer) {
276 
277  if (me->dvert) {
279  }
280  }
281 
282  if (!me->edata.totlayer) {
284  }
285 
286  if (!me->fdata.totlayer) {
288 
289  if (me->tface) {
290  if (me->mcol) {
291  MEM_freeN(me->mcol);
292  }
293 
296 
297  mtf = me->mtface;
298  mcol = me->mcol;
299  tf = me->tface;
300 
301  for (a = 0; a < me->totface; a++, mtf++, tf++, mcol += 4) {
302  memcpy(mcol, tf->col, sizeof(tf->col));
303  memcpy(mtf->uv, tf->uv, sizeof(tf->uv));
304  }
305 
306  MEM_freeN(me->tface);
307  me->tface = NULL;
308  }
309  else if (me->mcol) {
310  me->mcol = CustomData_add_layer(&me->fdata, CD_MCOL, CD_ASSIGN, me->mcol, me->totface);
311  }
312  }
313 
314  if (me->tface) {
315  MEM_freeN(me->tface);
316  me->tface = NULL;
317  }
318 
319  for (a = 0, mtfacen = 0, mcoln = 0; a < me->fdata.totlayer; a++) {
320  layer = &me->fdata.layers[a];
321 
322  if (layer->type == CD_MTFACE) {
323  if (layer->name[0] == 0) {
324  if (mtfacen == 0) {
325  strcpy(layer->name, "UVMap");
326  }
327  else {
328  BLI_snprintf(layer->name, sizeof(layer->name), "UVMap.%.3d", mtfacen);
329  }
330  }
331  mtfacen++;
332  }
333  else if (layer->type == CD_MCOL) {
334  if (layer->name[0] == 0) {
335  if (mcoln == 0) {
336  strcpy(layer->name, "Col");
337  }
338  else {
339  BLI_snprintf(layer->name, sizeof(layer->name), "Col.%.3d", mcoln);
340  }
341  }
342  mcoln++;
343  }
344  }
345 
347 }
348 
349 /* Only copy render texface layer from active. */
350 static void customdata_version_243(Mesh *me)
351 {
352  CustomDataLayer *layer;
353  int a;
354 
355  for (a = 0; a < me->fdata.totlayer; a++) {
356  layer = &me->fdata.layers[a];
357  layer->active_rnd = layer->active;
358  }
359 }
360 
361 /* struct NodeImageAnim moved to ImageUser, and we make it default available */
363 {
364  bNode *node;
365 
366  if (ntree->type == NTREE_COMPOSIT) {
367  for (node = ntree->nodes.first; node; node = node->next) {
369  /* only image had storage */
370  if (node->storage) {
371  NodeImageAnim *nia = node->storage;
372  ImageUser *iuser = MEM_callocN(sizeof(ImageUser), "ima user node");
373 
374  iuser->frames = nia->frames;
375  iuser->sfra = nia->sfra;
376  iuser->offset = nia->nr - 1;
377  iuser->cycl = nia->cyclic;
378 
379  node->storage = iuser;
380  MEM_freeN(nia);
381  }
382  else {
383  ImageUser *iuser = node->storage = MEM_callocN(sizeof(ImageUser), "node image user");
384  iuser->sfra = 1;
385  }
386  }
387  }
388  }
389 }
390 
392 {
393  PartEff *paf;
394 
395  if (eff->type == EFF_PARTICLE) {
396  paf = (PartEff *)eff;
397  if (paf->keys) {
398  MEM_freeN(paf->keys);
399  }
400  }
401  MEM_freeN(eff);
402 }
403 
405 {
406  Effect *eff;
407 
408  while ((eff = BLI_pophead(lb))) {
410  }
411 }
412 
414 {
415  bConstraint *con;
416  bConstraintTarget *ct;
417 
418  for (con = lb->first; con; con = con->next) {
419  if (con->type == CONSTRAINT_TYPE_PYTHON) {
421  if (data->tar) {
422  /* version patching needs to be done */
423  ct = MEM_callocN(sizeof(bConstraintTarget), "PyConTarget");
424 
425  ct->tar = data->tar;
426  BLI_strncpy(ct->subtarget, data->subtarget, sizeof(ct->subtarget));
427  ct->space = con->tarspace;
428 
429  BLI_addtail(&data->targets, ct);
430  data->tarnum++;
431 
432  /* clear old targets to avoid problems */
433  data->tar = NULL;
434  data->subtarget[0] = '\0';
435  }
436  }
437  else if (con->type == CONSTRAINT_TYPE_LOCLIKE) {
439 
440  /* new headtail functionality makes Bone-Tip function obsolete */
441  if (data->flag & LOCLIKE_TIP) {
442  con->headtail = 1.0f;
443  }
444  }
445  }
446 }
447 
449 {
450  /* create new trackto constraint from the relationship */
451  if (ob->track) {
453  bTrackToConstraint *data = con->data;
454 
455  /* copy tracking settings from the object */
456  data->tar = ob->track;
457  data->reserved1 = ob->trackflag;
458  data->reserved2 = ob->upflag;
459  }
460 
461  /* clear old track setting */
462  ob->track = NULL;
463 }
464 
466 {
467  if (ELEM(seq->type, SEQ_TYPE_IMAGE, SEQ_TYPE_MOVIE)) {
469  }
470  return true;
471 }
472 
474 {
475  if (seq->blend_mode == 0) {
476  seq->blend_opacity = 100.0f;
477  }
478  return true;
479 }
480 
481 /* NOLINTNEXTLINE: readability-function-size */
483 {
484  /* WATCH IT!!!: pointers from libdata have not been converted */
485 
486  if (bmain->versionfile == 100) {
487  /* tex->extend and tex->imageflag have changed: */
488  Tex *tex = bmain->textures.first;
489  while (tex) {
490  if (tex->id.tag & LIB_TAG_NEED_LINK) {
491 
492  if (tex->extend == 0) {
493  if (tex->xrepeat || tex->yrepeat) {
494  tex->extend = TEX_REPEAT;
495  }
496  else {
497  tex->extend = TEX_EXTEND;
498  tex->xrepeat = tex->yrepeat = 1;
499  }
500  }
501  }
502  tex = tex->id.next;
503  }
504  }
505 
506  if (bmain->versionfile <= 101) {
507  /* frame mapping */
508  Scene *sce = bmain->scenes.first;
509  while (sce) {
510  sce->r.framapto = 100;
511  sce->r.images = 100;
512  sce->r.framelen = 1.0;
513  sce = sce->id.next;
514  }
515  }
516 
517  if (bmain->versionfile <= 103) {
518  /* new variable in object: colbits */
519  Object *ob = bmain->objects.first;
520  int a;
521  while (ob) {
522  ob->colbits = 0;
523  if (ob->totcol) {
524  for (a = 0; a < ob->totcol; a++) {
525  if (ob->mat[a]) {
526  ob->colbits |= (1 << a);
527  }
528  }
529  }
530  ob = ob->id.next;
531  }
532  }
533 
534  if (bmain->versionfile <= 104) {
535  /* timeoffs moved */
536  Object *ob = bmain->objects.first;
537  while (ob) {
538  if (ob->transflag & 1) {
539  ob->transflag -= 1;
540  }
541  ob = ob->id.next;
542  }
543  }
544 
545  if (bmain->versionfile <= 106) {
546  /* mcol changed */
547  Mesh *me = bmain->meshes.first;
548  while (me) {
549  if (me->mcol) {
550  vcol_to_fcol(me);
551  }
552  me = me->id.next;
553  }
554  }
555 
556  if (bmain->versionfile <= 107) {
557  Object *ob;
558  ob = bmain->objects.first;
559  while (ob) {
560  if (ob->dt == 0) {
561  ob->dt = OB_SOLID;
562  }
563  ob = ob->id.next;
564  }
565  }
566 
567  if (bmain->versionfile <= 109) {
568  /* New variable: `gridlines`. */
569  bScreen *screen = bmain->screens.first;
570  while (screen) {
571  ScrArea *area = screen->areabase.first;
572  while (area) {
573  SpaceLink *sl = area->spacedata.first;
574  while (sl) {
575  if (sl->spacetype == SPACE_VIEW3D) {
576  View3D *v3d = (View3D *)sl;
577 
578  if (v3d->gridlines == 0) {
579  v3d->gridlines = 20;
580  }
581  }
582  sl = sl->next;
583  }
584  area = area->next;
585  }
586  screen = screen->id.next;
587  }
588  }
589 
590  if (bmain->versionfile <= 134) {
591  Tex *tex = bmain->textures.first;
592  while (tex) {
593  if ((tex->rfac == 0.0f) && (tex->gfac == 0.0f) && (tex->bfac == 0.0f)) {
594  tex->rfac = 1.0f;
595  tex->gfac = 1.0f;
596  tex->bfac = 1.0f;
597  tex->filtersize = 1.0f;
598  }
599  tex = tex->id.next;
600  }
601  }
602 
603  if (bmain->versionfile <= 140) {
604  /* r-g-b-fac in texture */
605  Tex *tex = bmain->textures.first;
606  while (tex) {
607  if ((tex->rfac == 0.0f) && (tex->gfac == 0.0f) && (tex->bfac == 0.0f)) {
608  tex->rfac = 1.0f;
609  tex->gfac = 1.0f;
610  tex->bfac = 1.0f;
611  tex->filtersize = 1.0f;
612  }
613  tex = tex->id.next;
614  }
615  }
616 
617  if (bmain->versionfile <= 153) {
618  Scene *sce = bmain->scenes.first;
619  while (sce) {
620  if (sce->r.blurfac == 0.0f) {
621  sce->r.blurfac = 1.0f;
622  }
623  sce = sce->id.next;
624  }
625  }
626 
627  if (bmain->versionfile <= 163) {
628  Scene *sce = bmain->scenes.first;
629  while (sce) {
630  if (sce->r.frs_sec == 0) {
631  sce->r.frs_sec = 25;
632  }
633  sce = sce->id.next;
634  }
635  }
636 
637  if (bmain->versionfile <= 164) {
638  Mesh *me = bmain->meshes.first;
639  while (me) {
640  me->smoothresh = 30;
641  me = me->id.next;
642  }
643  }
644 
645  if (bmain->versionfile <= 165) {
646  Mesh *me = bmain->meshes.first;
647  TFace *tface;
648  int nr;
649  char *cp;
650 
651  while (me) {
652  if (me->tface) {
653  nr = me->totface;
654  tface = me->tface;
655  while (nr--) {
656  int j;
657  for (j = 0; j < 4; j++) {
658  int k;
659  cp = ((char *)&tface->col[j]) + 1;
660  for (k = 0; k < 3; k++) {
661  cp[k] = (cp[k] > 126) ? 255 : cp[k] * 2;
662  }
663  }
664 
665  tface++;
666  }
667  }
668  me = me->id.next;
669  }
670  }
671 
672  if (bmain->versionfile <= 169) {
673  Mesh *me = bmain->meshes.first;
674  while (me) {
675  if (me->subdiv == 0) {
676  me->subdiv = 1;
677  }
678  me = me->id.next;
679  }
680  }
681 
682  if (bmain->versionfile <= 169) {
683  bScreen *screen = bmain->screens.first;
684  while (screen) {
685  ScrArea *area = screen->areabase.first;
686  while (area) {
687  SpaceLink *sl = area->spacedata.first;
688  while (sl) {
689  if (sl->spacetype == SPACE_GRAPH) {
690  SpaceGraph *sipo = (SpaceGraph *)sl;
691  sipo->v2d.max[0] = 15000.0;
692  }
693  sl = sl->next;
694  }
695  area = area->next;
696  }
697  screen = screen->id.next;
698  }
699  }
700 
701  if (bmain->versionfile <= 170) {
702  Object *ob = bmain->objects.first;
703  PartEff *paf;
704  while (ob) {
706  if (paf) {
707  if (paf->staticstep == 0) {
708  paf->staticstep = 5;
709  }
710  }
711  ob = ob->id.next;
712  }
713  }
714 
715  if (bmain->versionfile <= 171) {
716  bScreen *screen = bmain->screens.first;
717  while (screen) {
718  ScrArea *area = screen->areabase.first;
719  while (area) {
720  SpaceLink *sl = area->spacedata.first;
721  while (sl) {
722  if (sl->spacetype == SPACE_TEXT) {
723  SpaceText *st = (SpaceText *)sl;
724  st->lheight = 12;
725  }
726  sl = sl->next;
727  }
728  area = area->next;
729  }
730  screen = screen->id.next;
731  }
732  }
733 
734  if (bmain->versionfile <= 173) {
735  int a, b;
736  Mesh *me = bmain->meshes.first;
737  while (me) {
738  if (me->tface) {
739  TFace *tface = me->tface;
740  for (a = 0; a < me->totface; a++, tface++) {
741  for (b = 0; b < 4; b++) {
742  tface->uv[b][0] /= 32767.0f;
743  tface->uv[b][1] /= 32767.0f;
744  }
745  }
746  }
747  me = me->id.next;
748  }
749  }
750 
751  if (bmain->versionfile <= 204) {
752  bSound *sound;
753 
754  sound = bmain->sounds.first;
755  while (sound) {
756  if (sound->volume < 0.01f) {
757  sound->volume = 1.0f;
758  }
759  sound = sound->id.next;
760  }
761  }
762 
763  if (bmain->versionfile <= 212) {
764  bSound *sound;
765  Mesh *me;
766 
767  sound = bmain->sounds.first;
768  while (sound) {
769  sound->max_gain = 1.0;
770  sound->min_gain = 0.0;
771  sound->distance = 1.0;
772 
773  if (sound->attenuation > 0.0f) {
774  sound->flags |= SOUND_FLAGS_3D;
775  }
776  else {
777  sound->flags &= ~SOUND_FLAGS_3D;
778  }
779 
780  sound = sound->id.next;
781  }
782 
783  /* me->subdiv changed to reflect the actual reparametization
784  * better, and smeshes were removed - if it was a smesh make
785  * it a subsurf, and reset the subdiv level because subsurf
786  * takes a lot more work to calculate.
787  */
788  for (me = bmain->meshes.first; me; me = me->id.next) {
789  enum {
790  ME_SMESH = (1 << 6),
791  ME_SUBSURF = (1 << 7),
792  };
793  if (me->flag & ME_SMESH) {
794  me->flag &= ~ME_SMESH;
795  me->flag |= ME_SUBSURF;
796 
797  me->subdiv = 1;
798  }
799  else {
800  if (me->subdiv < 2) {
801  me->subdiv = 1;
802  }
803  else {
804  me->subdiv--;
805  }
806  }
807  }
808  }
809 
810  if (bmain->versionfile <= 220) {
811  Mesh *me;
812 
813  /* Began using alpha component of vertex colors, but
814  * old file vertex colors are undefined, reset them
815  * to be fully opaque. -zr
816  */
817  for (me = bmain->meshes.first; me; me = me->id.next) {
818  if (me->mcol) {
819  int i;
820 
821  for (i = 0; i < me->totface * 4; i++) {
822  MCol *mcol = &me->mcol[i];
823  mcol->a = 255;
824  }
825  }
826  if (me->tface) {
827  int i, j;
828 
829  for (i = 0; i < me->totface; i++) {
830  TFace *tf = &((TFace *)me->tface)[i];
831 
832  for (j = 0; j < 4; j++) {
833  char *col = (char *)&tf->col[j];
834 
835  col[0] = 255;
836  }
837  }
838  }
839  }
840  }
841 
842  if (bmain->versionfile <= 223) {
843  VFont *vf;
844  for (vf = bmain->fonts.first; vf; vf = vf->id.next) {
845  if (STREQ(vf->filepath + strlen(vf->filepath) - 6, ".Bfont")) {
846  strcpy(vf->filepath, FO_BUILTIN_NAME);
847  }
848  }
849  }
850 
851  if (bmain->versionfile <= 224) {
852  bSound *sound;
853  Scene *sce;
854  Mesh *me;
855  bScreen *screen;
856 
857  for (sound = bmain->sounds.first; sound; sound = sound->id.next) {
858  if (sound->packedfile) {
859  if (sound->newpackedfile == NULL) {
860  sound->newpackedfile = sound->packedfile;
861  }
862  sound->packedfile = NULL;
863  }
864  }
865  /* Make sure that old subsurf meshes don't have zero subdivision level for rendering */
866  for (me = bmain->meshes.first; me; me = me->id.next) {
867  enum { ME_SUBSURF = (1 << 7) };
868  if ((me->flag & ME_SUBSURF) && (me->subdivr == 0)) {
869  me->subdivr = me->subdiv;
870  }
871  }
872 
873  for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
874  sce->r.stereomode = 1; /* no stereo */
875  }
876 
877  /* some oldfile patch, moved from set_func_space */
878  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
879  ScrArea *area;
880 
881  for (area = screen->areabase.first; area; area = area->next) {
882  SpaceLink *sl;
883 
884  for (sl = area->spacedata.first; sl; sl = sl->next) {
885  if (sl->spacetype == SPACE_GRAPH) {
886  SpaceSeq *sseq = (SpaceSeq *)sl;
887  sseq->v2d.keeptot = 0;
888  }
889  }
890  }
891  }
892  }
893 
894  if (bmain->versionfile <= 227) {
895  Scene *sce;
896  bScreen *screen;
897  Object *ob;
898 
899  /* As of now, this insures that the transition from the old Track system
900  * to the new full constraint Track is painless for everyone. - theeth
901  */
902  ob = bmain->objects.first;
903 
904  while (ob) {
905  ListBase *list;
906  list = &ob->constraints;
907 
908  /* check for already existing TrackTo constraint
909  * set their track and up flag correctly
910  */
911 
912  if (list) {
913  bConstraint *curcon;
914  for (curcon = list->first; curcon; curcon = curcon->next) {
915  if (curcon->type == CONSTRAINT_TYPE_TRACKTO) {
916  bTrackToConstraint *data = curcon->data;
917  data->reserved1 = ob->trackflag;
918  data->reserved2 = ob->upflag;
919  }
920  }
921  }
922 
923  if (ob->type == OB_ARMATURE) {
924  if (ob->pose) {
925  bConstraint *curcon;
926  bPoseChannel *pchan;
927  for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
928  for (curcon = pchan->constraints.first; curcon; curcon = curcon->next) {
929  if (curcon->type == CONSTRAINT_TYPE_TRACKTO) {
930  bTrackToConstraint *data = curcon->data;
931  data->reserved1 = ob->trackflag;
932  data->reserved2 = ob->upflag;
933  }
934  }
935  }
936  }
937  }
938 
939  /* Change Ob->Track in real TrackTo constraint */
941 
942  ob = ob->id.next;
943  }
944 
945  for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
946  sce->audio.mixrate = 48000;
947  sce->audio.flag |= AUDIO_SCRUB;
948  }
949 
950  /* patch for old wrong max view2d settings, allows zooming out more */
951  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
952  ScrArea *area;
953 
954  for (area = screen->areabase.first; area; area = area->next) {
955  SpaceLink *sl;
956 
957  for (sl = area->spacedata.first; sl; sl = sl->next) {
958  if (sl->spacetype == SPACE_ACTION) {
959  SpaceAction *sac = (SpaceAction *)sl;
960  sac->v2d.max[0] = 32000;
961  }
962  else if (sl->spacetype == SPACE_NLA) {
963  SpaceNla *sla = (SpaceNla *)sl;
964  sla->v2d.max[0] = 32000;
965  }
966  }
967  }
968  }
969  }
970 
971  if (bmain->versionfile <= 228) {
972  bScreen *screen;
973  Object *ob;
974 
975  /* As of now, this insures that the transition from the old Track system
976  * to the new full constraint Track is painless for everyone.
977  */
978  ob = bmain->objects.first;
979 
980  while (ob) {
981  ListBase *list;
982  list = &ob->constraints;
983 
984  /* check for already existing TrackTo constraint
985  * set their track and up flag correctly */
986 
987  if (list) {
988  bConstraint *curcon;
989  for (curcon = list->first; curcon; curcon = curcon->next) {
990  if (curcon->type == CONSTRAINT_TYPE_TRACKTO) {
991  bTrackToConstraint *data = curcon->data;
992  data->reserved1 = ob->trackflag;
993  data->reserved2 = ob->upflag;
994  }
995  }
996  }
997 
998  if (ob->type == OB_ARMATURE) {
999  if (ob->pose) {
1000  bConstraint *curcon;
1001  bPoseChannel *pchan;
1002  for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
1003  for (curcon = pchan->constraints.first; curcon; curcon = curcon->next) {
1004  if (curcon->type == CONSTRAINT_TYPE_TRACKTO) {
1005  bTrackToConstraint *data = curcon->data;
1006  data->reserved1 = ob->trackflag;
1007  data->reserved2 = ob->upflag;
1008  }
1009  }
1010  }
1011  }
1012  }
1013 
1014  ob = ob->id.next;
1015  }
1016 
1017  /* convert old mainb values for new button panels */
1018  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
1019  ScrArea *area;
1020 
1021  for (area = screen->areabase.first; area; area = area->next) {
1022  SpaceLink *sl;
1023 
1024  for (sl = area->spacedata.first; sl; sl = sl->next) {
1025  if (sl->spacetype == SPACE_PROPERTIES) {
1026  SpaceProperties *sbuts = (SpaceProperties *)sl;
1027 
1028  sbuts->v2d.maxzoom = 1.2f;
1029 
1030  if (sbuts->mainb == BUTS_LAMP) {
1031  sbuts->mainb = CONTEXT_SHADING;
1032  // sbuts->tab[CONTEXT_SHADING] = TAB_SHADING_LAMP;
1033  }
1034  else if (sbuts->mainb == BUTS_MAT) {
1035  sbuts->mainb = CONTEXT_SHADING;
1036  // sbuts->tab[CONTEXT_SHADING] = TAB_SHADING_MAT;
1037  }
1038  else if (sbuts->mainb == BUTS_TEX) {
1039  sbuts->mainb = CONTEXT_SHADING;
1040  // sbuts->tab[CONTEXT_SHADING] = TAB_SHADING_TEX;
1041  }
1042  else if (sbuts->mainb == BUTS_ANIM) {
1043  sbuts->mainb = CONTEXT_OBJECT;
1044  }
1045  else if (sbuts->mainb == BUTS_WORLD) {
1046  sbuts->mainb = CONTEXT_SCENE;
1047  // sbuts->tab[CONTEXT_SCENE] = TAB_SCENE_WORLD;
1048  }
1049  else if (sbuts->mainb == BUTS_RENDER) {
1050  sbuts->mainb = CONTEXT_SCENE;
1051  // sbuts->tab[CONTEXT_SCENE] = TAB_SCENE_RENDER;
1052  }
1053  else if (sbuts->mainb == BUTS_FPAINT) {
1054  sbuts->mainb = CONTEXT_EDITING;
1055  }
1056  else if (sbuts->mainb == BUTS_RADIO) {
1057  sbuts->mainb = CONTEXT_SHADING;
1058  // sbuts->tab[CONTEXT_SHADING] = TAB_SHADING_RAD;
1059  }
1060  else if (sbuts->mainb == BUTS_CONSTRAINT) {
1061  sbuts->mainb = CONTEXT_OBJECT;
1062  }
1063  else if (sbuts->mainb == BUTS_SCRIPT) {
1064  sbuts->mainb = CONTEXT_OBJECT;
1065  }
1066  else if (sbuts->mainb == BUTS_EDIT) {
1067  sbuts->mainb = CONTEXT_EDITING;
1068  }
1069  else {
1070  sbuts->mainb = CONTEXT_SCENE;
1071  }
1072  }
1073  }
1074  }
1075  }
1076  }
1077 
1078  /* NOTE(@ton): made this 230 instead of 229,
1079  * to be sure (files from the `tuhopuu` branch) and this is a reliable check anyway
1080  * nevertheless, we might need to think over a fitness (initialize)
1081  * check apart from the do_versions(). */
1082 
1083  if (bmain->versionfile <= 230) {
1084  bScreen *screen;
1085 
1086  /* new variable blockscale, for panels in any area */
1087  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
1088  ScrArea *area;
1089 
1090  for (area = screen->areabase.first; area; area = area->next) {
1091  SpaceLink *sl;
1092 
1093  for (sl = area->spacedata.first; sl; sl = sl->next) {
1094  /* added: 5x better zoom in for action */
1095  if (sl->spacetype == SPACE_ACTION) {
1096  SpaceAction *sac = (SpaceAction *)sl;
1097  sac->v2d.maxzoom = 50;
1098  }
1099  }
1100  }
1101  }
1102  }
1103 
1104  if (bmain->versionfile <= 231) {
1105  bScreen *screen = bmain->screens.first;
1106 
1107  /* new bit flags for showing/hiding grid floor and axes */
1108 
1109  while (screen) {
1110  ScrArea *area = screen->areabase.first;
1111  while (area) {
1112  SpaceLink *sl = area->spacedata.first;
1113  while (sl) {
1114  if (sl->spacetype == SPACE_VIEW3D) {
1115  View3D *v3d = (View3D *)sl;
1116 
1117  if (v3d->gridflag == 0) {
1118  v3d->gridflag |= V3D_SHOW_X;
1119  v3d->gridflag |= V3D_SHOW_Y;
1120  v3d->gridflag |= V3D_SHOW_FLOOR;
1121  v3d->gridflag &= ~V3D_SHOW_Z;
1122  }
1123  }
1124  sl = sl->next;
1125  }
1126  area = area->next;
1127  }
1128  screen = screen->id.next;
1129  }
1130  }
1131 
1132  if (bmain->versionfile <= 232) {
1133  Tex *tex = bmain->textures.first;
1134  World *wrld = bmain->worlds.first;
1135  bScreen *screen;
1136 
1137  while (tex) {
1138  if ((tex->flag & (TEX_CHECKER_ODD + TEX_CHECKER_EVEN)) == 0) {
1139  tex->flag |= TEX_CHECKER_ODD;
1140  }
1141  /* copied from kernel texture.c */
1142  if (tex->ns_outscale == 0.0f) {
1143  /* musgrave */
1144  tex->mg_H = 1.0f;
1145  tex->mg_lacunarity = 2.0f;
1146  tex->mg_octaves = 2.0f;
1147  tex->mg_offset = 1.0f;
1148  tex->mg_gain = 1.0f;
1149  tex->ns_outscale = 1.0f;
1150  /* distnoise */
1151  tex->dist_amount = 1.0f;
1152  /* voronoi */
1153  tex->vn_w1 = 1.0f;
1154  tex->vn_mexp = 2.5f;
1155  }
1156  tex = tex->id.next;
1157  }
1158 
1159  while (wrld) {
1160  if (wrld->aodist == 0.0f) {
1161  wrld->aodist = 10.0f;
1162  }
1163  if (wrld->aoenergy == 0.0f) {
1164  wrld->aoenergy = 1.0f;
1165  }
1166  wrld = wrld->id.next;
1167  }
1168 
1169  /* new variable blockscale, for panels in any area, do again because new
1170  * areas didn't initialize it to 0.7 yet
1171  */
1172  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
1173  ScrArea *area;
1174  for (area = screen->areabase.first; area; area = area->next) {
1175  SpaceLink *sl;
1176  for (sl = area->spacedata.first; sl; sl = sl->next) {
1177  /* added: 5x better zoom in for nla */
1178  if (sl->spacetype == SPACE_NLA) {
1179  SpaceNla *snla = (SpaceNla *)sl;
1180  snla->v2d.maxzoom = 50;
1181  }
1182  }
1183  }
1184  }
1185  }
1186 
1187  if (bmain->versionfile <= 233) {
1188  bScreen *screen;
1189 
1190  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
1191  ScrArea *area;
1192  for (area = screen->areabase.first; area; area = area->next) {
1193  SpaceLink *sl;
1194  for (sl = area->spacedata.first; sl; sl = sl->next) {
1195  if (sl->spacetype == SPACE_VIEW3D) {
1196  View3D *v3d = (View3D *)sl;
1197  v3d->flag |= V3D_SELECT_OUTLINE;
1198  }
1199  }
1200  }
1201  }
1202  }
1203 
1204  if (bmain->versionfile <= 234) {
1205  bScreen *screen;
1206 
1207  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
1208  ScrArea *area;
1209  for (area = screen->areabase.first; area; area = area->next) {
1210  SpaceLink *sl;
1211  for (sl = area->spacedata.first; sl; sl = sl->next) {
1212  if (sl->spacetype == SPACE_TEXT) {
1213  SpaceText *st = (SpaceText *)sl;
1214  if (st->tabnumber == 0) {
1215  st->tabnumber = 2;
1216  }
1217  }
1218  }
1219  }
1220  }
1221  }
1222 
1223  if (bmain->versionfile <= 235) {
1224  Tex *tex = bmain->textures.first;
1225  Scene *sce = bmain->scenes.first;
1226  Editing *ed;
1227 
1228  while (tex) {
1229  if (tex->nabla == 0.0f) {
1230  tex->nabla = 0.025f;
1231  }
1232  tex = tex->id.next;
1233  }
1234  while (sce) {
1235  ed = sce->ed;
1236  if (ed) {
1238  }
1239 
1240  sce = sce->id.next;
1241  }
1242  }
1243 
1244  if (bmain->versionfile <= 236) {
1245  Object *ob;
1246  Camera *cam = bmain->cameras.first;
1247 
1248  while (cam) {
1249  if (cam->ortho_scale == 0.0f) {
1250  cam->ortho_scale = 256.0f / cam->lens;
1251  if (cam->type == CAM_ORTHO) {
1252  printf("NOTE: ortho render has changed, tweak new Camera 'scale' value.\n");
1253  }
1254  }
1255  cam = cam->id.next;
1256  }
1257  /* Force oops draw if depsgraph was set. */
1258  /* Set time line var. */
1259 
1260  /* softbody init new vars */
1261  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
1262  if (ob->soft) {
1263  if (ob->soft->defgoal == 0.0f) {
1264  ob->soft->defgoal = 0.7f;
1265  }
1266  if (ob->soft->physics_speed == 0.0f) {
1267  ob->soft->physics_speed = 1.0f;
1268  }
1269  }
1270  if (ob->soft && ob->soft->vertgroup == 0) {
1271  bDeformGroup *locGroup = BKE_object_defgroup_find_name(ob, "SOFTGOAL");
1272  if (locGroup) {
1273  /* retrieve index for that group */
1274  ob->soft->vertgroup = 1 + BLI_findindex(&ob->defbase, locGroup);
1275  }
1276  }
1277  }
1278  }
1279 
1280  if (bmain->versionfile <= 237) {
1281  bArmature *arm;
1282  bConstraint *con;
1283  Object *ob;
1284  Bone *bone;
1285 
1286  /* armature recode checks */
1287  for (arm = bmain->armatures.first; arm; arm = arm->id.next) {
1288  BKE_armature_where_is(arm);
1289 
1290  for (bone = arm->bonebase.first; bone; bone = bone->next) {
1292  }
1293  }
1294  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
1295  if (ob->parent) {
1296  Object *parent = blo_do_versions_newlibadr(fd, lib, ob->parent);
1297  if (parent && parent->type == OB_LATTICE) {
1298  ob->partype = PARSKEL;
1299  }
1300  }
1301 
1302  /* NOTE: #BKE_pose_rebuild is further only called on leave edit-mode. */
1303  if (ob->type == OB_ARMATURE) {
1304  if (ob->pose) {
1305  BKE_pose_tag_recalc(bmain, ob->pose);
1306  }
1307 
1308  /* Cannot call stuff now (pointers!), done in #setup_app_data. */
1309  ob->id.recalc |= ID_RECALC_ALL;
1310 
1311  /* new generic xray option */
1312  arm = blo_do_versions_newlibadr(fd, lib, ob->data);
1313  enum { ARM_DRAWXRAY = (1 << 1) };
1314  if (arm->flag & ARM_DRAWXRAY) {
1315  ob->dtx |= OB_DRAW_IN_FRONT;
1316  }
1317  }
1318  else if (ob->type == OB_MESH) {
1319  Mesh *me = blo_do_versions_newlibadr(fd, lib, ob->data);
1320 
1321  enum {
1322  ME_SUBSURF = (1 << 7),
1323  ME_OPT_EDGES = (1 << 8),
1324  };
1325 
1326  if (me->flag & ME_SUBSURF) {
1329 
1330  smd->levels = MAX2(1, me->subdiv);
1331  smd->renderLevels = MAX2(1, me->subdivr);
1332  smd->subdivType = me->subsurftype;
1333 
1334  smd->modifier.mode = 0;
1335  if (me->subdiv != 0) {
1336  smd->modifier.mode |= 1;
1337  }
1338  if (me->subdivr != 0) {
1339  smd->modifier.mode |= 2;
1340  }
1341 
1342  if (me->flag & ME_OPT_EDGES) {
1344  }
1345 
1346  BLI_addtail(&ob->modifiers, smd);
1347 
1349  }
1350  }
1351 
1352  /* follow path constraint needs to set the 'path' option in curves... */
1353  for (con = ob->constraints.first; con; con = con->next) {
1354  if (con->type == CONSTRAINT_TYPE_FOLLOWPATH) {
1356  Object *obc = blo_do_versions_newlibadr(fd, lib, data->tar);
1357 
1358  if (obc && obc->type == OB_CURVES_LEGACY) {
1359  Curve *cu = blo_do_versions_newlibadr(fd, lib, obc->data);
1360  if (cu) {
1361  cu->flag |= CU_PATH;
1362  }
1363  }
1364  }
1365  }
1366  }
1367  }
1368 
1369  if (bmain->versionfile <= 238) {
1370  Lattice *lt;
1371  Object *ob;
1372  bArmature *arm;
1373  Mesh *me;
1374  Key *key;
1375  Scene *sce = bmain->scenes.first;
1376 
1377  while (sce) {
1378  if (sce->toolsettings == NULL) {
1379  sce->toolsettings = MEM_callocN(sizeof(struct ToolSettings), "Tool Settings Struct");
1380  sce->toolsettings->doublimit = 0.001f;
1381  }
1382  sce = sce->id.next;
1383  }
1384 
1385  for (lt = bmain->lattices.first; lt; lt = lt->id.next) {
1386  if (lt->fu == 0.0f && lt->fv == 0.0f && lt->fw == 0.0f) {
1387  calc_lat_fudu(lt->flag, lt->pntsu, &lt->fu, &lt->du);
1388  calc_lat_fudu(lt->flag, lt->pntsv, &lt->fv, &lt->dv);
1389  calc_lat_fudu(lt->flag, lt->pntsw, &lt->fw, &lt->dw);
1390  }
1391  }
1392 
1393  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
1394  ModifierData *md;
1395  PartEff *paf;
1396 
1397  for (md = ob->modifiers.first; md; md = md->next) {
1398  if (md->type == eModifierType_Subsurf) {
1400 
1402  }
1403  }
1404 
1405  if ((ob->softflag & OB_SB_ENABLE) &&
1407  if (ob->softflag & OB_SB_POSTDEF) {
1408  md = ob->modifiers.first;
1409 
1411  md = md->next;
1412  }
1413 
1415  }
1416  else {
1418  }
1419 
1420  ob->softflag &= ~OB_SB_ENABLE;
1421  }
1422 
1423  if (ob->pose) {
1424  bPoseChannel *pchan;
1425  bConstraint *con;
1426  for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
1427  /* NOTE: pchan->bone is also lib-link stuff. */
1428  if (pchan->limitmin[0] == 0.0f && pchan->limitmax[0] == 0.0f) {
1429  pchan->limitmin[0] = pchan->limitmin[1] = pchan->limitmin[2] = -180.0f;
1430  pchan->limitmax[0] = pchan->limitmax[1] = pchan->limitmax[2] = 180.0f;
1431 
1432  for (con = pchan->constraints.first; con; con = con->next) {
1433  if (con->type == CONSTRAINT_TYPE_KINEMATIC) {
1435  data->weight = 1.0f;
1436  data->orientweight = 1.0f;
1437  data->flag &= ~CONSTRAINT_IK_ROT;
1438 
1439  /* enforce conversion from old IK_TOPARENT to rootbone index */
1440  data->rootbone = -1;
1441 
1442  /* update_pose_etc handles rootbone == -1 */
1443  BKE_pose_tag_recalc(bmain, ob->pose);
1444  }
1445  }
1446  }
1447  }
1448  }
1449 
1451  if (paf) {
1452  if (paf->disp == 0) {
1453  paf->disp = 100;
1454  }
1455  if (paf->speedtex == 0) {
1456  paf->speedtex = 8;
1457  }
1458  if (paf->omat == 0) {
1459  paf->omat = 1;
1460  }
1461  }
1462  }
1463 
1464  for (arm = bmain->armatures.first; arm; arm = arm->id.next) {
1465  bone_version_238(&arm->bonebase);
1466  arm->deformflag |= ARM_DEF_VGROUP;
1467  }
1468 
1469  for (me = bmain->meshes.first; me; me = me->id.next) {
1470  if (!me->medge) {
1471  BKE_mesh_calc_edges_legacy(me, true); /* true = use #MFace.edcode. */
1472  }
1473  else {
1475  }
1476  }
1477 
1478  for (key = bmain->shapekeys.first; key; key = key->id.next) {
1479  KeyBlock *kb;
1480  int index = 1;
1481 
1482  for (kb = key->block.first; kb; kb = kb->next) {
1483  if (kb == key->refkey) {
1484  if (kb->name[0] == 0) {
1485  strcpy(kb->name, "Basis");
1486  }
1487  }
1488  else {
1489  if (kb->name[0] == 0) {
1490  BLI_snprintf(kb->name, sizeof(kb->name), "Key %d", index);
1491  }
1492  index++;
1493  }
1494  }
1495  }
1496  }
1497 
1498  if (bmain->versionfile <= 239) {
1499  bArmature *arm;
1500  Object *ob;
1501  Scene *sce = bmain->scenes.first;
1502  Camera *cam = bmain->cameras.first;
1503  int set_passepartout = 0;
1504 
1505  /* deformflag is local in modifier now */
1506  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
1507  ModifierData *md;
1508 
1509  for (md = ob->modifiers.first; md; md = md->next) {
1510  if (md->type == eModifierType_Armature) {
1512  if (amd->object && amd->deformflag == 0) {
1513  Object *oba = blo_do_versions_newlibadr(fd, lib, amd->object);
1514  arm = blo_do_versions_newlibadr(fd, lib, oba->data);
1515  amd->deformflag = arm->deformflag;
1516  }
1517  }
1518  }
1519  }
1520 
1521  /* updating stepsize for ghost drawing */
1522  for (arm = bmain->armatures.first; arm; arm = arm->id.next) {
1523  bone_version_239(&arm->bonebase);
1524  if (arm->layer == 0) {
1525  arm->layer = 1;
1526  }
1527  }
1528 
1529  for (; sce; sce = sce->id.next) {
1530  if (sce->r.scemode & R_PASSEPARTOUT) {
1531  set_passepartout = 1;
1532  sce->r.scemode &= ~R_PASSEPARTOUT;
1533  }
1534  }
1535 
1536  for (; cam; cam = cam->id.next) {
1537  if (set_passepartout) {
1538  cam->flag |= CAM_SHOWPASSEPARTOUT;
1539  }
1540 
1541  /* make sure old cameras have title safe on */
1542  if (!(cam->flag & CAM_SHOW_SAFE_MARGINS)) {
1543  cam->flag |= CAM_SHOW_SAFE_MARGINS;
1544  }
1545 
1546  /* set an appropriate camera passepartout alpha */
1547  if (!(cam->passepartalpha)) {
1548  cam->passepartalpha = 0.2f;
1549  }
1550  }
1551  }
1552 
1553  if (bmain->versionfile <= 241) {
1554  Object *ob;
1555  Scene *sce;
1556  Light *la;
1557  bArmature *arm;
1558  bNodeTree *ntree;
1559 
1560  /* updating layers still */
1561  for (arm = bmain->armatures.first; arm; arm = arm->id.next) {
1562  bone_version_239(&arm->bonebase);
1563  if (arm->layer == 0) {
1564  arm->layer = 1;
1565  }
1566  }
1567  for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
1568  if (sce->audio.mixrate == 0) {
1569  sce->audio.mixrate = 48000;
1570  }
1571 
1572  /* We don't add default layer since blender2.8 because the layers
1573  * are now in Scene->view_layers and a default layer is created in
1574  * the doversion later on.
1575  */
1577  /* new layer flag for sky, was default for solid */
1578  for (srl = sce->r.layers.first; srl; srl = srl->next) {
1579  if (srl->layflag & SCE_LAY_SOLID) {
1580  srl->layflag |= SCE_LAY_SKY;
1581  }
1583  }
1584 
1585  /* node version changes */
1586  if (sce->nodetree) {
1588  }
1589 
1590  /* uv calculation options moved to toolsettings */
1591  if (sce->toolsettings->unwrapper == 0) {
1593  sce->toolsettings->unwrapper = 1;
1594  }
1595  }
1596 
1597  for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) {
1599  }
1600 
1601  for (la = bmain->lights.first; la; la = la->id.next) {
1602  if (la->buffers == 0) {
1603  la->buffers = 1;
1604  }
1605  }
1606 
1607  /* for empty drawsize and drawtype */
1608  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
1609  if (ob->empty_drawsize == 0.0f) {
1610  ob->empty_drawtype = OB_ARROWS;
1611  ob->empty_drawsize = 1.0;
1612  }
1613  }
1614 
1615  /* during 2.41 images with this name were used for viewer node output, lets fix that */
1616  if (bmain->versionfile == 241) {
1617  Image *ima;
1618  for (ima = bmain->images.first; ima; ima = ima->id.next) {
1619  if (STREQ(ima->filepath, "Compositor")) {
1620  strcpy(ima->id.name + 2, "Viewer Node");
1621  strcpy(ima->filepath, "Viewer Node");
1622  }
1623  }
1624  }
1625  }
1626 
1627  if (bmain->versionfile <= 242) {
1628  Scene *sce;
1629  bScreen *screen;
1630  Object *ob;
1631  Curve *cu;
1632  Material *ma;
1633  Mesh *me;
1634  Collection *collection;
1635  Nurb *nu;
1636  BezTriple *bezt;
1637  BPoint *bp;
1638  bNodeTree *ntree;
1639  int a;
1640 
1641  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
1642  ScrArea *area;
1643  area = screen->areabase.first;
1644  while (area) {
1645  SpaceLink *sl;
1646 
1647  for (sl = area->spacedata.first; sl; sl = sl->next) {
1648  if (sl->spacetype == SPACE_VIEW3D) {
1649  View3D *v3d = (View3D *)sl;
1650  if (v3d->gridsubdiv == 0) {
1651  v3d->gridsubdiv = 10;
1652  }
1653  }
1654  }
1655  area = area->next;
1656  }
1657  }
1658 
1659  for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
1660  enum {
1661  R_THREADS = (1 << 19),
1662  };
1663  if (sce->toolsettings->select_thresh == 0.0f) {
1664  sce->toolsettings->select_thresh = 0.01f;
1665  }
1666  if (sce->r.threads == 0) {
1667  if (sce->r.mode & R_THREADS) {
1668  sce->r.threads = 2;
1669  }
1670  else {
1671  sce->r.threads = 1;
1672  }
1673  }
1674  if (sce->nodetree) {
1676  }
1677  }
1678 
1679  for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) {
1681  }
1682 
1683  /* add default radius values to old curve points */
1684  for (cu = bmain->curves.first; cu; cu = cu->id.next) {
1685  for (nu = cu->nurb.first; nu; nu = nu->next) {
1686  if (nu->bezt) {
1687  for (bezt = nu->bezt, a = 0; a < nu->pntsu; a++, bezt++) {
1688  if (!bezt->radius) {
1689  bezt->radius = 1.0;
1690  }
1691  }
1692  }
1693  else if (nu->bp) {
1694  for (bp = nu->bp, a = 0; a < nu->pntsu * nu->pntsv; a++, bp++) {
1695  if (!bp->radius) {
1696  bp->radius = 1.0;
1697  }
1698  }
1699  }
1700  }
1701  }
1702 
1703  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
1704  ModifierData *md;
1705  ListBase *list;
1706  list = &ob->constraints;
1707 
1708  /* check for already existing MinMax (floor) constraint
1709  * and update the sticky flagging */
1710 
1711  if (list) {
1712  bConstraint *curcon;
1713  for (curcon = list->first; curcon; curcon = curcon->next) {
1714  switch (curcon->type) {
1715  case CONSTRAINT_TYPE_ROTLIKE: {
1716  bRotateLikeConstraint *data = curcon->data;
1717 
1718  /* version patch from buttons_object.c */
1719  if (data->flag == 0) {
1720  data->flag = ROTLIKE_X | ROTLIKE_Y | ROTLIKE_Z;
1721  }
1722 
1723  break;
1724  }
1725  }
1726  }
1727  }
1728 
1729  if (ob->type == OB_ARMATURE) {
1730  if (ob->pose) {
1731  bConstraint *curcon;
1732  bPoseChannel *pchan;
1733  for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
1734  for (curcon = pchan->constraints.first; curcon; curcon = curcon->next) {
1735  switch (curcon->type) {
1737  bKinematicConstraint *data = curcon->data;
1738  if (!(data->flag & CONSTRAINT_IK_POS)) {
1739  data->flag |= CONSTRAINT_IK_POS;
1740  data->flag |= CONSTRAINT_IK_STRETCH;
1741  }
1742  break;
1743  }
1744  case CONSTRAINT_TYPE_ROTLIKE: {
1745  bRotateLikeConstraint *data = curcon->data;
1746 
1747  /* version patch from buttons_object.c */
1748  if (data->flag == 0) {
1749  data->flag = ROTLIKE_X | ROTLIKE_Y | ROTLIKE_Z;
1750  }
1751  break;
1752  }
1753  }
1754  }
1755  }
1756  }
1757  }
1758 
1759  /* copy old object level track settings to curve modifiers */
1760  for (md = ob->modifiers.first; md; md = md->next) {
1761  if (md->type == eModifierType_Curve) {
1762  CurveModifierData *cmd = (CurveModifierData *)md;
1763 
1764  if (cmd->defaxis == 0) {
1765  cmd->defaxis = ob->trackflag + 1;
1766  }
1767  }
1768  }
1769  }
1770 
1771  for (ma = bmain->materials.first; ma; ma = ma->id.next) {
1772  if (ma->nodetree) {
1774  }
1775  }
1776 
1777  for (me = bmain->meshes.first; me; me = me->id.next) {
1779  }
1780 
1781  for (collection = bmain->collections.first; collection; collection = collection->id.next) {
1782  if (collection->layer == 0) {
1783  collection->layer = (1 << 20) - 1;
1784  }
1785  }
1786 
1787  /* now, subversion control! */
1788  if (bmain->subversionfile < 3) {
1789  Image *ima;
1790  Tex *tex;
1791 
1792  /* Image refactor initialize */
1793  for (ima = bmain->images.first; ima; ima = ima->id.next) {
1794  ima->source = IMA_SRC_FILE;
1795  ima->type = IMA_TYPE_IMAGE;
1796 
1797  ima->gen_x = 256;
1798  ima->gen_y = 256;
1799  ima->gen_type = 1;
1800 
1801  if (STREQLEN(ima->id.name + 2, "Viewer Node", sizeof(ima->id.name) - 2)) {
1802  ima->source = IMA_SRC_VIEWER;
1803  ima->type = IMA_TYPE_COMPOSITE;
1804  }
1805  if (STREQLEN(ima->id.name + 2, "Render Result", sizeof(ima->id.name) - 2)) {
1806  ima->source = IMA_SRC_VIEWER;
1807  ima->type = IMA_TYPE_R_RESULT;
1808  }
1809  }
1810  for (tex = bmain->textures.first; tex; tex = tex->id.next) {
1811  enum {
1812  TEX_ANIMCYCLIC = (1 << 6),
1813  TEX_ANIM5 = (1 << 7),
1814  };
1815 
1816  if (tex->type == TEX_IMAGE && tex->ima) {
1817  ima = blo_do_versions_newlibadr(fd, lib, tex->ima);
1818  if (tex->imaflag & TEX_ANIM5) {
1819  ima->source = IMA_SRC_MOVIE;
1820  }
1821  }
1822  tex->iuser.frames = tex->frames;
1823  tex->iuser.offset = tex->offset;
1824  tex->iuser.sfra = tex->sfra;
1825  tex->iuser.cycl = (tex->imaflag & TEX_ANIMCYCLIC) != 0;
1826  }
1827  for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
1828  if (sce->nodetree) {
1830  }
1831  }
1832  for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) {
1834  }
1835  for (ma = bmain->materials.first; ma; ma = ma->id.next) {
1836  if (ma->nodetree) {
1838  }
1839  }
1840  }
1841 
1842  if (bmain->subversionfile < 4) {
1843  for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
1844  sce->r.bake_mode = 1; /* prevent to include render stuff here */
1845  sce->r.bake_margin = 16;
1847  sce->r.bake_flag = R_BAKE_CLEAR;
1848  }
1849  }
1850  }
1851 
1852  if (bmain->versionfile <= 243) {
1853  Object *ob = bmain->objects.first;
1854 
1855  for (; ob; ob = ob->id.next) {
1856  bDeformGroup *curdef;
1857 
1858  for (curdef = ob->defbase.first; curdef; curdef = curdef->next) {
1859  /* replace an empty-string name with unique name */
1860  if (curdef->name[0] == '\0') {
1861  BKE_object_defgroup_unique_name(curdef, ob);
1862  }
1863  }
1864 
1865  if (bmain->versionfile < 243 || bmain->subversionfile < 1) {
1866  ModifierData *md;
1867 
1868  /* translate old mirror modifier axis values to new flags */
1869  for (md = ob->modifiers.first; md; md = md->next) {
1870  if (md->type == eModifierType_Mirror) {
1872 
1873  switch (mmd->axis) {
1874  case 0:
1875  mmd->flag |= MOD_MIR_AXIS_X;
1876  break;
1877  case 1:
1878  mmd->flag |= MOD_MIR_AXIS_Y;
1879  break;
1880  case 2:
1881  mmd->flag |= MOD_MIR_AXIS_Z;
1882  break;
1883  }
1884 
1885  mmd->axis = 0;
1886  }
1887  }
1888  }
1889  }
1890 
1891  /* render layer added, this is not the active layer */
1892  if (bmain->versionfile <= 243 || bmain->subversionfile < 2) {
1893  Mesh *me;
1894  for (me = bmain->meshes.first; me; me = me->id.next) {
1896  }
1897  }
1898  }
1899 
1900  if (bmain->versionfile <= 244) {
1901  bScreen *screen;
1902 
1903  if (bmain->versionfile != 244 || bmain->subversionfile < 2) {
1904  /* correct older action editors - incorrect scrolling */
1905  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
1906  ScrArea *area;
1907  area = screen->areabase.first;
1908  while (area) {
1909  SpaceLink *sl;
1910 
1911  for (sl = area->spacedata.first; sl; sl = sl->next) {
1912  if (sl->spacetype == SPACE_ACTION) {
1913  SpaceAction *saction = (SpaceAction *)sl;
1914 
1915  saction->v2d.tot.ymin = -1000.0;
1916  saction->v2d.tot.ymax = 0.0;
1917 
1918  saction->v2d.cur.ymin = -75.0;
1919  saction->v2d.cur.ymax = 5.0;
1920  }
1921  }
1922  area = area->next;
1923  }
1924  }
1925  }
1926  }
1927 
1928  if (bmain->versionfile <= 245) {
1929  Scene *sce;
1930  Object *ob;
1931  Image *ima;
1932  Light *la;
1933  Material *ma;
1934  ParticleSettings *part;
1935  bNodeTree *ntree;
1936  Tex *tex;
1937  ModifierData *md;
1938  ParticleSystem *psys;
1939 
1940  /* unless the file was created 2.44.3 but not 2.45, update the constraints */
1941  if (!(bmain->versionfile == 244 && bmain->subversionfile == 3) &&
1942  ((bmain->versionfile < 245) ||
1943  (bmain->versionfile == 245 && bmain->subversionfile == 0))) {
1944  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
1945  ListBase *list;
1946  list = &ob->constraints;
1947 
1948  /* fix up constraints due to constraint recode changes (originally at 2.44.3) */
1949  if (list) {
1950  bConstraint *curcon;
1951  for (curcon = list->first; curcon; curcon = curcon->next) {
1952  /* old CONSTRAINT_LOCAL check -> convert to CONSTRAINT_SPACE_LOCAL */
1953  if (curcon->flag & 0x20) {
1954  curcon->ownspace = CONSTRAINT_SPACE_LOCAL;
1955  curcon->tarspace = CONSTRAINT_SPACE_LOCAL;
1956  }
1957 
1958  switch (curcon->type) {
1959  case CONSTRAINT_TYPE_LOCLIMIT: {
1961 
1962  /* old limit without parent option for objects */
1963  if (data->flag2) {
1964  curcon->ownspace = CONSTRAINT_SPACE_LOCAL;
1965  }
1966  break;
1967  }
1968  }
1969  }
1970  }
1971 
1972  /* correctly initialize constinv matrix */
1973  unit_m4(ob->constinv);
1974 
1975  if (ob->type == OB_ARMATURE) {
1976  if (ob->pose) {
1977  bConstraint *curcon;
1978  bPoseChannel *pchan;
1979 
1980  for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
1981  /* make sure constraints are all up to date */
1982  for (curcon = pchan->constraints.first; curcon; curcon = curcon->next) {
1983  /* old CONSTRAINT_LOCAL check -> convert to CONSTRAINT_SPACE_LOCAL */
1984  if (curcon->flag & 0x20) {
1985  curcon->ownspace = CONSTRAINT_SPACE_LOCAL;
1986  curcon->tarspace = CONSTRAINT_SPACE_LOCAL;
1987  }
1988 
1989  switch (curcon->type) {
1990  case CONSTRAINT_TYPE_ACTION: {
1992 
1993  /* 'data->local' used to mean that target was in local-space */
1994  if (data->local) {
1995  curcon->tarspace = CONSTRAINT_SPACE_LOCAL;
1996  }
1997  break;
1998  }
1999  }
2000  }
2001 
2002  /* correctly initialize constinv matrix */
2003  unit_m4(pchan->constinv);
2004  }
2005  }
2006  }
2007  }
2008  }
2009 
2010  /* fix all versions before 2.45 */
2011  if (bmain->versionfile != 245) {
2012 
2013  /* Repair preview from 242 - 244. */
2014  for (ima = bmain->images.first; ima; ima = ima->id.next) {
2015  ima->preview = NULL;
2016  }
2017  }
2018 
2019  /* add point caches */
2020  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
2021  if (ob->soft && !ob->soft->pointcache) {
2022  ob->soft->pointcache = BKE_ptcache_add(&ob->soft->ptcaches);
2023  }
2024 
2025  for (psys = ob->particlesystem.first; psys; psys = psys->next) {
2026  if (psys->pointcache) {
2027  if (psys->pointcache->flag & PTCACHE_BAKED &&
2028  (psys->pointcache->flag & PTCACHE_DISK_CACHE) == 0) {
2029  printf("Old memory cache isn't supported for particles, so re-bake the simulation!\n");
2030  psys->pointcache->flag &= ~PTCACHE_BAKED;
2031  }
2032  }
2033  else {
2034  psys->pointcache = BKE_ptcache_add(&psys->ptcaches);
2035  }
2036  }
2037 
2038  for (md = ob->modifiers.first; md; md = md->next) {
2039  if (md->type == eModifierType_Cloth) {
2040  ClothModifierData *clmd = (ClothModifierData *)md;
2041  if (!clmd->point_cache) {
2042  clmd->point_cache = BKE_ptcache_add(&clmd->ptcaches);
2043  clmd->point_cache->step = 1;
2044  }
2045  }
2046  }
2047  }
2048 
2049  if (bmain->versionfile != 245 || bmain->subversionfile < 1) {
2050  for (la = bmain->lights.first; la; la = la->id.next) {
2052 
2053  if (la->curfalloff == NULL) {
2054  la->curfalloff = BKE_curvemapping_add(1, 0.0f, 1.0f, 1.0f, 0.0f);
2056  }
2057  }
2058  }
2059 
2060  for (ma = bmain->materials.first; ma; ma = ma->id.next) {
2061  if (ma->gloss_mir == 0.0f) {
2062  ma->gloss_mir = 1.0f;
2063  }
2064  }
2065 
2066  for (part = bmain->particles.first; part; part = part->id.next) {
2067  if (part->child_render_percent == 0) {
2068  part->child_render_percent = part->child_percent;
2069  }
2070  }
2071 
2072  for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
2073  if (sce->nodetree) {
2074  ntree_version_245(fd, lib, sce->nodetree);
2075  }
2076 
2077  if (sce->r.simplify_subsurf == 0) {
2078  sce->r.simplify_subsurf = 6;
2079  sce->r.simplify_particles = 1.0f;
2080  }
2081  }
2082 
2083  for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) {
2084  ntree_version_245(fd, lib, ntree);
2085  }
2086 
2087  /* fix for temporary flag changes during 245 cycle */
2088  for (ima = bmain->images.first; ima; ima = ima->id.next) {
2089  if (ima->flag & IMA_OLD_PREMUL) {
2090  ima->flag &= ~IMA_OLD_PREMUL;
2092  }
2093  }
2094 
2095  for (tex = bmain->textures.first; tex; tex = tex->id.next) {
2096  if (tex->iuser.flag & IMA_OLD_PREMUL) {
2098  }
2099 
2100  ima = blo_do_versions_newlibadr(fd, lib, tex->ima);
2101  if (ima && (tex->iuser.flag & IMA_DO_PREMUL)) {
2102  ima->flag &= ~IMA_OLD_PREMUL;
2104  }
2105  }
2106  }
2107 
2108  if (!MAIN_VERSION_ATLEAST(bmain, 245, 2)) {
2109  Image *ima;
2110 
2111  /* initialize 1:1 Aspect */
2112  for (ima = bmain->images.first; ima; ima = ima->id.next) {
2113  ima->aspx = ima->aspy = 1.0f;
2114  }
2115  }
2116 
2117  if (!MAIN_VERSION_ATLEAST(bmain, 245, 4)) {
2118  bArmature *arm;
2119  ModifierData *md;
2120  Object *ob;
2121 
2122  for (arm = bmain->armatures.first; arm; arm = arm->id.next) {
2123  arm->deformflag |= ARM_DEF_B_BONE_REST;
2124  }
2125 
2126  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
2127  for (md = ob->modifiers.first; md; md = md->next) {
2128  if (md->type == eModifierType_Armature) {
2129  ((ArmatureModifierData *)md)->deformflag |= ARM_DEF_B_BONE_REST;
2130  }
2131  }
2132  }
2133  }
2134 
2135  if (!MAIN_VERSION_ATLEAST(bmain, 245, 5)) {
2136  /* foreground color needs to be something other than black */
2137  Scene *sce;
2138  for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
2139  sce->r.fg_stamp[0] = sce->r.fg_stamp[1] = sce->r.fg_stamp[2] = 0.8f;
2140  sce->r.fg_stamp[3] = 1.0f; /* don't use text alpha yet */
2141  sce->r.bg_stamp[3] = 0.25f; /* make sure the background has full alpha */
2142  }
2143  }
2144 
2145  if (!MAIN_VERSION_ATLEAST(bmain, 245, 6)) {
2146  Scene *sce;
2147  /* fix frs_sec_base */
2148  for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
2149  if (sce->r.frs_sec_base == 0) {
2150  sce->r.frs_sec_base = 1;
2151  }
2152  }
2153  }
2154 
2155  if (!MAIN_VERSION_ATLEAST(bmain, 245, 7)) {
2156  Object *ob;
2157  bPoseChannel *pchan;
2158 
2159  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
2160  if (ob->pose) {
2161  for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
2163  }
2164  }
2166 
2167  if (ob->soft && ob->soft->keys) {
2168  SoftBody *sb = ob->soft;
2169  int k;
2170 
2171  for (k = 0; k < sb->totkey; k++) {
2172  if (sb->keys[k]) {
2173  MEM_freeN(sb->keys[k]);
2174  }
2175  }
2176 
2177  MEM_freeN(sb->keys);
2178 
2179  sb->keys = NULL;
2180  sb->totkey = 0;
2181  }
2182  }
2183  }
2184 
2185  if (!MAIN_VERSION_ATLEAST(bmain, 245, 8)) {
2186  Scene *sce;
2187  Object *ob;
2188  PartEff *paf = NULL;
2189 
2190  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
2191  if (ob->soft && ob->soft->keys) {
2192  SoftBody *sb = ob->soft;
2193  int k;
2194 
2195  for (k = 0; k < sb->totkey; k++) {
2196  if (sb->keys[k]) {
2197  MEM_freeN(sb->keys[k]);
2198  }
2199  }
2200 
2201  MEM_freeN(sb->keys);
2202 
2203  sb->keys = NULL;
2204  sb->totkey = 0;
2205  }
2206 
2207  /* convert old particles to new system */
2208  if ((paf = BKE_object_do_version_give_parteff_245(ob))) {
2209  ParticleSystem *psys;
2210  ModifierData *md;
2212  ParticleSettings *part;
2213 
2214  /* create new particle system */
2215  psys = MEM_callocN(sizeof(ParticleSystem), "particle_system");
2216  psys->pointcache = BKE_ptcache_add(&psys->ptcaches);
2217 
2218  part = psys->part = BKE_particlesettings_add(bmain, "ParticleSettings");
2219 
2220  /* needed for proper libdata lookup */
2221  blo_do_versions_oldnewmap_insert(fd->libmap, psys->part, psys->part, 0);
2222  part->id.lib = ob->id.lib;
2223 
2224  part->id.us--;
2225  part->id.tag |= (ob->id.tag & LIB_TAG_NEED_LINK);
2226 
2227  psys->totpart = 0;
2228  psys->flag = PSYS_CURRENT;
2229 
2230  BLI_addtail(&ob->particlesystem, psys);
2231 
2233  BLI_snprintf(md->name,
2234  sizeof(md->name),
2235  "ParticleSystem %i",
2237  psmd = (ParticleSystemModifierData *)md;
2238  psmd->psys = psys;
2239  BLI_addtail(&ob->modifiers, md);
2240 
2241  /* convert settings from old particle system */
2242  /* general settings */
2243  part->totpart = MIN2(paf->totpart, 100000);
2244  part->sta = paf->sta;
2245  part->end = paf->end;
2246  part->lifetime = paf->lifetime;
2247  part->randlife = paf->randlife;
2248  psys->seed = paf->seed;
2249  part->disp = paf->disp;
2250  part->omat = paf->mat[0];
2251  part->hair_step = paf->totkey;
2252 
2253  part->force_group = paf->group;
2254 
2255  /* old system didn't interpolate between keypoints at render time */
2256  part->draw_step = part->ren_step = 0;
2257 
2258  /* physics */
2259  part->normfac = paf->normfac * 25.0f;
2260  part->obfac = paf->obfac;
2261  part->randfac = paf->randfac * 25.0f;
2262  part->dampfac = paf->damp;
2263  copy_v3_v3(part->acc, paf->force);
2264 
2265  /* flags */
2266  if (paf->stype & PAF_VECT) {
2267  if (paf->flag & PAF_STATIC) {
2268  /* new hair lifetime is always 100.0f */
2269  float fac = paf->lifetime / 100.0f;
2270 
2271  part->draw_as = PART_DRAW_PATH;
2272  part->type = PART_HAIR;
2273  psys->recalc |= ID_RECALC_PSYS_REDO;
2274 
2275  part->normfac *= fac;
2276  part->randfac *= fac;
2277  }
2278  else {
2279  part->draw_as = PART_DRAW_LINE;
2280  part->draw |= PART_DRAW_VEL_LENGTH;
2281  part->draw_line[1] = 0.04f;
2282  }
2283  }
2284 
2285  part->rotmode = PART_ROT_VEL;
2286 
2287  part->flag |= (paf->flag & PAF_BSPLINE) ? PART_HAIR_BSPLINE : 0;
2288  part->flag |= (paf->flag & PAF_TRAND) ? PART_TRAND : 0;
2289  part->flag |= (paf->flag & PAF_EDISTR) ? PART_EDISTR : 0;
2290  part->flag |= (paf->flag & PAF_UNBORN) ? PART_UNBORN : 0;
2291  part->flag |= (paf->flag & PAF_DIED) ? PART_DIED : 0;
2292  part->from |= (paf->flag & PAF_FACE) ? PART_FROM_FACE : 0;
2293  part->draw |= (paf->flag & PAF_SHOWE) ? PART_DRAW_EMITTER : 0;
2294 
2295  psys->vgroup[PSYS_VG_DENSITY] = paf->vertgroup;
2296  psys->vgroup[PSYS_VG_VEL] = paf->vertgroup_v;
2297  psys->vgroup[PSYS_VG_LENGTH] = paf->vertgroup_v;
2298 
2299  /* Dupli-objects. */
2300  if (ob->transflag & OB_DUPLIVERTS) {
2301  Object *dup = bmain->objects.first;
2302 
2303  for (; dup; dup = dup->id.next) {
2304  if (ob == blo_do_versions_newlibadr(fd, lib, dup->parent)) {
2305  part->instance_object = dup;
2306  ob->transflag |= OB_DUPLIPARTS;
2307  ob->transflag &= ~OB_DUPLIVERTS;
2308 
2309  part->draw_as = PART_DRAW_OB;
2310 
2311  /* needed for proper libdata lookup */
2312  blo_do_versions_oldnewmap_insert(fd->libmap, dup, dup, 0);
2313  }
2314  }
2315  }
2316 
2317  {
2320  if (fluidmd && fluidmd->fss && fluidmd->fss->type == OB_FLUIDSIM_PARTICLE) {
2321  part->type = PART_FLUID;
2322  }
2323  }
2324 
2325  do_version_free_effects_245(&ob->effect);
2326 
2327  printf("Old particle system converted to new system.\n");
2328  }
2329  }
2330 
2331  for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
2333  int a;
2334 
2335  if (pset->brush[0].size == 0) {
2337  pset->emitterdist = 0.25f;
2338  pset->totrekey = 5;
2339  pset->totaddkey = 5;
2340 
2341  for (a = 0; a < ARRAY_SIZE(pset->brush); a++) {
2342  pset->brush[a].strength = 50;
2343  pset->brush[a].size = 50;
2344  pset->brush[a].step = 10;
2345  }
2346 
2347  pset->brush[PE_BRUSH_CUT].strength = 100;
2348  }
2349  }
2350  }
2351 
2352  if (!MAIN_VERSION_ATLEAST(bmain, 245, 10)) {
2353  Object *ob;
2354 
2355  /* dupliface scale */
2356  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
2357  ob->instance_faces_scale = 1.0f;
2358  }
2359  }
2360 
2361  if (!MAIN_VERSION_ATLEAST(bmain, 245, 11)) {
2362  Object *ob;
2363  bActionStrip *strip;
2364 
2365  /* NLA-strips - scale. */
2366  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
2367  for (strip = ob->nlastrips.first; strip; strip = strip->next) {
2368  float length, actlength, repeat;
2369 
2370  if (strip->flag & ACTSTRIP_USESTRIDE) {
2371  repeat = 1.0f;
2372  }
2373  else {
2374  repeat = strip->repeat;
2375  }
2376 
2377  length = strip->end - strip->start;
2378  if (length == 0.0f) {
2379  length = 1.0f;
2380  }
2381  actlength = strip->actend - strip->actstart;
2382 
2383  strip->scale = length / (repeat * actlength);
2384  if (strip->scale == 0.0f) {
2385  strip->scale = 1.0f;
2386  }
2387  }
2388  if (ob->soft) {
2389  ob->soft->inpush = ob->soft->inspring;
2390  ob->soft->shearstiff = 1.0f;
2391  }
2392  }
2393  }
2394 
2395  if (!MAIN_VERSION_ATLEAST(bmain, 245, 14)) {
2396  Scene *sce;
2397 
2398  for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
2399  if (sce->ed) {
2401  }
2402  }
2403  }
2404 
2405  /* fix broken group lengths in id properties */
2406  if (!MAIN_VERSION_ATLEAST(bmain, 245, 15)) {
2432  }
2433 
2434  /* convert fluids to modifier */
2435  if (!MAIN_VERSION_ATLEAST(bmain, 246, 1)) {
2436  Object *ob;
2437 
2438  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
2439  if (ob->fluidsimSettings) {
2442  BLI_addhead(&ob->modifiers, (ModifierData *)fluidmd);
2443 
2444  MEM_freeN(fluidmd->fss);
2445  fluidmd->fss = MEM_dupallocN(ob->fluidsimSettings);
2446  fluidmd->fss->ipo = blo_do_versions_newlibadr(fd, ob->id.lib, ob->fluidsimSettings->ipo);
2447  MEM_freeN(ob->fluidsimSettings);
2448 
2449  fluidmd->fss->lastgoodframe = INT_MAX;
2450  fluidmd->fss->flag = 0;
2451  fluidmd->fss->meshVelocities = NULL;
2452  }
2453  }
2454  }
2455 
2456  if (!MAIN_VERSION_ATLEAST(bmain, 246, 1)) {
2457  Object *ob;
2458  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
2459  if (ob->pd && (ob->pd->forcefield == PFIELD_WIND)) {
2460  ob->pd->f_noise = 0.0f;
2461  }
2462  }
2463  }
2464 
2465  /* set the curve radius interpolation to 2.47 default - easy */
2466  if (!MAIN_VERSION_ATLEAST(bmain, 247, 6)) {
2467  Curve *cu;
2468  Nurb *nu;
2469 
2470  for (cu = bmain->curves.first; cu; cu = cu->id.next) {
2471  for (nu = cu->nurb.first; nu; nu = nu->next) {
2472  nu->radius_interp = 3;
2473 
2474  /* resolu and resolv are now used differently for surfaces
2475  * rather than using the resolution to define the entire number of divisions,
2476  * use it for the number of divisions per segment
2477  */
2478  if (nu->pntsv > 1) {
2479  nu->resolu = MAX2(1, (int)(((float)nu->resolu / (float)nu->pntsu) + 0.5f));
2480  nu->resolv = MAX2(1, (int)(((float)nu->resolv / (float)nu->pntsv) + 0.5f));
2481  }
2482  }
2483  }
2484  }
2485 
2486  if (!MAIN_VERSION_ATLEAST(bmain, 248, 2)) {
2487  Scene *sce;
2488 
2489  /* NOTE: these will need to be added for painting. */
2490  for (sce = bmain->scenes.first; sce; sce = sce->id.next) {
2491  sce->toolsettings->imapaint.seam_bleed = 2;
2492  sce->toolsettings->imapaint.normal_angle = 80;
2493  }
2494  }
2495 
2496  if (!MAIN_VERSION_ATLEAST(bmain, 248, 3)) {
2497  bScreen *screen;
2498 
2499  /* adjust default settings for Animation Editors */
2500  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
2501  ScrArea *area;
2502 
2503  for (area = screen->areabase.first; area; area = area->next) {
2504  SpaceLink *sl;
2505 
2506  for (sl = area->spacedata.first; sl; sl = sl->next) {
2507  switch (sl->spacetype) {
2508  case SPACE_ACTION: {
2509  SpaceAction *sact = (SpaceAction *)sl;
2510 
2511  sact->mode = SACTCONT_DOPESHEET;
2512  sact->autosnap = SACTSNAP_FRAME;
2513  break;
2514  }
2515  case SPACE_GRAPH: {
2516  SpaceGraph *sipo = (SpaceGraph *)sl;
2517  sipo->autosnap = SACTSNAP_FRAME;
2518  break;
2519  }
2520  case SPACE_NLA: {
2521  SpaceNla *snla = (SpaceNla *)sl;
2522  snla->autosnap = SACTSNAP_FRAME;
2523  break;
2524  }
2525  }
2526  }
2527  }
2528  }
2529  }
2530 
2531  /* correct introduce of seed for wind force */
2532  if (bmain->versionfile < 249 && bmain->subversionfile < 1) {
2533  Object *ob;
2534  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
2535  if (ob->pd) {
2536  ob->pd->seed = ((uint)(ceil(PIL_check_seconds_timer())) + 1) % 128;
2537  }
2538  }
2539  }
2540 
2541  if (bmain->versionfile < 249 && bmain->subversionfile < 2) {
2542  Scene *sce = bmain->scenes.first;
2543  Editing *ed;
2544 
2545  while (sce) {
2546  ed = sce->ed;
2547  if (ed) {
2549  if (seq->strip && seq->strip->proxy) {
2550  seq->strip->proxy->quality = 90;
2551  }
2552  }
2553  }
2554 
2555  sce = sce->id.next;
2556  }
2557  }
2558 }
Blender kernel action and pose functionality.
void BKE_pose_tag_recalc(struct Main *bmain, struct bPose *pose)
Definition: action.c:1719
void BKE_armature_where_is(struct bArmature *arm)
Definition: armature.c:2263
void BKE_curvemapping_init(struct CurveMapping *cumap)
Definition: colortools.c:1235
struct CurveMapping * BKE_curvemapping_add(int tot, float minx, float miny, float maxx, float maxy)
Definition: colortools.c:72
struct bConstraint * BKE_constraint_add_for_object(struct Object *ob, const char *name, short type)
Definition: constraint.c:5870
@ CD_ASSIGN
@ CD_CALLOC
void * CustomData_add_layer(struct CustomData *data, int type, eCDAllocType alloctype, void *layer, int totelem)
Definition: customdata.cc:2776
support for deformation groups and hooks.
void BKE_object_defgroup_unique_name(struct bDeformGroup *dg, struct Object *ob)
Definition: deform.c:692
struct bDeformGroup * BKE_object_defgroup_find_name(const struct Object *ob, const char *name)
void calc_lat_fudu(int flag, int res, float *r_fu, float *r_du)
Definition: lattice.c:264
#define MAIN_VERSION_ATLEAST(main, ver, subver)
Definition: BKE_main.h:427
void BKE_mesh_strip_loose_faces(struct Mesh *me)
void BKE_mesh_update_customdata_pointers(struct Mesh *me, bool do_ensure_tess_cd)
Definition: mesh.cc:874
void BKE_mesh_calc_edges_legacy(struct Mesh *me, bool use_old)
const ModifierTypeInfo * BKE_modifier_get_info(ModifierType type)
struct ModifierData * BKE_modifiers_findby_type(const struct Object *ob, ModifierType type)
struct ModifierData * BKE_modifier_new(int type)
@ eModifierTypeType_OnlyDeform
Definition: BKE_modifier.h:44
bool BKE_modifier_unique_name(struct ListBase *modifiers, struct ModifierData *md)
#define CMP_NODE_VECBLUR
Definition: BKE_node.h:1210
#define CMP_NODE_SPLITVIEWER
Definition: BKE_node.h:1235
#define CMP_NODE_VIEWER
Definition: BKE_node.h:1196
#define CMP_NODE_HUE_SAT
Definition: BKE_node.h:1214
#define CMP_NODE_ALPHAOVER
Definition: BKE_node.h:1205
#define CMP_NODE_IMAGE
Definition: BKE_node.h:1215
#define CMP_NODE_BLUR
Definition: BKE_node.h:1206
General operations, lookup, etc. for blender objects.
struct PartEff * BKE_object_do_version_give_parteff_245(struct Object *ob)
Definition: object.cc:1026
struct ParticleSettings * BKE_particlesettings_add(struct Main *bmain, const char *name)
Definition: particle.c:4115
struct PointCache * BKE_ptcache_add(struct ListBase *ptcaches)
Definition: pointcache.c:3014
void * BLI_pophead(ListBase *listbase) ATTR_NONNULL(1)
Definition: listbase.c:221
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:60
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:336
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:80
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_insertlinkbefore(struct ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
Definition: listbase.c:340
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void unit_m4(float m[4][4])
Definition: rct.c:1090
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
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 STREQLEN(a, b, n)
#define UNUSED(x)
#define MAX2(a, b)
#define ELEM(...)
#define MIN2(a, b)
#define STREQ(a, b)
Compatibility-like things for windows.
external readfile function prototypes.
@ IDP_GROUP
Definition: DNA_ID.h:141
@ ID_RECALC_PSYS_REDO
Definition: DNA_ID.h:798
@ ID_RECALC_ALL
Definition: DNA_ID.h:891
@ LIB_TAG_NEED_LINK
Definition: DNA_ID.h:686
@ ID_IM
Definition: DNA_ID_enums.h:53
@ SACTSNAP_FRAME
@ SACTCONT_DOPESHEET
@ ARM_DEF_VGROUP
@ CAM_SHOWPASSEPARTOUT
@ CAM_SHOW_SAFE_MARGINS
@ CAM_ORTHO
Object groups, one object can be in many groups at once.
@ CONSTRAINT_IK_ROT
@ CONSTRAINT_IK_POS
@ CONSTRAINT_IK_STRETCH
@ CONSTRAINT_TYPE_TRACKTO
@ CONSTRAINT_TYPE_LOCLIKE
@ CONSTRAINT_TYPE_ROTLIKE
@ CONSTRAINT_TYPE_PYTHON
@ CONSTRAINT_TYPE_KINEMATIC
@ CONSTRAINT_TYPE_LOCLIMIT
@ CONSTRAINT_TYPE_ACTION
@ CONSTRAINT_TYPE_FOLLOWPATH
@ CONSTRAINT_SPACE_LOCAL
@ LOCLIKE_TIP
@ CU_PATH
@ CD_MTFACE
@ CD_MFACE
@ CD_MDEFORMVERT
@ CD_MEDGE
@ CD_MVERT
#define PAF_DIED
#define PAF_STATIC
#define PAF_EDISTR
#define PAF_FACE
#define PAF_VECT
#define EFF_PARTICLE
#define PAF_BSPLINE
#define PAF_UNBORN
#define PAF_SHOWE
#define PAF_TRAND
@ IMA_OLD_PREMUL
@ IMA_ALPHA_STRAIGHT
@ IMA_SRC_FILE
@ IMA_SRC_MOVIE
@ IMA_SRC_VIEWER
@ IMA_TYPE_R_RESULT
@ IMA_TYPE_COMPOSITE
@ IMA_TYPE_IMAGE
#define LA_FALLOFF_INVLINEAR
@ eModifierType_ParticleSystem
@ eModifierType_Fluidsim
@ eModifierType_Subsurf
@ eModifierType_Mirror
@ eModifierType_Curve
@ eModifierType_Cloth
@ eModifierType_Armature
@ eModifierType_Softbody
@ MOD_MIR_AXIS_Z
@ MOD_MIR_AXIS_X
@ MOD_MIR_AXIS_Y
@ eSubsurfModifierFlag_Incremental
@ eSubsurfModifierFlag_DebugIncr
@ eSubsurfModifierFlag_ControlEdges
@ ACTSTRIP_USESTRIDE
Definition: DNA_nla_types.h:85
#define NTREE_COMPOSIT
@ OB_SOLID
#define OB_FLUIDSIM_PARTICLE
#define OB_SB_POSTDEF
#define OB_SB_ENABLE
Object is a sort of wrapper for general info.
@ OB_ARROWS
@ OB_LATTICE
@ OB_ARMATURE
@ OB_MESH
@ OB_CURVES_LEGACY
@ OB_DRAW_IN_FRONT
@ OB_DUPLIPARTS
@ OB_DUPLIVERTS
@ PARSKEL
#define PART_DRAW_LINE
#define PART_DRAW_PATH
#define PART_FROM_FACE
#define PART_DRAW_OB
#define PART_EDISTR
#define PSYS_VG_LENGTH
@ PART_DRAW_VEL_LENGTH
#define PSYS_VG_VEL
#define PSYS_CURRENT
#define PART_HAIR_BSPLINE
#define PART_UNBORN
@ PART_FLUID
@ PART_HAIR
#define PSYS_VG_DENSITY
#define PART_TRAND
#define PART_DIED
#define PART_ROT_VEL
@ PTCACHE_BAKED
@ PTCACHE_DISK_CACHE
#define R_BAKE_CLEAR
#define AUDIO_SCRUB
#define R_FILTER_QUAD
#define R_PASSEPARTOUT
#define PE_KEEP_LENGTHS
#define PE_DEFLECT_EMITTER
@ R_BAKE_ADJACENT_FACES
#define PE_BRUSH_CUT
#define SCE_LAY_SOLID
#define PE_LOCK_FIRST
#define SCE_LAY_SKY
#define UVCALC_FILLHOLES
@ SCE_PASS_NORMAL
@ SCE_PASS_COMBINED
@ SCE_PASS_Z
@ SCE_PASS_VECTOR
@ SEQ_TYPE_IMAGE
@ SEQ_TYPE_MOVIE
@ SEQ_ALPHA_STRAIGHT
@ SPACE_TEXT
@ SPACE_ACTION
@ SPACE_PROPERTIES
@ SPACE_NLA
@ SPACE_GRAPH
@ SPACE_VIEW3D
#define TEX_CHECKER_EVEN
#define TEX_EXTEND
#define TEX_REPEAT
#define TEX_CHECKER_ODD
#define FO_BUILTIN_NAME
#define V3D_SELECT_OUTLINE
#define V3D_SHOW_Z
#define V3D_SHOW_Y
#define V3D_SHOW_X
#define V3D_SHOW_FLOOR
Read Guarded memory(de)allocation.
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block TEX_IMAGE
Platform independent time functions.
__forceinline const avxi srl(const avxi &a, const int32_t b)
Definition: avxi.h:335
struct PreviewImage * preview
char gen_type
float aspy
char filepath[1024]
short type
short source
float aspx
char alpha_mode
OperationNode * node
void * user_data
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
bNodeTree * ntree
DRWShaderLibrary * lib
uint col
#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_malloc_arrayN)(size_t len, size_t size, const char *str)
Definition: mallocn.c:34
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_dupallocN)(const void *vmemh)
Definition: mallocn.c:28
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
ccl_device_inline float3 ceil(const float3 &a)
Definition: math_float3.h:363
static unsigned a[3]
Definition: RandGen.cpp:78
static void area(int d1, int d2, int e1, int e2, float weights[2])
T length(const vec_base< T, Size > &a)
static const pxr::TfToken st("st", pxr::TfToken::Immortal)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void blo_do_versions_oldnewmap_insert(OldNewMap *onm, const void *oldaddr, void *newaddr, int nr)
Definition: readfile.c:368
void * blo_do_versions_newlibadr(FileData *fd, const void *lib, const void *adr)
Definition: readfile.c:1632
ListBase * SEQ_active_seqbase_get(const Editing *ed)
Definition: sequencer.c:388
float radius
float arm_head[3]
float arm_tail[3]
float rad_head
float length
float arm_mat[4][4]
float rad_tail
float dist
struct Bone * next
ListBase childbase
float lens
float passepartalpha
short flag
float ortho_scale
struct ListBase ptcaches
struct PointCache * point_cache
ListBase nurb
CustomDataLayer * layers
ListBase seqbase
short type
struct OldNewMap * libmap
Definition: readfile.h:91
struct FluidsimSettings * fss
struct FluidVertexVelocity * meshVelocities
ListBase group
Definition: DNA_ID.h:101
int len
Definition: DNA_ID.h:121
struct IDProperty * next
Definition: DNA_ID.h:107
IDPropertyData data
Definition: DNA_ID.h:117
char type
Definition: DNA_ID.h:108
Definition: DNA_ID.h:368
int tag
Definition: DNA_ID.h:387
struct Library * lib
Definition: DNA_ID.h:372
int recalc
Definition: DNA_ID.h:390
int us
Definition: DNA_ID.h:388
IDProperty * properties
Definition: DNA_ID.h:409
void * next
Definition: DNA_ID.h:369
char name[66]
Definition: DNA_ID.h:378
char name[64]
Definition: DNA_key_types.h:52
struct KeyBlock * next
Definition: DNA_key_types.h:25
ID id
Definition: DNA_key_types.h:63
ListBase block
Definition: DNA_key_types.h:84
KeyBlock * refkey
Definition: DNA_key_types.h:72
short falloff_type
struct CurveMapping * curfalloff
short buffers
void * first
Definition: DNA_listBase.h:31
unsigned char a
unsigned int v2
unsigned int v1
unsigned int v4
unsigned int v3
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 texts
Definition: BKE_main.h:185
ListBase meshes
Definition: BKE_main.h:171
ListBase ipo
Definition: BKE_main.h:180
ListBase lights
Definition: BKE_main.h:178
ListBase fonts
Definition: BKE_main.h:184
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 libraries
Definition: BKE_main.h:169
ListBase cameras
Definition: BKE_main.h:179
ListBase armatures
Definition: BKE_main.h:190
ListBase curves
Definition: BKE_main.h:172
ListBase worlds
Definition: BKE_main.h:182
ListBase screens
Definition: BKE_main.h:183
short versionfile
Definition: BKE_main.h:125
ListBase metaballs
Definition: BKE_main.h:173
ListBase collections
Definition: BKE_main.h:189
ListBase images
Definition: BKE_main.h:176
ListBase objects
Definition: BKE_main.h:170
struct bNodeTree * nodetree
struct MEdge * medge
float smoothresh
CustomData vdata
struct MTFace * mtface
struct MVert * mvert
uint16_t flag
struct MDeformVert * dvert
int totedge
int totvert
int totface
CustomData fdata
struct MCol * mcol
CustomData edata
struct MFace * mface
struct ModifierData * next
ModifierTypeType type
Definition: BKE_modifier.h:160
struct Nurb * next
BezTriple * bezt
BPoint * bp
short resolu
short resolv
short radius_interp
short partype
ListBase particlesystem
struct Object * track
short transflag
ListBase constraints
struct bPose * pose
ListBase modifiers
float constinv[4][4]
struct Material ** mat
struct PartDeflect * pd
struct SoftBody * soft
char empty_drawtype
float empty_drawsize
short softflag
float instance_faces_scale
struct Object * parent
short trackflag
short upflag
void * data
short vertgroup
short mat[4]
Particle * keys
short staticstep
short speedtex
short vertgroup_v
float force[3]
float lifetime
float normfac
float randfac
struct Collection * group
float randlife
ParticleBrushData brush[7]
struct Object * instance_object
struct ParticleSystem * psys
struct ListBase ptcaches
ParticleSettings * part
struct ParticleSystem * next
struct PointCache * pointcache
float frs_sec_base
short simplify_subsurf
float simplify_particles
float fg_stamp[4]
float bg_stamp[4]
short bake_margin_type
struct bNodeTree * nodetree
struct ToolSettings * toolsettings
struct Editing * ed
struct RenderData r
struct AudioData audio
SBVertex ** keys
short autosnap
StripProxy * proxy
float dist_amount
short xrepeat
float ns_outscale
short imaflag
float mg_lacunarity
float mg_offset
float nabla
float vn_mexp
float mg_gain
float gfac
float mg_octaves
struct ImageUser iuser
short flag
float mg_H
short type
float vn_w1
float bfac
struct Image * ima
float rfac
short extend
short yrepeat
float filtersize
struct ImagePaintSettings imapaint
struct ParticleEditSettings particle
char filepath[1024]
short gridsubdiv
short gridlines
float aodist
float aoenergy
struct bActionStrip * next
Definition: DNA_nla_types.h:40
ListBase bonebase
unsigned int layer
struct bConstraint * next
struct bDeformGroup * next
ListBase nodes
ListBase constraints
struct bPoseChannel * next
float constinv[4][4]
ListBase chanbase
ListBase areabase
struct PackedFile * packedfile
struct PackedFile * newpackedfile
float min_gain
short flags
float max_gain
float distance
float attenuation
float volume
double PIL_check_seconds_timer(void)
Definition: time.c:64
static void bone_version_239(ListBase *lb)
static void do_version_free_effects_245(ListBase *lb)
static void idproperties_fix_groups_lengths_recurse(IDProperty *prop)
void blo_do_version_old_trackto_to_constraints(Object *ob)
static void ntree_version_242(bNodeTree *ntree)
static void ntree_version_241(bNodeTree *ntree)
static void do_version_constraints_245(ListBase *lb)
static void ntree_version_245(FileData *fd, Library *lib, bNodeTree *ntree)
static void do_version_bone_head_tail_237(Bone *bone)
static void customdata_version_243(Mesh *me)
static void customdata_version_242(Mesh *me)
static void bone_version_238(ListBase *lb)
static void do_version_free_effect_245(Effect *eff)
static void do_version_ntree_242_2(bNodeTree *ntree)
static bool seq_set_blend_mode_cb(Sequence *seq, void *UNUSED(user_data))
static void vcol_to_fcol(Mesh *me)
static bool seq_set_alpha_mode_cb(Sequence *seq, void *UNUSED(user_data))
static void idproperties_fix_group_lengths(ListBase idlist)
void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)