Blender  V3.3
versioning_290.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
6 /* allow readfile to use deprecated functionality */
7 #define DNA_DEPRECATED_ALLOW
8 
9 #include "BLI_alloca.h"
10 #include "BLI_listbase.h"
11 #include "BLI_math.h"
12 #include "BLI_string.h"
13 #include "BLI_utildefines.h"
14 
15 #include "DNA_anim_types.h"
16 #include "DNA_armature_types.h"
17 #include "DNA_brush_types.h"
18 #include "DNA_cachefile_types.h"
19 #include "DNA_collection_types.h"
20 #include "DNA_constraint_types.h"
21 #include "DNA_curves_types.h"
22 #include "DNA_fluid_types.h"
23 #include "DNA_genfile.h"
25 #include "DNA_gpencil_types.h"
26 #include "DNA_light_types.h"
27 #include "DNA_mesh_types.h"
28 #include "DNA_meshdata_types.h"
29 #include "DNA_modifier_types.h"
30 #include "DNA_object_types.h"
31 #include "DNA_particle_types.h"
32 #include "DNA_pointcloud_types.h"
33 #include "DNA_rigidbody_types.h"
34 #include "DNA_screen_types.h"
35 #include "DNA_shader_fx_types.h"
36 #include "DNA_space_types.h"
37 #include "DNA_text_types.h"
38 #include "DNA_tracking_types.h"
39 #include "DNA_workspace_types.h"
40 
41 #include "BKE_animsys.h"
42 #include "BKE_armature.h"
43 #include "BKE_attribute.h"
44 #include "BKE_collection.h"
45 #include "BKE_colortools.h"
46 #include "BKE_cryptomatte.h"
47 #include "BKE_curve.h"
48 #include "BKE_fcurve.h"
49 #include "BKE_gpencil.h"
50 #include "BKE_lib_id.h"
51 #include "BKE_main.h"
52 #include "BKE_mesh.h"
53 #include "BKE_multires.h"
54 #include "BKE_node.h"
55 
56 #include "IMB_imbuf.h"
57 #include "MEM_guardedalloc.h"
58 
59 #include "RNA_access.h"
60 
61 #include "SEQ_proxy.h"
62 #include "SEQ_render.h"
63 #include "SEQ_sequencer.h"
64 #include "SEQ_time.h"
65 #include "SEQ_transform.h"
66 
67 #include "BLO_readfile.h"
68 #include "readfile.h"
69 #include "versioning_common.h"
70 
71 /* Make preferences read-only, use versioning_userdef.c. */
72 #define U (*((const UserDef *)&U))
73 
75 {
76  eSpaceSeq_Proxy_RenderSize render_size = 100;
77 
78  for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
79  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
80  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
81  switch (sl->spacetype) {
82  case SPACE_SEQ: {
83  SpaceSeq *sseq = (SpaceSeq *)sl;
84  if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
85  render_size = sseq->render_size;
86  break;
87  }
88  }
89  }
90  }
91  }
92  }
93 
94  return render_size;
95 }
96 
97 static bool can_use_proxy(const Sequence *seq, int psize)
98 {
99  if (seq->strip->proxy == NULL) {
100  return false;
101  }
102  short size_flags = seq->strip->proxy->build_size_flags;
103  return (seq->flag & SEQ_USE_PROXY) != 0 && psize != IMB_PROXY_NONE && (size_flags & psize) != 0;
104 }
105 
106 /* image_size is width or height depending what RNA property is converted - X or Y. */
108  const Scene *scene,
109  const char *path,
110  const int image_size,
111  const int scene_size)
112 {
113  if (scene->adt == NULL || scene->adt->action == NULL) {
114  return;
115  }
116 
117  /* Hardcoded legacy bit-flags which has been removed. */
118  const uint32_t use_transform_flag = (1 << 16);
119  const uint32_t use_crop_flag = (1 << 17);
120 
121  /* Convert offset animation, but only if crop is not used. */
122  if ((seq->flag & use_transform_flag) != 0 && (seq->flag & use_crop_flag) == 0) {
123  FCurve *fcu = BKE_fcurve_find(&scene->adt->action->curves, path, 0);
124  if (fcu != NULL && !BKE_fcurve_is_empty(fcu)) {
125  BezTriple *bezt = fcu->bezt;
126  for (int i = 0; i < fcu->totvert; i++, bezt++) {
127  /* Same math as with old_image_center_*, but simplified. */
128  bezt->vec[0][1] = (image_size - scene_size) / 2 + bezt->vec[0][1];
129  bezt->vec[1][1] = (image_size - scene_size) / 2 + bezt->vec[1][1];
130  bezt->vec[2][1] = (image_size - scene_size) / 2 + bezt->vec[2][1];
131  }
132  }
133  }
134  else { /* Else, remove offset animation. */
135  FCurve *fcu = BKE_fcurve_find(&scene->adt->action->curves, path, 0);
136  BLI_remlink(&scene->adt->action->curves, fcu);
137  BKE_fcurve_free(fcu);
138  }
139 }
140 
142  Sequence *seq,
143  const eSpaceSeq_Proxy_RenderSize render_size)
144 {
145  if (seq->strip->transform == NULL) {
146  seq->strip->transform = MEM_callocN(sizeof(struct StripTransform), "StripTransform");
147  }
148  if (seq->strip->crop == NULL) {
149  seq->strip->crop = MEM_callocN(sizeof(struct StripCrop), "StripCrop");
150  }
151 
152  StripCrop *c = seq->strip->crop;
153  StripTransform *t = seq->strip->transform;
154  int old_image_center_x = scene->r.xsch / 2;
155  int old_image_center_y = scene->r.ysch / 2;
156  int image_size_x = scene->r.xsch;
157  int image_size_y = scene->r.ysch;
158 
159  /* Hard-coded legacy bit-flags which has been removed. */
160  const uint32_t use_transform_flag = (1 << 16);
161  const uint32_t use_crop_flag = (1 << 17);
162 
163  const StripElem *s_elem = seq->strip->stripdata;
164  if (s_elem != NULL) {
165  image_size_x = s_elem->orig_width;
166  image_size_y = s_elem->orig_height;
167 
168  if (can_use_proxy(seq, SEQ_rendersize_to_proxysize(render_size))) {
169  image_size_x /= SEQ_rendersize_to_scale_factor(render_size);
170  image_size_y /= SEQ_rendersize_to_scale_factor(render_size);
171  }
172  }
173 
174  /* Default scale. */
175  if (t->scale_x == 0.0f && t->scale_y == 0.0f) {
176  t->scale_x = 1.0f;
177  t->scale_y = 1.0f;
178  }
179 
180  /* Clear crop if it was unused. This must happen before converting values. */
181  if ((seq->flag & use_crop_flag) == 0) {
182  c->bottom = c->top = c->left = c->right = 0;
183  }
184 
185  if ((seq->flag & use_transform_flag) == 0) {
186  t->xofs = t->yofs = 0;
187 
188  /* Reverse scale to fit for strips not using offset. */
189  float project_aspect = (float)scene->r.xsch / (float)scene->r.ysch;
190  float image_aspect = (float)image_size_x / (float)image_size_y;
191  if (project_aspect > image_aspect) {
192  t->scale_x = project_aspect / image_aspect;
193  }
194  else {
195  t->scale_y = image_aspect / project_aspect;
196  }
197  }
198 
199  if ((seq->flag & use_crop_flag) != 0 && (seq->flag & use_transform_flag) == 0) {
200  /* Calculate image offset. */
201  float s_x = scene->r.xsch / image_size_x;
202  float s_y = scene->r.ysch / image_size_y;
203  old_image_center_x += c->right * s_x - c->left * s_x;
204  old_image_center_y += c->top * s_y - c->bottom * s_y;
205 
206  /* Convert crop to scale. */
207  int cropped_image_size_x = image_size_x - c->right - c->left;
208  int cropped_image_size_y = image_size_y - c->top - c->bottom;
209  c->bottom = c->top = c->left = c->right = 0;
210  t->scale_x *= (float)image_size_x / (float)cropped_image_size_x;
211  t->scale_y *= (float)image_size_y / (float)cropped_image_size_y;
212  }
213 
214  if ((seq->flag & use_transform_flag) != 0) {
215  /* Convert image offset. */
216  old_image_center_x = image_size_x / 2 - c->left + t->xofs;
217  old_image_center_y = image_size_y / 2 - c->bottom + t->yofs;
218 
219  /* Preserve original image size. */
220  t->scale_x = t->scale_y = MAX2((float)image_size_x / (float)scene->r.xsch,
221  (float)image_size_y / (float)scene->r.ysch);
222 
223  /* Convert crop. */
224  if ((seq->flag & use_crop_flag) != 0) {
225  c->top /= t->scale_x;
226  c->bottom /= t->scale_x;
227  c->left /= t->scale_x;
228  c->right /= t->scale_x;
229  }
230  }
231 
232  t->xofs = old_image_center_x - scene->r.xsch / 2;
233  t->yofs = old_image_center_y - scene->r.ysch / 2;
234 
235  char name_esc[(sizeof(seq->name) - 2) * 2], *path;
236  BLI_str_escape(name_esc, seq->name + 2, sizeof(name_esc));
237 
238  path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].transform.offset_x", name_esc);
239  seq_convert_transform_animation(seq, scene, path, image_size_x, scene->r.xsch);
240  MEM_freeN(path);
241  path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].transform.offset_y", name_esc);
242  seq_convert_transform_animation(seq, scene, path, image_size_y, scene->r.ysch);
243  MEM_freeN(path);
244 
245  seq->flag &= ~use_transform_flag;
246  seq->flag &= ~use_crop_flag;
247 }
248 
250  const ListBase *lb,
251  const eSpaceSeq_Proxy_RenderSize render_size)
252 {
253 
254  LISTBASE_FOREACH (Sequence *, seq, lb) {
255  if (seq->type != SEQ_TYPE_SOUND_RAM) {
256  seq_convert_transform_crop(scene, seq, render_size);
257  }
258  if (seq->type == SEQ_TYPE_META) {
259  seq_convert_transform_crop_lb(scene, &seq->seqbase, render_size);
260  }
261  }
262 }
263 
265  const char *path,
266  const float scale_to_fit_factor)
267 {
268  if (scene->adt == NULL || scene->adt->action == NULL) {
269  return;
270  }
271 
272  FCurve *fcu = BKE_fcurve_find(&scene->adt->action->curves, path, 0);
273  if (fcu != NULL && !BKE_fcurve_is_empty(fcu)) {
274  BezTriple *bezt = fcu->bezt;
275  for (int i = 0; i < fcu->totvert; i++, bezt++) {
276  /* Same math as with old_image_center_*, but simplified. */
277  bezt->vec[0][1] *= scale_to_fit_factor;
278  bezt->vec[1][1] *= scale_to_fit_factor;
279  bezt->vec[2][1] *= scale_to_fit_factor;
280  }
281  }
282 }
283 
285  Sequence *seq,
286  const eSpaceSeq_Proxy_RenderSize render_size)
287 {
288  const StripElem *s_elem = seq->strip->stripdata;
289  if (s_elem == NULL) {
290  return;
291  }
292 
293  StripCrop *c = seq->strip->crop;
294  StripTransform *t = seq->strip->transform;
295  int image_size_x = s_elem->orig_width;
296  int image_size_y = s_elem->orig_height;
297 
298  if (can_use_proxy(seq, SEQ_rendersize_to_proxysize(render_size))) {
299  image_size_x /= SEQ_rendersize_to_scale_factor(render_size);
300  image_size_y /= SEQ_rendersize_to_scale_factor(render_size);
301  }
302 
303  /* Calculate scale factor, so image fits in preview area with original aspect ratio. */
304  const float scale_to_fit_factor = MIN2((float)scene->r.xsch / (float)image_size_x,
305  (float)scene->r.ysch / (float)image_size_y);
306  t->scale_x *= scale_to_fit_factor;
307  t->scale_y *= scale_to_fit_factor;
308  c->top /= scale_to_fit_factor;
309  c->bottom /= scale_to_fit_factor;
310  c->left /= scale_to_fit_factor;
311  c->right /= scale_to_fit_factor;
312 
313  char name_esc[(sizeof(seq->name) - 2) * 2], *path;
314  BLI_str_escape(name_esc, seq->name + 2, sizeof(name_esc));
315  path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].transform.scale_x", name_esc);
316  seq_convert_transform_animation_2(scene, path, scale_to_fit_factor);
317  MEM_freeN(path);
318  path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].transform.scale_y", name_esc);
319  seq_convert_transform_animation_2(scene, path, scale_to_fit_factor);
320  MEM_freeN(path);
321  path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].crop.min_x", name_esc);
322  seq_convert_transform_animation_2(scene, path, 1 / scale_to_fit_factor);
323  MEM_freeN(path);
324  path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].crop.max_x", name_esc);
325  seq_convert_transform_animation_2(scene, path, 1 / scale_to_fit_factor);
326  MEM_freeN(path);
327  path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].crop.min_y", name_esc);
328  seq_convert_transform_animation_2(scene, path, 1 / scale_to_fit_factor);
329  MEM_freeN(path);
330  path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].crop.max_x", name_esc);
331  seq_convert_transform_animation_2(scene, path, 1 / scale_to_fit_factor);
332  MEM_freeN(path);
333 }
334 
336  const ListBase *lb,
337  const eSpaceSeq_Proxy_RenderSize render_size)
338 {
339 
340  LISTBASE_FOREACH (Sequence *, seq, lb) {
341  if (seq->type != SEQ_TYPE_SOUND_RAM) {
342  seq_convert_transform_crop_2(scene, seq, render_size);
343  }
344  if (seq->type == SEQ_TYPE_META) {
345  seq_convert_transform_crop_lb_2(scene, &seq->seqbase, render_size);
346  }
347  }
348 }
349 
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  ms->disp_range[0] = SEQ_time_left_handle_frame_get(scene, ms->parseq);
362  ms->disp_range[1] = SEQ_time_right_handle_frame_get(scene, ms->parseq);
363  }
364 
365  /* Update meta strip endpoints. */
366  SEQ_time_left_handle_frame_set(scene, ms->parseq, ms->disp_range[0]);
367  SEQ_time_right_handle_frame_set(scene, ms->parseq, ms->disp_range[1]);
369 
370  /* Recalculate effects using meta strip. */
371  LISTBASE_FOREACH (Sequence *, seq, ms->oldbasep) {
372  if (seq->seq2) {
373  seq->start = seq->startdisp = max_ii(seq->seq1->startdisp, seq->seq2->startdisp);
374  seq->enddisp = min_ii(seq->seq1->enddisp, seq->seq2->enddisp);
375  }
376  }
377 
378  /* Ensure that active seqbase points to active meta strip seqbase. */
379  MetaStack *active_ms = SEQ_meta_stack_active_get(ed);
380  SEQ_seqbase_active_set(ed, &active_ms->parseq->seqbase);
381  }
382 }
383 
385  const int node_type,
386  const char *old_name,
387  const char *new_name)
388 {
389  /* Duplicate a link going into the original socket. */
391  if (link->tonode->type == node_type) {
392  bNode *node = link->tonode;
393  bNodeSocket *dest_socket = nodeFindSocket(node, SOCK_IN, new_name);
394  BLI_assert(dest_socket);
395  if (STREQ(link->tosock->name, old_name)) {
396  nodeAddLink(ntree, link->fromnode, link->fromsock, node, dest_socket);
397  }
398  }
399  }
400 
401  /* Duplicate the default value from the old socket and assign it to the new socket. */
403  if (node->type == node_type) {
404  bNodeSocket *source_socket = nodeFindSocket(node, SOCK_IN, old_name);
405  bNodeSocket *dest_socket = nodeFindSocket(node, SOCK_IN, new_name);
406  BLI_assert(source_socket && dest_socket);
407  if (dest_socket->default_value) {
408  MEM_freeN(dest_socket->default_value);
409  }
410  dest_socket->default_value = MEM_dupallocN(source_socket->default_value);
411  }
412  }
413 }
414 
416 {
417  if (!MAIN_VERSION_ATLEAST(bmain, 290, 1)) {
418  /* Patch old grease pencil modifiers material filter. */
419  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
420  LISTBASE_FOREACH (GpencilModifierData *, md, &ob->greasepencil_modifiers) {
421  switch (md->type) {
424  if (gpmd->materialname[0] != '\0') {
425  gpmd->material = BLI_findstring(
426  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
427  gpmd->materialname[0] = '\0';
428  }
429  break;
430  }
433  if (gpmd->materialname[0] != '\0') {
434  gpmd->material = BLI_findstring(
435  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
436  gpmd->materialname[0] = '\0';
437  }
438  break;
439  }
442  if (gpmd->materialname[0] != '\0') {
443  gpmd->material = BLI_findstring(
444  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
445  gpmd->materialname[0] = '\0';
446  }
447  break;
448  }
451  if (gpmd->materialname[0] != '\0') {
452  gpmd->material = BLI_findstring(
453  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
454  gpmd->materialname[0] = '\0';
455  }
456  break;
457  }
460  if (gpmd->materialname[0] != '\0') {
461  gpmd->material = BLI_findstring(
462  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
463  gpmd->materialname[0] = '\0';
464  }
465  break;
466  }
469  if (gpmd->materialname[0] != '\0') {
470  gpmd->material = BLI_findstring(
471  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
472  gpmd->materialname[0] = '\0';
473  }
474  break;
475  }
478  if (gpmd->materialname[0] != '\0') {
479  gpmd->material = BLI_findstring(
480  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
481  gpmd->materialname[0] = '\0';
482  }
483  break;
484  }
487  if (gpmd->materialname[0] != '\0') {
488  gpmd->material = BLI_findstring(
489  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
490  gpmd->materialname[0] = '\0';
491  }
492  break;
493  }
496  if (gpmd->materialname[0] != '\0') {
497  gpmd->material = BLI_findstring(
498  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
499  gpmd->materialname[0] = '\0';
500  }
501  break;
502  }
505  if (gpmd->materialname[0] != '\0') {
506  gpmd->material = BLI_findstring(
507  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
508  gpmd->materialname[0] = '\0';
509  }
510  break;
511  }
514  if (gpmd->materialname[0] != '\0') {
515  gpmd->material = BLI_findstring(
516  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
517  gpmd->materialname[0] = '\0';
518  }
519  break;
520  }
523  if (gpmd->materialname[0] != '\0') {
524  gpmd->material = BLI_findstring(
525  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
526  gpmd->materialname[0] = '\0';
527  }
528  break;
529  }
532  if (gpmd->materialname[0] != '\0') {
533  gpmd->material = BLI_findstring(
534  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
535  gpmd->materialname[0] = '\0';
536  }
537  break;
538  }
541  if (gpmd->materialname[0] != '\0') {
542  gpmd->material = BLI_findstring(
543  &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2);
544  gpmd->materialname[0] = '\0';
545  }
546  break;
547  }
548  default:
549  break;
550  }
551  }
552  }
553 
554  /* Patch first frame for old files. */
555  Scene *scene = bmain->scenes.first;
556  if (scene != NULL) {
557  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
558  if (ob->type != OB_GPENCIL) {
559  continue;
560  }
561  bGPdata *gpd = ob->data;
562  LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
563  bGPDframe *gpf = gpl->frames.first;
564  if (gpf && gpf->framenum > scene->r.sfra) {
565  bGPDframe *gpf_dup = BKE_gpencil_frame_duplicate(gpf, true);
566  gpf_dup->framenum = scene->r.sfra;
567  BLI_addhead(&gpl->frames, gpf_dup);
568  }
569  }
570  }
571  }
572  }
573 
574  if (!MAIN_VERSION_ATLEAST(bmain, 291, 1)) {
575  LISTBASE_FOREACH (Collection *, collection, &bmain->collections) {
576  if (BKE_collection_cycles_fix(bmain, collection)) {
577  printf(
578  "WARNING: Cycle detected in collection '%s', fixed as best as possible.\n"
579  "You may have to reconstruct your View Layers...\n",
580  collection->id.name);
581  }
582  }
583  }
584 
585  if (!MAIN_VERSION_ATLEAST(bmain, 291, 8)) {
599  }
600 
601  /* Convert all Multires displacement to Catmull-Clark subdivision limit surface. */
602  if (!MAIN_VERSION_ATLEAST(bmain, 292, 1)) {
603  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
604  ModifierData *md;
605  for (md = ob->modifiers.first; md; md = md->next) {
606  if (md->type == eModifierType_Multires) {
608  if (mmd->simple) {
610  }
611  }
612  }
613  }
614  }
615 
616  if (!MAIN_VERSION_ATLEAST(bmain, 292, 2)) {
617 
619 
620  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
621  if (scene->ed != NULL) {
623  }
624  }
625  }
626 
627  if (!MAIN_VERSION_ATLEAST(bmain, 292, 8)) {
628  /* Systematically rebuild posebones to ensure consistent ordering matching the one of bones in
629  * Armature obdata. */
630  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
631  if (ob->type == OB_ARMATURE) {
632  BKE_pose_rebuild(bmain, ob, ob->data, true);
633  }
634  }
635 
636  /* Wet Paint Radius Factor */
637  for (Brush *br = bmain->brushes.first; br; br = br->id.next) {
638  if (br->ob_mode & OB_MODE_SCULPT && br->wet_paint_radius_factor == 0.0f) {
639  br->wet_paint_radius_factor = 1.0f;
640  }
641  }
642 
644  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
645  if (scene->ed != NULL) {
647  }
648  }
649  }
650 
651  if (!MAIN_VERSION_ATLEAST(bmain, 293, 16)) {
652  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
654  }
655 
656  /* Add a separate socket for Grid node X and Y size. */
657  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
658  if (ntree->type == NTREE_GEOMETRY) {
660  }
662  }
663  }
664 
665  if (!MAIN_VERSION_ATLEAST(bmain, 293, 20)) {
666  /* Set zero user text objects to have a fake user. */
667  LISTBASE_FOREACH (Text *, text, &bmain->texts) {
668  if (text->id.us == 0) {
669  id_fake_user_set(&text->id);
670  }
671  }
672  }
673 
684  {
685  /* Keep this block, even when empty. */
686  }
687 }
688 
690 {
691  const bool was_closed_x = panel->flag & PNL_UNUSED_1;
692  const bool was_closed_y = panel->flag & PNL_CLOSED; /* That value was the Y closed flag. */
693 
694  SET_FLAG_FROM_TEST(panel->flag, was_closed_x || was_closed_y, PNL_CLOSED);
695 
696  /* Clear the old PNL_CLOSEDX flag. */
697  panel->flag &= ~PNL_UNUSED_1;
698 
699  LISTBASE_FOREACH (Panel *, child_panel, &panel->children) {
701  }
702 }
703 
705 {
706  /* Change to generic named float/float3 attributes. */
707  enum {
708  CD_LOCATION = 43,
709  CD_RADIUS = 44,
710  };
711 
712  for (int i = 0; i < pdata->totlayer; i++) {
713  CustomDataLayer *layer = &pdata->layers[i];
714  if (layer->type == CD_LOCATION) {
715  STRNCPY(layer->name, "Position");
716  layer->type = CD_PROP_FLOAT3;
717  }
718  else if (layer->type == CD_RADIUS) {
719  STRNCPY(layer->name, "Radius");
720  layer->type = CD_PROP_FLOAT;
721  }
722  }
723 }
724 
726 {
727  /* Change from capital initial letter to lower case (T82693). */
728  for (int i = 0; i < pdata->totlayer; i++) {
729  CustomDataLayer *layer = &pdata->layers[i];
730  if (layer->type == CD_PROP_FLOAT3 && STREQ(layer->name, "Position")) {
731  STRNCPY(layer->name, "position");
732  }
733  else if (layer->type == CD_PROP_FLOAT && STREQ(layer->name, "Radius")) {
734  STRNCPY(layer->name, "radius");
735  }
736  }
737 }
738 
739 /* Move FCurve handles towards the control point in such a way that the curve itself doesn't
740  * change. Since 2.91 FCurves are computed slightly differently, which requires this update to keep
741  * the same animation result. Previous versions scaled down overlapping handles during evaluation.
742  * This function applies the old correction to the actual animation data instead. */
744 {
745  uint i = 1;
746  for (BezTriple *bezt = fcu->bezt; i < fcu->totvert; i++, bezt++) {
747  /* Only adjust bezier key-frames. */
748  if (bezt->ipo != BEZT_IPO_BEZ) {
749  continue;
750  }
751 
752  BezTriple *nextbezt = bezt + 1;
753  const float v1[2] = {bezt->vec[1][0], bezt->vec[1][1]};
754  const float v2[2] = {bezt->vec[2][0], bezt->vec[2][1]};
755  const float v3[2] = {nextbezt->vec[0][0], nextbezt->vec[0][1]};
756  const float v4[2] = {nextbezt->vec[1][0], nextbezt->vec[1][1]};
757 
758  /* If the handles have no length, no need to do any corrections. */
759  if (v1[0] == v2[0] && v3[0] == v4[0]) {
760  continue;
761  }
762 
763  /* Calculate handle deltas. */
764  float delta1[2], delta2[2];
765  sub_v2_v2v2(delta1, v1, v2);
766  sub_v2_v2v2(delta2, v4, v3);
767 
768  const float len1 = fabsf(delta1[0]); /* Length of handle of first key. */
769  const float len2 = fabsf(delta2[0]); /* Length of handle of second key. */
770 
771  /* Overlapping handles used to be internally scaled down in previous versions.
772  * We bake the handles onto these previously virtual values. */
773  const float time_delta = v4[0] - v1[0];
774  const float total_len = len1 + len2;
775  if (total_len <= time_delta) {
776  continue;
777  }
778 
779  const float factor = time_delta / total_len;
780  /* Current keyframe's right handle: */
781  madd_v2_v2v2fl(bezt->vec[2], v1, delta1, -factor); /* vec[2] = v1 - factor * delta1 */
782  /* Next keyframe's left handle: */
783  madd_v2_v2v2fl(nextbezt->vec[0], v4, delta2, -factor); /* vec[0] = v4 - factor * delta2 */
784  }
785 }
786 
788 {
789  LISTBASE_FOREACH (Sequence *, seq, seqbase) {
790  seq->cache_flag = 0;
791  if (seq->type == SEQ_TYPE_META) {
793  }
794  }
795 }
796 
798 {
800  if (link->tonode->type == GEO_NODE_JOIN_GEOMETRY && !(link->tosock->flag & SOCK_MULTI_INPUT)) {
801  link->tosock = link->tonode->inputs.first;
802  }
803  }
805  if (node->type == GEO_NODE_JOIN_GEOMETRY) {
806  bNodeSocket *socket = node->inputs.first;
807  socket->flag |= SOCK_MULTI_INPUT;
808  socket->limit = 4095;
809  nodeRemoveSocket(ntree, node, socket->next);
810  }
811  }
812 }
813 
814 /* NOLINTNEXTLINE: readability-function-size */
816 {
817  UNUSED_VARS(fd);
818 
819  if (MAIN_VERSION_ATLEAST(bmain, 290, 2) && MAIN_VERSION_OLDER(bmain, 291, 1)) {
820  /* In this range, the extrude manifold could generate meshes with degenerated face. */
821  LISTBASE_FOREACH (Mesh *, me, &bmain->meshes) {
822  for (MPoly *mp = me->mpoly, *mp_end = mp + me->totpoly; mp < mp_end; mp++) {
823  if (mp->totloop == 2) {
824  bool changed;
826  me->mvert,
827  me->totvert,
828  me->medge,
829  me->totedge,
830  me->mface,
831  me->totface,
832  me->mloop,
833  me->totloop,
834  me->mpoly,
835  me->totpoly,
836  me->dvert,
837  false,
838  true,
839  &changed);
840  break;
841  }
842  }
843  }
844  }
845 
847  if (!MAIN_VERSION_ATLEAST(bmain, 290, 2)) {
848  {
849  short id_codes[] = {ID_BR, ID_PAL};
850  for (int i = 0; i < ARRAY_SIZE(id_codes); i++) {
851  ListBase *lb = which_libbase(bmain, id_codes[i]);
853  }
854  }
855 
856  if (!DNA_struct_elem_find(fd->filesdna, "SpaceImage", "float", "uv_opacity")) {
857  for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
858  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
859  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
860  if (sl->spacetype == SPACE_IMAGE) {
861  SpaceImage *sima = (SpaceImage *)sl;
862  sima->uv_opacity = 1.0f;
863  }
864  }
865  }
866  }
867  }
868 
869  /* Init Grease Pencil new random curves. */
870  if (!DNA_struct_elem_find(fd->filesdna, "BrushGpencilSettings", "float", "random_hue")) {
871  LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
872  if ((brush->gpencil_settings) && (brush->gpencil_settings->curve_rand_pressure == NULL)) {
873  brush->gpencil_settings->curve_rand_pressure = BKE_curvemapping_add(
874  1, 0.0f, 0.0f, 1.0f, 1.0f);
875  brush->gpencil_settings->curve_rand_strength = BKE_curvemapping_add(
876  1, 0.0f, 0.0f, 1.0f, 1.0f);
877  brush->gpencil_settings->curve_rand_uv = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
878  brush->gpencil_settings->curve_rand_hue = BKE_curvemapping_add(
879  1, 0.0f, 0.0f, 1.0f, 1.0f);
880  brush->gpencil_settings->curve_rand_saturation = BKE_curvemapping_add(
881  1, 0.0f, 0.0f, 1.0f, 1.0f);
882  brush->gpencil_settings->curve_rand_value = BKE_curvemapping_add(
883  1, 0.0f, 0.0f, 1.0f, 1.0f);
884  }
885  }
886  }
887  }
888 
889  if (!MAIN_VERSION_ATLEAST(bmain, 290, 4)) {
890  /* Clear old deprecated bit-flag from edit weights modifiers, we now use it for something else.
891  */
892  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
893  LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
894  if (md->type == eModifierType_WeightVGEdit) {
896  }
897  }
898  }
899 
900  /* Initialize parameters of the new Nishita sky model. */
901  if (!DNA_struct_elem_find(fd->filesdna, "NodeTexSky", "float", "sun_size")) {
902  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
903  if (ntree->type == NTREE_SHADER) {
905  if (node->type == SH_NODE_TEX_SKY && node->storage) {
906  NodeTexSky *tex = (NodeTexSky *)node->storage;
907  tex->sun_disc = true;
908  tex->sun_size = DEG2RADF(0.545);
909  tex->sun_elevation = M_PI_2;
910  tex->sun_rotation = 0.0f;
911  tex->altitude = 0.0f;
912  tex->air_density = 1.0f;
913  tex->dust_density = 1.0f;
914  tex->ozone_density = 1.0f;
915  }
916  }
917  }
918  }
920  }
921  }
922 
923  if (!MAIN_VERSION_ATLEAST(bmain, 290, 6)) {
924  /* Transition to saving expansion for all of a modifier's sub-panels. */
925  if (!DNA_struct_elem_find(fd->filesdna, "ModifierData", "short", "ui_expand_flag")) {
926  for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) {
927  LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
928  if (md->mode & eModifierMode_Expanded_DEPRECATED) {
929  md->ui_expand_flag = 1;
930  }
931  else {
932  md->ui_expand_flag = 0;
933  }
934  }
935  }
936  }
937 
938  /* EEVEE Motion blur new parameters. */
939  if (!DNA_struct_elem_find(fd->filesdna, "SceneEEVEE", "float", "motion_blur_depth_scale")) {
940  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
943  }
944  }
945 
946  if (!DNA_struct_elem_find(fd->filesdna, "SceneEEVEE", "int", "motion_blur_steps")) {
947  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
949  }
950  }
951 
952  /* Transition to saving expansion for all of a constraint's sub-panels. */
953  if (!DNA_struct_elem_find(fd->filesdna, "bConstraint", "short", "ui_expand_flag")) {
954  for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) {
955  LISTBASE_FOREACH (bConstraint *, con, &object->constraints) {
956  if (con->flag & CONSTRAINT_EXPAND_DEPRECATED) {
957  con->ui_expand_flag = 1;
958  }
959  else {
960  con->ui_expand_flag = 0;
961  }
962  }
963  }
964  }
965 
966  /* Transition to saving expansion for all of grease pencil modifier's sub-panels. */
967  if (!DNA_struct_elem_find(fd->filesdna, "GpencilModifierData", "short", "ui_expand_flag")) {
968  for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) {
969  LISTBASE_FOREACH (GpencilModifierData *, md, &object->greasepencil_modifiers) {
970  if (md->mode & eGpencilModifierMode_Expanded_DEPRECATED) {
971  md->ui_expand_flag = 1;
972  }
973  else {
974  md->ui_expand_flag = 0;
975  }
976  }
977  }
978  }
979 
980  /* Transition to saving expansion for all of an effect's sub-panels. */
981  if (!DNA_struct_elem_find(fd->filesdna, "ShaderFxData", "short", "ui_expand_flag")) {
982  for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) {
983  LISTBASE_FOREACH (ShaderFxData *, fx, &object->shader_fx) {
984  if (fx->mode & eShaderFxMode_Expanded_DEPRECATED) {
985  fx->ui_expand_flag = 1;
986  }
987  else {
988  fx->ui_expand_flag = 0;
989  }
990  }
991  }
992  }
993 
994  /* Refactor bevel profile type to use an enum. */
995  if (!DNA_struct_elem_find(fd->filesdna, "BevelModifierData", "short", "profile_type")) {
996  for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) {
997  LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
998  if (md->type == eModifierType_Bevel) {
1000  bool use_custom_profile = bmd->flags & MOD_BEVEL_CUSTOM_PROFILE_DEPRECATED;
1001  bmd->profile_type = use_custom_profile ? MOD_BEVEL_PROFILE_CUSTOM :
1003  }
1004  }
1005  }
1006  }
1007 
1008  /* Change ocean modifier values from [0, 10] to [0, 1] ranges. */
1009  for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) {
1010  LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
1011  if (md->type == eModifierType_Ocean) {
1012  OceanModifierData *omd = (OceanModifierData *)md;
1013  omd->wave_alignment *= 0.1f;
1014  omd->sharpen_peak_jonswap *= 0.1f;
1015  }
1016  }
1017  }
1018  }
1019 
1020  if (!MAIN_VERSION_ATLEAST(bmain, 291, 1)) {
1021 
1022  /* Initialize additional parameter of the Nishita sky model and change altitude unit. */
1023  if (!DNA_struct_elem_find(fd->filesdna, "NodeTexSky", "float", "sun_intensity")) {
1024  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1025  if (ntree->type == NTREE_SHADER) {
1027  if (node->type == SH_NODE_TEX_SKY && node->storage) {
1028  NodeTexSky *tex = (NodeTexSky *)node->storage;
1029  tex->sun_intensity = 1.0f;
1030  tex->altitude *= 0.001f;
1031  }
1032  }
1033  }
1034  }
1036  }
1037 
1038  /* Refactor bevel affect type to use an enum. */
1039  if (!DNA_struct_elem_find(fd->filesdna, "BevelModifierData", "char", "affect_type")) {
1040  for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) {
1041  LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
1042  if (md->type == eModifierType_Bevel) {
1043  BevelModifierData *bmd = (BevelModifierData *)md;
1044  const bool use_vertex_bevel = bmd->flags & MOD_BEVEL_VERT_DEPRECATED;
1045  bmd->affect_type = use_vertex_bevel ? MOD_BEVEL_AFFECT_VERTICES :
1047  }
1048  }
1049  }
1050  }
1051 
1052  /* Initialize additional velocity parameter for #CacheFile's. */
1053  if (!DNA_struct_elem_find(
1054  fd->filesdna, "MeshSeqCacheModifierData", "float", "velocity_scale")) {
1055  for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) {
1056  LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
1057  if (md->type == eModifierType_MeshSequenceCache) {
1059  mcmd->velocity_scale = 1.0f;
1060  }
1061  }
1062  }
1063  }
1064 
1065  if (!DNA_struct_elem_find(fd->filesdna, "CacheFile", "char", "velocity_unit")) {
1066  for (CacheFile *cache_file = bmain->cachefiles.first; cache_file != NULL;
1067  cache_file = cache_file->id.next) {
1068  BLI_strncpy(cache_file->velocity_name, ".velocities", sizeof(cache_file->velocity_name));
1069  cache_file->velocity_unit = CACHEFILE_VELOCITY_UNIT_SECOND;
1070  }
1071  }
1072 
1073  if (!DNA_struct_elem_find(fd->filesdna, "OceanModifierData", "int", "viewport_resolution")) {
1074  for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) {
1075  LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
1076  if (md->type == eModifierType_Ocean) {
1077  OceanModifierData *omd = (OceanModifierData *)md;
1078  omd->viewport_resolution = omd->resolution;
1079  }
1080  }
1081  }
1082  }
1083 
1084  /* Remove panel X axis collapsing, a remnant of horizontal panel alignment. */
1085  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1086  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1087  LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
1088  LISTBASE_FOREACH (Panel *, panel, &region->panels) {
1090  }
1091  }
1092  }
1093  }
1094  }
1095 
1096  if (!MAIN_VERSION_ATLEAST(bmain, 291, 2)) {
1097  for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) {
1099 
1100  if (rbw == NULL) {
1101  continue;
1102  }
1103 
1104  /* The substep method changed from "per second" to "per frame".
1105  * To get the new value simply divide the old bullet sim fps with the scene fps.
1106  */
1107  rbw->substeps_per_frame /= FPS;
1108 
1109  if (rbw->substeps_per_frame <= 0) {
1110  rbw->substeps_per_frame = 1;
1111  }
1112  }
1113 
1114  /* PointCloud attributes. */
1115  for (PointCloud *pointcloud = bmain->pointclouds.first; pointcloud != NULL;
1116  pointcloud = pointcloud->id.next) {
1117  do_versions_point_attributes(&pointcloud->pdata);
1118  }
1119 
1120  /* Show outliner mode column by default. */
1121  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1122  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1123  LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) {
1124  if (space->spacetype == SPACE_OUTLINER) {
1125  SpaceOutliner *space_outliner = (SpaceOutliner *)space;
1126 
1127  space_outliner->flag |= SO_MODE_COLUMN;
1128  }
1129  }
1130  }
1131  }
1132 
1133  /* Solver and Collections for Boolean. */
1134  for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) {
1135  LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
1136  if (md->type == eModifierType_Boolean) {
1140  }
1141  }
1142  }
1143  }
1144 
1145  if (!MAIN_VERSION_ATLEAST(bmain, 291, 4) && MAIN_VERSION_ATLEAST(bmain, 291, 1)) {
1146  /* Due to a48d78ce07f4f, CustomData.totlayer and CustomData.maxlayer has been written
1147  * incorrectly. Fortunately, the size of the layers array has been written to the .blend file
1148  * as well, so we can reconstruct totlayer and maxlayer from that. */
1149  LISTBASE_FOREACH (Mesh *, mesh, &bmain->meshes) {
1151  sizeof(CustomDataLayer);
1153  sizeof(CustomDataLayer);
1154  /* We can be sure that mesh->fdata is empty for files written by 2.90. */
1156  sizeof(CustomDataLayer);
1158  sizeof(CustomDataLayer);
1159  }
1160  }
1161 
1162  if (!MAIN_VERSION_ATLEAST(bmain, 291, 5)) {
1163  /* Fix fcurves to allow for new bezier handles behavior (T75881 and D8752). */
1164  for (bAction *act = bmain->actions.first; act; act = act->id.next) {
1165  for (FCurve *fcu = act->curves.first; fcu; fcu = fcu->next) {
1166  /* Only need to fix Bezier curves with at least 2 key-frames. */
1167  if (fcu->totvert < 2 || fcu->bezt == NULL) {
1168  continue;
1169  }
1171  }
1172  }
1173 
1174  LISTBASE_FOREACH (Collection *, collection, &bmain->collections) {
1175  collection->color_tag = COLLECTION_COLOR_NONE;
1176  }
1177  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1178  /* Old files do not have a master collection, but it will be created by
1179  * `BKE_collection_master_add()`. */
1180  if (scene->master_collection) {
1182  }
1183  }
1184 
1185  /* Add custom profile and bevel mode to curve bevels. */
1186  if (!DNA_struct_elem_find(fd->filesdna, "Curve", "char", "bevel_mode")) {
1187  LISTBASE_FOREACH (Curve *, curve, &bmain->curves) {
1188  if (curve->bevobj != NULL) {
1190  }
1191  else {
1193  }
1194  }
1195  }
1196 
1197  /* Ensure that new viewport display fields are initialized correctly. */
1198  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1199  LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1200  if (md->type == eModifierType_Fluid) {
1201  FluidModifierData *fmd = (FluidModifierData *)md;
1202  if (fmd->domain != NULL) {
1203  if (!fmd->domain->coba_field && fmd->domain->type == FLUID_DOMAIN_TYPE_LIQUID) {
1205  }
1206  fmd->domain->grid_scale = 1.0;
1207  fmd->domain->gridlines_upper_bound = 1.0;
1208  fmd->domain->vector_scale_with_magnitude = true;
1209  const float grid_lines[4] = {1.0, 0.0, 0.0, 1.0};
1210  copy_v4_v4(fmd->domain->gridlines_range_color, grid_lines);
1211  }
1212  }
1213  }
1214  }
1215  }
1216 
1217  if (!MAIN_VERSION_ATLEAST(bmain, 291, 6)) {
1218  /* Darken Inactive Overlay. */
1219  if (!DNA_struct_elem_find(fd->filesdna, "View3DOverlay", "float", "fade_alpha")) {
1220  for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
1221  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1222  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1223  if (sl->spacetype == SPACE_VIEW3D) {
1224  View3D *v3d = (View3D *)sl;
1225  v3d->overlay.fade_alpha = 0.40f;
1227  }
1228  }
1229  }
1230  }
1231  }
1232 
1233  /* Unify symmetry as a mesh property. */
1234  if (!DNA_struct_elem_find(fd->filesdna, "Mesh", "char", "symmetry")) {
1235  LISTBASE_FOREACH (Mesh *, mesh, &bmain->meshes) {
1236  /* The previous flags used to store mesh symmetry in edit-mode match the new ones that are
1237  * used in #Mesh.symmetry. */
1239  }
1240  }
1241 
1242  /* Alembic importer: allow vertex interpolation by default. */
1243  for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) {
1244  LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
1245  if (md->type != eModifierType_MeshSequenceCache) {
1246  continue;
1247  }
1248 
1250  data->read_flag |= MOD_MESHSEQ_INTERPOLATE_VERTICES;
1251  }
1252  }
1253  }
1254 
1255  if (!MAIN_VERSION_ATLEAST(bmain, 291, 7)) {
1256  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1257  scene->r.simplify_volumes = 1.0f;
1258  }
1259  }
1260 
1261  if (!MAIN_VERSION_ATLEAST(bmain, 291, 8)) {
1262  if (!DNA_struct_elem_find(fd->filesdna, "WorkSpaceDataRelation", "int", "parentid")) {
1263  LISTBASE_FOREACH (WorkSpace *, workspace, &bmain->workspaces) {
1265  WorkSpaceDataRelation *, relation, &workspace->hook_layout_relations) {
1266  relation->parent = blo_read_get_new_globaldata_address(fd, relation->parent);
1267  BLI_assert(relation->parentid == 0);
1268  if (relation->parent != NULL) {
1269  LISTBASE_FOREACH (wmWindowManager *, wm, &bmain->wm) {
1270  wmWindow *win = BLI_findptr(
1271  &wm->windows, relation->parent, offsetof(wmWindow, workspace_hook));
1272  if (win != NULL) {
1273  relation->parentid = win->winid;
1274  break;
1275  }
1276  }
1277  if (relation->parentid == 0) {
1278  BLI_assert(
1279  !"Found a valid parent for workspace data relation, but no valid parent id.");
1280  }
1281  }
1282  if (relation->parentid == 0) {
1283  BLI_freelinkN(&workspace->hook_layout_relations, relation);
1284  }
1285  }
1286  }
1287  }
1288 
1289  /* UV/Image show overlay option. */
1290  if (!DNA_struct_find(fd->filesdna, "SpaceImageOverlay")) {
1291  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1292  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1293  LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) {
1294  if (space->spacetype == SPACE_IMAGE) {
1295  SpaceImage *sima = (SpaceImage *)space;
1297  }
1298  }
1299  }
1300  }
1301  }
1302 
1303  /* Ensure that particle systems generated by fluid modifier have correct phystype. */
1304  LISTBASE_FOREACH (ParticleSettings *, part, &bmain->particles) {
1305  if (ELEM(
1307  part->phystype = PART_PHYS_NO;
1308  }
1309  }
1310  }
1311 
1312  if (!MAIN_VERSION_ATLEAST(bmain, 291, 9)) {
1313  /* Remove options of legacy UV/Image editor */
1314  for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
1315  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1316  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1317  switch (sl->spacetype) {
1318  case SPACE_IMAGE: {
1319  SpaceImage *sima = (SpaceImage *)sl;
1320  sima->flag &= ~(SI_FLAG_UNUSED_20);
1321  break;
1322  }
1323  }
1324  }
1325  }
1326  }
1327 
1328  if (!DNA_struct_elem_find(fd->filesdna, "FluidModifierData", "float", "fractions_distance")) {
1329  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1330  LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1331  if (md->type == eModifierType_Fluid) {
1332  FluidModifierData *fmd = (FluidModifierData *)md;
1333  if (fmd->domain) {
1334  fmd->domain->fractions_distance = 0.5;
1335  }
1336  }
1337  }
1338  }
1339  }
1340  }
1341 
1342  if (!MAIN_VERSION_ATLEAST(bmain, 292, 1)) {
1343  {
1344  const int LEGACY_REFINE_RADIAL_DISTORTION_K1 = (1 << 2);
1345 
1346  LISTBASE_FOREACH (MovieClip *, clip, &bmain->movieclips) {
1347  MovieTracking *tracking = &clip->tracking;
1348  MovieTrackingSettings *settings = &tracking->settings;
1349  int new_refine_camera_intrinsics = 0;
1350 
1352  new_refine_camera_intrinsics |= REFINE_FOCAL_LENGTH;
1353  }
1354 
1356  new_refine_camera_intrinsics |= REFINE_PRINCIPAL_POINT;
1357  }
1358 
1359  /* The end goal is to enable radial distortion refinement if either K1 or K2 were set for
1360  * refinement. It is enough to only check for L1 it was not possible to refine K2 without
1361  * K1. */
1362  if (settings->refine_camera_intrinsics & LEGACY_REFINE_RADIAL_DISTORTION_K1) {
1363  new_refine_camera_intrinsics |= REFINE_RADIAL_DISTORTION;
1364  }
1365 
1366  settings->refine_camera_intrinsics = new_refine_camera_intrinsics;
1367  }
1368  }
1369  }
1370 
1371  if (!MAIN_VERSION_ATLEAST(bmain, 292, 5)) {
1372  /* Initialize the opacity of the overlay wireframe */
1373  if (!DNA_struct_elem_find(fd->filesdna, "View3DOverlay", "float", "wireframe_opacity")) {
1374  for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
1375  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1376  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1377  if (sl->spacetype == SPACE_VIEW3D) {
1378  View3D *v3d = (View3D *)sl;
1379  v3d->overlay.wireframe_opacity = 1.0f;
1380  }
1381  }
1382  }
1383  }
1384  }
1385 
1386  /* Replace object hidden filter with inverted object visible filter. */
1387  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1388  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1389  LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) {
1390  if (space->spacetype == SPACE_OUTLINER) {
1391  SpaceOutliner *space_outliner = (SpaceOutliner *)space;
1392  if (space_outliner->filter_state == SO_FILTER_OB_HIDDEN) {
1393  space_outliner->filter_state = SO_FILTER_OB_VISIBLE;
1394  space_outliner->filter |= SO_FILTER_OB_STATE_INVERSE;
1395  }
1396  }
1397  }
1398  }
1399  }
1400 
1401  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1402  LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1403  if (md->type == eModifierType_WeightVGProximity) {
1405  if (wmd->cmap_curve == NULL) {
1406  wmd->cmap_curve = BKE_curvemapping_add(1, 0.0, 0.0, 1.0, 1.0);
1408  }
1409  }
1410  }
1411  }
1412 
1413  /* PointCloud attributes names. */
1414  LISTBASE_FOREACH (PointCloud *, pointcloud, &bmain->pointclouds) {
1415  do_versions_point_attribute_names(&pointcloud->pdata);
1416  }
1417 
1418  /* Cryptomatte render pass */
1419  if (!DNA_struct_elem_find(fd->filesdna, "ViewLayer", "short", "cryptomatte_levels")) {
1420  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1421  LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) {
1422  view_layer->cryptomatte_levels = 6;
1423  view_layer->cryptomatte_flag = VIEW_LAYER_CRYPTOMATTE_ACCURATE;
1424  }
1425  }
1426  }
1427  }
1428 
1429  if (!MAIN_VERSION_ATLEAST(bmain, 292, 7)) {
1430  /* Make all IDProperties used as interface of geometry node trees overridable. */
1431  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1432  LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1433  if (md->type == eModifierType_Nodes) {
1434  NodesModifierData *nmd = (NodesModifierData *)md;
1435  IDProperty *nmd_properties = nmd->settings.properties;
1436 
1437  BLI_assert(nmd_properties->type == IDP_GROUP);
1438  LISTBASE_FOREACH (IDProperty *, nmd_socket_idprop, &nmd_properties->data.group) {
1439  nmd_socket_idprop->flag |= IDP_FLAG_OVERRIDABLE_LIBRARY;
1440  }
1441  }
1442  }
1443  }
1444 
1445  /* EEVEE/Cycles Volumes consistency */
1446  for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) {
1447  /* Remove Volume Transmittance render pass from each view layer. */
1448  LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) {
1449  view_layer->eevee.render_passes &= ~EEVEE_RENDER_PASS_UNUSED_8;
1450  }
1451 
1452  /* Rename Render-layer Socket `VolumeScatterCol` to `VolumeDir`. */
1453  if (scene->nodetree) {
1455  if (node->type == CMP_NODE_R_LAYERS) {
1456  LISTBASE_FOREACH (bNodeSocket *, output_socket, &node->outputs) {
1457  const char *volume_scatter = "VolumeScatterCol";
1458  if (STREQLEN(output_socket->name, volume_scatter, MAX_NAME)) {
1459  BLI_strncpy(output_socket->name, RE_PASSNAME_VOLUME_LIGHT, MAX_NAME);
1460  }
1461  }
1462  }
1463  }
1464  }
1465  }
1466 
1467  /* Convert `NodeCryptomatte->storage->matte_id` to `NodeCryptomatte->storage->entries` */
1468  if (!DNA_struct_find(fd->filesdna, "CryptomatteEntry")) {
1469  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1470  if (scene->nodetree) {
1472  if (node->type == CMP_NODE_CRYPTOMATTE_LEGACY) {
1473  NodeCryptomatte *storage = (NodeCryptomatte *)node->storage;
1474  char *matte_id = storage->matte_id;
1475  if (matte_id == NULL || strlen(storage->matte_id) == 0) {
1476  continue;
1477  }
1478  BKE_cryptomatte_matte_id_to_entries(storage, storage->matte_id);
1479  }
1480  }
1481  }
1482  }
1483  }
1484 
1485  /* Overlay elements in the sequencer. */
1486  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1487  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1488  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1489  if (sl->spacetype == SPACE_SEQ) {
1490  SpaceSeq *sseq = (SpaceSeq *)sl;
1493  }
1494  }
1495  }
1496  }
1497  }
1498 
1499  if (!MAIN_VERSION_ATLEAST(bmain, 292, 8)) {
1500  LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
1502  if (STREQ(node->idname, "GeometryNodeRandomAttribute")) {
1503  STRNCPY(node->idname, "GeometryLegacyNodeAttributeRandomize");
1504  }
1505  }
1506  }
1507 
1508  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1511  }
1512  }
1513  }
1514 
1515  if (!MAIN_VERSION_ATLEAST(bmain, 292, 9)) {
1516  /* Default properties editors to auto outliner sync. */
1517  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1518  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1519  LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) {
1520  if (space->spacetype == SPACE_PROPERTIES) {
1521  SpaceProperties *space_properties = (SpaceProperties *)space;
1522  space_properties->outliner_sync = PROPERTIES_SYNC_AUTO;
1523  }
1524  }
1525  }
1526  }
1527 
1528  /* Ensure that new viscosity strength field is initialized correctly. */
1529  if (!DNA_struct_elem_find(fd->filesdna, "FluidModifierData", "float", "viscosity_value")) {
1530  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1531  LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1532  if (md->type == eModifierType_Fluid) {
1533  FluidModifierData *fmd = (FluidModifierData *)md;
1534  if (fmd->domain != NULL) {
1535  fmd->domain->viscosity_value = 0.05;
1536  }
1537  }
1538  }
1539  }
1540  }
1541  }
1542 
1543  if (!MAIN_VERSION_ATLEAST(bmain, 292, 10)) {
1544  if (!DNA_struct_find(fd->filesdna, "NodeSetAlpha")) {
1545  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1546  if (ntree->type != NTREE_COMPOSIT) {
1547  continue;
1548  }
1550  if (node->type != CMP_NODE_SETALPHA) {
1551  continue;
1552  }
1553  NodeSetAlpha *storage = MEM_callocN(sizeof(NodeSetAlpha), "NodeSetAlpha");
1555  node->storage = storage;
1556  }
1557  }
1559  }
1560 
1561  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1562  Editing *ed = SEQ_editing_get(scene);
1563  if (ed == NULL) {
1564  continue;
1565  }
1568  }
1569  }
1570 
1571  /* Enable "Save as Render" option for file output node by default (apply view transform to image
1572  * on save) */
1573  if (!MAIN_VERSION_ATLEAST(bmain, 292, 11)) {
1574  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1575  if (ntree->type == NTREE_COMPOSIT) {
1577  if (node->type == CMP_NODE_OUTPUT_FILE) {
1578  LISTBASE_FOREACH (bNodeSocket *, sock, &node->inputs) {
1579  NodeImageMultiFileSocket *simf = sock->storage;
1580  simf->save_as_render = true;
1581  }
1582  }
1583  }
1584  }
1585  }
1587  }
1588 
1589  if (!MAIN_VERSION_ATLEAST(bmain, 293, 1)) {
1590  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1591  if (ntree->type == NTREE_GEOMETRY) {
1592  version_node_socket_name(ntree, GEO_NODE_MESH_BOOLEAN, "Geometry A", "Geometry 1");
1593  version_node_socket_name(ntree, GEO_NODE_MESH_BOOLEAN, "Geometry B", "Geometry 2");
1594  }
1595  }
1597 
1598  /* Init grease pencil default curve resolution. */
1599  if (!DNA_struct_elem_find(fd->filesdna, "bGPdata", "int", "curve_edit_resolution")) {
1600  LISTBASE_FOREACH (bGPdata *, gpd, &bmain->gpencils) {
1601  gpd->curve_edit_resolution = GP_DEFAULT_CURVE_RESOLUTION;
1602  gpd->flag |= GP_DATA_CURVE_ADAPTIVE_RESOLUTION;
1603  }
1604  }
1605  /* Init grease pencil curve editing error threshold. */
1606  if (!DNA_struct_elem_find(fd->filesdna, "bGPdata", "float", "curve_edit_threshold")) {
1607  LISTBASE_FOREACH (bGPdata *, gpd, &bmain->gpencils) {
1608  gpd->curve_edit_threshold = GP_DEFAULT_CURVE_ERROR;
1609  gpd->curve_edit_corner_angle = GP_DEFAULT_CURVE_EDIT_CORNER_ANGLE;
1610  }
1611  }
1612  }
1613 
1614  if ((!MAIN_VERSION_ATLEAST(bmain, 292, 14)) ||
1615  ((bmain->versionfile == 293) && (!MAIN_VERSION_ATLEAST(bmain, 293, 1)))) {
1616  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1617  if (ntree->type != NTREE_GEOMETRY) {
1618  continue;
1619  }
1621  if (node->type == GEO_NODE_OBJECT_INFO && node->storage == NULL) {
1623  sizeof(NodeGeometryObjectInfo), __func__);
1624  data->transform_space = GEO_NODE_TRANSFORM_SPACE_RELATIVE;
1625  node->storage = data;
1626  }
1627  }
1628  }
1630  }
1631 
1632  if (!MAIN_VERSION_ATLEAST(bmain, 293, 1)) {
1633  /* Grease pencil layer transform matrix. */
1634  if (!DNA_struct_elem_find(fd->filesdna, "bGPDlayer", "float", "location[0]")) {
1635  LISTBASE_FOREACH (bGPdata *, gpd, &bmain->gpencils) {
1636  LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
1637  zero_v3(gpl->location);
1638  zero_v3(gpl->rotation);
1639  copy_v3_fl(gpl->scale, 1.0f);
1640  loc_eul_size_to_mat4(gpl->layer_mat, gpl->location, gpl->rotation, gpl->scale);
1641  invert_m4_m4(gpl->layer_invmat, gpl->layer_mat);
1642  }
1643  }
1644  }
1645  /* Fix Fill factor for grease pencil fill brushes. */
1646  LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
1647  if ((brush->gpencil_settings) && (brush->gpencil_settings->fill_factor == 0.0f)) {
1648  brush->gpencil_settings->fill_factor = 1.0f;
1649  }
1650  }
1651  }
1652 
1653  if (!MAIN_VERSION_ATLEAST(bmain, 293, 5)) {
1654  /* Change Nishita sky model Altitude unit. */
1655  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1656  if (ntree->type == NTREE_SHADER) {
1658  if (node->type == SH_NODE_TEX_SKY && node->storage) {
1659  NodeTexSky *tex = (NodeTexSky *)node->storage;
1660  tex->altitude *= 1000.0f;
1661  }
1662  }
1663  }
1664  }
1666  }
1667 
1668  if (!MAIN_VERSION_ATLEAST(bmain, 293, 6)) {
1669  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1670  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1671  LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) {
1672  /* Enable Outliner render visibility column. */
1673  if (space->spacetype == SPACE_OUTLINER) {
1674  SpaceOutliner *space_outliner = (SpaceOutliner *)space;
1675  space_outliner->show_restrict_flags |= SO_RESTRICT_RENDER;
1676  }
1677  }
1678  }
1679  }
1680  }
1681 
1682  if (!MAIN_VERSION_ATLEAST(bmain, 293, 7)) {
1683  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1684  if (ntree->type == NTREE_GEOMETRY) {
1686  }
1687  }
1689  }
1690 
1691  if (!MAIN_VERSION_ATLEAST(bmain, 293, 9)) {
1692  if (!DNA_struct_elem_find(fd->filesdna, "SceneEEVEE", "float", "bokeh_overblur")) {
1693  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1694  scene->eevee.bokeh_neighbor_max = 10.0f;
1695  scene->eevee.bokeh_denoise_fac = 0.75f;
1696  scene->eevee.bokeh_overblur = 5.0f;
1697  }
1698  }
1699 
1700  /* Add sub-panels for FModifiers, which requires a field to store expansion. */
1701  if (!DNA_struct_elem_find(fd->filesdna, "FModifier", "short", "ui_expand_flag")) {
1702  LISTBASE_FOREACH (bAction *, act, &bmain->actions) {
1703  LISTBASE_FOREACH (FCurve *, fcu, &act->curves) {
1704  LISTBASE_FOREACH (FModifier *, fcm, &fcu->modifiers) {
1705  SET_FLAG_FROM_TEST(fcm->ui_expand_flag,
1706  fcm->flag & FMODIFIER_FLAG_EXPANDED,
1708  }
1709  }
1710  }
1711  }
1712  }
1713 
1714  if (!MAIN_VERSION_ATLEAST(bmain, 293, 10)) {
1715  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1716  /* Fix old scene with too many samples that were not being used.
1717  * Now they are properly used and might produce a huge slowdown.
1718  * So we clamp to what the old max actual was. */
1721  }
1722  }
1723  }
1724 
1725  if (!MAIN_VERSION_ATLEAST(bmain, 293, 11)) {
1726  LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
1727  if (ntree->type == NTREE_GEOMETRY) {
1729  if (STREQ(node->idname, "GeometryNodeSubdivisionSurfaceSimple")) {
1730  STRNCPY(node->idname, "GeometryNodeSubdivide");
1731  }
1732  if (STREQ(node->idname, "GeometryNodeSubdivisionSurface")) {
1733  STRNCPY(node->idname, "GeometryNodeSubdivideSmooth");
1734  }
1735  }
1736  }
1737  }
1738  }
1739 
1740  if (!MAIN_VERSION_ATLEAST(bmain, 293, 12)) {
1741  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1742  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1743  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1744  switch (sl->spacetype) {
1745  case SPACE_SEQ: {
1746  SpaceSeq *sseq = (SpaceSeq *)sl;
1747  if (ELEM(sseq->render_size,
1752  sseq->flag |= SEQ_USE_PROXIES;
1753  }
1754  if (sseq->render_size == SEQ_RENDER_SIZE_FULL) {
1756  }
1757  }
1758  }
1759  }
1760  }
1761  }
1762 
1763  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1764  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1765  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1766  if (sl->spacetype == SPACE_SPREADSHEET) {
1767  ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
1768  &sl->regionbase;
1770  regionbase, RGN_TYPE_FOOTER, "footer for spreadsheet", RGN_TYPE_HEADER);
1771  if (new_footer != NULL) {
1772  new_footer->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_TOP :
1774  }
1775  }
1776  }
1777  }
1778  }
1779  }
1780 
1781  if (!MAIN_VERSION_ATLEAST(bmain, 293, 13)) {
1782  LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
1783  if (ntree->type == NTREE_GEOMETRY) {
1785  if (STREQ(node->idname, "GeometryNodeSubdivideSmooth")) {
1786  STRNCPY(node->idname, "GeometryNodeSubdivisionSurface");
1787  }
1788  }
1789  }
1790  }
1791  }
1792 
1793  if (!MAIN_VERSION_ATLEAST(bmain, 293, 14)) {
1794  if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "diff_fac")) {
1795  LISTBASE_FOREACH (Light *, light, &bmain->lights) {
1796  light->diff_fac = 1.0f;
1797  light->volume_fac = 1.0f;
1798  }
1799  }
1800  }
1801 
1802  if (!MAIN_VERSION_ATLEAST(bmain, 293, 15)) {
1803  LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
1804  if (ntree->type == NTREE_GEOMETRY) {
1806  if (STREQ(node->idname, "GeometryNodeMeshPlane")) {
1807  STRNCPY(node->idname, "GeometryNodeMeshGrid");
1808  }
1809  }
1810  }
1811  }
1812  }
1813 
1814  if (!MAIN_VERSION_ATLEAST(bmain, 293, 16)) {
1815  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1816  if (ntree->type == NTREE_GEOMETRY) {
1818  }
1820  }
1821 
1822  /* The CU_2D flag has been removed. */
1823  LISTBASE_FOREACH (Curve *, cu, &bmain->curves) {
1824 #define CU_2D (1 << 3)
1825  ListBase *nurbs = BKE_curve_nurbs_get(cu);
1826  bool is_2d = true;
1827 
1828  LISTBASE_FOREACH (Nurb *, nu, nurbs) {
1829  if (nu->flag & CU_2D) {
1830  nu->flag &= ~CU_2D;
1831  }
1832  else {
1833  is_2d = false;
1834  }
1835  }
1836 #undef CU_2D
1837  if (!is_2d && CU_IS_2D(cu)) {
1838  cu->flag |= CU_3D;
1839  }
1840  }
1841  }
1842 
1843  if (!MAIN_VERSION_ATLEAST(bmain, 293, 18)) {
1844  if (!DNA_struct_elem_find(fd->filesdna, "bArmature", "float", "axes_position")) {
1845  /* Convert the axes draw position to its old default (tip of bone). */
1846  LISTBASE_FOREACH (struct bArmature *, arm, &bmain->armatures) {
1847  arm->axes_position = 1.0;
1848  }
1849  }
1850 
1851  /* Initialize the spread parameter for area lights. */
1852  if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "area_spread")) {
1853  LISTBASE_FOREACH (Light *, la, &bmain->lights) {
1854  la->area_spread = DEG2RADF(180.0f);
1855  }
1856  }
1857 
1858  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1859  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1860  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1861  if (sl->spacetype == SPACE_NODE) {
1862  SpaceNode *snode = (SpaceNode *)sl;
1863  LISTBASE_FOREACH (bNodeTreePath *, path, &snode->treepath) {
1864  STRNCPY(path->display_name, path->node_name);
1865  }
1866  }
1867  }
1868  }
1869  }
1870 
1871  /* Consolidate node and final evaluation modes. */
1872  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1873  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1874  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1875  if (sl->spacetype == SPACE_SPREADSHEET) {
1876  SpaceSpreadsheet *sspreadsheet = (SpaceSpreadsheet *)sl;
1877  if (sspreadsheet->object_eval_state == 2) {
1879  }
1880  }
1881  }
1882  }
1883  }
1884  }
1885 
1886  /* Set default value for the new bisect_threshold parameter in the mirror modifier. */
1887  if (!MAIN_VERSION_ATLEAST(bmain, 293, 19)) {
1888  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1889  LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1890  if (md->type == eModifierType_Mirror) {
1892  /* This was the previous hard-coded value. */
1893  mmd->bisect_threshold = 0.001f;
1894  }
1895  }
1896  }
1897 
1898  LISTBASE_FOREACH (Curve *, cu, &bmain->curves) {
1899  /* Turn on clamping as this was implicit before. */
1900  cu->flag |= CU_PATH_CLAMP;
1901  }
1902  }
1903 
1913  {
1914  /* Keep this block, even when empty. */
1915  }
1916 }
typedef float(TangentPoint)[2]
void BKE_pose_rebuild(struct Main *bmain, struct Object *ob, struct bArmature *arm, bool do_id_user)
Definition: armature.c:2362
Generic geometry attributes built on CustomData.
bool BKE_collection_cycles_fix(struct Main *bmain, struct Collection *collection)
Definition: collection.c:1498
void BKE_curvemapping_init(struct CurveMapping *cumap)
Definition: colortools.c:1235
struct CurveMapping * BKE_curvemapping_add(int tot, float minx, float miny, float maxx, float maxy)
Definition: colortools.c:72
void BKE_cryptomatte_matte_id_to_entries(struct NodeCryptomatte *node_storage, const char *matte_id)
Definition: cryptomatte.cc:234
#define CU_IS_2D(cu)
Definition: BKE_curve.h:67
ListBase * BKE_curve_nurbs_get(struct Curve *cu)
Definition: curve.cc:4976
bool BKE_fcurve_is_empty(struct FCurve *fcu)
Definition: fcurve.c:2198
void BKE_fcurve_free(struct FCurve *fcu)
Definition: fcurve.c:65
struct FCurve * BKE_fcurve_find(ListBase *list, const char rna_path[], int array_index)
Definition: fcurve.c:249
struct bGPDframe * BKE_gpencil_frame_duplicate(const struct bGPDframe *gpf_src, bool dup_strokes)
void id_fake_user_set(struct ID *id)
Definition: lib_id.c:343
void BKE_main_id_repair_duplicate_names_listbase(struct Main *bmain, struct ListBase *lb)
Definition: lib_id.c:967
#define MAIN_VERSION_ATLEAST(main, ver, subver)
Definition: BKE_main.h:427
#define MAIN_VERSION_OLDER(main, ver, subver)
Definition: BKE_main.h:431
struct ListBase * which_libbase(struct Main *bmain, short type)
Definition: main.c:567
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, bool do_verbose, bool do_fixes, bool *r_change)
void multires_do_versions_simple_to_catmull_clark(struct Object *object, struct MultiresModifierData *mmd)
#define GEO_NODE_OBJECT_INFO
Definition: BKE_node.h:1386
#define SH_NODE_BSDF_PRINCIPLED
Definition: BKE_node.h:1164
#define GEO_NODE_MESH_BOOLEAN
Definition: BKE_node.h:1385
#define CMP_NODE_CRYPTOMATTE_LEGACY
Definition: BKE_node.h:1289
#define GEO_NODE_MESH_PRIMITIVE_GRID
Definition: BKE_node.h:1398
#define CMP_NODE_OUTPUT_FILE
Definition: BKE_node.h:1218
#define FOREACH_NODETREE_END
Definition: BKE_node.h:1058
#define CMP_NODE_SETALPHA
Definition: BKE_node.h:1213
struct bNodeLink * nodeAddLink(struct bNodeTree *ntree, struct bNode *fromnode, struct bNodeSocket *fromsock, struct bNode *tonode, struct bNodeSocket *tosock)
Definition: node.cc:2296
void nodeRemoveSocket(struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *sock)
Definition: node.cc:1933
struct bNodeSocket * nodeFindSocket(const struct bNode *node, eNodeSocketInOut in_out, const char *identifier)
#define FOREACH_NODETREE_BEGIN(bmain, _nodetree, _id)
Definition: BKE_node.h:1048
#define CMP_NODE_R_LAYERS
Definition: BKE_node.h:1216
#define GEO_NODE_JOIN_GEOMETRY
Definition: BKE_node.h:1387
#define BLI_assert(a)
Definition: BLI_assert.h:46
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:60
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:336
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:239
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
Definition: BLI_listbase.h:354
#define LISTBASE_FOREACH_BACKWARD(type, var, list)
Definition: BLI_listbase.h:348
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:100
void * BLI_findstring(const struct ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findptr(const struct ListBase *listbase, const void *ptr, 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:23
bool invert_m4_m4(float R[4][4], const float A[4][4])
Definition: math_matrix.c:1287
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:2547
#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 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:483
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
Definition: string.c:64
size_t size_t char size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL()
Definition: string.c:250
unsigned int uint
Definition: BLI_sys_types.h:67
#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:141
@ IDP_FLAG_OVERRIDABLE_LIBRARY
Definition: DNA_ID.h:172
@ ID_PAL
Definition: DNA_ID_enums.h:76
@ ID_BR
Definition: DNA_ID_enums.h:69
@ CACHEFILE_VELOCITY_UNIT_SECOND
Object groups, one object can be in many groups at once.
@ COLLECTION_COLOR_NONE
@ 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:48
@ FLUID_DOMAIN_TYPE_LIQUID
@ FLUID_DOMAIN_FIELD_PHI
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
@ VIEW_LAYER_CRYPTOMATTE_ACCURATE
@ EEVEE_RENDER_PASS_UNUSED_8
@ ME_SYMMETRY_X
@ ME_SYMMETRY_Y
@ ME_SYMMETRY_Z
@ MOD_BEVEL_PROFILE_CUSTOM
@ MOD_BEVEL_PROFILE_SUPERELLIPSE
@ MOD_WVG_EDIT_WEIGHTS_NORMALIZE
@ eBooleanModifierSolver_Fast
@ eBooleanModifierFlag_Object
@ eModifierType_Mirror
@ eModifierType_WeightVGProximity
@ eModifierType_Boolean
@ eModifierType_Fluid
@ eModifierType_MeshSequenceCache
@ eModifierType_Ocean
@ eModifierType_Nodes
@ eModifierType_Bevel
@ eModifierType_WeightVGEdit
@ eModifierType_Multires
@ MOD_MESHSEQ_INTERPOLATE_VERTICES
@ MOD_BEVEL_AFFECT_EDGES
@ MOD_BEVEL_AFFECT_VERTICES
#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
@ OB_MODE_SCULPT
Object is a sort of wrapper for general info.
@ OB_ARMATURE
@ OB_GPENCIL
@ PART_FLUID_FLIP
@ PART_FLUID_BUBBLE
@ PART_FLUID_FOAM
@ PART_FLUID_SPRAY
#define PART_PHYS_NO
Types and defines for representing Rigid Body entities.
#define RE_PASSNAME_VOLUME_LIGHT
#define FPS
@ PNL_UNUSED_1
@ PNL_CLOSED
@ UI_PANEL_DATA_EXPAND_ROOT
@ RGN_TYPE_FOOTER
@ RGN_TYPE_HEADER
@ RGN_ALIGN_BOTTOM
@ RGN_ALIGN_TOP
@ SEQ_TYPE_SOUND_RAM
@ SEQ_TYPE_META
@ SEQ_CACHE_STORE_RAW
@ SEQ_CACHE_STORE_FINAL_OUT
@ SEQ_USE_PROXY
@ 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
@ SEQ_TIMELINE_SHOW_STRIP_DURATION
@ SEQ_TIMELINE_SHOW_STRIP_SOURCE
@ SEQ_TIMELINE_SHOW_STRIP_NAME
@ 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_USE_PROXIES
@ SEQ_SHOW_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:341
Read Guarded memory(de)allocation.
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture SH_NODE_TEX_SKY
ATTR_WARN_UNUSED_RESULT const BMVert * v2
unsigned int U
Definition: btGjkEpa3.h:78
OperationNode * node
Scene scene
Curve curve
bNodeTree * ntree
DRWShaderLibrary * lib
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_dupallocN)(const void *vmemh)
Definition: mallocn.c:28
size_t(* MEM_allocN_len)(const void *vmemh)
Definition: mallocn.c:26
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
#define fabsf(x)
Definition: metal/compat.h:219
static unsigned c
Definition: RandGen.cpp:83
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:71
double SEQ_rendersize_to_scale_factor(int render_size)
Definition: proxy.c:86
void * blo_read_get_new_globaldata_address(FileData *fd, const void *adr)
Definition: readfile.c:1611
SequencerToolSettings * SEQ_tool_settings_init(void)
Definition: sequencer.c:316
MetaStack * SEQ_meta_stack_active_get(const Editing *ed)
Definition: sequencer.c:420
void SEQ_seqbase_active_set(Editing *ed, ListBase *seqbase)
Definition: sequencer.c:397
Editing * SEQ_editing_get(const Scene *scene)
Definition: sequencer.c:241
unsigned int uint32_t
Definition: stdint.h:80
void SEQ_time_right_handle_frame_set(const Scene *scene, Sequence *seq, int val)
Definition: strip_time.c:539
int SEQ_time_left_handle_frame_get(const Scene *UNUSED(scene), const Sequence *seq)
Definition: strip_time.c:506
void SEQ_time_left_handle_frame_set(const Scene *scene, Sequence *seq, int val)
Definition: strip_time.c:524
int SEQ_time_right_handle_frame_get(const Scene *scene, const Sequence *seq)
Definition: strip_time.c:515
void SEQ_transform_fix_single_image_seq_offsets(const Scene *scene, Sequence *seq)
short alignment
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:63
float gridlines_range_color[4]
struct FluidDomainSettings * domain
ListBase group
Definition: DNA_ID.h:101
IDPropertyData data
Definition: DNA_ID.h:117
char type
Definition: DNA_ID.h:108
Definition: DNA_ID.h:368
void * next
Definition: DNA_ID.h:369
void * first
Definition: DNA_listBase.h:31
Definition: BKE_main.h:121
ListBase brushes
Definition: BKE_main.h:193
ListBase scenes
Definition: BKE_main.h:168
ListBase wm
Definition: BKE_main.h:197
ListBase actions
Definition: BKE_main.h:191
ListBase texts
Definition: BKE_main.h:185
ListBase meshes
Definition: BKE_main.h:171
ListBase movieclips
Definition: BKE_main.h:199
ListBase lights
Definition: BKE_main.h:178
ListBase nodetrees
Definition: BKE_main.h:192
ListBase particles
Definition: BKE_main.h:194
ListBase materials
Definition: BKE_main.h:174
ListBase pointclouds
Definition: BKE_main.h:209
ListBase armatures
Definition: BKE_main.h:190
ListBase curves
Definition: BKE_main.h:172
ListBase screens
Definition: BKE_main.h:183
short versionfile
Definition: BKE_main.h:125
ListBase workspaces
Definition: BKE_main.h:203
ListBase collections
Definition: BKE_main.h:189
ListBase gpencils
Definition: BKE_main.h:198
ListBase objects
Definition: BKE_main.h:170
ListBase cachefiles
Definition: BKE_main.h:202
CustomData vdata
char symmetry
char editflag
CustomData pdata
CustomData edata
CustomData ldata
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
ListBase treepath
short render_size
short build_size_flags
StripProxy * proxy
StripTransform * transform
StripElem * stripdata
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 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_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 seq_convert_transform_animation(const Sequence *seq, const Scene *scene, const char *path, const int image_size, const int scene_size)
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 do_versions_point_attributes(CustomData *pdata)
static eSpaceSeq_Proxy_RenderSize get_sequencer_render_size(Main *bmain)
static void seq_update_meta_disp_range(Scene *scene)
static void do_versions_point_attribute_names(CustomData *pdata)
void do_versions_after_linking_290(FileData *UNUSED(fd), Main *bmain)
void version_node_socket_index_animdata(Main *bmain, const int node_tree_type, const int node_type, const int socket_index_orig, const int socket_index_offset, const int total_number_of_sockets)
void version_node_socket_name(bNodeTree *ntree, const int node_type, const char *old_name, const char *new_name)
ARegion * do_versions_add_region_if_not_found(ListBase *regionbase, int region_type, const char *name, int link_after_region_type)