Blender V4.3
node.cc File Reference
#include "CLG_log.h"
#include "MEM_guardedalloc.h"
#include <climits>
#include <cstddef>
#include <cstdlib>
#include <cstring>
#include <optional>
#include "DNA_action_types.h"
#include "DNA_anim_types.h"
#include "DNA_collection_types.h"
#include "DNA_gpencil_legacy_types.h"
#include "DNA_light_types.h"
#include "DNA_linestyle_types.h"
#include "DNA_material_types.h"
#include "DNA_modifier_types.h"
#include "DNA_node_types.h"
#include "DNA_scene_types.h"
#include "DNA_texture_types.h"
#include "DNA_world_types.h"
#include "BLI_color.hh"
#include "BLI_ghash.h"
#include "BLI_listbase.h"
#include "BLI_map.hh"
#include "BLI_math_rotation_types.hh"
#include "BLI_path_utils.hh"
#include "BLI_rand.hh"
#include "BLI_set.hh"
#include "BLI_stack.hh"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLI_string_utils.hh"
#include "BLI_threads.h"
#include "BLI_time.h"
#include "BLI_utildefines.h"
#include "BLI_vector_set.hh"
#include "BLT_translation.hh"
#include "IMB_imbuf.hh"
#include "BKE_anim_data.hh"
#include "BKE_animsys.h"
#include "BKE_asset.hh"
#include "BKE_bpath.hh"
#include "BKE_colortools.hh"
#include "BKE_context.hh"
#include "BKE_cryptomatte.h"
#include "BKE_global.hh"
#include "BKE_idprop.hh"
#include "BKE_idtype.hh"
#include "BKE_image_format.hh"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.hh"
#include "BKE_main.hh"
#include "BKE_node.hh"
#include "BKE_node_enum.hh"
#include "BKE_node_runtime.hh"
#include "BKE_node_tree_anonymous_attributes.hh"
#include "BKE_node_tree_interface.hh"
#include "BKE_node_tree_update.hh"
#include "BKE_node_tree_zones.hh"
#include "BKE_preview_image.hh"
#include "BKE_type_conversions.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "RNA_enum_types.hh"
#include "RNA_prototypes.hh"
#include "NOD_common.h"
#include "NOD_composite.hh"
#include "NOD_geo_bake.hh"
#include "NOD_geo_capture_attribute.hh"
#include "NOD_geo_foreach_geometry_element.hh"
#include "NOD_geo_index_switch.hh"
#include "NOD_geo_menu_switch.hh"
#include "NOD_geo_repeat.hh"
#include "NOD_geo_simulation.hh"
#include "NOD_geometry.hh"
#include "NOD_geometry_nodes_gizmos.hh"
#include "NOD_geometry_nodes_lazy_function.hh"
#include "NOD_node_declaration.hh"
#include "NOD_register.hh"
#include "NOD_shader.h"
#include "NOD_socket.hh"
#include "NOD_texture.h"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_build.hh"
#include "BLO_read_write.hh"
#include "NOD_static_types.h"

Go to the source code of this file.

Classes

struct  blender::bke::SocketTemplateIdentifierCallbackData
 

Namespaces

namespace  blender
 
namespace  blender::bke
 
namespace  blender::bke::forward_compat
 

Macros

#define DNA_DEPRECATED_ALLOW
 
#define DefNode(Category, ID, DefFunc, EnumName, StructName, UIName, UIDesc)
 

Functions

static void blender::bke::write_node_socket_default_value (BlendWriter *writer, const bNodeSocket *sock)
 
static void blender::bke::ntree_set_typeinfo (bNodeTree *ntree, bNodeTreeType *typeinfo)
 
static void blender::bke::node_socket_set_typeinfo (bNodeTree *ntree, bNodeSocket *sock, bNodeSocketType *typeinfo)
 
static void blender::bke::node_socket_copy (bNodeSocket *sock_dst, const bNodeSocket *sock_src, const int flag)
 
