diff options
author | Lukas Stockner <lukas.stockner@freenet.de> | 2017-05-03 01:21:18 +0300 |
---|---|---|
committer | Lukas Stockner <lukas.stockner@freenet.de> | 2017-05-03 17:44:52 +0300 |
commit | 4cf7fc3b3a4d032f0c0db632a46d40806e906cf1 (patch) | |
tree | 511e87033628608dd235ed352a007df4474234fa /source/blender/editors/space_node/drawnode.c | |
parent | 6bf4115c13962c99d1cdc97f2be92c4922f3fd33 (diff) |
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
Diffstat (limited to 'source/blender/editors/space_node/drawnode.c')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 2a63d094116..b7c41f04879 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -3069,6 +3069,7 @@ static void std_node_socket_draw(bContext *C, uiLayout *layout, PointerRNA *ptr, bNode *node = node_ptr->data; bNodeSocket *sock = ptr->data; int type = sock->typeinfo->type; + bool connected_to_virtual = (sock->link && (sock->link->fromsock->flag & SOCK_VIRTUAL)); /*int subtype = sock->typeinfo->subtype;*/ /* XXX not nice, eventually give this node its own socket type ... */ @@ -3076,8 +3077,8 @@ static void std_node_socket_draw(bContext *C, uiLayout *layout, PointerRNA *ptr, node_file_output_socket_draw(C, layout, ptr, node_ptr); return; } - - if ((sock->in_out == SOCK_OUT) || (sock->flag & SOCK_IN_USE) || (sock->flag & SOCK_HIDE_VALUE)) { + + if ((sock->in_out == SOCK_OUT) || ((sock->flag & SOCK_IN_USE) && !connected_to_virtual) || (sock->flag & SOCK_HIDE_VALUE)) { node_socket_button_label(C, layout, ptr, node_ptr, text); return; } @@ -3590,6 +3591,7 @@ void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link) { bool do_shaded = false; bool do_triple = false; + bool do_dashed = false; int th_col1 = TH_WIRE_INNER, th_col2 = TH_WIRE_INNER, th_col3 = TH_WIRE; if (link->fromsock == NULL && link->tosock == NULL) @@ -3606,7 +3608,9 @@ void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link) return; if (link->fromsock->flag & SOCK_UNAVAIL) return; - + if ((link->fromsock->flag & SOCK_VIRTUAL) || (link->fromsock->flag & SOCK_VIRTUAL)) + do_dashed = true; + if (link->flag & NODE_LINK_VALID) { /* special indicated link, on drop-node */ if (link->flag & NODE_LINKFLAG_HILITE) { @@ -3626,8 +3630,10 @@ void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link) th_col1 = TH_REDALERT; } } - + + if (do_dashed) setlinestyle(3); node_draw_link_bezier(v2d, snode, link, th_col1, do_shaded, th_col2, do_triple, th_col3); + if (do_dashed) setlinestyle(0); // node_draw_link_straight(v2d, snode, link, th_col1, do_shaded, th_col2, do_triple, th_col3); } |