Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-11-07 01:05:58 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-11-07 01:05:58 +0400
commitfb56dbc2afc7c8b6ffc24406ed82cbcbff090da3 (patch)
tree5832366c7147ad6ebc858312ac106b5d1571b5e5 /source/blender/makesrna
parent3bf96250cde08ab9ad717819114b48ccb11c2d5d (diff)
Cycles: procedural texture nodes reorganization. This will break existing files
using them, but rather do it now that I have the chance still. Highlights: * Wood and Marble merged into a single Wave texture * Clouds + Distorted Noise merged into new Noise node * Blend renamed to Gradient * Stucci removed, was mostly useful for old bump * Noise removed, will come back later, didn't actually work yet * Depth setting is now Detail socket, which accepts float values * Scale socket instead of Size socket http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Textures
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c212
-rw-r--r--source/blender/makesrna/intern/rna_nodetree_types.h12
2 files changed, 21 insertions, 203 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index db80f8906fd..035a05e5124 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -1147,12 +1147,6 @@ static void def_sh_tex(StructRNA *srna)
RNA_def_property_ui_text(prop, "Color Mapping", "Color mapping settings");
}
-static void def_sh_tex_noise(StructRNA *srna)
-{
- RNA_def_struct_sdna_from(srna, "NodeTexNoise", "storage");
- def_sh_tex(srna);
-}
-
static void def_sh_tex_sky(StructRNA *srna)
{
PropertyRNA *prop;
@@ -1219,9 +1213,9 @@ static void def_sh_tex_image(StructRNA *srna)
RNA_def_property_update(prop, 0, "rna_Node_update");
}
-static void def_sh_tex_blend(StructRNA *srna)
+static void def_sh_tex_gradient(StructRNA *srna)
{
- static EnumPropertyItem prop_blend_progression[] = {
+ static EnumPropertyItem prop_gradient_type[] = {
{SHD_BLEND_LINEAR, "LINEAR", 0, "Linear", "Creates a linear progression"},
{SHD_BLEND_QUADRATIC, "QUADRATIC", 0, "Quadratic", "Creates a quadratic progression"},
{SHD_BLEND_EASING, "EASING", 0, "Easing", "Creates a progression easing from one step to the next"},
@@ -1231,73 +1225,21 @@ static void def_sh_tex_blend(StructRNA *srna)
{SHD_BLEND_RADIAL, "RADIAL", 0, "Radial", "Creates a radial progression"},
{0, NULL, 0, NULL, NULL}};
- static const EnumPropertyItem prop_axis_items[]= {
- {SHD_BLEND_HORIZONTAL, "HORIZONTAL", 0, "Horizontal", "Flips the texture's X and Y axis"},
- {SHD_BLEND_VERTICAL, "VERTICAL", 0, "Vertical", "Flips the texture's X and Y axis"},
- {0, NULL, 0, NULL, NULL}};
-
- PropertyRNA *prop;
-
- RNA_def_struct_sdna_from(srna, "NodeTexBlend", "storage");
- def_sh_tex(srna);
-
- prop= RNA_def_property(srna, "progression", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "progression");
- RNA_def_property_enum_items(prop, prop_blend_progression);
- RNA_def_property_ui_text(prop, "Progression", "Sets the style of the color blending");
- RNA_def_property_update(prop, 0, "rna_Node_update");
-
- prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_bitflag_sdna(prop, NULL, "axis");
- RNA_def_property_enum_items(prop, prop_axis_items);
- RNA_def_property_ui_text(prop, "Axis", "Flips the texture's X and Y axis");
- RNA_def_property_update(prop, 0, "rna_Node_update");
-}
-
-static void def_sh_tex_clouds(StructRNA *srna)
-{
PropertyRNA *prop;
- RNA_def_struct_sdna_from(srna, "NodeTexClouds", "storage");
+ RNA_def_struct_sdna_from(srna, "NodeTexGradient", "storage");
def_sh_tex(srna);
- prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "basis");
- RNA_def_property_enum_items(prop, prop_noise_basis_items);
- RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, 0, "rna_Node_update");
-
- prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "hard");
- RNA_def_property_enum_items(prop, prop_noise_type_items);
- RNA_def_property_ui_text(prop, "Noise Type", "");
- RNA_def_property_update(prop, 0, "rna_Node_update");
-
- prop= RNA_def_property(srna, "turbulence_depth", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "depth");
- RNA_def_property_range(prop, 0, 30);
- RNA_def_property_ui_text(prop, "Depth", "Level of detail in the added turbulent noise");
+ prop= RNA_def_property(srna, "gradient_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, prop_gradient_type);
+ RNA_def_property_ui_text(prop, "Gradient Type", "Sets the style of the color blending");
RNA_def_property_update(prop, 0, "rna_Node_update");
}
-static void def_sh_tex_distnoise(StructRNA *srna)
+static void def_sh_tex_noise(StructRNA *srna)
{
- PropertyRNA *prop;
-
- RNA_def_struct_sdna_from(srna, "NodeTexDistortedNoise", "storage");
+ RNA_def_struct_sdna_from(srna, "NodeTexNoise", "storage");
def_sh_tex(srna);
-
- prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "basis");
- RNA_def_property_enum_items(prop, prop_noise_basis_items);
- RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, 0, "rna_Node_update");
-
- prop= RNA_def_property(srna, "noise_distortion", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "distortion_basis");
- RNA_def_property_enum_items(prop, prop_noise_basis_items);
- RNA_def_property_ui_text(prop, "Noise Distortion", "Sets the noise basis used for distortion");
- RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_sh_tex_magic(StructRNA *srna)
@@ -1314,50 +1256,6 @@ static void def_sh_tex_magic(StructRNA *srna)
RNA_def_property_update(prop, 0, "rna_Node_update");
}
-static void def_sh_tex_marble(StructRNA *srna)
-{
- static EnumPropertyItem prop_marble_stype[] = {
- {SHD_MARBLE_SOFT, "SOFT", 0, "Soft", "Uses soft marble"},
- {SHD_MARBLE_SHARP, "SHARP", 0, "Sharp", "Uses more clearly defined marble"},
- {SHD_MARBLE_SHARPER, "SHARPER", 0, "Sharper", "Uses very clearly defined marble"},
- {0, NULL, 0, NULL, NULL}};
-
- PropertyRNA *prop;
-
- RNA_def_struct_sdna_from(srna, "NodeTexMarble", "storage");
- def_sh_tex(srna);
-
- prop= RNA_def_property(srna, "marble_type", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "type");
- RNA_def_property_enum_items(prop, prop_marble_stype);
- RNA_def_property_ui_text(prop, "Type", "");
- RNA_def_property_update(prop, 0, "rna_Node_update");
-
- prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "basis");
- RNA_def_property_enum_items(prop, prop_noise_basis_items);
- RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, 0, "rna_Node_update");
-
- prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "hard");
- RNA_def_property_enum_items(prop, prop_noise_type_items);
- RNA_def_property_ui_text(prop, "Noise Type", "");
- RNA_def_property_update(prop, 0, "rna_Node_update");
-
- prop= RNA_def_property(srna, "turbulence_depth", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "depth");
- RNA_def_property_range(prop, 0, 30);
- RNA_def_property_ui_text(prop, "Depth", "Level of detail in the added turbulent noise");
- RNA_def_property_update(prop, 0, "rna_Node_update");
-
- prop= RNA_def_property(srna, "wave_type", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "wave");
- RNA_def_property_enum_items(prop, prop_wave_items);
- RNA_def_property_ui_text(prop, "Wave Type", "");
- RNA_def_property_update(prop, 0, "rna_Node_update");
-}
-
static void def_sh_tex_musgrave(StructRNA *srna)
{
static EnumPropertyItem prop_musgrave_type[] = {
@@ -1374,67 +1272,17 @@ static void def_sh_tex_musgrave(StructRNA *srna)
def_sh_tex(srna);
prop= RNA_def_property(srna, "musgrave_type", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "type");
+ RNA_def_property_enum_sdna(prop, NULL, "musgrave_type");
RNA_def_property_enum_items(prop, prop_musgrave_type);
RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_update(prop, 0, "rna_Node_update");
-
- prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "basis");
- RNA_def_property_enum_items(prop, prop_noise_basis_items);
- RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, 0, "rna_Node_update");
-}
-
-static void def_sh_tex_stucci(StructRNA *srna)
-{
- static EnumPropertyItem prop_stucci_stype[] = {
- {SHD_STUCCI_PLASTIC, "PLASTIC", 0, "Plastic", "Uses standard stucci"},
- {SHD_STUCCI_WALL_IN, "WALL_IN", 0, "Wall in", "Creates Dimples"},
- {SHD_STUCCI_WALL_OUT, "WALL_OUT", 0, "Wall out", "Creates Ridges"},
- {0, NULL, 0, NULL, NULL}};
-
- PropertyRNA *prop;
-
- RNA_def_struct_sdna_from(srna, "NodeTexStucci", "storage");
- def_sh_tex(srna);
-
- prop= RNA_def_property(srna, "stucci_type", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "type");
- RNA_def_property_enum_items(prop, prop_stucci_stype);
- RNA_def_property_ui_text(prop, "Type", "");
- RNA_def_property_update(prop, 0, "rna_Node_update");
-
- prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "basis");
- RNA_def_property_enum_items(prop, prop_noise_basis_items);
- RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, 0, "rna_Node_update");
-
- prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "hard");
- RNA_def_property_enum_items(prop, prop_noise_type_items);
- RNA_def_property_ui_text(prop, "Noise Type", "");
- RNA_def_property_update(prop, 0, "rna_Node_update");
}
static void def_sh_tex_voronoi(StructRNA *srna)
{
- static EnumPropertyItem prop_distance_metric_items[] = {
- {SHD_VORONOI_ACTUAL_DISTANCE, "DISTANCE", 0, "Actual Distance", ""},
- {SHD_VORONOI_DISTANCE_SQUARED, "DISTANCE_SQUARED", 0, "Distance Squared", ""},
- {SHD_VORONOI_MANHATTAN, "MANHATTAN", 0, "Manhattan", ""},
- {SHD_VORONOI_CHEBYCHEV, "CHEBYCHEV", 0, "Chebychev", ""},
- {SHD_VORONOI_MINKOVSKY_H, "MINKOVSKY_HALF", 0, "Minkovsky 1/2", ""},
- {SHD_VORONOI_MINKOVSKY_4, "MINKOVSKY_FOUR", 0, "Minkovsky 4", ""},
- {SHD_VORONOI_MINKOVSKY, "MINKOVSKY", 0, "Minkovsky", ""},
- {0, NULL, 0, NULL, NULL}};
-
static EnumPropertyItem prop_coloring_items[] = {
{SHD_VORONOI_INTENSITY, "INTENSITY", 0, "Intensity", "Only calculate intensity"},
- {SHD_VORONOI_POSITION, "POSITION", 0, "Position", "Color cells by position"},
- {SHD_VORONOI_POSITION_OUTLINE, "POSITION_OUTLINE", 0, "Position and Outline", "Use position plus an outline based on F2-F.1"},
- {SHD_VORONOI_POSITION_OUTLINE_INTENSITY, "POSITION_OUTLINE_INTENSITY", 0, "Position, Outline, and Intensity", "Multiply position and outline by intensity"},
+ {SHD_VORONOI_CELLS, "CELLS", 0, "Cells", "Color cells by position"},
{0, NULL, 0, NULL, NULL}};
PropertyRNA *prop;
@@ -1442,12 +1290,6 @@ static void def_sh_tex_voronoi(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeTexVoronoi", "storage");
def_sh_tex(srna);
- prop= RNA_def_property(srna, "distance_metric", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "distance_metric");
- RNA_def_property_enum_items(prop, prop_distance_metric_items);
- RNA_def_property_ui_text(prop, "Distance Metric", "");
- RNA_def_property_update(prop, 0, "rna_Node_update");
-
prop= RNA_def_property(srna, "coloring", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "coloring");
RNA_def_property_enum_items(prop, prop_coloring_items);
@@ -1455,41 +1297,21 @@ static void def_sh_tex_voronoi(StructRNA *srna)
RNA_def_property_update(prop, 0, "rna_Node_update");
}
-static void def_sh_tex_wood(StructRNA *srna)
+static void def_sh_tex_wave(StructRNA *srna)
{
- static EnumPropertyItem prop_wood_type_items[] = {
- {SHD_WOOD_BANDS, "BANDS", 0, "Bands", "Uses standard wood texture in bands"},
- {SHD_WOOD_RINGS, "RINGS", 0, "Rings", "Uses wood texture in rings"},
- {SHD_WOOD_BAND_NOISE, "BAND_NOISE", 0, "Band Noise", "Adds noise to standard wood"},
- {SHD_WOOD_RING_NOISE, "RING_NOISE", 0, "Ring Noise", "Adds noise to rings"},
+ static EnumPropertyItem prop_wave_type_items[] = {
+ {SHD_WAVE_BANDS, "BANDS", 0, "Bands", "Uses standard wave texture in bands"},
+ {SHD_WAVE_RINGS, "RINGS", 0, "Rings", "Uses wave texture in rings"},
{0, NULL, 0, NULL, NULL}};
PropertyRNA *prop;
- RNA_def_struct_sdna_from(srna, "NodeTexWood", "storage");
+ RNA_def_struct_sdna_from(srna, "NodeTexWave", "storage");
def_sh_tex(srna);
- prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "basis");
- RNA_def_property_enum_items(prop, prop_noise_basis_items);
- RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
- RNA_def_property_update(prop, 0, "rna_Node_update");
-
- prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "hard");
- RNA_def_property_enum_items(prop, prop_noise_type_items);
- RNA_def_property_ui_text(prop, "Noise Type", "");
- RNA_def_property_update(prop, 0, "rna_Node_update");
-
- prop= RNA_def_property(srna, "wood_type", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "type");
- RNA_def_property_enum_items(prop, prop_wood_type_items);
- RNA_def_property_ui_text(prop, "Wood Type", "");
- RNA_def_property_update(prop, 0, "rna_Node_update");
-
prop= RNA_def_property(srna, "wave_type", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "wave");
- RNA_def_property_enum_items(prop, prop_wave_items);
+ RNA_def_property_enum_sdna(prop, NULL, "wave_type");
+ 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");
}
diff --git a/source/blender/makesrna/intern/rna_nodetree_types.h b/source/blender/makesrna/intern/rna_nodetree_types.h
index c74d8943bcf..911501efc04 100644
--- a/source/blender/makesrna/intern/rna_nodetree_types.h
+++ b/source/blender/makesrna/intern/rna_nodetree_types.h
@@ -58,7 +58,7 @@ DefNode( ShaderNode, SH_NODE_OUTPUT_LAMP, 0, "OUTPU
//DefNode( ShaderNode, SH_NODE_OUTPUT_TEXTURE, 0, "OUTPUT_TEXTURE", OutputTexture, "Texture Output", "" )
DefNode( ShaderNode, SH_NODE_OUTPUT_WORLD, 0, "OUTPUT_WORLD", OutputWorld, "World Output", "" )
DefNode( ShaderNode, SH_NODE_FRESNEL, 0, "FRESNEL", Fresnel, "Fresnel", "" )
-DefNode( ShaderNode, SH_NODE_BLEND_WEIGHT, 0, "BLEND_WEIGHT", BlendWeight, "BlendWeight", "" )
+DefNode( ShaderNode, SH_NODE_LAYER_WEIGHT, 0, "LAYER_WEIGHT", LayerWeight, "LayerWeight", "" )
DefNode( ShaderNode, SH_NODE_MIX_SHADER, 0, "MIX_SHADER", MixShader, "Mix Shader", "" )
DefNode( ShaderNode, SH_NODE_ADD_SHADER, 0, "ADD_SHADER", AddShader, "Add Shader", "" )
@@ -79,17 +79,13 @@ DefNode( ShaderNode, SH_NODE_GEOMETRY, 0, "GE
DefNode( ShaderNode, SH_NODE_LIGHT_PATH, 0, "LIGHT_PATH", Light_path, "Light_path", "")
DefNode( ShaderNode, SH_NODE_TEX_IMAGE, def_sh_tex_image, "TEX_IMAGE", TexImage, "Image Texture", "")
DefNode( ShaderNode, SH_NODE_TEX_ENVIRONMENT, def_sh_tex_environment, "TEX_ENVIRONMENT", TexEnvironment, "Environment Texture", "")
-DefNode( ShaderNode, SH_NODE_TEX_NOISE, def_sh_tex_noise, "TEX_NOISE", TexNoise, "Noise Texture", "")
DefNode( ShaderNode, SH_NODE_TEX_SKY, def_sh_tex_sky, "TEX_SKY", TexSky, "Sky Texture", "")
-DefNode( ShaderNode, SH_NODE_TEX_BLEND, def_sh_tex_blend, "TEX_BLEND", TexBlend, "Blend Texture", "")
-DefNode( ShaderNode, SH_NODE_TEX_CLOUDS, def_sh_tex_clouds, "TEX_CLOUDS", TexClouds, "Clouds Texture", "")
-DefNode( ShaderNode, SH_NODE_TEX_DISTNOISE, def_sh_tex_distnoise, "TEX_DISTORTED_NOISE", TexDistortedNoise, "Distorted Noise Texture", "")
+DefNode( ShaderNode, SH_NODE_TEX_GRADIENT, def_sh_tex_gradient, "TEX_GRADIENT", TexGradient, "Gradient Texture", "")
+DefNode( ShaderNode, SH_NODE_TEX_NOISE, def_sh_tex_noise, "TEX_NOISE", TexNoise, "Noise Texture", "")
DefNode( ShaderNode, SH_NODE_TEX_MAGIC, def_sh_tex_magic, "TEX_MAGIC", TexMagic, "Magic Texture", "")
-DefNode( ShaderNode, SH_NODE_TEX_MARBLE, def_sh_tex_marble, "TEX_MARBLE", TexMarble, "Marble Texture", "")
+DefNode( ShaderNode, SH_NODE_TEX_WAVE, def_sh_tex_wave, "TEX_WAVE", TexWave, "Wave Texture", "")
DefNode( ShaderNode, SH_NODE_TEX_MUSGRAVE, def_sh_tex_musgrave, "TEX_MUSGRAVE", TexMusgrave, "Musgrave Texture", "")
-DefNode( ShaderNode, SH_NODE_TEX_STUCCI, def_sh_tex_stucci, "TEX_STUCCI", TexStucci, "Stucci Texture", "")
DefNode( ShaderNode, SH_NODE_TEX_VORONOI, def_sh_tex_voronoi, "TEX_VORONOI", TexVoronoi, "Voronoi Texture", "")
-DefNode( ShaderNode, SH_NODE_TEX_WOOD, def_sh_tex_wood, "TEX_WOOD", TexWood, "Wood Texture", "")
DefNode( ShaderNode, SH_NODE_TEX_COORD, 0, "TEX_COORD", TexCoord, "Texture Coordinate", "")
DefNode( CompositorNode, CMP_NODE_VIEWER, 0, "VIEWER", Viewer, "Viewer", "" )