Blender  V3.3
versioning_300.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 <string.h>
10 
11 #include "CLG_log.h"
12 
13 #include "MEM_guardedalloc.h"
14 
15 #include "BLI_listbase.h"
16 #include "BLI_math_vector.h"
17 #include "BLI_path_util.h"
18 #include "BLI_string.h"
19 #include "BLI_string_utils.h"
20 #include "BLI_utildefines.h"
21 
22 #include "DNA_anim_types.h"
23 #include "DNA_armature_types.h"
24 #include "DNA_brush_types.h"
25 #include "DNA_collection_types.h"
26 #include "DNA_constraint_types.h"
27 #include "DNA_curve_types.h"
28 #include "DNA_curves_types.h"
29 #include "DNA_genfile.h"
31 #include "DNA_lineart_types.h"
32 #include "DNA_listBase.h"
33 #include "DNA_mask_types.h"
34 #include "DNA_material_types.h"
35 #include "DNA_mesh_types.h"
36 #include "DNA_modifier_types.h"
37 #include "DNA_screen_types.h"
38 #include "DNA_space_types.h"
39 #include "DNA_text_types.h"
40 #include "DNA_workspace_types.h"
41 
42 #include "BKE_action.h"
43 #include "BKE_anim_data.h"
44 #include "BKE_animsys.h"
45 #include "BKE_armature.h"
46 #include "BKE_asset.h"
47 #include "BKE_attribute.h"
48 #include "BKE_collection.h"
49 #include "BKE_colortools.h"
50 #include "BKE_curve.h"
51 #include "BKE_data_transfer.h"
52 #include "BKE_deform.h"
53 #include "BKE_fcurve.h"
54 #include "BKE_fcurve_driver.h"
55 #include "BKE_idprop.h"
56 #include "BKE_image.h"
57 #include "BKE_lib_id.h"
58 #include "BKE_lib_override.h"
59 #include "BKE_main.h"
60 #include "BKE_main_namemap.h"
61 #include "BKE_modifier.h"
62 #include "BKE_node.h"
63 #include "BKE_screen.h"
64 
65 #include "RNA_access.h"
66 #include "RNA_enum_types.h"
67 #include "RNA_prototypes.h"
68 
69 #include "BLO_readfile.h"
70 
71 #include "readfile.h"
72 
73 #include "SEQ_channels.h"
74 #include "SEQ_iterator.h"
75 #include "SEQ_sequencer.h"
76 #include "SEQ_time.h"
77 
78 #include "versioning_common.h"
79 
80 static CLG_LogRef LOG = {"blo.readfile.doversion"};
81 
83 {
84  LISTBASE_FOREACH (IDProperty *, prop, &idprop_group->data.group) {
85  if (prop->type == IDP_GROUP && STREQ(prop->name, "_RNA_UI")) {
86  return prop;
87  }
88  }
89  return NULL;
90 }
91 
93  const IDProperty *prop_ui_data)
94 {
95  IDProperty *min = IDP_GetPropertyFromGroup(prop_ui_data, "min");
96  if (min != NULL) {
97  ui_data->min = ui_data->soft_min = IDP_coerce_to_int_or_zero(min);
98  }
99  IDProperty *max = IDP_GetPropertyFromGroup(prop_ui_data, "max");
100  if (max != NULL) {
101  ui_data->max = ui_data->soft_max = IDP_coerce_to_int_or_zero(max);
102  }
103  IDProperty *soft_min = IDP_GetPropertyFromGroup(prop_ui_data, "soft_min");
104  if (soft_min != NULL) {
105  ui_data->soft_min = IDP_coerce_to_int_or_zero(soft_min);
106  ui_data->soft_min = MIN2(ui_data->soft_min, ui_data->min);
107  }
108  IDProperty *soft_max = IDP_GetPropertyFromGroup(prop_ui_data, "soft_max");
109  if (soft_max != NULL) {
110  ui_data->soft_max = IDP_coerce_to_int_or_zero(soft_max);
111  ui_data->soft_max = MAX2(ui_data->soft_max, ui_data->max);
112  }
113  IDProperty *step = IDP_GetPropertyFromGroup(prop_ui_data, "step");
114  if (step != NULL) {
115  ui_data->step = IDP_coerce_to_int_or_zero(soft_max);
116  }
117  IDProperty *default_value = IDP_GetPropertyFromGroup(prop_ui_data, "default");
118  if (default_value != NULL) {
119  if (default_value->type == IDP_ARRAY) {
120  if (default_value->subtype == IDP_INT) {
121  ui_data->default_array = MEM_malloc_arrayN(default_value->len, sizeof(int), __func__);
122  memcpy(ui_data->default_array, IDP_Array(default_value), sizeof(int) * default_value->len);
123  ui_data->default_array_len = default_value->len;
124  }
125  }
126  else if (default_value->type == IDP_INT) {
127  ui_data->default_value = IDP_coerce_to_int_or_zero(default_value);
128  }
129  }
130 }
131 
133  const IDProperty *prop_ui_data)
134 {
135  IDProperty *min = IDP_GetPropertyFromGroup(prop_ui_data, "min");
136  if (min != NULL) {
137  ui_data->min = ui_data->soft_min = IDP_coerce_to_double_or_zero(min);
138  }
139  IDProperty *max = IDP_GetPropertyFromGroup(prop_ui_data, "max");
140  if (max != NULL) {
141  ui_data->max = ui_data->soft_max = IDP_coerce_to_double_or_zero(max);
142  }
143  IDProperty *soft_min = IDP_GetPropertyFromGroup(prop_ui_data, "soft_min");
144  if (soft_min != NULL) {
145  ui_data->soft_min = IDP_coerce_to_double_or_zero(soft_min);
146  ui_data->soft_min = MAX2(ui_data->soft_min, ui_data->min);
147  }
148  IDProperty *soft_max = IDP_GetPropertyFromGroup(prop_ui_data, "soft_max");
149  if (soft_max != NULL) {
150  ui_data->soft_max = IDP_coerce_to_double_or_zero(soft_max);
151  ui_data->soft_max = MIN2(ui_data->soft_max, ui_data->max);
152  }
153  IDProperty *step = IDP_GetPropertyFromGroup(prop_ui_data, "step");
154  if (step != NULL) {
155  ui_data->step = IDP_coerce_to_float_or_zero(step);
156  }
157  IDProperty *precision = IDP_GetPropertyFromGroup(prop_ui_data, "precision");
158  if (precision != NULL) {
159  ui_data->precision = IDP_coerce_to_int_or_zero(precision);
160  }
161  IDProperty *default_value = IDP_GetPropertyFromGroup(prop_ui_data, "default");
162  if (default_value != NULL) {
163  if (default_value->type == IDP_ARRAY) {
164  const int array_len = default_value->len;
165  ui_data->default_array_len = array_len;
166  if (default_value->subtype == IDP_FLOAT) {
167  ui_data->default_array = MEM_malloc_arrayN(array_len, sizeof(double), __func__);
168  const float *old_default_array = IDP_Array(default_value);
169  for (int i = 0; i < ui_data->default_array_len; i++) {
170  ui_data->default_array[i] = (double)old_default_array[i];
171  }
172  }
173  else if (default_value->subtype == IDP_DOUBLE) {
174  ui_data->default_array = MEM_malloc_arrayN(array_len, sizeof(double), __func__);
175  memcpy(ui_data->default_array, IDP_Array(default_value), sizeof(double) * array_len);
176  }
177  }
178  else if (ELEM(default_value->type, IDP_DOUBLE, IDP_FLOAT)) {
179  ui_data->default_value = IDP_coerce_to_double_or_zero(default_value);
180  }
181  }
182 }
183 
185  const IDProperty *prop_ui_data)
186 {
187  IDProperty *default_value = IDP_GetPropertyFromGroup(prop_ui_data, "default");
188  if (default_value != NULL && default_value->type == IDP_STRING) {
189  ui_data->default_value = BLI_strdup(IDP_String(default_value));
190  }
191 }
192 
193 static void version_idproperty_ui_data(IDProperty *idprop_group)
194 {
195  if (idprop_group == NULL) { /* NULL check here to reduce verbosity of calls to this function. */
196  return;
197  }
198 
199  IDProperty *ui_container = idproperty_find_ui_container(idprop_group);
200  if (ui_container == NULL) {
201  return;
202  }
203 
204  LISTBASE_FOREACH (IDProperty *, prop, &idprop_group->data.group) {
205  IDProperty *prop_ui_data = IDP_GetPropertyFromGroup(ui_container, prop->name);
206  if (prop_ui_data == NULL) {
207  continue;
208  }
209 
210  if (!IDP_ui_data_supported(prop)) {
211  continue;
212  }
213 
214  IDPropertyUIData *ui_data = IDP_ui_data_ensure(prop);
215 
216  IDProperty *subtype = IDP_GetPropertyFromGroup(prop_ui_data, "subtype");
217  if (subtype != NULL && subtype->type == IDP_STRING) {
218  const char *subtype_string = IDP_String(subtype);
219  int result = PROP_NONE;
221  ui_data->rna_subtype = result;
222  }
223 
224  IDProperty *description = IDP_GetPropertyFromGroup(prop_ui_data, "description");
225  if (description != NULL && description->type == IDP_STRING) {
226  ui_data->description = BLI_strdup(IDP_String(description));
227  }
228 
229  /* Type specific data. */
230  switch (IDP_ui_data_type(prop)) {
233  break;
234  case IDP_UI_DATA_TYPE_ID:
235  break;
237  version_idproperty_move_data_int((IDPropertyUIDataInt *)ui_data, prop_ui_data);
238  break;
241  break;
244  break;
245  }
246 
247  IDP_FreeFromGroup(ui_container, prop_ui_data);
248  }
249 
250  IDP_FreeFromGroup(idprop_group, ui_container);
251 }
252 
254 {
256  LISTBASE_FOREACH (Bone *, child_bone, &bone->childbase) {
258  }
259 }
260 
262 {
263  LISTBASE_FOREACH (Sequence *, seq, seqbase) {
264  version_idproperty_ui_data(seq->prop);
265  if (seq->type == SEQ_TYPE_META) {
267  }
268  }
269 }
270 
281 {
282  /* ID data. */
283  ID *id;
284  FOREACH_MAIN_ID_BEGIN (bmain, id) {
285  IDProperty *idprop_group = IDP_GetProperties(id, false);
286  version_idproperty_ui_data(idprop_group);
287  }
289 
290  /* Bones. */
291  LISTBASE_FOREACH (bArmature *, armature, &bmain->armatures) {
292  LISTBASE_FOREACH (Bone *, bone, &armature->bonebase) {
294  }
295  }
296 
297  /* Nodes and node sockets. */
298  LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
301  }
302  LISTBASE_FOREACH (bNodeSocket *, socket, &ntree->inputs) {
303  version_idproperty_ui_data(socket->prop);
304  }
305  LISTBASE_FOREACH (bNodeSocket *, socket, &ntree->outputs) {
306  version_idproperty_ui_data(socket->prop);
307  }
308  }
309 
310  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
311  /* The UI data from exposed node modifier properties is just copied from the corresponding node
312  * group, but the copying only runs when necessary, so we still need to version data here. */
313  LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
314  if (md->type == eModifierType_Nodes) {
317  }
318  }
319 
320  /* Object post bones. */
321  if (ob->type == OB_ARMATURE && ob->pose != NULL) {
322  LISTBASE_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
323  version_idproperty_ui_data(pchan->prop);
324  }
325  }
326  }
327 
328  /* Sequences. */
329  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
330  if (scene->ed != NULL) {
332  }
333  }
334 }
335 
336 static void sort_linked_ids(Main *bmain)
337 {
338  ListBase *lb;
339  FOREACH_MAIN_LISTBASE_BEGIN (bmain, lb) {
340  ListBase temp_list;
341  BLI_listbase_clear(&temp_list);
342  LISTBASE_FOREACH_MUTABLE (ID *, id, lb) {
343  if (ID_IS_LINKED(id)) {
344  BLI_remlink(lb, id);
345  BLI_addtail(&temp_list, id);
346  id_sort_by_name(&temp_list, id, NULL);
347  }
348  }
349  BLI_movelisttolist(lb, &temp_list);
350  }
352 }
353 
354 static void assert_sorted_ids(Main *bmain)
355 {
356 #ifndef NDEBUG
357  ListBase *lb;
358  FOREACH_MAIN_LISTBASE_BEGIN (bmain, lb) {
359  ID *id_prev = NULL;
360  LISTBASE_FOREACH (ID *, id, lb) {
361  if (id_prev == NULL) {
362  continue;
363  }
364  BLI_assert(id_prev->lib != id->lib || BLI_strcasecmp(id_prev->name, id->name) < 0);
365  }
366  }
368 #else
369  UNUSED_VARS_NDEBUG(bmain);
370 #endif
371 }
372 
374 {
375  LISTBASE_FOREACH (Object *, object, &bmain->objects) {
376  if (ELEM(object->type, OB_MESH, OB_LATTICE, OB_GPENCIL)) {
377  ListBase *new_defbase = BKE_object_defgroup_list_mutable(object);
378 
379  /* Choose the longest vertex group name list among all linked duplicates. */
380  if (BLI_listbase_count(&object->defbase) < BLI_listbase_count(new_defbase)) {
381  BLI_freelistN(&object->defbase);
382  }
383  else {
384  /* Clear the list in case the it was already assigned from another object. */
385  BLI_freelistN(new_defbase);
386  *new_defbase = object->defbase;
387  BKE_object_defgroup_active_index_set(object, object->actdef);
388  }
389  }
390  }
391 }
392 
394 {
395  /* Old SpeedControlVars->flags. */
396 #define SEQ_SPEED_INTEGRATE (1 << 0)
397 #define SEQ_SPEED_COMPRESS_IPO_Y (1 << 2)
398 
399  LISTBASE_FOREACH (Sequence *, seq, seqbase) {
400  if (seq->type == SEQ_TYPE_SPEED) {
401  SpeedControlVars *v = (SpeedControlVars *)seq->effectdata;
402  const char *substr = NULL;
403  float globalSpeed = v->globalSpeed;
404  if (seq->flag & SEQ_USE_EFFECT_DEFAULT_FADE) {
405  if (globalSpeed == 1.0f) {
406  v->speed_control_type = SEQ_SPEED_STRETCH;
407  }
408  else {
409  v->speed_control_type = SEQ_SPEED_MULTIPLY;
410  v->speed_fader = globalSpeed *
411  ((float)seq->seq1->len /
412  max_ff((float)(SEQ_time_right_handle_frame_get(scene, seq->seq1) -
413  seq->seq1->start),
414  1.0f));
415  }
416  }
417  else if (v->flags & SEQ_SPEED_INTEGRATE) {
418  v->speed_control_type = SEQ_SPEED_MULTIPLY;
419  v->speed_fader = seq->speed_fader * globalSpeed;
420  }
421  else if (v->flags & SEQ_SPEED_COMPRESS_IPO_Y) {
422  globalSpeed *= 100.0f;
423  v->speed_control_type = SEQ_SPEED_LENGTH;
424  v->speed_fader_length = seq->speed_fader * globalSpeed;
425  substr = "speed_length";
426  }
427  else {
428  v->speed_control_type = SEQ_SPEED_FRAME_NUMBER;
429  v->speed_fader_frame_number = (int)(seq->speed_fader * globalSpeed);
430  substr = "speed_frame_number";
431  }
432 
434 
435  if (substr || globalSpeed != 1.0f) {
436  FCurve *fcu = id_data_find_fcurve(&scene->id, seq, &RNA_Sequence, "speed_factor", 0, NULL);
437  if (fcu) {
438  if (globalSpeed != 1.0f) {
439  for (int i = 0; i < fcu->totvert; i++) {
440  BezTriple *bezt = &fcu->bezt[i];
441  bezt->vec[0][1] *= globalSpeed;
442  bezt->vec[1][1] *= globalSpeed;
443  bezt->vec[2][1] *= globalSpeed;
444  }
445  }
446  if (substr) {
447  char *new_path = BLI_str_replaceN(fcu->rna_path, "speed_factor", substr);
448  MEM_freeN(fcu->rna_path);
449  fcu->rna_path = new_path;
450  }
451  }
452  }
453  }
454  else if (seq->type == SEQ_TYPE_META) {
456  }
457  }
458 
459 #undef SEQ_SPEED_INTEGRATE
460 #undef SEQ_SPEED_COMPRESS_IPO_Y
461 }
462 
464 {
466  return true;
467 }
468 
470 {
472  if (smd->type == seqModifierType_ColorBalance) {
473  StripColorBalance *cb = &((ColorBalanceModifierData *)smd)->color_balance;
475  for (int i = 0; i < 3; i++) {
476  copy_v3_fl(cb->slope, 1.0f);
477  copy_v3_fl(cb->offset, 1.0f);
478  copy_v3_fl(cb->power, 1.0f);
479  }
480  }
481  }
482  return true;
483 }
484 
486 {
487  LISTBASE_FOREACH (bNodeLink *, link, &ntree->links) {
488  if (link->tosock == in_socket) {
489  return link;
490  }
491  }
492  return NULL;
493 }
494 
496  bNode *node,
497  bNodeSocket *geometry_socket)
498 {
499  BLI_assert(geometry_socket->type == SOCK_GEOMETRY);
500  bNodeLink *link = find_connected_link(ntree, geometry_socket);
501  if (link == NULL) {
502  return;
503  }
504 
505  /* If the realize instances node is already before this socket, no need to continue. */
506  if (link->fromnode->type == GEO_NODE_REALIZE_INSTANCES) {
507  return;
508  }
509 
511  realize_node->parent = node->parent;
512  realize_node->locx = node->locx - 100;
513  realize_node->locy = node->locy;
514  nodeAddLink(ntree, link->fromnode, link->fromsock, realize_node, realize_node->inputs.first);
515  link->fromnode = realize_node;
516  link->fromsock = realize_node->outputs.first;
517 }
518 
525 {
527  if (ELEM(node->type,
540  bNodeSocket *geometry_socket = node->inputs.first;
542  }
543  /* Also realize instances for the profile input of the curve to mesh node. */
544  if (node->type == GEO_NODE_CURVE_TO_MESH) {
545  bNodeSocket *profile_socket = (bNodeSocket *)BLI_findlink(&node->inputs, 1);
547  }
548  }
549 }
550 
557 {
558  bNodeTree *node_tree = ntreeAddTree(bmain, "Realize Instances 2.93 Legacy", "GeometryNodeTree");
559 
560  ntreeAddSocketInterface(node_tree, SOCK_IN, "NodeSocketGeometry", "Geometry");
561  ntreeAddSocketInterface(node_tree, SOCK_OUT, "NodeSocketGeometry", "Geometry");
562 
564  group_input->locx = -400.0f;
566  group_output->locx = 500.0f;
567  group_output->flag |= NODE_DO_OUTPUT;
568 
570  join->locx = group_output->locx - 175.0f;
571  join->locy = group_output->locy;
573  conv->locx = join->locx - 175.0f;
574  conv->locy = join->locy - 70.0;
576  separate->locx = join->locx - 350.0f;
577  separate->locy = join->locy + 50.0f;
579  realize->locx = separate->locx - 200.0f;
580  realize->locy = join->locy;
581 
582  nodeAddLink(node_tree, group_input, group_input->outputs.first, realize, realize->inputs.first);
583  nodeAddLink(node_tree, realize, realize->outputs.first, separate, separate->inputs.first);
584  nodeAddLink(node_tree, conv, conv->outputs.first, join, join->inputs.first);
585  nodeAddLink(node_tree, separate, BLI_findlink(&separate->outputs, 3), join, join->inputs.first);
586  nodeAddLink(node_tree, separate, BLI_findlink(&separate->outputs, 1), conv, conv->inputs.first);
587  nodeAddLink(node_tree, separate, BLI_findlink(&separate->outputs, 2), join, join->inputs.first);
588  nodeAddLink(node_tree, separate, separate->outputs.first, join, join->inputs.first);
589  nodeAddLink(node_tree, join, join->outputs.first, group_output, group_output->inputs.first);
590 
591  LISTBASE_FOREACH (bNode *, node, &node_tree->nodes) {
592  nodeSetSelected(node, false);
593  }
594 
596  return node_tree;
597 }
598 
600 {
601  char name_esc[(sizeof(seq->name) - 2) * 2];
602  BLI_str_escape(name_esc, seq->name + 2, sizeof(name_esc));
603  char *path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].pitch", name_esc);
604  FCurve *fcu = BKE_fcurve_find(fcurves, path, 0);
605  if (fcu != NULL) {
606  MEM_freeN(fcu->rna_path);
607  fcu->rna_path = BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].speed_factor", name_esc);
608  }
609  MEM_freeN(path);
610 }
611 
613 {
614  Scene *scene = (Scene *)user_data;
615  if (seq->type == SEQ_TYPE_META) {
617  }
618  return true;
619 }
620 
621 static bool seq_speed_factor_set(Sequence *seq, void *user_data)
622 {
623  const Scene *scene = user_data;
624  if (seq->type == SEQ_TYPE_SOUND_RAM) {
625  /* Move `pitch` animation to `speed_factor` */
626  if (scene->adt && scene->adt->action) {
628  }
631  }
632 
633  seq->speed_factor = seq->pitch;
634  }
635  else {
636  seq->speed_factor = 1.0f;
637  }
638  return true;
639 }
640 
642 {
643  if (MAIN_VERSION_ATLEAST(bmain, 300, 0) && !MAIN_VERSION_ATLEAST(bmain, 300, 1)) {
644  /* Set zero user text objects to have a fake user. */
645  LISTBASE_FOREACH (Text *, text, &bmain->texts) {
646  if (text->id.us == 0) {
647  id_fake_user_set(&text->id);
648  }
649  }
650  }
651 
652  if (!MAIN_VERSION_ATLEAST(bmain, 300, 3)) {
653  sort_linked_ids(bmain);
654  assert_sorted_ids(bmain);
655  }
656 
657  if (MAIN_VERSION_ATLEAST(bmain, 300, 3)) {
658  assert_sorted_ids(bmain);
659  }
660 
661  if (!MAIN_VERSION_ATLEAST(bmain, 300, 11)) {
663  }
664 
665  if (!MAIN_VERSION_ATLEAST(bmain, 300, 13)) {
666  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
667  if (scene->ed != NULL) {
669  }
670  }
671  }
672 
673  if (!MAIN_VERSION_ATLEAST(bmain, 300, 25)) {
675  }
676 
677  if (!MAIN_VERSION_ATLEAST(bmain, 300, 26)) {
678  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
679  ToolSettings *tool_settings = scene->toolsettings;
680  ImagePaintSettings *imapaint = &tool_settings->imapaint;
681  if (imapaint->canvas != NULL &&
683  imapaint->canvas = NULL;
684  }
685  if (imapaint->stencil != NULL &&
687  imapaint->stencil = NULL;
688  }
689  if (imapaint->clone != NULL &&
691  imapaint->clone = NULL;
692  }
693  }
694 
695  LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
696  if (brush->clone.image != NULL &&
697  ELEM(brush->clone.image->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) {
698  brush->clone.image = NULL;
699  }
700  }
701  }
702 
703  if (!MAIN_VERSION_ATLEAST(bmain, 300, 28)) {
704  LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
705  if (ntree->type == NTREE_GEOMETRY) {
707  }
708  }
709  }
710 
711  if (!MAIN_VERSION_ATLEAST(bmain, 300, 30)) {
713  }
714 
715  if (!MAIN_VERSION_ATLEAST(bmain, 300, 32)) {
716  /* Update Switch Node Non-Fields switch input to Switch_001. */
717  LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
718  if (ntree->type != NTREE_GEOMETRY) {
719  continue;
720  }
721 
722  LISTBASE_FOREACH (bNodeLink *, link, &ntree->links) {
723  if (link->tonode->type == GEO_NODE_SWITCH) {
724  if (STREQ(link->tosock->identifier, "Switch")) {
725  bNode *to_node = link->tonode;
726 
727  uint8_t mode = ((NodeSwitch *)to_node->storage)->input_type;
728  if (ELEM(mode,
730  SOCK_OBJECT,
732  SOCK_TEXTURE,
733  SOCK_MATERIAL)) {
734  link->tosock = link->tosock->next;
735  }
736  }
737  }
738  }
739  }
740  }
741 
742  if (!MAIN_VERSION_ATLEAST(bmain, 300, 33)) {
743  /* This was missing from #move_vertex_group_names_to_object_data. */
744  LISTBASE_FOREACH (Object *, object, &bmain->objects) {
745  if (ELEM(object->type, OB_MESH, OB_LATTICE, OB_GPENCIL)) {
746  /* This uses the fact that the active vertex group index starts counting at 1. */
747  if (BKE_object_defgroup_active_index_get(object) == 0) {
748  BKE_object_defgroup_active_index_set(object, object->actdef);
749  }
750  }
751  }
752  }
753 
754  if (!MAIN_VERSION_ATLEAST(bmain, 300, 35)) {
755  /* Add a new modifier to realize instances from previous modifiers.
756  * Previously that was done automatically by geometry nodes. */
757  bNodeTree *realize_instances_node_tree = NULL;
758  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
759  LISTBASE_FOREACH_MUTABLE (ModifierData *, md, &ob->modifiers) {
760  if (md->type != eModifierType_Nodes) {
761  continue;
762  }
763  if (md->next == NULL) {
764  break;
765  }
766  if (md->next->type == eModifierType_Nodes) {
767  continue;
768  }
770  if (nmd->node_group == NULL) {
771  continue;
772  }
773 
775  STRNCPY(new_nmd->modifier.name, "Realize Instances 2.93 Legacy");
776  BKE_modifier_unique_name(&ob->modifiers, &new_nmd->modifier);
777  BLI_insertlinkafter(&ob->modifiers, md, new_nmd);
778  if (realize_instances_node_tree == NULL) {
779  realize_instances_node_tree = add_realize_node_tree(bmain);
780  }
781  new_nmd->node_group = realize_instances_node_tree;
782  }
783  }
784  }
785 
786  if (!MAIN_VERSION_ATLEAST(bmain, 300, 37)) {
787  LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
788  if (ntree->type == NTREE_GEOMETRY) {
790  if (node->type == GEO_NODE_BOUNDING_BOX) {
791  bNodeSocket *geometry_socket = node->inputs.first;
793  }
794  }
795  }
796  }
797  }
798 
799  if (!MAIN_VERSION_ATLEAST(bmain, 301, 6)) {
800  { /* Ensure driver variable names are unique within the driver. */
801  ID *id;
802  FOREACH_MAIN_ID_BEGIN (bmain, id) {
803  AnimData *adt = BKE_animdata_from_id(id);
804  if (adt == NULL) {
805  continue;
806  }
807  LISTBASE_FOREACH (FCurve *, fcu, &adt->drivers) {
808  ChannelDriver *driver = fcu->driver;
809  /* Ensure the uniqueness front to back. Given a list of identically
810  * named variables, the last one gets to keep its original name. This
811  * matches the evaluation order, and thus shouldn't change the evaluated
812  * value of the driver expression. */
813  LISTBASE_FOREACH (DriverVar *, dvar, &driver->variables) {
814  BLI_uniquename(&driver->variables,
815  dvar,
816  dvar->name,
817  '_',
818  offsetof(DriverVar, name),
819  sizeof(dvar->name));
820  }
821  }
822  }
824  }
825 
826  /* Ensure tiled image sources contain a UDIM token. */
827  LISTBASE_FOREACH (Image *, ima, &bmain->images) {
828  if (ima->source == IMA_SRC_TILED) {
829  char *filename = (char *)BLI_path_basename(ima->filepath);
830  BKE_image_ensure_tile_token(filename);
831  }
832  }
833  }
834 
835  if (!MAIN_VERSION_ATLEAST(bmain, 302, 14)) {
836  /* Sequencer channels region. */
837  for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
838  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
839  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
840  if (sl->spacetype != SPACE_SEQ) {
841  continue;
842  }
843  SpaceSeq *sseq = (SpaceSeq *)sl;
844  ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
845  &sl->regionbase;
846  sseq->flag |= SEQ_CLAMP_VIEW;
847 
849  continue;
850  }
851 
852  ARegion *timeline_region = BKE_region_find_in_listbase_by_type(regionbase,
854 
855  if (timeline_region == NULL) {
856  continue;
857  }
858 
859  timeline_region->v2d.cur.ymax = 8.5f;
860  timeline_region->v2d.align &= ~V2D_ALIGN_NO_NEG_Y;
861  }
862  }
863  }
864  }
865 
866  if (!MAIN_VERSION_ATLEAST(bmain, 303, 5)) {
867  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
869  if (ed == NULL) {
870  continue;
871  }
874  }
875  }
876 
877  if (!MAIN_VERSION_ATLEAST(bmain, 303, 6)) {
878  /* In the Dope Sheet, for every mode other than Timeline, open the Properties panel. */
879  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
880  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
881  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
882  if (sl->spacetype != SPACE_ACTION) {
883  continue;
884  }
885 
886  /* Skip the timeline, it shouldn't get its Properties panel opened. */
887  SpaceAction *saction = (SpaceAction *)sl;
888  if (saction->mode == SACTCONT_TIMELINE) {
889  continue;
890  }
891 
892  const bool is_first_space = sl == area->spacedata.first;
893  ListBase *regionbase = is_first_space ? &area->regionbase : &sl->regionbase;
895  if (region == NULL) {
896  continue;
897  }
898 
899  region->flag &= ~RGN_FLAG_HIDDEN;
900  }
901  }
902  }
903  }
904 
915  {
916  /* Keep this block, even when empty. */
917  }
918 }
919 
921 {
922  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
923  if (ntree->type == NTREE_GEOMETRY) {
925  if (node->type == GEO_NODE_SWITCH) {
926  LISTBASE_FOREACH (bNodeSocket *, socket, &node->inputs) {
927  /* Skip the "switch" socket. */
928  if (socket == node->inputs.first) {
929  continue;
930  }
931  strcpy(socket->name, socket->name[0] == 'A' ? "False" : "True");
932 
933  /* Replace "A" and "B", but keep the unique number suffix at the end. */
934  char number_suffix[8];
935  BLI_strncpy(number_suffix, socket->identifier + 1, sizeof(number_suffix));
936  strcpy(socket->identifier, socket->name);
937  strcat(socket->identifier, number_suffix);
938  }
939  }
940  }
941  }
942  }
944 }
945 
946 static bool replace_bbone_len_scale_rnapath(char **p_old_path, int *p_index)
947 {
948  char *old_path = *p_old_path;
949 
950  if (old_path == NULL) {
951  return false;
952  }
953 
954  int len = strlen(old_path);
955 
956  if (BLI_str_endswith(old_path, ".bbone_curveiny") ||
957  BLI_str_endswith(old_path, ".bbone_curveouty")) {
958  old_path[len - 1] = 'z';
959  return true;
960  }
961 
962  if (BLI_str_endswith(old_path, ".bbone_scaleinx") ||
963  BLI_str_endswith(old_path, ".bbone_scaleiny") ||
964  BLI_str_endswith(old_path, ".bbone_scaleoutx") ||
965  BLI_str_endswith(old_path, ".bbone_scaleouty")) {
966  int index = (old_path[len - 1] == 'y' ? 2 : 0);
967 
968  old_path[len - 1] = 0;
969 
970  if (p_index) {
971  *p_index = index;
972  }
973  else {
974  *p_old_path = BLI_sprintfN("%s[%d]", old_path, index);
975  MEM_freeN(old_path);
976  }
977 
978  return true;
979  }
980 
981  return false;
982 }
983 
985 {
986  /* Update driver variable paths. */
987  if (fcu->driver) {
988  LISTBASE_FOREACH (DriverVar *, dvar, &fcu->driver->variables) {
990  replace_bbone_len_scale_rnapath(&dtar->rna_path, NULL);
991  }
993  }
994  }
995 
996  /* Update F-Curve's path. */
998 }
999 
1001  AnimData *adt,
1002  void *UNUSED(wrapper_data))
1003 {
1004  LISTBASE_FOREACH_MUTABLE (FCurve *, fcu, &adt->drivers) {
1006  }
1007 }
1008 
1010 {
1011  LISTBASE_FOREACH (Bone *, bone, lb) {
1012  if (bone->flag & BONE_ADD_PARENT_END_ROLL) {
1013  bone->bbone_flag |= BBONE_ADD_PARENT_END_ROLL;
1014  }
1015 
1016  copy_v3_fl3(bone->scale_in, bone->scale_in_x, 1.0f, bone->scale_in_z);
1017  copy_v3_fl3(bone->scale_out, bone->scale_out_x, 1.0f, bone->scale_out_z);
1018 
1019  do_version_bones_bbone_len_scale(&bone->childbase);
1020  }
1021 }
1022 
1024 {
1025  /* Binding array data could be freed without properly resetting its size data. */
1026  LISTBASE_FOREACH (bConstraint *, con, lb) {
1027  if (con->type == CONSTRAINT_TYPE_SPLINEIK) {
1029  if (data->points == NULL) {
1030  data->numpoints = 0;
1031  }
1032  }
1033  }
1034 }
1035 
1037  bNode *node,
1038  bNodeSocket *socket)
1039 {
1040  const bNodeSocketValueFloat *socket_value = (const bNodeSocketValueFloat *)socket->default_value;
1041  const float old_value = socket_value->value;
1042  nodeRemoveSocket(ntree, node, socket);
1043  bNodeSocket *new_socket = nodeAddSocket(
1045  bNodeSocketValueVector *value_vector = (bNodeSocketValueVector *)new_socket->default_value;
1046  copy_v3_fl(value_vector->value, old_value);
1047  return new_socket;
1048 }
1049 
1051 {
1053  if (seq->strip->transform != NULL) {
1054  transform->origin[0] = transform->origin[1] = 0.5f;
1055  }
1056  return true;
1057 }
1058 
1060 {
1062  if (seq->strip->transform != NULL) {
1064  }
1065  return true;
1066 }
1067 
1069 {
1070  if (seq->type == SEQ_TYPE_META) {
1072  }
1073  return true;
1074 }
1075 
1077 {
1078  if (node->type == SH_NODE_SUBSURFACE_SCATTERING) {
1081  }
1082  }
1083  else if (node->type == SH_NODE_BSDF_PRINCIPLED) {
1086  }
1087  }
1088 }
1089 
1091 {
1092  if (nmd->settings.properties == NULL) {
1093  return;
1094  }
1095  /* Before versioning the properties, make sure it hasn't been done already. */
1096  LISTBASE_FOREACH (const IDProperty *, property, &nmd->settings.properties->data.group) {
1097  if (strstr(property->name, "_use_attribute") || strstr(property->name, "_attribute_name")) {
1098  return;
1099  }
1100  }
1101 
1103  if (!ELEM(property->type, IDP_FLOAT, IDP_INT, IDP_ARRAY)) {
1104  continue;
1105  }
1106 
1107  if (strstr(property->name, "_use_attribute") || strstr(property->name, "_attribute_name")) {
1108  continue;
1109  }
1110 
1111  char use_attribute_prop_name[MAX_IDPROP_NAME];
1112  BLI_snprintf(use_attribute_prop_name,
1113  sizeof(use_attribute_prop_name),
1114  "%s%s",
1115  property->name,
1116  "_use_attribute");
1117 
1118  IDPropertyTemplate idprop = {0};
1119  IDProperty *use_attribute_prop = IDP_New(IDP_INT, &idprop, use_attribute_prop_name);
1120  IDP_AddToGroup(nmd->settings.properties, use_attribute_prop);
1121 
1122  char attribute_name_prop_name[MAX_IDPROP_NAME];
1123  BLI_snprintf(attribute_name_prop_name,
1124  sizeof(attribute_name_prop_name),
1125  "%s%s",
1126  property->name,
1127  "_attribute_name");
1128 
1129  IDProperty *attribute_prop = IDP_New(IDP_STRING, &idprop, attribute_name_prop_name);
1130  IDP_AddToGroup(nmd->settings.properties, attribute_prop);
1131  }
1132 }
1133 
1134 /* Copy of the function before the fixes. */
1135 static void legacy_vec_roll_to_mat3_normalized(const float nor[3],
1136  const float roll,
1137  float r_mat[3][3])
1138 {
1139  const float SAFE_THRESHOLD = 1.0e-5f; /* theta above this value has good enough precision. */
1140  const float CRITICAL_THRESHOLD = 1.0e-9f; /* above this is safe under certain conditions. */
1141  const float THRESHOLD_SQUARED = CRITICAL_THRESHOLD * CRITICAL_THRESHOLD;
1142 
1143  const float x = nor[0];
1144  const float y = nor[1];
1145  const float z = nor[2];
1146 
1147  const float theta = 1.0f + y; /* remapping Y from [-1,+1] to [0,2]. */
1148  const float theta_alt = x * x + z * z; /* Helper value for matrix calculations. */
1149  float rMatrix[3][3], bMatrix[3][3];
1150 
1152 
1153  /* When theta is close to zero (nor is aligned close to negative Y Axis),
1154  * we have to check we do have non-null X/Z components as well.
1155  * Also, due to float precision errors, nor can be (0.0, -0.99999994, 0.0) which results
1156  * in theta being close to zero. This will cause problems when theta is used as divisor.
1157  */
1158  if (theta > SAFE_THRESHOLD || (theta > CRITICAL_THRESHOLD && theta_alt > THRESHOLD_SQUARED)) {
1159  /* nor is *not* aligned to negative Y-axis (0,-1,0). */
1160 
1161  bMatrix[0][1] = -x;
1162  bMatrix[1][0] = x;
1163  bMatrix[1][1] = y;
1164  bMatrix[1][2] = z;
1165  bMatrix[2][1] = -z;
1166 
1167  if (theta > SAFE_THRESHOLD) {
1168  /* nor differs significantly from negative Y axis (0,-1,0): apply the general case. */
1169  bMatrix[0][0] = 1 - x * x / theta;
1170  bMatrix[2][2] = 1 - z * z / theta;
1171  bMatrix[2][0] = bMatrix[0][2] = -x * z / theta;
1172  }
1173  else {
1174  /* nor is close to negative Y axis (0,-1,0): apply the special case. */
1175  bMatrix[0][0] = (x + z) * (x - z) / -theta_alt;
1176  bMatrix[2][2] = -bMatrix[0][0];
1177  bMatrix[2][0] = bMatrix[0][2] = 2.0f * x * z / theta_alt;
1178  }
1179  }
1180  else {
1181  /* nor is very close to negative Y axis (0,-1,0): use simple symmetry by Z axis. */
1182  unit_m3(bMatrix);
1183  bMatrix[0][0] = bMatrix[1][1] = -1.0;
1184  }
1185 
1186  /* Make Roll matrix */
1187  axis_angle_normalized_to_mat3(rMatrix, nor, roll);
1188 
1189  /* Combine and output result */
1190  mul_m3_m3m3(r_mat, rMatrix, bMatrix);
1191 }
1192 
1193 static void correct_bone_roll_value(const float head[3],
1194  const float tail[3],
1195  const float check_x_axis[3],
1196  const float check_y_axis[3],
1197  float *r_roll)
1198 {
1199  const float SAFE_THRESHOLD = 1.0e-5f;
1200  float vec[3], bone_mat[3][3], vec2[3];
1201 
1202  /* Compute the Y axis vector. */
1203  sub_v3_v3v3(vec, tail, head);
1204  normalize_v3(vec);
1205 
1206  /* Only correct when in the danger zone. */
1207  if (1.0f + vec[1] < SAFE_THRESHOLD * 2 && (vec[0] || vec[2])) {
1208  /* Use the armature matrix to double-check if adjustment is needed.
1209  * This should minimize issues if the file is bounced back and forth between
1210  * 2.92 and 2.91, provided Edit Mode isn't entered on the armature in 2.91. */
1211  vec_roll_to_mat3(vec, *r_roll, bone_mat);
1212 
1213  UNUSED_VARS_NDEBUG(check_y_axis);
1214  BLI_assert(dot_v3v3(bone_mat[1], check_y_axis) > 0.999f);
1215 
1216  if (dot_v3v3(bone_mat[0], check_x_axis) < 0.999f) {
1217  /* Recompute roll using legacy code to interpret the old value. */
1218  legacy_vec_roll_to_mat3_normalized(vec, *r_roll, bone_mat);
1219  mat3_to_vec_roll(bone_mat, vec2, r_roll);
1220  BLI_assert(compare_v3v3(vec, vec2, 0.001f));
1221  }
1222  }
1223 }
1224 
1225 /* Update the armature Bone roll fields for bones very close to -Y direction. */
1227 {
1228  LISTBASE_FOREACH (Bone *, bone, lb) {
1229  /* Parent-relative orientation (used for posing). */
1231  bone->head, bone->tail, bone->bone_mat[0], bone->bone_mat[1], &bone->roll);
1232 
1233  /* Absolute orientation (used for Edit mode). */
1235  bone->arm_head, bone->arm_tail, bone->arm_mat[0], bone->arm_mat[1], &bone->arm_roll);
1236 
1237  do_version_bones_roll(&bone->childbase);
1238  }
1239 }
1240 
1242 {
1243  /* Add the new Offset socket. */
1245  if (node->type != GEO_NODE_SET_POSITION) {
1246  continue;
1247  }
1248  if (BLI_listbase_count(&node->inputs) < 4) {
1249  /* The offset socket didn't exist in the file yet. */
1250  return;
1251  }
1252  bNodeSocket *old_offset_socket = BLI_findlink(&node->inputs, 3);
1253  if (old_offset_socket->type == SOCK_VECTOR) {
1254  /* Versioning happened already. */
1255  return;
1256  }
1257  /* Change identifier of old socket, so that the there is no name collision. */
1258  STRNCPY(old_offset_socket->identifier, "Offset_old");
1260  }
1261 
1262  /* Relink links that were connected to Position while Offset was enabled. */
1263  LISTBASE_FOREACH (bNodeLink *, link, &ntree->links) {
1264  if (link->tonode->type != GEO_NODE_SET_POSITION) {
1265  continue;
1266  }
1267  if (!STREQ(link->tosock->identifier, "Position")) {
1268  continue;
1269  }
1270  bNodeSocket *old_offset_socket = BLI_findlink(&link->tonode->inputs, 3);
1271  /* This assumes that the offset is not linked to something else. That seems to be a reasonable
1272  * assumption, because the node is probably only ever used in one or the other mode. */
1273  const bool offset_enabled =
1274  ((bNodeSocketValueBoolean *)old_offset_socket->default_value)->value;
1275  if (offset_enabled) {
1276  /* Relink to new offset socket. */
1277  link->tosock = old_offset_socket->next;
1278  }
1279  }
1280 
1281  /* Remove old Offset socket. */
1283  if (node->type != GEO_NODE_SET_POSITION) {
1284  continue;
1285  }
1286  bNodeSocket *old_offset_socket = BLI_findlink(&node->inputs, 3);
1287  nodeRemoveSocket(ntree, node, old_offset_socket);
1288  }
1289 }
1290 
1292 {
1294  LISTBASE_FOREACH (bNodeSocket *, socket, &node->inputs) {
1296  }
1297  LISTBASE_FOREACH (bNodeSocket *, socket, &node->outputs) {
1299  }
1300  }
1301 }
1302 
1304 {
1305  seq->startofs -= seq->startstill;
1306  seq->endofs -= seq->endstill;
1307  seq->startstill = 0;
1308  seq->endstill = 0;
1309  return true;
1310 }
1311 
1312 /* Those `version_liboverride_rnacollections_*` functions mimic the old, pre-3.0 code to find
1313  * anchor and source items in the given list of modifiers, constraints etc., using only the
1314  * `subitem_local` data of the override property operation.
1315  *
1316  * Then they convert it into the new, proper `subitem_reference` data for the anchor, and
1317  * `subitem_local` for the source.
1318  *
1319  * NOTE: Here only the stored override ID is available, unlike in the `override_apply` functions.
1320  */
1321 
1324 {
1326  if (opop->operation != IDOVERRIDE_LIBRARY_OP_INSERT_AFTER) {
1327  continue;
1328  }
1330  opop->subitem_local_name,
1331  offsetof(bConstraint, name),
1332  opop->subitem_local_index);
1333  bConstraint *constraint_src = constraint_anchor != NULL ? constraint_anchor->next :
1334  constraints->first;
1335 
1336  if (constraint_src == NULL) {
1337  /* Invalid case, just remove that override property operation. */
1338  CLOG_ERROR(&LOG, "Could not find source constraint in stored override data");
1340  continue;
1341  }
1342 
1343  opop->subitem_reference_name = opop->subitem_local_name;
1344  opop->subitem_local_name = BLI_strdup(constraint_src->name);
1345  opop->subitem_reference_index = opop->subitem_local_index;
1346  opop->subitem_local_index++;
1347  }
1348 }
1349 
1351 {
1352  IDOverrideLibrary *liboverride = object->id.override_library;
1354 
1355  op = BKE_lib_override_library_property_find(liboverride, "modifiers");
1356  if (op != NULL) {
1358  if (opop->operation != IDOVERRIDE_LIBRARY_OP_INSERT_AFTER) {
1359  continue;
1360  }
1362  opop->subitem_local_name,
1363  offsetof(ModifierData, name),
1364  opop->subitem_local_index);
1365  ModifierData *mod_src = mod_anchor != NULL ? mod_anchor->next : object->modifiers.first;
1366 
1367  if (mod_src == NULL) {
1368  /* Invalid case, just remove that override property operation. */
1369  CLOG_ERROR(&LOG, "Could not find source modifier in stored override data");
1371  continue;
1372  }
1373 
1374  opop->subitem_reference_name = opop->subitem_local_name;
1375  opop->subitem_local_name = BLI_strdup(mod_src->name);
1376  opop->subitem_reference_index = opop->subitem_local_index;
1377  opop->subitem_local_index++;
1378  }
1379  }
1380 
1381  op = BKE_lib_override_library_property_find(liboverride, "grease_pencil_modifiers");
1382  if (op != NULL) {
1384  if (opop->operation != IDOVERRIDE_LIBRARY_OP_INSERT_AFTER) {
1385  continue;
1386  }
1388  &object->greasepencil_modifiers,
1389  opop->subitem_local_name,
1390  offsetof(GpencilModifierData, name),
1391  opop->subitem_local_index);
1392  GpencilModifierData *gp_mod_src = gp_mod_anchor != NULL ?
1393  gp_mod_anchor->next :
1394  object->greasepencil_modifiers.first;
1395 
1396  if (gp_mod_src == NULL) {
1397  /* Invalid case, just remove that override property operation. */
1398  CLOG_ERROR(&LOG, "Could not find source GP modifier in stored override data");
1400  continue;
1401  }
1402 
1403  opop->subitem_reference_name = opop->subitem_local_name;
1404  opop->subitem_local_name = BLI_strdup(gp_mod_src->name);
1405  opop->subitem_reference_index = opop->subitem_local_index;
1406  opop->subitem_local_index++;
1407  }
1408  }
1409 
1410  op = BKE_lib_override_library_property_find(liboverride, "constraints");
1411  if (op != NULL) {
1413  }
1414 
1415  if (object->pose != NULL) {
1416  LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) {
1417  char rna_path[26 + (sizeof(pchan->name) * 2) + 1];
1418  char name_esc[sizeof(pchan->name) * 2];
1419  BLI_str_escape(name_esc, pchan->name, sizeof(name_esc));
1420  SNPRINTF(rna_path, "pose.bones[\"%s\"].constraints", name_esc);
1421  op = BKE_lib_override_library_property_find(liboverride, rna_path);
1422  if (op != NULL) {
1424  }
1425  }
1426  }
1427 }
1428 
1430 {
1431  AnimData *anim_data = BKE_animdata_from_id(id);
1432  if (anim_data == NULL) {
1433  return;
1434  }
1435 
1436  IDOverrideLibrary *liboverride = id->override_library;
1438 
1439  op = BKE_lib_override_library_property_find(liboverride, "animation_data.nla_tracks");
1440  if (op != NULL) {
1442  if (opop->operation != IDOVERRIDE_LIBRARY_OP_INSERT_AFTER) {
1443  continue;
1444  }
1445  /* NLA tracks are only referenced by index, which limits possibilities, basically they are
1446  * always added at the end of the list, see #rna_NLA_tracks_override_apply.
1447  *
1448  * This makes things simple here. */
1449  opop->subitem_reference_name = opop->subitem_local_name;
1450  opop->subitem_local_name = NULL;
1451  opop->subitem_reference_index = opop->subitem_local_index;
1452  opop->subitem_local_index++;
1453  }
1454  }
1455 }
1456 
1458 {
1459  /* In geometry nodes, replace shader combine/separate color nodes with function nodes */
1460  if (ntree->type == NTREE_GEOMETRY) {
1465 
1470 
1472  switch (node->type) {
1473  case SH_NODE_COMBRGB_LEGACY: {
1474  node->type = FN_NODE_COMBINE_COLOR;
1476  __func__);
1477  storage->mode = NODE_COMBSEP_COLOR_RGB;
1478  strcpy(node->idname, "FunctionNodeCombineColor");
1479  node->storage = storage;
1480  break;
1481  }
1482  case SH_NODE_SEPRGB_LEGACY: {
1483  node->type = FN_NODE_SEPARATE_COLOR;
1485  __func__);
1486  storage->mode = NODE_COMBSEP_COLOR_RGB;
1487  strcpy(node->idname, "FunctionNodeSeparateColor");
1488  node->storage = storage;
1489  break;
1490  }
1491  }
1492  }
1493  }
1494 
1495  /* In compositing nodes, replace combine/separate RGBA/HSVA/YCbCrA/YCCA nodes with
1496  * combine/separate color */
1497  if (ntree->type == NTREE_COMPOSIT) {
1502 
1507 
1512 
1517 
1522 
1527 
1532 
1537 
1539  switch (node->type) {
1540  case CMP_NODE_COMBRGBA_LEGACY: {
1541  node->type = CMP_NODE_COMBINE_COLOR;
1543  sizeof(NodeCMPCombSepColor), __func__);
1544  storage->mode = CMP_NODE_COMBSEP_COLOR_RGB;
1545  strcpy(node->idname, "CompositorNodeCombineColor");
1546  node->storage = storage;
1547  break;
1548  }
1549  case CMP_NODE_COMBHSVA_LEGACY: {
1550  node->type = CMP_NODE_COMBINE_COLOR;
1552  sizeof(NodeCMPCombSepColor), __func__);
1553  storage->mode = CMP_NODE_COMBSEP_COLOR_HSV;
1554  strcpy(node->idname, "CompositorNodeCombineColor");
1555  node->storage = storage;
1556  break;
1557  }
1558  case CMP_NODE_COMBYCCA_LEGACY: {
1559  node->type = CMP_NODE_COMBINE_COLOR;
1561  sizeof(NodeCMPCombSepColor), __func__);
1562  storage->mode = CMP_NODE_COMBSEP_COLOR_YCC;
1563  storage->ycc_mode = node->custom1;
1564  strcpy(node->idname, "CompositorNodeCombineColor");
1565  node->storage = storage;
1566  break;
1567  }
1568  case CMP_NODE_COMBYUVA_LEGACY: {
1569  node->type = CMP_NODE_COMBINE_COLOR;
1571  sizeof(NodeCMPCombSepColor), __func__);
1572  storage->mode = CMP_NODE_COMBSEP_COLOR_YUV;
1573  strcpy(node->idname, "CompositorNodeCombineColor");
1574  node->storage = storage;
1575  break;
1576  }
1577  case CMP_NODE_SEPRGBA_LEGACY: {
1578  node->type = CMP_NODE_SEPARATE_COLOR;
1580  sizeof(NodeCMPCombSepColor), __func__);
1581  storage->mode = CMP_NODE_COMBSEP_COLOR_RGB;
1582  strcpy(node->idname, "CompositorNodeSeparateColor");
1583  node->storage = storage;
1584  break;
1585  }
1586  case CMP_NODE_SEPHSVA_LEGACY: {
1587  node->type = CMP_NODE_SEPARATE_COLOR;
1589  sizeof(NodeCMPCombSepColor), __func__);
1590  storage->mode = CMP_NODE_COMBSEP_COLOR_HSV;
1591  strcpy(node->idname, "CompositorNodeSeparateColor");
1592  node->storage = storage;
1593  break;
1594  }
1595  case CMP_NODE_SEPYCCA_LEGACY: {
1596  node->type = CMP_NODE_SEPARATE_COLOR;
1598  sizeof(NodeCMPCombSepColor), __func__);
1599  storage->mode = CMP_NODE_COMBSEP_COLOR_YCC;
1600  storage->ycc_mode = node->custom1;
1601  strcpy(node->idname, "CompositorNodeSeparateColor");
1602  node->storage = storage;
1603  break;
1604  }
1605  case CMP_NODE_SEPYUVA_LEGACY: {
1606  node->type = CMP_NODE_SEPARATE_COLOR;
1608  sizeof(NodeCMPCombSepColor), __func__);
1609  storage->mode = CMP_NODE_COMBSEP_COLOR_YUV;
1610  strcpy(node->idname, "CompositorNodeSeparateColor");
1611  node->storage = storage;
1612  break;
1613  }
1614  }
1615  }
1616  }
1617 
1618  /* In texture nodes, replace combine/separate RGBA with combine/separate color */
1619  if (ntree->type == NTREE_TEXTURE) {
1621  switch (node->type) {
1622  case TEX_NODE_COMPOSE_LEGACY: {
1623  node->type = TEX_NODE_COMBINE_COLOR;
1624  node->custom1 = NODE_COMBSEP_COLOR_RGB;
1625  strcpy(node->idname, "TextureNodeCombineColor");
1626  break;
1627  }
1629  node->type = TEX_NODE_SEPARATE_COLOR;
1630  node->custom1 = NODE_COMBSEP_COLOR_RGB;
1631  strcpy(node->idname, "TextureNodeSeparateColor");
1632  break;
1633  }
1634  }
1635  }
1636  }
1637 
1638  /* In shader nodes, replace combine/separate RGB/HSV with combine/separate color */
1639  if (ntree->type == NTREE_SHADER) {
1644 
1648 
1653 
1657 
1659  switch (node->type) {
1660  case SH_NODE_COMBRGB_LEGACY: {
1661  node->type = SH_NODE_COMBINE_COLOR;
1663  __func__);
1664  storage->mode = NODE_COMBSEP_COLOR_RGB;
1665  strcpy(node->idname, "ShaderNodeCombineColor");
1666  node->storage = storage;
1667  break;
1668  }
1669  case SH_NODE_COMBHSV_LEGACY: {
1670  node->type = SH_NODE_COMBINE_COLOR;
1672  __func__);
1673  storage->mode = NODE_COMBSEP_COLOR_HSV;
1674  strcpy(node->idname, "ShaderNodeCombineColor");
1675  node->storage = storage;
1676  break;
1677  }
1678  case SH_NODE_SEPRGB_LEGACY: {
1679  node->type = SH_NODE_SEPARATE_COLOR;
1681  __func__);
1682  storage->mode = NODE_COMBSEP_COLOR_RGB;
1683  strcpy(node->idname, "ShaderNodeSeparateColor");
1684  node->storage = storage;
1685  break;
1686  }
1687  case SH_NODE_SEPHSV_LEGACY: {
1688  node->type = SH_NODE_SEPARATE_COLOR;
1690  __func__);
1691  storage->mode = NODE_COMBSEP_COLOR_HSV;
1692  strcpy(node->idname, "ShaderNodeSeparateColor");
1693  node->storage = storage;
1694  break;
1695  }
1696  }
1697  }
1698  }
1699 }
1700 
1702 {
1703  /* Fix bug where curves in image format were not properly copied to file output
1704  * node, incorrectly sharing a pointer with the scene settings. Copy the data
1705  * structure now as it should have been done in the first place. */
1706  if (format->view_settings.curve_mapping) {
1707  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1708  if (format != &scene->r.im_format && ELEM(format->view_settings.curve_mapping,
1711  format->view_settings.curve_mapping = BKE_curvemapping_copy(
1712  format->view_settings.curve_mapping);
1713  break;
1714  }
1715  }
1716 
1717  /* Remove any invalid curves with missing data. */
1718  if (format->view_settings.curve_mapping->cm[0].curve == NULL) {
1719  BKE_curvemapping_free(format->view_settings.curve_mapping);
1720  format->view_settings.curve_mapping = NULL;
1721  format->view_settings.flag &= ~COLORMANAGE_VIEW_USE_CURVES;
1722  }
1723  }
1724 }
1725 
1726 /* NOLINTNEXTLINE: readability-function-size */
1728 {
1729  /* The #SCE_SNAP_SEQ flag has been removed in favor of the #SCE_SNAP which can be used for each
1730  * snap_flag member individually. */
1731  enum { SCE_SNAP_SEQ = (1 << 7) };
1732 
1733  if (!MAIN_VERSION_ATLEAST(bmain, 300, 1)) {
1734  /* Set default value for the new bisect_threshold parameter in the mirror modifier. */
1735  if (!DNA_struct_elem_find(fd->filesdna, "MirrorModifierData", "float", "bisect_threshold")) {
1736  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1737  LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1738  if (md->type == eModifierType_Mirror) {
1740  /* This was the previous hard-coded value. */
1741  mmd->bisect_threshold = 0.001f;
1742  }
1743  }
1744  }
1745  }
1746  /* Grease Pencil: Set default value for dilate pixels. */
1747  if (!DNA_struct_elem_find(fd->filesdna, "BrushGpencilSettings", "int", "dilate_pixels")) {
1748  LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
1749  if (brush->gpencil_settings) {
1750  brush->gpencil_settings->dilate_pixels = 1;
1751  }
1752  }
1753  }
1754  }
1755 
1756  if (!MAIN_VERSION_ATLEAST(bmain, 300, 2)) {
1758 
1759  if (!DNA_struct_elem_find(fd->filesdna, "bPoseChannel", "float", "custom_scale_xyz[3]")) {
1760  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1761  if (ob->pose == NULL) {
1762  continue;
1763  }
1764  LISTBASE_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
1765  copy_v3_fl(pchan->custom_scale_xyz, pchan->custom_scale);
1766  }
1767  }
1768  }
1769  }
1770 
1771  if (!MAIN_VERSION_ATLEAST(bmain, 300, 4)) {
1772  /* Add a properties sidebar to the spreadsheet editor. */
1773  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1774  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1775  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1776  if (sl->spacetype == SPACE_SPREADSHEET) {
1777  ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
1778  &sl->regionbase;
1780  regionbase, RGN_TYPE_UI, "sidebar for spreadsheet", RGN_TYPE_FOOTER);
1781  if (new_sidebar != NULL) {
1782  new_sidebar->alignment = RGN_ALIGN_RIGHT;
1783  new_sidebar->flag |= RGN_FLAG_HIDDEN;
1784  }
1785  }
1786  }
1787  }
1788  }
1789 
1790  /* Enable spreadsheet filtering in old files without row filters. */
1791  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1792  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1793  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1794  if (sl->spacetype == SPACE_SPREADSHEET) {
1795  SpaceSpreadsheet *sspreadsheet = (SpaceSpreadsheet *)sl;
1796  sspreadsheet->filter_flag |= SPREADSHEET_FILTER_ENABLE;
1797  }
1798  }
1799  }
1800  }
1801 
1802  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1803  if (ntree->type == NTREE_GEOMETRY) {
1804  version_node_socket_name(ntree, GEO_NODE_BOUNDING_BOX, "Mesh", "Bounding Box");
1805  }
1806  }
1808 
1809  if (!DNA_struct_elem_find(fd->filesdna, "FileAssetSelectParams", "short", "import_type")) {
1810  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1811  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1812  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1813  if (sl->spacetype == SPACE_FILE) {
1814  SpaceFile *sfile = (SpaceFile *)sl;
1815  if (sfile->asset_params) {
1817  }
1818  }
1819  }
1820  }
1821  }
1822  }
1823 
1824  /* Initialize length-wise scale B-Bone settings. */
1825  if (!DNA_struct_elem_find(fd->filesdna, "Bone", "int", "bbone_flag")) {
1826  /* Update armature data and pose channels. */
1827  LISTBASE_FOREACH (bArmature *, arm, &bmain->armatures) {
1828  do_version_bones_bbone_len_scale(&arm->bonebase);
1829  }
1830 
1831  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1832  if (ob->pose) {
1833  LISTBASE_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
1834  copy_v3_fl3(pchan->scale_in, pchan->scale_in_x, 1.0f, pchan->scale_in_z);
1835  copy_v3_fl3(pchan->scale_out, pchan->scale_out_x, 1.0f, pchan->scale_out_z);
1836  }
1837  }
1838  }
1839 
1840  /* Update action curves and drivers. */
1841  LISTBASE_FOREACH (bAction *, act, &bmain->actions) {
1842  LISTBASE_FOREACH_MUTABLE (FCurve *, fcu, &act->curves) {
1844  }
1845  }
1846 
1848  }
1849  }
1850 
1851  if (!MAIN_VERSION_ATLEAST(bmain, 300, 5)) {
1852  /* Add a dataset sidebar to the spreadsheet editor. */
1853  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1854  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1855  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1856  if (sl->spacetype == SPACE_SPREADSHEET) {
1857  ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
1858  &sl->regionbase;
1859  ARegion *spreadsheet_dataset_region = do_versions_add_region_if_not_found(
1860  regionbase, RGN_TYPE_CHANNELS, "spreadsheet dataset region", RGN_TYPE_FOOTER);
1861 
1862  if (spreadsheet_dataset_region) {
1863  spreadsheet_dataset_region->alignment = RGN_ALIGN_LEFT;
1864  spreadsheet_dataset_region->v2d.scroll = (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM);
1865  }
1866  }
1867  }
1868  }
1869  }
1870  }
1871 
1872  if (!MAIN_VERSION_ATLEAST(bmain, 300, 6)) {
1873  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1874  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1875  LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) {
1876  /* Disable View Layers filter. */
1877  if (space->spacetype == SPACE_OUTLINER) {
1878  SpaceOutliner *space_outliner = (SpaceOutliner *)space;
1879  space_outliner->filter |= SO_FILTER_NO_VIEW_LAYERS;
1880  }
1881  }
1882  }
1883  }
1884  }
1885 
1886  if (!MAIN_VERSION_ATLEAST(bmain, 300, 7)) {
1887  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1888  ToolSettings *tool_settings = scene->toolsettings;
1889  tool_settings->snap_flag |= SCE_SNAP_SEQ;
1890  short snap_mode = tool_settings->snap_mode;
1891  short snap_node_mode = tool_settings->snap_node_mode;
1892  short snap_uv_mode = tool_settings->snap_uv_mode;
1893  tool_settings->snap_mode &= ~((1 << 4) | (1 << 5) | (1 << 6));
1894  tool_settings->snap_node_mode &= ~((1 << 5) | (1 << 6));
1895  tool_settings->snap_uv_mode &= ~(1 << 4);
1896  if (snap_mode & (1 << 4)) {
1897  tool_settings->snap_mode |= (1 << 6); /* SCE_SNAP_MODE_INCREMENT */
1898  }
1899  if (snap_mode & (1 << 5)) {
1900  tool_settings->snap_mode |= (1 << 4); /* SCE_SNAP_MODE_EDGE_MIDPOINT */
1901  }
1902  if (snap_mode & (1 << 6)) {
1903  tool_settings->snap_mode |= (1 << 5); /* SCE_SNAP_MODE_EDGE_PERPENDICULAR */
1904  }
1905  if (snap_node_mode & (1 << 5)) {
1906  tool_settings->snap_node_mode |= (1 << 0); /* SCE_SNAP_MODE_NODE_X */
1907  }
1908  if (snap_node_mode & (1 << 6)) {
1909  tool_settings->snap_node_mode |= (1 << 1); /* SCE_SNAP_MODE_NODE_Y */
1910  }
1911  if (snap_uv_mode & (1 << 4)) {
1912  tool_settings->snap_uv_mode |= (1 << 6); /* SCE_SNAP_MODE_INCREMENT */
1913  }
1914 
1915  SequencerToolSettings *sequencer_tool_settings = SEQ_tool_settings_ensure(scene);
1916  sequencer_tool_settings->snap_mode = SEQ_SNAP_TO_STRIPS | SEQ_SNAP_TO_CURRENT_FRAME |
1918  sequencer_tool_settings->snap_distance = 15;
1919  }
1920  }
1921 
1922  if (!MAIN_VERSION_ATLEAST(bmain, 300, 8)) {
1923  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1924  if (scene->master_collection != NULL) {
1927  sizeof(scene->master_collection->id.name) - 2);
1928  }
1929  }
1930  }
1931 
1932  if (!MAIN_VERSION_ATLEAST(bmain, 300, 9)) {
1933  /* Fix a bug where reordering FCurves and bActionGroups could cause some corruption. Just
1934  * reconstruct all the action groups & ensure that the FCurves of a group are continuously
1935  * stored (i.e. not mixed with other groups) to be sure. See T89435. */
1936  LISTBASE_FOREACH (bAction *, act, &bmain->actions) {
1938  }
1939 
1940  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
1941  if (ntree->type == NTREE_GEOMETRY) {
1943  if (node->type == GEO_NODE_SUBDIVIDE_MESH) {
1944  strcpy(node->idname, "GeometryNodeMeshSubdivide");
1945  }
1946  }
1947  }
1948  }
1950  }
1951 
1952  if (!MAIN_VERSION_ATLEAST(bmain, 300, 10)) {
1953  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1954  ToolSettings *tool_settings = scene->toolsettings;
1955  if (tool_settings->snap_uv_mode & (1 << 4)) {
1956  tool_settings->snap_uv_mode |= (1 << 6); /* SCE_SNAP_MODE_INCREMENT */
1957  tool_settings->snap_uv_mode &= ~(1 << 4);
1958  }
1959  }
1960  LISTBASE_FOREACH (Material *, mat, &bmain->materials) {
1961  if (!(mat->lineart.flags & LRT_MATERIAL_CUSTOM_OCCLUSION_EFFECTIVENESS)) {
1962  mat->lineart.mat_occlusion = 1;
1963  }
1964  }
1965  }
1966 
1967  if (!MAIN_VERSION_ATLEAST(bmain, 300, 13)) {
1968  /* Convert Surface Deform to sparse-capable bind structure. */
1969  if (!DNA_struct_elem_find(
1970  fd->filesdna, "SurfaceDeformModifierData", "int", "num_mesh_verts")) {
1971  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1972  LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
1973  if (md->type == eModifierType_SurfaceDeform) {
1975  if (smd->bind_verts_num && smd->verts) {
1976  smd->mesh_verts_num = smd->bind_verts_num;
1977 
1978  for (unsigned int i = 0; i < smd->bind_verts_num; i++) {
1979  smd->verts[i].vertex_idx = i;
1980  }
1981  }
1982  }
1983  }
1984  if (ob->type == OB_GPENCIL) {
1985  LISTBASE_FOREACH (GpencilModifierData *, md, &ob->greasepencil_modifiers) {
1986  if (md->type == eGpencilModifierType_Lineart) {
1988  lmd->flags |= LRT_GPENCIL_USE_CACHE;
1989  lmd->chain_smooth_tolerance = 0.2f;
1990  }
1991  }
1992  }
1993  }
1994  }
1995 
1996  if (!DNA_struct_elem_find(
1997  fd->filesdna, "WorkSpace", "AssetLibraryReference", "asset_library")) {
1998  LISTBASE_FOREACH (WorkSpace *, workspace, &bmain->workspaces) {
1999  BKE_asset_library_reference_init_default(&workspace->asset_library_ref);
2000  }
2001  }
2002 
2003  if (!DNA_struct_elem_find(
2004  fd->filesdna, "FileAssetSelectParams", "AssetLibraryReference", "asset_library_ref")) {
2005  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
2006  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
2007  LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) {
2008  if (space->spacetype == SPACE_FILE) {
2009  SpaceFile *sfile = (SpaceFile *)space;
2010  if (sfile->browse_mode != FILE_BROWSE_MODE_ASSETS) {
2011  continue;
2012  }
2014  }
2015  }
2016  }
2017  }
2018  }
2019 
2020  /* Set default 2D annotation placement. */
2021  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
2024  }
2025  }
2026 
2027  if (!MAIN_VERSION_ATLEAST(bmain, 300, 14)) {
2028  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
2029  ToolSettings *tool_settings = scene->toolsettings;
2030  tool_settings->snap_flag &= ~SCE_SNAP_SEQ;
2031  }
2032  }
2033 
2034  if (!MAIN_VERSION_ATLEAST(bmain, 300, 15)) {
2035  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
2036  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
2037  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
2038  if (sl->spacetype == SPACE_SEQ) {
2039  SpaceSeq *sseq = (SpaceSeq *)sl;
2040  sseq->flag |= SEQ_TIMELINE_SHOW_GRID;
2041  }
2042  }
2043  }
2044  }
2045  }
2046 
2047  /* Font names were copied directly into ID names, see: T90417. */
2048  if (!MAIN_VERSION_ATLEAST(bmain, 300, 16)) {
2049  ListBase *lb = which_libbase(bmain, ID_VF);
2051  }
2052 
2053  if (!MAIN_VERSION_ATLEAST(bmain, 300, 17)) {
2054  if (!DNA_struct_elem_find(
2055  fd->filesdna, "View3DOverlay", "float", "normals_constant_screen_size")) {
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_VIEW3D) {
2060  View3D *v3d = (View3D *)sl;
2062  }
2063  }
2064  }
2065  }
2066  }
2067 
2068  /* Fix SplineIK constraint's inconsistency between binding points array and its stored size.
2069  */
2070  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
2071  /* NOTE: Objects should never have SplineIK constraint, so no need to apply this fix on
2072  * their constraints. */
2073  if (ob->pose) {
2074  LISTBASE_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
2076  }
2077  }
2078  }
2079  }
2080 
2081  if (!MAIN_VERSION_ATLEAST(bmain, 300, 18)) {
2082  if (!DNA_struct_elem_find(
2083  fd->filesdna, "WorkSpace", "AssetLibraryReference", "asset_library_ref")) {
2084  LISTBASE_FOREACH (WorkSpace *, workspace, &bmain->workspaces) {
2085  BKE_asset_library_reference_init_default(&workspace->asset_library_ref);
2086  }
2087  }
2088 
2089  if (!DNA_struct_elem_find(
2090  fd->filesdna, "FileAssetSelectParams", "AssetLibraryReference", "asset_library_ref")) {
2091  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
2092  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
2093  LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) {
2094  if (space->spacetype != SPACE_FILE) {
2095  continue;
2096  }
2097 
2098  SpaceFile *sfile = (SpaceFile *)space;
2099  if (sfile->browse_mode != FILE_BROWSE_MODE_ASSETS) {
2100  continue;
2101  }
2103  }
2104  }
2105  }
2106  }
2107 
2108  /* Previously, only text ending with `.py` would run, apply this logic
2109  * to existing files so text that happens to have the "Register" enabled
2110  * doesn't suddenly start running code on startup that was previously ignored. */
2111  LISTBASE_FOREACH (Text *, text, &bmain->texts) {
2112  if ((text->flags & TXT_ISSCRIPT) && !BLI_path_extension_check(text->id.name + 2, ".py")) {
2113  text->flags &= ~TXT_ISSCRIPT;
2114  }
2115  }
2116  }
2117 
2118  if (!MAIN_VERSION_ATLEAST(bmain, 300, 19)) {
2119  /* Disable Fade Inactive Overlay by default as it is redundant after introducing flash on
2120  * mode transfer. */
2121  for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
2122  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
2123  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
2124  if (sl->spacetype == SPACE_VIEW3D) {
2125  View3D *v3d = (View3D *)sl;
2127  }
2128  }
2129  }
2130  }
2131 
2132  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
2133  SequencerToolSettings *sequencer_tool_settings = SEQ_tool_settings_ensure(scene);
2134  sequencer_tool_settings->overlap_mode = SEQ_OVERLAP_SHUFFLE;
2135  }
2136  }
2137 
2138  if (!MAIN_VERSION_ATLEAST(bmain, 300, 20)) {
2139  /* Use new vector Size socket in Cube Mesh Primitive node. */
2140  LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
2141  if (ntree->type != NTREE_GEOMETRY) {
2142  continue;
2143  }
2144 
2146  if (link->tonode->type == GEO_NODE_MESH_PRIMITIVE_CUBE) {
2147  bNode *node = link->tonode;
2148  if (STREQ(link->tosock->identifier, "Size") && link->tosock->type == SOCK_FLOAT) {
2149  bNode *link_fromnode = link->fromnode;
2150  bNodeSocket *link_fromsock = link->fromsock;
2151  bNodeSocket *socket = link->tosock;
2152  BLI_assert(socket);
2153 
2155  ntree, node, socket);
2156  nodeAddLink(ntree, link_fromnode, link_fromsock, node, new_socket);
2157  }
2158  }
2159  }
2160 
2162  if (node->type != GEO_NODE_MESH_PRIMITIVE_CUBE) {
2163  continue;
2164  }
2165  LISTBASE_FOREACH (bNodeSocket *, socket, &node->inputs) {
2166  if (STREQ(socket->identifier, "Size") && (socket->type == SOCK_FLOAT)) {
2168  break;
2169  }
2170  }
2171  }
2172  }
2173  }
2174 
2175  if (!MAIN_VERSION_ATLEAST(bmain, 300, 22)) {
2176  if (!DNA_struct_elem_find(
2177  fd->filesdna, "LineartGpencilModifierData", "bool", "use_crease_on_smooth")) {
2178  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
2179  if (ob->type == OB_GPENCIL) {
2180  LISTBASE_FOREACH (GpencilModifierData *, md, &ob->greasepencil_modifiers) {
2181  if (md->type == eGpencilModifierType_Lineart) {
2184  }
2185  }
2186  }
2187  }
2188  }
2189  }
2190 
2191  if (!MAIN_VERSION_ATLEAST(bmain, 300, 23)) {
2192  for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
2193  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
2194  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
2195  if (sl->spacetype == SPACE_FILE) {
2196  SpaceFile *sfile = (SpaceFile *)sl;
2197  if (sfile->asset_params) {
2199  }
2200  }
2201  }
2202  }
2203  }
2204 
2205  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
2206  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
2207  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
2208  if (sl->spacetype == SPACE_SEQ) {
2209  SpaceSeq *sseq = (SpaceSeq *)sl;
2210  int seq_show_safe_margins = (sseq->flag & SEQ_PREVIEW_SHOW_SAFE_MARGINS);
2211  int seq_show_gpencil = (sseq->flag & SEQ_PREVIEW_SHOW_GPENCIL);
2212  int seq_show_fcurves = (sseq->flag & SEQ_TIMELINE_SHOW_FCURVES);
2213  int seq_show_safe_center = (sseq->flag & SEQ_PREVIEW_SHOW_SAFE_CENTER);
2214  int seq_show_metadata = (sseq->flag & SEQ_PREVIEW_SHOW_METADATA);
2215  int seq_show_strip_name = (sseq->flag & SEQ_TIMELINE_SHOW_STRIP_NAME);
2216  int seq_show_strip_source = (sseq->flag & SEQ_TIMELINE_SHOW_STRIP_SOURCE);
2217  int seq_show_strip_duration = (sseq->flag & SEQ_TIMELINE_SHOW_STRIP_DURATION);
2218  int seq_show_grid = (sseq->flag & SEQ_TIMELINE_SHOW_GRID);
2219  int show_strip_offset = (sseq->draw_flag & SEQ_TIMELINE_SHOW_STRIP_OFFSETS);
2220  sseq->preview_overlay.flag = (seq_show_safe_margins | seq_show_gpencil |
2221  seq_show_safe_center | seq_show_metadata);
2222  sseq->timeline_overlay.flag = (seq_show_fcurves | seq_show_strip_name |
2223  seq_show_strip_source | seq_show_strip_duration |
2224  seq_show_grid | show_strip_offset);
2225  }
2226  }
2227  }
2228  }
2229  }
2230 
2231  if (!MAIN_VERSION_ATLEAST(bmain, 300, 24)) {
2232  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
2233  SequencerToolSettings *sequencer_tool_settings = SEQ_tool_settings_ensure(scene);
2234  sequencer_tool_settings->pivot_point = V3D_AROUND_CENTER_MEDIAN;
2235 
2236  if (scene->ed != NULL) {
2238  }
2239  }
2240  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
2241  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
2242  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
2243  if (sl->spacetype == SPACE_SEQ) {
2244  SpaceSeq *sseq = (SpaceSeq *)sl;
2246  }
2247  }
2248  }
2249  }
2250 
2251  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
2252  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
2253  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
2254  if (sl->spacetype == SPACE_SEQ) {
2255  ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
2256  &sl->regionbase;
2257  LISTBASE_FOREACH (ARegion *, region, regionbase) {
2258  if (region->regiontype == RGN_TYPE_WINDOW) {
2259  region->v2d.min[1] = 4.0f;
2260  }
2261  }
2262  }
2263  }
2264  }
2265  }
2266  }
2267 
2268  if (!MAIN_VERSION_ATLEAST(bmain, 300, 25)) {
2269  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
2270  if (ntree->type == NTREE_SHADER) {
2273  }
2274  }
2275  }
2277 
2278  enum {
2279  R_EXR_TILE_FILE = (1 << 10),
2280  R_FULL_SAMPLE = (1 << 15),
2281  };
2282  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
2283  scene->r.scemode &= ~(R_EXR_TILE_FILE | R_FULL_SAMPLE);
2284  }
2285  }
2286 
2287  if (!MAIN_VERSION_ATLEAST(bmain, 300, 26)) {
2288  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
2289  LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
2290  if (md->type == eModifierType_Nodes) {
2292  }
2293  }
2294  }
2295 
2296  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
2297  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
2298  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
2299  switch (sl->spacetype) {
2300  case SPACE_FILE: {
2301  SpaceFile *sfile = (SpaceFile *)sl;
2302  if (sfile->params) {
2305  }
2306 
2307  /* New default import type: Append with reuse. */
2308  if (sfile->asset_params) {
2310  }
2311  break;
2312  }
2313  default:
2314  break;
2315  }
2316  }
2317  }
2318  }
2319  }
2320 
2321  if (!MAIN_VERSION_ATLEAST(bmain, 300, 29)) {
2322  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
2323  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
2324  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
2325  switch (sl->spacetype) {
2326  case SPACE_SEQ: {
2327  ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
2328  &sl->regionbase;
2329  LISTBASE_FOREACH (ARegion *, region, regionbase) {
2330  if (region->regiontype == RGN_TYPE_WINDOW) {
2331  region->v2d.max[1] = MAXSEQ;
2332  }
2333  }
2334  break;
2335  }
2336  case SPACE_IMAGE: {
2337  SpaceImage *sima = (SpaceImage *)sl;
2338  sima->custom_grid_subdiv = 10;
2339  break;
2340  }
2341  }
2342  }
2343  }
2344  }
2345  }
2346 
2347  if (!MAIN_VERSION_ATLEAST(bmain, 300, 31)) {
2348  /* Swap header with the tool header so the regular header is always on the edge. */
2349  for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
2350  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
2351  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
2352  ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
2353  &sl->regionbase;
2354  ARegion *region_tool = NULL, *region_head = NULL;
2355  int region_tool_index = -1, region_head_index = -1, i;
2356  LISTBASE_FOREACH_INDEX (ARegion *, region, regionbase, i) {
2357  if (region->regiontype == RGN_TYPE_TOOL_HEADER) {
2358  region_tool = region;
2359  region_tool_index = i;
2360  }
2361  else if (region->regiontype == RGN_TYPE_HEADER) {
2362  region_head = region;
2363  region_head_index = i;
2364  }
2365  }
2366  if ((region_tool && region_head) && (region_head_index > region_tool_index)) {
2367  BLI_listbase_swaplinks(regionbase, region_tool, region_head);
2368  }
2369  }
2370  }
2371  }
2372 
2373  /* Set strip color tags to SEQUENCE_COLOR_NONE. */
2374  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
2375  if (scene->ed != NULL) {
2377  }
2378  }
2379 
2380  /* Show sequencer color tags by default. */
2381  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
2382  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
2383  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
2384  if (sl->spacetype == SPACE_SEQ) {
2385  SpaceSeq *sseq = (SpaceSeq *)sl;
2387  }
2388  }
2389  }
2390  }
2391 
2392  /* Set defaults for new color balance modifier parameters. */
2393  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
2394  if (scene->ed != NULL) {
2396  }
2397  }
2398  }
2399 
2400  if (!MAIN_VERSION_ATLEAST(bmain, 300, 33)) {
2401  for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
2402  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
2403  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
2404  switch (sl->spacetype) {
2405  case SPACE_SEQ: {
2406  SpaceSeq *sseq = (SpaceSeq *)sl;
2407  enum { SEQ_DRAW_SEQUENCE = 0 };
2408  if (sseq->mainb == SEQ_DRAW_SEQUENCE) {
2409  sseq->mainb = SEQ_DRAW_IMG_IMBUF;
2410  }
2411  break;
2412  }
2413  case SPACE_TEXT: {
2414  SpaceText *st = (SpaceText *)sl;
2415  st->flags &= ~ST_FLAG_UNUSED_4;
2416  break;
2417  }
2418  }
2419  }
2420  }
2421  }
2422  }
2423 
2424  if (!MAIN_VERSION_ATLEAST(bmain, 300, 36)) {
2425  /* Update the `idnames` for renamed geometry and function nodes. */
2426  LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
2427  if (ntree->type != NTREE_GEOMETRY) {
2428  continue;
2429  }
2430  version_node_id(ntree, FN_NODE_COMPARE, "FunctionNodeCompareFloats");
2431  version_node_id(ntree, GEO_NODE_CAPTURE_ATTRIBUTE, "GeometryNodeCaptureAttribute");
2432  version_node_id(ntree, GEO_NODE_MESH_BOOLEAN, "GeometryNodeMeshBoolean");
2433  version_node_id(ntree, GEO_NODE_FILL_CURVE, "GeometryNodeFillCurve");
2434  version_node_id(ntree, GEO_NODE_FILLET_CURVE, "GeometryNodeFilletCurve");
2435  version_node_id(ntree, GEO_NODE_REVERSE_CURVE, "GeometryNodeReverseCurve");
2436  version_node_id(ntree, GEO_NODE_SAMPLE_CURVE, "GeometryNodeSampleCurve");
2437  version_node_id(ntree, GEO_NODE_RESAMPLE_CURVE, "GeometryNodeResampleCurve");
2438  version_node_id(ntree, GEO_NODE_SUBDIVIDE_CURVE, "GeometryNodeSubdivideCurve");
2439  version_node_id(ntree, GEO_NODE_TRIM_CURVE, "GeometryNodeTrimCurve");
2440  version_node_id(ntree, GEO_NODE_REPLACE_MATERIAL, "GeometryNodeReplaceMaterial");
2441  version_node_id(ntree, GEO_NODE_SUBDIVIDE_MESH, "GeometryNodeSubdivideMesh");
2442  version_node_id(ntree, GEO_NODE_SET_MATERIAL, "GeometryNodeSetMaterial");
2443  version_node_id(ntree, GEO_NODE_SPLIT_EDGES, "GeometryNodeSplitEdges");
2444  }
2445 
2446  /* Update bone roll after a fix to vec_roll_to_mat3_normalized. */
2447  LISTBASE_FOREACH (bArmature *, arm, &bmain->armatures) {
2448  do_version_bones_roll(&arm->bonebase);
2449  }
2450  }
2451 
2452  if (!MAIN_VERSION_ATLEAST(bmain, 300, 37)) {
2453  /* Node Editor: toggle overlays on. */
2454  if (!DNA_struct_find(fd->filesdna, "SpaceNodeOverlay")) {
2455  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
2456  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
2457  LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) {
2458  if (space->spacetype == SPACE_NODE) {
2459  SpaceNode *snode = (SpaceNode *)space;
2462  }
2463  }
2464  }
2465  }
2466  }
2467  }
2468 
2469  if (!MAIN_VERSION_ATLEAST(bmain, 300, 38)) {
2470  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
2471  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
2472  LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) {
2473  if (space->spacetype == SPACE_FILE) {
2474  SpaceFile *sfile = (SpaceFile *)space;
2475  FileAssetSelectParams *asset_params = sfile->asset_params;
2476  if (asset_params) {
2477  asset_params->base_params.filter_id = FILTER_ID_ALL;
2478  }
2479  }
2480  }
2481  }
2482  }
2483  }
2484 
2485  if (!MAIN_VERSION_ATLEAST(bmain, 300, 39)) {
2486  LISTBASE_FOREACH (wmWindowManager *, wm, &bmain->wm) {
2487  wm->xr.session_settings.base_scale = 1.0f;
2488  wm->xr.session_settings.draw_flags |= (V3D_OFSDRAW_SHOW_SELECTION |
2491  }
2492  }
2493 
2494  if (!MAIN_VERSION_ATLEAST(bmain, 300, 40)) {
2495  /* Update the `idnames` for renamed geometry and function nodes. */
2496  LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
2497  if (ntree->type != NTREE_GEOMETRY) {
2498  continue;
2499  }
2500  version_node_id(ntree, FN_NODE_SLICE_STRING, "FunctionNodeSliceString");
2502  }
2503 
2504  /* Add storage to viewer node. */
2505  LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
2506  if (ntree->type != NTREE_GEOMETRY) {
2507  continue;
2508  }
2510  if (node->type == GEO_NODE_VIEWER) {
2511  if (node->storage == NULL) {
2513  sizeof(NodeGeometryViewer), __func__);
2514  data->data_type = CD_PROP_FLOAT;
2515  node->storage = data;
2516  }
2517  }
2518  }
2519  }
2520 
2521  LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
2522  if (ntree->type == NTREE_GEOMETRY) {
2524  ntree, GEO_NODE_DISTRIBUTE_POINTS_ON_FACES, "Geometry", "Mesh");
2533  version_node_socket_name(ntree, GEO_NODE_TRANSLATE_INSTANCES, "Geometry", "Instances");
2534  version_node_socket_name(ntree, GEO_NODE_ROTATE_INSTANCES, "Geometry", "Instances");
2535  version_node_socket_name(ntree, GEO_NODE_SCALE_INSTANCES, "Geometry", "Instances");
2540  version_node_socket_name(ntree, GEO_NODE_TRIANGULATE, "Geometry", "Mesh");
2544  ntree, GEO_NODE_MESH_PRIMITIVE_CYLINDER, "Geometry", "Mesh");
2547  ntree, GEO_NODE_MESH_PRIMITIVE_ICO_SPHERE, "Geometry", "Mesh");
2551  ntree, GEO_NODE_MESH_PRIMITIVE_UV_SPHERE, "Geometry", "Mesh");
2553  }
2554  }
2555  }
2556 
2557  if (!MAIN_VERSION_ATLEAST(bmain, 300, 42)) {
2558  /* Use consistent socket identifiers for the math node.
2559  * The code to make unique identifiers from the names was inconsistent. */
2560  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
2561  if (ntree->type != NTREE_CUSTOM) {
2563  }
2564  }
2566 
2567  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
2568  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
2569  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
2570  if (sl->spacetype == SPACE_SEQ) {
2571  ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
2572  &sl->regionbase;
2573  LISTBASE_FOREACH (ARegion *, region, regionbase) {
2574  if (region->regiontype == RGN_TYPE_WINDOW) {
2575  region->v2d.min[1] = 1.0f;
2576  }
2577  }
2578  }
2579  }
2580  }
2581  }
2582 
2583  /* Change minimum zoom to 0.05f in the node editor. */
2584  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
2585  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
2586  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
2587  if (sl->spacetype == SPACE_NODE) {
2588  ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
2589  &sl->regionbase;
2590  LISTBASE_FOREACH (ARegion *, region, regionbase) {
2591  if (region->regiontype == RGN_TYPE_WINDOW) {
2592  if (region->v2d.minzoom > 0.05f) {
2593  region->v2d.minzoom = 0.05f;
2594  }
2595  }
2596  }
2597  }
2598  }
2599  }
2600  }
2601  }
2602 
2603  /* Special case to handle older in-development 3.1 files, before change from 3.0 branch gets
2604  * merged in master. */
2605  if (!MAIN_VERSION_ATLEAST(bmain, 300, 42) ||
2606  (bmain->versionfile == 301 && !MAIN_VERSION_ATLEAST(bmain, 301, 3))) {
2607  /* Update LibOverride operations regarding insertions in RNA collections (i.e. modifiers,
2608  * constraints and NLA tracks). */
2609  ID *id_iter;
2610  FOREACH_MAIN_ID_BEGIN (bmain, id_iter) {
2611  if (ID_IS_OVERRIDE_LIBRARY_REAL(id_iter)) {
2613  if (GS(id_iter->name) == ID_OB) {
2615  }
2616  }
2617  }
2619  }
2620 
2621  if (!MAIN_VERSION_ATLEAST(bmain, 301, 4)) {
2622  LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
2623  if (ntree->type != NTREE_GEOMETRY) {
2624  continue;
2625  }
2626  version_node_id(ntree, GEO_NODE_CURVE_SPLINE_PARAMETER, "GeometryNodeSplineParameter");
2628  if (node->type == GEO_NODE_CURVE_SPLINE_PARAMETER) {
2630  ntree, node, SOCK_OUT, SOCK_INT, PROP_NONE, "Index", "Index");
2631  }
2632 
2633  /* Convert float compare into a more general compare node. */
2634  if (node->type == FN_NODE_COMPARE) {
2635  if (node->storage == NULL) {
2637  sizeof(NodeFunctionCompare), __func__);
2638  data->data_type = SOCK_FLOAT;
2639  data->operation = node->custom1;
2640  strcpy(node->idname, "FunctionNodeCompare");
2641  node->storage = data;
2642  }
2643  }
2644  }
2645  }
2646 
2647  /* Add a toggle for the breadcrumbs overlay in the node editor. */
2648  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
2649  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
2650  LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) {
2651  if (space->spacetype == SPACE_NODE) {
2652  SpaceNode *snode = (SpaceNode *)space;
2653  snode->overlay.flag |= SN_OVERLAY_SHOW_PATH;
2654  }
2655  }
2656  }
2657  }
2658  }
2659 
2660  if (!MAIN_VERSION_ATLEAST(bmain, 301, 5)) {
2661  LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
2662  if (ntree->type != NTREE_GEOMETRY) {
2663  continue;
2664  }
2666  if (node->type != GEO_NODE_REALIZE_INSTANCES) {
2667  continue;
2668  }
2670  }
2671  }
2672  }
2673 
2674  if (!MAIN_VERSION_ATLEAST(bmain, 301, 6)) {
2675  /* Add node storage for map range node. */
2676  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
2678  if (node->type == SH_NODE_MAP_RANGE) {
2679  if (node->storage == NULL) {
2680  NodeMapRange *data = MEM_callocN(sizeof(NodeMapRange), __func__);
2681  data->clamp = node->custom1;
2682  data->data_type = CD_PROP_FLOAT;
2683  data->interpolation_type = node->custom2;
2684  node->storage = data;
2685  }
2686  }
2687  }
2688  }
2690 
2691  /* Update spreadsheet data set region type. */
2692  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
2693  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
2694  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
2695  if (sl->spacetype == SPACE_SPREADSHEET) {
2696  ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
2697  &sl->regionbase;
2698  LISTBASE_FOREACH (ARegion *, region, regionbase) {
2699  if (region->regiontype == RGN_TYPE_CHANNELS) {
2700  region->regiontype = RGN_TYPE_TOOLS;
2701  }
2702  }
2703  }
2704  }
2705  }
2706  }
2707 
2708  /* Initialize the bone wireframe opacity setting. */
2709  if (!DNA_struct_elem_find(fd->filesdna, "View3DOverlay", "float", "bone_wire_alpha")) {
2710  for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
2711  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
2712  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
2713  if (sl->spacetype == SPACE_VIEW3D) {
2714  View3D *v3d = (View3D *)sl;
2715  v3d->overlay.bone_wire_alpha = 1.0f;
2716  }
2717  }
2718  }
2719  }
2720  }
2721 
2722  /* Rename sockets on multiple nodes */
2723  LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
2724  if (ntree->type == NTREE_GEOMETRY) {
2726  ntree, GEO_NODE_STRING_TO_CURVES, "Curves", "Curve Instances");
2728  ntree, GEO_NODE_INPUT_MESH_EDGE_ANGLE, "Angle", "Unsigned Angle");
2730  ntree, GEO_NODE_INPUT_MESH_ISLAND, "Index", "Island Index");
2732  }
2733  }
2734  }
2735 
2736  if (!MAIN_VERSION_ATLEAST(bmain, 301, 7) ||
2737  (bmain->versionfile == 302 && !MAIN_VERSION_ATLEAST(bmain, 302, 4))) {
2738  /* Duplicate value for two flags that mistakenly had the same numeric value. */
2739  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
2740  LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
2741  if (md->type == eModifierType_WeightVGProximity) {
2745  }
2746  }
2747  }
2748  }
2749  }
2750 
2751  if (!MAIN_VERSION_ATLEAST(bmain, 302, 2)) {
2752  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
2753  if (scene->ed != NULL) {
2755  }
2756  }
2757  }
2758 
2759  if (!MAIN_VERSION_ATLEAST(bmain, 302, 6)) {
2760  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
2762  if (ts->uv_relax_method == 0) {
2764  }
2765  }
2766  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
2767  ToolSettings *tool_settings = scene->toolsettings;
2768  tool_settings->snap_flag_seq = tool_settings->snap_flag & ~(SCE_SNAP | SCE_SNAP_SEQ);
2769  if (tool_settings->snap_flag & SCE_SNAP_SEQ) {
2770  tool_settings->snap_flag_seq |= SCE_SNAP;
2771  tool_settings->snap_flag &= ~SCE_SNAP_SEQ;
2772  }
2773 
2774  tool_settings->snap_flag_node = tool_settings->snap_flag;
2775  tool_settings->snap_uv_flag |= tool_settings->snap_flag & SCE_SNAP;
2776  }
2777 
2778  /* Alter NURBS knot mode flags to fit new modes. */
2779  LISTBASE_FOREACH (Curve *, curve, &bmain->curves) {
2780  LISTBASE_FOREACH (Nurb *, nurb, &curve->nurb) {
2781  /* Previously other flags were ignored if CU_NURB_CYCLIC is set. */
2782  if (nurb->flagu & CU_NURB_CYCLIC) {
2783  nurb->flagu = CU_NURB_CYCLIC;
2784  }
2785  /* CU_NURB_BEZIER and CU_NURB_ENDPOINT were ignored if combined. */
2786  else if (nurb->flagu & CU_NURB_BEZIER && nurb->flagu & CU_NURB_ENDPOINT) {
2787  nurb->flagu &= ~(CU_NURB_BEZIER | CU_NURB_ENDPOINT);
2788  BKE_nurb_knot_calc_u(nurb);
2789  }
2790  /* Bezier NURBS of order 3 were clamped to first control point. */
2791  else if (nurb->orderu == 3 && (nurb->flagu & CU_NURB_BEZIER)) {
2792  nurb->flagu |= CU_NURB_ENDPOINT;
2793  }
2794 
2795  /* Previously other flags were ignored if CU_NURB_CYCLIC is set. */
2796  if (nurb->flagv & CU_NURB_CYCLIC) {
2797  nurb->flagv = CU_NURB_CYCLIC;
2798  }
2799  /* CU_NURB_BEZIER and CU_NURB_ENDPOINT were ignored if used together. */
2800  else if (nurb->flagv & CU_NURB_BEZIER && nurb->flagv & CU_NURB_ENDPOINT) {
2801  nurb->flagv &= ~(CU_NURB_BEZIER | CU_NURB_ENDPOINT);
2802  BKE_nurb_knot_calc_v(nurb);
2803  }
2804  /* Bezier NURBS of order 3 were clamped to first control point. */
2805  else if (nurb->orderv == 3 && (nurb->flagv & CU_NURB_BEZIER)) {
2806  nurb->flagv |= CU_NURB_ENDPOINT;
2807  }
2808  }
2809  }
2810 
2811  /* Change grease pencil smooth iterations to match old results with new algorithm. */
2812  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
2813  LISTBASE_FOREACH (GpencilModifierData *, md, &ob->greasepencil_modifiers) {
2814  if (md->type == eGpencilModifierType_Smooth) {
2816  if (gpmd->step == 1 && gpmd->factor <= 0.5f) {
2817  gpmd->factor *= 2.0f;
2818  }
2819  else {
2820  gpmd->step = 1 + (int)(gpmd->factor * max_ff(0.0f,
2821  min_ff(5.1f * sqrtf(gpmd->step) - 3.0f,
2822  gpmd->step + 2.0f)));
2823  gpmd->factor = 1.0f;
2824  }
2825  }
2826  }
2827  }
2828  }
2829 
2830  /* Rebuild active/render color attribute references. */
2831  if (!MAIN_VERSION_ATLEAST(bmain, 302, 6)) {
2832  LISTBASE_FOREACH (Brush *, br, &bmain->brushes) {
2833  /* Buggy code in wm_toolsystem broke smear in old files,
2834  * reset to defaults. */
2835  if (br->sculpt_tool == SCULPT_TOOL_SMEAR) {
2836  br->alpha = 1.0f;
2837  br->spacing = 5;
2838  br->flag &= ~BRUSH_ALPHA_PRESSURE;
2839  br->flag &= ~BRUSH_SPACE_ATTEN;
2840  br->curve_preset = BRUSH_CURVE_SPHERE;
2841  }
2842  }
2843 
2844  LISTBASE_FOREACH (Mesh *, me, &bmain->meshes) {
2845  for (int step = 0; step < 2; step++) {
2846  CustomDataLayer *actlayer = NULL;
2847 
2848  int vact1, vact2;
2849 
2850  if (step) {
2851  vact1 = CustomData_get_render_layer_index(&me->vdata, CD_PROP_COLOR);
2853  }
2854  else {
2855  vact1 = CustomData_get_active_layer_index(&me->vdata, CD_PROP_COLOR);
2857  }
2858 
2859  if (vact1 != -1) {
2860  actlayer = me->vdata.layers + vact1;
2861  }
2862  else if (vact2 != -1) {
2863  actlayer = me->ldata.layers + vact2;
2864  }
2865 
2866  if (actlayer) {
2867  if (step) {
2868  BKE_id_attributes_render_color_set(&me->id, actlayer);
2869  }
2870  else {
2871  BKE_id_attributes_active_color_set(&me->id, actlayer);
2872  }
2873  }
2874  }
2875  }
2876  }
2877 
2878  if (!MAIN_VERSION_ATLEAST(bmain, 302, 7)) {
2879  /* Generate 'system' liboverrides IDs.
2880  * NOTE: This is a fairly rough process, based on very basic heuristics. Should be enough for a
2881  * do_version code though, this is a new optional feature, not a critical conversion. */
2882  ID *id;
2883  FOREACH_MAIN_ID_BEGIN (bmain, id) {
2884  if (!ID_IS_OVERRIDE_LIBRARY_REAL(id) || ID_IS_LINKED(id)) {
2885  /* Ignore non-real liboverrides, and linked ones. */
2886  continue;
2887  }
2888  if (GS(id->name) == ID_OB) {
2889  /* Never 'lock' an object into a system override for now. */
2890  continue;
2891  }
2893  /* Do not 'lock' an ID already edited by the user. */
2894  continue;
2895  }
2896  id->override_library->flag |= IDOVERRIDE_LIBRARY_FLAG_SYSTEM_DEFINED;
2897  }
2899 
2900  /* Initialize brush curves sculpt settings. */
2901  LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
2902  if (brush->ob_mode != OB_MODE_SCULPT_CURVES) {
2903  continue;
2904  }
2905  if (brush->curves_sculpt_settings != NULL) {
2906  continue;
2907  }
2908  brush->curves_sculpt_settings = MEM_callocN(sizeof(BrushCurvesSculptSettings), __func__);
2909  brush->curves_sculpt_settings->add_amount = 1;
2910  }
2911 
2912  for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
2913  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
2914  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
2915  if (sl->spacetype == SPACE_OUTLINER) {
2916  SpaceOutliner *space_outliner = (SpaceOutliner *)sl;
2917  space_outliner->filter &= ~SO_FILTER_CLEARED_1;
2918  }
2919  }
2920  }
2921  }
2922  }
2923 
2924  if (!MAIN_VERSION_ATLEAST(bmain, 302, 9)) {
2925  /* Sequencer channels region. */
2926  for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
2927  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
2928  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
2929  if (sl->spacetype != SPACE_SEQ) {
2930  continue;
2931  }
2933  continue;
2934  }
2935 
2936  ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
2937  &sl->regionbase;
2939  if (!region) {
2940  /* Find sequencer tools region. */
2941  ARegion *tools_region = BKE_region_find_in_listbase_by_type(regionbase,
2942  RGN_TYPE_TOOLS);
2943  region = do_versions_add_region(RGN_TYPE_CHANNELS, "channels region");
2944  BLI_insertlinkafter(regionbase, tools_region, region);
2945  region->alignment = RGN_ALIGN_LEFT;
2946  region->v2d.flag |= V2D_VIEWSYNC_AREA_VERTICAL;
2947  }
2948 
2949  ARegion *timeline_region = BKE_region_find_in_listbase_by_type(regionbase,
2950  RGN_TYPE_WINDOW);
2951  if (timeline_region != NULL) {
2952  timeline_region->v2d.flag |= V2D_VIEWSYNC_AREA_VERTICAL;
2953  }
2954  }
2955  }
2956  }
2957 
2958  /* Initialize channels. */
2959  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
2960  Editing *ed = SEQ_editing_get(scene);
2961  if (ed == NULL) {
2962  continue;
2963  }
2966 
2967  ed->displayed_channels = &ed->channels;
2968 
2969  ListBase *previous_channels = &ed->channels;
2970  LISTBASE_FOREACH (MetaStack *, ms, &ed->metastack) {
2971  ms->old_channels = previous_channels;
2972  previous_channels = &ms->parseq->channels;
2973  /* If `MetaStack` exists, active channels must point to last link. */
2974  ed->displayed_channels = &ms->parseq->channels;
2975  }
2976  }
2977  }
2978 
2979  if (!MAIN_VERSION_ATLEAST(bmain, 302, 10)) {
2980  for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
2981  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
2982  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
2983  if (sl->spacetype != SPACE_FILE) {
2984  continue;
2985  }
2986  SpaceFile *sfile = (SpaceFile *)sl;
2987  if (sfile->browse_mode != FILE_BROWSE_MODE_ASSETS) {
2988  continue;
2989  }
2991  }
2992  }
2993  }
2994 
2995  /* While vertex-colors were experimental the smear tool became corrupt due
2996  * to bugs in the wm_toolsystem API (auto-creation of sculpt brushes
2997  * was broken). Go through and reset all smear brushes. */
2998  LISTBASE_FOREACH (Brush *, br, &bmain->brushes) {
2999  if (br->sculpt_tool == SCULPT_TOOL_SMEAR) {
3000  br->alpha = 1.0f;
3001  br->spacing = 5;
3002  br->flag &= ~BRUSH_ALPHA_PRESSURE;
3003  br->flag &= ~BRUSH_SPACE_ATTEN;
3004  br->curve_preset = BRUSH_CURVE_SPHERE;
3005  }
3006  }
3007 
3008  /* Rebuild active/render color attribute references. */
3009  LISTBASE_FOREACH (Mesh *, me, &bmain->meshes) {
3010  for (int step = 0; step < 2; step++) {
3011  CustomDataLayer *actlayer = NULL;
3012 
3013  int vact1, vact2;
3014 
3015  if (step) {
3016  vact1 = CustomData_get_render_layer_index(&me->vdata, CD_PROP_COLOR);
3018  }
3019  else {
3020  vact1 = CustomData_get_active_layer_index(&me->vdata, CD_PROP_COLOR);
3022  }
3023 
3024  if (vact1 != -1) {
3025  actlayer = me->vdata.layers + vact1;
3026  }
3027  else if (vact2 != -1) {
3028  actlayer = me->ldata.layers + vact2;
3029  }
3030 
3031  if (actlayer) {
3032  if (step) {
3033  BKE_id_attributes_render_color_set(&me->id, actlayer);
3034  }
3035  else {
3036  BKE_id_attributes_active_color_set(&me->id, actlayer);
3037  }
3038  }
3039  }
3040  }
3041 
3042  /* Update data transfer modifiers */
3043  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
3044  LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
3045  if (md->type == eModifierType_DataTransfer) {
3047 
3048  for (int i = 0; i < DT_MULTILAYER_INDEX_MAX; i++) {
3049  if (dtmd->layers_select_src[i] == 0) {
3051  }
3052 
3053  if (dtmd->layers_select_dst[i] == 0) {
3055  }
3056  }
3057  }
3058  }
3059  }
3060  }
3061 
3062  if (!MAIN_VERSION_ATLEAST(bmain, 302, 12)) {
3063  /* UV/Image show background grid option. */
3064  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
3065  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
3066  LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) {
3067  if (space->spacetype == SPACE_IMAGE) {
3068  SpaceImage *sima = (SpaceImage *)space;
3070  }
3071  }
3072  }
3073  }
3074 
3075  /* Add node storage for the merge by distance node. */
3076  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
3077  if (ntree->type == NTREE_GEOMETRY) {
3079  if (node->type == GEO_NODE_MERGE_BY_DISTANCE) {
3080  if (node->storage == NULL) {
3082  __func__);
3084  node->storage = data;
3085  }
3086  }
3087  }
3088  }
3089  }
3091 
3092  LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
3093  if (ntree->type == NTREE_GEOMETRY) {
3095  ntree, GEO_NODE_SUBDIVISION_SURFACE, "Crease", "Edge Crease");
3096  }
3097  }
3098  }
3099 
3100  if (!MAIN_VERSION_ATLEAST(bmain, 302, 13)) {
3101  /* Enable named attributes overlay in node editor. */
3102  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
3103  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
3104  LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) {
3105  if (space->spacetype == SPACE_NODE) {
3106  SpaceNode *snode = (SpaceNode *)space;
3108  }
3109  }
3110  }
3111  }
3112 
3113  LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
3114  BrushCurvesSculptSettings *settings = brush->curves_sculpt_settings;
3115  if (settings == NULL) {
3116  continue;
3117  }
3118  if (settings->curve_length == 0.0f) {
3119  settings->curve_length = 0.3f;
3120  }
3121  }
3122  }
3123 
3124  if (!MAIN_VERSION_ATLEAST(bmain, 302, 14)) {
3125  /* Compensate for previously wrong squared distance. */
3126  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
3128  }
3129  }
3130 
3131  if (!MAIN_VERSION_ATLEAST(bmain, 303, 1)) {
3132  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
3134  }
3136 
3137  /* Initialize brush curves sculpt settings. */
3138  LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
3139  if (brush->ob_mode != OB_MODE_SCULPT_CURVES) {
3140  continue;
3141  }
3142  if (brush->curves_sculpt_settings->points_per_curve == 0) {
3143  brush->curves_sculpt_settings->points_per_curve = 8;
3144  }
3145  }
3146 
3147  /* UDIM Packing. */
3148  if (!DNA_struct_elem_find(fd->filesdna, "ImagePackedFile", "int", "tile_number")) {
3149  for (Image *ima = bmain->images.first; ima; ima = ima->id.next) {
3150  int view;
3151  LISTBASE_FOREACH_INDEX (ImagePackedFile *, imapf, &ima->packedfiles, view) {
3152  imapf->view = view;
3153  imapf->tile_number = 1001;
3154  }
3155  }
3156  }
3157 
3158  /* Merge still offsets into start/end offsets. */
3159  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
3160  Editing *ed = SEQ_editing_get(scene);
3161  if (ed != NULL) {
3163  }
3164  }
3165 
3166  /* Use the curves type enum for the set spline type node, instead of a special one. */
3167  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
3168  if (ntree->type == NTREE_GEOMETRY) {
3170  if (node->type == GEO_NODE_CURVE_SPLINE_TYPE) {
3172  switch (storage->spline_type) {
3173  case 0: /* GEO_NODE_SPLINE_TYPE_BEZIER */
3174  storage->spline_type = CURVE_TYPE_BEZIER;
3175  break;
3176  case 1: /* GEO_NODE_SPLINE_TYPE_NURBS */
3177  storage->spline_type = CURVE_TYPE_NURBS;
3178  break;
3179  case 2: /* GEO_NODE_SPLINE_TYPE_POLY */
3180  storage->spline_type = CURVE_TYPE_POLY;
3181  break;
3182  }
3183  }
3184  }
3185  }
3186  }
3188 
3189  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
3190  LISTBASE_FOREACH (GpencilModifierData *, gpd, &ob->greasepencil_modifiers) {
3191  if (gpd->type == eGpencilModifierType_Lineart) {
3193  lmd->shadow_camera_near = 0.1f;
3194  lmd->shadow_camera_far = 200.0f;
3195  lmd->shadow_camera_size = 200.0f;
3196  }
3197  }
3198  }
3199  }
3200 
3201  if (!MAIN_VERSION_ATLEAST(bmain, 303, 2)) {
3202  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
3203  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
3204  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
3205  if (sl->spacetype == SPACE_CLIP) {
3206  ((SpaceClip *)sl)->mask_info.blend_factor = 1.0;
3207  }
3208  }
3209  }
3210  }
3211  }
3212 
3213  if (!MAIN_VERSION_ATLEAST(bmain, 303, 3)) {
3214  LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
3215  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
3216  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
3217  if (sl->spacetype == SPACE_CLIP) {
3218  ((SpaceClip *)sl)->mask_info.draw_flag |= MASK_DRAWFLAG_SPLINE;
3219  }
3220  else if (sl->spacetype == SPACE_IMAGE) {
3221  ((SpaceImage *)sl)->mask_info.draw_flag |= MASK_DRAWFLAG_SPLINE;
3222  }
3223  }
3224  }
3225  }
3226 
3227  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
3228  ToolSettings *tool_settings = scene->toolsettings;
3229  /* Zero isn't a valid value, use for versioning. */
3230  if (tool_settings->snap_face_nearest_steps == 0) {
3231  /* Minimum of snap steps for face nearest is 1. */
3232  tool_settings->snap_face_nearest_steps = 1;
3233  /* Set snap to edited and non-edited as default. */
3235  }
3236  }
3237  }
3238 
3239  if (!MAIN_VERSION_ATLEAST(bmain, 303, 4)) {
3240  FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
3241  if (ntree->type == NTREE_COMPOSIT) {
3243  if (node->type == CMP_NODE_OUTPUT_FILE) {
3244  LISTBASE_FOREACH (bNodeSocket *, sock, &node->inputs) {
3245  if (sock->storage) {
3246  NodeImageMultiFileSocket *sockdata = (NodeImageMultiFileSocket *)sock->storage;
3247  version_fix_image_format_copy(bmain, &sockdata->format);
3248  }
3249  }
3250 
3251  if (node->storage) {
3252  NodeImageMultiFile *nimf = (NodeImageMultiFile *)node->storage;
3253  version_fix_image_format_copy(bmain, &nimf->format);
3254  }
3255  }
3256  }
3257  }
3258  }
3260 
3261  LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
3263  }
3264  }
3265 
3266  if (!MAIN_VERSION_ATLEAST(bmain, 303, 5)) {
3267  /* Fix for T98925 - remove channels region, that was initialized in incorrect editor types. */
3268  for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
3269  LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
3270  LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
3271  if (ELEM(sl->spacetype, SPACE_ACTION, SPACE_CLIP, SPACE_GRAPH, SPACE_NLA, SPACE_SEQ)) {
3272  continue;
3273  }
3274 
3275  ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
3276  &sl->regionbase;
3277  ARegion *channels_region = BKE_region_find_in_listbase_by_type(regionbase,
3279  if (channels_region) {
3280  BLI_freelinkN(regionbase, channels_region);
3281  }
3282  }
3283  }
3284  }
3285  }
3286 
3287  if (!MAIN_VERSION_ATLEAST(bmain, 303, 6)) {
3288  /* Initialize brush curves sculpt settings. */
3289  LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
3290  if (brush->ob_mode != OB_MODE_SCULPT_CURVES) {
3291  continue;
3292  }
3293  brush->curves_sculpt_settings->density_add_attempts = 100;
3294  }
3295 
3296  /* Disable 'show_bounds' option of curve objects. Option was set as there was no object mode
3297  * outline implementation. See T95933. */
3298  LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
3299  if (ob->type == OB_CURVES) {
3300  ob->dtx &= ~OB_DRAWBOUNDOX;
3301  }
3302  }
3303 
3305  }
3306 
3316  {
3317  /* Keep this block, even when empty. */
3318  }
3319 }
typedef float(TangentPoint)[2]
Blender kernel action and pose functionality.
void BKE_action_groups_reconstruct(struct bAction *act)
Definition: action.c:503
struct AnimData * BKE_animdata_from_id(const struct ID *id)
void BKE_animdata_main_cb(struct Main *bmain, ID_AnimData_Edit_Callback func, void *user_data)
Definition: anim_data.c:1177
void vec_roll_to_mat3(const float vec[3], float roll, float r_mat[3][3])
Definition: armature.c:2211
void mat3_to_vec_roll(const float mat[3][3], float r_vec[3], float *r_roll)
Definition: armature.c:2056
void BKE_asset_library_reference_init_default(struct AssetLibraryReference *library_ref)
Definition: asset.cc:99
Generic geometry attributes built on CustomData.
void BKE_id_attributes_active_color_set(struct ID *id, struct CustomDataLayer *active_layer)
Definition: attribute.cc:715
void BKE_id_attributes_render_color_set(struct ID *id, struct CustomDataLayer *active_layer)
Definition: attribute.cc:727
#define BKE_SCENE_COLLECTION_NAME
struct CurveMapping * BKE_curvemapping_copy(const struct CurveMapping *cumap)
void BKE_curvemapping_free(struct CurveMapping *cumap)
Definition: colortools.c:103
void BKE_nurb_knot_calc_v(struct Nurb *nu)
Definition: curve.cc:1239
void BKE_nurb_knot_calc_u(struct Nurb *nu)
Definition: curve.cc:1234
int CustomData_get_active_layer_index(const struct CustomData *data, int type)
int CustomData_get_render_layer_index(const struct CustomData *data, int type)
@ DT_MULTILAYER_INDEX_MAX
@ DT_LAYERS_ALL_SRC
@ DT_LAYERS_NAME_DST
support for deformation groups and hooks.
int BKE_object_defgroup_active_index_get(const struct Object *ob)
struct ListBase * BKE_object_defgroup_list_mutable(struct Object *ob)
Definition: deform.c:552
void BKE_object_defgroup_active_index_set(struct Object *ob, int new_index)
Definition: deform.c:568
struct FCurve * id_data_find_fcurve(ID *id, void *data, struct StructRNA *type, const char *prop_name, int index, bool *r_driven)
Definition: fcurve.c:201
struct FCurve * BKE_fcurve_find(ListBase *list, const char rna_path[], int array_index)
Definition: fcurve.c:249
#define DRIVER_TARGETS_LOOPER_BEGIN(dvar)
#define DRIVER_TARGETS_LOOPER_END
eIDPropertyUIDataType IDP_ui_data_type(const struct IDProperty *prop)
struct IDPropertyUIData * IDP_ui_data_ensure(struct IDProperty *prop)
Definition: idprop.c:1519
struct IDProperty * IDP_GetProperties(struct ID *id, bool create_if_needed) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition: idprop.c:778
bool IDP_ui_data_supported(const struct IDProperty *prop)
int IDP_coerce_to_int_or_zero(const struct IDProperty *prop)
@ IDP_UI_DATA_TYPE_ID
Definition: BKE_idprop.h:335
@ IDP_UI_DATA_TYPE_UNSUPPORTED
Definition: BKE_idprop.h:327
@ IDP_UI_DATA_TYPE_INT
Definition: BKE_idprop.h:329
@ IDP_UI_DATA_TYPE_FLOAT
Definition: BKE_idprop.h:331
@ IDP_UI_DATA_TYPE_STRING
Definition: BKE_idprop.h:333
struct IDProperty * IDP_New(char type, const IDPropertyTemplate *val, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition: idprop.c:887
#define IDP_String(prop)
Definition: BKE_idprop.h:271
bool IDP_AddToGroup(struct IDProperty *group, struct IDProperty *prop) ATTR_NONNULL()
Definition: idprop.c:631
struct IDProperty * IDP_GetPropertyFromGroup(const struct IDProperty *prop, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
float IDP_coerce_to_float_or_zero(const struct IDProperty *prop)
double IDP_coerce_to_double_or_zero(const struct IDProperty *prop)
void IDP_FreeFromGroup(struct IDProperty *group, struct IDProperty *prop) ATTR_NONNULL()
Definition: idprop.c:666
#define IDP_Array(prop)
Definition: BKE_idprop.h:245
void BKE_image_ensure_tile_token(char *filename)
void id_fake_user_set(struct ID *id)
Definition: lib_id.c:343
void id_sort_by_name(struct ListBase *lb, struct ID *id, struct ID *id_sorting_hint)
Definition: lib_id.c:1318
void BKE_main_id_repair_duplicate_names_listbase(struct Main *bmain, struct ListBase *lb)
Definition: lib_id.c:967
bool BKE_lib_override_library_is_user_edited(const struct ID *id)
struct IDOverrideLibraryProperty * BKE_lib_override_library_property_find(struct IDOverrideLibrary *override, const char *rna_path)
void BKE_lib_override_library_property_operation_delete(struct IDOverrideLibraryProperty *override_property, struct IDOverrideLibraryPropertyOperation *override_property_operation)
#define FOREACH_MAIN_ID_END
Definition: BKE_main.h:367
#define MAIN_VERSION_ATLEAST(main, ver, subver)
Definition: BKE_main.h:427
#define FOREACH_MAIN_LISTBASE_END
Definition: BKE_main.h:348
#define FOREACH_MAIN_LISTBASE_BEGIN(_bmain, _lb)
Definition: BKE_main.h:341
#define FOREACH_MAIN_ID_BEGIN(_bmain, _id)
Definition: BKE_main.h:361
struct ListBase * which_libbase(struct Main *bmain, short type)
Definition: main.c:567
bool BKE_main_namemap_validate_and_fix(struct Main *bmain) ATTR_NONNULL()
struct ModifierData * BKE_modifier_new(int type)
bool BKE_modifier_unique_name(struct ListBase *modifiers, struct ModifierData *md)
#define GEO_NODE_SET_POSITION
Definition: BKE_node.h:1419
#define GEO_NODE_MERGE_BY_DISTANCE
Definition: BKE_node.h:1494
#define GEO_NODE_TRIANGULATE
Definition: BKE_node.h:1383
#define SH_NODE_COMBINE_COLOR
Definition: BKE_node.h:1182
#define GEO_NODE_SET_CURVE_HANDLES
Definition: BKE_node.h:1455
#define GEO_NODE_MESH_PRIMITIVE_ICO_SPHERE
Definition: BKE_node.h:1395
#define GEO_NODE_SUBDIVISION_SURFACE
Definition: BKE_node.h:1468
#define GEO_NODE_CURVE_SPLINE_PARAMETER
Definition: BKE_node.h:1430
#define CMP_NODE_SEPHSVA_LEGACY
Definition: BKE_node.h:1212
#define GEO_NODE_MESH_PRIMITIVE_CIRCLE
Definition: BKE_node.h:1392
struct bNodeSocket * nodeAddSocket(struct bNodeTree *ntree, struct bNode *node, eNodeSocketInOut in_out, const char *idname, const char *identifier, const char *name)
Definition: node.cc:1679
#define GEO_NODE_SEPARATE_COMPONENTS
Definition: BKE_node.h:1407
#define GEO_NODE_POINTS_TO_VERTICES
Definition: BKE_node.h:1436
#define GEO_NODE_BOUNDING_BOX
Definition: BKE_node.h:1399
#define GEO_NODE_SUBDIVIDE_MESH
Definition: BKE_node.h:1390
#define CMP_NODE_COMBYCCA_LEGACY
Definition: BKE_node.h:1227
#define SH_NODE_BSDF_PRINCIPLED
Definition: BKE_node.h:1164
#define CMP_NODE_SEPRGBA_LEGACY
Definition: BKE_node.h:1211
#define CMP_NODE_SEPARATE_COLOR
Definition: BKE_node.h:1299
#define GEO_NODE_SET_POINT_RADIUS
Definition: BKE_node.h:1459
#define GEO_NODE_VIEWER
Definition: BKE_node.h:1413
#define GEO_NODE_SET_CURVE_TILT
Definition: BKE_node.h:1454
#define SH_NODE_SUBSURFACE_SCATTERING
Definition: BKE_node.h:1148
#define SH_NODE_MAP_RANGE
Definition: BKE_node.h:1173
#define TEX_NODE_DECOMPOSE_LEGACY
Definition: BKE_node.h:1366
#define GEO_NODE_INPUT_MESH_ISLAND
Definition: BKE_node.h:1485
#define GEO_NODE_MESH_PRIMITIVE_CUBE
Definition: BKE_node.h:1391
#define GEO_NODE_DISTRIBUTE_POINTS_ON_FACES
Definition: BKE_node.h:1432
#define SH_NODE_SEPRGB_LEGACY
Definition: BKE_node.h:1097
#define CMP_NODE_COMBYUVA_LEGACY
Definition: BKE_node.h:1229
#define GEO_NODE_MESH_PRIMITIVE_CONE
Definition: BKE_node.h:1396
#define GEO_NODE_REPLACE_MATERIAL
Definition: BKE_node.h:1404
#define GEO_NODE_REVERSE_CURVE
Definition: BKE_node.h:1437
#define GEO_NODE_MESH_BOOLEAN
Definition: BKE_node.h:1385
#define CMP_NODE_SEPYUVA_LEGACY
Definition: BKE_node.h:1228
#define TEX_NODE_COMBINE_COLOR
Definition: BKE_node.h:1370
#define CMP_NODE_COMBHSVA_LEGACY
Definition: BKE_node.h:1241
struct bNodeSocket * nodeAddStaticSocket(struct bNodeTree *ntree, struct bNode *node, eNodeSocketInOut in_out, int type, int subtype, const char *identifier, const char *name)
Definition: node.cc:1897
#define FN_NODE_COMBINE_COLOR
Definition: BKE_node.h:1537
#define GEO_NODE_TRANSLATE_INSTANCES
Definition: BKE_node.h:1462
#define TEX_NODE_SEPARATE_COLOR
Definition: BKE_node.h:1371
#define GEO_NODE_MESH_PRIMITIVE_LINE
Definition: BKE_node.h:1397
#define GEO_NODE_TRIM_CURVE
Definition: BKE_node.h:1416
#define FN_NODE_COMPARE
Definition: BKE_node.h:1520
#define GEO_NODE_TRANSFER_ATTRIBUTE
Definition: BKE_node.h:1467
#define SH_NODE_SEPHSV_LEGACY
Definition: BKE_node.h:1154
#define GEO_NODE_SWITCH
Definition: BKE_node.h:1400
#define TEX_NODE_COMPOSE_LEGACY
Definition: BKE_node.h:1365
#define GEO_NODE_FILLET_CURVE
Definition: BKE_node.h:1431
#define GEO_NODE_MESH_PRIMITIVE_CYLINDER
Definition: BKE_node.h:1394
#define GEO_NODE_CURVE_SPLINE_TYPE
Definition: BKE_node.h:1441
#define GEO_NODE_MESH_PRIMITIVE_UV_SPHERE
Definition: BKE_node.h:1393
#define GEO_NODE_SUBDIVIDE_CURVE
Definition: BKE_node.h:1439
#define GEO_NODE_MESH_PRIMITIVE_GRID
Definition: BKE_node.h:1398
const char * nodeStaticSocketType(int type, int subtype)
Definition: node.cc:1710
#define GEO_NODE_SPLIT_EDGES
Definition: BKE_node.h:1465
#define CMP_NODE_OUTPUT_FILE
Definition: BKE_node.h:1218
#define FOREACH_NODETREE_END
Definition: BKE_node.h:1058
struct bNodeLink * nodeAddLink(struct bNodeTree *ntree, struct bNode *fromnode, struct bNodeSocket *fromsock, struct bNode *tonode, struct bNodeSocket *tosock)
Definition: node.cc:2296
#define GEO_NODE_ROTATE_INSTANCES
Definition: BKE_node.h:1464
#define GEO_NODE_INPUT_MESH_EDGE_ANGLE
Definition: BKE_node.h:1488
#define GEO_NODE_REALIZE_INSTANCES
Definition: BKE_node.h:1425
void nodeRemoveSocket(struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *sock)
Definition: node.cc:1933
#define GEO_NODE_RESAMPLE_CURVE
Definition: BKE_node.h:1402
#define GEO_NODE_SAMPLE_CURVE
Definition: BKE_node.h:1427
#define CMP_NODE_COMBINE_COLOR
Definition: BKE_node.h:1298
#define CMP_NODE_COMBRGBA_LEGACY
Definition: BKE_node.h:1222
void nodeSetSelected(struct bNode *node, bool select)
Definition: node.cc:3615
#define GEO_NODE_CAPTURE_ATTRIBUTE
Definition: BKE_node.h:1422
#define FN_NODE_SEPARATE_COLOR
Definition: BKE_node.h:1536
#define GEO_NODE_FILL_CURVE
Definition: BKE_node.h:1417
#define FOREACH_NODETREE_BEGIN(bmain, _nodetree, _id)
Definition: BKE_node.h:1048
#define GEO_NODE_CURVE_LENGTH
Definition: BKE_node.h:1405
#define GEO_NODE_CURVE_TO_MESH
Definition: BKE_node.h:1401
struct bNodeTree * ntreeAddTree(struct Main *bmain, const char *name, const char *idname)
Definition: node.cc:2674
#define GEO_NODE_STRING_TO_CURVES
Definition: BKE_node.h:1433
struct bNodeSocket * ntreeAddSocketInterface(struct bNodeTree *ntree, eNodeSocketInOut in_out, const char *idname, const char *name)
Definition: node.cc:3349
#define GEO_NODE_POINTS_TO_VOLUME
Definition: BKE_node.h:1443
struct bNode * nodeAddStaticNode(const struct bContext *C, struct bNodeTree *ntree, int type)
Definition: node.cc:2151
#define CMP_NODE_SEPYCCA_LEGACY
Definition: BKE_node.h:1226
#define NODE_GROUP_INPUT
Definition: BKE_node.h:987
#define GEO_NODE_SET_MATERIAL
Definition: BKE_node.h:1424
#define GEO_NODE_SCALE_INSTANCES
Definition: BKE_node.h:1463
#define GEO_NODE_SET_CURVE_RADIUS
Definition: BKE_node.h:1453
#define GEO_NODE_CONVEX_HULL
Definition: BKE_node.h:1406
#define GEO_NODE_JOIN_GEOMETRY
Definition: BKE_node.h:1387
#define FN_NODE_SLICE_STRING
Definition: BKE_node.h:1527
struct ARegion * BKE_region_find_in_listbase_by_type(const struct ListBase *regionbase, const int region_type)
#define BLI_assert_unreachable()
Definition: BLI_assert.h:93
#define BLI_assert(a)
Definition: BLI_assert.h:46
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
Definition: BLI_listbase.h:269
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:336
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:239
void void * BLI_listbase_string_or_index_find(const struct ListBase *listbase, const char *string, size_t string_offset, int index) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
Definition: BLI_listbase.h:354
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
Definition: BLI_listbase.h:273
void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
Definition: listbase.c:301
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
Definition: BLI_listbase.h:344
void void void BLI_movelisttolist(struct ListBase *dst, struct ListBase *src) ATTR_NONNULL(1
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition: listbase.c:466
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:80
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:100
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_listbase_swaplinks(struct ListBase *listbase, void *vlinka, void *vlinkb) ATTR_NONNULL(1
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
#define BLI_ASSERT_UNIT_V3(v)
MINLINE float sasqrt(float fac)
void unit_m3(float m[3][3])
Definition: math_matrix.c:40
void mul_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
Definition: math_matrix.c:388
void axis_angle_normalized_to_mat3(float R[3][3], const float axis[3], float angle)
MINLINE bool compare_v3v3(const float a[3], const float b[3], float limit) ATTR_WARN_UNUSED_RESULT
MINLINE float normalize_v3(float r[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v3_fl3(float v[3], float x, float y, float z)
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v3_fl(float r[3], float f)
const char * BLI_path_basename(const char *path) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
Definition: path_util.c:1653
bool BLI_path_extension_check(const char *str, const char *ext) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
Definition: path_util.c:1299
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
#define SNPRINTF(dst, format,...)
Definition: BLI_string.h:485
int BLI_strcasecmp(const char *s1, const char *s2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition: string.c:623
char * BLI_str_replaceN(const char *__restrict str, const char *__restrict substr_old, const char *__restrict substr_new) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
Definition: string.c:448
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
Definition: string.c:42
bool BLI_str_endswith(const char *__restrict str, const char *__restrict end) ATTR_NONNULL()
Definition: string.c:887
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
Definition: string.c:64
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
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
bool BLI_uniquename(struct ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_len)
Definition: string_utils.c:309
#define UNUSED_VARS_NDEBUG(...)
#define UNUSED(x)
#define MAX2(a, b)
#define ELEM(...)
#define MIN2(a, b)
#define STREQ(a, b)
external readfile function prototypes.
typedef double(DMatrix)[4][4]
#define CLOG_ERROR(clg_ref,...)
Definition: CLG_log.h:190
@ IDP_DOUBLE
Definition: DNA_ID.h:143
@ IDP_FLOAT
Definition: DNA_ID.h:138
@ IDP_STRING
Definition: DNA_ID.h:136
@ IDP_INT
Definition: DNA_ID.h:137
@ IDP_GROUP
Definition: DNA_ID.h:141
@ IDP_ARRAY
Definition: DNA_ID.h:140
#define FILTER_ID_ALL
Definition: DNA_ID.h:939
#define ID_IS_OVERRIDE_LIBRARY_REAL(_id)
Definition: DNA_ID.h:581
#define ID_IS_LINKED(_id)
Definition: DNA_ID.h:566
#define FILTER_ID_GR
Definition: DNA_ID.h:905
#define MAX_IDPROP_NAME
Definition: DNA_ID.h:131
@ IDOVERRIDE_LIBRARY_OP_INSERT_AFTER
Definition: DNA_ID.h:230
@ IDOVERRIDE_LIBRARY_FLAG_SYSTEM_DEFINED
Definition: DNA_ID.h:327
@ ID_VF
Definition: DNA_ID_enums.h:61
@ ID_OB
Definition: DNA_ID_enums.h:47
@ SACTCONT_TIMELINE
@ BBONE_ADD_PARENT_END_ROLL
@ BRUSH_CURVE_SPHERE
@ BRUSH_ALPHA_PRESSURE
@ BRUSH_SPACE_ATTEN
@ SCULPT_TOOL_SMEAR
Object groups, one object can be in many groups at once.
@ COLORMANAGE_VIEW_USE_CURVES
@ CONSTRAINT_TYPE_SPLINEIK
@ CU_NURB_CYCLIC
@ CU_NURB_ENDPOINT
@ CU_NURB_BEZIER
@ CURVE_TYPE_BEZIER
@ CURVE_TYPE_NURBS
@ CURVE_TYPE_POLY
@ CD_PROP_BYTE_COLOR
@ CD_PROP_FLOAT
@ CD_PROP_COLOR
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_Lineart
@ eGpencilModifierType_Smooth
@ IMA_SRC_TILED
@ IMA_TYPE_R_RESULT
@ IMA_TYPE_COMPOSITE
@ LRT_USE_CREASE_ON_SMOOTH_SURFACES
These structs are the foundation for all linked lists in the library system.
#define MASK_DRAWFLAG_SPLINE
@ LRT_MATERIAL_CUSTOM_OCCLUSION_EFFECTIVENESS
@ eModifierType_Mirror
@ eModifierType_WeightVGProximity
@ eModifierType_DataTransfer
@ eModifierType_SurfaceDeform
@ eModifierType_Nodes
@ MOD_WVG_PROXIMITY_WEIGHTS_NORMALIZE
@ MOD_WVG_PROXIMITY_INVERT_VGROUP_MASK
@ CMP_NODE_COMBSEP_COLOR_YCC
@ CMP_NODE_COMBSEP_COLOR_YUV
@ CMP_NODE_COMBSEP_COLOR_RGB
@ CMP_NODE_COMBSEP_COLOR_HSV
@ SHD_SUBSURFACE_BURLEY
@ SHD_SUBSURFACE_RANDOM_WALK_FIXED_RADIUS
@ SHD_SUBSURFACE_RANDOM_WALK
#define NTREE_TEXTURE
@ GEO_NODE_REALIZE_INSTANCES_LEGACY_BEHAVIOR
#define NODE_DO_OUTPUT
#define NTREE_GEOMETRY
#define NTREE_CUSTOM
#define NTREE_COMPOSIT
@ SOCK_OUT
@ SOCK_IN
@ GEO_NODE_MERGE_BY_DISTANCE_MODE_ALL
@ SOCK_INT
@ SOCK_TEXTURE
@ SOCK_VECTOR
@ SOCK_MATERIAL
@ SOCK_FLOAT
@ SOCK_COLLECTION
@ SOCK_GEOMETRY
@ SOCK_OBJECT
@ NODE_COMBSEP_COLOR_RGB
@ NODE_COMBSEP_COLOR_HSV
#define NTREE_SHADER
@ OB_MODE_SCULPT_CURVES
@ OB_LATTICE
@ OB_ARMATURE
@ OB_MESH
@ OB_CURVES
@ OB_GPENCIL
@ OB_DRAWBOUNDOX
#define SEQ_SNAP_TO_STRIPS
#define SEQ_SNAP_TO_STRIP_HOLD
@ SEQ_OVERLAP_SHUFFLE
#define UV_SCULPT_TOOL_RELAX_LAPLACIAN
#define SEQ_SNAP_TO_CURRENT_FRAME
@ GP_PROJECT_VIEWSPACE
@ GP_PROJECT_CURSOR
@ SCE_SNAP_TO_INCLUDE_EDITED
@ SCE_SNAP
@ SCE_SNAP_TO_INCLUDE_NONEDITED
@ RGN_FLAG_HIDDEN
@ RGN_TYPE_CHANNELS
@ RGN_TYPE_TOOL_HEADER
@ RGN_TYPE_UI
@ RGN_TYPE_WINDOW
@ RGN_TYPE_FOOTER
@ RGN_TYPE_HEADER
@ RGN_TYPE_TOOLS
@ RGN_ALIGN_LEFT
@ RGN_ALIGN_RIGHT
@ SEQ_TYPE_SOUND_RAM
@ SEQ_TYPE_META
@ SEQ_TYPE_SPEED
@ seqModifierType_ColorBalance
@ SEQUENCE_COLOR_NONE
@ SEQ_SPEED_STRETCH
@ SEQ_SPEED_MULTIPLY
@ SEQ_SPEED_LENGTH
@ SEQ_SPEED_FRAME_NUMBER
@ SEQ_COLOR_BALANCE_METHOD_LIFTGAMMAGAIN
@ SEQ_USE_EFFECT_DEFAULT_FADE
#define MAXSEQ
@ SEQ_TRANSFORM_FILTER_BILINEAR
@ SN_OVERLAY_SHOW_PATH
@ SN_OVERLAY_SHOW_WIRE_COLORS
@ SN_OVERLAY_SHOW_OVERLAYS
@ SN_OVERLAY_SHOW_NAMED_ATTRIBUTES
@ SI_OVERLAY_SHOW_GRID_BACKGROUND
@ SPACE_TEXT
@ SPACE_CLIP
@ SPACE_ACTION
@ SPACE_OUTLINER
@ SPACE_NODE
@ SPACE_SPREADSHEET
@ SPACE_FILE
@ SPACE_NLA
@ SPACE_SEQ
@ SPACE_IMAGE
@ SPACE_GRAPH
@ SPACE_VIEW3D
@ SEQ_TIMELINE_SHOW_FCURVES
@ SEQ_TIMELINE_SHOW_STRIP_DURATION
@ SEQ_TIMELINE_SHOW_STRIP_OFFSETS
@ SEQ_TIMELINE_SHOW_STRIP_SOURCE
@ SEQ_TIMELINE_SHOW_STRIP_NAME
@ SEQ_TIMELINE_SHOW_GRID
@ SEQ_TIMELINE_SHOW_STRIP_COLOR_TAG
@ SEQ_VIEW_SEQUENCE_PREVIEW
@ SEQ_VIEW_PREVIEW
@ FILE_BROWSE_MODE_ASSETS
@ SO_FILTER_CLEARED_1
@ SO_FILTER_NO_VIEW_LAYERS
@ SPREADSHEET_FILTER_ENABLE
@ SEQ_PREVIEW_SHOW_METADATA
@ SEQ_PREVIEW_SHOW_GPENCIL
@ SEQ_PREVIEW_SHOW_SAFE_MARGINS
@ SEQ_PREVIEW_SHOW_OUTLINE_SELECTED
@ SEQ_PREVIEW_SHOW_SAFE_CENTER
@ FILE_ASSET_IMPORT_APPEND_REUSE
@ FILE_ASSET_IMPORT_APPEND
@ ST_FLAG_UNUSED_4
@ FILE_PARAMS_FLAG_UNUSED_3
@ FILE_PARAMS_FLAG_UNUSED_1
@ FILE_PARAMS_FLAG_UNUSED_2
@ FILE_PATH_TOKENS_ALLOW
@ SEQ_DRAW_IMG_IMBUF
@ SEQ_CLAMP_VIEW
#define FILE_SELECT_MAX_RECURSIONS
@ TXT_ISSCRIPT
@ V2D_VIEWSYNC_AREA_VERTICAL
@ V2D_SCROLL_RIGHT
@ V2D_SCROLL_BOTTOM
@ V2D_ALIGN_NO_NEG_Y
@ V3D_OFSDRAW_XR_SHOW_CUSTOM_OVERLAYS
@ V3D_OFSDRAW_SHOW_SELECTION
@ V3D_OFSDRAW_XR_SHOW_CONTROLLERS
@ V3D_AROUND_CENTER_MEDIAN
@ V3D_OVERLAY_FADE_INACTIVE
static AppView * view
_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 z
_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 y
Read Guarded memory(de)allocation.
NODE_GROUP_OUTPUT
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 Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between and object coordinate space Combine Create a color from its and value channels Color Retrieve a color or the default fallback if none is specified Separate Split a vector into its and Z components Generates normals with round corners and may slow down renders Vector Displace the surface along an arbitrary direction White Return a random value or color based on an input seed Float Map an input float to a curve and outputs a float value SH_NODE_SEPARATE_COLOR
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a producing a negative SH_NODE_COMBRGB_LEGACY
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 Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between and object coordinate space SH_NODE_COMBHSV_LEGACY
@ PROP_NONE
Definition: RNA_types.h:126
@ PROP_TRANSLATION
Definition: RNA_types.h:154
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
btSequentialImpulseConstraintSolverMt int btPersistentManifold int btTypedConstraint ** constraints
void SEQ_channels_ensure(ListBase *channels)
Definition: channels.c:33
short type
OperationNode * node
Scene scene
Curve curve
void * user_data
int len
Definition: draw_manager.c:108
bNodeTree * ntree
DRWShaderLibrary * lib
uint nor
#define GS(x)
Definition: iris.c:225
void SEQ_for_each_callback(ListBase *seqbase, SeqForEachFunc callback, void *user_data)
Definition: iterator.c:76
format
Definition: logImageCore.h:38
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
Definition: mallocn.c:34
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
#define sqrtf(x)
Definition: metal/compat.h:243
static void area(int d1, int d2, int e1, int e2, float weights[2])
static const pxr::TfToken st("st", pxr::TfToken::Immortal)
struct node_tree node_tree
bool RNA_enum_value_from_id(const EnumPropertyItem *item, const char *identifier, int *r_value)
Definition: rna_access.c:5076
const EnumPropertyItem rna_enum_property_subtype_items[]
Definition: rna_rna.c:120
Editing * SEQ_editing_get(const Scene *scene)
Definition: sequencer.c:241
SequencerToolSettings * SEQ_tool_settings_ensure(Scene *scene)
Definition: sequencer.c:330
#define min(a, b)
Definition: sort.c:35
unsigned char uint8_t
Definition: stdint.h:78
void SEQ_time_update_meta_strip_range(const Scene *scene, Sequence *seq_meta)
Definition: strip_time.c:147
int SEQ_time_right_handle_frame_get(const Scene *scene, const Sequence *seq)
Definition: strip_time.c:515
short alignment
bAction * action
ListBase drivers
float max_ray_distance
float vec[3][3]
IDProperty * prop
ListBase childbase
ListBase variables
struct CurveMapping * curve_mapping
ListBase nurb
ListBase seqbase
ListBase channels
ListBase * displayed_channels
ListBase metastack
char * rna_path
ChannelDriver * driver
BezTriple * bezt
int array_index
unsigned int totvert
AssetLibraryReference asset_library_ref
FileSelectParams base_params
struct SDNA * filesdna
Definition: readfile.h:63
struct GpencilModifierData * next
ListBase group
Definition: DNA_ID.h:101
double * default_array
Definition: DNA_ID.h:74
double default_value
Definition: DNA_ID.h:85
int default_array_len
Definition: DNA_ID.h:60
int * default_array
Definition: DNA_ID.h:59
char * default_value
Definition: DNA_ID.h:91
char * description
Definition: DNA_ID.h:49
int rna_subtype
Definition: DNA_ID.h:51
int len
Definition: DNA_ID.h:121
char name[64]
Definition: DNA_ID.h:111
IDPropertyData data
Definition: DNA_ID.h:117
char subtype
Definition: DNA_ID.h:108
char type
Definition: DNA_ID.h:108
Definition: DNA_ID.h:368
struct Library * lib
Definition: DNA_ID.h:372
char name[66]
Definition: DNA_ID.h:378
ColorManagedViewSettings view_settings
struct Image * stencil
struct Image * canvas
struct Image * clone
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 nodetrees
Definition: BKE_main.h:192
ListBase materials
Definition: BKE_main.h:174
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 images
Definition: BKE_main.h:176
ListBase objects
Definition: BKE_main.h:170
struct ModifierData * next
ImageFormatData format
struct bNodeTree * node_group
struct NodesModifierSettings settings
struct IDProperty * properties
ListBase constraints
struct bPose * pose
ListBase modifiers
ListBase greasepencil_modifiers
struct BakeData bake
struct ImageFormatData im_format
unsigned int vertex_idx
struct Collection * master_collection
struct ToolSettings * toolsettings
ColorManagedViewSettings view_settings
struct Editing * ed
struct RenderData r
struct AnimData * adt
ListBase channels
ListBase modifiers
FileSelectParams * params
FileAssetSelectParams * asset_params
SpaceImageOverlay overlay
SpaceNodeOverlay overlay
struct SequencerTimelineOverlay timeline_overlay
ListBase regionbase
struct SequencerPreviewOverlay preview_overlay
StripTransform * transform
struct ImagePaintSettings imapaint
short snap_face_nearest_steps
short flag
short align
float normals_constant_screen_size
View3DOverlay overlay
ListBase curves
struct bConstraint * next
struct bNodeSocket * next
void * default_value
char identifier[64]
ListBase nodes
ListBase inputs
ListBase links
ListBase outputs
float locy
ListBase inputs
struct bNode * parent
float locx
short type
struct bNode * next
void * storage
ListBase outputs
ListBase chanbase
float ymax
Definition: DNA_vec_types.h:70
float max
#define SEQ_SPEED_INTEGRATE
static void version_idproperty_move_data_string(IDPropertyUIDataString *ui_data, const IDProperty *prop_ui_data)
static void move_vertex_group_names_to_object_data(Main *bmain)
static void add_realize_instances_before_socket(bNodeTree *ntree, bNode *node, bNodeSocket *geometry_socket)
void do_versions_after_linking_300(FileData *UNUSED(fd), Main *bmain)
static void version_idproperty_move_data_float(IDPropertyUIDataFloat *ui_data, const IDProperty *prop_ui_data)
static bool seq_transform_origin_set(Sequence *seq, void *UNUSED(user_data))
void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
static void versioning_replace_legacy_combined_and_separate_color_nodes(bNodeTree *ntree)
static void sort_linked_ids(Main *bmain)
static void version_liboverride_rnacollections_insertion_animdata(ID *id)
static void do_versions_idproperty_bones_recursive(Bone *bone)
static bNodeTree * add_realize_node_tree(Main *bmain)
static void version_geometry_nodes_add_attribute_input_settings(NodesModifierData *nmd)
static void version_idproperty_ui_data(IDProperty *idprop_group)
static void do_version_bbone_len_scale_fcurve_fix(FCurve *fcu)
static void version_switch_node_input_prefix(Main *bmain)
static void version_liboverride_rnacollections_insertion_object(Object *object)
static bool do_versions_sequencer_color_tags(Sequence *seq, void *UNUSED(user_data))
static void legacy_vec_roll_to_mat3_normalized(const float nor[3], const float roll, float r_mat[3][3])
static void version_geometry_nodes_set_position_node_offset(bNodeTree *ntree)
static void version_idproperty_move_data_int(IDPropertyUIDataInt *ui_data, const IDProperty *prop_ui_data)
static void do_versions_sequencer_speed_effect_recursive(Scene *scene, const ListBase *seqbase)
#define SEQ_SPEED_COMPRESS_IPO_Y
static void do_versions_idproperty_ui_data(Main *bmain)
static void version_node_tree_socket_id_delim(bNodeTree *ntree)
static void do_version_bones_bbone_len_scale(ListBase *lb)
static bool seq_transform_filter_set(Sequence *seq, void *UNUSED(user_data))
static void version_geometry_nodes_add_realize_instance_nodes(bNodeTree *ntree)
static void do_versions_idproperty_seq_recursive(ListBase *seqbase)
static void do_version_constraints_spline_ik_joint_bindings(ListBase *lb)
static void do_version_subsurface_methods(bNode *node)
static void seq_speed_factor_fix_rna_path(Sequence *seq, ListBase *fcurves)
static void version_fix_image_format_copy(Main *bmain, ImageFormatData *format)
static bool replace_bbone_len_scale_rnapath(char **p_old_path, int *p_index)
static void version_liboverride_rnacollections_insertion_object_constraints(ListBase *constraints, IDOverrideLibraryProperty *op)
static void do_version_bbone_len_scale_animdata_cb(ID *UNUSED(id), AnimData *adt, void *UNUSED(wrapper_data))
static bNodeSocket * do_version_replace_float_size_with_vector(bNodeTree *ntree, bNode *node, bNodeSocket *socket)
static bNodeLink * find_connected_link(bNodeTree *ntree, bNodeSocket *in_socket)
static IDProperty * idproperty_find_ui_container(IDProperty *idprop_group)
static bool version_fix_seq_meta_range(Sequence *seq, void *user_data)
static bool version_merge_still_offsets(Sequence *seq, void *UNUSED(user_data))
static CLG_LogRef LOG
static void correct_bone_roll_value(const float head[3], const float tail[3], const float check_x_axis[3], const float check_y_axis[3], float *r_roll)
static bool do_versions_sequencer_color_balance_sop(Sequence *seq, void *UNUSED(user_data))
static bool seq_speed_factor_set(Sequence *seq, void *user_data)
static void assert_sorted_ids(Main *bmain)
static bool seq_meta_channels_ensure(Sequence *seq, void *UNUSED(user_data))
static void do_version_bones_roll(ListBase *lb)
void version_node_socket_id_delim(bNodeSocket *socket)
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_input_socket_name(bNodeTree *ntree, const int node_type, const char *old_name, const char *new_name)
ARegion * do_versions_add_region(int regiontype, const char *name)
void version_node_socket_name(bNodeTree *ntree, const int node_type, const char *old_name, const char *new_name)
void version_socket_update_is_used(bNodeTree *ntree)
bNodeSocket * version_node_add_socket_if_not_exist(bNodeTree *ntree, bNode *node, eNodeSocketInOut in_out, int type, int subtype, const char *identifier, const char *name)
ARegion * do_versions_add_region_if_not_found(ListBase *regionbase, int region_type, const char *name, int link_after_region_type)
void version_node_output_socket_name(bNodeTree *ntree, const int node_type, const char *old_name, const char *new_name)
void version_node_id(bNodeTree *ntree, const int node_type, const char *new_name)