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>2009-03-25 17:42:47 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-03-25 17:42:47 +0300
commita26a3f423fd6503dc2fbcd5f105c766ac3288515 (patch)
treedcc7508f3a159d79c09668197157545991e4bc32 /source/blender
parentae76d25e653878bc3bc56f43e407d68147f40557 (diff)
RNA: texture types Clouds/Wood/Marble/Magic/Stucci wrapped,
patch by Sven von Brand, thanks!
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/makesrna/intern/rna_texture.c236
1 files changed, 228 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index c7b479f8e45..e975c80a440 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -42,17 +42,17 @@ StructRNA *rna_Texture_refine(struct PointerRNA *ptr)
switch(tex->type) {
case TEX_CLOUDS:
return &RNA_CloudsTexture;
- /*case TEX_WOOD:
+ case TEX_WOOD:
return &RNA_WoodTexture;
case TEX_MARBLE:
return &RNA_MarbleTexture;
case TEX_MAGIC:
return &RNA_MagicTexture;
- case TEX_BLEND:
- return &RNA_BlendTexture;
+ /*case TEX_BLEND:
+ return &RNA_BlendTexture; */
case TEX_STUCCI:
return &RNA_StucciTexture;
- case TEX_NOISE:
+ /*case TEX_NOISE:
return &RNA_NoiseTexture;
case TEX_IMAGE:
return &RNA_ImageTexture;
@@ -320,11 +320,24 @@ static EnumPropertyItem prop_noise_basis_items[] = {
{TEX_CELLNOISE, "CELL_NOISE", "Cell Noise", ""},
{0, NULL, NULL, NULL}};
+static EnumPropertyItem prop_noise_type[] = {
+ {TEX_NOISESOFT, "SOFT_NOISE", "Soft Noise", ""},
+ {TEX_NOISEPERL, "HARD_NOISE", "Hard Noise", ""},
+ {0, NULL, NULL, NULL}
+ };
+
+
static void rna_def_texture_clouds(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
+ static EnumPropertyItem prop_clouds_stype[] = {
+ {TEX_DEFAULT, "DEFAULT", "Default", ""},
+ {TEX_COLOR, "COLOR", "Color", ""},
+ {0, NULL, NULL, NULL}
+ };
+
srna= RNA_def_struct(brna, "CloudsTexture", "Texture");
RNA_def_struct_ui_text(srna, "Clouds Texture", "Procedural noise texture.");
RNA_def_struct_sdna(srna, "Tex");
@@ -333,19 +346,222 @@ static void rna_def_texture_clouds(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "noisesize");
RNA_def_property_range(prop, 0.0001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
- RNA_def_property_ui_text(prop, "Noise Size", "");
+ RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
+
+ prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "noisedepth");
+ RNA_def_property_range(prop, 0, INT_MAX);
+ RNA_def_property_ui_range(prop, 0, 6, 0, 2);
+ RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation");
+
+
+ prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
+ 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");
+
+ prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "noisetype");
+ RNA_def_property_enum_items(prop, prop_noise_type);
+ RNA_def_property_ui_text(prop, "Noise Type", "");
+
+ prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "stype");
+ RNA_def_property_enum_items(prop, prop_clouds_stype);
+ RNA_def_property_ui_text(prop, "Color", "");
+
+ prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.001, 0.1);
+ RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
+ RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal.");
+
+}
+
+static void rna_def_texture_wood(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem prop_wood_stype[] = {
+ {TEX_BAND, "BANDS", "Bands", "Uses standard wood texture in bands"},
+ {TEX_RING, "RINGS", "Rings", "Uses wood texture in rings"},
+ {TEX_BANDNOISE, "BANDNOISE", "BandNoise", "Adds noise to standard wood"},
+ {TEX_RINGNOISE, "RINGNOISE", "RingNoise", "Adds noise to rings"},
+ {0, NULL, NULL, NULL}
+ };
+
+ static EnumPropertyItem prop_wood_noisebasis2[] = {
+ {TEX_SIN, "SIN", "Sin", "Uses a sine wave to produce bands"},
+ {TEX_SAW, "SAW", "Saw", "Uses a saw wave to produce bands"},
+ {TEX_TRI, "TRI", "Tri", "Uses a triangle wave to produce bands"},
+ {0, NULL, NULL, NULL}
+ };
+
+ srna= RNA_def_struct(brna, "WoodTexture", "Texture");
+ RNA_def_struct_ui_text(srna, "Wood Texture", "Procedural noise texture.");
+ RNA_def_struct_sdna(srna, "Tex");
+
+ prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "noisesize");
+ RNA_def_property_range(prop, 0.0001, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
+ RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
+
+ prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "turbul");
+ RNA_def_property_range(prop, 0.0001, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
+ RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types");
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
- RNA_def_property_ui_text(prop, "Noise Basis", "");
+ RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence");
+
+ prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "noisetype");
+ RNA_def_property_enum_items(prop, prop_noise_type);
+ RNA_def_property_ui_text(prop, "Noise Type", "");
+
+ prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "stype");
+ RNA_def_property_enum_items(prop, prop_wood_stype);
+ RNA_def_property_ui_text(prop, "Pattern", "");
+
+ prop= RNA_def_property(srna, "noisebasis2", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "noisebasis2");
+ RNA_def_property_enum_items(prop, prop_wood_noisebasis2);
+ RNA_def_property_ui_text(prop, "Noise Basis 2", "");
prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.001, 0.1);
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal.");
- /* XXX todo: noise depth, default/color, hard/soft */
+}
+
+static void rna_def_texture_marble(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "MarbleTexture", "Texture");
+ RNA_def_struct_ui_text(srna, "Marble Texture", "Procedural noise texture.");
+ RNA_def_struct_sdna(srna, "Tex");
+
+ static EnumPropertyItem prop_marble_stype[] = {
+ {TEX_SOFT, "SOFT", "Soft", "Uses soft marble"},
+ {TEX_SHARP, "SHARP", "Sharp", "Uses more clearly defined marble"},
+ {TEX_SHARPER, "SHARPER", "Sharper", "Uses very clearly defined marble"},
+ {0, NULL, NULL, NULL}
+ };
+
+ static EnumPropertyItem prop_marble_noisebasis2[] = {
+ {TEX_SIN, "SIN", "Sin", "Uses a sine wave to produce bands"},
+ {TEX_SAW, "SAW", "Saw", "Uses a saw wave to produce bands"},
+ {TEX_TRI, "TRI", "Tri", "Uses a triangle wave to produce bands"},
+ {0, NULL, NULL, NULL}
+ };
+
+ prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "noisesize");
+ RNA_def_property_range(prop, 0.0001, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
+ RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
+
+ prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "turbul");
+ RNA_def_property_range(prop, 0.0001, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
+ RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types");
+
+ prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "noisedepth");
+ RNA_def_property_range(prop, 0, INT_MAX);
+ RNA_def_property_ui_range(prop, 0, 6, 0, 2);
+ RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation");
+
+ prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "noisetype");
+ RNA_def_property_enum_items(prop, prop_noise_type);
+ RNA_def_property_ui_text(prop, "Noise Type", "");
+
+ prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "stype");
+ RNA_def_property_enum_items(prop, prop_marble_stype);
+ RNA_def_property_ui_text(prop, "Pattern", "");
+
+ prop= RNA_def_property(srna, "noisebasis2", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "noisebasis2");
+ RNA_def_property_enum_items(prop, prop_marble_noisebasis2);
+ RNA_def_property_ui_text(prop, "Noise Basis 2", "");
+
+ prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.001, 0.1);
+ RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
+ RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal.");
+
+}
+
+static void rna_def_texture_magic(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "MagicTexture", "Texture");
+ RNA_def_struct_ui_text(srna, "Magic Texture", "Procedural noise texture.");
+ RNA_def_struct_sdna(srna, "Tex");
+
+ prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "turbul");
+ RNA_def_property_range(prop, 0.0001, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
+ RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types");
+
+ prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "noisedepth");
+ RNA_def_property_range(prop, 0, INT_MAX);
+ RNA_def_property_ui_range(prop, 0, 6, 0, 2);
+ RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation");
+}
+
+static void rna_def_texture_stucci(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem prop_stucci_stype[] = {
+ {TEX_PLASTIC, "PLASTIC", "Plastic", "Uses standard stucci"},
+ {TEX_WALLIN, "WALL_IN", "Wall in", "Creates Dimples"},
+ {TEX_WALLOUT, "WALL_OUT", "Wall out", "Creates Ridges"},
+ {0, NULL, NULL, NULL}
+ };
+
+ srna= RNA_def_struct(brna, "StucciTexture", "Texture");
+ RNA_def_struct_ui_text(srna, "Stucci Texture", "Procedural noise texture.");
+ RNA_def_struct_sdna(srna, "Tex");
+
+ prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "turbul");
+ RNA_def_property_range(prop, 0.0001, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
+ RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types");
+
+ prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "noisesize");
+ RNA_def_property_range(prop, 0.0001, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2);
+ RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input");
+
+ prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "noisetype");
+ RNA_def_property_enum_items(prop, prop_noise_type);
+ RNA_def_property_ui_text(prop, "Noise Type", "");
+
+ prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "stype");
+ RNA_def_property_enum_items(prop, prop_stucci_stype);
+ RNA_def_property_ui_text(prop, "Pattern", "");
}
static void rna_def_texture(BlenderRNA *brna)
@@ -405,6 +621,10 @@ static void rna_def_texture(BlenderRNA *brna)
/* specific types */
rna_def_texture_clouds(brna);
+ rna_def_texture_wood(brna);
+ rna_def_texture_marble(brna);
+ rna_def_texture_magic(brna);
+ rna_def_texture_stucci(brna);
/* XXX add more types here .. */
/* ********** XXX these should be moved to the specific types *****************/
@@ -504,7 +724,7 @@ static void rna_def_texture(BlenderRNA *brna)
/* XXX: stype */
/* XXX: did this as an array, but needs better descriptions than "1 2 3 4"
- perhaps a new subtype could be added? */
+ perhaps a new subtype could be added? */
prop= RNA_def_property(srna, "crop_rectangle", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cropxmin");
RNA_def_property_array(prop, 4);