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:
authorOmarSquircleArt <omar.squircleart@gmail.com>2019-08-14 11:53:19 +0300
committerOmarSquircleArt <omar.squircleart@gmail.com>2019-08-14 11:53:19 +0300
commit7a7eadaf7f6be4008f49a83d76c5a6d5a6294f14 (patch)
tree8a064999db636d7c8c49f41156fd526193cee658 /source/blender/makesrna
parentc9acc5faad08422e07be59fc160a028a45b7440c (diff)
Shading: Add a clamp option to the Map Range node.
If the option is enabled, the output is clamped to the target range. The target range is [To Min, To Max]. The option is enabled by default. The clamp option is implemented in EEVEE by linking to the `clamp_value` GLSL function. And it is implemented in Cycles using a graph expand function. Reviewers: brecht, JacquesLucke Differential Revision: https://developer.blender.org/D5477
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index b28403bf28c..347be6b8a72 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -3834,6 +3834,16 @@ static void def_frame(StructRNA *srna)
RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, NULL);
}
+static void def_map_range(StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ prop = RNA_def_property(srna, "clamp", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "custom1", 1);
+ RNA_def_property_ui_text(prop, "Clamp", "Clamp the result to the target range [To Min, To Max]");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
+}
+
static void def_math(StructRNA *srna)
{
PropertyRNA *prop;