static void blender::bke::free_localized_node_groups (bNodeTree *ntree)
 
static bool blender::bke::socket_id_user_decrement (bNodeSocket *sock)
 
static void blender::bke::ntree_init_data (ID *id)
 
static void blender::bke::ntree_copy_data (Main *, std::optional< Library * >, ID *id_dst, const ID *id_src, const int flag)
 
static void blender::bke::ntree_free_data (ID *id)
 
static void blender::bke::library_foreach_node_socket (bNodeSocket *sock, LibraryForeachIDData *data)
 
void blender::bke::node_node_foreach_id (bNode *node, LibraryForeachIDData *data)
 
static void blender::bke::node_foreach_id (ID *id, LibraryForeachIDData *data)
 
static void blender::bke::node_foreach_cache (ID *id, IDTypeForeachCacheFunctionCallback function_callback, void *user_data)
 
static void blender::bke::node_foreach_path (ID *id, BPathForeachPathData *bpath_data)
 
static ID ** blender::bke::node_owner_pointer_get (ID *id, const bool debug_relationship_assert)
 
static void blender::bke::forward_compat::write_node_socket_interface (BlendWriter *writer, const bNodeSocket *sock)
 
static bNodeSocketblender::bke::forward_compat::make_socket (bNodeTree *ntree, const eNodeSocketInOut in_out, const StringRef idname, const StringRef name, const StringRef identifier)
 
static StringRef blender::bke::forward_compat::get_legacy_socket_subtype_idname (StringRef idname, const void *socket_data)
 
static void blender::bke::forward_compat::construct_interface_as_legacy_sockets (bNodeTree *ntree)
 
static void blender::bke::forward_compat::write_legacy_sockets (BlendWriter *writer, bNodeTree *ntree)
 
static void blender::bke::forward_compat::legacy_socket_interface_free (bNodeSocket *sock)
 
static void blender::bke::forward_compat::cleanup_legacy_sockets (bNodeTree *ntree)
 
static void blender::bke::write_node_socket (BlendWriter *writer, const bNodeSocket *sock)
 
static void blender::bke::ntree_blend_write (BlendWriter *writer, ID *id, const void *id_address)
 
static bool blender::bke::is_node_socket_supported (const bNodeSocket *sock)
 
static void blender::bke::direct_link_node_socket (BlendDataReader *reader, bNodeSocket *sock)
 
static void blender::bke::remove_unsupported_sockets (ListBase *sockets, ListBase *links)
 
void blender::bke::node_tree_blend_read_data (BlendDataReader *reader, ID *owner_id, bNodeTree *ntree)
 
static void blender::bke::ntree_blend_read_data (BlendDataReader *reader, ID *id)
 
static void blender::bke::ntree_blend_read_after_liblink (BlendLibReader *reader, ID *id)
 
void blender::bke::node_update_asset_metadata (bNodeTree &node_tree)
 
static void blender::bke::node_tree_asset_pre_save (void *asset_ptr, AssetMetaData *)
 
static void blender::bke::node_tree_asset_on_mark_asset (void *asset_ptr, AssetMetaData *asset_data)
 
static void blender::bke::node_tree_asset_on_clear_asset (void *asset_ptr, AssetMetaData *asset_data)
 
static void blender::bke::node_add_sockets_from_type (bNodeTree *ntree, bNode *node, bNodeType *ntype)
 
static void blender::bke::node_init (const bContext *C, bNodeTree *ntree, bNode *node)
 
static void blender::bke::node_set_typeinfo (const bContext *C, bNodeTree *ntree, bNode *node, bNodeType *typeinfo)
 
static void blender::bke::update_typeinfo (Main *bmain, const bContext *C, bNodeTreeType *treetype, bNodeType *nodetype, bNodeSocketType *socktype, const bool unregister)
 
static void blender::bke::ntree_free_type (void *treetype_v)
 
