Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/node_draw.cc
| Show First 20 Lines • Show All 654 Lines • ▼ Show 20 Lines | |||||
| static void node_draw_mute_line(const bContext &C, | static void node_draw_mute_line(const bContext &C, | ||||
| const View2D &v2d, | const View2D &v2d, | ||||
| const SpaceNode &snode, | const SpaceNode &snode, | ||||
| const bNode &node) | const bNode &node) | ||||
| { | { | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| LISTBASE_FOREACH (const bNodeLink *, link, &node.internal_links) { | LISTBASE_FOREACH (const bNodeLink *, link, &node.internal_links) { | ||||
| node_draw_link_bezier(C, v2d, snode, *link, TH_WIRE_INNER, TH_WIRE_INNER, TH_WIRE); | node_draw_link_bezier(C, v2d, snode, *link, TH_WIRE_INNER, TH_WIRE_INNER, TH_WIRE, false); | ||||
| } | } | ||||
| GPU_blend(GPU_BLEND_NONE); | GPU_blend(GPU_BLEND_NONE); | ||||
| } | } | ||||
| static void node_socket_draw(const bNodeSocket &sock, | static void node_socket_draw(const bNodeSocket &sock, | ||||
| const float color[4], | const float color[4], | ||||
| const float color_outline[4], | const float color_outline[4], | ||||
| ▲ Show 20 Lines • Show All 1,973 Lines • ▼ Show 20 Lines | #endif | ||||
| node_draw(C, region, snode, ntree, *nodes[i], *blocks[i], key); | node_draw(C, region, snode, ntree, *nodes[i], *blocks[i], key); | ||||
| } | } | ||||
| /* Node lines. */ | /* Node lines. */ | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| nodelink_batch_start(snode); | nodelink_batch_start(snode); | ||||
| LISTBASE_FOREACH (bNodeLink *, link, &ntree.links) { | LISTBASE_FOREACH (bNodeLink *, link, &ntree.links) { | ||||
| if (!nodeLinkIsHidden(link)) { | if (!nodeLinkIsHidden(link) && !nodeLinkIsSelected(link)) { | ||||
| node_draw_link(C, region.v2d, snode, *link); | node_draw_link(C, region.v2d, snode, *link, false); | ||||
| } | } | ||||
| } | } | ||||
| /* Draw selected node links after the unselected ones, so they are shown on top. */ | |||||
| LISTBASE_FOREACH (bNodeLink *, link, &ntree.links) { | |||||
| if (!nodeLinkIsHidden(link) && nodeLinkIsSelected(link)) { | |||||
| node_draw_link(C, region.v2d, snode, *link, true); | |||||
| } | |||||
| } | |||||
| nodelink_batch_end(snode); | nodelink_batch_end(snode); | ||||
| GPU_blend(GPU_BLEND_NONE); | GPU_blend(GPU_BLEND_NONE); | ||||
| /* Draw foreground nodes, last nodes in front. */ | /* Draw foreground nodes, last nodes in front. */ | ||||
| for (const int i : nodes.index_range()) { | for (const int i : nodes.index_range()) { | ||||
| if (nodes[i]->flag & NODE_BACKGROUND) { | if (nodes[i]->flag & NODE_BACKGROUND) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 168 Lines • ▼ Show 20 Lines | if (ntree) { | ||||
| draw_nodetree(C, region, *ntree, path->parent_key); | draw_nodetree(C, region, *ntree, path->parent_key); | ||||
| } | } | ||||
| /* Temporary links. */ | /* Temporary links. */ | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| GPU_line_smooth(true); | GPU_line_smooth(true); | ||||
| if (snode.runtime->linkdrag) { | if (snode.runtime->linkdrag) { | ||||
| for (const bNodeLink *link : snode.runtime->linkdrag->links) { | for (const bNodeLink *link : snode.runtime->linkdrag->links) { | ||||
| node_draw_link(C, v2d, snode, *link); | node_draw_link(C, v2d, snode, *link, true); | ||||
| } | } | ||||
| } | } | ||||
| GPU_line_smooth(false); | GPU_line_smooth(false); | ||||
| GPU_blend(GPU_BLEND_NONE); | GPU_blend(GPU_BLEND_NONE); | ||||
| if (snode.overlay.flag & SN_OVERLAY_SHOW_OVERLAYS && snode.flag & SNODE_SHOW_GPENCIL) { | if (snode.overlay.flag & SN_OVERLAY_SHOW_OVERLAYS && snode.flag & SNODE_SHOW_GPENCIL) { | ||||
| /* Draw grease-pencil annotations. */ | /* Draw grease-pencil annotations. */ | ||||
| ED_annotation_draw_view2d(&C, true); | ED_annotation_draw_view2d(&C, true); | ||||
| Show All 30 Lines | |||||