30 valid_names.
add_new(defgroup->name);
41 int defgroup_index = 0;
43 if (!valid_names.
contains(defgroup->name)) {
59 bDeformGroup *defgroup = MEM_cnew<bDeformGroup>(__func__);
73 if (
mask.is_empty()) {
83 bDeformGroup *defgroup = MEM_cnew<bDeformGroup>(__func__);
91 mask.foreach_index([&](
const int point_i) {
116 bDeformGroup *defgroup = MEM_cnew<bDeformGroup>(__func__);
134 bool changed =
false;
203 const int num_elements = attributes.
domain_size(selection_domain);
209 switch (selection_domain) {
212 for (const int point_i : range) {
213 if (BKE_defvert_find_index(&dverts[point_i], def_nr)) {
214 selection.span[point_i] = select;
222 for (const int curve_i : range) {
223 const IndexRange points = points_by_curve[curve_i];
224 bool any_point_in_group = false;
225 for (const int point_i : points) {
226 if (BKE_defvert_find_index(&dverts[point_i], def_nr)) {
227 any_point_in_group = true;
231 if (any_point_in_group) {
232 selection.span[curve_i] = select;
Low-level operations for curves.
Low-level operations for grease pencil.
Utility functions for vertex groups in grease pencil objects.
#define BLI_assert_unreachable()
#define LISTBASE_FOREACH(type, var, list)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
constexpr IndexRange index_range() const
bool contains(const Key &key) const
void add_new(const Key &key)
constexpr bool is_empty() const
void copy(char *dst, int64_t dst_size) const
static VArray ForSingle(T value, const int64_t size)
GAttributeReader lookup_or_default(StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const void *default_value=nullptr) const
int domain_size(const AttrDomain domain) const
GSpanAttributeWriter lookup_or_add_for_write_span(StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
bke::CurvesGeometry & strokes_for_write()
ccl_device_inline float4 mask(const int4 mask, const float4 a)
ccl_device_inline float4 select(const int4 mask, const float4 a, const float4 b)
void clear_vertex_groups(GreasePencil &grease_pencil)
bool remove_from_vertex_group(Drawing &drawing, StringRef name, bool use_selection)
int ensure_vertex_group(const StringRef name, ListBase &vertex_group_names)
void select_from_group(Drawing &drawing, const AttrDomain selection_domain, StringRef name, bool select)
void assign_to_vertex_group(Drawing &drawing, StringRef name, float weight)
void assign_to_vertex_group_from_mask(CurvesGeometry &curves, const IndexMask &mask, StringRef name, float weight)
void validate_drawing_vertex_groups(GreasePencil &grease_pencil)
void remove_defgroup_index(MutableSpan< MDeformVert > dverts, int defgroup_index)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
float wrap(float value, float max, float min)
GPU_SHADER_INTERFACE_INFO(overlay_edit_curve_handle_iface, "vert").flat(Type pos vertex_in(1, Type::UINT, "data") .vertex_out(overlay_edit_curve_handle_iface) .geometry_layout(PrimitiveIn Frequency::GEOMETRY storage_buf(1, Qualifier::READ, "uint", "data[]", Frequency::GEOMETRY) .push_constant(Type Frequency::GEOMETRY selection[]
ListBase vertex_group_names