static void blender::bke::node_free_type (void *nodetype_v)
 
bool blender::bke::node_type_is_undefined (const bNode *node)
 
static void blender::bke::node_free_socket_type (void *socktype_v)
 
const char * blender::bke::node_socket_sub_type_label (int subtype)
 
static bool blender::bke::unique_identifier_check (void *arg, const char *identifier)
 
static bNodeSocketblender::bke::make_socket (bNodeTree *ntree, bNode *, const int in_out, ListBase *lb, const char *idname, const char *identifier, const char *name)
 
static void blender::bke::socket_id_user_increment (bNodeSocket *sock)
 
void blender::bke::node_modify_socket_type (bNodeTree *ntree, bNode *node, bNodeSocket *sock, const char *idname)
 
bool blender::bke::node_is_static_socket_type (const bNodeSocketType *stype)
 
static void blender::bke::node_socket_free (bNodeSocket *sock, const bool do_id_user)
 
void blender::bke::node_remove_socket_ex (bNodeTree *ntree, bNode *node, bNodeSocket *sock, bool do_id_user)
 
bNodeblender::bke::node_find_root_parent (bNode *node)
 
void blender::bke::node_chain_iterator (const bNodeTree *ntree, const bNode *node_start, bool(*callback)(bNode *, bNode *, void *, const bool), void *userdata, bool reversed)
 
static void blender::bke::iter_backwards_ex (const bNodeTree *ntree, const bNode *node_start, bool(*callback)(bNode *, bNode *, void *), void *userdata, const char recursion_mask)
 
void blender::bke::node_chain_iterator_backwards (const bNodeTree *ntree, const bNode *node_start, bool(*callback)(bNode *, bNode *, void *), void *userdata, int recursion_lvl)
 
void blender::bke::node_parents_iterator (bNode *node, bool(*callback)(bNode *, void *), void *userdata)
 
bNodeblender::bke::node_copy_with_mapping (bNodeTree *dst_tree, const bNode &node_src, int flag, bool use_unique, Map< const bNodeSocket *, bNodeSocket * > &new_socket_map)
 
static void * blender::bke::node_static_value_storage_for (bNode &node, const bNodeSocket &socket)
 
static void * blender::bke::socket_value_storage (bNodeSocket &socket)
 
void blender::bke::node_socket_move_default_value (Main &bmain, bNodeTree &tree, bNodeSocket &src, bNodeSocket &dst)
 
bNodeblender::bke::node_copy (bNodeTree *dst_tree, const bNode &src_node, int flag, bool use_unique)
 
static int blender::bke::node_count_links (const bNodeTree *ntree, const bNodeSocket *socket)
 
void blender::bke::node_link_set_mute (bNodeTree *ntree, bNodeLink *link, const bool muted)
 
bool blender::bke::node_link_is_selected (const bNodeLink *link)
 
static void blender::bke::adjust_multi_input_indices_after_removed_link (bNodeTree *ntree, const bNodeSocket *sock, const int deleted_index)
 
void blender::bke::node_internal_relink (bNodeTree *ntree, bNode *node)
 
float2 blender::bke::node_to_view (const bNode *node, float2 loc)
 
float2 blender::bke::node_from_view (const bNode *node, float2 view_loc)
 
void blender::bke::node_position_relative (bNode *from_node, const bNode *to_node, const bNodeSocket *from_sock, const bNodeSocket *to_sock)
 
void blender::bke::node_position_propagate (bNode *node)
 
static bNodeTreeblender::bke::node_tree_add_tree_do (Main *bmain, std::optional< Library * > owner_library, ID *owner_id, const bool is_embedded, const char *name, const char *idname)
 
bNodeTreeblender::bke::node_tree_add_tree_embedded (Main *bmain, ID *owner_id, const char *name, const char *idname)
 
