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

Issue 5671088: Limit brushes to a single paint tool

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 9 months ago by nicholasbishop
Modified:
12 years, 9 months ago
Reviewers:
bf-codereview, jason.a.wilkins
Base URL:
https://svn.blender.org/svnroot/bf-blender/trunk/blender/
Visibility:
Public.

Description

This patch limits each brush to a single paint tool. It converts Brush.ob_mode to Brush.paint_mode, where paint mode can be: BRUSH_MODE_NONE, BRUSH_MODE_SCULPT, BRUSH_MODE_VERTEX_WEIGHT_PAINT, BRUSH_MODE_TEXTURE_PAINT, or BRUSH_MODE_UV_SCULPT. During file read, brushes with more than one ob_mode are split in to multiple brushes. The purpose of this is to simplify brush code. You can now tell which brush tool is in use with just the brush pointer, rather than having to check the current object mode. This would be nice for RNA in particular. This is a bit rough, wanted to see if there's interest in doing this first (see mail to bf-committers.)

Patch Set 1 #

Patch Set 2 : Revert to brush to using ob_mode mode field and flags #

Unified diffs Side-by-side diffs Delta from patch set Stats (+163 lines, -164 lines) Patch
release/scripts/startup/bl_ui/space_view3d_toolbar.py View 1 1 chunk +1 line, -4 lines 0 comments Download
source/blender/blenkernel/BKE_brush.h View 1 1 chunk +1 line, -1 line 0 comments Download
source/blender/blenkernel/intern/brush.c View 1 4 chunks +11 lines, -7 lines 0 comments Download
source/blender/blenkernel/intern/paint.c View 1 1 chunk +0 lines, -6 lines 0 comments Download
source/blender/blenloader/intern/readfile.c View 1 1 chunk +54 lines, -0 lines 0 comments Download
source/blender/editors/sculpt_paint/paint_ops.c View 1 6 chunks +86 lines, -125 lines 0 comments Download
source/blender/makesdna/DNA_brush_types.h View 1 1 chunk +1 line, -1 line 0 comments Download
source/blender/makesrna/intern/rna_brush.c View 1 1 chunk +0 lines, -17 lines 0 comments Download
source/blender/makesrna/intern/rna_main_api.c View 1 3 chunks +6 lines, -2 lines 0 comments Download
source/blender/makesrna/intern/rna_sculpt_paint.c View 1 2 chunks +2 lines, -1 line 0 comments Download
source/blender/makesrna/intern/rna_space.c View 1 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 4
nicholasbishop
12 years, 9 months ago (2012-02-17 21:50:49 UTC) #1
Jason.A.Wilkins
I did something similar in soc-2011-onion except I did not create a new C enumeration. ...
12 years, 9 months ago (2012-02-18 11:16:52 UTC) #2
nicholasbishop
Revert to brush to using ob_mode mode field and flags
12 years, 9 months ago (2012-02-19 17:47:41 UTC) #3
nicholasbishop
12 years, 9 months ago (2012-02-19 17:53:53 UTC) #4
Fair point, uploaded a new patch that removes the new field and goes back to the
object mode enum.

The point of using a new C enumeration was really just to make clear that it's
choosing between brush tools (Brush.sculpt_tool, Brush.vertextool,
Brush.imagepaint_tool), but that's a bit weak anyway since UV Sculpt doesn't
have a brush tool field.

A couple other changes as well: removed the brush_paint_mode from struct Paint,
was really only used in one place and easily replaced.

Also changed paint_init to not require the brush type by not creating a default
brush if none exists. This situation would only normally come up when creating a
new Scene anyways, at which point the normal brush selection UI is probably more
useful than creating a new generic brush from scratch.
Sign in to reply to this message.

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