diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-01-21 02:40:42 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-02-03 14:20:26 +0300 |
commit | f9ea097a872290d20cd94504adb3172165cb770d (patch) | |
tree | 1560b65cd6b5077e8690b26bb4b2f2ff251ff358 /source/blender/editors/space_node/drawnode.c | |
parent | 37beac8eb823bd81b411426bfc8718639577b179 (diff) |
Cycles: add Vector Displacement node and extend Displacement node.
This adds midlevel and object/world space for displacement, and a
vector displacement node with tangent/object/world space, midlevel
and scale.
Note that tangent space vector displacement still is not exactly
compatible with maps created by other software, this will require
changes to the tangent computation.
Differential Revision: https://developer.blender.org/D1734
Diffstat (limited to 'source/blender/editors/space_node/drawnode.c')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index bcf06f117aa..eccf3c057d4 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -1036,7 +1036,7 @@ static void node_shader_buts_normal_map(uiLayout *layout, bContext *C, PointerRN { uiItemR(layout, ptr, "space", 0, "", 0); - if (RNA_enum_get(ptr, "space") == SHD_NORMAL_MAP_TANGENT) { + if (RNA_enum_get(ptr, "space") == SHD_SPACE_TANGENT) { PointerRNA obptr = CTX_data_pointer_get(C, "active_object"); if (obptr.data && RNA_enum_get(&obptr, "type") == OB_MESH) { @@ -1048,6 +1048,11 @@ static void node_shader_buts_normal_map(uiLayout *layout, bContext *C, PointerRN } } +static void node_shader_buts_displacement(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +{ + uiItemR(layout, ptr, "space", 0, "", 0); +} + static void node_shader_buts_tangent(uiLayout *layout, bContext *C, PointerRNA *ptr) { uiLayout *split, *row; @@ -1239,6 +1244,10 @@ static void node_shader_set_butfunc(bNodeType *ntype) case SH_NODE_NORMAL_MAP: ntype->draw_buttons = node_shader_buts_normal_map; break; + case SH_NODE_DISPLACEMENT: + case SH_NODE_VECTOR_DISPLACEMENT: + ntype->draw_buttons = node_shader_buts_displacement; + break; case SH_NODE_TANGENT: ntype->draw_buttons = node_shader_buts_tangent; break; |