bNodeTreeblender::bke::node_tree_copy_tree_ex (const bNodeTree *ntree, Main *bmain, bool do_id_user)
 
bNodeTreeblender::bke::node_tree_copy_tree (Main *bmain, const bNodeTree *ntree)
 
bool blender::bke::node_preview_used (const bNode *node)
 
bNodePreviewblender::bke::node_preview_verify (bNodeInstanceHash *previews, bNodeInstanceKey key, int xsize, int ysize, bool create)
 
bNodePreviewblender::bke::node_preview_copy (bNodePreview *preview)
 
void blender::bke::node_preview_free (bNodePreview *preview)
 
static void blender::bke::node_preview_init_tree_recursive (bNodeInstanceHash *previews, bNodeTree *ntree, bNodeInstanceKey parent_key, const int xsize, const int ysize)
 
void blender::bke::node_preview_init_tree (bNodeTree *ntree, int xsize, int ysize)
 
static void blender::bke::node_preview_tag_used_recursive (bNodeInstanceHash *previews, bNodeTree *ntree, bNodeInstanceKey parent_key)
 
void blender::bke::node_preview_remove_unused (bNodeTree *ntree)
 
void blender::bke::node_preview_merge_tree (bNodeTree *to_ntree, bNodeTree *from_ntree, bool remove_old)
 
void blender::bke::node_unlink_node (bNodeTree *ntree, bNode *node)
 
static void blender::bke::node_unlink_attached (bNodeTree *ntree, const bNode *parent)
 
void blender::bke::node_rebuild_id_vector (bNodeTree *node_tree)
 
void blender::bke::node_free_node (bNodeTree *tree, bNode *node)
 
void blender::bke::node_tree_free_local_node (bNodeTree *ntree, bNode *node)
 
void blender::bke::node_tree_free_tree (bNodeTree *ntree)
 
void blender::bke::node_tree_node_flag_set (const bNodeTree *ntree, int flag, bool enable)
 
void blender::bke::node_tree_local_merge (Main *bmain, bNodeTree *localtree, bNodeTree *ntree)
 
static bool blender::bke::ntree_contains_tree_exec (const bNodeTree *tree_to_search_in, const bNodeTree *tree_to_search_for, Set< const bNodeTree * > &already_passed)
 
void blender::bke::node_set_socket_availability (bNodeTree *ntree, bNodeSocket *sock, bool is_available)
 
static void blender::bke::update_socket_declarations (ListBase *sockets, Span< nodes::SocketDeclaration * > declarations)
 
static void blender::bke::reset_socket_declarations (ListBase *sockets)
 
void blender::bke::node_socket_declarations_update (bNode *node)
 
bool blender::bke::node_declaration_ensure_on_outdated_node (bNodeTree *ntree, bNode *node)
 
bool blender::bke::node_declaration_ensure (bNodeTree *ntree, bNode *node)
 
static bNodeInstanceKey blender::bke::node_hash_int_str (bNodeInstanceKey hash, const char *str)
 
static uint blender::bke::node_instance_hash_key (const void *key)
 
static bool blender::bke::node_instance_hash_key_cmp (const void *a, const void *b)
 
static Set< intblender::bke::get_known_node_types_set ()
 
static bool blender::bke::can_read_node_type (const int type)
 
static void blender::bke::node_replace_undefined_types (bNode *node)
 
void blender::bke::node_tree_update_all_new (Main *main)
 
static void blender::bke::node_type_base_defaults (bNodeType *ntype)
 
static bool blender::bke::node_poll_default (const bNodeType *, const bNodeTree *, const char **)
 
static bool blender::bke::node_poll_instance_default (const bNode *node, const bNodeTree *ntree, const char **r_disabled_hint)
 
static const CPPTypeblender::bke::slow_socket_type_to_geo_nodes_base_cpp_type (const eNodeSocketDatatype type)
 
static bool blender::bke::unique_socket_template_identifier_check (void *arg, const char *name)
 
