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
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user