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:
Diffstat (limited to 'source/blender/makesrna/intern/rna_texture.c')
-rw-r--r--source/blender/makesrna/intern/rna_texture.c383
1 files changed, 120 insertions, 263 deletions
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index 7d6547e1abb..84fd217e64e 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -27,7 +27,6 @@
#include <stdlib.h>
#include "RNA_define.h"
-#include "RNA_types.h"
#include "rna_internal.h"
@@ -43,12 +42,11 @@
#include "BKE_node.h"
-static EnumPropertyItem texture_filter_items[] = {
+EnumPropertyItem texture_filter_items[] = {
{TXF_BOX, "BOX", 0, "Box", ""},
{TXF_EWA, "EWA", 0, "EWA", ""},
{TXF_FELINE, "FELINE", 0, "FELINE", ""},
{TXF_AREA, "AREA", 0, "Area", ""},
- {TXF_SAT, "SAT", 0, "SAT (4x mem)", ""},
{0, NULL, 0, NULL, NULL}};
EnumPropertyItem texture_type_items[] = {
@@ -77,6 +75,7 @@ EnumPropertyItem texture_type_items[] = {
#include "RNA_access.h"
#include "BKE_depsgraph.h"
+#include "BKE_image.h"
#include "BKE_texture.h"
#include "BKE_main.h"
@@ -133,6 +132,22 @@ static void rna_Texture_update(Main *bmain, Scene *scene, PointerRNA *ptr)
WM_main_add_notifier(NC_TEXTURE, tex);
}
+static void rna_Texture_voxeldata_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ Tex *tex= ptr->id.data;
+
+ tex->vd->ok = 0;
+ rna_Texture_update(bmain, scene, ptr);
+}
+
+static void rna_Texture_voxeldata_image_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ Tex *tex= ptr->id.data;
+
+ tex->ima->source = IMA_SRC_SEQUENCE;
+ rna_Texture_voxeldata_update(bmain, scene, ptr);
+}
+
/* Used for Texture Properties, used (also) for/in Nodes */
static void rna_Texture_nodes_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
@@ -145,18 +160,8 @@ static void rna_Texture_nodes_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Texture_type_set(PointerRNA *ptr, int value)
{
Tex *tex= (Tex*)ptr->data;
-
- if (value == TEX_VOXELDATA) {
- if (tex->vd == NULL) {
- tex->vd = BKE_add_voxeldata();
- }
- } else if (value == TEX_POINTDENSITY) {
- if (tex->pd == NULL) {
- tex->pd = BKE_add_pointdensity();
- }
- }
- tex->type = value;
+ tex_set_type(tex, value);
}
void rna_TextureSlot_update(Main *bmain, Scene *scene, PointerRNA *ptr)
@@ -321,26 +326,18 @@ static void rna_ImageTexture_mipmap_set(PointerRNA *ptr, int value)
if(value) tex->imaflag |= TEX_MIPMAP;
else tex->imaflag &= ~TEX_MIPMAP;
- if((tex->imaflag & TEX_MIPMAP) && tex->texfilter == TXF_SAT)
+ if(tex->imaflag & TEX_MIPMAP)
tex->texfilter = TXF_EWA;
}
-static EnumPropertyItem *rna_ImageTexture_filter_itemf(bContext *C, PointerRNA *ptr, int *free)
+static void rna_Envmap_source_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- Tex *tex= (Tex*)ptr->data;
- EnumPropertyItem *item= NULL;
- int totitem= 0;
-
- RNA_enum_items_add_value(&item, &totitem, texture_filter_items, TXF_BOX);
- RNA_enum_items_add_value(&item, &totitem, texture_filter_items, TXF_EWA);
- RNA_enum_items_add_value(&item, &totitem, texture_filter_items, TXF_FELINE);
- RNA_enum_items_add_value(&item, &totitem, texture_filter_items, TXF_AREA);
- if(tex->imaflag & TEX_MIPMAP)
- RNA_enum_items_add_value(&item, &totitem, texture_filter_items, TXF_SAT);
+ Tex *tex= ptr->id.data;
- *free= 1;
-
- return item;
+ if (tex->env)
+ BKE_free_envmapdata(tex->env);
+
+ rna_Texture_update(bmain, scene, ptr);
}
static PointerRNA rna_PointDensity_psys_get(PointerRNA *ptr)
@@ -366,156 +363,8 @@ static void rna_PointDensity_psys_set(PointerRNA *ptr, PointerRNA value)
pd->psys= BLI_findindex(&ob->particlesystem, value.data) + 1;
}
-static char *rna_ColorRamp_path(PointerRNA *ptr)
-{
- /* handle the cases where a single datablock may have 2 ramp types */
- if (ptr->id.data) {
- ID *id= ptr->id.data;
-
- switch (GS(id->name)) {
- case ID_MA: /* material has 2 cases - diffuse and specular */
- {
- Material *ma= (Material*)id;
-
- if (ptr->data == ma->ramp_col)
- return BLI_strdup("diffuse_ramp");
- else if (ptr->data == ma->ramp_spec)
- return BLI_strdup("specular_ramp");
- }
- break;
- }
- }
-
- /* everything else just uses 'color_ramp' */
- return BLI_strdup("color_ramp");
-}
-
-static char *rna_ColorRampElement_path(PointerRNA *ptr)
-{
- PointerRNA ramp_ptr;
- PropertyRNA *prop;
- char *path = NULL;
- int index;
-
- /* helper macro for use here to try and get the path
- * - this calls the standard code for getting a path to a texture...
- */
-#define COLRAMP_GETPATH \
- { \
- prop= RNA_struct_find_property(&ramp_ptr, "elements"); \
- if (prop) { \
- index= RNA_property_collection_lookup_index(&ramp_ptr, prop, ptr); \
- if (index >= 0) { \
- char *texture_path= rna_ColorRamp_path(&ramp_ptr); \
- path= BLI_sprintfN("%s.elements[%d]", texture_path, index); \
- MEM_freeN(texture_path); \
- } \
- } \
- }
-
- /* determine the path from the ID-block to the ramp */
- // FIXME: this is a very slow way to do it, but it will have to suffice...
- if (ptr->id.data) {
- ID *id= ptr->id.data;
-
- switch (GS(id->name)) {
- case ID_MA: /* 2 cases for material - diffuse and spec */
- {
- Material *ma= (Material *)id;
-
- /* try diffuse first */
- if (ma->ramp_col) {
- RNA_pointer_create(id, &RNA_ColorRamp, ma->ramp_col, &ramp_ptr);
- COLRAMP_GETPATH;
- }
- /* try specular if not diffuse */
- if (!path && ma->ramp_spec) {
- RNA_pointer_create(id, &RNA_ColorRamp, ma->ramp_spec, &ramp_ptr);
- COLRAMP_GETPATH;
- }
- }
- break;
-
- // TODO: node trees need special attention
- case ID_NT:
- {
- // FIXME: we'll probably have to loop over nodes until we find one that uses the color ramp
- }
- break;
-
- default: /* everything else should have a "color_ramp" property */
- {
- /* create pointer to the ID block, and try to resolve "color_ramp" pointer */
- RNA_id_pointer_create(id, &ramp_ptr);
- if (RNA_path_resolve(&ramp_ptr, "color_ramp", &ramp_ptr, &prop)) {
- COLRAMP_GETPATH;
- }
- }
- }
- }
-
- /* cleanup the macro we defined */
-#undef COLRAMP_GETPATH
-
- return path;
-}
-
#else
-static void rna_def_color_ramp_element(BlenderRNA *brna)
-{
- StructRNA *srna;
- PropertyRNA *prop;
-
- srna= RNA_def_struct(brna, "ColorRampElement", NULL);
- RNA_def_struct_sdna(srna, "CBData");
- RNA_def_struct_path_func(srna, "rna_ColorRampElement_path");
- RNA_def_struct_ui_text(srna, "Color Ramp Element", "Element defining a color at a position in the color ramp");
-
- prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
- RNA_def_property_float_sdna(prop, NULL, "r");
- RNA_def_property_array(prop, 4);
- RNA_def_property_ui_text(prop, "Color", "");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
-
- prop= RNA_def_property(srna, "position", PROP_FLOAT, PROP_COLOR);
- RNA_def_property_float_sdna(prop, NULL, "pos");
- RNA_def_property_range(prop, 0, 1);
- RNA_def_property_ui_text(prop, "Position", "");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
-}
-
-static void rna_def_color_ramp(BlenderRNA *brna)
-{
- StructRNA *srna;
- PropertyRNA *prop;
-
- static EnumPropertyItem prop_interpolation_items[] = {
- {1, "EASE", 0, "Ease", ""},
- {3, "CARDINAL", 0, "Cardinal", ""},
- {0, "LINEAR", 0, "Linear", ""},
- {2, "B_SPLINE", 0, "B-Spline", ""},
- {4, "CONSTANT", 0, "Constant", ""},
- {0, NULL, 0, NULL, NULL}};
-
- srna= RNA_def_struct(brna, "ColorRamp", NULL);
- RNA_def_struct_sdna(srna, "ColorBand");
- RNA_def_struct_path_func(srna, "rna_ColorRamp_path");
- RNA_def_struct_ui_text(srna, "Color Ramp", "Color ramp mapping a scalar value to a color");
-
- prop= RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_COLOR);
- RNA_def_property_collection_sdna(prop, NULL, "data", "tot");
- RNA_def_property_struct_type(prop, "ColorRampElement");
- RNA_def_property_ui_text(prop, "Elements", "");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
-
- prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "ipotype");
- RNA_def_property_enum_items(prop, prop_interpolation_items);
- RNA_def_property_ui_text(prop, "Interpolation", "");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
-}
-
static void rna_def_texmapping(BlenderRNA *brna)
{
StructRNA *srna;
@@ -580,8 +429,8 @@ static void rna_def_mtex(BlenderRNA *brna)
{MTEX_BLEND_SAT, "SATURATION", 0, "Saturation", ""},
{MTEX_BLEND_VAL, "VALUE", 0, "Value", ""},
{MTEX_BLEND_COLOR, "COLOR", 0, "Color", ""},
- {MTEX_SOFT_LIGHT, "SOFT LIGHT", 0, "Soft Light", ""},
- {MTEX_LIN_LIGHT , "LINEAR LIGHT", 0, "Linear Light", ""},
+ {MTEX_SOFT_LIGHT, "SOFT LIGHT", 0, "Soft Light", ""},
+ {MTEX_LIN_LIGHT , "LINEAR LIGHT", 0, "Linear Light", ""},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem output_node_items[] = {
@@ -661,9 +510,38 @@ static void rna_def_mtex(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
}
-static void rna_def_filter_size_common(StructRNA *srna)
+static void rna_def_filter_common(StructRNA *srna)
{
PropertyRNA *prop;
+
+ prop= RNA_def_property(srna, "mipmap", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_MIPMAP);
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_ImageTexture_mipmap_set");
+ RNA_def_property_ui_text(prop, "MIP Map", "Uses auto-generated MIP maps for the image");
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
+
+ prop= RNA_def_property(srna, "mipmap_gauss", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_GAUSS_MIP);
+ RNA_def_property_ui_text(prop, "MIP Map Gaussian filter", "Uses Gauss filter to sample down MIP maps");
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
+
+ prop= RNA_def_property(srna, "filter", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "texfilter");
+ RNA_def_property_enum_items(prop, texture_filter_items);
+ RNA_def_property_ui_text(prop, "Filter", "Texture filter to use for sampling image");
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
+
+ prop= RNA_def_property(srna, "filter_probes", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "afmax");
+ RNA_def_property_range(prop, 1, 256);
+ RNA_def_property_ui_text(prop, "Filter Probes", "Maximum number of samples. Higher gives less blur at distant/oblique angles, but is also slower");
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
+
+ prop= RNA_def_property(srna, "filter_eccentricity", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "afmax");
+ RNA_def_property_range(prop, 1, 256);
+ RNA_def_property_ui_text(prop, "Filter Eccentricity", "Maximum eccentricity. Higher gives less blur at distant/oblique angles, but is also slower");
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "filter_size_minimum", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_FILTER_MIN);
@@ -678,36 +556,18 @@ static void rna_def_filter_size_common(StructRNA *srna)
RNA_def_property_update(prop, 0, "rna_Texture_update");
}
-static void rna_def_environment_map_common(StructRNA *srna)
+static void rna_def_environment_map(BlenderRNA *brna)
{
+ StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem prop_source_items[] = {
{ENV_STATIC, "STATIC", 0, "Static", "Calculates environment map only once"},
{ENV_ANIM, "ANIMATED", 0, "Animated", "Calculates environment map at each rendering"},
- {ENV_LOAD, "LOADED", 0, "Loaded", "Loads saved environment map from disk"},
+ {ENV_LOAD, "IMAGE_FILE", 0, "Image File", "Loads a saved environment map image from disk"},
{0, NULL, 0, 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", "");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
-
- /* 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", "");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
-}
-
-static void rna_def_environment_map(BlenderRNA *brna)
-{
- StructRNA *srna;
- PropertyRNA *prop;
-
- static EnumPropertyItem prop_type_items[] = {
+
+ static EnumPropertyItem prop_mapping_items[] = {
{ENV_CUBE, "CUBE", 0, "Cube", "Use environment map with six cube sides"},
{ENV_PLANE, "PLANE", 0, "Plane", "Only one side is rendered, with Z axis pointing in direction of image"},
{0, NULL, 0, NULL, NULL}};
@@ -715,13 +575,23 @@ static void rna_def_environment_map(BlenderRNA *brna)
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, "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", "");
+ RNA_def_property_update(prop, 0, "rna_Envmap_source_update");
- rna_def_environment_map_common(srna);
-
- prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "viewpoint_object", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "object");
+ RNA_def_property_ui_text(prop, "Viewpoint Object", "Object to use as the environment map's viewpoint location");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
+
+ prop= RNA_def_property(srna, "mapping", 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", "");
+ RNA_def_property_enum_items(prop, prop_mapping_items);
+ RNA_def_property_ui_text(prop, "Mapping", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE);
@@ -740,20 +610,24 @@ static void rna_def_environment_map(BlenderRNA *brna)
prop= RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "viewscale");
- RNA_def_property_range(prop, 0.01, FLT_MAX);
- RNA_def_property_ui_range(prop, 0.5, 5, 100, 2);
+ RNA_def_property_range(prop, 0.1, 5.0);
+ RNA_def_property_ui_range(prop, 0.5, 1.5, 1, 2);
RNA_def_property_ui_text(prop, "Zoom", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- /* XXX: EnvMap.notlay */
+ prop= RNA_def_property(srna, "ignore_layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ RNA_def_property_boolean_sdna(prop, NULL, "notlay", 1);
+ RNA_def_property_array(prop, 20);
+ RNA_def_property_ui_text(prop, "Ignore Layers", "Hide objects on these layers when generating the Environment Map");
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "cuberes");
RNA_def_property_range(prop, 50, 4096);
RNA_def_property_ui_text(prop, "Resolution", "Pixel resolution of the rendered environment map");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
RNA_def_property_range(prop, 0, 5);
RNA_def_property_ui_text(prop, "Depth", "Number of times a map will be rendered recursively (mirror effects.)");
RNA_def_property_update(prop, 0, "rna_Texture_update");
@@ -1116,17 +990,6 @@ static void rna_def_texture_image(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Image Texture", "");
RNA_def_struct_sdna(srna, "Tex");
- prop= RNA_def_property(srna, "mipmap", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_MIPMAP);
- RNA_def_property_boolean_funcs(prop, NULL, "rna_ImageTexture_mipmap_set");
- RNA_def_property_ui_text(prop, "MIP Map", "Uses auto-generated MIP maps for the image");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
-
- prop= RNA_def_property(srna, "mipmap_gauss", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_GAUSS_MIP);
- RNA_def_property_ui_text(prop, "MIP Map Gaussian filter", "Uses Gauss filter to sample down MIP maps");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
-
prop= RNA_def_property(srna, "interpolation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_INTERPOL);
RNA_def_property_ui_text(prop, "Interpolation", "Interpolates pixels using Area filter");
@@ -1153,7 +1016,7 @@ static void rna_def_texture_image(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Invert Alpha", "Inverts all the alpha values in the image");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- rna_def_filter_size_common(srna);
+ rna_def_filter_common(srna);
prop= RNA_def_property(srna, "extension", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "extend");
@@ -1254,26 +1117,6 @@ static void rna_def_texture_image(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed");
RNA_def_property_update(prop, 0, "rna_Texture_update");
- /* filtering */
- prop= RNA_def_property(srna, "filter", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "texfilter");
- RNA_def_property_enum_items(prop, texture_filter_items);
- RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_ImageTexture_filter_itemf");
- RNA_def_property_ui_text(prop, "Filter", "Texture filter to use for sampling image");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
-
- prop= RNA_def_property(srna, "filter_probes", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "afmax");
- RNA_def_property_range(prop, 1, 256);
- RNA_def_property_ui_text(prop, "Filter Probes", "Maximum number of samples. Higher gives less blur at distant/oblique angles, but is also slower");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
-
- prop= RNA_def_property(srna, "filter_eccentricity", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "afmax");
- RNA_def_property_range(prop, 1, 256);
- RNA_def_property_ui_text(prop, "Filter Eccentricity", "Maximum eccentricity. Higher gives less blur at distant/oblique angles, but is also slower");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
-
/* Normal Map */
prop= RNA_def_property(srna, "normal_map", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_NORMALMAP);
@@ -1310,20 +1153,25 @@ static void rna_def_texture_environment_map(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Environment Map", "Environment map texture");
RNA_def_struct_sdna(srna, "Tex");
- rna_def_environment_map_common(srna);
-
+ 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_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Image", "Source image file to read the environment map from");
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
+
prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "iuser");
RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed");
RNA_def_property_update(prop, 0, "rna_Texture_update");
+ rna_def_filter_common(srna);
+
prop= RNA_def_property(srna, "environment_map", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "env");
RNA_def_property_struct_type(prop, "EnvironmentMap");
RNA_def_property_ui_text(prop, "Environment Map", "Gets the environment map associated with this texture");
RNA_def_property_update(prop, 0, "rna_Texture_update");
-
- rna_def_filter_size_common(srna);
}
static void rna_def_texture_musgrave(BlenderRNA *brna)
@@ -1358,7 +1206,7 @@ static void rna_def_texture_musgrave(BlenderRNA *brna)
prop= RNA_def_property(srna, "lacunarity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mg_lacunarity");
RNA_def_property_range(prop, 0, 6);
- RNA_def_property_ui_text(prop, "Lacunarity", "Gap between succesive frequencies");
+ RNA_def_property_ui_text(prop, "Lacunarity", "Gap between successive frequencies");
RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "octaves", PROP_FLOAT, PROP_NONE);
@@ -1642,7 +1490,7 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
prop= RNA_def_property(srna, "speed_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "speed_scale");
RNA_def_property_range(prop, 0.001, 100.0);
- RNA_def_property_ui_text(prop, "Scale", "Multipler to bring particle speed within an acceptable range");
+ RNA_def_property_ui_text(prop, "Scale", "Multiplier to bring particle speed within an acceptable range");
RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL);
@@ -1684,7 +1532,7 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noise_basis");
RNA_def_property_enum_items(prop, prop_noise_basis_items);
- RNA_def_property_ui_text(prop, "Noise Basis", "Noise formula used for tubulence");
+ RNA_def_property_ui_text(prop, "Noise Basis", "Noise formula used for turbulence");
RNA_def_property_update(prop, 0, "rna_Texture_update");
@@ -1746,7 +1594,7 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "smoked_type");
RNA_def_property_enum_items(prop, smoked_type_items);
RNA_def_property_ui_text(prop, "Source", "Simulation value to be used as a texture");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
prop= RNA_def_property(srna, "extension", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "extend");
@@ -1764,34 +1612,34 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "file_format");
RNA_def_property_enum_items(prop, file_format_items);
RNA_def_property_ui_text(prop, "File Format", "Format of the source data set to render ");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
prop= RNA_def_property(srna, "source_path", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "source_path");
RNA_def_property_ui_text(prop, "Source Path", "The external source data file to use");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resol");
RNA_def_property_ui_text(prop, "Resolution", "Resolution of the voxel grid");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
prop= RNA_def_property(srna, "still", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_VD_STILL);
RNA_def_property_ui_text(prop, "Still Frame Only", "Always render a still frame from the voxel data sequence");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
prop= RNA_def_property(srna, "still_frame_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "still_frame");
RNA_def_property_range(prop, -MAXFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Still Frame Number", "The frame number to always use");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
prop= RNA_def_property(srna, "domain_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_ui_text(prop, "Domain Object", "Object used as the smoke simulation domain");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
srna= RNA_def_struct(brna, "VoxelDataTexture", "Texture");
@@ -1809,12 +1657,12 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Image");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Image", "");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_image_update");
prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "iuser");
RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
}
static void rna_def_texture(BlenderRNA *brna)
@@ -1858,6 +1706,11 @@ static void rna_def_texture(BlenderRNA *brna)
RNA_def_property_range(prop, 0.01, 5);
RNA_def_property_ui_text(prop, "Contrast", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
+
+ prop= RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0, 2);
+ RNA_def_property_ui_text(prop, "Saturation", "");
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
/* RGB Factor */
prop= RNA_def_property(srna, "factor_red", PROP_FLOAT, PROP_NONE);
@@ -1878,6 +1731,12 @@ static void rna_def_texture(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Factor Blue", "");
RNA_def_property_update(prop, 0, "rna_Texture_update");
+ /* Alpha for preview render */
+ prop= RNA_def_property(srna, "use_preview_alpha", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_PRV_ALPHA);
+ RNA_def_property_ui_text(prop, "Show Alpha", "Show Alpha in Preview Render");
+ RNA_def_property_update(prop, 0, "rna_Texture_update");
+
/* nodetree */
prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1);
@@ -1916,8 +1775,6 @@ void RNA_def_texture(BlenderRNA *brna)
rna_def_texture(brna);
rna_def_mtex(brna);
rna_def_environment_map(brna);
- rna_def_color_ramp(brna);
- rna_def_color_ramp_element(brna);
rna_def_texmapping(brna);
}