From 396d0b5cd0bcd9dd3dfa8d9006ee9f6f91c7196d Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Sun, 2 Aug 2020 22:04:24 +0200 Subject: Particles: new Age Reached Event, Kill Particle and Random Float node The hardcoded age limit is now gone. The behavior can be implemented with an Age Reached Event and Kill Particle node. Other utility nodes to handle age limits of particles can be added later. Adding an Age Limit attribute to particles on birth will be useful for some effects, e.g. when you want to control the color or size of a particle over its life time. The Random Float node takes a seed currently. Different nodes will produce different values even with the same seed. However, the same node will generate the same random number for the same seed every time. The "Hash" of a particle can be used as seed. Later, we'd want to have more modes in the node to make it more user friendly. Modes could be: Per Particle, Per Time, Per Particle Per Time, Per Node Instance, ... Also a Random Vector node will be useful, as it currently has to be build using three Random Float nodes. --- source/blender/functions/intern/attributes_ref.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/functions') diff --git a/source/blender/functions/intern/attributes_ref.cc b/source/blender/functions/intern/attributes_ref.cc index 4686e217911..8f7f41be079 100644 --- a/source/blender/functions/intern/attributes_ref.cc +++ b/source/blender/functions/intern/attributes_ref.cc @@ -27,6 +27,10 @@ AttributesInfoBuilder::~AttributesInfoBuilder() bool AttributesInfoBuilder::add(StringRef name, const CPPType &type, const void *default_value) { + if (name.size() == 0) { + std::cout << "Warning: Tried to add an attribute with empty name.\n"; + return false; + } if (names_.add_as(name)) { types_.append(&type); -- cgit v1.2.3