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:
authorLukas Stockner <lukas.stockner@freenet.de>2015-10-08 04:31:15 +0300
committerLukas Stockner <lukas.stockner@freenet.de>2015-10-08 16:45:45 +0300
commite3abcd6723afe24eabf2a332112e4c7a74cceae3 (patch)
tree45fcb529a4e88011f7a380620293ac8df98f9e3e /source/blender/makesrna/intern/rna_nodetree.c
parent3ab5075cf9f0d3ab466e97691bfe6d84c2dffb80 (diff)
Cycles: Add an interpolation option to environment textures
This commit exposes the interpolation parameter for environment textures (requested by DolpheenDream on IRC), just as it already is for image textures. Reviewers: sergey Differential Revision: https://developer.blender.org/D1544
Diffstat (limited to 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c62
1 files changed, 29 insertions, 33 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 9c93b8ee794..a51dffb8ca3 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -3548,17 +3548,29 @@ static void def_sh_tex_sky(StructRNA *srna)
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
}
+static const EnumPropertyItem sh_tex_prop_color_space_items[] = {
+ {SHD_COLORSPACE_COLOR, "COLOR", 0, "Color",
+ "Image contains color data, and will be converted to linear color for rendering"},
+ {SHD_COLORSPACE_NONE, "NONE", 0, "Non-Color Data",
+ "Image contains non-color data, for example a displacement or normal map, "
+ "and will not be converted"},
+ {0, NULL, 0, NULL, NULL}
+};
+
+static const EnumPropertyItem sh_tex_prop_interpolation_items[] = {
+ {SHD_INTERP_LINEAR, "Linear", 0, "Linear",
+ "Linear interpolation"},
+ {SHD_INTERP_CLOSEST, "Closest", 0, "Closest",
+ "No interpolation (sample closest texel)"},
+ {SHD_INTERP_CUBIC, "Cubic", 0, "Cubic",
+ "Cubic interpolation (CPU only)"},
+ {SHD_INTERP_SMART, "Smart", 0, "Smart",
+ "Bicubic when magnifying, else bilinear (OSL only)"},
+ {0, NULL, 0, NULL, NULL}
+};
+
static void def_sh_tex_environment(StructRNA *srna)
{
- static const EnumPropertyItem prop_color_space_items[] = {
- {SHD_COLORSPACE_COLOR, "COLOR", 0, "Color",
- "Image contains color data, and will be converted to linear color for rendering"},
- {SHD_COLORSPACE_NONE, "NONE", 0, "Non-Color Data",
- "Image contains non-color data, for example a displacement or normal map, "
- "and will not be converted"},
- {0, NULL, 0, NULL, NULL}
- };
-
static const EnumPropertyItem prop_projection_items[] = {
{SHD_PROJ_EQUIRECTANGULAR, "EQUIRECTANGULAR", 0, "Equirectangular",
"Equirectangular or latitude-longitude projection"},
@@ -3580,7 +3592,7 @@ static void def_sh_tex_environment(StructRNA *srna)
def_sh_tex(srna);
prop = RNA_def_property(srna, "color_space", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_items(prop, prop_color_space_items);
+ RNA_def_property_enum_items(prop, sh_tex_prop_color_space_items);
RNA_def_property_enum_default(prop, SHD_COLORSPACE_COLOR);
RNA_def_property_ui_text(prop, "Color Space", "Image file color space");
RNA_def_property_update(prop, 0, "rna_Node_update");
@@ -3590,6 +3602,11 @@ static void def_sh_tex_environment(StructRNA *srna)
RNA_def_property_ui_text(prop, "Projection", "Projection of the input image");
RNA_def_property_update(prop, 0, "rna_Node_update");
+ prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, sh_tex_prop_interpolation_items);
+ RNA_def_property_ui_text(prop, "Interpolation", "Texture interpolation");
+ RNA_def_property_update(prop, 0, "rna_Node_update");
+
prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "iuser");
@@ -3600,15 +3617,6 @@ static void def_sh_tex_environment(StructRNA *srna)
static void def_sh_tex_image(StructRNA *srna)
{
- static const EnumPropertyItem prop_color_space_items[] = {
- {SHD_COLORSPACE_COLOR, "COLOR", 0, "Color",
- "Image contains color data, and will be converted to linear color for rendering"},
- {SHD_COLORSPACE_NONE, "NONE", 0, "Non-Color Data",
- "Image contains non-color data, for example a displacement or normal map, "
- "and will not be converted"},
- {0, NULL, 0, NULL, NULL}
- };
-
static const EnumPropertyItem prop_projection_items[] = {
{SHD_PROJ_FLAT, "FLAT", 0, "Flat",
"Image is projected flat using the X and Y coordinates of the texture vector"},
@@ -3621,18 +3629,6 @@ static void def_sh_tex_image(StructRNA *srna)
{0, NULL, 0, NULL, NULL}
};
- static const EnumPropertyItem prop_interpolation_items[] = {
- {SHD_INTERP_LINEAR, "Linear", 0, "Linear",
- "Linear interpolation"},
- {SHD_INTERP_CLOSEST, "Closest", 0, "Closest",
- "No interpolation (sample closest texel)"},
- {SHD_INTERP_CUBIC, "Cubic", 0, "Cubic",
- "Cubic interpolation (CPU only)"},
- {SHD_INTERP_SMART, "Smart", 0, "Smart",
- "Bicubic when magnifying, else bilinear (OSL only)"},
- {0, NULL, 0, NULL, NULL}
- };
-
static EnumPropertyItem prop_image_extension[] = {
{SHD_IMAGE_EXTENSION_REPEAT, "REPEAT", 0, "Repeat", "Cause the image to repeat horizontally and vertically"},
{SHD_IMAGE_EXTENSION_EXTEND, "EXTEND", 0, "Extend", "Extend by repeating edge pixels of the image"},
@@ -3653,7 +3649,7 @@ static void def_sh_tex_image(StructRNA *srna)
def_sh_tex(srna);
prop = RNA_def_property(srna, "color_space", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_items(prop, prop_color_space_items);
+ RNA_def_property_enum_items(prop, sh_tex_prop_color_space_items);
RNA_def_property_enum_default(prop, SHD_COLORSPACE_COLOR);
RNA_def_property_ui_text(prop, "Color Space", "Image file color space");
RNA_def_property_update(prop, 0, "rna_Node_update");
@@ -3664,7 +3660,7 @@ static void def_sh_tex_image(StructRNA *srna)
RNA_def_property_update(prop, 0, "rna_Node_update");
prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_items(prop, prop_interpolation_items);
+ RNA_def_property_enum_items(prop, sh_tex_prop_interpolation_items);
RNA_def_property_ui_text(prop, "Interpolation", "Texture interpolation");
RNA_def_property_update(prop, 0, "rna_Node_update");