|
Blender V5.0
|
#include <cstring>#include "DNA_node_types.h"#include "DNA_screen_types.h"#include "DNA_sequence_types.h"#include "BLI_listbase.h"#include "BLI_map.hh"#include "BLI_string.h"#include "BLI_string_ref.hh"#include "BLI_string_utf8.h"#include "BKE_animsys.h"#include "BKE_grease_pencil_legacy_convert.hh"#include "BKE_idprop.hh"#include "BKE_lib_id.hh"#include "BKE_lib_override.hh"#include "BKE_library.hh"#include "BKE_main.hh"#include "BKE_main_namemap.hh"#include "BKE_mesh_legacy_convert.hh"#include "BKE_node.hh"#include "BKE_node_legacy_types.hh"#include "BKE_node_runtime.hh"#include "BKE_node_tree_update.hh"#include "BKE_report.hh"#include "BKE_screen.hh"#include "ANIM_versioning.hh"#include "NOD_socket.hh"#include "BLT_translation.hh"#include "SEQ_sequencer.hh"#include "MEM_guardedalloc.h"#include "BLO_readfile.hh"#include "readfile.hh"#include "versioning_common.hh"Go to the source code of this file.
Macros | |
| #define | DNA_DEPRECATED_ALLOW |
Functions | |
| short | do_versions_new_to_old_idcode_get (const short id_code_new) |
| ARegion * | do_versions_add_region_if_not_found (ListBase *regionbase, int region_type, const char *, int link_after_region_type) |
| ARegion * | do_versions_ensure_region (ListBase *regionbase, int region_type, const char *, int link_after_region_type) |
| ID * | do_versions_rename_id (Main *bmain, const short id_type, const char *name_src, const char *name_dst) |
| static void | change_node_socket_name (ListBase *sockets, const char *old_name, const char *new_name) |
| bool | version_node_socket_is_used (bNodeSocket *sock) |
| void | version_node_socket_id_delim (bNodeSocket *socket) |
| void | version_node_socket_name (bNodeTree *ntree, const int node_type, const char *old_name, const char *new_name) |
| void | version_node_input_socket_name (bNodeTree *ntree, const int node_type, const char *old_name, const char *new_name) |
| void | version_node_output_socket_name (bNodeTree *ntree, const int node_type, const char *old_name, const char *new_name) |
| StringRef | legacy_socket_idname_to_socket_type (StringRef idname) |
| bNode & | version_node_add_empty (bNodeTree &ntree, const char *idname) |
| void | version_node_remove (bNodeTree &ntree, bNode &node) |
| bNodeSocket & | version_node_add_socket (bNodeTree &ntree, bNode &node, const eNodeSocketInOut in_out, const char *idname, const char *identifier) |
| 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_node_tree_clear_interface (bNodeTree &ntree) |
| void | version_node_id (bNodeTree *ntree, const int node_type, const char *new_name) |
| 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_socket_update_is_used (bNodeTree *ntree) |
| ARegion * | do_versions_add_region (int regiontype, const char *) |
| void | node_tree_relink_with_socket_id_map (bNodeTree &ntree, bNode &old_node, bNode &new_node, const Map< std::string, std::string > &map) |
| static blender::Vector< bNodeLink * > | find_connected_links (bNodeTree *ntree, bNodeSocket *in_socket) |
| void | add_realize_instances_before_socket (bNodeTree *ntree, bNode *node, bNodeSocket *geometry_socket) |
| float * | version_cycles_node_socket_float_value (bNodeSocket *socket) |
| float * | version_cycles_node_socket_rgba_value (bNodeSocket *socket) |
| float * | version_cycles_node_socket_vector_value (bNodeSocket *socket) |
| IDProperty * | version_cycles_properties_from_ID (ID *id) |
| IDProperty * | version_cycles_properties_from_view_layer (ViewLayer *view_layer) |
| IDProperty * | version_cycles_properties_from_render_layer (SceneRenderLayer *render_layer) |
| float | version_cycles_property_float (IDProperty *idprop, const char *name, float default_value) |
| int | version_cycles_property_int (IDProperty *idprop, const char *name, int default_value) |
| void | version_cycles_property_int_set (IDProperty *idprop, const char *name, int value) |
| bool | version_cycles_property_boolean (IDProperty *idprop, const char *name, bool default_value) |
| void | version_cycles_property_boolean_set (IDProperty *idprop, const char *name, bool value) |
| IDProperty * | version_cycles_visibility_properties_from_ID (ID *id) |
| void | version_update_node_input (bNodeTree *ntree, FunctionRef< bool(bNode *)> check_node, const char *socket_identifier, FunctionRef< void(bNode *, bNodeSocket *)> update_input, FunctionRef< void(bNode *, bNodeSocket *, bNode *, bNodeSocket *)> update_input_link) |
| bNode * | version_eevee_output_node_get (bNodeTree *ntree, int16_t node_type) |
| bool | all_scenes_use (Main *bmain, const blender::Span< const char * > engines) |
| bNodeTree * | version_get_scene_compositor_node_tree (Main *bmain, Scene *scene) |
| static bool | blendfile_or_libraries_versions_atleast (Main *bmain, const short versionfile, const short subversionfile) |
| void | do_versions_after_setup (Main *new_bmain, BlendfileLinkAppendContext *lapp_context, BlendFileReadReport *reports) |
| #define DNA_DEPRECATED_ALLOW |
Definition at line 9 of file versioning_common.cc.
| void add_realize_instances_before_socket | ( | bNodeTree * | ntree, |
| bNode * | node, | ||
| bNodeSocket * | geometry_socket ) |
Definition at line 462 of file versioning_common.cc.
References BLI_assert, find_connected_links(), ListBase::first, GEO_NODE_REALIZE_INSTANCES, bNode::inputs, bNode::locx_legacy, bNode::locy_legacy, blender::bke::node_add_link(), blender::bke::node_add_static_node(), bNode::outputs, bNode::parent, SOCK_GEOMETRY, and bNodeSocket::type.
Referenced by do_versions_after_linking_300(), and version_geometry_nodes_add_realize_instance_nodes().
| bool all_scenes_use | ( | Main * | bmain, |
| const blender::Span< const char * > | engines ) |
Definition at line 641 of file versioning_common.cc.
References ListBase::first, LISTBASE_FOREACH, Main::scenes, and STREQ.
Referenced by blo_do_versions_410(), blo_do_versions_420(), and do_versions_after_linking_420().
|
static |
Definition at line 671 of file versioning_common.cc.
References Main::libraries, LIBRARY_VERSION_FILE_ATLEAST, LISTBASE_FOREACH, and MAIN_VERSION_FILE_ATLEAST.
Referenced by do_versions_after_setup().
|
static |
Definition at line 133 of file versioning_common.cc.
References LISTBASE_FOREACH, STREQ, and STRNCPY_UTF8.
Referenced by version_node_input_socket_name(), version_node_output_socket_name(), and version_node_socket_name().
| ARegion * do_versions_add_region | ( | int | regiontype, |
| const char * | name ) |
Definition at line 411 of file versioning_common.cc.
References BKE_area_region_new(), and ARegion::regiontype.
Referenced by blo_do_versions_280(), blo_do_versions_300(), and do_versions_area_ensure_tool_region().
| ARegion * do_versions_add_region_if_not_found | ( | ListBase * | regionbase, |
| int | region_type, | ||
| const char * | allocname, | ||
| int | link_after_region_type ) |
Check if a region of type region_type exists in regionbase. Otherwise add it after the first region of type link_after_region_type.
Definition at line 67 of file versioning_common.cc.
References BKE_area_region_new(), BLI_insertlinkafter(), LISTBASE_FOREACH, and ARegion::regiontype.
Referenced by add_image_editor_asset_shelf(), blo_do_versions_290(), blo_do_versions_300(), blo_do_versions_400(), blo_do_versions_500(), and version_ensure_missing_regions().
| void do_versions_after_setup | ( | Main * | new_bmain, |
| BlendfileLinkAppendContext * | lapp_context, | ||
| BlendFileReadReport * | reports ) |
Definition at line 688 of file versioning_common.cc.
References BKE_lib_override_library_main_hierarchy_root_ensure(), BKE_lib_override_library_main_proxy_convert(), BKE_libblock_management_main_add(), BKE_main_mesh_legacy_convert_auto_smooth(), BKE_main_namemap_validate_and_fix(), blendfile_or_libraries_versions_atleast(), blender::animrig::versioning::convert_legacy_action_assignments(), blender::seq::doversion_250_sound_proxy_update(), ID::flag, bNodeTree::id, ID_FLAG_EMBEDDED_DATA, ID_TAG_NO_MAIN, blender::bke::greasepencil::convert::legacy_main(), LISTBASE_FOREACH, bNodeTree::owner_id, BlendFileReadReport::pre_animato_file_loaded, BlendFileReadReport::reports, Main::scenes, and ID::tag.
Referenced by BLO_read_do_version_after_setup().
| ARegion * do_versions_ensure_region | ( | ListBase * | regionbase, |
| int | region_type, | ||
| const char * | allocname, | ||
| int | link_after_region_type ) |
Check if a region of type region_type exists in regionbase. Otherwise add it after the first region of type link_after_region_type.
Definition at line 88 of file versioning_common.cc.
References BKE_area_region_new(), BLI_insertlinkafter(), LISTBASE_FOREACH, and ARegion::regiontype.
Referenced by version_ensure_missing_regions().
| short do_versions_new_to_old_idcode_get | ( | short | id_code_new | ) |
Mapping from new ID types to old converted ID types.
This is used by linking code, when a directly linked data comes from a library where it exists as an older, different type of ID.
Since the current blend-file will convert that older ID type to the new one as part of its versioning process, when saved, it will store a reference to that linked ID using the new ID type, which will not be found on next blend-file opening/reloading when searching for that ID in the library blend-file.
Definition at line 56 of file versioning_common.cc.
References ID_GD_LEGACY, ID_GP, and ID_LINK_PLACEHOLDER.
Referenced by find_bhead_from_idname().
| ID * do_versions_rename_id | ( | Main * | bmain, |
| short | id_type, | ||
| const char * | name_src, | ||
| const char * | name_dst ) |
Rename if the ID doesn't exist.
Definition at line 109 of file versioning_common.cc.
References BKE_libblock_rename(), ID_IS_LINKED, LISTBASE_FOREACH, STREQ, and which_libbase().
Referenced by blo_do_versions_300(), BLO_update_defaults_startup_blend(), and do_versions_after_linking_280().
|
static |
Definition at line 451 of file versioning_common.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), bNodeTree::links, and LISTBASE_FOREACH.
Referenced by add_realize_instances_before_socket().
| StringRef legacy_socket_idname_to_socket_type | ( | blender::StringRef | idname | ) |
Find the base socket name for an idname that may include a subtype.
Definition at line 209 of file versioning_common.cc.
Referenced by legacy_socket_move_to_interface(), and versioning_fix_socket_subtype_idnames().
| void node_tree_relink_with_socket_id_map | ( | bNodeTree & | ntree, |
| bNode & | old_node, | ||
| bNode & | new_node, | ||
| const Map< std::string, std::string > & | map ) |
Definition at line 418 of file versioning_common.cc.
References bNodeSocket::identifier, bNodeSocket::link, bNodeTree::links, LISTBASE_FOREACH_MUTABLE, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr_as(), blender::bke::node_find_socket(), SOCK_IN, and SOCK_OUT.
Referenced by version_geometry_nodes_replace_transfer_attribute_node().
| float * version_cycles_node_socket_float_value | ( | bNodeSocket * | socket | ) |
Definition at line 489 of file versioning_common.cc.
References bNodeSocket::default_value, and bNodeSocketValueFloat::value.
Referenced by ambient_occlusion_node_relink(), BLO_update_defaults_startup_blend(), displacement_node_insert(), do_version_bump_filter_width(), light_emission_node_to_energy(), square_roughness_node_insert(), update_noise_and_wave_distortion(), update_vector_math_node_dot_product_operator(), update_voronoi_node_crackle(), update_wave_node_directions_and_offset(), version_principled_bsdf_coat(), version_principled_bsdf_emission(), version_principled_bsdf_sheen(), version_principled_bsdf_specular_tint(), version_principled_bsdf_subsurface(), version_refraction_depth_to_thickness_value(), versioning_eevee_alpha_source_get(), versioning_eevee_material_blend_mode_settings(), versioning_replace_musgrave_texture_node(), and versioning_update_noise_texture_node().
| float * version_cycles_node_socket_rgba_value | ( | bNodeSocket * | socket | ) |
Definition at line 495 of file versioning_common.cc.
References bNodeSocket::default_value, and bNodeSocketValueRGBA::value.
Referenced by BLO_update_defaults_startup_blend(), light_emission_node_to_energy(), update_vector_math_node_dot_product_operator(), version_principled_bsdf_sheen(), version_principled_bsdf_specular_tint(), version_principled_bsdf_subsurface(), versioning_eevee_alpha_source_get(), and versioning_eevee_material_blend_mode_settings().
| float * version_cycles_node_socket_vector_value | ( | bNodeSocket * | socket | ) |
Definition at line 501 of file versioning_common.cc.
References bNodeSocket::default_value, and bNodeSocketValueVector::value.
Referenced by update_mapping_node_inputs_and_properties(), update_vector_math_node_add_and_subtract_operators(), update_vector_math_node_dot_product_operator(), and update_vector_math_node_normalize_operator().
| IDProperty * version_cycles_properties_from_ID | ( | ID * | id | ) |
Definition at line 508 of file versioning_common.cc.
References IDP_GetPropertyTypeFromGroup(), IDP_GROUP, and IDP_ID_system_properties_get().
Referenced by blo_do_versions_280(), blo_do_versions_290(), blo_do_versions_300(), blo_do_versions_400(), blo_do_versions_410(), blo_do_versions_420(), blo_do_versions_440(), blo_do_versions_450(), do_version_adaptive_subdivision(), and do_versions_after_linking_280().
| IDProperty * version_cycles_properties_from_render_layer | ( | SceneRenderLayer * | render_layer | ) |
Definition at line 520 of file versioning_common.cc.
References IDP_GetPropertyTypeFromGroup(), and IDP_GROUP.
Referenced by blo_do_versions_290().
| IDProperty * version_cycles_properties_from_view_layer | ( | ViewLayer * | view_layer | ) |
Definition at line 514 of file versioning_common.cc.
References IDP_GetPropertyTypeFromGroup(), IDP_GROUP, and ViewLayer::system_properties.
Referenced by blo_do_versions_290().
| bool version_cycles_property_boolean | ( | IDProperty * | idprop, |
| const char * | name, | ||
| bool | default_value ) |
Definition at line 548 of file versioning_common.cc.
References name, and version_cycles_property_int().
Referenced by blo_do_versions_280(), blo_do_versions_290(), blo_do_versions_300(), blo_do_versions_410(), blo_do_versions_420(), and do_version_adaptive_subdivision().
| void version_cycles_property_boolean_set | ( | IDProperty * | idprop, |
| const char * | name, | ||
| bool | value ) |
Definition at line 553 of file versioning_common.cc.
References name, and version_cycles_property_int_set().
Referenced by blo_do_versions_290(), and blo_do_versions_440().
| float version_cycles_property_float | ( | IDProperty * | idprop, |
| const char * | name, | ||
| float | default_value ) |
Definition at line 526 of file versioning_common.cc.
References IDP_FLOAT, IDP_float_get, IDP_GetPropertyTypeFromGroup(), and name.
Referenced by blo_do_versions_280(), blo_do_versions_400(), blo_do_versions_450(), do_version_adaptive_subdivision(), and do_versions_after_linking_280().
| int version_cycles_property_int | ( | IDProperty * | idprop, |
| const char * | name, | ||
| int | default_value ) |
Definition at line 532 of file versioning_common.cc.
References IDP_GetPropertyTypeFromGroup(), IDP_INT, IDP_int_get, and name.
Referenced by blo_do_versions_290(), blo_do_versions_300(), blo_do_versions_400(), blo_do_versions_410(), blo_do_versions_420(), blo_do_versions_440(), do_versions_after_linking_280(), and version_cycles_property_boolean().
| void version_cycles_property_int_set | ( | IDProperty * | idprop, |
| const char * | name, | ||
| int | value ) |
Definition at line 538 of file versioning_common.cc.
References blender::bke::idprop::create(), IDP_AddToGroup(), IDP_GetPropertyTypeFromGroup(), IDP_INT, IDP_int_set, and name.
Referenced by blo_do_versions_290(), blo_do_versions_300(), blo_do_versions_440(), and version_cycles_property_boolean_set().
| IDProperty * version_cycles_visibility_properties_from_ID | ( | ID * | id | ) |
Definition at line 558 of file versioning_common.cc.
References IDP_GetPropertyTypeFromGroup(), IDP_GROUP, and IDP_ID_system_properties_get().
Referenced by blo_do_versions_300().
Definition at line 609 of file versioning_common.cc.
References bNode::custom1, bNode::flag, LISTBASE_FOREACH, NODE_DO_OUTPUT, bNodeTree::nodes, SHD_OUTPUT_ALL, and SHD_OUTPUT_EEVEE.
Referenced by blo_do_versions_420(), versioning_eevee_material_blend_mode_settings(), and versioning_eevee_material_shadow_none().
Definition at line 662 of file versioning_common.cc.
References Scene::compositing_node_group, and MAIN_VERSION_FILE_ATLEAST.
Referenced by do_versions_after_linking_500().
Adds a new node for versioning purposes. This is intended to be used to create raw DNA that might have been read from a file. The created node does not have storage or sockets. Both have to be added manually afterwards.
This may seem redundant because the set of sockets is already part of the node declaration. However, the declaration should not be used here, because it changes over time. The versioning code generally expects to get the sockets that the node had at the time of writing the versioning code. Changing the declaration later can break the versioning code in ways that are hard to detect.
When adding new nodes in versioning code that replace or belong to existing nodes, they should be positioned so that it overlaps the existing node with just a slight offset. This is better than putting them next to each other they way one would do it manually, because it messes up more complex node trees significantly. In simple tests, putting the nodes next to each other looks better, but in actual user-files it looks way worse and makes it less obvious what was changed by versioning code.
Definition at line 237 of file versioning_common.cc.
References BKE_ntree_update_tag_node_new(), BLI_addtail(), bNode::color, DATA_, bNode::flag, blender::bke::bNodeType::height, bNode::height, bNode::idname, MEM_callocN(), bNode::name, NODE_INIT, NODE_OPTIONS, NODE_SELECT, blender::bke::node_type_find(), blender::bke::node_unique_id(), blender::bke::node_unique_name(), bNodeTree::nodes, bNode::runtime, STRNCPY(), blender::bke::bNodeType::type_legacy, bNode::type_legacy, blender::bke::bNodeType::ui_name, blender::bke::bNodeType::width, and bNode::width.
Referenced by clamp_subdivision_node_level_input(), do_version_bokeh_blur_pixel_size(), do_version_map_value_node(), do_version_material_remove_use_nodes(), do_version_node_curve_to_mesh_scale_input(), do_version_texture_gradient_clamp(), do_version_world_remove_use_nodes(), hide_simulation_node_skip_socket_value(), remove_triangulate_node_min_size_input(), version_geometry_nodes_extrude_smooth_propagation(), and version_geometry_nodes_primitive_uv_maps().
| bNodeLink & version_node_add_link | ( | bNodeTree & | ntree, |
| bNode & | node_a, | ||
| bNodeSocket & | socket_a, | ||
| bNode & | node_b, | ||
| bNodeSocket & | socket_b ) |
Definition at line 301 of file versioning_common.cc.
References BKE_ntree_update_tag_link_added(), BLI_addtail(), BLI_assert, bNodeLink::fromnode, bNodeLink::fromsock, bNodeSocket::in_out, bNodeTree::links, MEM_callocN(), SOCK_IN, bNodeLink::tonode, bNodeLink::tosock, and version_node_add_link().
Referenced by clamp_subdivision_node_level_input(), do_version_alpha_over_remove_premultiply(), do_version_blur_defocus_nodes_remove_gamma(), do_version_blur_node_options_to_inputs(), do_version_bokeh_blur_pixel_size(), do_version_bright_contrast_remove_premultiplied(), do_version_color_to_float_conversion(), do_version_composite_node_in_scene_tree(), do_version_composite_viewer_remove_alpha(), do_version_crop_node_options_to_inputs(), do_version_displace_node_remove_xy_scale(), do_version_lift_gamma_gain_srgb_to_linear(), do_version_map_value_node(), do_version_material_remove_use_nodes(), do_version_mix_color_use_alpha(), do_version_node_curve_to_mesh_scale_input(), do_version_normal_node_dot_product(), do_version_replace_image_info_node_coordinates(), do_version_scale_node_remove_translate(), do_version_sun_beams(), do_version_texture_gradient_clamp(), do_version_translate_node_remove_relative(), do_version_world_remove_use_nodes(), hide_simulation_node_skip_socket_value(), remove_triangulate_node_min_size_input(), version_geometry_nodes_extrude_smooth_propagation(), version_geometry_nodes_primitive_uv_maps(), and version_node_add_link().
| bNodeSocket & version_node_add_socket | ( | bNodeTree & | ntree, |
| bNode & | node, | ||
| const eNodeSocketInOut | in_out, | ||
| const char * | idname, | ||
| const char * | identifier ) |
Definition at line 270 of file versioning_common.cc.
References BKE_ntree_update_tag_socket_new(), BLI_addtail(), bNodeSocket::default_value, bNodeSocket::identifier, bNodeSocket::idname, bNodeSocket::in_out, bNode::inputs, bNodeSocket::limit, MEM_callocN(), bNodeSocket::name, node_socket_init_default_value_data(), blender::bke::node_socket_type_find(), bNode::outputs, bNodeSocket::runtime, SOCK_IN, STRNCPY_UTF8, blender::bke::bNodeSocketType::subtype, blender::bke::bNodeSocketType::type, and bNodeSocket::type.
Referenced by clamp_subdivision_node_level_input(), do_version_blur_menus_to_inputs(), do_version_bokeh_blur_pixel_size(), do_version_box_mask_menus_to_inputs(), do_version_channel_matte_menus_to_inputs(), do_version_color_balance_menus_to_inputs(), do_version_color_spill_menus_to_inputs(), do_version_convert_alpha_menus_to_inputs(), do_version_corner_pin_menus_to_inputs(), do_version_denoise_menus_to_inputs(), do_version_dilate_menus_to_inputs(), do_version_displace_menus_to_inputs(), do_version_distance_matte_menus_to_inputs(), do_version_distribute_points_in_volume_options_to_inputs(), do_version_double_edge_mask_options_to_inputs(), do_version_ellipse_mask_menus_to_inputs(), do_version_fill_curve_options_to_inputs(), do_version_fillet_curve_options_to_inputs(), do_version_filter_menus_to_inputs(), do_version_glare_menus_to_inputs(), do_version_keying_menus_to_inputs(), do_version_kuwahara_menus_to_inputs(), do_version_lens_distortion_menus_to_inputs(), do_version_levels_menus_to_inputs(), do_version_map_uv_menus_to_inputs(), do_version_map_value_node(), do_version_mask_menus_to_inputs(), do_version_match_string_options_to_inputs(), do_version_material_remove_use_nodes(), do_version_merge_by_distance_options_to_inputs(), do_version_mesh_to_volume_options_to_inputs(), do_version_movie_distortion_menus_to_inputs(), do_version_points_to_volume_options_to_inputs(), do_version_raycast_options_to_inputs(), do_version_remove_attribute_options_to_inputs(), do_version_resample_curve_options_to_inputs(), do_version_rotate_menus_to_inputs(), do_version_sample_grid_options_to_inputs(), do_version_scale_elements_options_to_inputs(), do_version_scale_menus_to_inputs(), do_version_set_alpha_menus_to_inputs(), do_version_set_curve_normal_options_to_inputs(), do_version_stabilize_2d_menus_to_inputs(), do_version_subdivision_surface_options_to_inputs(), do_version_texture_gradient_clamp(), do_version_tone_map_menus_to_inputs(), do_version_track_position_menus_to_inputs(), do_version_transform_geometry_options_to_inputs(), do_version_transform_menus_to_inputs(), do_version_translate_menus_to_inputs(), do_version_triangulate_options_to_inputs(), do_version_uv_pack_islands_options_to_inputs(), do_version_uv_unwrap_options_to_inputs(), do_version_volume_to_mesh_options_to_inputs(), do_version_world_remove_use_nodes(), hide_simulation_node_skip_socket_value(), version_geometry_nodes_extrude_smooth_propagation(), and version_geometry_nodes_primitive_uv_maps().
| 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 ) |
Definition at line 325 of file versioning_common.cc.
References name, blender::bke::node_add_static_socket(), and blender::bke::node_find_socket().
Referenced by add_subsurf_node_limit_surface_option(), blo_do_versions_300(), do_version_glare_node_bloom_strength(), do_version_glare_node_options_to_inputs(), do_version_node_curve_to_mesh_scale_input(), and remove_triangulate_node_min_size_input().
| void version_node_id | ( | bNodeTree * | ntree, |
| int | node_type, | ||
| const char * | new_name ) |
Replace the ID name of all nodes in the tree with the given type with the new name.
Definition at line 346 of file versioning_common.cc.
References STREQ, and STRNCPY().
Referenced by blo_do_versions_300().
| void version_node_input_socket_name | ( | bNodeTree * | ntree, |
| const int | node_type, | ||
| const char * | old_name, | ||
| const char * | new_name ) |
Definition at line 185 of file versioning_common.cc.
References change_node_socket_name().
Referenced by blo_do_versions_300(), blo_do_versions_420(), blo_do_versions_500(), version_principled_bsdf_coat(), version_principled_bsdf_rename_sockets(), versioning_replace_legacy_combined_and_separate_color_nodes(), versioning_replace_legacy_mix_rgb_node(), and versioning_replace_musgrave_texture_node().
| void version_node_output_socket_name | ( | bNodeTree * | ntree, |
| const int | node_type, | ||
| const char * | old_name, | ||
| const char * | new_name ) |
Definition at line 197 of file versioning_common.cc.
References change_node_socket_name().
Referenced by blo_do_versions_300(), blo_do_versions_420(), blo_do_versions_500(), versioning_replace_legacy_combined_and_separate_color_nodes(), and versioning_replace_legacy_mix_rgb_node().
Removes a node for versioning purposes:
Definition at line 261 of file versioning_common.cc.
References blender::bke::node_free_node(), blender::bke::node_rebuild_id_vector(), blender::bke::node_unlink_attached(), and blender::bke::node_unlink_node().
Referenced by do_version_composite_node_in_scene_tree(), do_version_map_value_node(), do_version_normal_node_dot_product(), do_version_sun_beams(), do_version_texture_gradient_clamp(), and do_versions_after_linking_500().
| void version_node_socket_id_delim | ( | bNodeSocket * | socket | ) |
Convert SocketName.001 unique name format to SocketName_001. Previously both were used.
Definition at line 151 of file versioning_common.cc.
References blender::StringRef::drop_known_prefix(), bNodeSocket::identifier, blender::StringRefBase::is_empty(), bNodeSocket::name, name, and blender::StringRefBase::startswith().
Referenced by version_node_tree_socket_id_delim().
| void version_node_socket_index_animdata | ( | Main * | bmain, |
| int | node_tree_type, | ||
| int | node_type, | ||
| int | socket_index_orig, | ||
| int | socket_index_offset, | ||
| int | total_number_of_sockets ) |
Adjust animation data for newly added node sockets.
Node sockets are addressed by their index (in their RNA path, and thus FCurves/drivers), and thus when a new node is added in the middle of the list, existing animation data needs to be adjusted.
Since this is about animation data, it only concerns input sockets.
| node_tree_type | Node tree type that has these nodes, for example NTREE_SHADER. |
| node_type | Node type to adjust, for example SH_NODE_BSDF_PRINCIPLED. |
| socket_index_orig | The original index of the moved socket; when socket 4 moved to 6, pass 4 here. |
| socket_index_offset | The offset of the nodes, so when socket 4 moved to 6, pass 2 here. |
| total_number_of_sockets | The total number of sockets in the node. |
Definition at line 357 of file versioning_common.cc.
References BKE_animdata_fix_paths_rename_all_ex(), BLI_sprintfN(), BLI_str_escape(), FOREACH_NODETREE_BEGIN, FOREACH_NODETREE_END, and MEM_freeN().
Referenced by do_versions_after_linking_290(), do_versions_after_linking_300(), do_versions_after_linking_420(), do_versions_after_linking_430(), do_versions_after_linking_440(), and do_versions_after_linking_450().
| bool version_node_socket_is_used | ( | bNodeSocket * | sock | ) |
Definition at line 145 of file versioning_common.cc.
References BLI_assert, bNodeSocket::flag, and SOCK_IS_LINKED.
Referenced by do_version_new_glare_clamp_input(), do_version_node_curve_to_mesh_scale_input(), update_noise_and_wave_distortion(), update_vector_math_node_add_and_subtract_operators(), update_vector_math_node_average_operator(), update_vector_math_node_cross_product_operator(), update_vector_math_node_dot_product_operator(), update_vector_math_node_normalize_operator(), update_voronoi_node_crackle(), and update_voronoi_node_square_distance().
| void version_node_socket_name | ( | bNodeTree * | ntree, |
| const int | node_type, | ||
| const char * | old_name, | ||
| const char * | new_name ) |
Definition at line 172 of file versioning_common.cc.
References change_node_socket_name().
Referenced by blo_do_versions_290(), blo_do_versions_300(), blo_do_versions_410(), and blo_do_versions_500().
| void version_node_tree_clear_interface | ( | bNodeTree & | ntree | ) |
Definition at line 341 of file versioning_common.cc.
References bNodeTree::tree_interface.
| void version_socket_update_is_used | ( | bNodeTree * | ntree | ) |
The versioning code generally expects SOCK_IS_LINKED to be set correctly. This function updates the flag on all sockets after changes to the node tree.
Definition at line 395 of file versioning_common.cc.
References bNodeTree::links, LISTBASE_FOREACH, and SOCK_IS_LINKED.
Referenced by add_realize_node_tree(), ambient_occlusion_node_relink(), clamp_subdivision_node_level_input(), displacement_node_insert(), do_version_map_value_node(), do_version_mix_color_use_alpha(), do_version_node_curve_to_mesh_scale_input(), do_versions_material_convert_legacy_blend_mode(), update_mapping_node_inputs_and_properties(), update_math_node_single_operand_operators(), update_noise_and_wave_distortion(), update_vector_math_node_add_and_subtract_operators(), update_vector_math_node_average_operator(), update_vector_math_node_cross_product_operator(), update_vector_math_node_dot_product_operator(), update_vector_math_node_normalize_operator(), update_voronoi_node_coloring(), update_voronoi_node_crackle(), update_voronoi_node_square_distance(), version_refraction_depth_to_thickness_value(), version_update_node_input(), versioning_replace_musgrave_texture_node(), and versioning_update_noise_texture_node().
| void version_update_node_input | ( | bNodeTree * | ntree, |
| FunctionRef< bool(bNode *)> | check_node, | ||
| const char * | socket_identifier, | ||
| FunctionRef< void(bNode *, bNodeSocket *)> | update_input, | ||
| FunctionRef< void(bNode *, bNodeSocket *, bNode *, bNodeSocket *)> | update_input_link ) |
Definition at line 564 of file versioning_common.cc.
References bNodeSocket::identifier, input, bNodeTree::links, LISTBASE_FOREACH, LISTBASE_FOREACH_BACKWARD_MUTABLE, blender::bke::node_find_socket(), blender::bke::node_remove_link(), bNodeTree::nodes, SOCK_IN, STREQ, and version_socket_update_is_used().
Referenced by square_roughness_node_insert(), and version_principled_bsdf_sheen().