Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt.cc
| Show First 20 Lines • Show All 4,357 Lines • ▼ Show 20 Lines | static void sculpt_update_cache_invariants( | ||||
| Object *ob = CTX_data_active_object(C); | Object *ob = CTX_data_active_object(C); | ||||
| float mat[3][3]; | float mat[3][3]; | ||||
| float viewDir[3] = {0.0f, 0.0f, 1.0f}; | float viewDir[3] = {0.0f, 0.0f, 1.0f}; | ||||
| float max_scale; | float max_scale; | ||||
| int mode; | int mode; | ||||
| ss->cache = cache; | ss->cache = cache; | ||||
| cache->use_pixels = sculpt_needs_pbvh_pixels(&tool_settings->paint_mode, brush, ob); | |||||
| /* Set scaling adjustment. */ | /* Set scaling adjustment. */ | ||||
| max_scale = 0.0f; | max_scale = 0.0f; | ||||
| for (int i = 0; i < 3; i++) { | for (int i = 0; i < 3; i++) { | ||||
| max_scale = max_ff(max_scale, fabsf(ob->scale[i])); | max_scale = max_ff(max_scale, fabsf(ob->scale[i])); | ||||
| } | } | ||||
| cache->scale[0] = max_scale / ob->scale[0]; | cache->scale[0] = max_scale / ob->scale[0]; | ||||
| cache->scale[1] = max_scale / ob->scale[1]; | cache->scale[1] = max_scale / ob->scale[1]; | ||||
| cache->scale[2] = max_scale / ob->scale[2]; | cache->scale[2] = max_scale / ob->scale[2]; | ||||
| ▲ Show 20 Lines • Show All 1,197 Lines • ▼ Show 20 Lines | if (((op->flag & OP_IS_INVOKE) == 0) || (mval == nullptr) || over_mesh(C, op, mval)) { | ||||
| SculptCursorGeometryInfo sgi; | SculptCursorGeometryInfo sgi; | ||||
| SCULPT_cursor_geometry_info_update(C, &sgi, mval, false); | SCULPT_cursor_geometry_info_update(C, &sgi, mval, false); | ||||
| sculpt_stroke_undo_begin(C, op); | sculpt_stroke_undo_begin(C, op); | ||||
| SCULPT_stroke_id_next(ob); | SCULPT_stroke_id_next(ob); | ||||
| ss->cache->stroke_id = ss->stroke_id; | ss->cache->stroke_id = ss->stroke_id; | ||||
| /* Mark all pbvh nodes for update. */ | |||||
| if (ss->pbvh) { | |||||
| BKE_pbvh_node_automasking_mark_all(ss->pbvh); | |||||
| } | |||||
| return true; | return true; | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| static void sculpt_stroke_update_step(bContext *C, | static void sculpt_stroke_update_step(bContext *C, | ||||
| wmOperator * /*op*/, | wmOperator * /*op*/, | ||||
| PaintStroke *stroke, | PaintStroke *stroke, | ||||
| ▲ Show 20 Lines • Show All 557 Lines • ▼ Show 20 Lines | void SCULPT_automasking_node_begin(Object *ob, | ||||
| AutomaskingNodeData *automask_data, | AutomaskingNodeData *automask_data, | ||||
| PBVHNode *node) | PBVHNode *node) | ||||
| { | { | ||||
| if (!automasking) { | if (!automasking) { | ||||
| memset(automask_data, 0, sizeof(*automask_data)); | memset(automask_data, 0, sizeof(*automask_data)); | ||||
| return; | return; | ||||
| } | } | ||||
| automask_data->initializing = false; | |||||
| automask_data->node = node; | automask_data->node = node; | ||||
| automask_data->have_orig_data = automasking->settings.flags & | automask_data->have_orig_data = automasking->settings.flags & | ||||
| (BRUSH_AUTOMASKING_BRUSH_NORMAL | BRUSH_AUTOMASKING_VIEW_NORMAL); | (BRUSH_AUTOMASKING_BRUSH_NORMAL | BRUSH_AUTOMASKING_VIEW_NORMAL); | ||||
| if (automask_data->have_orig_data) { | if (automask_data->have_orig_data) { | ||||
| SCULPT_orig_vert_data_init(&automask_data->orig_data, ob, node, SCULPT_UNDO_COORDS); | SCULPT_orig_vert_data_init(&automask_data->orig_data, ob, node, SCULPT_UNDO_COORDS); | ||||
| } | } | ||||
| else { | else { | ||||
| ▲ Show 20 Lines • Show All 164 Lines • Show Last 20 Lines | |||||