static void blender::bke::unique_socket_template_identifier (bNodeSocketTemplate *list, bNodeSocketTemplate *ntemp, const char defname[], const char delim)
 
void blender::bke::node_system_init ()
 
void blender::bke::node_system_exit ()
 
Generic API, Trees
void blender::bke::node_tree_blend_write (BlendWriter *writer, bNodeTree *ntree)
 
void blender::bke::node_tree_set_type (const bContext *C, bNodeTree *ntree)
 
bNodeTreeTypeblender::bke::node_tree_type_find (const char *idname)
 
void blender::bke::node_tree_type_add (bNodeTreeType *nt)
 
void blender::bke::node_tree_type_free_link (const bNodeTreeType *nt)
 
bool blender::bke::node_tree_is_registered (const bNodeTree *ntree)
 
GHashIteratorblender::bke::node_tree_type_get_iterator ()
 
bNodeTreeblender::bke::node_tree_add_tree (Main *bmain, const char *name, const char *idname)
 
bNodeTreeblender::bke::node_tree_add_in_lib (Main *bmain, Library *owner_library, const char *name, const char *idname)
 
void blender::bke::node_tree_free_embedded_tree (bNodeTree *ntree)
 
void blender::bke::node_tree_free_local_tree (bNodeTree *ntree)
 
void blender::bke::node_tree_set_output (bNodeTree *ntree)
 
bNodeTree ** blender::bke::node_tree_ptr_from_id (ID *id)
 
bNodeTreeblender::bke::node_tree_from_id (ID *id)
 
bNodeTreeblender::bke::node_tree_localize (bNodeTree *ntree, ID *new_owner_id)
 
bool blender::bke::node_tree_contains_tree (const bNodeTree *tree_to_search_in, const bNodeTree *tree_to_search_for)
 
void blender::bke::node_tree_update_all_users (Main *main, ID *id)
 
Generic API, Nodes
bNodeTypeblender::bke::node_type_find (const char *idname)
 
const char * blender::bke::node_type_find_alias (const char *idname)
 
void blender::bke::node_register_type (bNodeType *ntype)
 
void blender::bke::node_unregister_type (bNodeType *ntype)
 
void blender::bke::node_register_alias (bNodeType *nt, const char *alias)
 
GHashIteratorblender::bke::node_type_get_iterator ()
 
bNodeSocketTypeblender::bke::node_socket_type_find (const char *idname)
 
void blender::bke::node_register_socket_type (bNodeSocketType *stype)
 
void blender::bke::node_unregister_socket_type (bNodeSocketType *stype)
 
bool blender::bke::node_socket_is_registered (const bNodeSocket *sock)
 
GHashIteratorblender::bke::node_socket_type_get_iterator ()
 
const char * blender::bke::node_socket_type_label (const bNodeSocketType *stype)
 
bNodeSocketblender::bke::node_find_socket (bNode *node, eNodeSocketInOut in_out, StringRef identifier)
 
const bNodeSocketblender::bke::node_find_socket (const bNode *node, eNodeSocketInOut in_out, StringRef identifier)
 
void blender::bke::node_modify_socket_type_static (bNodeTree *ntree, bNode *node, bNodeSocket *sock, int type, int subtype)
 
bNodeSocketblender::bke::node_add_socket (bNodeTree *ntree, bNode *node, eNodeSocketInOut in_out, const char *idname, const char *identifier, const char *name)
 
const char * blender::bke::node_static_socket_type (int type, int subtype)
 
const char * blender::bke::node_static_socket_interface_type_new (int type, int subtype)
 
const char * blender::bke::node_static_socket_label (int type, int subtype)
 
bNodeSocketblender::bke::node_add_static_socket (bNodeTree *ntree, bNode *node, eNodeSocketInOut in_out, int type, int subtype, const char *identifier, const char *name)
 
