Blender V4.5
versioning_440.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#define DNA_DEPRECATED_ALLOW
10
11#include <fmt/format.h>
12
13/* Define macros in `DNA_genfile.h`. */
14#define DNA_GENFILE_VERSIONING_MACROS
15
16#include "DNA_anim_types.h"
17#include "DNA_brush_types.h"
18#include "DNA_curves_types.h"
19#include "DNA_defaults.h"
20#include "DNA_genfile.h"
21#include "DNA_modifier_types.h"
22#include "DNA_screen_types.h"
23#include "DNA_sequence_types.h"
24#include "DNA_workspace_types.h"
25
26#undef DNA_GENFILE_VERSIONING_MACROS
27
28#include "BLI_listbase.h"
29#include "BLI_math_vector.h"
30#include "BLI_math_vector.hh"
31#include "BLI_set.hh"
32#include "BLI_string.h"
33
34#include "BKE_anim_data.hh"
35#include "BKE_fcurve.hh"
36#include "BKE_main.hh"
37#include "BKE_node.hh"
39#include "BKE_node_runtime.hh"
40#include "BKE_scene.hh"
41
42#include "SEQ_iterator.hh"
43#include "SEQ_sequencer.hh"
44
45#include "RNA_types.hh"
46
47#include "ANIM_action.hh"
49#include "ANIM_versioning.hh"
50
51#include "readfile.hh"
52
53#include "versioning_common.hh"
54
55/* The Threshold, Mix, and Size properties of the node were converted into node inputs, and
56 * two new outputs were added.
57 *
58 * A new Highlights output was added to expose the extracted highlights, this is not relevant for
59 * versioning.
60 *
61 * A new Glare output was added to expose just the generated glare without the input image itself.
62 * this relevant for versioning the Mix property as will be shown.
63 *
64 * The Threshold, Iterations, Fade, Color Modulation, Streaks, and Streaks Angle Offset properties
65 * were converted into node inputs, maintaining its type and range, so we just transfer its value
66 * as is.
67 *
68 * The Mix property was converted into a Strength input, but its range changed from [-1, 1] to [0,
69 * 1]. For the [-1, 0] sub-range, -1 used to mean zero strength and 0 used to mean full strength,
70 * so we can convert between the two ranges by negating the mix factor and subtracting it from 1.
71 * The [0, 1] sub-range on the other hand was useless except for the value 1, because it linearly
72 * interpolates between Image + Glare and Glare, so it essentially adds an attenuated version of
73 * the input image to the glare. When it is 1, only the glare is returned. So we split that range
74 * in half as a heuristic and for values in the range [0.5, 1], we just reconnect the output to the
75 * newly added Glare output.
76 *
77 * The Size property was converted into a float node input, and its range was changed from [1, 9]
78 * to [0, 1]. For Bloom, the [1, 9] range was related exponentially to the actual size of the
79 * glare, that is, 9 meant the glare covers the entire image, 8 meant it covers half, 7 meant it
80 * covers quarter and so on. The new range is linear and relative to the image size, that is, 1
81 * means the entire image and 0 means nothing. So we can convert from the [1, 9] range to [0, 1]
82 * range using the relation 2^(x-9).
83 * For Fog Glow, the [1, 9] range was related to the absolute size of the Fog Glow kernel in
84 * pixels, where it is 2^size pixels in size. There is no way to version this accurately, since the
85 * new size is relative to the input image size, which is runtime information. But we can assume
86 * the render size as a guess and compute the size relative to that. */
88 bNodeTree *node_tree,
89 bNode *node)
90{
91 NodeGlare *storage = static_cast<NodeGlare *>(node->storage);
92 if (!storage) {
93 return;
94 }
95
96 /* Get the newly added inputs. */
98 node_tree, node, SOCK_IN, SOCK_FLOAT, PROP_NONE, "Highlights Threshold", "Threshold");
100 node_tree, node, SOCK_IN, SOCK_FLOAT, PROP_FACTOR, "Strength", "Strength");
102 node_tree, node, SOCK_IN, SOCK_FLOAT, PROP_FACTOR, "Size", "Size");
104 node_tree, node, SOCK_IN, SOCK_INT, PROP_NONE, "Streaks", "Streaks");
106 node_tree, node, SOCK_IN, SOCK_FLOAT, PROP_ANGLE, "Streaks Angle", "Streaks Angle");
108 node_tree, node, SOCK_IN, SOCK_INT, PROP_NONE, "Iterations", "Iterations");
110 node_tree, node, SOCK_IN, SOCK_FLOAT, PROP_FACTOR, "Fade", "Fade");
112 node_tree, node, SOCK_IN, SOCK_FLOAT, PROP_FACTOR, "Color Modulation", "Color Modulation");
113
114 /* Function to remap the Mix property to the range of the new Strength input. See function
115 * description. */
116 auto mix_to_strength = [](const float mix) {
117 return 1.0f - blender::math::clamp(-mix, 0.0f, 1.0f);
118 };
119
120 /* Find the render size to guess the Size value. The node tree might not belong to a scene, so we
121 * just assume an arbitrary HDTV 1080p render size. */
122 blender::int2 render_size;
123 if (scene) {
124 BKE_render_resolution(&scene->r, true, &render_size.x, &render_size.y);
125 }
126 else {
127 render_size = blender::int2(1920, 1080);
128 }
129
130 /* Function to remap the Size property to its new range. See function description. */
131 const int max_render_size = blender::math::reduce_max(render_size);
132 auto size_to_linear = [&](const int size) {
133 if (storage->type == CMP_NODE_GLARE_BLOOM) {
134 return blender::math::pow(2.0f, float(size - 9));
135 }
136 return blender::math::min(1.0f, float((1 << size) + 1) / float(max_render_size));
137 };
138
139 /* Assign the inputs the values from the old deprecated properties. */
140 threshold->default_value_typed<bNodeSocketValueFloat>()->value = storage->threshold;
141 strength->default_value_typed<bNodeSocketValueFloat>()->value = mix_to_strength(storage->mix);
142 size->default_value_typed<bNodeSocketValueFloat>()->value = size_to_linear(storage->size);
143 streaks->default_value_typed<bNodeSocketValueInt>()->value = storage->streaks;
144 streaks_angle->default_value_typed<bNodeSocketValueFloat>()->value = storage->angle_ofs;
145 iterations->default_value_typed<bNodeSocketValueInt>()->value = storage->iter;
146 fade->default_value_typed<bNodeSocketValueFloat>()->value = storage->fade;
147 color_modulation->default_value_typed<bNodeSocketValueFloat>()->value = storage->colmod;
148
149 /* Compute the RNA path of the node. */
150 char escaped_node_name[sizeof(node->name) * 2 + 1];
151 BLI_str_escape(escaped_node_name, node->name, sizeof(escaped_node_name));
152 const std::string node_rna_path = fmt::format("nodes[\"{}\"]", escaped_node_name);
153
154 BKE_fcurves_id_cb(&node_tree->id, [&](ID * /*id*/, FCurve *fcurve) {
155 /* The FCurve does not belong to the node since its RNA path doesn't start with the node's RNA
156 * path. */
157 if (!blender::StringRef(fcurve->rna_path).startswith(node_rna_path)) {
158 return;
159 }
160
161 /* Change the RNA path of the FCurve from the old properties to the new inputs, adjusting the
162 * values of the FCurves frames when needed. */
163 char *old_rna_path = fcurve->rna_path;
164 if (BLI_str_endswith(fcurve->rna_path, "threshold")) {
165 fcurve->rna_path = BLI_sprintfN("%s.%s", node_rna_path.c_str(), "inputs[1].default_value");
166 }
167 else if (BLI_str_endswith(fcurve->rna_path, "mix")) {
168 fcurve->rna_path = BLI_sprintfN("%s.%s", node_rna_path.c_str(), "inputs[2].default_value");
169 adjust_fcurve_key_frame_values(
170 fcurve, PROP_FLOAT, [&](const float value) { return mix_to_strength(value); });
171 }
172 else if (BLI_str_endswith(fcurve->rna_path, "size")) {
173 fcurve->rna_path = BLI_sprintfN("%s.%s", node_rna_path.c_str(), "inputs[3].default_value");
175 fcurve, PROP_FLOAT, [&](const float value) { return size_to_linear(value); });
176 }
177 else if (BLI_str_endswith(fcurve->rna_path, "streaks")) {
178 fcurve->rna_path = BLI_sprintfN("%s.%s", node_rna_path.c_str(), "inputs[4].default_value");
179 }
180 else if (BLI_str_endswith(fcurve->rna_path, "angle_offset")) {
181 fcurve->rna_path = BLI_sprintfN("%s.%s", node_rna_path.c_str(), "inputs[5].default_value");
182 }
183 else if (BLI_str_endswith(fcurve->rna_path, "iterations")) {
184 fcurve->rna_path = BLI_sprintfN("%s.%s", node_rna_path.c_str(), "inputs[6].default_value");
185 }
186 else if (BLI_str_endswith(fcurve->rna_path, "fade")) {
187 fcurve->rna_path = BLI_sprintfN("%s.%s", node_rna_path.c_str(), "inputs[7].default_value");
188 }
189 else if (BLI_str_endswith(fcurve->rna_path, "color_modulation")) {
190 fcurve->rna_path = BLI_sprintfN("%s.%s", node_rna_path.c_str(), "inputs[8].default_value");
191 }
192
193 /* The RNA path was changed, free the old path. */
194 if (fcurve->rna_path != old_rna_path) {
195 MEM_freeN(old_rna_path);
196 }
197 });
198
199 /* If the Mix factor is between [0.5, 1], then the user actually wants the Glare output, so
200 * reconnect the output to the newly created Glare output. */
201 if (storage->mix > 0.5f) {
203 node_tree, node, SOCK_OUT, SOCK_RGBA, PROP_NONE, "Image", "Image");
205 node_tree, node, SOCK_OUT, SOCK_RGBA, PROP_NONE, "Glare", "Glare");
206
207 LISTBASE_FOREACH_BACKWARD_MUTABLE (bNodeLink *, link, &node_tree->links) {
208 if (link->fromsock != image_output) {
209 continue;
210 }
211
212 /* Relink from the Image output to the Glare output. */
213 blender::bke::node_add_link(*node_tree, *node, *glare_output, *link->tonode, *link->tosock);
214 blender::bke::node_remove_link(node_tree, *link);
215 }
216 }
217}
218
220 const Scene *scene,
221 bNodeTree *node_tree,
222 blender::Set<bNodeTree *> &node_trees_already_versioned)
223{
224 if (node_trees_already_versioned.contains(node_tree)) {
225 return;
226 }
227
228 LISTBASE_FOREACH (bNode *, node, &node_tree->nodes) {
229 if (node->type_legacy == CMP_NODE_GLARE) {
230 do_version_glare_node_options_to_inputs(scene, node_tree, node);
231 }
232 else if (node->is_group()) {
233 bNodeTree *child_tree = reinterpret_cast<bNodeTree *>(node->id);
234 if (child_tree) {
236 scene, child_tree, node_trees_already_versioned);
237 }
238 }
239 }
240
241 node_trees_already_versioned.add_new(node_tree);
242}
243
244/* The bloom glare is now normalized by its chain length, see the compute_bloom_chain_length method
245 * in the glare code. So we need to multiply the strength by the chain length to restore its
246 * original value. Since the chain length depend on the input image size, which is runtime
247 * information, we assume the render size as a guess. */
249 bNodeTree *node_tree,
250 bNode *node)
251{
252 NodeGlare *storage = static_cast<NodeGlare *>(node->storage);
253 if (!storage) {
254 return;
255 }
256
257 if (storage->type != CMP_NODE_GLARE_BLOOM) {
258 return;
259 }
260
261 /* See the get_quality_factor method in the glare code. */
262 const int quality_factor = 1 << storage->quality;
263
264 /* Find the render size to guess the Strength value. The node tree might not belong to a scene,
265 * so we just assume an arbitrary HDTV 1080p render size. */
266 blender::int2 render_size;
267 if (scene) {
268 BKE_render_resolution(&scene->r, true, &render_size.x, &render_size.y);
269 }
270 else {
271 render_size = blender::int2(1920, 1080);
272 }
273
274 const blender::int2 highlights_size = render_size / quality_factor;
275
277 node_tree, node, SOCK_IN, SOCK_FLOAT, PROP_FACTOR, "Size", "Size");
278 const float size_value = size->default_value_typed<bNodeSocketValueFloat>()->value;
279
280 /* See the compute_bloom_chain_length method in the glare code. */
281 const int smaller_dimension = blender::math::reduce_min(highlights_size);
282 const float scaled_dimension = smaller_dimension * size_value;
283 const int chain_length = int(std::log2(blender::math::max(1.0f, scaled_dimension)));
284
285 auto scale_strength = [chain_length](const float strength) { return strength * chain_length; };
286
288 node_tree, node, SOCK_IN, SOCK_FLOAT, PROP_FACTOR, "Strength", "Strength");
289 strength_input->default_value_typed<bNodeSocketValueFloat>()->value = scale_strength(
290 strength_input->default_value_typed<bNodeSocketValueFloat>()->value);
291
292 /* Compute the RNA path of the strength input. */
293 char escaped_node_name[sizeof(node->name) * 2 + 1];
294 BLI_str_escape(escaped_node_name, node->name, sizeof(escaped_node_name));
295 const std::string strength_rna_path = fmt::format("nodes[\"{}\"].inputs[4].default_value",
296 escaped_node_name);
297
298 /* Scale F-Curve. */
299 BKE_fcurves_id_cb(&node_tree->id, [&](ID * /*id*/, FCurve *fcurve) {
300 if (strength_rna_path == fcurve->rna_path) {
301 adjust_fcurve_key_frame_values(
302 fcurve, PROP_FLOAT, [&](const float value) { return scale_strength(value); });
303 }
304 });
305}
306
308 const Scene *scene,
309 bNodeTree *node_tree,
310 blender::Set<bNodeTree *> &node_trees_already_versioned)
311{
312 if (node_trees_already_versioned.contains(node_tree)) {
313 return;
314 }
315
316 LISTBASE_FOREACH (bNode *, node, &node_tree->nodes) {
317 if (node->type_legacy == CMP_NODE_GLARE) {
318 do_version_glare_node_bloom_strength(scene, node_tree, node);
319 }
320 else if (node->is_group()) {
321 bNodeTree *child_tree = reinterpret_cast<bNodeTree *>(node->id);
322 if (child_tree) {
324 scene, child_tree, node_trees_already_versioned);
325 }
326 }
327 }
328
329 node_trees_already_versioned.add_new(node_tree);
330}
331
332/* Previously, color to float implicit conversion happened by taking the average, while now it uses
333 * luminance coefficients. So we need to convert all implicit conversions manually by adding a
334 * normal node to sum the color components then divide them by an appropriate factor. The normal
335 * node compute negative the dot product with its output vector, which is normalized. So if we
336 * supply a vector of (-1, -1, -1), we will get the dot product multiplied by 1 / sqrt(3) due to
337 * normalization. So if we want the average, we need to multiply by the normalization factor, then
338 * divide by 3. */
340{
341 /* Stores a mapping between an output and the final link of the versioning node tree that was
342 * added for it, in order to share the same versioning node tree with potentially multiple
343 * outgoing links from that same output. */
344 blender::Map<bNodeSocket *, bNodeLink *> color_to_float_links;
345 LISTBASE_FOREACH_BACKWARD_MUTABLE (bNodeLink *, link, &node_tree->links) {
346 if (!(link->fromsock->type == SOCK_RGBA && link->tosock->type == SOCK_FLOAT)) {
347 continue;
348 }
349
350 /* If that output was versioned before, just connect the existing link. */
351 bNodeLink *existing_link = color_to_float_links.lookup_default(link->fromsock, nullptr);
352 if (existing_link) {
353 version_node_add_link(*node_tree,
354 *existing_link->fromnode,
355 *existing_link->fromsock,
356 *link->tonode,
357 *link->tosock);
358 blender::bke::node_remove_link(node_tree, *link);
359 continue;
360 }
361
362 /* Add a hidden dot product node. */
363 bNode *dot_product_node = blender::bke::node_add_static_node(
364 nullptr, *node_tree, CMP_NODE_NORMAL);
365 dot_product_node->flag |= NODE_HIDDEN;
366 dot_product_node->location[0] = link->fromnode->location[0] + link->fromnode->width + 10.0f;
367 dot_product_node->location[1] = link->fromnode->location[1];
368
369 /* Link the source socket to the dot product input. */
371 node_tree, dot_product_node, SOCK_IN, SOCK_VECTOR, PROP_NONE, "Normal", "Normal");
373 *node_tree, *link->fromnode, *link->fromsock, *dot_product_node, *dot_product_input);
374
375 /* Assign (-1, -1, -1) to the dot product output, which stores the second vector for the
376 * dot product. Notice that negative sign, since the node actually returns negative the dot
377 * product. */
378 bNodeSocket *dot_product_normal_output = version_node_add_socket_if_not_exist(
379 node_tree, dot_product_node, SOCK_OUT, SOCK_VECTOR, PROP_NONE, "Normal", "Normal");
380 copy_v3_fl(dot_product_normal_output->default_value_typed<bNodeSocketValueVector>()->value,
381 -1.0f);
382
383 /* Add a hidden multiply node. */
384 bNode *multiply_node = blender::bke::node_add_static_node(nullptr, *node_tree, CMP_NODE_MATH);
385 multiply_node->custom1 = NODE_MATH_MULTIPLY;
386 multiply_node->flag |= NODE_HIDDEN;
387 multiply_node->location[0] = dot_product_node->location[0] + dot_product_node->width + 10.0f;
388 multiply_node->location[1] = dot_product_node->location[1];
389
390 /* Link the dot product output with the first input of the multiply node. */
391 bNodeSocket *dot_product_dot_output = version_node_add_socket_if_not_exist(
392 node_tree, dot_product_node, SOCK_OUT, SOCK_FLOAT, PROP_NONE, "Dot", "Dot");
393 bNodeSocket *multiply_input_a = static_cast<bNodeSocket *>(
394 BLI_findlink(&multiply_node->inputs, 0));
396 *node_tree, *dot_product_node, *dot_product_dot_output, *multiply_node, *multiply_input_a);
397
398 /* Set the second input to sqrt(3) / 3 as described in the function description. */
399 bNodeSocket *multiply_input_b = static_cast<bNodeSocket *>(
400 BLI_findlink(&multiply_node->inputs, 1));
401 multiply_input_b->default_value_typed<bNodeSocketValueFloat>()->value =
403
404 /* Link the multiply node output to the link target. */
406 node_tree, multiply_node, SOCK_OUT, SOCK_FLOAT, PROP_NONE, "Value", "Value");
407 bNodeLink *final_link = &version_node_add_link(
408 *node_tree, *multiply_node, *multiply_output, *link->tonode, *link->tosock);
409
410 /* Add the new link to the cache. */
411 color_to_float_links.add_new(link->fromsock, final_link);
412
413 /* Remove the old link. */
414 blender::bke::node_remove_link(node_tree, *link);
415 }
416}
417
419{
420 LISTBASE_FOREACH_MUTABLE (bNode *, node, &node_tree->nodes) {
421 if (node->type_legacy != SH_NODE_BUMP) {
422 continue;
423 }
424
425 bNodeSocket *filter_width_input = blender::bke::node_find_socket(
426 *node, SOCK_IN, "Filter Width");
427 if (filter_width_input) {
428 *version_cycles_node_socket_float_value(filter_width_input) = 1.0f;
429 }
430 }
431}
432
434{
435 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 2)) {
439 }
440
441 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 7)) {
442 constexpr char SCE_SNAP_TO_NODE_X = (1 << 0);
443 constexpr char SCE_SNAP_TO_NODE_Y = (1 << 1);
444 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
445 if (scene->toolsettings->snap_node_mode & SCE_SNAP_TO_NODE_X ||
446 scene->toolsettings->snap_node_mode & SCE_SNAP_TO_NODE_Y)
447 {
448 scene->toolsettings->snap_node_mode = SCE_SNAP_TO_GRID;
449 }
450 }
451 }
452
453 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 18)) {
454 blender::Set<bNodeTree *> node_trees_already_versioned;
455 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
456 bNodeTree *node_tree = scene->nodetree;
457 if (!node_tree) {
458 continue;
459 }
461 scene, node_tree, node_trees_already_versioned);
462 }
463
464 /* The above loop versioned all node trees used in a scene, but other node trees might exist
465 * that are not used in a scene. For those, assume the first scene in the file, as this is
466 * better than not doing versioning at all. */
467 Scene *scene = static_cast<Scene *>(bmain->scenes.first);
468 LISTBASE_FOREACH (bNodeTree *, node_tree, &bmain->nodetrees) {
469 if (node_trees_already_versioned.contains(node_tree)) {
470 continue;
471 }
472
473 LISTBASE_FOREACH (bNode *, node, &node_tree->nodes) {
474 if (node->type_legacy == CMP_NODE_GLARE) {
475 do_version_glare_node_options_to_inputs(scene, node_tree, node);
476 }
477 }
478 node_trees_already_versioned.add_new(node_tree);
479 }
480 }
481
482 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 19)) {
483 /* Two new inputs were added, Saturation and Tint. */
485 }
486
487 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 20)) {
488 /* Two new inputs were added, Highlights Smoothness and Highlights suppression. */
490 }
491
492 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 21)) {
493 blender::Set<bNodeTree *> node_trees_already_versioned;
494 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
495 bNodeTree *node_tree = scene->nodetree;
496 if (!node_tree) {
497 continue;
498 }
500 scene, node_tree, node_trees_already_versioned);
501 }
502
503 /* The above loop versioned all node trees used in a scene, but other node trees might exist
504 * that are not used in a scene. For those, assume the first scene in the file, as this is
505 * better than not doing versioning at all. */
506 Scene *scene = static_cast<Scene *>(bmain->scenes.first);
507 LISTBASE_FOREACH (bNodeTree *, node_tree, &bmain->nodetrees) {
508 if (node_trees_already_versioned.contains(node_tree)) {
509 continue;
510 }
511
512 LISTBASE_FOREACH (bNode *, node, &node_tree->nodes) {
513 if (node->type_legacy == CMP_NODE_GLARE) {
514 do_version_glare_node_bloom_strength(scene, node_tree, node);
515 }
516 }
517 node_trees_already_versioned.add_new(node_tree);
518 }
519 }
520
521 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 25)) {
522 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
523 if (!scene->adt) {
524 continue;
525 }
526 using namespace blender;
527 auto replace_rna_path_prefix =
528 [](FCurve &fcurve, const StringRef old_prefix, const StringRef new_prefix) {
529 const StringRef rna_path = fcurve.rna_path;
530 if (!rna_path.startswith(old_prefix)) {
531 return;
532 }
533 const StringRef tail = rna_path.drop_prefix(old_prefix.size());
534 char *new_rna_path = BLI_strdupcat(new_prefix.data(), tail.data());
535 MEM_freeN(fcurve.rna_path);
536 fcurve.rna_path = new_rna_path;
537 };
538 if (scene->adt->action) {
539 animrig::foreach_fcurve_in_action(scene->adt->action->wrap(), [&](FCurve &fcurve) {
540 replace_rna_path_prefix(fcurve, "sequence_editor.sequences", "sequence_editor.strips");
541 });
542 }
543 LISTBASE_FOREACH (FCurve *, driver, &scene->adt->drivers) {
544 replace_rna_path_prefix(*driver, "sequence_editor.sequences", "sequence_editor.strips");
545 }
546 }
547 }
548
549 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 27)) {
550 FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
551 if (ntree->type == NTREE_COMPOSIT) {
553 }
554 else if (ntree->type == NTREE_SHADER) {
556 }
557 }
559 }
560}
561
562static bool versioning_convert_seq_text_anchor(Strip *strip, void * /*user_data*/)
563{
564 if (strip->type != STRIP_TYPE_TEXT || strip->effectdata == nullptr) {
565 return true;
566 }
567
568 TextVars *data = static_cast<TextVars *>(strip->effectdata);
569 data->anchor_x = data->align;
570 data->anchor_y = data->align_y;
572
573 return true;
574}
575
577{
578 LISTBASE_FOREACH (bNodeTree *, ntree, &bmain.nodetrees) {
579 if (ntree->type == NTREE_GEOMETRY) {
580 LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
581 if (node->type_legacy == GEO_NODE_SUBDIVISION_SURFACE) {
583 ntree, node, SOCK_IN, SOCK_BOOLEAN, PROP_NONE, "Limit Surface", "Limit Surface");
584 static_cast<bNodeSocketValueBoolean *>(socket->default_value)->value = false;
585 }
586 }
587 }
588 }
589}
590
592{
593 using namespace blender;
594 Set<bNode *> triangulate_nodes;
595 LISTBASE_FOREACH (bNode *, node, &tree->nodes) {
596 if (node->type_legacy == GEO_NODE_TRIANGULATE) {
597 triangulate_nodes.add(node);
598 }
599 }
600
602 LISTBASE_FOREACH (bNodeLink *, link, &tree->links) {
603 if (triangulate_nodes.contains(link->tonode)) {
604 input_links.add_new(link->tosock, link);
605 }
606 }
607
608 for (bNode *triangulate : triangulate_nodes) {
609 bNodeSocket *selection = bke::node_find_socket(*triangulate, SOCK_IN, "Selection");
610 bNodeSocket *min_verts = bke::node_find_socket(*triangulate, SOCK_IN, "Minimum Vertices");
611 if (!min_verts) {
612 /* Make versioning idempotent. */
613 continue;
614 }
615 const int old_min_verts = static_cast<bNodeSocketValueInt *>(min_verts->default_value)->value;
616 if (!input_links.contains(min_verts) && old_min_verts <= 4) {
617 continue;
618 }
619 bNode &corners_of_face = version_node_add_empty(*tree, "GeometryNodeCornersOfFace");
621 tree, &corners_of_face, SOCK_IN, SOCK_INT, PROP_NONE, "Face Index", "Face Index");
623 tree, &corners_of_face, SOCK_IN, SOCK_FLOAT, PROP_NONE, "Weights", "Weights");
625 tree, &corners_of_face, SOCK_IN, SOCK_INT, PROP_NONE, "Sort Index", "Sort Index");
627 tree, &corners_of_face, SOCK_OUT, SOCK_INT, PROP_NONE, "Corner Index", "Corner Index");
629 tree, &corners_of_face, SOCK_OUT, SOCK_INT, PROP_NONE, "Total", "Total");
630 corners_of_face.locx_legacy = triangulate->locx_legacy - 200;
631 corners_of_face.locy_legacy = triangulate->locy_legacy - 50;
632 corners_of_face.parent = triangulate->parent;
633 LISTBASE_FOREACH (bNodeSocket *, socket, &corners_of_face.inputs) {
634 socket->flag |= SOCK_HIDDEN;
635 }
636 LISTBASE_FOREACH (bNodeSocket *, socket, &corners_of_face.outputs) {
637 if (!STREQ(socket->identifier, "Total")) {
638 socket->flag |= SOCK_HIDDEN;
639 }
640 }
641
642 bNode &greater_or_equal = version_node_add_empty(*tree, "FunctionNodeCompare");
643 auto *compare_storage = MEM_callocN<NodeFunctionCompare>(__func__);
644 compare_storage->operation = NODE_COMPARE_GREATER_EQUAL;
645 compare_storage->data_type = SOCK_INT;
646 greater_or_equal.storage = compare_storage;
648 tree, &greater_or_equal, SOCK_IN, SOCK_INT, PROP_NONE, "A_INT", "A");
650 tree, &greater_or_equal, SOCK_IN, SOCK_INT, PROP_NONE, "B_INT", "B");
652 tree, &greater_or_equal, SOCK_OUT, SOCK_BOOLEAN, PROP_NONE, "Result", "Result");
653 greater_or_equal.locx_legacy = triangulate->locx_legacy - 100;
654 greater_or_equal.locy_legacy = triangulate->locy_legacy - 50;
655 greater_or_equal.parent = triangulate->parent;
656 greater_or_equal.flag &= ~NODE_OPTIONS;
658 corners_of_face,
659 *bke::node_find_socket(*&corners_of_face, SOCK_OUT, "Total"),
660 greater_or_equal,
661 *bke::node_find_socket(*&greater_or_equal, SOCK_IN, "A_INT"));
662 if (bNodeLink **min_verts_link = input_links.lookup_ptr(min_verts)) {
663 (*min_verts_link)->tonode = &greater_or_equal;
664 (*min_verts_link)->tosock = bke::node_find_socket(*&greater_or_equal, SOCK_IN, "B_INT");
665 }
666 else {
667 bNodeSocket *new_min_verts = bke::node_find_socket(*&greater_or_equal, SOCK_IN, "B_INT");
668 static_cast<bNodeSocketValueInt *>(new_min_verts->default_value)->value = old_min_verts;
669 }
670
671 if (bNodeLink **selection_link = input_links.lookup_ptr(selection)) {
672 bNode &boolean_and = version_node_add_empty(*tree, "FunctionNodeBooleanMath");
674 tree, &boolean_and, SOCK_IN, SOCK_BOOLEAN, PROP_NONE, "Boolean", "Boolean");
676 tree, &boolean_and, SOCK_IN, SOCK_BOOLEAN, PROP_NONE, "Boolean_001", "Boolean");
678 tree, &boolean_and, SOCK_OUT, SOCK_BOOLEAN, PROP_NONE, "Boolean", "Boolean");
679 boolean_and.locx_legacy = triangulate->locx_legacy - 75;
680 boolean_and.locy_legacy = triangulate->locy_legacy - 50;
681 boolean_and.parent = triangulate->parent;
682 boolean_and.flag &= ~NODE_OPTIONS;
683 boolean_and.custom1 = NODE_BOOLEAN_MATH_AND;
684
685 (*selection_link)->tonode = &boolean_and;
686 (*selection_link)->tosock = bke::node_find_socket(*&boolean_and, SOCK_IN, "Boolean");
688 greater_or_equal,
689 *bke::node_find_socket(*&greater_or_equal, SOCK_OUT, "Result"),
690 boolean_and,
691 *bke::node_find_socket(*&boolean_and, SOCK_IN, "Boolean_001"));
692
694 boolean_and,
695 *bke::node_find_socket(*&boolean_and, SOCK_OUT, "Boolean"),
696 *triangulate,
697 *selection);
698 }
699 else {
701 greater_or_equal,
702 *bke::node_find_socket(*&greater_or_equal, SOCK_OUT, "Result"),
703 *triangulate,
704 *selection);
705 }
706
707 /* Make versioning idempotent. */
708 bke::node_remove_socket(*tree, *triangulate, *min_verts);
709 }
710}
711
713{
714 LISTBASE_FOREACH (FModifier *, fcurve_modifier, &fcurve.modifiers) {
715 if (fcurve_modifier->type != FMODIFIER_TYPE_NOISE) {
716 continue;
717 }
718 FMod_Noise *data = static_cast<FMod_Noise *>(fcurve_modifier->data);
719 data->lacunarity = 2.0f;
720 data->roughness = 0.5f;
721 data->legacy_noise = true;
722 }
723}
724
726{
727 LISTBASE_FOREACH (bNode *, node, &ntree.nodes) {
728 node->location[0] = node->locx_legacy;
729 node->location[1] = node->locy_legacy;
730 for (const bNode *parent = node->parent; parent; parent = parent->parent) {
731 node->location[0] += parent->locx_legacy;
732 node->location[1] += parent->locy_legacy;
733 }
734
735 node->location[0] += node->offsetx_legacy;
736 node->location[1] += node->offsety_legacy;
737 node->offsetx_legacy = 0.0f;
738 node->offsety_legacy = 0.0f;
739 }
740}
741
748{
749 LISTBASE_FOREACH (bNode *, node, &ntree.nodes) {
750 if (!node->is_group_input()) {
751 continue;
752 }
753 LISTBASE_FOREACH (bNodeSocket *, socket, &node->outputs) {
754 switch (socket->type) {
755 case SOCK_OBJECT:
756 socket->default_value_typed<bNodeSocketValueObject>()->value = nullptr;
757 break;
758 case SOCK_IMAGE:
759 socket->default_value_typed<bNodeSocketValueImage>()->value = nullptr;
760 break;
761 case SOCK_COLLECTION:
762 socket->default_value_typed<bNodeSocketValueCollection>()->value = nullptr;
763 break;
764 case SOCK_TEXTURE:
765 socket->default_value_typed<bNodeSocketValueTexture>()->value = nullptr;
766 break;
767 case SOCK_MATERIAL:
768 socket->default_value_typed<bNodeSocketValueMaterial>()->value = nullptr;
769 break;
770 }
771 }
772 }
773}
774
775static bool versioning_clear_strip_unused_flag(Strip *strip, void * /*user_data*/)
776{
777 strip->flag &= ~(1 << 6);
778 return true;
779}
780
782{
783 if (ntree.type == NTREE_GEOMETRY) {
784 LISTBASE_FOREACH (bNode *, node, &ntree.nodes) {
785 if (STREQ(node->idname, "GeometryNodeInputNormal")) {
786 node->custom1 = 1;
787 }
788 }
789 }
790}
791
793{
794 LISTBASE_FOREACH_MUTABLE (bNode *, node, &node_tree->nodes) {
795 if (node->type_legacy != CMP_NODE_VIEWER) {
796 continue;
797 }
798 /* custom1 was previously used for Tile Order for the Tiled Compositor. */
799 node->custom1 = NODE_VIEWER_SHORTCUT_NONE;
800 }
801}
802
803void blo_do_versions_440(FileData *fd, Library * /*lib*/, Main *bmain)
804{
805 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 1)) {
806 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
808 if (ed != nullptr) {
810 }
811 }
812 }
813
814 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 4)) {
815 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
816 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
817 LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
818 if (sl->spacetype != SPACE_FILE) {
819 continue;
820 }
821 SpaceFile *sfile = reinterpret_cast<SpaceFile *>(sl);
822 if (sfile->asset_params) {
824 }
825 }
826 }
827 }
828 }
829
830 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 6)) {
832 }
833
834 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 8)) {
835 LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
836 if (ntree->type == NTREE_GEOMETRY) {
838 }
839 }
840 }
841
842 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 10)) {
843 LISTBASE_FOREACH (bAction *, dna_action, &bmain->actions) {
844 blender::animrig::Action &action = dna_action->wrap();
846 action, [&](FCurve &fcurve) { version_fcurve_noise_modifier(fcurve); });
847 }
848
849 ID *id;
850 FOREACH_MAIN_ID_BEGIN (bmain, id) {
852 if (!adt) {
853 continue;
854 }
855
856 LISTBASE_FOREACH (FCurve *, fcu, &adt->drivers) {
858 }
859 }
861 }
862
863 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 11)) {
864 /* #update_paint_modes_for_brush_assets() didn't handle image editor tools for some time. 4.3
865 * files saved during that period could have invalid tool references stored. */
866 LISTBASE_FOREACH (WorkSpace *, workspace, &bmain->workspaces) {
867 LISTBASE_FOREACH (bToolRef *, tref, &workspace->tools) {
868 if (tref->space_type == SPACE_IMAGE && tref->mode == SI_MODE_PAINT) {
869 STRNCPY(tref->idname, "builtin.brush");
870 }
871 }
872 }
873 }
874
875 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 12)) {
876 FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
878 }
880 }
881
882 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 13)) {
883 LISTBASE_FOREACH (Object *, object, &bmain->objects) {
884 LISTBASE_FOREACH (ModifierData *, modifier, &object->modifiers) {
885 if (modifier->type != eModifierType_Nodes) {
886 continue;
887 }
888 NodesModifierData *nmd = reinterpret_cast<NodesModifierData *>(modifier);
889 if (!nmd->settings.properties) {
890 continue;
891 }
893 if (idprop->type != IDP_STRING) {
894 continue;
895 }
896 blender::StringRef prop_name(idprop->name);
897 if (prop_name.endswith("_attribute_name") || prop_name.endswith("_use_attribute")) {
899 }
900 }
901 }
902 }
903 }
904
905 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 14)) {
906 LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
908 }
909 }
910
911 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 15)) {
912 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
914 if (ed != nullptr) {
916 }
917 }
918 }
919
920 /* Fix incorrect identifier in the shader mix node. */
921 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 16)) {
922 FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
923 if (ntree->type == NTREE_SHADER) {
924 LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
925 if (node->type_legacy == SH_NODE_MIX_SHADER) {
926 LISTBASE_FOREACH (bNodeSocket *, socket, &node->inputs) {
927 if (STREQ(socket->identifier, "Shader.001")) {
928 STRNCPY(socket->identifier, "Shader_001");
929 }
930 }
931 }
932 }
933 }
934 }
936 }
937
938 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 17)) {
939 if (!DNA_struct_member_exists(
940 fd->filesdna, "RenderData", "RenderSettings", "compositor_denoise_preview_quality"))
941 {
942 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
943 scene->r.compositor_denoise_preview_quality = SCE_COMPOSITOR_DENOISE_BALANCED;
944 }
945 }
946 if (!DNA_struct_member_exists(
947 fd->filesdna, "RenderData", "RenderSettings", "compositor_denoise_final_quality"))
948 {
949 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
950 scene->r.compositor_denoise_final_quality = SCE_COMPOSITOR_DENOISE_HIGH;
951 }
952 }
953 }
954
955 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 22)) {
956 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
957 IDProperty *cscene = version_cycles_properties_from_ID(&scene->id);
958 if (cscene) {
959 if (version_cycles_property_int(cscene, "sample_offset", 0) > 0) {
960 version_cycles_property_boolean_set(cscene, "use_sample_subset", true);
961 version_cycles_property_int_set(cscene, "sample_subset_length", (1 << 24));
962 }
963 }
964 }
965 }
966
967 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 23)) {
968 if (!DNA_struct_member_exists(fd->filesdna, "Curves", "float", "surface_collision_distance")) {
969 LISTBASE_FOREACH (Curves *, curves, &bmain->hair_curves) {
970 curves->surface_collision_distance = 0.005f;
971 }
972 }
973 }
974
975 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 24)) {
976 LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
978 }
979 }
980
981 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 26)) {
982 const Brush *default_brush = DNA_struct_default_get(Brush);
983 LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
984 if ((brush->mask_stencil_dimension[0] == 0) && (brush->mask_stencil_dimension[1] == 0)) {
985 brush->mask_stencil_dimension[0] = default_brush->mask_stencil_dimension[0];
986 brush->mask_stencil_dimension[1] = default_brush->mask_stencil_dimension[1];
987 }
988 if ((brush->mask_stencil_pos[0] == 0) && (brush->mask_stencil_pos[1] == 0)) {
989 brush->mask_stencil_pos[0] = default_brush->mask_stencil_pos[0];
990 brush->mask_stencil_pos[1] = default_brush->mask_stencil_pos[1];
991 }
992 }
993 }
994
995 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 27)) {
996 FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
997 if (ntree->type == NTREE_COMPOSIT) {
999 }
1000 }
1002 }
1003
1004 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 28)) {
1005 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1006 SequencerToolSettings *sequencer_tool_settings = blender::seq::tool_settings_ensure(scene);
1007 sequencer_tool_settings->snap_mode |= SEQ_SNAP_TO_RETIMING;
1008 }
1009 }
1010
1011 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 29)) {
1012 LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
1013 ToolSettings *ts = scene->toolsettings;
1014 ts->imapaint.clone_alpha = 0.5f;
1015 }
1016 }
1017
1018 if (!MAIN_VERSION_FILE_ATLEAST(bmain, 404, 30)) {
1019 LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
1020 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1021 LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1022 if (ELEM(sl->spacetype, SPACE_ACTION, SPACE_INFO, SPACE_CONSOLE)) {
1023 ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
1024 &sl->regionbase;
1025 LISTBASE_FOREACH (ARegion *, region, regionbase) {
1026 if (region->regiontype == RGN_TYPE_WINDOW) {
1027 region->v2d.scroll |= V2D_SCROLL_RIGHT | V2D_SCROLL_VERTICAL_HIDE;
1028 }
1029 }
1030 }
1031 }
1032 }
1033 }
1034 }
1035}
Functions and classes to work with Actions.
Functionality to iterate an Action in various ways.
Versioning of old animation data. Most animation versioning code lives in the versioning_xxx....
AnimData * BKE_animdata_from_id(const ID *id)
Definition anim_data.cc:82
void BKE_fcurves_id_cb(struct ID *id, blender::FunctionRef< void(ID *, FCurve *)> func)
#define FOREACH_MAIN_ID_END
Definition BKE_main.hh:563
#define MAIN_VERSION_FILE_ATLEAST(main, ver, subver)
Definition BKE_main.hh:634
#define FOREACH_MAIN_ID_BEGIN(_bmain, _id)
Definition BKE_main.hh:557
#define FOREACH_NODETREE_END
Definition BKE_node.hh:866
#define FOREACH_NODETREE_BEGIN(bmain, _nodetree, _id)
Definition BKE_node.hh:856
#define GEO_NODE_TRIANGULATE
#define SH_NODE_MIX_SHADER
#define GEO_NODE_SUBDIVISION_SURFACE
#define CMP_NODE_VIEWER
#define SH_NODE_BUMP
#define CMP_NODE_GLARE
#define CMP_NODE_MATH
#define CMP_NODE_NORMAL
void BKE_render_resolution(const RenderData *r, const bool use_crop, int *r_width, int *r_height)
Definition scene.cc:2927
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:534
#define LISTBASE_FOREACH(type, var, list)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
#define LISTBASE_FOREACH_BACKWARD_MUTABLE(type, var, list)
MINLINE void copy_v3_fl(float r[3], float f)
char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
char * BLI_strdupcat(const char *__restrict str1, const char *__restrict str2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
char * STRNCPY(char(&dst)[N], const char *src)
Definition BLI_string.h:688
int bool bool BLI_str_endswith(const char *__restrict str, const char *__restrict end) ATTR_NONNULL(1
size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define ELEM(...)
#define STREQ(a, b)
@ IDP_STRING
@ IDP_FLAG_STATIC_TYPE
@ IDP_FLAG_OVERRIDABLE_LIBRARY
@ FMODIFIER_TYPE_NOISE
#define DNA_struct_default_get(struct_name)
blenloader genfile private function prototypes
@ eModifierType_Nodes
@ NODE_OPTIONS
@ NODE_HIDDEN
@ NTREE_SHADER
@ NTREE_GEOMETRY
@ NTREE_COMPOSIT
@ NODE_MATH_MULTIPLY
@ SOCK_OUT
@ SOCK_IN
@ NODE_VIEWER_SHORTCUT_NONE
@ SOCK_HIDDEN
@ SOCK_INT
@ SOCK_TEXTURE
@ SOCK_VECTOR
@ SOCK_BOOLEAN
@ SOCK_MATERIAL
@ SOCK_FLOAT
@ SOCK_IMAGE
@ SOCK_COLLECTION
@ SOCK_OBJECT
@ SOCK_RGBA
@ NODE_BOOLEAN_MATH_AND
@ NODE_COMPARE_GREATER_EQUAL
@ CMP_NODE_GLARE_BLOOM
@ SCE_COMPOSITOR_DENOISE_BALANCED
@ SCE_COMPOSITOR_DENOISE_HIGH
@ SEQ_SNAP_TO_RETIMING
@ SCE_SNAP_TO_GRID
@ RGN_TYPE_WINDOW
@ STRIP_TYPE_TEXT
@ SEQ_TEXT_ALIGN_X_LEFT
@ FILE_SORT_ASSET_CATALOG
@ SPACE_ACTION
@ SPACE_CONSOLE
@ SPACE_FILE
@ SPACE_IMAGE
@ SPACE_INFO
@ SI_MODE_PAINT
@ V2D_SCROLL_VERTICAL_HIDE
@ V2D_SCROLL_RIGHT
@ PROP_FLOAT
Definition RNA_types.hh:152
@ PROP_ANGLE
Definition RNA_types.hh:240
@ PROP_NONE
Definition RNA_types.hh:221
@ PROP_FACTOR
Definition RNA_types.hh:239
BMesh const char void * data
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
const Value * lookup_ptr(const Key &key) const
Definition BLI_map.hh:508
void add_new(const Key &key, const Value &value)
Definition BLI_map.hh:265
bool contains(const Key &key) const
Definition BLI_map.hh:353
bool contains(const Key &key) const
Definition BLI_set.hh:310
bool add(const Key &key)
Definition BLI_set.hh:248
constexpr StringRef drop_prefix(int64_t n) const
Value lookup_default(const Key &key, const Value &default_value) const
Definition BLI_map.hh:570
void add_new(const Key &key, const Value &value)
Definition BLI_map.hh:265
bool contains(const Key &key) const
Definition BLI_set.hh:310
void add_new(const Key &key)
Definition BLI_set.hh:233
constexpr bool startswith(StringRef prefix) const
constexpr bool endswith(StringRef suffix) const
constexpr const char * data() const
KDTree_3d * tree
#define mix(a, b, c)
Definition hash.h:35
void * MEM_callocN(size_t len, const char *str)
Definition mallocn.cc:118
void MEM_freeN(void *vmemh)
Definition mallocn.cc:113
void convert_legacy_action_assignments(Main &bmain, ReportList *reports)
void convert_legacy_animato_actions(Main &bmain)
Definition versioning.cc:57
void tag_action_users_for_slotted_actions_conversion(Main &bmain)
void foreach_fcurve_in_action(Action &action, FunctionRef< void(FCurve &fcurve)> callback)
bNodeSocket * node_find_socket(bNode &node, eNodeSocketInOut in_out, StringRef identifier)
Definition node.cc:2864
void node_remove_socket(bNodeTree &ntree, bNode &node, bNodeSocket &sock)
Definition node.cc:3575
void node_remove_link(bNodeTree *ntree, bNodeLink &link)
Definition node.cc:4124
bNode * node_add_static_node(const bContext *C, bNodeTree &ntree, int type)
Definition node.cc:3804
bNodeLink & node_add_link(bNodeTree &ntree, bNode &fromnode, bNodeSocket &fromsock, bNode &tonode, bNodeSocket &tosock)
Definition node.cc:4087
T pow(const T &x, const T &power)
T clamp(const T &a, const T &min, const T &max)
T reduce_max(const VecBase< T, Size > &a)
T reduce_min(const VecBase< T, Size > &a)
T min(const T &a, const T &b)
T max(const T &a, const T &b)
Editing * editing_get(const Scene *scene)
Definition sequencer.cc:272
void for_each_callback(ListBase *seqbase, ForEachFunc callback, void *user_data)
Definition iterator.cc:59
SequencerToolSettings * tool_settings_ensure(Scene *scene)
Definition sequencer.cc:362
VecBase< int32_t, 2 > int2
CCL_NAMESPACE_BEGIN ccl_device float fade(const float t)
Definition noise.h:18
ListBase drivers
float mask_stencil_pos[2]
float mask_stencil_dimension[2]
char * rna_path
ListBase modifiers
FileSelectParams base_params
BlendFileReadReport * reports
Definition readfile.hh:165
SDNA * filesdna
Definition readfile.hh:103
ListBase group
Definition DNA_ID.h:138
IDPropertyData data
Definition DNA_ID.h:159
Definition DNA_ID.h:404
void * first
ListBase brushes
Definition BKE_main.hh:271
ListBase scenes
Definition BKE_main.hh:245
ListBase actions
Definition BKE_main.hh:269
ListBase hair_curves
Definition BKE_main.hh:289
ListBase nodetrees
Definition BKE_main.hh:270
ListBase screens
Definition BKE_main.hh:261
ListBase workspaces
Definition BKE_main.hh:284
ListBase objects
Definition BKE_main.hh:247
struct NodesModifierSettings settings
struct IDProperty * properties
struct RenderData r
FileAssetSelectParams * asset_params
void * effectdata
struct ImagePaintSettings imapaint
void * default_value
ListBase nodes
ListBase links
float location[2]
int16_t custom1
float width
ListBase inputs
float locx_legacy
struct bNode * parent
char name[64]
float locy_legacy
void * storage
ListBase outputs
static bool versioning_convert_seq_text_anchor(Strip *strip, void *)
static void version_node_locations_to_global(bNodeTree &ntree)
static bool versioning_clear_strip_unused_flag(Strip *strip, void *)
static void do_version_bump_filter_width(bNodeTree *node_tree)
void do_versions_after_linking_440(FileData *fd, Main *bmain)
static void remove_triangulate_node_min_size_input(bNodeTree *tree)
static void do_version_color_to_float_conversion(bNodeTree *node_tree)
void blo_do_versions_440(FileData *fd, Library *, Main *bmain)
static void do_version_glare_node_bloom_strength_recursive(const Scene *scene, bNodeTree *node_tree, blender::Set< bNodeTree * > &node_trees_already_versioned)
static void do_version_glare_node_options_to_inputs(const Scene *scene, bNodeTree *node_tree, bNode *node)
static void version_geometry_normal_input_node(bNodeTree &ntree)
static void add_subsurf_node_limit_surface_option(Main &bmain)
static void version_group_input_socket_data_block_reference(bNodeTree &ntree)
static void do_version_glare_node_options_to_inputs_recursive(const Scene *scene, bNodeTree *node_tree, blender::Set< bNodeTree * > &node_trees_already_versioned)
static void do_version_glare_node_bloom_strength(const Scene *scene, bNodeTree *node_tree, bNode *node)
static void do_version_viewer_shortcut(bNodeTree *node_tree)
static void version_fcurve_noise_modifier(FCurve &fcurve)
float * version_cycles_node_socket_float_value(bNodeSocket *socket)
void version_cycles_property_int_set(IDProperty *idprop, const char *name, int value)
IDProperty * version_cycles_properties_from_ID(ID *id)
int version_cycles_property_int(IDProperty *idprop, const char *name, int default_value)
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)
bNode & version_node_add_empty(bNodeTree &ntree, const char *idname)
bNodeLink & version_node_add_link(bNodeTree &ntree, bNode &node_a, bNodeSocket &socket_a, bNode &node_b, bNodeSocket &socket_b)
bNodeSocket * version_node_add_socket_if_not_exist(bNodeTree *ntree, bNode *node, int in_out, int type, int subtype, const char *identifier, const char *name)
void version_cycles_property_boolean_set(IDProperty *idprop, const char *name, bool value)
static void adjust_fcurve_key_frame_values(FCurve *fcurve, const PropertyType property_type, const Function &function)