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:
authorCharlie Jolly <charlie>2020-02-15 00:46:10 +0300
committerCharlie Jolly <mistajolly@gmail.com>2020-02-15 01:14:05 +0300
commit635ab9d1dded4d4975bd4486718fde19e8e901ca (patch)
tree63ae9c050c4749212c2beed2e0e46d9bc14b6c72 /source/blender/makesrna/intern/rna_nodetree.c
parent44d7706fe1868d66e8e724aebd9c3841cca67794 (diff)
Shading: Extend Vector Math Node with Sin, Cos, Tan and Wrap functions
This adds some extra functions recently added to the float Maths Node. Not all functions have been ported over in this patch. Also: + Tidy up menu + Change node color to match other vector nodes, this helps distinguish vector and float nodes in the tree + Move shared OSL functions to new header node_math.h Reviewed By: brecht Differential Revision: https://developer.blender.org/D6713
Diffstat (limited to 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 7efd01bbef9..bed00b588e8 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -164,9 +164,9 @@ const EnumPropertyItem rna_enum_node_math_items[] = {
{NODE_MATH_TRUNC, "TRUNC", 0, "Truncate", "trunc(A)"},
{0, "", ICON_NONE, NULL, NULL},
{NODE_MATH_FRACTION, "FRACT", 0, "Fraction", "The fraction part of A"},
- {NODE_MATH_MODULO, "MODULO", 0, "Modulo", "A mod B"},
- {NODE_MATH_SNAP, "SNAP", 0, "Snap", "Snap to increment, snap(A,B)"},
+ {NODE_MATH_MODULO, "MODULO", 0, "Modulo", "Modulo using fmod(A,B)"},
{NODE_MATH_WRAP, "WRAP", 0, "Wrap", "Wrap value to range, wrap(A,B)"},
+ {NODE_MATH_SNAP, "SNAP", 0, "Snap", "Snap to increment, snap(A,B)"},
{NODE_MATH_PINGPONG,
"PINGPONG",
0,
@@ -211,18 +211,23 @@ const EnumPropertyItem rna_enum_node_vec_math_items[] = {
{NODE_VECTOR_MATH_SCALE, "SCALE", 0, "Scale", "A multiplied by Scale"},
{NODE_VECTOR_MATH_NORMALIZE, "NORMALIZE", 0, "Normalize", "Normalize A"},
{0, "", ICON_NONE, NULL, NULL},
+ {NODE_VECTOR_MATH_ABSOLUTE, "ABSOLUTE", 0, "Absolute", "Entrywise absolute"},
+ {NODE_VECTOR_MATH_MINIMUM, "MINIMUM", 0, "Minimum", "Entrywise minimum"},
+ {NODE_VECTOR_MATH_MAXIMUM, "MAXIMUM", 0, "Maximum", "Entrywise maximum"},
+ {NODE_VECTOR_MATH_FLOOR, "FLOOR", 0, "Floor", "Entrywise floor"},
+ {NODE_VECTOR_MATH_CEIL, "CEIL", 0, "Ceil", "Entrywise ceil"},
+ {NODE_VECTOR_MATH_FRACTION, "FRACTION", 0, "Fraction", "The fraction part of A entrywise"},
+ {NODE_VECTOR_MATH_MODULO, "MODULO", 0, "Modulo", "Entrywise modulo using fmod(A,B)"},
+ {NODE_VECTOR_MATH_WRAP, "WRAP", 0, "Wrap", "Entrywise wrap(A,B)"},
{NODE_VECTOR_MATH_SNAP,
"SNAP",
0,
"Snap",
"Round A to the largest integer multiple of B less than or equal A"},
- {NODE_VECTOR_MATH_FLOOR, "FLOOR", 0, "Floor", "Entrywise floor"},
- {NODE_VECTOR_MATH_CEIL, "CEIL", 0, "Ceil", "Entrywise ceil"},
- {NODE_VECTOR_MATH_MODULO, "MODULO", 0, "Modulo", "Entrywise modulo"},
- {NODE_VECTOR_MATH_FRACTION, "FRACTION", 0, "Fraction", "The fraction part of A entrywise"},
- {NODE_VECTOR_MATH_ABSOLUTE, "ABSOLUTE", 0, "Absolute", "Entrywise absolute"},
- {NODE_VECTOR_MATH_MINIMUM, "MINIMUM", 0, "Minimum", "Entrywise minimum"},
- {NODE_VECTOR_MATH_MAXIMUM, "MAXIMUM", 0, "Maximum", "Entrywise maximum"},
+ {0, "", ICON_NONE, NULL, NULL},
+ {NODE_VECTOR_MATH_SINE, "SINE", 0, "Sine", "Entrywise sin(A)"},
+ {NODE_VECTOR_MATH_COSINE, "COSINE", 0, "Cosine", "Entrywise cos(A)"},
+ {NODE_VECTOR_MATH_TANGENT, "TANGENT", 0, "Tangent", "Entrywise tan(A)"},
{0, NULL, 0, NULL, NULL},
};