[Bf-blender-cvs] [3aee13b3495] temp-geometry-nodes-fields-prototype-visualization: cleanup
Jacques Lucke
noreply at git.blender.org
Tue Aug 24 13:41:26 CEST 2021
Commit: 3aee13b3495413c4809b6993397ec28a9024bd89
Author: Jacques Lucke
Date: Tue Aug 24 13:41:16 2021 +0200
Branches: temp-geometry-nodes-fields-prototype-visualization
https://developer.blender.org/rB3aee13b3495413c4809b6993397ec28a9024bd89
cleanup
===================================================================
M source/blender/editors/space_node/drawnode.cc
===================================================================
diff --git a/source/blender/editors/space_node/drawnode.cc b/source/blender/editors/space_node/drawnode.cc
index 6f8c0a513da..732db4a78eb 100644
--- a/source/blender/editors/space_node/drawnode.cc
+++ b/source/blender/editors/space_node/drawnode.cc
@@ -4176,7 +4176,32 @@ void node_draw_link_bezier(const View2D *v2d,
int th_col2,
int th_col3)
{
- const float dim_factor = node_link_dim_factor(v2d, link);
+ float dim_factor = node_link_dim_factor(v2d, link);
+
+ if (link->fromsock) {
+ const SocketSingleState from_single_state = get_socket_single_state(
+ snode->edittree, link->fromnode, link->fromsock);
+ if (ELEM(from_single_state,
+ SocketSingleState::RequiredSingle,
+ SocketSingleState::CurrentlySingle)) {
+ th_col1 = th_col2 = TH_ACTIVE;
+ }
+ else {
+ dim_factor *= 0.7f;
+ }
+ }
+
+ if (link->fromsock && link->tosock) {
+ const SocketSingleState to_single_state = get_socket_single_state(
+ snode->edittree, link->tonode, link->tosock);
+ const SocketSingleState from_single_state = get_socket_single_state(
+ snode->edittree, link->fromnode, link->fromsock);
+
+ if (to_single_state == SocketSingleState::RequiredSingle &&
+ from_single_state == SocketSingleState::MaybeField) {
+ th_col1 = th_col2 = TH_REDALERT;
+ }
+ }
float vec[4][2];
const bool highlighted = link->flag & NODE_LINK_TEMP_HIGHLIGHT;
@@ -4278,28 +4303,6 @@ void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link)
}
}
- if (link->fromsock) {
- const SocketSingleState from_single_state = get_socket_single_state(
- snode->edittree, link->fromnode, link->fromsock);
- if (ELEM(from_single_state,
- SocketSingleState::RequiredSingle,
- SocketSingleState::CurrentlySingle)) {
- th_col1 = th_col2 = TH_ACTIVE;
- }
- }
-
- if (link->fromsock && link->tosock) {
- const SocketSingleState to_single_state = get_socket_single_state(
- snode->edittree, link->tonode, link->tosock);
- const SocketSingleState from_single_state = get_socket_single_state(
- snode->edittree, link->fromnode, link->fromsock);
-
- if (to_single_state == SocketSingleState::RequiredSingle &&
- from_single_state == SocketSingleState::MaybeField) {
- th_col1 = th_col2 = TH_REDALERT;
- }
- }
-
node_draw_link_bezier(v2d, snode, link, th_col1, th_col2, th_col3);
}
More information about the Bf-blender-cvs
mailing list