106 #ifdef WITH_FREESTYLE
146 node_next =
node->next;
192 "shader node tree type");
195 strcpy(tt->
idname,
"ShaderNodeTree");
196 strcpy(tt->
ui_name,
N_(
"Shader Editor"));
238 if (output_node ==
NULL) {
247 else if (
node->custom1 == target) {
248 if (output_node ==
NULL) {
267 if (
STREQ(sock->identifier, identifier)) {
298 switch (socket->
type) {
306 dst_rgba->
value[3] = 1.0f;
344 bool removed_link =
false;
378 bool link_added =
false;
389 if (is_group || is_group_output) {
444 nextnode =
node->next;
463 for (link = ngroup->
links.
first; link; link = linkn) {
472 if (glinks_first !=
NULL) {
474 for (link = glinks_first->
next; link != glinks_last->
next; link = link->
next) {
492 for (link = glinks_first->
next; link != glinks_last->
next; link = link->
next) {
504 while (group_interface_nodes) {
521 node_next =
node->next;
530 node_next =
node->next;
549 if (output_node ==
NULL) {
557 if (displacement ==
NULL) {
565 *r_link = displacement->
link;
580 if (
STREQ(sock->identifier,
"Normal") && sock->link ==
NULL) {
584 else if (sock->link) {
601 if (
node == node_from) {
605 if (
node->tmp_flag == -2) {
620 if (bump_normal_input->
link) {
648 int *node_count = (
int *)userdata;
679 if (
node->tmp_flag >= 0) {
680 int id =
node->tmp_flag;
695 if (link->fromnode->tmp_flag >= 0 && link->tonode->tmp_flag >= 0) {
696 bNode *fromnode = nodes_copy[link->fromnode->tmp_flag];
697 bNode *tonode = nodes_copy[link->tonode->tmp_flag];
705 for (
int i = 0; i < node_count; i++) {
711 return start_node_copy;
715 bNode *displacement_node,
736 bNode *displacement_node;
740 ntree, output_node, &displacement_node, &displacement_socket, &displacement_link)) {
748 ntree, displacement_node, displacement_socket, displacement_link);
754 ntree, output_node, &displacement_node, &displacement_socket, &displacement_link);
769 nodeAddLink(
ntree, displacement_node, displacement_socket, dot_node, dot_input1);
771 displacement_node = dot_node;
785 nodeAddLink(
ntree, displacement_node, displacement_socket, bump_node, bump_input_socket);
803 node->branch_tag = 1;
806 node->branch_tag = 2;
815 bNodeSocket *height_dx_sock, *height_dy_sock, *bump_socket, *bump_dx_socket, *bump_dy_socket;
816 bNode *bump = fromnode;
820 if (bump_dx_socket->
link) {
823 else if (bump_socket && bump_socket->
link) {
840 switch (fromnode->
type) {
873 if (output_node ==
NULL) {
885 bool *has_surface_output,
886 bool *has_volume_output)
937 *has_surface_output =
false;
938 *has_volume_output =
false;
944 if (surface_sock !=
NULL) {
948 if (volume_sock !=
NULL) {
1006 if (
exec->threadstack) {
1008 for (nts =
exec->threadstack[
a].first; nts; nts = nts->
next) {
typedef float(TangentPoint)[2]
struct Scene * CTX_data_scene(const bContext *C)
struct SpaceNode * CTX_wm_space_node(const bContext *C)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
@ LIB_ID_CREATE_NO_USER_REFCOUNT
Blender kernel freestyle line style functionality.
FreestyleLineStyle * BKE_linestyle_active_from_view_layer(struct ViewLayer *view_layer)
struct Material * BKE_object_material_get(struct Object *ob, short act)
void ntreeTypeAdd(struct bNodeTreeType *nt)
#define NODE_CLASS_OUTPUT
#define SH_NODE_OUTPUT_WORLD
#define NODE_CLASS_INTERFACE
void BKE_node_preview_sync_tree(struct bNodeTree *to_ntree, struct bNodeTree *from_ntree)
void nodeInternalRelink(struct bNodeTree *ntree, struct bNode *node)
const bNodeInstanceKey NODE_INSTANCE_KEY_BASE
#define NODE_CUSTOM_GROUP
#define SH_NODE_BSDF_PRINCIPLED
void ntreeFreeLocalNode(struct bNodeTree *ntree, struct bNode *node)
void BKE_node_preview_remove_unused(struct bNodeTree *ntree)
#define SH_NODE_SUBSURFACE_SCATTERING
void(* bNodeClassCallback)(void *calldata, int nclass, const char *name)
void ntreeFreeTree(struct bNodeTree *ntree)
void nodeRemLink(struct bNodeTree *ntree, struct bNodeLink *link)
#define NODE_CLASS_CONVERTOR
struct bNode * BKE_node_copy_ex(struct bNodeTree *ntree, const struct bNode *node_src, const int flag, const bool unique_name)
void ntreeUpdateTree(struct Main *main, struct bNodeTree *ntree)
void BKE_node_preview_merge_tree(struct bNodeTree *to_ntree, struct bNodeTree *from_ntree, bool remove_old)
void ntreeSetOutput(struct bNodeTree *ntree)
struct bNodeLink * nodeAddLink(struct bNodeTree *ntree, struct bNode *fromnode, struct bNodeSocket *fromsock, struct bNode *tonode, struct bNodeSocket *tosock)
#define SH_NODE_BSDF_ANISOTROPIC
#define NODE_CLASS_OP_VECTOR
#define SH_NODE_EEVEE_SPECULAR
#define NODE_CLASS_LAYOUT
#define NODE_CLASS_OP_COLOR
#define SH_NODE_BSDF_GLASS
void nodeChainIterBackwards(const bNodeTree *ntree, const bNode *node_start, bool(*callback)(bNode *, bNode *, void *), void *userdata, int recursion_lvl)
struct bNode * nodeAddStaticNode(const struct bContext *C, struct bNodeTree *ntree, int type)
int nodeCountSocketLinks(const struct bNodeTree *ntree, const struct bNodeSocket *sock)
#define NODE_CLASS_TEXTURE
#define NODE_CLASS_SHADER
#define SH_NODE_OUTPUT_AOV
#define NODE_CLASS_SCRIPT
bool BKE_scene_use_shading_nodes_custom(struct Scene *scene)
void void void * BLI_linklist_pop(LinkNode **listp) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void BLI_linklist_prepend(LinkNode **listp, void *ptr) ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void copy_v3_fl(float r[3], float f)
#define BLENDER_MAX_THREADS
@ NODE_VECTOR_MATH_DOT_PRODUCT
#define OBACT(_view_layer)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume Image Sky Noise Wave Voronoi Brick SH_NODE_TEX_COORD
Group RGB to Bright Vector Camera Vector Combine Material SH_NODE_OUTPUT_LIGHT
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume SH_NODE_BUMP
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse SH_NODE_BSDF_GLOSSY
Group RGB to Bright Vector Camera SH_NODE_VECTOR_MATH
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled SH_NODE_NEW_GEOMETRY
Group RGB to Bright Vector Camera Vector Combine SH_NODE_OUTPUT_MATERIAL
StructRNA RNA_ShaderNodeTree
FreestyleLineStyle linestyle
DEGForeachIDComponentCallback callback
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
void ntree_update_reroute_nodes(bNodeTree *ntree)
static bNodeSocketTemplate outputs[]
static bNodeSocketTemplate inputs[]
bNodeTreeExec * ntree_exec_begin(bNodeExecContext *context, bNodeTree *ntree, bNodeInstanceKey parent_key)
void ntree_exec_end(bNodeTreeExec *exec)
static void foreach_nodeclass(Scene *UNUSED(scene), void *calldata, bNodeClassCallback func)
bNodeTreeExec * ntreeShaderBeginExecTree(bNodeTree *ntree)
static bool ntree_branch_count_and_tag_nodes(bNode *fromnode, bNode *tonode, void *userdata)
static bool ntree_shader_expand_socket_default(bNodeTree *localtree, bNode *node, bNodeSocket *socket)
static void ntree_shader_bypass_bump_link(bNodeTree *ntree, bNode *bump_node, bNodeLink *bump_link)
static bool ntree_tag_bsdf_cb(bNode *fromnode, bNode *UNUSED(tonode), void *userdata)
static bNodeSocket * ntree_shader_node_find_output(bNode *node, const char *identifier)
static void ntree_shader_groups_expand_inputs(bNodeTree *localtree)
bNodeTreeExec * ntreeShaderBeginExecTree_internal(bNodeExecContext *context, bNodeTree *ntree, bNodeInstanceKey parent_key)
static void ntree_shader_groups_flatten(bNodeTree *localtree)
static void node_tag_branch_as_derivative(bNode *node, int dx)
static void local_sync(bNodeTree *localtree, bNodeTree *ntree)
static void localize(bNodeTree *localtree, bNodeTree *UNUSED(ntree))
static void ntree_shader_link_builtin_normal(bNodeTree *ntree, bNode *node_from, bNodeSocket *socket_from)
static void shader_get_from_context(const bContext *C, bNodeTreeType *UNUSED(treetype), bNodeTree **r_ntree, ID **r_id, ID **r_from)
static bNode * ntree_shader_copy_branch(bNodeTree *ntree, bNode *start_node, void(*callback)(bNode *node, int user_data), int user_data)
static void ntree_shader_tag_nodes(bNodeTree *ntree, bNode *output_node, nTreeTags *tags)
void ntreeGPUMaterialNodes(bNodeTree *localtree, GPUMaterial *mat, bool *has_surface_output, bool *has_volume_output)
static void update(bNodeTree *ntree)
static bNodeSocket * ntree_shader_node_find_socket(ListBase *sockets, const char *identifier)
static bool ntree_shader_bump_branches(bNode *fromnode, bNode *UNUSED(tonode), void *userdata)
static bool ntree_shader_has_displacement(bNodeTree *ntree, bNode *output_node, bNode **r_node, bNodeSocket **r_socket, bNodeLink **r_link)
static void ntree_shader_relink_node_normal(bNodeTree *ntree, bNode *node, bNode *node_from, bNodeSocket *socket_from)
static void ntree_shader_unlink_hidden_value_sockets(bNode *group_node, bNodeSocket *isock)
bNodeTreeType * ntreeType_Shader
static bool shader_validate_link(bNodeTree *UNUSED(ntree), bNodeLink *link)
static void ntree_shader_bypass_tagged_bump_nodes(bNodeTree *ntree)
static void ntree_shader_relink_displacement(bNodeTree *ntree, bNode *output_node)
static void flatten_group_do(bNodeTree *ntree, bNode *gnode)
struct nTreeTags nTreeTags
static bool shader_tree_poll(const bContext *C, bNodeTreeType *UNUSED(treetype))
void register_node_tree_type_sh(void)
void ntreeShaderEndExecTree(bNodeTreeExec *exec)
static void ntree_shader_copy_branch_displacement(bNodeTree *ntree, bNode *displacement_node, bNodeSocket *displacement_socket, bNodeLink *displacement_link)
bNode * ntreeShaderOutputNode(bNodeTree *ntree, int target)
void ntreeShaderEndExecTree_internal(bNodeTreeExec *exec)
static bNodeSocket * ntree_shader_node_find_input(bNode *node, const char *identifier)
static void local_merge(Main *UNUSED(bmain), bNodeTree *localtree, bNodeTree *ntree)
void ntreeExecGPUNodes(bNodeTreeExec *exec, GPUMaterial *mat, bNode *output_node)
static void exec(void *data, int UNUSED(thread), bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack **out)
const char * RE_engine_id_CYCLES
struct SELECTID_Context context
struct bNodeTree * nodetree
struct bNodeTree * nodetree
struct bNodeTree * nodetree
struct bNodeSocket * next
struct bNodeThreadStack * next
struct bNodeStack * stack
bool(* poll)(const struct bContext *C, struct bNodeTreeType *ntreetype)
void(* update)(struct bNodeTree *ntree)
void(* local_merge)(struct Main *bmain, struct bNodeTree *localtree, struct bNodeTree *ntree)
void(* get_from_context)(const struct bContext *C, struct bNodeTreeType *ntreetype, struct bNodeTree **r_ntree, struct ID **r_id, struct ID **r_from)
bool(* validate_link)(struct bNodeTree *ntree, struct bNodeLink *link)
void(* localize)(struct bNodeTree *localtree, struct bNodeTree *ntree)
void(* foreach_nodeclass)(struct Scene *scene, void *calldata, bNodeClassCallback func)
void(* local_sync)(struct bNodeTree *localtree, struct bNodeTree *ntree)
struct bNodeInstanceHash * previews
struct bNodeTreeExec * execdata