Geometry Nodes: Boolean attribute type

This adds a boolean attribute and custom data type, to be used in the
point separate node. It also adds it as supported data types in the
random attribute and attribute fill nodes.

There are more clever ways of storing a boolean attribute that make
more sense in certain situations-- sets, bitfields, and others, this
commit keeps it simple, saving those changes for when there is a proper
use case for them. In any case, we will still probably always want the
idea of a boolean attribute.

Differential Revision: https://developer.blender.org/D9818
This commit is contained in:
2020-12-16 12:33:13 -06:00
parent c06c5d617a
commit c484b54453
10 changed files with 77 additions and 7 deletions

View File

@@ -264,9 +264,11 @@ template<typename T> class TypedWriteAttribute {
}
};
using BooleanReadAttribute = TypedReadAttribute<bool>;
using FloatReadAttribute = TypedReadAttribute<float>;
using Float3ReadAttribute = TypedReadAttribute<float3>;
using Color4fReadAttribute = TypedReadAttribute<Color4f>;
using BooleanWriteAttribute = TypedWriteAttribute<bool>;
using FloatWriteAttribute = TypedWriteAttribute<float>;
using Float3WriteAttribute = TypedWriteAttribute<float3>;
using Color4fWriteAttribute = TypedWriteAttribute<Color4f>;