void blender::bke::node_remove_socket (bNodeTree *ntree, bNode *node, bNodeSocket *sock)
 
bNodeblender::bke::node_find_node_by_name (bNodeTree *ntree, const char *name)
 
void blender::bke::node_find_node (bNodeTree *ntree, bNodeSocket *sock, bNode **r_node, int *r_sockindex)
 
bool blender::bke::node_find_node_try (bNodeTree *ntree, bNodeSocket *sock, bNode **r_node, int *r_sockindex)
 
bool blender::bke::node_is_parent_and_child (const bNode *parent, const bNode *child)
 
void blender::bke::node_unique_name (bNodeTree *ntree, bNode *node)
 
void blender::bke::node_unique_id (bNodeTree *ntree, bNode *node)
 
bNodeblender::bke::node_add_node (const bContext *C, bNodeTree *ntree, const char *idname)
 
bNodeblender::bke::node_add_static_node (const bContext *C, bNodeTree *ntree, int type)
 
bNodeLinkblender::bke::node_add_link (bNodeTree *ntree, bNode *fromnode, bNodeSocket *fromsock, bNode *tonode, bNodeSocket *tosock)
 
void blender::bke::node_remove_link (bNodeTree *ntree, bNodeLink *link)
 
void blender::bke::node_remove_socket_links (bNodeTree *ntree, bNodeSocket *sock)
 
bool blender::bke::node_link_is_hidden (const bNodeLink *link)
 
void blender::bke::node_attach_node (bNodeTree *ntree, bNode *node, bNode *parent)
 
void blender::bke::node_detach_node (bNodeTree *ntree, bNode *node)
 
void blender::bke::node_remove_node (Main *bmain, bNodeTree *ntree, bNode *node, bool do_id_user)
 
int blender::bke::node_count_socket_links (const bNodeTree *ntree, const bNodeSocket *sock)
 
bNodeblender::bke::node_get_active (bNodeTree *ntree)
 
bool blender::bke::node_set_selected (bNode *node, bool select)
 
void blender::bke::node_clear_active (bNodeTree *ntree)
 
void blender::bke::node_set_active (bNodeTree *ntree, bNode *node)
 
int blender::bke::node_socket_link_limit (const bNodeSocket *sock)
 
void blender::bke::node_dimensions_get (const bNode *node, float *r_width, float *r_height)
 
void blender::bke::node_tag_update_id (bNode *node)
 
void blender::bke::node_internal_links (bNode *node, bNodeLink **r_links, int *r_len)
 
bNodeInstanceKey blender::bke::node_instance_key (bNodeInstanceKey parent_key, const bNodeTree *ntree, const bNode *node)
 
bNodeInstanceHashblender::bke::node_instance_hash_new (const char *info)
 
void blender::bke::node_instance_hash_free (bNodeInstanceHash *hash, bNodeInstanceValueFP valfreefp)
 
void blender::bke::node_instance_hash_insert (bNodeInstanceHash *hash, bNodeInstanceKey key, void *value)
 
void * blender::bke::node_instance_hash_lookup (bNodeInstanceHash *hash, bNodeInstanceKey key)
 
int blender::bke::node_instance_hash_remove (bNodeInstanceHash *hash, bNodeInstanceKey key, bNodeInstanceValueFP valfreefp)
 
void blender::bke::node_instance_hash_clear (bNodeInstanceHash *hash, bNodeInstanceValueFP valfreefp)
 
void * blender::bke::node_instance_hash_pop (bNodeInstanceHash *hash, bNodeInstanceKey key)
 
int blender::bke::node_instance_hash_haskey (bNodeInstanceHash *hash, bNodeInstanceKey key)
 
int blender::bke::node_instance_hash_size (bNodeInstanceHash *hash)
 
void blender::bke::node_instance_hash_clear_tags (bNodeInstanceHash *hash)
 
void blender::bke::node_instance_hash_tag (bNodeInstanceHash *hash, void *value)
 
