57 MEM_delete(ma->nodetree);
58 ma->nodetree =
nullptr;
61 ma->nodetree->owner_id = &ma->id;
62 for (
bNode *node_iter : ma->nodetree->all_nodes()) {
76 ntree = world->nodetree;
102 shader->location[0] = -200.0f;
103 shader->location[1] = 100.0f;
104 output->location[0] = 200.0f;
105 output->location[1] = 100.0f;
110 printf(
"node_tree_shader_default() called on wrong ID type.\n");
132 in->location[0] = -150.0f -
in->width;
133 in->location[1] = 100.0f;
General operations, lookup, etc. for materials.
#define SH_NODE_OUTPUT_WORLD
#define SH_NODE_BACKGROUND
#define SH_NODE_OUTPUT_LIGHT
#define STRNCPY_UTF8(dst, src)
Object is a sort of wrapper for general info.
StringRefNull ref() const
bNodeTree * node_tree_add_tree_embedded(Main *bmain, ID *owner_id, StringRefNull name, StringRefNull idname)
bNodeTree * node_tree_copy_tree(Main *bmain, const bNodeTree &ntree)
bNode * node_add_node(const bContext *C, bNodeTree &ntree, UString idname, std::optional< int > unique_identifier=std::nullopt)
bNode * node_add_static_node(const bContext *C, bNodeTree &ntree, int type)
bNodeLink & node_add_link(bNodeTree &ntree, bNode &fromnode, bNodeSocket &fromsock, bNode &tonode, bNodeSocket &tosock)
bNodeSocket * node_find_socket(bNode &node, eNodeSocketInOut in_out, UString identifier)
void node_set_active(bNodeTree &ntree, bNode &node)
void node_tree_free_embedded_tree(bNodeTree *ntree)
void node_unique_name(bNodeTree &ntree, bNode &node)
void node_tree_shader_default(const bContext *C, Main *bmain, ID *id)
void node_tree_composit_default_init(const bContext *C, bNodeTree *ntree)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
MINLINE void copy_v3_v3(float r[3], const float a[3])
Material * BKE_material_default_surface()
Material * BKE_material_default_volume()
void BKE_ntree_update_after_single_tree_change(Main &bmain, bNodeTree &modified_tree, const NodeTreeUpdateExtraParams ¶ms={})
struct bke::bNodeTreeType * ntreeType_Shader
Main * CTX_data_main(const bContext *C)
ID_Type GS(const char *name)
@ NODE_INTERFACE_SOCKET_OUTPUT
@ NODE_INTERFACE_SOCKET_INPUT
Material * BKE_material_default_gsplat()
Object * CTX_data_active_object(const bContext *C)
bNodeTreeInterface tree_interface
ListBaseT< bNodeSocket > inputs