[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19627] branches/blender2.5/blender/source /blender/makesrna: 2.5 / RNA
Elia Sarti
vekoon at gmail.com
Thu Apr 9 22:33:39 CEST 2009
Revision: 19627
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19627
Author: vekoon
Date: 2009-04-09 22:33:39 +0200 (Thu, 09 Apr 2009)
Log Message:
-----------
2.5 / RNA
DNA_texture_types almost finished, missing still plugin type.
I noticed many texture share the same noise settings maybe this can be grouped into a common function.
Also testing out first commit.
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
branches/blender2.5/blender/source/blender/makesrna/intern/rna_texture.c
Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/RNA_access.h 2009-04-09 18:11:18 UTC (rev 19626)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_access.h 2009-04-09 20:33:39 UTC (rev 19627)
@@ -58,6 +58,7 @@
extern StructRNA RNA_BevelModifier;
extern StructRNA RNA_BezierCurvePoint;
extern StructRNA RNA_BlenderRNA;
+extern StructRNA RNA_BlendTexture;
extern StructRNA RNA_Bone;
extern StructRNA RNA_BooleanModifier;
extern StructRNA RNA_BooleanProperty;
@@ -68,6 +69,7 @@
extern StructRNA RNA_ClothCollisionSettings;
extern StructRNA RNA_ClothModifier;
extern StructRNA RNA_ClothSettings;
+extern StructRNA RNA_CloudsTexture;
extern StructRNA RNA_CollectionProperty;
extern StructRNA RNA_CollisionModifier;
extern StructRNA RNA_CollisionSensor;
@@ -88,6 +90,7 @@
extern StructRNA RNA_DecimateModifier;
extern StructRNA RNA_DelaySensor;
extern StructRNA RNA_DisplaceModifier;
+extern StructRNA RNA_DistortedNoiseTexture;
extern StructRNA RNA_DomainFluidSettings;
extern StructRNA RNA_Driver;
extern StructRNA RNA_EdgeSplitModifier;
@@ -95,6 +98,7 @@
extern StructRNA RNA_EnumProperty;
extern StructRNA RNA_EnumPropertyItem;
extern StructRNA RNA_EnvironmentMap;
+extern StructRNA RNA_EnvironmentMapTexture;
extern StructRNA RNA_ExplodeModifier;
extern StructRNA RNA_ExpressionController;
extern StructRNA RNA_FCurve;
@@ -121,6 +125,7 @@
extern StructRNA RNA_IDPropertyGroup;
extern StructRNA RNA_Image;
extern StructRNA RNA_ImageSequence;
+extern StructRNA RNA_ImageTexture;
extern StructRNA RNA_ImageUser;
extern StructRNA RNA_InflowFluidSettings;
extern StructRNA RNA_IntProperty;
@@ -137,7 +142,9 @@
extern StructRNA RNA_LatticePoint;
extern StructRNA RNA_Library;
extern StructRNA RNA_LocalLamp;
+extern StructRNA RNA_MagicTexture;
extern StructRNA RNA_Main;
+extern StructRNA RNA_MarbleTexture;
extern StructRNA RNA_MaskModifier;
extern StructRNA RNA_Material;
extern StructRNA RNA_MaterialHalo;
@@ -172,10 +179,12 @@
extern StructRNA RNA_MouseSensor;
extern StructRNA RNA_MovieSequence;
extern StructRNA RNA_MultiresModifier;
+extern StructRNA RNA_MusgraveTexture;
extern StructRNA RNA_NandController;
extern StructRNA RNA_NearSensor;
extern StructRNA RNA_Node;
extern StructRNA RNA_NodeTree;
+extern StructRNA RNA_NoiseTexture;
extern StructRNA RNA_NorController;
extern StructRNA RNA_Object;
extern StructRNA RNA_ObstacleFluidSettings;
@@ -193,6 +202,7 @@
extern StructRNA RNA_ParticleSystem;
extern StructRNA RNA_ParticleSystemModifier;
extern StructRNA RNA_PluginSequence;
+extern StructRNA RNA_PluginTexture;
extern StructRNA RNA_PointCache;
extern StructRNA RNA_PointerProperty;
extern StructRNA RNA_Pose;
@@ -238,6 +248,7 @@
extern StructRNA RNA_SpotLamp;
extern StructRNA RNA_StringProperty;
extern StructRNA RNA_Struct;
+extern StructRNA RNA_StucciTexture;
extern StructRNA RNA_SubsurfModifier;
extern StructRNA RNA_SunLamp;
extern StructRNA RNA_Text;
@@ -274,11 +285,13 @@
extern StructRNA RNA_UserSolidLight;
extern StructRNA RNA_VectorFont;
extern StructRNA RNA_VertexGroup;
+extern StructRNA RNA_VoronoiTexture;
extern StructRNA RNA_VPaint;
extern StructRNA RNA_VertexGroupElement;
extern StructRNA RNA_WaveModifier;
extern StructRNA RNA_WindowManager;
extern StructRNA RNA_WipeSequence;
+extern StructRNA RNA_WoodTexture;
extern StructRNA RNA_World;
extern StructRNA RNA_WorldAmbientOcclusion;
extern StructRNA RNA_WorldMistSettings;
Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_texture.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_texture.c 2009-04-09 18:11:18 UTC (rev 19626)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_texture.c 2009-04-09 20:33:39 UTC (rev 19627)
@@ -48,11 +48,11 @@
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;
@@ -65,7 +65,7 @@
case TEX_VORONOI:
return &RNA_VoronoiTexture;
case TEX_DISTNOISE:
- return &RNA_DistortedNoiseTexture; */
+ return &RNA_DistortedNoiseTexture;
default:
return &RNA_Texture;
}
@@ -242,17 +242,50 @@
RNA_def_property_ui_text(prop, "Normal Factor", "Amount texture affects normal values.");
}
+static void rna_def_filter_size_common(StructRNA *srna)
+{
+ PropertyRNA * prop;
+
+ /* XXX: not sure about the name of this, "Min" seems a bit off */
+ prop= RNA_def_property(srna, "use_filter", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_FILTER_MIN);
+ RNA_def_property_ui_text(prop, "Use Filter", "Use Filter Size as a minimal filter value in pixels");
+
+ prop= RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "filtersize");
+ RNA_def_property_range(prop, 0.1, 50.0);
+ RNA_def_property_ui_range(prop, 0.1, 50.0, 1, 0.2);
+ RNA_def_property_ui_text(prop, "Filter Size", "Multiplies the filter size used by MIP Map and Interpolation");
+}
+
+static void rna_def_environment_map_common(StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ static EnumPropertyItem prop_source_items[] = {
+ {ENV_STATIC, "STATIC", "Static", "Calculates environment map only once"},
+ {ENV_ANIM, "ANIMATED", "Animated", "Calculates environment map at each rendering"},
+ {ENV_LOAD, "LOADED", "Loaded", "Loads saved environment map from disk"},
+ {0, NULL, NULL, NULL}
+ };
+
+ prop= RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "stype");
+ RNA_def_property_enum_items(prop, prop_source_items);
+ RNA_def_property_ui_text(prop, "Source", "");
+
+ /* XXX: move this to specific types if needed */
+ prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "ima");
+ RNA_def_property_struct_type(prop, "Image");
+ RNA_def_property_ui_text(prop, "Image", "");
+}
+
static void rna_def_environment_map(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_source_items[] = {
- {ENV_STATIC, "STATIC", "Static", ""},
- {ENV_ANIM, "ANIMATED", "Animated", ""},
- {ENV_LOAD, "LOAD", "Load", ""},
- {0, NULL, NULL, NULL}};
-
static EnumPropertyItem prop_type_items[] = {
{ENV_CUBE, "CUBE", "Cube", "Use environment map with six cube sides."},
{ENV_PLANE, "PLANE", "Plane", "Only one side is rendered, with Z axis pointing in direction of image."},
@@ -261,22 +294,14 @@
srna= RNA_def_struct(brna, "EnvironmentMap", NULL);
RNA_def_struct_sdna(srna, "EnvMap");
RNA_def_struct_ui_text(srna, "EnvironmentMap", "Environment map created by the renderer and cached for subsequent renders.");
-
- prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
- RNA_def_property_pointer_sdna(prop, NULL, "ima");
- RNA_def_property_struct_type(prop, "Image");
- RNA_def_property_ui_text(prop, "Image", "");
+ rna_def_environment_map_common(srna);
+
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "");
- prop= RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "stype");
- RNA_def_property_enum_items(prop, prop_source_items);
- RNA_def_property_ui_text(prop, "Source", "");
-
prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clipsta");
RNA_def_property_range(prop, 0.01, FLT_MAX);
@@ -373,8 +398,7 @@
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.");
-
+ RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
}
static void rna_def_texture_wood(BlenderRNA *brna)
@@ -525,6 +549,36 @@
RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation");
}
+static void rna_def_texture_blend(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem prop_blend_progression[] = {
+ {TEX_LIN, "LINEAR", "Linear", "Creates a linear progression"},
+ {TEX_QUAD, "QUADRATIC", "Quadratic", "Creates a quadratic progression"},
+ {TEX_EASE, "EASING", "Easing", "Creates a progression easing from one step to the next"},
+ {TEX_DIAG, "DIAGONAL", "Diagonal", "Creates a diagonal progression"},
+ {TEX_SPHERE, "SPHERICAL", "Spherical", "Creates a spherical progression"},
+ {TEX_HALO, "QUADRATIC_SPHERE", "Quadratic sphere", "Creates a quadratic progression in the shape of a sphere"},
+ {TEX_RAD, "RADIAL", "Radial", "Creates a radial progression"},
+ {0, NULL, NULL, NULL}
+ };
+
+ srna= RNA_def_struct(brna, "BlendTexture", "Texture");
+ RNA_def_struct_ui_text(srna, "Blend Texture", "Procedural color blending texture.");
+ RNA_def_struct_sdna(srna, "Tex");
+
+ prop= RNA_def_property(srna, "progression", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "stype");
+ RNA_def_property_enum_items(prop, prop_blend_progression);
+ RNA_def_property_ui_text(prop, "Progression", "Sets the style of the color blending");
+
+ prop= RNA_def_property(srna, "flip_axis", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_FLIPBLEND);
+ RNA_def_property_ui_text(prop, "Flip Axis", "Flips the texture's X and Y axis");
+}
+
static void rna_def_texture_stucci(BlenderRNA *brna)
{
StructRNA *srna;
@@ -564,138 +618,280 @@
RNA_def_property_ui_text(prop, "Pattern", "");
}
-static void rna_def_texture(BlenderRNA *brna)
+static void rna_def_texture_noise(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem prop_type_items[] = {
- {0, "NONE", "None", ""},
- {TEX_CLOUDS, "CLOUDS", "Clouds", ""},
- {TEX_WOOD, "WOOD", "Wood", ""},
- {TEX_MARBLE, "MARBLE", "Marble", ""},
- {TEX_MAGIC, "MAGIC", "Magic", ""},
- {TEX_BLEND, "BLEND", "Blend", ""},
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list