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