Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/paint_stroke.c
| Show First 20 Lines • Show All 991 Lines • ▼ Show 20 Lines | static void stroke_done(bContext *C, wmOperator *op) | ||||||||
| } | } | ||||||||
| paint_stroke_free(C, op); | paint_stroke_free(C, op); | ||||||||
| } | } | ||||||||
| /* Returns zero if the stroke dots should not be spaced, non-zero otherwise */ | /* Returns zero if the stroke dots should not be spaced, non-zero otherwise */ | ||||||||
| bool paint_space_stroke_enabled(Brush *br, ePaintMode mode) | bool paint_space_stroke_enabled(Brush *br, ePaintMode mode) | ||||||||
| { | { | ||||||||
| return (br->flag & BRUSH_SPACE) && paint_supports_dynamic_size(br, mode); | if ((br->flag & BRUSH_SPACE) == 0) { | ||||||||
| return false; | |||||||||
| } | |||||||||
| if (br->sculpt_tool == SCULPT_TOOL_CLOTH) { | |||||||||
| /* The Cloth Brush is a special case for stroke spacing. Even if it has grab modes which do | |||||||||
sergeyUnsubmitted Done Inline Actions
sergey: | |||||||||
| * not support dynamic size, stroke spacing needs to be enabled so it is possible to control | |||||||||
Done Inline Actions
sergey: | |||||||||
| * whether the simulation runs constantly or only when the brush moves when using the cloth | |||||||||
| * grab brushes. */ | |||||||||
| return true; | |||||||||
| } | |||||||||
| return paint_supports_dynamic_size(br, mode); | |||||||||
Done Inline ActionsI would do it as if ((br->flag & BRUSH_SPACE) == 0) {. Is kind of way more difficult to miss == 0 than ! when having a quick read. sergey: I would do it as `if ((br->flag & BRUSH_SPACE) == 0) {`. Is kind of way more difficult to miss… | |||||||||
| } | } | ||||||||
| static bool sculpt_is_grab_tool(Brush *br) | static bool sculpt_is_grab_tool(Brush *br) | ||||||||
| { | { | ||||||||
| if (br->sculpt_tool == SCULPT_TOOL_CLOTH && br->cloth_deform_type == BRUSH_CLOTH_DEFORM_GRAB) { | if (br->sculpt_tool == SCULPT_TOOL_CLOTH && br->cloth_deform_type == BRUSH_CLOTH_DEFORM_GRAB) { | ||||||||
| return true; | return true; | ||||||||
| } | } | ||||||||
| ▲ Show 20 Lines • Show All 596 Lines • Show Last 20 Lines | |||||||||