[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19409] branches/blender2.5/blender/source /blender/makesrna/intern/rna_texture.c: RNA: texture types Clouds/Wood/ Marble/Magic/Stucci wrapped,
Brecht Van Lommel
brecht at blender.org
Wed Mar 25 15:42:47 CET 2009
Revision: 19409
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19409
Author: blendix
Date: 2009-03-25 15:42:47 +0100 (Wed, 25 Mar 2009)
Log Message:
-----------
RNA: texture types Clouds/Wood/Marble/Magic/Stucci wrapped,
patch by Sven von Brand, thanks!
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/makesrna/intern/rna_texture.c
Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_texture.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_texture.c 2009-03-25 14:35:36 UTC (rev 19408)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_texture.c 2009-03-25 14:42:47 UTC (rev 19409)
@@ -42,17 +42,17 @@
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 @@
{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,21 +346,224 @@
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", "");
+ 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.");
- /* XXX todo: noise depth, default/color, hard/soft */
}
+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", "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.");
+
+}
+
+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");
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list