Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt.c
| Show First 20 Lines • Show All 5,148 Lines • ▼ Show 20 Lines | static bool sculpt_any_smooth_mode(const Brush *brush, StrokeCache *cache, int stroke_mode) | ||||
| return ((stroke_mode == BRUSH_STROKE_SMOOTH) || (cache && cache->alt_smooth) || | return ((stroke_mode == BRUSH_STROKE_SMOOTH) || (cache && cache->alt_smooth) || | ||||
| (brush->sculpt_tool == SCULPT_TOOL_SMOOTH) || (brush->autosmooth_factor > 0) || | (brush->sculpt_tool == SCULPT_TOOL_SMOOTH) || (brush->autosmooth_factor > 0) || | ||||
| ((brush->sculpt_tool == SCULPT_TOOL_MASK) && (brush->mask_tool == BRUSH_MASK_SMOOTH))); | ((brush->sculpt_tool == SCULPT_TOOL_MASK) && (brush->mask_tool == BRUSH_MASK_SMOOTH))); | ||||
| } | } | ||||
| static void sculpt_stroke_modifiers_check(const bContext *C, Object *ob, const Brush *brush) | static void sculpt_stroke_modifiers_check(const bContext *C, Object *ob, const Brush *brush) | ||||
| { | { | ||||
| SculptSession *ss = ob->sculpt; | SculptSession *ss = ob->sculpt; | ||||
| View3D *v3d = CTX_wm_view3d(C); | |||||
| if (ss->kb || ss->modifiers_active) { | |||||
| Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); | |||||
| bool need_pmap = sculpt_any_smooth_mode(brush, ss->cache, 0); | bool need_pmap = sculpt_any_smooth_mode(brush, ss->cache, 0); | ||||
| if (ss->kb || ss->modifiers_active || (!BKE_sculptsession_use_pbvh_draw(ob, v3d) && need_pmap)) { | |||||
| Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); | |||||
| BKE_sculpt_update_object_for_edit(depsgraph, ob, need_pmap, false); | BKE_sculpt_update_object_for_edit(depsgraph, ob, need_pmap, false); | ||||
| } | } | ||||
| } | } | ||||
| static void sculpt_raycast_cb(PBVHNode *node, void *data_v, float *tmin) | static void sculpt_raycast_cb(PBVHNode *node, void *data_v, float *tmin) | ||||
| { | { | ||||
| if (BKE_pbvh_node_get_tmin(node) < *tmin) { | if (BKE_pbvh_node_get_tmin(node) < *tmin) { | ||||
| SculptRaycastData *srd = data_v; | SculptRaycastData *srd = data_v; | ||||
| ▲ Show 20 Lines • Show All 1,587 Lines • Show Last 20 Lines | |||||