Blender  V2.93
versioning_290.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 
20 /* allow readfile to use deprecated functionality */
21 #define DNA_DEPRECATED_ALLOW
22 
23 #include "BLI_alloca.h"
24 #include "BLI_listbase.h"
25 #include "BLI_math.h"
26 #include "BLI_string.h"
27 #include "BLI_utildefines.h"
28 
29 #include "DNA_anim_types.h"
30 #include "DNA_armature_types.h"
31 #include "DNA_brush_types.h"
32 #include "DNA_cachefile_types.h"
33 #include "DNA_collection_types.h"
34 #include "DNA_constraint_types.h"
35 #include "DNA_fluid_types.h"
36 #include "DNA_genfile.h"
38 #include "DNA_gpencil_types.h"
39 #include "DNA_hair_types.h"
40 #include "DNA_light_types.h"
41 #include "DNA_mesh_types.h"
42 #include "DNA_meshdata_types.h"
43 #include "DNA_modifier_types.h"
44 #include "DNA_object_types.h"
45 #include "DNA_particle_types.h"
46 #include "DNA_pointcloud_types.h"
47 #include "DNA_rigidbody_types.h"
48 #include "DNA_screen_types.h"
49 #include "DNA_shader_fx_types.h"
50 #include "DNA_space_types.h"
51 #include "DNA_text_types.h"
52 #include "DNA_tracking_types.h"
53 #include "DNA_workspace_types.h"
54 
55 #include "BKE_animsys.h"
56 #include "BKE_armature.h"
57 #include "BKE_attribute.h"
58 #include "BKE_collection.h"
59 #include "BKE_colortools.h"
60 #include "BKE_cryptomatte.h"
61 #include "BKE_curve.h"
62 #include "BKE_fcurve.h"
63 #include "BKE_gpencil.h"
64 #include "BKE_lib_id.h"
65 #include "BKE_main.h"
66 #include "BKE_mesh.h"
67 #include "BKE_multires.h"
68 #include "BKE_node.h"
69 
70 #include "IMB_imbuf.h"
71 #include "MEM_guardedalloc.h"
72 
73 #include "RNA_access.h"
74 
75 #include "SEQ_proxy.h"
76 #include "SEQ_render.h"
77 #include "SEQ_sequencer.h"
78 #include "SEQ_time.h"
79 #include "SEQ_transform.h"
80 
81 #include "BLO_readfile.h"
82 #include "readfile.h"
83 
84 /* Make preferences read-only, use versioning_userdef.c. */
85 #define U (*((const UserDef *)&U))
86 
88 {
89  eSpaceSeq_Proxy_RenderSize render_size = 100;
90 
91  for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
92  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
93  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
94  switch (sl->spacetype) {
95  case SPACE_SEQ: {
96  SpaceSeq *sseq = (SpaceSeq *)sl;
97  if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
98  render_size = sseq->render_size;
99  break;
100  }
101  }
102  }
103  }
104  }
105  }
106 
107  return render_size;
108 }
109 
110 static bool can_use_proxy(const Sequence *seq, int psize)
111 {
112  if (seq->strip->proxy == NULL) {
113  return false;
114  }
115  short size_flags = seq->strip->proxy->build_size_flags;
116  return (seq->flag & SEQ_USE_PROXY) != 0 && psize != IMB_PROXY_NONE && (size_flags & psize) != 0;
117 }
118 
119 /* image_size is width or height depending what RNA property is converted - X or Y. */
121  const char *path,
122  const int image_size)
123 {
124  if (scene->adt == NULL || scene->adt->action == NULL) {
125  return;
126  }
127 
128  FCurve *fcu = BKE_fcurve_find(&scene->adt->action->curves, path, 0);
129  if (fcu != NULL && !BKE_fcurve_is_empty(fcu)) {
130  BezTriple *bezt = fcu->bezt;
131  for (int i = 0; i < fcu->totvert; i++, bezt++) {
132  /* Same math as with old_image_center_*, but simplified. */
133  bezt->vec[0][1] = image_size / 2 + bezt->vec[0][1] - scene->r.xsch / 2;
134  bezt->vec[1][1] = image_size / 2 + bezt->vec[1][1] - scene->r.xsch / 2;
135  bezt->vec[2][1] = image_size / 2 + bezt->vec[2][1] - scene->r.xsch / 2;
136  }
137  }
138 }
139 
141  Sequence *seq,
142  const eSpaceSeq_Proxy_RenderSize render_size)
143 {
144  if (seq->strip->transform == NULL) {
145  seq->strip->transform = MEM_callocN(sizeof(struct StripTransform), "StripTransform");
146  }
147  if (seq->strip->crop == NULL) {
148  seq->strip->crop = MEM_callocN(sizeof(struct StripCrop), "StripCrop");
149  }
150 
151  StripCrop *c = seq->strip->crop;
152  StripTransform *t = seq->strip->transform;
153  int old_image_center_x = scene->r.xsch / 2;
154  int old_image_center_y = scene->r.ysch / 2;
155  int image_size_x = scene->r.xsch;
156  int image_size_y = scene->r.ysch;
157 
158  /* Hardcoded legacy bit-flags which has been removed. */
159  const uint32_t use_transform_flag = (1 << 16);
160  const uint32_t use_crop_flag = (1 << 17);
161 
162  const StripElem *s_elem = SEQ_render_give_stripelem(seq, seq->start);
163  if (s_elem != NULL) {
164  image_size_x = s_elem->orig_width;
165  image_size_y = s_elem->orig_height;
166 
167  if (can_use_proxy(seq, SEQ_rendersize_to_proxysize(render_size))) {
168  image_size_x /= SEQ_rendersize_to_scale_factor(render_size);
169  image_size_y /= SEQ_rendersize_to_scale_factor(render_size);
170  }
171  }
172 
173  /* Default scale. */
174  if (t->scale_x == 0.0f && t->scale_y == 0.0f) {
175  t->scale_x = 1.0f;
176  t->scale_y = 1.0f;
177  }
178 
179  /* Clear crop if it was unused. This must happen before converting values. */
180  if ((seq->flag & use_crop_flag) == 0) {
181  c->bottom = c->top = c->left = c->right = 0;
182  }
183 
184  if ((seq->flag & use_transform_flag) == 0) {
185  t->xofs = t->yofs = 0;
186 
187  /* Reverse scale to fit for strips not using offset. */
188  float project_aspect = (float)scene->r.xsch / (float)scene->r.ysch;
189  float image_aspect = (float)image_size_x / (float)image_size_y;
190  if (project_aspect > image_aspect) {
191  t->scale_x = project_aspect / image_aspect;
192  }
193  else {
194  t->scale_y = image_aspect / project_aspect;
195  }
196  }
197 
198  if ((seq->flag & use_crop_flag) != 0 && (seq->flag & use_transform_flag) == 0) {
199  /* Calculate image offset. */
200  float s_x = scene->r.xsch / image_size_x;
201  float s_y = scene->r.ysch / image_size_y;
202  old_image_center_x += c->right * s_x - c->left * s_x;
203  old_image_center_y += c->top * s_y - c->bottom * s_y;
204 
205  /* Convert crop to scale. */
206  int cropped_image_size_x = image_size_x - c->right - c->left;
207  int cropped_image_size_y = image_size_y - c->top - c->bottom;
208  c->bottom = c->top = c->left = c->right = 0;
209  t->scale_x *= (float)image_size_x / (float)cropped_image_size_x;
210  t->scale_y *= (float)image_size_y / (float)cropped_image_size_y;
211  }
212 
213  if ((seq->flag & use_transform_flag) != 0) {
214  /* Convert image offset. */
215  old_image_center_x = image_size_x / 2 - c->left + t->xofs;
216  old_image_center_y = image_size_y / 2 - c->bottom + t->yofs;
217 
218  /* Preserve original image size. */
219  t->scale_x = t->scale_y = MAX2((float)image_size_x / (float)scene->r.xsch,
220  (float)image_size_y / (float)scene->r.ysch);
221 
222  /* Convert crop. */
223  if ((seq->flag & use_crop_flag) != 0) {
224  c->top /= t->scale_x;
225  c->bottom /= t->scale_x;
226  c->left /= t->scale_x;
227  c->right /= t->scale_x;
228  }
229  }
230 
231  t->xofs = old_image_center_x - scene->r.xsch / 2;
232  t->yofs = old_image_center_y - scene->r.ysch / 2;
233 
234  /* Convert offset animation, but only if crop is not used. */
235  if ((seq->flag & use_transform_flag) != 0 && (seq->flag & use_crop_flag) == 0) {
236  char name_esc[(sizeof(seq->name) - 2) * 2], *path;
237  BLI_str_escape(name_esc, seq->name + 2, sizeof(name_esc));
238 
239  path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].transform.offset_x", name_esc);
240  seq_convert_transform_animation(scene, path, image_size_x);
241  MEM_freeN(path);
242  path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].transform.offset_y", name_esc);
243  seq_convert_transform_animation(scene, path, image_size_y);
244  MEM_freeN(path);
245  }
246 
247  seq->flag &= ~use_transform_flag;
248  seq->flag &= ~use_crop_flag;
249 }
250 
252  const ListBase *lb,
253  const eSpaceSeq_Proxy_RenderSize render_size)
254 {
255 
256  LISTBASE_FOREACH (Sequence *, seq, lb) {
257  if (seq->type != SEQ_TYPE_SOUND_RAM) {
258  seq_convert_transform_crop(scene, seq, render_size);
259  }
260  if (seq->type == SEQ_TYPE_META) {
261  seq_convert_transform_crop_lb(scene, &seq->seqbase, render_size);
262  }
263  }
264 }
265 
267  const char *path,
268  const float scale_to_fit_factor)
269 {
270  if (scene->adt == NULL || scene->adt->action == NULL) {
271  return;
272  }
273 
274  FCurve *fcu = BKE_fcurve_find(&scene->adt->action->curves, path, 0);
275  if (fcu != NULL && !BKE_fcurve_is_empty(fcu)) {
276  BezTriple *bezt = fcu->bezt;
277  for (int i = 0; i < fcu->totvert; i++, bezt++) {
278  /* Same math as with old_image_center_*, but simplified. */
279  bezt->vec[0][1] *= scale_to_fit_factor;
280  bezt->vec[1][1] *= scale_to_fit_factor;
281  bezt->vec[2][1] *= scale_to_fit_factor;
282  }
283  }
284 }
285 
287  Sequence *seq,
288  const eSpaceSeq_Proxy_RenderSize render_size)
289 {
290  const StripElem *s_elem = SEQ_render_give_stripelem(seq, seq->start);
291  if (s_elem == NULL) {
292  return;
293  }
294 
295  StripCrop *c = seq->strip->crop;
296  StripTransform *t = seq->strip->transform;
297  int image_size_x = s_elem->orig_width;
298  int image_size_y = s_elem->orig_height;
299 
300  if (can_use_proxy(seq, SEQ_rendersize_to_proxysize(render_size))) {
301  image_size_x /= SEQ_rendersize_to_scale_factor(render_size);
302  image_size_y /= SEQ_rendersize_to_scale_factor(render_size);
303  }
304 
305  /* Calculate scale factor, so image fits in preview area with original aspect ratio. */
306  const float scale_to_fit_factor = MIN2((float)scene->r.xsch / (float)image_size_x,
307  (float)scene->r.ysch / (float)image_size_y);
308  t->scale_x *= scale_to_fit_factor;
309  t->scale_y *= scale_to_fit_factor;
310  c->top /= scale_to_fit_factor;
311  c->bottom /= scale_to_fit_factor;
312  c->left /= scale_to_fit_factor;
313  c->right /= scale_to_fit_factor;
314 
315  char name_esc[(sizeof(seq->name) - 2) * 2], *path;
316  BLI_str_escape(name_esc, seq->name + 2, sizeof(name_esc));
317  path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].transform.scale_x", name_esc);
318  seq_convert_transform_animation_2(scene, path, scale_to_fit_factor);
319  MEM_freeN(path);
320  path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].transform.scale_y", name_esc);
321  seq_convert_transform_animation_2(scene, path, scale_to_fit_factor);
322  MEM_freeN(path);
323  path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].crop.min_x", name_esc);
324  seq_convert_transform_animation_2(scene, path, 1 / scale_to_fit_factor);
325  MEM_freeN(path);
326  path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].crop.max_x", name_esc);
327  seq_convert_transform_animation_2(scene, path, 1 / scale_to_fit_factor);
328  MEM_freeN(path);
329  path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].crop.min_y", name_esc);
330  seq_convert_transform_animation_2(scene, path, 1 / scale_to_fit_factor);
331  MEM_freeN(path);
332  path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].crop.max_x", name_esc);
333  seq_convert_transform_animation_2(scene, path, 1 / scale_to_fit_factor);
334  MEM_freeN(path);
335 }
336 
338  const ListBase *lb,
339  const eSpaceSeq_Proxy_RenderSize render_size)
340 {
341 
342  LISTBASE_FOREACH (Sequence *, seq, lb) {
343  if (seq->type != SEQ_TYPE_SOUND_RAM) {
344  seq_convert_transform_crop_2(scene, seq, render_size);
345  }
346  if (seq->type == SEQ_TYPE_META) {
347  seq_convert_transform_crop_lb_2(scene, &seq->seqbase, render_size);
348  }
349  }
350 }
351 
353 {
354  if (ed == NULL) {
355  return;
356  }
357 
359  /* Update ms->disp_range from meta. */
360  if (ms->disp_range[0] == ms->disp_range[1]) {
361  copy_v2_v2_int(ms->disp_range, &ms->parseq->startdisp);
362  }
363 
364  /* Update meta strip endpoints. */
365  SEQ_transform_set_left_handle_frame(ms->parseq, ms->disp_range[0]);
366  SEQ_transform_set_right_handle_frame(ms->parseq, ms->disp_range[1]);
368 
369  /* Recalculate effects using meta strip. */
370  LISTBASE_FOREACH (Sequence *, seq, ms->oldbasep) {
371  if (seq->seq2) {
372  seq->start = seq->startdisp = max_ii(seq->seq1->startdisp, seq->seq2->startdisp);
373  seq->enddisp = min_ii(seq->seq1->enddisp, seq->seq2->enddisp);
374  }
375  }
376 
377  /* Ensure that active seqbase points to active meta strip seqbase. */
378  MetaStack *active_ms = SEQ_meta_stack_active_get(ed);
379  SEQ_seqbase_active_set(ed, &active_ms->parseq->seqbase);
380  }
381 }
382 
384  const int node_type,
385  const char *old_name,
386  const char *new_name)
387 {
388  /* Duplicate a link going into the original socket. */
390  if (link->tonode->type == node_type) {
391  bNode *node = link->tonode;
392  bNodeSocket *dest_socket = nodeFindSocket(node, SOCK_IN, new_name);
393  BLI_assert(dest_socket);
394  if (STREQ(link->tosock->name, old_name)) {
395  nodeAddLink(ntree, link->fromnode, link->fromsock, node, dest_socket);
396  }
397  }
398  }
399 
400  /* Duplicate the default value from the old socket and assign it to the new socket. */
402  if (node->type == node_type) {
403  bNodeSocket *source_socket = nodeFindSocket(node, SOCK_IN, old_name);
404  bNodeSocket *dest_socket = nodeFindSocket(node, SOCK_IN, new_name);
405  BLI_assert(source_socket && dest_socket);
406  if (dest_socket->default_value) {
407  MEM_freeN(dest_socket->default_value);
408  }
409  dest_socket->default_value = MEM_dupallocN(source_socket->default_value);
410  }
411  }
412 }
413 
415 {
416  if (!MAIN_VERSION_ATLEAST(bmain, 290, 1)) {
417  /* Patch old grease pencil modifiers material filter. */
418  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
419  LISTBASE_FOREACH (GpencilModifierData *, md, &ob->greasepencil_modifiers) {
420  switch (md->type) {
423  if (gpmd->materialname[0] != '\0') {
424  gpmd->material = BLI_findstring(
425  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
426  gpmd->materialname[0] = '\0';
427  }
428  break;
429  }
432  if (gpmd->materialname[0] != '\0') {
433  gpmd->material = BLI_findstring(
434  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
435  gpmd->materialname[0] = '\0';
436  }
437  break;
438  }
441  if (gpmd->materialname[0] != '\0') {
442  gpmd->material = BLI_findstring(
443  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
444  gpmd->materialname[0] = '\0';
445  }
446  break;
447  }
450  if (gpmd->materialname[0] != '\0') {
451  gpmd->material = BLI_findstring(
452  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
453  gpmd->materialname[0] = '\0';
454  }
455  break;
456  }
459  if (gpmd->materialname[0] != '\0') {
460  gpmd->material = BLI_findstring(
461  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
462  gpmd->materialname[0] = '\0';
463  }
464  break;
465  }
468  if (gpmd->materialname[0] != '\0') {
469  gpmd->material = BLI_findstring(
470  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
471  gpmd->materialname[0] = '\0';
472  }
473  break;
474  }
477  if (gpmd->materialname[0] != '\0') {
478  gpmd->material = BLI_findstring(
479  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
480  gpmd->materialname[0] = '\0';
481  }
482  break;
483  }
486  if (gpmd->materialname[0] != '\0') {
487  gpmd->material = BLI_findstring(
488  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
489  gpmd->materialname[0] = '\0';
490  }
491  break;
492  }
495  if (gpmd->materialname[0] != '\0') {
496  gpmd->material = BLI_findstring(
497  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
498  gpmd->materialname[0] = '\0';
499  }
500  break;
501  }
504  if (gpmd->materialname[0] != '\0') {
505  gpmd->material = BLI_findstring(
506  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
507  gpmd->materialname[0] = '\0';
508  }
509  break;
510  }
513  if (gpmd->materialname[0] != '\0') {
514  gpmd->material = BLI_findstring(
515  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
516  gpmd->materialname[0] = '\0';
517  }
518  break;
519  }
522  if (gpmd->materialname[0] != '\0') {
523  gpmd->material = BLI_findstring(
524  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
525  gpmd->materialname[0] = '\0';
526  }
527  break;
528  }
531  if (gpmd->materialname[0] != '\0') {
532  gpmd->material = BLI_findstring(
533  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
534  gpmd->materialname[0] = '\0';
535  }
536  break;
537  }
540  if (gpmd->materialname[0] != '\0') {
541  gpmd->material = BLI_findstring(
542  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
543  gpmd->materialname[0] = '\0';
544  }
545  break;
546  }
547  default:
548  break;
549  }
550  }
551  }
552 
553  /* Patch first frame for old files. */
554  Scene *scene = bmain->scenes.first;
555  if (scene != NULL) {
556  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
557  if (ob->type != OB_GPENCIL) {
558  continue;
559  }
560  bGPdata *gpd = ob->data;
561  LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
562  bGPDframe *gpf = gpl->frames.first;
563  if (gpf && gpf->framenum > scene->r.sfra) {
564  bGPDframe *gpf_dup = BKE_gpencil_frame_duplicate(gpf, true);
565  gpf_dup->framenum = scene->r.sfra;
566  BLI_addhead(&gpl->frames, gpf_dup);
567  }
568  }
569  }
570  }
571  }
572 
573  if (!MAIN_VERSION_ATLEAST(bmain, 291, 1)) {
574  LISTBASE_FOREACH (Collection *, collection, &bmain->collections) {
575  if (BKE_collection_cycles_fix(bmain, collection)) {
576  printf(
577  "WARNING: Cycle detected in collection '%s', fixed as best as possible.\n"
578  "You may have to reconstruct your View Layers...\n",
579  collection->id.name);
580  }
581  }
582  }
583 
584  if (!MAIN_VERSION_ATLEAST(bmain, 291, 8)) {
600  for (int input_id = 21; input_id >= 18; input_id--) {
601  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
602  if (ntree->type == NTREE_SHADER) {
604  if (node->type != SH_NODE_BSDF_PRINCIPLED) {
605  continue;
606  }
607 
608  const size_t node_name_length = strlen(node->name);
609  const size_t node_name_escaped_max_length = (node_name_length * 2);
610  char *node_name_escaped = MEM_mallocN(node_name_escaped_max_length + 1,
611  "escaped name");
612  BLI_str_escape(node_name_escaped, node->name, node_name_escaped_max_length);
613  char *rna_path_prefix = BLI_sprintfN("nodes[\"%s\"].inputs", node_name_escaped);
614 
616  bmain, id, rna_path_prefix, NULL, NULL, input_id, input_id + 1, false);
617  MEM_freeN(rna_path_prefix);
618  MEM_freeN(node_name_escaped);
619  }
620  }
621  }
623  }
624  }
625 
626  /* Convert all Multires displacement to Catmull-Clark subdivision limit surface. */
627  if (!MAIN_VERSION_ATLEAST(bmain, 292, 1)) {
628  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
629  ModifierData *md;
630  for (md = ob->modifiers.first; md; md = md->next) {
631  if (md->type == eModifierType_Multires) {
633  if (mmd->simple) {
635  }
636  }
637  }
638  }
639  }
640 
641  if (!MAIN_VERSION_ATLEAST(bmain, 292, 2)) {
642 
644 
645  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
646  if (scene->ed != NULL) {
648  }
649  }
650  }
651 
652  if (!MAIN_VERSION_ATLEAST(bmain, 292, 8)) {
653  /* Systematically rebuild posebones to ensure consistent ordering matching the one of bones in
654  * Armature obdata. */
655  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
656  if (ob->type == OB_ARMATURE) {
657  BKE_pose_rebuild(bmain, ob, ob->data, true);
658  }
659  }
660 
661  /* Wet Paint Radius Factor */
662  for (Brush *br = bmain->brushes.first; br; br = br->id.next) {
663  if (br->ob_mode & OB_MODE_SCULPT && br->wet_paint_radius_factor == 0.0f) {
664  br->wet_paint_radius_factor = 1.0f;
665  }
666  }
667 
669  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
670  if (scene->ed != NULL) {
672  }
673  }
674  }
675 
676  if (!MAIN_VERSION_ATLEAST(bmain, 293, 16)) {
677  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
679  }
680 
681  /* Add a separate socket for Grid node X and Y size. */
682  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
683  if (ntree->type == NTREE_GEOMETRY) {
685  }
687  }
688  }
689 
690  if (!MAIN_VERSION_ATLEAST(bmain, 293, 20)) {
691  /* Set zero user text objects to have a fake user. */
692  LISTBASE_FOREACH (Text *, text, &bmain->texts) {
693  if (text->id.us == 0) {
694  id_fake_user_set(&text->id);
695  }
696  }
697  }
698 
709  {
710  /* Keep this block, even when empty. */
711  }
712 }
713 
715 {
716  const bool was_closed_x = panel->flag & PNL_UNUSED_1;
717  const bool was_closed_y = panel->flag & PNL_CLOSED; /* That value was the Y closed flag. */
718 
719  SET_FLAG_FROM_TEST(panel->flag, was_closed_x || was_closed_y, PNL_CLOSED);
720 
721  /* Clear the old PNL_CLOSEDX flag. */
722  panel->flag &= ~PNL_UNUSED_1;
723 
724  LISTBASE_FOREACH (Panel *, child_panel, &panel->children) {
726  }
727 }
728 
730 {
731  /* Change to generic named float/float3 attributes. */
732  const int CD_LOCATION = 43;
733  const int CD_RADIUS = 44;
734 
735  for (int i = 0; i < pdata->totlayer; i++) {
736  CustomDataLayer *layer = &pdata->layers[i];
737  if (layer->type == CD_LOCATION) {
738  STRNCPY(layer->name, "Position");
739  layer->type = CD_PROP_FLOAT3;
740  }
741  else if (layer->type == CD_RADIUS) {
742  STRNCPY(layer->name, "Radius");
743  layer->type = CD_PROP_FLOAT;
744  }
745  }
746 }
747 
749 {
750  /* Change from capital initial letter to lower case (T82693). */
751  for (int i = 0; i < pdata->totlayer; i++) {
752  CustomDataLayer *layer = &pdata->layers[i];
753  if (layer->type == CD_PROP_FLOAT3 && STREQ(layer->name, "Position")) {
754  STRNCPY(layer->name, "position");
755  }
756  else if (layer->type == CD_PROP_FLOAT && STREQ(layer->name, "Radius")) {
757  STRNCPY(layer->name, "radius");
758  }
759  }
760 }
761 
762 /* Move FCurve handles towards the control point in such a way that the curve itself doesn't
763  * change. Since 2.91 FCurves are computed slightly differently, which requires this update to keep
764  * the same animation result. Previous versions scaled down overlapping handles during evaluation.
765  * This function applies the old correction to the actual animation data instead. */
767 {
768  uint i = 1;
769  for (BezTriple *bezt = fcu->bezt; i < fcu->totvert; i++, bezt++) {
770  /* Only adjust bezier key-frames. */
771  if (bezt->ipo != BEZT_IPO_BEZ) {
772  continue;
773  }
774 
775  BezTriple *nextbezt = bezt + 1;
776  const float v1[2] = {bezt->vec[1][0], bezt->vec[1][1]};
777  const float v2[2] = {bezt->vec[2][0], bezt->vec[2][1]};
778  const float v3[2] = {nextbezt->vec[0][0], nextbezt->vec[0][1]};
779  const float v4[2] = {nextbezt->vec[1][0], nextbezt->vec[1][1]};
780 
781  /* If the handles have no length, no need to do any corrections. */
782  if (v1[0] == v2[0] && v3[0] == v4[0]) {
783  continue;
784  }
785 
786  /* Calculate handle deltas. */
787  float delta1[2], delta2[2];
788  sub_v2_v2v2(delta1, v1, v2);
789  sub_v2_v2v2(delta2, v4, v3);
790 
791  const float len1 = fabsf(delta1[0]); /* Length of handle of first key. */
792  const float len2 = fabsf(delta2[0]); /* Length of handle of second key. */
793 
794  /* Overlapping handles used to be internally scaled down in previous versions.
795  * We bake the handles onto these previously virtual values. */
796  const float time_delta = v4[0] - v1[0];
797  const float total_len = len1 + len2;
798  if (total_len <= time_delta) {
799  continue;
800  }
801 
802  const float factor = time_delta / total_len;
803  /* Current keyframe's right handle: */
804  madd_v2_v2v2fl(bezt->vec[2], v1, delta1, -factor); /* vec[2] = v1 - factor * delta1 */
805  /* Next keyframe's left handle: */
806  madd_v2_v2v2fl(nextbezt->vec[0], v4, delta2, -factor); /* vec[0] = v4 - factor * delta2 */
807  }
808 }
809 
811 {
812  LISTBASE_FOREACH (Sequence *, seq, seqbase) {
813  seq->cache_flag = 0;
814  if (seq->type == SEQ_TYPE_META) {
816  }
817  }
818 }
819 
821  const int node_type,
822  const char *old_name,
823  const char *new_name)
824 {
826  if (node->type == node_type) {
827  LISTBASE_FOREACH (bNodeSocket *, socket, &node->inputs) {
828  if (STREQ(socket->name, old_name)) {
829  strcpy(socket->name, new_name);
830  }
831  if (STREQ(socket->identifier, old_name)) {
832  strcpy(socket->identifier, new_name);
833  }
834  }
835  LISTBASE_FOREACH (bNodeSocket *, socket, &node->outputs) {
836  if (STREQ(socket->name, old_name)) {
837  strcpy(socket->name, new_name);
838  }
839  if (STREQ(socket->identifier, old_name)) {
840  strcpy(socket->identifier, new_name);
841  }
842  }
843  }
844  }
845 }
846 
848 {
850  if (link->tonode->type == GEO_NODE_JOIN_GEOMETRY && !(link->tosock->flag & SOCK_MULTI_INPUT)) {
851  link->tosock = link->tonode->inputs.first;
852  }
853  }
855  if (node->type == GEO_NODE_JOIN_GEOMETRY) {
856  bNodeSocket *socket = node->inputs.first;
857  socket->flag |= SOCK_MULTI_INPUT;
858  socket->limit = 4095;
859  nodeRemoveSocket(ntree, node, socket->next);
860  }
861  }
862 }
863 
865  int region_type,
866  const char *name,
867  int link_after_region_type)
868 {
869  ARegion *link_after_region = NULL;
870  LISTBASE_FOREACH (ARegion *, region, regionbase) {
871  if (region->regiontype == region_type) {
872  return NULL;
873  }
874  if (region->regiontype == link_after_region_type) {
875  link_after_region = region;
876  }
877  }
878  ARegion *new_region = MEM_callocN(sizeof(ARegion), name);
879  new_region->regiontype = region_type;
880  BLI_insertlinkafter(regionbase, link_after_region, new_region);
881  return new_region;
882 }
883 
885 {
886  /* Binding array data could be freed without properly resetting its size data. */
887  LISTBASE_FOREACH (bConstraint *, con, lb) {
888  if (con->type == CONSTRAINT_TYPE_SPLINEIK) {
890  if (data->points == NULL) {
891  data->numpoints = 0;
892  }
893  }
894  }
895 }
896 
897 /* NOLINTNEXTLINE: readability-function-size */
899 {
900  UNUSED_VARS(fd);
901 
902  if (MAIN_VERSION_ATLEAST(bmain, 290, 2) && MAIN_VERSION_OLDER(bmain, 291, 1)) {
903  /* In this range, the extrude manifold could generate meshes with degenerated face. */
904  LISTBASE_FOREACH (Mesh *, me, &bmain->meshes) {
905  for (MPoly *mp = me->mpoly, *mp_end = mp + me->totpoly; mp < mp_end; mp++) {
906  if (mp->totloop == 2) {
907  bool changed;
909  me->mvert,
910  me->totvert,
911  me->medge,
912  me->totedge,
913  me->mface,
914  me->totface,
915  me->mloop,
916  me->totloop,
917  me->mpoly,
918  me->totpoly,
919  me->dvert,
920  false,
921  true,
922  &changed);
923  break;
924  }
925  }
926  }
927  }
928 
930  if (!MAIN_VERSION_ATLEAST(bmain, 290, 2)) {
931  {
932  short id_codes[] = {ID_BR, ID_PAL};
933  for (int i = 0; i < ARRAY_SIZE(id_codes); i++) {
934  ListBase *lb = which_libbase(bmain, id_codes[i]);
936  }
937  }
938 
939  if (!DNA_struct_elem_find(fd->filesdna, "SpaceImage", "float", "uv_opacity")) {
940  for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
941  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
942  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
943  if (sl->spacetype == SPACE_IMAGE) {
944  SpaceImage *sima = (SpaceImage *)sl;
945  sima->uv_opacity = 1.0f;
946  }
947  }
948  }
949  }
950  }
951 
952  /* Init Grease Pencil new random curves. */
953  if (!DNA_struct_elem_find(fd->filesdna, "BrushGpencilSettings", "float", "random_hue")) {
954  LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
955  if ((brush->gpencil_settings) && (brush->gpencil_settings->curve_rand_pressure == NULL)) {
956  brush->gpencil_settings->curve_rand_pressure = BKE_curvemapping_add(
957  1, 0.0f, 0.0f, 1.0f, 1.0f);
958  brush->gpencil_settings->curve_rand_strength = BKE_curvemapping_add(
959  1, 0.0f, 0.0f, 1.0f, 1.0f);
960  brush->gpencil_settings->curve_rand_uv = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
961  brush->gpencil_settings->curve_rand_hue = BKE_curvemapping_add(
962  1, 0.0f, 0.0f, 1.0f, 1.0f);
963  brush->gpencil_settings->curve_rand_saturation = BKE_curvemapping_add(
964  1, 0.0f, 0.0f, 1.0f, 1.0f);
965  brush->gpencil_settings->curve_rand_value = BKE_curvemapping_add(
966  1, 0.0f, 0.0f, 1.0f, 1.0f);
967  }
968  }
969  }
970  }
971 
972  if (!MAIN_VERSION_ATLEAST(bmain, 290, 4)) {
973  /* Clear old deprecated bit-flag from edit weights modifiers, we now use it for something else.
974  */
975  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
976  LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
977  if (md->type == eModifierType_WeightVGEdit) {
979  }
980  }
981  }
982 
983  /* Initialize parameters of the new Nishita sky model. */
984  if (!DNA_struct_elem_find(fd->filesdna, "NodeTexSky", "float", "sun_size")) {
985  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
986  if (ntree->type == NTREE_SHADER) {
988  if (node->type == SH_NODE_TEX_SKY && node->storage) {
989  NodeTexSky *tex = (NodeTexSky *)node->storage;
990  tex->sun_disc = true;
991  tex->sun_size = DEG2RADF(0.545);
992  tex->sun_elevation = M_PI_2;
993  tex->sun_rotation = 0.0f;
994  tex->altitude = 0.0f;
995  tex->air_density = 1.0f;
996  tex->dust_density = 1.0f;
997  tex->ozone_density = 1.0f;
998  }
999  }
1000  }
1001  }
1003  }
1004  }
1005 
1006  if (!MAIN_VERSION_ATLEAST(bmain, 290, 6)) {
1007  /* Transition to saving expansion for all of a modifier's sub-panels. */
1008  if (!DNA_struct_elem_find(fd->filesdna, "ModifierData", "short", "ui_expand_flag")) {
1009  for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) {
1010  LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
1011  if (md->mode & eModifierMode_Expanded_DEPRECATED) {
1012  md->ui_expand_flag = 1;
1013  }
1014  else {
1015  md->ui_expand_flag = 0;
1016  }
1017  }
1018  }
1019  }
1020 
1021  /* EEVEE Motion blur new parameters. */
1022  if (!DNA_struct_elem_find(fd->filesdna, "SceneEEVEE", "float", "motion_blur_depth_scale")) {
1023  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1025  scene->eevee.motion_blur_max = 32;
1026  }
1027  }
1028 
1029  if (!DNA_struct_elem_find(fd->filesdna, "SceneEEVEE", "int", "motion_blur_steps")) {
1030  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1032  }
1033  }
1034 
1035  /* Transition to saving expansion for all of a constraint's sub-panels. */
1036  if (!DNA_struct_elem_find(fd->filesdna, "bConstraint", "short", "ui_expand_flag")) {
1037  for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) {
1038  LISTBASE_FOREACH (bConstraint *, con, &object->constraints) {
1039  if (con->flag & CONSTRAINT_EXPAND_DEPRECATED) {
1040  con->ui_expand_flag = 1;
1041  }
1042  else {
1043  con->ui_expand_flag = 0;
1044  }
1045  }
1046  }
1047  }
1048 
1049  /* Transition to saving expansion for all of grease pencil modifier's sub-panels. */
1050  if (!DNA_struct_elem_find(fd->filesdna, "GpencilModifierData", "short", "ui_expand_flag")) {
1051  for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) {
1052  LISTBASE_FOREACH (GpencilModifierData *, md, &object->greasepencil_modifiers) {
1053  if (md->mode & eGpencilModifierMode_Expanded_DEPRECATED) {
1054  md->ui_expand_flag = 1;
1055  }
1056  else {
1057  md->ui_expand_flag = 0;
1058  }
1059  }
1060  }
1061  }
1062 
1063  /* Transition to saving expansion for all of an effect's sub-panels. */
1064  if (!DNA_struct_elem_find(fd->filesdna, "ShaderFxData", "short", "ui_expand_flag")) {
1065  for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) {
1066  LISTBASE_FOREACH (ShaderFxData *, fx, &object->shader_fx) {
1067  if (fx->mode & eShaderFxMode_Expanded_DEPRECATED) {
1068  fx->ui_expand_flag = 1;
1069  }
1070  else {
1071  fx->ui_expand_flag = 0;
1072  }
1073  }
1074  }
1075  }
1076 
1077  /* Refactor bevel profile type to use an enum. */
1078  if (!DNA_struct_elem_find(fd->filesdna, "BevelModifierData", "short", "profile_type")) {
1079  for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) {
1080  LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
1081  if (md->type == eModifierType_Bevel) {
1082  BevelModifierData *bmd = (BevelModifierData *)md;
1083  bool use_custom_profile = bmd->flags & MOD_BEVEL_CUSTOM_PROFILE_DEPRECATED;
1084  bmd->profile_type = use_custom_profile ? MOD_BEVEL_PROFILE_CUSTOM :
1086  }
1087  }
1088  }
1089  }
1090 
1091  /* Change ocean modifier values from [0, 10] to [0, 1] ranges. */
1092  for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) {
1093  LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
1094  if (md->type == eModifierType_Ocean) {
1095  OceanModifierData *omd = (OceanModifierData *)md;
1096  omd->wave_alignment *= 0.1f;
1097  omd->sharpen_peak_jonswap *= 0.1f;
1098  }
1099  }
1100  }
1101  }
1102  if (!MAIN_VERSION_ATLEAST(bmain, 291, 1)) {
1103 
1104  /* Initialize additional parameter of the Nishita sky model and change altitude unit. */
1105  if (!DNA_struct_elem_find(fd->filesdna, "NodeTexSky", "float", "sun_intensity")) {
1106  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1107  if (ntree->type == NTREE_SHADER) {
1109  if (node->type == SH_NODE_TEX_SKY && node->storage) {
1110  NodeTexSky *tex = (NodeTexSky *)node->storage;
1111  tex->sun_intensity = 1.0f;
1112  tex->altitude *= 0.001f;
1113  }
1114  }
1115  }
1116  }
1118  }
1119 
1120  /* Refactor bevel affect type to use an enum. */
1121  if (!DNA_struct_elem_find(fd->filesdna, "BevelModifierData", "char", "affect_type")) {
1122  for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) {
1123  LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
1124  if (md->type == eModifierType_Bevel) {
1125  BevelModifierData *bmd = (BevelModifierData *)md;
1126  const bool use_vertex_bevel = bmd->flags & MOD_BEVEL_VERT_DEPRECATED;
1127  bmd->affect_type = use_vertex_bevel ? MOD_BEVEL_AFFECT_VERTICES :
1129  }
1130  }
1131  }
1132  }
1133 
1134  /* Initialize additional velocity parameter for #CacheFile's. */
1135  if (!DNA_struct_elem_find(
1136  fd->filesdna, "MeshSeqCacheModifierData", "float", "velocity_scale")) {
1137  for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) {
1138  LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
1139  if (md->type == eModifierType_MeshSequenceCache) {
1141  mcmd->velocity_scale = 1.0f;
1142  mcmd->vertex_velocities = NULL;
1143  mcmd->num_vertices = 0;
1144  }
1145  }
1146  }
1147  }
1148 
1149  if (!DNA_struct_elem_find(fd->filesdna, "CacheFile", "char", "velocity_unit")) {
1150  for (CacheFile *cache_file = bmain->cachefiles.first; cache_file != NULL;
1151  cache_file = cache_file->id.next) {
1152  BLI_strncpy(cache_file->velocity_name, ".velocities", sizeof(cache_file->velocity_name));
1153  cache_file->velocity_unit = CACHEFILE_VELOCITY_UNIT_SECOND;
1154  }
1155  }
1156 
1157  if (!DNA_struct_elem_find(fd->filesdna, "OceanModifierData", "int", "viewport_resolution")) {
1158  for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) {
1159  LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
1160  if (md->type == eModifierType_Ocean) {
1161  OceanModifierData *omd = (OceanModifierData *)md;
1162  omd->viewport_resolution = omd->resolution;
1163  }
1164  }
1165  }
1166  }
1167 
1168  /* Remove panel X axis collapsing, a remnant of horizontal panel alignment. */
1169  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1170  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1171  LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
1172  LISTBASE_FOREACH (Panel *, panel, &region->panels) {
1174  }
1175  }
1176  }
1177  }
1178  }
1179 
1180  if (!MAIN_VERSION_ATLEAST(bmain, 291, 2)) {
1181  for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) {
1183 
1184  if (rbw == NULL) {
1185  continue;
1186  }
1187 
1188  /* The substep method changed from "per second" to "per frame".
1189  * To get the new value simply divide the old bullet sim fps with the scene fps.
1190  */
1191  rbw->substeps_per_frame /= FPS;
1192 
1193  if (rbw->substeps_per_frame <= 0) {
1194  rbw->substeps_per_frame = 1;
1195  }
1196  }
1197 
1198  /* Hair and PointCloud attributes. */
1199  for (Hair *hair = bmain->hairs.first; hair != NULL; hair = hair->id.next) {
1200  do_versions_point_attributes(&hair->pdata);
1201  }
1202  for (PointCloud *pointcloud = bmain->pointclouds.first; pointcloud != NULL;
1203  pointcloud = pointcloud->id.next) {
1204  do_versions_point_attributes(&pointcloud->pdata);
1205  }
1206 
1207  /* Show outliner mode column by default. */
1208  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1209  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1210  LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) {
1211  if (space->spacetype == SPACE_OUTLINER) {
1212  SpaceOutliner *space_outliner = (SpaceOutliner *)space;
1213 
1214  space_outliner->flag |= SO_MODE_COLUMN;
1215  }
1216  }
1217  }
1218  }
1219 
1220  /* Solver and Collections for Boolean. */
1221  for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) {
1222  LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
1223  if (md->type == eModifierType_Boolean) {
1227  }
1228  }
1229  }
1230  }
1231 
1232  if (!MAIN_VERSION_ATLEAST(bmain, 291, 4) && MAIN_VERSION_ATLEAST(bmain, 291, 1)) {
1233  /* Due to a48d78ce07f4f, CustomData.totlayer and CustomData.maxlayer has been written
1234  * incorrectly. Fortunately, the size of the layers array has been written to the .blend file
1235  * as well, so we can reconstruct totlayer and maxlayer from that. */
1236  LISTBASE_FOREACH (Mesh *, mesh, &bmain->meshes) {
1237  mesh->vdata.totlayer = mesh->vdata.maxlayer = MEM_allocN_len(mesh->vdata.layers) /
1238  sizeof(CustomDataLayer);
1239  mesh->edata.totlayer = mesh->edata.maxlayer = MEM_allocN_len(mesh->edata.layers) /
1240  sizeof(CustomDataLayer);
1241  /* We can be sure that mesh->fdata is empty for files written by 2.90. */
1243  sizeof(CustomDataLayer);
1244  mesh->pdata.totlayer = mesh->pdata.maxlayer = MEM_allocN_len(mesh->pdata.layers) /
1245  sizeof(CustomDataLayer);
1246  }
1247  }
1248 
1249  if (!MAIN_VERSION_ATLEAST(bmain, 291, 5)) {
1250  /* Fix fcurves to allow for new bezier handles behavior (T75881 and D8752). */
1251  for (bAction *act = bmain->actions.first; act; act = act->id.next) {
1252  for (FCurve *fcu = act->curves.first; fcu; fcu = fcu->next) {
1253  /* Only need to fix Bezier curves with at least 2 key-frames. */
1254  if (fcu->totvert < 2 || fcu->bezt == NULL) {
1255  continue;
1256  }
1258  }
1259  }
1260 
1261  LISTBASE_FOREACH (Collection *, collection, &bmain->collections) {
1262  collection->color_tag = COLLECTION_COLOR_NONE;
1263  }
1264  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1265  /* Old files do not have a master collection, but it will be created by
1266  * `BKE_collection_master_add()`. */
1267  if (scene->master_collection) {
1269  }
1270  }
1271 
1272  /* Add custom profile and bevel mode to curve bevels. */
1273  if (!DNA_struct_elem_find(fd->filesdna, "Curve", "char", "bevel_mode")) {
1274  LISTBASE_FOREACH (Curve *, curve, &bmain->curves) {
1275  if (curve->bevobj != NULL) {
1277  }
1278  else {
1280  }
1281  }
1282  }
1283 
1284  /* Ensure that new viewport display fields are initialized correctly. */
1285  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1286  LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1287  if (md->type == eModifierType_Fluid) {
1288  FluidModifierData *fmd = (FluidModifierData *)md;
1289  if (fmd->domain != NULL) {
1290  if (!fmd->domain->coba_field && fmd->domain->type == FLUID_DOMAIN_TYPE_LIQUID) {
1292  }
1293  fmd->domain->grid_scale = 1.0;
1294  fmd->domain->gridlines_upper_bound = 1.0;
1295  fmd->domain->vector_scale_with_magnitude = true;
1296  const float grid_lines[4] = {1.0, 0.0, 0.0, 1.0};
1297  copy_v4_v4(fmd->domain->gridlines_range_color, grid_lines);
1298  }
1299  }
1300  }
1301  }
1302  }
1303 
1304  if (!MAIN_VERSION_ATLEAST(bmain, 291, 6)) {
1305  /* Darken Inactive Overlay. */
1306  if (!DNA_struct_elem_find(fd->filesdna, "View3DOverlay", "float", "fade_alpha")) {
1307  for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
1308  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1309  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1310  if (sl->spacetype == SPACE_VIEW3D) {
1311  View3D *v3d = (View3D *)sl;
1312  v3d->overlay.fade_alpha = 0.40f;
1314  }
1315  }
1316  }
1317  }
1318  }
1319 
1320  /* Unify symmetry as a mesh property. */
1321  if (!DNA_struct_elem_find(fd->filesdna, "Mesh", "char", "symmetry")) {
1322  LISTBASE_FOREACH (Mesh *, mesh, &bmain->meshes) {
1323  /* The previous flags used to store mesh symmetry in edit-mode match the new ones that are
1324  * used in #Mesh.symmetry. */
1326  }
1327  }
1328 
1329  /* Alembic importer: allow vertex interpolation by default. */
1330  for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) {
1331  LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
1332  if (md->type != eModifierType_MeshSequenceCache) {
1333  continue;
1334  }
1335 
1337  data->read_flag |= MOD_MESHSEQ_INTERPOLATE_VERTICES;
1338  }
1339  }
1340  }
1341 
1342  if (!MAIN_VERSION_ATLEAST(bmain, 291, 7)) {
1343  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1344  scene->r.simplify_volumes = 1.0f;
1345  }
1346  }
1347 
1348  if (!MAIN_VERSION_ATLEAST(bmain, 291, 8)) {
1349  if (!DNA_struct_elem_find(fd->filesdna, "WorkSpaceDataRelation", "int", "parentid")) {
1350  LISTBASE_FOREACH (WorkSpace *, workspace, &bmain->workspaces) {
1352  WorkSpaceDataRelation *, relation, &workspace->hook_layout_relations) {
1353  relation->parent = blo_read_get_new_globaldata_address(fd, relation->parent);
1354  BLI_assert(relation->parentid == 0);
1355  if (relation->parent != NULL) {
1356  LISTBASE_FOREACH (wmWindowManager *, wm, &bmain->wm) {
1357  wmWindow *win = BLI_findptr(
1358  &wm->windows, relation->parent, offsetof(wmWindow, workspace_hook));
1359  if (win != NULL) {
1360  relation->parentid = win->winid;
1361  break;
1362  }
1363  }
1364  if (relation->parentid == 0) {
1365  BLI_assert(
1366  !"Found a valid parent for workspace data relation, but no valid parent id.");
1367  }
1368  }
1369  if (relation->parentid == 0) {
1370  BLI_freelinkN(&workspace->hook_layout_relations, relation);
1371  }
1372  }
1373  }
1374  }
1375 
1376  /* UV/Image show overlay option. */
1377  if (!DNA_struct_find(fd->filesdna, "SpaceImageOverlay")) {
1378  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1379  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1380  LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) {
1381  if (space->spacetype == SPACE_IMAGE) {
1382  SpaceImage *sima = (SpaceImage *)space;
1384  }
1385  }
1386  }
1387  }
1388  }
1389 
1390  /* Ensure that particle systems generated by fluid modifier have correct phystype. */
1391  LISTBASE_FOREACH (ParticleSettings *, part, &bmain->particles) {
1392  if (ELEM(
1394  part->phystype = PART_PHYS_NO;
1395  }
1396  }
1397  }
1398 
1399  if (!MAIN_VERSION_ATLEAST(bmain, 291, 9)) {
1400  /* Remove options of legacy UV/Image editor */
1401  for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
1402  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1403  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1404  switch (sl->spacetype) {
1405  case SPACE_IMAGE: {
1406  SpaceImage *sima = (SpaceImage *)sl;
1407  sima->flag &= ~(SI_FLAG_UNUSED_20);
1408  break;
1409  }
1410  }
1411  }
1412  }
1413  }
1414 
1415  if (!DNA_struct_elem_find(fd->filesdna, "FluidModifierData", "float", "fractions_distance")) {
1416  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1417  LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1418  if (md->type == eModifierType_Fluid) {
1419  FluidModifierData *fmd = (FluidModifierData *)md;
1420  if (fmd->domain) {
1421  fmd->domain->fractions_distance = 0.5;
1422  }
1423  }
1424  }
1425  }
1426  }
1427  }
1428 
1429  if (!MAIN_VERSION_ATLEAST(bmain, 292, 1)) {
1430  {
1431  const int LEGACY_REFINE_RADIAL_DISTORTION_K1 = (1 << 2);
1432 
1433  LISTBASE_FOREACH (MovieClip *, clip, &bmain->movieclips) {
1434  MovieTracking *tracking = &clip->tracking;
1435  MovieTrackingSettings *settings = &tracking->settings;
1436  int new_refine_camera_intrinsics = 0;
1437 
1439  new_refine_camera_intrinsics |= REFINE_FOCAL_LENGTH;
1440  }
1441 
1443  new_refine_camera_intrinsics |= REFINE_PRINCIPAL_POINT;
1444  }
1445 
1446  /* The end goal is to enable radial distortion refinement if either K1 or K2 were set for
1447  * refinement. It is enough to only check for L1 it was not possible to refine K2 without
1448  * K1. */
1449  if (settings->refine_camera_intrinsics & LEGACY_REFINE_RADIAL_DISTORTION_K1) {
1450  new_refine_camera_intrinsics |= REFINE_RADIAL_DISTORTION;
1451  }
1452 
1453  settings->refine_camera_intrinsics = new_refine_camera_intrinsics;
1454  }
1455  }
1456  }
1457 
1458  if (!MAIN_VERSION_ATLEAST(bmain, 292, 5)) {
1459  /* Initialize the opacity of the overlay wireframe */
1460  if (!DNA_struct_elem_find(fd->filesdna, "View3DOverlay", "float", "wireframe_opacity")) {
1461  for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
1462  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1463  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1464  if (sl->spacetype == SPACE_VIEW3D) {
1465  View3D *v3d = (View3D *)sl;
1466  v3d->overlay.wireframe_opacity = 1.0f;
1467  }
1468  }
1469  }
1470  }
1471  }
1472 
1473  /* Replace object hidden filter with inverted object visible filter. */
1474  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1475  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1476  LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) {
1477  if (space->spacetype == SPACE_OUTLINER) {
1478  SpaceOutliner *space_outliner = (SpaceOutliner *)space;
1479  if (space_outliner->filter_state == SO_FILTER_OB_HIDDEN) {
1480  space_outliner->filter_state = SO_FILTER_OB_VISIBLE;
1481  space_outliner->filter |= SO_FILTER_OB_STATE_INVERSE;
1482  }
1483  }
1484  }
1485  }
1486  }
1487 
1488  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1489  LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1490  if (md->type == eModifierType_WeightVGProximity) {
1492  if (wmd->cmap_curve == NULL) {
1493  wmd->cmap_curve = BKE_curvemapping_add(1, 0.0, 0.0, 1.0, 1.0);
1495  }
1496  }
1497  }
1498  }
1499 
1500  /* Hair and PointCloud attributes names. */
1501  LISTBASE_FOREACH (Hair *, hair, &bmain->hairs) {
1502  do_versions_point_attribute_names(&hair->pdata);
1503  }
1504  LISTBASE_FOREACH (PointCloud *, pointcloud, &bmain->pointclouds) {
1505  do_versions_point_attribute_names(&pointcloud->pdata);
1506  }
1507 
1508  /* Cryptomatte render pass */
1509  if (!DNA_struct_elem_find(fd->filesdna, "ViewLayer", "short", "cryptomatte_levels")) {
1510  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1511  LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) {
1512  view_layer->cryptomatte_levels = 6;
1513  view_layer->cryptomatte_flag = VIEW_LAYER_CRYPTOMATTE_ACCURATE;
1514  }
1515  }
1516  }
1517  }
1518 
1519  if (!MAIN_VERSION_ATLEAST(bmain, 292, 7)) {
1520  /* Make all IDProperties used as interface of geometry node trees overridable. */
1521  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1522  LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1523  if (md->type == eModifierType_Nodes) {
1524  NodesModifierData *nmd = (NodesModifierData *)md;
1525  IDProperty *nmd_properties = nmd->settings.properties;
1526 
1527  BLI_assert(nmd_properties->type == IDP_GROUP);
1528  LISTBASE_FOREACH (IDProperty *, nmd_socket_idprop, &nmd_properties->data.group) {
1529  nmd_socket_idprop->flag |= IDP_FLAG_OVERRIDABLE_LIBRARY;
1530  }
1531  }
1532  }
1533  }
1534 
1535  /* EEVEE/Cycles Volumes consistency */
1536  for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) {
1537  /* Remove Volume Transmittance render pass from each view layer. */
1538  LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) {
1539  view_layer->eevee.render_passes &= ~EEVEE_RENDER_PASS_UNUSED_8;
1540  }
1541 
1542  /* Rename Renderlayer Socket `VolumeScatterCol` to `VolumeDir` */
1543  if (scene->nodetree) {
1545  if (node->type == CMP_NODE_R_LAYERS) {
1546  LISTBASE_FOREACH (bNodeSocket *, output_socket, &node->outputs) {
1547  const char *volume_scatter = "VolumeScatterCol";
1548  if (STREQLEN(output_socket->name, volume_scatter, MAX_NAME)) {
1549  BLI_strncpy(output_socket->name, RE_PASSNAME_VOLUME_LIGHT, MAX_NAME);
1550  }
1551  }
1552  }
1553  }
1554  }
1555  }
1556 
1557  /* Convert `NodeCryptomatte->storage->matte_id` to `NodeCryptomatte->storage->entries` */
1558  if (!DNA_struct_find(fd->filesdna, "CryptomatteEntry")) {
1559  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1560  if (scene->nodetree) {
1562  if (node->type == CMP_NODE_CRYPTOMATTE_LEGACY) {
1563  NodeCryptomatte *storage = (NodeCryptomatte *)node->storage;
1564  char *matte_id = storage->matte_id;
1565  if (matte_id == NULL || strlen(storage->matte_id) == 0) {
1566  continue;
1567  }
1568  BKE_cryptomatte_matte_id_to_entries(storage, storage->matte_id);
1569  }
1570  }
1571  }
1572  }
1573  }
1574 
1575  /* Overlay elements in the sequencer. */
1576  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1577  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1578  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1579  if (sl->spacetype == SPACE_SEQ) {
1580  SpaceSeq *sseq = (SpaceSeq *)sl;
1583  }
1584  }
1585  }
1586  }
1587  }
1588 
1589  if (!MAIN_VERSION_ATLEAST(bmain, 292, 8)) {
1590  LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
1592  if (STREQ(node->idname, "GeometryNodeRandomAttribute")) {
1593  STRNCPY(node->idname, "GeometryNodeAttributeRandomize");
1594  }
1595  }
1596  }
1597 
1598  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1601  }
1602  }
1603  }
1604 
1605  if (!MAIN_VERSION_ATLEAST(bmain, 292, 9)) {
1606  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1607  if (ntree->type == NTREE_GEOMETRY) {
1609  if (node->type == GEO_NODE_ATTRIBUTE_MATH && node->storage == NULL) {
1610  const int old_use_attibute_a = (1 << 0);
1611  const int old_use_attibute_b = (1 << 1);
1612  NodeAttributeMath *data = MEM_callocN(sizeof(NodeAttributeMath), "NodeAttributeMath");
1613  data->operation = NODE_MATH_ADD;
1614  data->input_type_a = (node->custom2 & old_use_attibute_a) ?
1617  data->input_type_b = (node->custom2 & old_use_attibute_b) ?
1620  node->storage = data;
1621  }
1622  }
1623  }
1624  }
1626 
1627  /* Default properties editors to auto outliner sync. */
1628  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1629  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1630  LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) {
1631  if (space->spacetype == SPACE_PROPERTIES) {
1632  SpaceProperties *space_properties = (SpaceProperties *)space;
1633  space_properties->outliner_sync = PROPERTIES_SYNC_AUTO;
1634  }
1635  }
1636  }
1637  }
1638 
1639  /* Ensure that new viscosity strength field is initialized correctly. */
1640  if (!DNA_struct_elem_find(fd->filesdna, "FluidModifierData", "float", "viscosity_value")) {
1641  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1642  LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1643  if (md->type == eModifierType_Fluid) {
1644  FluidModifierData *fmd = (FluidModifierData *)md;
1645  if (fmd->domain != NULL) {
1646  fmd->domain->viscosity_value = 0.05;
1647  }
1648  }
1649  }
1650  }
1651  }
1652  }
1653 
1654  if (!MAIN_VERSION_ATLEAST(bmain, 292, 10)) {
1655  if (!DNA_struct_find(fd->filesdna, "NodeSetAlpha")) {
1656  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1657  if (ntree->type != NTREE_COMPOSIT) {
1658  continue;
1659  }
1661  if (node->type != CMP_NODE_SETALPHA) {
1662  continue;
1663  }
1664  NodeSetAlpha *storage = MEM_callocN(sizeof(NodeSetAlpha), "NodeSetAlpha");
1666  node->storage = storage;
1667  }
1668  }
1670  }
1671 
1672  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1673  Editing *ed = SEQ_editing_get(scene, false);
1674  if (ed == NULL) {
1675  continue;
1676  }
1679  }
1680  }
1681 
1682  /* Enable "Save as Render" option for file output node by default (apply view transform to image
1683  * on save) */
1684  if (!MAIN_VERSION_ATLEAST(bmain, 292, 11)) {
1685  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1686  if (ntree->type == NTREE_COMPOSIT) {
1688  if (node->type == CMP_NODE_OUTPUT_FILE) {
1689  LISTBASE_FOREACH (bNodeSocket *, sock, &node->inputs) {
1690  NodeImageMultiFileSocket *simf = sock->storage;
1691  simf->save_as_render = true;
1692  }
1693  }
1694  }
1695  }
1696  }
1698  }
1699 
1700  if (!MAIN_VERSION_ATLEAST(bmain, 293, 1)) {
1701  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1702  if (ntree->type == NTREE_GEOMETRY) {
1703  version_node_socket_name(ntree, GEO_NODE_BOOLEAN, "Geometry A", "Geometry 1");
1704  version_node_socket_name(ntree, GEO_NODE_BOOLEAN, "Geometry B", "Geometry 2");
1705  }
1706  }
1708 
1709  /* Init grease pencil default curve resolution. */
1710  if (!DNA_struct_elem_find(fd->filesdna, "bGPdata", "int", "curve_edit_resolution")) {
1711  LISTBASE_FOREACH (bGPdata *, gpd, &bmain->gpencils) {
1712  gpd->curve_edit_resolution = GP_DEFAULT_CURVE_RESOLUTION;
1713  gpd->flag |= GP_DATA_CURVE_ADAPTIVE_RESOLUTION;
1714  }
1715  }
1716  /* Init grease pencil curve editing error threshold. */
1717  if (!DNA_struct_elem_find(fd->filesdna, "bGPdata", "float", "curve_edit_threshold")) {
1718  LISTBASE_FOREACH (bGPdata *, gpd, &bmain->gpencils) {
1719  gpd->curve_edit_threshold = GP_DEFAULT_CURVE_ERROR;
1720  gpd->curve_edit_corner_angle = GP_DEFAULT_CURVE_EDIT_CORNER_ANGLE;
1721  }
1722  }
1723  }
1724 
1725  if ((!MAIN_VERSION_ATLEAST(bmain, 292, 14)) ||
1726  ((bmain->versionfile == 293) && (!MAIN_VERSION_ATLEAST(bmain, 293, 1)))) {
1727  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1728  if (ntree->type != NTREE_GEOMETRY) {
1729  continue;
1730  }
1732  if (node->type == GEO_NODE_OBJECT_INFO && node->storage == NULL) {
1734  sizeof(NodeGeometryObjectInfo), __func__);
1735  data->transform_space = GEO_NODE_TRANSFORM_SPACE_RELATIVE;
1736  node->storage = data;
1737  }
1738  }
1739  }
1741  }
1742 
1743  if (!MAIN_VERSION_ATLEAST(bmain, 293, 1)) {
1744  /* Grease pencil layer transform matrix. */
1745  if (!DNA_struct_elem_find(fd->filesdna, "bGPDlayer", "float", "location[0]")) {
1746  LISTBASE_FOREACH (bGPdata *, gpd, &bmain->gpencils) {
1747  LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
1748  zero_v3(gpl->location);
1749  zero_v3(gpl->rotation);
1750  copy_v3_fl(gpl->scale, 1.0f);
1751  loc_eul_size_to_mat4(gpl->layer_mat, gpl->location, gpl->rotation, gpl->scale);
1752  invert_m4_m4(gpl->layer_invmat, gpl->layer_mat);
1753  }
1754  }
1755  }
1756  /* Fix Fill factor for grease pencil fill brushes. */
1757  LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
1758  if ((brush->gpencil_settings) && (brush->gpencil_settings->fill_factor == 0.0f)) {
1759  brush->gpencil_settings->fill_factor = 1.0f;
1760  }
1761  }
1762  }
1763 
1764  if (!MAIN_VERSION_ATLEAST(bmain, 293, 3)) {
1765  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1766  if (ntree->type != NTREE_GEOMETRY) {
1767  continue;
1768  }
1770  if (node->type == GEO_NODE_POINT_INSTANCE && node->storage == NULL) {
1772  sizeof(NodeGeometryPointInstance), __func__);
1773  data->instance_type = node->custom1;
1774  data->flag = (node->custom2 ? 0 : GEO_NODE_POINT_INSTANCE_WHOLE_COLLECTION);
1775  node->storage = data;
1776  }
1777  }
1778  }
1780  }
1781 
1782  if (!MAIN_VERSION_ATLEAST(bmain, 293, 4)) {
1783  /* Add support for all operations to the "Attribute Math" node. */
1784  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1785  if (ntree->type == NTREE_GEOMETRY) {
1787  if (node->type == GEO_NODE_ATTRIBUTE_MATH) {
1789  data->input_type_c = GEO_NODE_ATTRIBUTE_INPUT_ATTRIBUTE;
1790  }
1791  }
1792  }
1793  }
1795  }
1796 
1797  if (!MAIN_VERSION_ATLEAST(bmain, 293, 5)) {
1798  /* Change Nishita sky model Altitude unit. */
1799  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1800  if (ntree->type == NTREE_SHADER) {
1802  if (node->type == SH_NODE_TEX_SKY && node->storage) {
1803  NodeTexSky *tex = (NodeTexSky *)node->storage;
1804  tex->altitude *= 1000.0f;
1805  }
1806  }
1807  }
1808  }
1810  }
1811 
1812  if (!MAIN_VERSION_ATLEAST(bmain, 293, 6)) {
1813  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1814  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1815  LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) {
1816  /* UV/Image Max resolution images in image editor. */
1817  if (space->spacetype == SPACE_IMAGE) {
1818  SpaceImage *sima = (SpaceImage *)space;
1820  }
1821  /* Enable Outliner render visibility column. */
1822  else if (space->spacetype == SPACE_OUTLINER) {
1823  SpaceOutliner *space_outliner = (SpaceOutliner *)space;
1824  space_outliner->show_restrict_flags |= SO_RESTRICT_RENDER;
1825  }
1826  }
1827  }
1828  }
1829  }
1830 
1831  if (!MAIN_VERSION_ATLEAST(bmain, 293, 7)) {
1832  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1833  if (ntree->type == NTREE_GEOMETRY) {
1835  }
1836  }
1838  }
1839 
1840  if (!MAIN_VERSION_ATLEAST(bmain, 293, 8)) {
1841  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1842  if (ntree->type != NTREE_GEOMETRY) {
1843  continue;
1844  }
1846  if (node->type == GEO_NODE_ATTRIBUTE_RANDOMIZE && node->storage == NULL) {
1848  sizeof(NodeAttributeRandomize), __func__);
1849  data->data_type = node->custom1;
1851  node->storage = data;
1852  }
1853  }
1854  }
1856  }
1857 
1858  if (!MAIN_VERSION_ATLEAST(bmain, 293, 9)) {
1859  if (!DNA_struct_elem_find(fd->filesdna, "SceneEEVEE", "float", "bokeh_overblur")) {
1860  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1861  scene->eevee.bokeh_neighbor_max = 10.0f;
1862  scene->eevee.bokeh_denoise_fac = 0.75f;
1863  scene->eevee.bokeh_overblur = 5.0f;
1864  }
1865  }
1866 
1867  /* Add subpanels for FModifiers, which requires a field to store expansion. */
1868  if (!DNA_struct_elem_find(fd->filesdna, "FModifier", "short", "ui_expand_flag")) {
1869  LISTBASE_FOREACH (bAction *, act, &bmain->actions) {
1870  LISTBASE_FOREACH (FCurve *, fcu, &act->curves) {
1871  LISTBASE_FOREACH (FModifier *, fcm, &fcu->modifiers) {
1872  SET_FLAG_FROM_TEST(fcm->ui_expand_flag,
1873  fcm->flag & FMODIFIER_FLAG_EXPANDED,
1875  }
1876  }
1877  }
1878  }
1879 
1880  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1881  if (ntree->type == NTREE_GEOMETRY) {
1883  }
1884  }
1886  }
1887 
1888  if (!MAIN_VERSION_ATLEAST(bmain, 293, 10)) {
1889  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1890  if (ntree->type == NTREE_GEOMETRY) {
1892  }
1893  }
1895 
1896  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1897  /* Fix old scene with too many samples that were not being used.
1898  * Now they are properly used and might produce a huge slowdown.
1899  * So we clamp to what the old max actual was. */
1902  }
1903  }
1904  }
1905 
1906  if (!MAIN_VERSION_ATLEAST(bmain, 293, 11)) {
1907  LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
1908  if (ntree->type == NTREE_GEOMETRY) {
1910  if (STREQ(node->idname, "GeometryNodeSubdivisionSurfaceSimple")) {
1911  STRNCPY(node->idname, "GeometryNodeSubdivide");
1912  }
1913  if (STREQ(node->idname, "GeometryNodeSubdivisionSurface")) {
1914  STRNCPY(node->idname, "GeometryNodeSubdivideSmooth");
1915  }
1916  }
1917  }
1918  }
1919  }
1920 
1921  if (!MAIN_VERSION_ATLEAST(bmain, 293, 12)) {
1922  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1923  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1924  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1925  switch (sl->spacetype) {
1926  case SPACE_SEQ: {
1927  SpaceSeq *sseq = (SpaceSeq *)sl;
1928  if (ELEM(sseq->render_size,
1933  sseq->flag |= SEQ_USE_PROXIES;
1934  }
1935  if (sseq->render_size == SEQ_RENDER_SIZE_FULL) {
1937  }
1938  }
1939  }
1940  }
1941  }
1942  }
1943 
1944  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1945  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1946  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1947  if (sl->spacetype == SPACE_SPREADSHEET) {
1948  ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
1949  &sl->regionbase;
1951  regionbase, RGN_TYPE_FOOTER, "footer for spreadsheet", RGN_TYPE_HEADER);
1952  if (new_footer != NULL) {
1953  new_footer->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_TOP :
1955  }
1956  }
1957  }
1958  }
1959  }
1960  }
1961 
1962  if (!MAIN_VERSION_ATLEAST(bmain, 293, 13)) {
1963  LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
1964  if (ntree->type == NTREE_GEOMETRY) {
1966  if (STREQ(node->idname, "GeometryNodeSubdivideSmooth")) {
1967  STRNCPY(node->idname, "GeometryNodeSubdivisionSurface");
1968  }
1969  }
1970  }
1971  }
1972  }
1973 
1974  if (!MAIN_VERSION_ATLEAST(bmain, 293, 14)) {
1975  if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "diff_fac")) {
1976  LISTBASE_FOREACH (Light *, light, &bmain->lights) {
1977  light->diff_fac = 1.0f;
1978  light->volume_fac = 1.0f;
1979  }
1980  }
1981 
1982  LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
1983  if (ntree->type == NTREE_GEOMETRY) {
1985  if (node->type == GEO_NODE_ATTRIBUTE_FILL) {
1986  node->custom2 = ATTR_DOMAIN_AUTO;
1987  }
1988  }
1989  }
1990  }
1991  }
1992 
1993  if (!MAIN_VERSION_ATLEAST(bmain, 293, 15)) {
1994  LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
1995  if (ntree->type == NTREE_GEOMETRY) {
1997  if (STREQ(node->idname, "GeometryNodeMeshPlane")) {
1998  STRNCPY(node->idname, "GeometryNodeMeshGrid");
1999  }
2000  }
2001  }
2002  }
2003  }
2004 
2005  if (!MAIN_VERSION_ATLEAST(bmain, 293, 16)) {
2006  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
2007  if (ntree->type == NTREE_GEOMETRY) {
2009  }
2011  }
2012 
2013  /* The CU_2D flag has been removed. */
2014  LISTBASE_FOREACH (Curve *, cu, &bmain->curves) {
2015 #define CU_2D (1 << 3)
2016  ListBase *nurbs = BKE_curve_nurbs_get(cu);
2017  bool is_2d = true;
2018 
2019  LISTBASE_FOREACH (Nurb *, nu, nurbs) {
2020  if (nu->flag & CU_2D) {
2021  nu->flag &= ~CU_2D;
2022  }
2023  else {
2024  is_2d = false;
2025  }
2026  }
2027 #undef CU_2D
2028  if (!is_2d && CU_IS_2D(cu)) {
2029  cu->flag |= CU_3D;
2030  }
2031  }
2032  }
2033 
2034  if (!MAIN_VERSION_ATLEAST(bmain, 293, 18)) {
2035  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
2036  if (ntree->type == NTREE_GEOMETRY) {
2038  }
2039  }
2041 
2042  if (!DNA_struct_elem_find(fd->filesdna, "bArmature", "float", "axes_position")) {
2043  /* Convert the axes draw position to its old default (tip of bone). */
2044  LISTBASE_FOREACH (struct bArmature *, arm, &bmain->armatures) {
2045  arm->axes_position = 1.0;
2046  }
2047  }
2048 
2049  /* Initialize the spread parameter for area lights*/
2050  if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "area_spread")) {
2051  LISTBASE_FOREACH (Light *, la, &bmain->lights) {
2052  la->area_spread = DEG2RADF(180.0f);
2053  }
2054  }
2055 
2056  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
2057  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
2058  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
2059  if (sl->spacetype == SPACE_NODE) {
2060  SpaceNode *snode = (SpaceNode *)sl;
2061  LISTBASE_FOREACH (bNodeTreePath *, path, &snode->treepath) {
2062  STRNCPY(path->display_name, path->node_name);
2063  }
2064  }
2065  }
2066  }
2067  }
2068 
2069  /* Consolidate node and final evaluation modes. */
2070  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
2071  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
2072  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
2073  if (sl->spacetype == SPACE_SPREADSHEET) {
2074  SpaceSpreadsheet *sspreadsheet = (SpaceSpreadsheet *)sl;
2075  if (sspreadsheet->object_eval_state == 2) {
2077  }
2078  }
2079  }
2080  }
2081  }
2082  }
2083 
2084  /* Set default value for the new bisect_threshold parameter in the mirror modifier. */
2085  if (!MAIN_VERSION_ATLEAST(bmain, 293, 19)) {
2086  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
2087  LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
2088  if (md->type == eModifierType_Mirror) {
2090  /* This was the previous hard-coded value. */
2091  mmd->bisect_threshold = 0.001f;
2092  }
2093  }
2094  }
2095 
2096  LISTBASE_FOREACH (Curve *, cu, &bmain->curves) {
2097  /* Turn on clamping as this was implicit before. */
2098  cu->flag |= CU_PATH_CLAMP;
2099  }
2100  }
2101 
2102  if (!MAIN_VERSION_ATLEAST(bmain, 300, 20)) {
2103  ListBase *lb = which_libbase(bmain, ID_VF);
2105 
2106  /* Fix SplineIK constraint's inconsistency between binding points array and its stored size. */
2107  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
2108  /* NOTE: Objects should never have SplineIK constraint, so no need to apply this fix on
2109  * their constraints. */
2110  if (ob->pose) {
2111  LISTBASE_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
2113  }
2114  }
2115  }
2116  }
2117 
2127  {
2128  /* Keep this block, even when empty. */
2129  }
2130 }
typedef float(TangentPoint)[2]
void BKE_animdata_fix_paths_rename_all_ex(struct Main *bmain, struct ID *ref_id, const char *prefix, const char *oldName, const char *newName, const int oldSubscript, const int newSubscript, const bool verify_paths)
Definition: anim_data.c:1428
void BKE_pose_rebuild(struct Main *bmain, struct Object *ob, struct bArmature *arm, const bool do_id_user)
Definition: armature.c:2536
Generic geometry attributes built on CustomData.
@ ATTR_DOMAIN_AUTO
Definition: BKE_attribute.h:42
bool BKE_collection_cycles_fix(struct Main *bmain, struct Collection *collection)
Definition: collection.c:1519
void BKE_curvemapping_init(struct CurveMapping *cumap)
Definition: colortools.c:1200
struct CurveMapping * BKE_curvemapping_add(int tot, float minx, float miny, float maxx, float maxy)
Definition: colortools.c:88
void BKE_cryptomatte_matte_id_to_entries(struct NodeCryptomatte *node_storage, const char *matte_id)
Definition: cryptomatte.cc:251
#define CU_IS_2D(cu)
Definition: BKE_curve.h:83
ListBase * BKE_curve_nurbs_get(struct Curve *cu)
Definition: curve.c:5079
bool BKE_fcurve_is_empty(struct FCurve *fcu)
Definition: fcurve.c:2250
struct FCurve * BKE_fcurve_find(ListBase *list, const char rna_path[], const int array_index)
Definition: fcurve.c:274
struct bGPDframe * BKE_gpencil_frame_duplicate(const struct bGPDframe *gpf_src, const bool dup_strokes)
void BKE_main_id_repair_duplicate_names_listbase(struct ListBase *lb)
Definition: lib_id.c:966
void id_fake_user_set(struct ID *id)
Definition: lib_id.c:328
#define MAIN_VERSION_ATLEAST(main, ver, subver)
Definition: BKE_main.h:269
#define MAIN_VERSION_OLDER(main, ver, subver)
Definition: BKE_main.h:273
struct ListBase * which_libbase(struct Main *bmain, short type)
Definition: main.c:447
bool BKE_mesh_validate_arrays(struct Mesh *me, struct MVert *mverts, unsigned int totvert, struct MEdge *medges, unsigned int totedge, struct MFace *mfaces, unsigned int totface, struct MLoop *mloops, unsigned int totloop, struct MPoly *mpolys, unsigned int totpoly, struct MDeformVert *dverts, const bool do_verbose, const bool do_fixes, bool *r_change)
void multires_do_versions_simple_to_catmull_clark(struct Object *object, struct MultiresModifierData *mmd)
#define GEO_NODE_POINT_INSTANCE
Definition: BKE_node.h:1381
#define SH_NODE_BSDF_PRINCIPLED
Definition: BKE_node.h:1058
#define GEO_NODE_ATTRIBUTE_RANDOMIZE
Definition: BKE_node.h:1384
#define CMP_NODE_CRYPTOMATTE_LEGACY
Definition: BKE_node.h:1225
#define CMP_NODE_OUTPUT_FILE
Definition: BKE_node.h:1154
#define FOREACH_NODETREE_END
Definition: BKE_node.h:945
struct bNodeLink * nodeAddLink(struct bNodeTree *ntree, struct bNode *fromnode, struct bNodeSocket *fromsock, struct bNode *tonode, struct bNodeSocket *tosock)
Definition: node.cc:2189
void nodeRemoveSocket(struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *sock)
Definition: node.cc:1775
#define GEO_NODE_BOOLEAN
Definition: BKE_node.h:1379
struct bNodeSocket * nodeFindSocket(const struct bNode *node, eNodeSocketInOut in_out, const char *identifier)
#define FOREACH_NODETREE_BEGIN(bmain, _nodetree, _id)
Definition: BKE_node.h:935
#define CMP_NODE_R_LAYERS
Definition: BKE_node.h:1152
#define GEO_NODE_VOLUME_TO_MESH
Definition: BKE_node.h:1402
#define GEO_NODE_JOIN_GEOMETRY
Definition: BKE_node.h:1386
#define BLI_assert(a)
Definition: BLI_assert.h:58
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:87
#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
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
Definition: BLI_listbase.h:188
#define LISTBASE_FOREACH_BACKWARD(type, var, list)
Definition: BLI_listbase.h:184
void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
Definition: listbase.c:352
void * BLI_findstring(const struct ListBase *listbase, const char *id, const int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findptr(const struct ListBase *listbase, const void *ptr, const int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
#define M_PI_2
Definition: BLI_math_base.h:41
bool invert_m4_m4(float R[4][4], const float A[4][4])
Definition: math_matrix.c:1278
void loc_eul_size_to_mat4(float R[4][4], const float loc[3], const float eul[3], const float size[3])
Definition: math_matrix.c:2653
#define DEG2RADF(_deg)
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void madd_v2_v2v2fl(float r[2], const float a[2], const float b[2], float f)
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE void zero_v3(float r[3])
size_t size_t char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
#define STRNCPY(dst, src)
Definition: BLI_string.h:163
size_t size_t char size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, const size_t dst_maxncpy) ATTR_NONNULL()
Definition: string.c:333
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
Definition: string.c:108
unsigned int uint
Definition: BLI_sys_types.h:83
#define ARRAY_SIZE(arr)
#define UNUSED_VARS(...)
#define STREQLEN(a, b, n)
#define UNUSED(x)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define MAX2(a, b)
#define ELEM(...)
#define MIN2(a, b)
#define STREQ(a, b)
external readfile function prototypes.
@ IDP_GROUP
Definition: DNA_ID.h:101
@ IDP_FLAG_OVERRIDABLE_LIBRARY
Definition: DNA_ID.h:132
@ ID_PAL
Definition: DNA_ID_enums.h:88
@ ID_BR
Definition: DNA_ID_enums.h:81
@ ID_VF
Definition: DNA_ID_enums.h:73
@ CACHEFILE_VELOCITY_UNIT_SECOND
Object groups, one object can be in many groups at once.
@ COLLECTION_COLOR_NONE
@ CONSTRAINT_TYPE_SPLINEIK
@ CU_BEV_MODE_OBJECT
@ CU_BEV_MODE_ROUND
@ BEZT_IPO_BEZ
@ CU_3D
@ CU_PATH_CLAMP
struct CustomDataLayer CustomDataLayer
@ CD_PROP_FLOAT
@ CD_PROP_FLOAT3
#define MAX_NAME
Definition: DNA_defs.h:62
@ FLUID_DOMAIN_FIELD_PHI
@ FLUID_DOMAIN_TYPE_LIQUID
blenloader genfile private function prototypes
bool DNA_struct_find(const struct SDNA *sdna, const char *stype)
bool DNA_struct_elem_find(const struct SDNA *sdna, const char *stype, const char *vartype, const char *name)
@ eGpencilModifierType_Array
@ eGpencilModifierType_Noise
@ eGpencilModifierType_Mirror
@ eGpencilModifierType_Color
@ eGpencilModifierType_Multiply
@ eGpencilModifierType_Texture
@ eGpencilModifierType_Subdiv
@ eGpencilModifierType_Lattice
@ eGpencilModifierType_Opacity
@ eGpencilModifierType_Hook
@ eGpencilModifierType_Simplify
@ eGpencilModifierType_Smooth
@ eGpencilModifierType_Thick
@ eGpencilModifierType_Offset
#define GP_DEFAULT_CURVE_EDIT_CORNER_ANGLE
#define GP_DEFAULT_CURVE_RESOLUTION
#define GP_DEFAULT_CURVE_ERROR
@ GP_DATA_CURVE_ADAPTIVE_RESOLUTION
#define IMA_SHOW_MAX_RESOLUTION
@ VIEW_LAYER_CRYPTOMATTE_ACCURATE
@ EEVEE_RENDER_PASS_UNUSED_8
@ ME_SYMMETRY_X
@ ME_SYMMETRY_Y
@ ME_SYMMETRY_Z
@ MOD_MESHSEQ_INTERPOLATE_VERTICES
@ eBooleanModifierSolver_Fast
@ MOD_BEVEL_PROFILE_CUSTOM
@ MOD_BEVEL_PROFILE_SUPERELLIPSE
@ eBooleanModifierFlag_Object
@ eModifierType_Mirror
@ eModifierType_WeightVGProximity
@ eModifierType_Boolean
@ eModifierType_Fluid
@ eModifierType_MeshSequenceCache
@ eModifierType_Ocean
@ eModifierType_Nodes
@ eModifierType_Bevel
@ eModifierType_WeightVGEdit
@ eModifierType_Multires
@ MOD_BEVEL_AFFECT_EDGES
@ MOD_BEVEL_AFFECT_VERTICES
@ MOD_WVG_EDIT_WEIGHTS_NORMALIZE
@ GEO_NODE_ATTRIBUTE_RANDOMIZE_REPLACE_CREATE
@ NODE_MATH_ADD
@ GEO_NODE_POINT_INSTANCE_WHOLE_COLLECTION
#define NTREE_GEOMETRY
#define NTREE_COMPOSIT
@ SOCK_IN
@ CMP_NODE_SETALPHA_MODE_REPLACE_ALPHA
@ SOCK_MULTI_INPUT
#define NTREE_SHADER
@ GEO_NODE_TRANSFORM_SPACE_RELATIVE
@ GEO_NODE_ATTRIBUTE_INPUT_ATTRIBUTE
@ GEO_NODE_ATTRIBUTE_INPUT_FLOAT
@ OB_MODE_SCULPT
Object is a sort of wrapper for general info.
@ OB_ARMATURE
@ OB_GPENCIL
#define PART_PHYS_NO
@ PART_FLUID_FLIP
@ PART_FLUID_BUBBLE
@ PART_FLUID_FOAM
@ PART_FLUID_SPRAY
Types and defines for representing Rigid Body entities.
#define RE_PASSNAME_VOLUME_LIGHT
#define FPS
@ PNL_UNUSED_1
@ PNL_CLOSED
@ RGN_ALIGN_BOTTOM
@ RGN_ALIGN_TOP
@ UI_PANEL_DATA_EXPAND_ROOT
@ RGN_TYPE_FOOTER
@ RGN_TYPE_HEADER
@ SEQ_USE_PROXY
@ SEQ_CACHE_STORE_RAW
@ SEQ_CACHE_STORE_FINAL_OUT
@ SEQ_TYPE_SOUND_RAM
@ SEQ_TYPE_META
@ SI_FLAG_UNUSED_20
@ SI_OVERLAY_SHOW_OVERLAYS
eSpaceSeq_Proxy_RenderSize
@ SEQ_RENDER_SIZE_PROXY_25
@ SEQ_RENDER_SIZE_PROXY_75
@ SEQ_RENDER_SIZE_PROXY_50
@ SEQ_RENDER_SIZE_FULL
@ SEQ_RENDER_SIZE_PROXY_100
@ SPACE_OUTLINER
@ SPACE_NODE
@ SPACE_SPREADSHEET
@ SPACE_PROPERTIES
@ SPACE_SEQ
@ SPACE_IMAGE
@ SPACE_VIEW3D
@ SO_RESTRICT_RENDER
@ SO_FILTER_OB_STATE_INVERSE
@ SO_MODE_COLUMN
@ SO_FILTER_OB_VISIBLE
@ SO_FILTER_OB_HIDDEN
@ SPREADSHEET_OBJECT_EVAL_STATE_EVALUATED
@ SEQ_DRAW_IMG_IMBUF
@ SEQ_SHOW_STRIP_DURATION
@ SEQ_USE_PROXIES
@ SEQ_SHOW_STRIP_NAME
@ SEQ_SHOW_STRIP_SOURCE
@ SEQ_SHOW_STRIP_OVERLAY
@ PROPERTIES_SYNC_AUTO
@ REFINE_PRINCIPAL_POINT
@ REFINE_RADIAL_DISTORTION
@ REFINE_FOCAL_LENGTH
@ USER_HEADER_BOTTOM
@ V3D_OVERLAY_FADE_INACTIVE
_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 const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
_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 const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
@ IMB_PROXY_NONE
Definition: IMB_imbuf.h:318
Read Guarded memory(de)allocation.
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume Image Sky Noise Wave Voronoi Brick Texture Vector Combine Vertex Separate Vector White RGB Map Separate CMP_NODE_SETALPHA
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 SH_NODE_TEX_SKY
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume Image Sky Noise Wave Voronoi Brick Texture Vector Combine Vertex Separate Vector White RGB Map Separate Set Z Dilate Combine Combine Color Channel Split ID Combine Luminance Directional Alpha Distance Hue Movie Ellipse Bokeh View Corner Anti Mix RGB Hue Separate TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC Boolean Random Edge Subdivision Point Object Attribute Attribute Attribute Color Attribute Attribute Vector Point Attribute Sample Collection GEO_NODE_ATTRIBUTE_PROXIMITY
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume Image Sky Noise Wave Voronoi Brick Texture Vector Combine Vertex Separate Vector White RGB Map Separate Set Z Dilate Combine Combine Color Channel Split ID Combine Luminance Directional Alpha Distance Hue Movie Ellipse Bokeh View Corner Anti Mix RGB Hue Separate TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC Boolean Random Edge Subdivision Point Object Attribute Attribute Attribute Color Attribute Attribute Vector Point Attribute Sample Collection Attribute Attribute Combine Attribute GEO_NODE_MESH_PRIMITIVE_GRID
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume Image Sky Noise Wave Voronoi Brick Texture Vector Combine Vertex Separate Vector White RGB Map Separate Set Z Dilate Combine Combine Color Channel Split ID Combine Luminance Directional Alpha Distance Hue Movie Ellipse Bokeh View Corner Anti Mix RGB Hue Separate TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC Boolean Random Edge Subdivision Point Object GEO_NODE_ATTRIBUTE_MATH
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume Image Sky Noise Wave Voronoi Brick Texture Vector Combine Vertex Separate Vector White RGB Map Separate Set Z Dilate Combine Combine Color Channel Split ID Combine Luminance Directional Alpha Distance Hue Movie Ellipse Bokeh View Corner Anti Mix RGB Hue Separate TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC Boolean Random Edge Subdivision Point GEO_NODE_OBJECT_INFO
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume Image Sky Noise Wave Voronoi Brick Texture Vector Combine Vertex Separate Vector White RGB Map Separate Set Z Dilate Combine Combine Color Channel Split ID Combine Luminance Directional Alpha Distance Hue Movie Ellipse Bokeh View Corner Anti Mix RGB Hue Separate TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC Boolean Random Edge Subdivision Point Object Attribute GEO_NODE_ATTRIBUTE_FILL
ATTR_WARN_UNUSED_RESULT const BMVert * v2
unsigned int U
Definition: btGjkEpa3.h:78
OperationNode * node
Scene scene
Curve curve
bNodeTree * ntree
DRWShaderLibrary * lib
#define fabsf(x)
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:41
void *(* MEM_dupallocN)(const void *vmemh)
Definition: mallocn.c:42
size_t(* MEM_allocN_len)(const void *vmemh)
Definition: mallocn.c:40
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
void *(* MEM_mallocN)(size_t len, const char *str)
Definition: mallocn.c:47
static unsigned c
Definition: RandGen.cpp:97
static void area(int d1, int d2, int e1, int e2, float weights[2])
int SEQ_rendersize_to_proxysize(int render_size)
Definition: proxy.c:84
double SEQ_rendersize_to_scale_factor(int render_size)
Definition: proxy.c:99
void * blo_read_get_new_globaldata_address(FileData *fd, const void *adr)
Definition: readfile.c:1818
StripElem * SEQ_render_give_stripelem(Sequence *seq, int timeline_frame)
Definition: render.c:242
SequencerToolSettings * SEQ_tool_settings_init(void)
Definition: sequencer.c:308
MetaStack * SEQ_meta_stack_active_get(const Editing *ed)
Definition: sequencer.c:405
void SEQ_seqbase_active_set(Editing *ed, ListBase *seqbase)
Definition: sequencer.c:365
Editing * SEQ_editing_get(Scene *scene, bool alloc)
Definition: sequencer.c:232
unsigned int uint32_t
Definition: stdint.h:83
void SEQ_transform_fix_single_image_seq_offsets(Sequence *seq)
void SEQ_transform_set_right_handle_frame(Sequence *seq, int val)
void SEQ_transform_set_left_handle_frame(Sequence *seq, int val)
short alignment
short regiontype
bAction * action
float vec[3][3]
struct Object * bevobj
char bevel_mode
CustomDataLayer * layers
ListBase seqbase
ListBase metastack
struct FCurve * next
BezTriple * bezt
unsigned int totvert
struct SDNA * filesdna
Definition: readfile.h:105
float gridlines_range_color[4]
struct FluidDomainSettings * domain
ListBase group
Definition: DNA_ID.h:64
IDPropertyData data
Definition: DNA_ID.h:80
char type
Definition: DNA_ID.h:71
Definition: DNA_ID.h:273
void * next
Definition: DNA_ID.h:274
void * first
Definition: DNA_listBase.h:47
Definition: BKE_main.h:116
ListBase brushes
Definition: BKE_main.h:171
ListBase scenes
Definition: BKE_main.h:146
ListBase wm
Definition: BKE_main.h:175
ListBase actions
Definition: BKE_main.h:169
ListBase texts
Definition: BKE_main.h:163
ListBase meshes
Definition: BKE_main.h:149
ListBase movieclips
Definition: BKE_main.h:177
ListBase lights
Definition: BKE_main.h:156
ListBase nodetrees
Definition: BKE_main.h:170
ListBase particles
Definition: BKE_main.h:172
ListBase materials
Definition: BKE_main.h:152
ListBase pointclouds
Definition: BKE_main.h:183
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 workspaces
Definition: BKE_main.h:181
ListBase hairs
Definition: BKE_main.h:182
ListBase collections
Definition: BKE_main.h:167
ListBase gpencils
Definition: BKE_main.h:176
ListBase objects
Definition: BKE_main.h:148
ListBase cachefiles
Definition: BKE_main.h:180
struct MeshCacheVertexVelocity * vertex_velocities
struct CustomData pdata ldata
char symmetry
char editflag
Sequence * parseq
struct ModifierData * next
MovieTrackingSettings settings
struct NodesModifierSettings settings
struct IDProperty * properties
short flag
ListBase children
float simplify_volumes
float bokeh_denoise_fac
float bokeh_overblur
float bokeh_neighbor_max
float motion_blur_depth_scale
int volumetric_shadow_samples
struct bNodeTree * nodetree
struct Collection * master_collection
struct RigidBodyWorld * rigidbody_world
struct ToolSettings * toolsettings
struct Editing * ed
struct RenderData r
ListBase view_layers
struct AnimData * adt
struct SceneEEVEE eevee
ListBase seqbase
SpaceImageOverlay overlay
struct ImageUser iuser
ListBase treepath
short render_size
short build_size_flags
StripProxy * proxy
StripTransform * transform
StripCrop * crop
struct SequencerToolSettings * sequencer_tool_settings
View3DOverlay overlay
struct CurveMapping * cmap_curve
ListBase curves
ListBase layers
struct bNodeSocket * next
void * default_value
ListBase nodes
ListBase links
static ARegion * do_versions_add_region_if_not_found(ListBase *regionbase, int region_type, const char *name, int link_after_region_type)
static void seq_update_meta_disp_range(Editing *ed)
static void seq_convert_transform_animation_2(const Scene *scene, const char *path, const float scale_to_fit_factor)
static void version_node_socket_duplicate(bNodeTree *ntree, const int node_type, const char *old_name, const char *new_name)
static void seq_convert_transform_crop_lb_2(const Scene *scene, const ListBase *lb, const eSpaceSeq_Proxy_RenderSize render_size)
static void seq_convert_transform_crop(const Scene *scene, Sequence *seq, const eSpaceSeq_Proxy_RenderSize render_size)
static void version_node_socket_name(bNodeTree *ntree, const int node_type, const char *old_name, const char *new_name)
static void version_node_join_geometry_for_multi_input_socket(bNodeTree *ntree)
void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
static void seq_convert_transform_crop_lb(const Scene *scene, const ListBase *lb, const eSpaceSeq_Proxy_RenderSize render_size)
static bool can_use_proxy(const Sequence *seq, int psize)
static void do_versions_291_fcurve_handles_limit(FCurve *fcu)
static void seq_convert_transform_crop_2(const Scene *scene, Sequence *seq, const eSpaceSeq_Proxy_RenderSize render_size)
static void do_version_constraints_spline_ik_joint_bindings(ListBase *lb)
void do_versions_after_linking_290(Main *bmain, ReportList *UNUSED(reports))
static void panels_remove_x_closed_flag_recursive(Panel *panel)
#define CU_2D
static void do_versions_strip_cache_settings_recursive(const ListBase *seqbase)
static void seq_convert_transform_animation(const Scene *scene, const char *path, const int image_size)
static void do_versions_point_attributes(CustomData *pdata)
static eSpaceSeq_Proxy_RenderSize get_sequencer_render_size(Main *bmain)
static void do_versions_point_attribute_names(CustomData *pdata)