Last summer I noticed two behaviors in paint strokes that I believed were incorrect.
1. "airbrush" strokes painted on both timer and mouse events, so a slow airbrush could be "sped up" by moving the mouse.
Although it may be somewhat intuitive to have a the rate of the airbrush speed up if you "shake" the airbrush, I think that this is an unintended feature. If we want to add a "airbrush rate goes up if mouse moves" feature, I think it should be done deliberately.
2. "smooth stroke" would set its initial mouse position based on the first successful "hit" on the pbvh raycast instead of the first place the mouse is pressed.
This means that you could not properly start a smooth stroke that does not start out hitting the object surface, however paint strokes are purely 2D operations and should not depend on anything being hit in 3D, so the 2D stroke should be smooth and when the smoothed point finally arrives over the object's surface the stroke should start.
The modification of "test_start" to take the smoothed mouse coordinate also sets us up to be able to handle snapped coordinates later
--
I removed the "paint_stroke_space_enabled" external function because it clashed with the internal "is_space_enabled". The only use for this function was an XXX issue that needs to be addressed separately.
Another fix is to force drawing for every event, you can also see where the smooth cursor is while the mouse is not over the object. Before there was a general problem where the cursor would not be updated unless you caused a change that resulted in a need to redraw the object.
Finally, although last_mouse_position is not used by the sculpt_update_step function, it was being incorrectly updated to be the same as the current mouse position. This would have been a problem if something in sculpt actually used it. However, it looks like sculpt just duplicates some of the work of saving the last mouse coordinate.
As with the other Onion patches, this one anticipates some future changes. The "one_time_init" function and the "stroke predicates" as well as the "input_ok" variable are all artifacts from the future that were convenient to go ahead an integrate.
Description
Event Timeline
Jason, I tried applying the patch but it didnt apply cleanly, so I had to apply by hand.
A few things changed since you made the patch, can you confirm the patch I made on rev 51201 works as expected?
Updated patch so that wm_tag_redraw_overlay is moved to WM_api.h as WM_tag_redraw_overylay.
The justification is that gestures use this function in order to make sure they are refreshed, but since they are part of the window manager, this function wasn't needed outside of the wm. But now that paint_stroke is doing something similar to gestures (redrawing an overlay without forcing a redraw) it needs the same function. This function is needed because allows us to take advantage of the triple drawing mode, but using ED_tag_region_redraw(sp) would force a redraw.
With this I think the patch is ready to be applied.