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