bool blender::bke::node_instance_hash_tag_key (bNodeInstanceHash *hash, bNodeInstanceKey key)
 
void blender::bke::node_instance_hash_remove_untagged (bNodeInstanceHash *hash, bNodeInstanceValueFP valfreefp)
 
Node Generic Functions
bNodeSocketblender::bke::node_find_enabled_socket (bNode &node, eNodeSocketInOut in_out, StringRef name)
 
bNodeSocketblender::bke::node_find_enabled_input_socket (bNode &node, StringRef name)
 
bNodeSocketblender::bke::node_find_enabled_output_socket (bNode &node, StringRef name)
 
std::optional< eCustomDataTypeblender::bke::socket_type_to_custom_data_type (eNodeSocketDatatype type)
 
std::optional< eNodeSocketDatatypeblender::bke::custom_data_type_to_socket_type (eCustomDataType type)
 
const CPPTypeblender::bke::socket_type_to_geo_nodes_base_cpp_type (eNodeSocketDatatype type)
 
std::optional< eNodeSocketDatatypeblender::bke::geo_nodes_base_cpp_type_to_socket_type (const CPPType &type)
 
std::optional< VolumeGridTypeblender::bke::socket_type_to_grid_type (eNodeSocketDatatype type)
 
std::optional< eNodeSocketDatatypeblender::bke::grid_type_to_socket_type (VolumeGridType type)
 
Node Type Access
void blender::bke::nodeLabel (const bNodeTree *ntree, const bNode *node, char *label, int maxlen)
 
const char * blender::bke::nodeSocketShortLabel (const bNodeSocket *sock)
 
const char * blender::bke::nodeSocketLabel (const bNodeSocket *sock)
 
void blender::bke::node_type_base (bNodeType *ntype, int type, const char *name, short nclass)
 
void blender::bke::node_type_base_custom (bNodeType *ntype, const char *idname, const char *name, const char *enum_name, short nclass)
 
void blender::bke::node_type_socket_templates (bNodeType *ntype, bNodeSocketTemplate *inputs, bNodeSocketTemplate *outputs)
 
void blender::bke::node_type_size (bNodeType *ntype, int width, int minwidth, int maxwidth)
 
void blender::bke::node_type_size_preset (bNodeType *ntype, eNodeSizePreset size)
 
