Blender
V3.3
|
#include "BLI_map.hh"
#include "BLI_multi_value_map.hh"
#include "BLI_noise.hh"
#include "BLI_set.hh"
#include "BLI_stack.hh"
#include "BLI_vector_set.hh"
#include "DNA_anim_types.h"
#include "DNA_modifier_types.h"
#include "DNA_node_types.h"
#include "BKE_anim_data.h"
#include "BKE_image.h"
#include "BKE_main.h"
#include "BKE_node.h"
#include "BKE_node_runtime.hh"
#include "BKE_node_tree_update.h"
#include "MOD_nodes.h"
#include "NOD_node_declaration.hh"
#include "NOD_node_tree_ref.hh"
#include "NOD_texture.h"
#include "DEG_depsgraph_query.h"
Go to the source code of this file.
Classes | |
struct | blender::bke::node_field_inferencing::SocketFieldState |
struct | blender::bke::NodeTreeRelations |
struct | blender::bke::TreeUpdateResult |
class | blender::bke::NodeTreeMainUpdater |
Namespaces | |
blender | |
blender::bke | |
blender::bke::node_field_inferencing | |
Typedefs | |
using | blender::bke::TreeNodePair = std::pair< bNodeTree *, bNode * > |
using | blender::bke::ObjectModifierPair = std::pair< Object *, ModifierData * > |
using | blender::bke::NodeSocketPair = std::pair< bNode *, bNodeSocket * > |
Enumerations | |
enum | eNodeTreeChangedFlag { NTREE_CHANGED_NOTHING = 0 , NTREE_CHANGED_ANY = (1 << 1) , NTREE_CHANGED_NODE_PROPERTY = (1 << 2) , NTREE_CHANGED_NODE_OUTPUT = (1 << 3) , NTREE_CHANGED_INTERFACE = (1 << 4) , NTREE_CHANGED_LINK = (1 << 5) , NTREE_CHANGED_REMOVED_NODE = (1 << 6) , NTREE_CHANGED_REMOVED_SOCKET = (1 << 7) , NTREE_CHANGED_SOCKET_PROPERTY = (1 << 8) , NTREE_CHANGED_INTERNAL_LINK = (1 << 9) , NTREE_CHANGED_ALL = -1 } |
Variables | |
static bool | is_updating = false |
enum eNodeTreeChangedFlag |
These flags are used by the changed_flag
field in bNodeTree, bNode and bNodeSocket. This enum is not part of the public api. It should be used through the BKE_ntree_update_tag_*
api.
Definition at line 36 of file node_tree_update.cc.
|
static |
Definition at line 55 of file node_tree_update.cc.
References add_tree_tag(), node, and ntree.
Referenced by BKE_ntree_update_tag_id_changed(), BKE_ntree_update_tag_node_internal_link(), BKE_ntree_update_tag_node_mute(), BKE_ntree_update_tag_node_new(), BKE_ntree_update_tag_node_property(), and blender::bke::NodeTreeMainUpdater::update_rooted().
|
static |
Definition at line 61 of file node_tree_update.cc.
References add_tree_tag(), ntree, and bNodeSocket::runtime.
Referenced by BKE_ntree_update_tag_socket_availability(), BKE_ntree_update_tag_socket_new(), BKE_ntree_update_tag_socket_property(), and BKE_ntree_update_tag_socket_type().
|
static |
Definition at line 50 of file node_tree_update.cc.
References ntree, and bNodeTree::runtime.
Referenced by add_node_tag(), add_socket_tag(), BKE_ntree_update_tag_active_output_changed(), BKE_ntree_update_tag_all(), BKE_ntree_update_tag_image_user_changed(), BKE_ntree_update_tag_interface(), BKE_ntree_update_tag_link_added(), BKE_ntree_update_tag_link_changed(), BKE_ntree_update_tag_link_mute(), BKE_ntree_update_tag_link_removed(), BKE_ntree_update_tag_missing_runtime_data(), BKE_ntree_update_tag_node_removed(), and BKE_ntree_update_tag_socket_removed().
void BKE_ntree_update_main | ( | struct Main * | bmain, |
struct NodeTreeUpdateExtraParams * | params | ||
) |
Updates #bmain based on changes to node trees.
Definition at line 1736 of file node_tree_update.cc.
References is_updating, and params.
Referenced by BKE_image_signal(), BKE_ntree_update_main_tree(), ntreeCompositTagRender(), ntreeUpdateAllNew(), ntreeUpdateAllUsers(), render_endjob(), and special_aftertrans_update__movieclip().
void BKE_ntree_update_main_tree | ( | struct Main * | bmain, |
struct bNodeTree * | ntree, | ||
struct NodeTreeUpdateExtraParams * | params | ||
) |
Same as BKE_ntree_update_main, but will first only look at the provided tree and only looks at #bmain when something relevant for other data-blocks changed. This avoids scanning #bmain in many cases.
If #bmain is null, only the provided tree is updated. This should only be used in very rare cases because it may result it incorrectly synced data in DNA.
If tree is null, this is the same as calling BKE_ntree_update_main.
Definition at line 1748 of file node_tree_update.cc.
References BKE_ntree_update_main(), is_updating, ntree, and params.
Referenced by BKE_linestyle_default_shader(), ED_node_composit_default(), ED_node_shader_default(), ED_node_texture_default(), ED_node_tree_propagate_change(), blender::io::obj::get_or_create_material(), Freestyle::BlenderStrokeRenderer::GetStrokeShader(), blender::io::usd::USDMaterialReader::import_usd_preview(), ntree_exec_begin(), ntree_shader_groups_expand_inputs(), ntree_shader_groups_flatten(), ntree_shader_implicit_closure_cast(), ntree_shader_pruned_unused(), ntree_shader_shader_to_rgba_branch(), ntree_shader_unlink_hidden_value_sockets(), ntree_shader_weight_tree_invert(), and MaterialNode::update_material_nodetree().
Used when the a new output node becomes active and therefore changes the output.
Definition at line 1693 of file node_tree_update.cc.
References add_tree_tag(), ntree, and NTREE_CHANGED_ANY.
Referenced by ED_node_set_active().
Tag tree as changed without providing any more information about what has changed exactly. The update process has to assume that everything may have changed.
Using one of the methods below to tag the tree after changes is preferred when possible.
Definition at line 1618 of file node_tree_update.cc.
References add_tree_tag(), ntree, and NTREE_CHANGED_ANY.
Referenced by blo_do_versions_250(), flatten_group_do(), blender::ed::space_node::node_group_separate_selected(), ntree_set_typeinfo(), and ntreeUpdateAllNew().
Used when an id data block changed that might be used by nodes that need to be updated.
Definition at line 1708 of file node_tree_update.cc.
References add_node_tag(), FOREACH_NODETREE_BEGIN, FOREACH_NODETREE_END, LISTBASE_FOREACH, node, NODE_UPDATE_ID, bNodeTree::nodes, ntree, and NTREE_CHANGED_NODE_PROPERTY.
Referenced by BKE_image_signal(), BKE_movieclip_reload(), render_endjob(), and special_aftertrans_update__movieclip().
Definition at line 1721 of file node_tree_update.cc.
References add_tree_tag(), ntree, and NTREE_CHANGED_ANY.
Used when the interface sockets/values have changed.
Definition at line 1703 of file node_tree_update.cc.
References add_tree_tag(), ntree, and NTREE_CHANGED_INTERFACE.
Referenced by do_versions_node_group_add_socket_2_56_2(), group_verify_socket_list(), blender::ed::space_node::ntree_socket_change_type_exec(), blender::ed::space_node::ntree_socket_move_exec(), ntreeAddSocketInterface(), ntreeInsertSocketInterface(), and ntreeRemoveSocketInterface().
Definition at line 1683 of file node_tree_update.cc.
References add_tree_tag(), ntree, and NTREE_CHANGED_LINK.
Definition at line 1673 of file node_tree_update.cc.
References add_tree_tag(), ntree, and NTREE_CHANGED_LINK.
Referenced by blender::ed::space_node::attribute_search_exec_fn(), ED_node_link_insert(), blender::ed::space_node::viewer_linking::link_socket_to_viewer(), and nodeInternalRelink().
Definition at line 1688 of file node_tree_update.cc.
References add_tree_tag(), ntree, and NTREE_CHANGED_LINK.
Definition at line 1678 of file node_tree_update.cc.
References add_tree_tag(), ntree, and NTREE_CHANGED_LINK.
Referenced by nodeRemLink().
Used after file loading when run-time data on the tree has not been initialized yet.
Definition at line 1698 of file node_tree_update.cc.
References add_tree_tag(), ntree, and NTREE_CHANGED_ALL.
Referenced by ntreeBlendReadData().
Definition at line 1668 of file node_tree_update.cc.
References add_node_tag(), node, ntree, and NTREE_CHANGED_INTERNAL_LINK.
Referenced by nodeRemoveSocketEx().
Definition at line 1663 of file node_tree_update.cc.
References add_node_tag(), node, ntree, and NTREE_CHANGED_NODE_PROPERTY.
Referenced by blender::ed::space_node::node_mute_exec().
Definition at line 1628 of file node_tree_update.cc.
References add_node_tag(), node, ntree, and NTREE_CHANGED_NODE_PROPERTY.
Referenced by blender::bke::node_copy_with_mapping(), blender::ed::space_node::node_group_make_insert_selected(), blender::ed::space_node::node_group_ungroup(), and nodeAddNode().
More specialized tag functions that may result in a more efficient update.
Definition at line 1623 of file node_tree_update.cc.
References add_node_tag(), node, ntree, and NTREE_CHANGED_NODE_PROPERTY.
Referenced by blender::ed::space_node::attribute_search_exec_fn(), BLO_update_defaults_startup_blend(), blender::ed::space_node::node_add_group_exec(), blender::ed::space_node::node_link_init(), blender::ed::space_node::node_link_item_apply(), blender::ed::space_node::node_property_update_default(), blender::ed::space_node::node_socket_add_replace(), blender::ed::space_node::node_socket_disconnect(), blender::ed::space_node::node_socket_remove(), ntreeCompositTagRender(), ntreeUpdateAllUsers(), and blender::ed::space_node::pick_link().
Definition at line 1658 of file node_tree_update.cc.
References add_tree_tag(), ntree, and NTREE_CHANGED_REMOVED_NODE.
Referenced by node_free_node(), and blender::ed::space_node::node_group_make_insert_selected().
void BKE_ntree_update_tag_socket_availability | ( | bNodeTree * | ntree, |
bNodeSocket * | socket | ||
) |
Definition at line 1653 of file node_tree_update.cc.
References add_socket_tag(), ntree, and NTREE_CHANGED_SOCKET_PROPERTY.
Referenced by nodeSetSocketAvailability().
void BKE_ntree_update_tag_socket_new | ( | bNodeTree * | ntree, |
bNodeSocket * | socket | ||
) |
Definition at line 1638 of file node_tree_update.cc.
References add_socket_tag(), ntree, and NTREE_CHANGED_SOCKET_PROPERTY.
Referenced by nodeAddSocket().
void BKE_ntree_update_tag_socket_property | ( | bNodeTree * | ntree, |
bNodeSocket * | socket | ||
) |
Definition at line 1633 of file node_tree_update.cc.
References add_socket_tag(), ntree, and NTREE_CHANGED_SOCKET_PROPERTY.
Definition at line 1643 of file node_tree_update.cc.
References add_tree_tag(), ntree, and NTREE_CHANGED_REMOVED_SOCKET.
Referenced by nodeRemoveAllSockets(), and nodeRemoveSocketEx().
void BKE_ntree_update_tag_socket_type | ( | bNodeTree * | ntree, |
bNodeSocket * | socket | ||
) |
Definition at line 1648 of file node_tree_update.cc.
References add_socket_tag(), ntree, and NTREE_CHANGED_SOCKET_PROPERTY.
Referenced by node_socket_set_typeinfo().
|
static |
Protect from recursive calls into the updating function. Some node update functions might trigger this from Python or in other cases.
This could be added to Main, but given that there is generally only one Main, that's not really worth it now.
Definition at line 1734 of file node_tree_update.cc.
Referenced by BKE_ntree_update_main(), and BKE_ntree_update_main_tree().