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:
authorJacques Lucke <jacques@blender.org>2020-07-16 17:33:20 +0300
committerJacques Lucke <jacques@blender.org>2020-07-16 17:43:42 +0300
commit1494ad20b9b31bb910b802d41bbc12a298d221e5 (patch)
tree93a788ef3fb82d99ff3d621d650b4b52a1574c69 /source/blender
parent76bf0508530fe05347269eac088a885a75967a30 (diff)
Particles: add implicit covnersions between Vector and Color
Not sure if these conversions are a good idea. However, we have them in Cycles, so they be available in the simulation node tree for consistency reasons.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/node_tree_multi_function.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/node_tree_multi_function.cc b/source/blender/blenkernel/intern/node_tree_multi_function.cc
index b4df44eec85..537ec056126 100644
--- a/source/blender/blenkernel/intern/node_tree_multi_function.cc
+++ b/source/blender/blenkernel/intern/node_tree_multi_function.cc
@@ -16,6 +16,7 @@
#include "BKE_node_tree_multi_function.hh"
+#include "BLI_color.hh"
#include "BLI_float3.hh"
namespace blender {
@@ -214,6 +215,10 @@ static ImplicitConversionsMap get_implicit_conversions()
conversions, "Vector Length", [](float3 a) { return a.length(); });
add_implicit_conversion<int32_t, float3>(
conversions, "int32 to float3", [](int32_t a) { return float3((float)a); });
+ add_implicit_conversion<float3, Color4f>(
+ conversions, "float3 to Color4f", [](float3 a) { return Color4f(a.x, a.y, a.z, 1.0f); });
+ add_implicit_conversion<Color4f, float3>(
+ conversions, "Color4f to float3", [](Color4f a) { return float3(a.r, a.g, a.b); });
return conversions;
}