Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(732)

Issue 6202077: Smooth and Airbrush Fixes (Onion #3)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 12 months ago by Jason.A.Wilkins
Modified:
11 years, 7 months ago
Reviewers:
nicholasbishop, nicholasbishop
Base URL:
https://svn.blender.org/svnroot/bf-blender/trunk/blender/
Visibility:
Public.

Description

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.

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+236 lines, -128 lines) Patch
source/blender/editors/sculpt_paint/paint_intern.h View 2 chunks +1 line, -3 lines 0 comments Download
source/blender/editors/sculpt_paint/paint_stroke.c View 9 chunks +214 lines, -110 lines 1 comment Download
source/blender/editors/sculpt_paint/paint_vertex.c View 2 chunks +2 lines, -2 lines 0 comments Download
source/blender/editors/sculpt_paint/sculpt.c View 4 chunks +19 lines, -13 lines 0 comments Download

Messages

Total messages: 5
Jason.A.Wilkins
11 years, 12 months ago (2012-05-13 18:51:57 UTC) #1
Jason.A.Wilkins
http://codereview.appspot.com/6202077/diff/1/source/blender/editors/sculpt_paint/paint_stroke.c File source/blender/editors/sculpt_paint/paint_stroke.c (right): http://codereview.appspot.com/6202077/diff/1/source/blender/editors/sculpt_paint/paint_stroke.c#newcode448 source/blender/editors/sculpt_paint/paint_stroke.c:448: int first_event; /* true only during first call where ...
11 years, 12 months ago (2012-05-13 18:58:53 UTC) #2
Jason.A.Wilkins
11 years, 12 months ago (2012-05-13 19:01:54 UTC) #3
nicholasbishop
On 2012/05/13 19:01:54, Jason.A.Wilkins wrote: On 2012/05/13 19:01:54, Jason.A.Wilkins wrote: Hi Jason, Now that 2.64 ...
11 years, 7 months ago (2012-10-06 17:35:10 UTC) #4
jason.a.wilkins_gmail.com
11 years, 7 months ago (2012-10-07 01:08:11 UTC) #5
I was hoping that things would go better than almost every hunk
getting rejected >.<

I'll look at it again tomorrow when I have time to fix it.

On Sat, Oct 6, 2012 at 12:35 PM,  <NicholasBishop@gmail.com> wrote:
> On 2012/05/13 19:01:54, Jason.A.Wilkins wrote:
>
> On 2012/05/13 19:01:54, Jason.A.Wilkins wrote:
>
> Hi Jason,
>
> Now that 2.64 is out I'd like to review this patch. Could you post an
> updated version against latest trunk?
>
> Also, please add bf-codereview@blender.org to the list of reviewers.
> (http://wiki.blender.org/index.php/Dev:Doc/Tools/CodeReview)
>
> Thanks
>
> https://codereview.appspot.com/6202077/
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b