40 for (
const int frame_group : drawings_per_frame.
index_range()) {
54 std::atomic<bool> changed =
false;
57 Array<DrawingWeightData> &drawing_weights = this->drawing_weight_data[frame_group];
61 threading::parallel_for_each(drawing_weights, [&](DrawingWeightData &drawing_weight) {
62 for (const int point_index : drawing_weight.point_positions.index_range()) {
64 if (drawing_weight.point_is_read_only[point_index]) {
69 const float2 &co = drawing_weight.point_positions[point_index];
70 this->add_point_under_brush_to_brush_buffer(co, drawing_weight, point_index);
89 changed.store(
true, std::memory_order_relaxed);
107 return std::make_unique<DrawWeightPaintOperation>(stroke_mode);
Scene * CTX_data_scene(const bContext *C)
void DEG_id_tag_update(ID *id, unsigned int flags)
IndexRange index_range() const
DrawWeightPaintOperation(const BrushStrokeMode &stroke_mode)
void on_stroke_begin(const bContext &C, const InputSample &start_sample) override
void on_stroke_done(const bContext &) override
void on_stroke_extended(const bContext &C, const InputSample &extension_sample) override
void ensure_active_vertex_group_in_object()
void get_mouse_input_sample(const InputSample &input_sample, const float brush_widen_factor=1.0f)
BrushStrokeMode stroke_mode
Array< Array< DrawingWeightData > > drawing_weight_data
void get_brush_settings(const bContext &C, const InputSample &start_sample)
void get_locked_and_bone_deformed_vertex_groups()
GreasePencil * grease_pencil
void init_weight_data_for_drawings(const bContext &C, const Span< ed::greasepencil::MutableDrawingInfo > &drawings, const int frame_group)
void apply_weight_to_point(const BrushPoint &point, const float target_weight, DrawingWeightData &drawing_weight)
void normalize_vertex_weights(MDeformVert &dvert, const int active_vertex_group, const Span< bool > vertex_group_is_locked, const Span< bool > vertex_group_is_bone_deformed)
Array< Vector< MutableDrawingInfo > > retrieve_editable_drawings_grouped_per_frame(const Scene &scene, GreasePencil &grease_pencil)
std::unique_ptr< GreasePencilStrokeOperation > new_weight_paint_draw_operation(const BrushStrokeMode &stroke_mode)
void parallel_for_each(Range &&range, const Function &function)
Vector< bool > locked_vgroups
Vector< BrushPoint > points_in_brush
MutableSpan< MDeformVert > deform_verts
Vector< bool > bone_deformed_vgroups
void WM_event_add_notifier(const bContext *C, uint type, void *reference)