reinterpret_cast<GreasePencilArmatureModifierData *>(md)
Any reason to switch here from IndexRange
to IndexMask
? Ignore my question when there is 🔕
I'm sorry, you're right! I bothered you with wrong comments!
It's confusing, because there are 3 falloff curves at play here:
brush->gpencil_settings->curve_sensitivity
, must be applied to the…
BKE_brush_curve_strength
is using brush->curve
for the falloff and that is not the curve you want. So here you have to use something like BKE_curvemapping_evaluateF(brush->gpencil_settings->curve_strength, 0.0f, distance / radius)
. But avoid division by zero, of course.
.premultiply_alpha()
returns the new color, it isn't changing the existing one. So this statement is doing nothing at the moment.
The brush falloff should only be used once (see below), when you calculate the influence.
Perhaps we should discuss this? I would say this has to take the multi frame editing settings into account. For that, you could use retrieve_editable_drawings_from_layer()
and apply execute_tint_on_drawing
to all drawings in the returned vector. Now only the current frame is affected.
For performance/efficiency, perhaps an idea to move this to TintOperation::on_stroke_begin
? That's possible, because the curve positions stay the same during the tint operation.