void blender::bke::node_type_storage (bNodeType *ntype, const char *storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
 
Node Tree Iterator

Utility macro for visiting every node tree in the library data, including local bNodeTree blocks in other IDs. This avoids the need for callback functions and allows executing code in a single inner code block.

Variables:

  • nodetree: The actual bNodeTree data block. Check nodetree->idname or nodetree->typeinfo to use only specific types.
  • id: The owner of the bNodeTree data block. Same as nodetree if it's a linkable node tree from the library.

Examples:

FOREACH_NODETREE_BEGIN(bmain, nodetree, id) {
if (id == nodetree)
printf("This is a linkable node tree");
FOREACH_NODETREE_BEGIN(bmain, nodetree, id) {
if (nodetree->idname == "ShaderNodeTree")
printf("This is a shader node tree);
if (GS(id) == ID_MA)
printf(" and it's owned by a material");
} FOREACH_NODETREE_END;
#define FOREACH_NODETREE_END
Definition BKE_node.hh:870
#define FOREACH_NODETREE_BEGIN(bmain, _nodetree, _id)
Definition BKE_node.hh:860
#define printf
void blender::bke::node_tree_iterator_init (NodeTreeIterStore *ntreeiter, Main *bmain)
 
bool blender::bke::node_tree_iterator_step (NodeTreeIterStore *ntreeiter, bNodeTree **r_nodetree, ID **r_id)
 
Node Tree
void blender::bke::node_tree_remove_layer_n (bNodeTree *ntree, Scene *scene, int layer_index)
 

Variables

static CLG_LogRef LOG = {"bke.node"}
 
static AssetTypeInfo AssetType_NT
 
IDTypeInfo IDType_ID_NT
 
static GHashblender::bke::nodetreetypes_hash = nullptr
 
static GHashblender::bke::nodetypes_hash = nullptr
 
static GHashblender::bke::nodetypes_alias_hash = nullptr
 
static GHashblender::bke::nodesockettypes_hash = nullptr
 

Macro Definition Documentation

◆ DefNode

#define DefNode ( Category,
ID,
DefFunc,
EnumName,
StructName,
UIName,
UIDesc )
Value:
case ID: { \
STRNCPY(ntype->idname, #Category #StructName); \
StructRNA *srna = RNA_struct_find(#Category #StructName); \
BLI_assert(srna != nullptr); \
ntype->rna_ext.srna = srna; \
RNA_struct_blender_type_set(srna, ntype); \
RNA_def_struct_ui_text(srna, UIName, UIDesc); \
ntype->enum_name_legacy = EnumName; \
STRNCPY(ntype->ui_description, UIDesc); \
break; \
}
struct ID ID
StructRNA * RNA_struct_find(const char *identifier)

◆ DNA_DEPRECATED_ALLOW

#define DNA_DEPRECATED_ALLOW

Definition at line 20 of file node.cc.

Variable Documentation

◆ AssetType_NT

AssetTypeInfo AssetType_NT
static
Initial value:
= {
}
static void node_tree_asset_on_clear_asset(void *asset_ptr, AssetMetaData *asset_data)
Definition node.cc:1351
static void node_tree_asset_pre_save(void *asset_ptr, AssetMetaData *)
Definition node.cc:1333
static void node_tree_asset_on_mark_asset(void *asset_ptr, AssetMetaData *asset_data)
Definition node.cc:1339

Definition at line 1365 of file node.cc.

◆ IDType_ID_NT

IDTypeInfo IDType_ID_NT
Initial value:
= {
sizeof(bNodeTree),
"NodeTree",
N_("node_groups"),
nullptr,
nullptr,
nullptr,
}
@ IDTYPE_FLAGS_APPEND_IS_REUSABLE
Definition BKE_idtype.hh:39
#define BLT_I18NCONTEXT_ID_NODETREE
#define FILTER_ID_ALL
Definition DNA_ID.h:1206
@ INDEX_ID_NT
Definition DNA_ID.h:1264
#define FILTER_ID_NT
Definition DNA_ID.h:1180
@ ID_NT
struct bNodeTree bNodeTree
static ID ** node_owner_pointer_get(ID *id, const bool debug_relationship_assert)
Definition node.cc:462
static void node_foreach_path(ID *id, BPathForeachPathData *bpath_data)
Definition node.cc:439
static void ntree_copy_data(Main *, std::optional< Library * >, ID *id_dst, const ID *id_src, const int flag)
Definition node.cc:155
static void ntree_free_data(ID *id)
Definition node.cc:273
static void ntree_blend_read_after_liblink(BlendLibReader *reader, ID *id)
Definition node.cc:1282
static void ntree_init_data(ID *id)
Definition node.cc:146
static void node_foreach_id(ID *id, LibraryForeachIDData *data)
Definition node.cc:397
static void ntree_blend_read_data(BlendDataReader *reader, ID *id)
Definition node.cc:1276
static void ntree_blend_write(BlendWriter *writer, ID *id, const void *id_address)
Definition node.cc:933
static void node_foreach_cache(ID *id, IDTypeForeachCacheFunctionCallback function_callback, void *user_data)
Definition node.cc:415
static AssetTypeInfo AssetType_NT
Definition node.cc:1365
#define N_(msgid)

Definition at line 1371 of file node.cc.

◆ LOG

CLG_LogRef LOG = {"bke.node"}
static

Definition at line 126 of file node.cc.

Referenced by blender::bke::node_tree_blend_read_data().