diff options
author | Bartosz Moniewski <monio> | 2020-02-17 14:31:38 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-02-17 15:24:07 +0300 |
commit | 67d12bb5192d04a596e216f63cff2875fdd8cfbf (patch) | |
tree | c4d866f343ec9b87f713ebd004a8f343ab6f5307 /source/blender/makesrna/intern/rna_nodetree.c | |
parent | ae9bbb4d0360aea694b46ee698d24dbc1476ebf3 (diff) |
Shading: add direction modes and phase offset to wave texture node
* Direction mode X, Y and Z to align with axes rather than diagonal or
spherical as previously. X is the new default, existing files will
use diagonal or spherical for compatibility.
* Phase offset to offset the wave along its direction, for purposes like
animation and distortion.
https://developer.blender.org/D6382
Diffstat (limited to 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index cc833287aa7..e17fdb5359d 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -4556,9 +4556,30 @@ static void def_sh_tex_wave(StructRNA *srna) {0, NULL, 0, NULL, NULL}, }; + static EnumPropertyItem prop_wave_bands_direction_items[] = { + {SHD_WAVE_BANDS_DIRECTION_X, "X", 0, "X", "Bands across X axis"}, + {SHD_WAVE_BANDS_DIRECTION_Y, "Y", 0, "Y", "Bands across Y axis"}, + {SHD_WAVE_BANDS_DIRECTION_Z, "Z", 0, "Z", "Bands across Z axis"}, + {SHD_WAVE_BANDS_DIRECTION_DIAGONAL, "DIAGONAL", 0, "Diagonal", "Bands across diagonal axis"}, + {0, NULL, 0, NULL, NULL}, + }; + + static EnumPropertyItem prop_wave_rings_direction_items[] = { + {SHD_WAVE_RINGS_DIRECTION_X, "X", 0, "X", "Rings along X axis"}, + {SHD_WAVE_RINGS_DIRECTION_Y, "Y", 0, "Y", "Rings along Y axis"}, + {SHD_WAVE_RINGS_DIRECTION_Z, "Z", 0, "Z", "Rings along Z axis"}, + {SHD_WAVE_RINGS_DIRECTION_SPHERICAL, + "SPHERICAL", + 0, + "Spherical", + "Rings along spherical distance"}, + {0, NULL, 0, NULL, NULL}, + }; + static const 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"}, + {SHD_WAVE_PROFILE_TRI, "TRI", 0, "Triangle", "Use a triangle profile"}, {0, NULL, 0, NULL, NULL}, }; @@ -4573,6 +4594,18 @@ static void def_sh_tex_wave(StructRNA *srna) RNA_def_property_ui_text(prop, "Wave Type", ""); RNA_def_property_update(prop, 0, "rna_Node_update"); + prop = RNA_def_property(srna, "bands_direction", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "bands_direction"); + RNA_def_property_enum_items(prop, prop_wave_bands_direction_items); + RNA_def_property_ui_text(prop, "Bands Direction", ""); + RNA_def_property_update(prop, 0, "rna_Node_update"); + + prop = RNA_def_property(srna, "rings_direction", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "rings_direction"); + RNA_def_property_enum_items(prop, prop_wave_rings_direction_items); + RNA_def_property_ui_text(prop, "Rings Direction", ""); + 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); |