Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 2,715 Lines • ▼ Show 20 Lines | static void calc_sculpt_normal( | ||||
| } | } | ||||
| } | } | ||||
| static void update_sculpt_normal(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode) | static void update_sculpt_normal(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode) | ||||
| { | { | ||||
| const Brush *brush = BKE_paint_brush(&sd->paint); | const Brush *brush = BKE_paint_brush(&sd->paint); | ||||
| StrokeCache *cache = ob->sculpt->cache; | StrokeCache *cache = ob->sculpt->cache; | ||||
| /* Grab brush does not update the sculpt normal during a stroke. */ | /* Grab brush does not update the sculpt normal during a stroke. */ | ||||
| const bool update_normal = !(brush->flag & BRUSH_ORIGINAL_NORMAL) && | const bool update_normal = | ||||
| !(brush->sculpt_tool == SCULPT_TOOL_GRAB) && | !(brush->flag & BRUSH_ORIGINAL_NORMAL) && !(brush->sculpt_tool == SCULPT_TOOL_GRAB) && | ||||
| !(brush->sculpt_tool == SCULPT_TOOL_THUMB && !(brush->flag & BRUSH_ANCHORED)) && | |||||
| !(brush->sculpt_tool == SCULPT_TOOL_ELASTIC_DEFORM) && | !(brush->sculpt_tool == SCULPT_TOOL_ELASTIC_DEFORM) && | ||||
| !(brush->sculpt_tool == SCULPT_TOOL_SNAKE_HOOK && | !(brush->sculpt_tool == SCULPT_TOOL_SNAKE_HOOK && cache->normal_weight > 0.0f); | ||||
| cache->normal_weight > 0.0f); | |||||
| if (cache->mirror_symmetry_pass == 0 && cache->radial_symmetry_pass == 0 && | if (cache->mirror_symmetry_pass == 0 && cache->radial_symmetry_pass == 0 && | ||||
| (SCULPT_stroke_is_first_brush_step_of_symmetry_pass(cache) || update_normal)) { | (SCULPT_stroke_is_first_brush_step_of_symmetry_pass(cache) || update_normal)) { | ||||
| calc_sculpt_normal(sd, ob, nodes, totnode, cache->sculpt_normal); | calc_sculpt_normal(sd, ob, nodes, totnode, cache->sculpt_normal); | ||||
| if (brush->falloff_shape == PAINT_FALLOFF_SHAPE_TUBE) { | if (brush->falloff_shape == PAINT_FALLOFF_SHAPE_TUBE) { | ||||
| project_plane_v3_v3v3(cache->sculpt_normal, cache->sculpt_normal, cache->view_normal); | project_plane_v3_v3v3(cache->sculpt_normal, cache->sculpt_normal, cache->view_normal); | ||||
| normalize_v3(cache->sculpt_normal); | normalize_v3(cache->sculpt_normal); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 6,961 Lines • Show Last 20 Lines | |||||