diff options
author | Lukas Stockner <lukas.stockner@freenet.de> | 2015-12-29 16:42:49 +0300 |
---|---|---|
committer | Lukas Stockner <lukas.stockner@freenet.de> | 2016-01-02 01:25:37 +0300 |
commit | 5c682a901b2ae9acf656f19e5f9b470d957d71cc (patch) | |
tree | 18ffa9d0ed4164ce601c285c700642a26a3c6eb9 /source | |
parent | 1991ee173865ed79a78b50afc3f7a46af472e9dd (diff) |
Cycles: Add Saw option to the wave texture
This commit adds "Bands Saw" and "Rings Saw" to the options for the Wave texture node in Cycles, behaving similar to the Saw option in BI textures.
Requested by @cekuhnen on BA.
Reviewers: dingto, sergey
Subscribers: cekuhnen
Differential Revision: https://developer.blender.org/D1699
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 1 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_node_types.h | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 12 |
3 files changed, 17 insertions, 1 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 603db9564cf..50e31ffca64 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -939,6 +939,7 @@ static void node_shader_buts_tex_brick(uiLayout *layout, bContext *UNUSED(C), Po static void node_shader_buts_tex_wave(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiItemR(layout, ptr, "wave_type", 0, "", ICON_NONE); + uiItemR(layout, ptr, "wave_profile", 0, "", ICON_NONE); } static void node_shader_buts_tex_musgrave(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 86713d7dcc8..7aec437b62b 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -778,7 +778,7 @@ typedef struct NodeTexMusgrave { typedef struct NodeTexWave { NodeTexBase base; int wave_type; - int pad; + int wave_profile; } NodeTexWave; typedef struct NodeTexMagic { @@ -972,6 +972,9 @@ typedef struct NodeSunBeams { #define SHD_WAVE_BANDS 0 #define SHD_WAVE_RINGS 1 +#define SHD_WAVE_PROFILE_SIN 0 +#define SHD_WAVE_PROFILE_SAW 1 + /* sky texture */ #define SHD_SKY_OLD 0 #define SHD_SKY_NEW 1 diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index c10fe52bb29..984ecbe96ac 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -3858,6 +3858,12 @@ static void def_sh_tex_wave(StructRNA *srna) {0, NULL, 0, NULL, NULL} }; + static EnumPropertyItem prop_wave_profile_items[] = { + {SHD_WAVE_PROFILE_SIN, "SIN", 0, "Sine", "Use a standard sine profile"}, + {SHD_WAVE_PROFILE_SAW, "SAW", 0, "Saw", "Use a sawtooth profile"}, + {0, NULL, 0, NULL, NULL} + }; + PropertyRNA *prop; RNA_def_struct_sdna_from(srna, "NodeTexWave", "storage"); @@ -3868,6 +3874,12 @@ static void def_sh_tex_wave(StructRNA *srna) RNA_def_property_enum_items(prop, prop_wave_type_items); RNA_def_property_ui_text(prop, "Wave Type", ""); RNA_def_property_update(prop, 0, "rna_Node_update"); + + prop = RNA_def_property(srna, "wave_profile", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "wave_profile"); + RNA_def_property_enum_items(prop, prop_wave_profile_items); + RNA_def_property_ui_text(prop, "Wave Profile", ""); + RNA_def_property_update(prop, 0, "rna_Node_update"); } static void def_sh_tex_coord(StructRNA *srna) |