Cleanup: Remove unused arguments to sculpt update function
This commit is contained in:
parent
1020a7f6ee
commit
b74862127d
|
@ -839,8 +839,7 @@ void BKE_sculpt_color_layer_create_if_needed(Object *object);
|
|||
/**
|
||||
* \warning Expects a fully evaluated depsgraph.
|
||||
*/
|
||||
void BKE_sculpt_update_object_for_edit(
|
||||
Depsgraph *depsgraph, Object *ob_orig, bool need_pmap, bool need_mask, bool is_paint_tool);
|
||||
void BKE_sculpt_update_object_for_edit(Depsgraph *depsgraph, Object *ob_orig, bool is_paint_tool);
|
||||
void BKE_sculpt_update_object_before_eval(Object *ob_eval);
|
||||
void BKE_sculpt_update_object_after_eval(Depsgraph *depsgraph, Object *ob_eval);
|
||||
|
||||
|
|
|
@ -1654,8 +1654,10 @@ static void sculpt_update_persistent_base(Object *ob)
|
|||
ob, ATTR_DOMAIN_POINT, CD_PROP_FLOAT, SCULPT_ATTRIBUTE_NAME(persistent_disp));
|
||||
}
|
||||
|
||||
static void sculpt_update_object(
|
||||
Depsgraph *depsgraph, Object *ob, Object *ob_eval, bool /*need_pmap*/, bool is_paint_tool)
|
||||
static void sculpt_update_object(Depsgraph *depsgraph,
|
||||
Object *ob,
|
||||
Object *ob_eval,
|
||||
bool is_paint_tool)
|
||||
{
|
||||
Scene *scene = DEG_get_input_scene(depsgraph);
|
||||
Sculpt *sd = scene->toolsettings->sculpt;
|
||||
|
@ -1898,7 +1900,7 @@ void BKE_sculpt_update_object_after_eval(Depsgraph *depsgraph, Object *ob_eval)
|
|||
* other data when modifiers change the mesh. */
|
||||
Object *ob_orig = DEG_get_original_object(ob_eval);
|
||||
|
||||
sculpt_update_object(depsgraph, ob_orig, ob_eval, false, false);
|
||||
sculpt_update_object(depsgraph, ob_orig, ob_eval, false);
|
||||
}
|
||||
|
||||
void BKE_sculpt_color_layer_create_if_needed(Object *object)
|
||||
|
@ -1929,14 +1931,13 @@ void BKE_sculpt_color_layer_create_if_needed(Object *object)
|
|||
}
|
||||
}
|
||||
|
||||
void BKE_sculpt_update_object_for_edit(
|
||||
Depsgraph *depsgraph, Object *ob_orig, bool need_pmap, bool /*need_mask*/, bool is_paint_tool)
|
||||
void BKE_sculpt_update_object_for_edit(Depsgraph *depsgraph, Object *ob_orig, bool is_paint_tool)
|
||||
{
|
||||
BLI_assert(ob_orig == DEG_get_original_object(ob_orig));
|
||||
|
||||
Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob_orig);
|
||||
|
||||
sculpt_update_object(depsgraph, ob_orig, ob_eval, need_pmap, is_paint_tool);
|
||||
sculpt_update_object(depsgraph, ob_orig, ob_eval, is_paint_tool);
|
||||
}
|
||||
|
||||
int *BKE_sculpt_face_sets_ensure(Object *ob)
|
||||
|
|
|
@ -1733,7 +1733,7 @@ static void paint_cursor_preview_boundary_data_update(PaintCursorContext *pconte
|
|||
|
||||
/* Needed for updating the necessary SculptSession data in order to initialize the
|
||||
* boundary data for the preview. */
|
||||
BKE_sculpt_update_object_for_edit(pcontext->depsgraph, pcontext->vc.obact, true, false, false);
|
||||
BKE_sculpt_update_object_for_edit(pcontext->depsgraph, pcontext->vc.obact, false);
|
||||
|
||||
if (ss->boundary_preview) {
|
||||
SCULPT_boundary_data_free(ss->boundary_preview);
|
||||
|
@ -1804,8 +1804,7 @@ static void paint_cursor_draw_3d_view_brush_cursor_inactive(PaintCursorContext *
|
|||
* nullptr before drawing it. */
|
||||
SculptSession *ss = pcontext->ss;
|
||||
if (update_previews || !ss->pose_ik_chain_preview) {
|
||||
BKE_sculpt_update_object_for_edit(
|
||||
pcontext->depsgraph, pcontext->vc.obact, true, false, false);
|
||||
BKE_sculpt_update_object_for_edit(pcontext->depsgraph, pcontext->vc.obact, false);
|
||||
|
||||
/* Free the previous pose brush preview. */
|
||||
if (ss->pose_ik_chain_preview) {
|
||||
|
|
|
@ -104,7 +104,7 @@ static int mask_flood_fill_exec(bContext *C, wmOperator *op)
|
|||
MultiresModifierData *mmd = BKE_sculpt_multires_active(scene, ob);
|
||||
BKE_sculpt_mask_layers_ensure(depsgraph, CTX_data_main(C), ob, mmd);
|
||||
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false, true, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
PBVH *pbvh = ob->sculpt->pbvh;
|
||||
const bool multires = (BKE_pbvh_type(pbvh) == PBVH_GRIDS);
|
||||
|
||||
|
@ -690,7 +690,7 @@ struct SculptGestureFaceSetOperation {
|
|||
static void sculpt_gesture_face_set_begin(bContext *C, SculptGestureContext *sgcontext)
|
||||
{
|
||||
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, sgcontext->vc.obact, true, false, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, sgcontext->vc.obact, false);
|
||||
}
|
||||
|
||||
static void face_set_gesture_apply_task(SculptGestureContext *sgcontext, PBVHNode *node)
|
||||
|
@ -804,7 +804,7 @@ struct SculptGestureMaskOperation {
|
|||
static void sculpt_gesture_mask_begin(bContext *C, SculptGestureContext *sgcontext)
|
||||
{
|
||||
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, sgcontext->vc.obact, false, true, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, sgcontext->vc.obact, false);
|
||||
}
|
||||
|
||||
static void mask_gesture_apply_task(SculptGestureContext *sgcontext,
|
||||
|
@ -1415,7 +1415,7 @@ static void sculpt_gesture_trim_begin(bContext *C, SculptGestureContext *sgconte
|
|||
sculpt_gesture_trim_calculate_depth(sgcontext);
|
||||
sculpt_gesture_trim_geometry_generate(sgcontext);
|
||||
SCULPT_topology_islands_invalidate(ss);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, sgcontext->vc.obact, true, false, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, sgcontext->vc.obact, false);
|
||||
SCULPT_undo_push_node(sgcontext->vc.obact, nullptr, SCULPT_UNDO_GEOMETRY);
|
||||
}
|
||||
|
||||
|
@ -1515,7 +1515,7 @@ struct SculptGestureProjectOperation {
|
|||
static void sculpt_gesture_project_begin(bContext *C, SculptGestureContext *sgcontext)
|
||||
{
|
||||
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, sgcontext->vc.obact, false, false, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, sgcontext->vc.obact, false);
|
||||
}
|
||||
|
||||
static void project_line_gesture_apply_task(SculptGestureContext *sgcontext, PBVHNode *node)
|
||||
|
@ -1711,7 +1711,7 @@ static int sculpt_trim_gesture_lasso_exec(bContext *C, wmOperator *op)
|
|||
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
|
||||
Object *object = CTX_data_active_object(C);
|
||||
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, object, false, true, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, object, false);
|
||||
|
||||
SculptSession *ss = object->sculpt;
|
||||
if (BKE_pbvh_type(ss->pbvh) != PBVH_FACES) {
|
||||
|
|
|
@ -197,7 +197,7 @@ bool brush_use_accumulate(const VPaint *vp)
|
|||
|
||||
void init_stroke(Depsgraph *depsgraph, Object *ob)
|
||||
{
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, true, false, true);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, true);
|
||||
SculptSession *ss = ob->sculpt;
|
||||
|
||||
/* Ensure ss->cache is allocated. It will mostly be initialized in
|
||||
|
@ -217,7 +217,7 @@ void init_session(Depsgraph *depsgraph, Scene *scene, Object *ob, eObjectMode ob
|
|||
BLI_assert(ob->sculpt == nullptr);
|
||||
ob->sculpt = MEM_new<SculptSession>(__func__);
|
||||
ob->sculpt->mode_type = object_mode;
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, true, false, true);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, true);
|
||||
|
||||
SCULPT_ensure_valid_pivot(ob, scene);
|
||||
}
|
||||
|
@ -2250,8 +2250,7 @@ static int vertex_color_set_exec(bContext *C, wmOperator *op)
|
|||
const bool affect_alpha = RNA_boolean_get(op->ptr, "use_alpha");
|
||||
|
||||
/* Ensure valid sculpt state. */
|
||||
BKE_sculpt_update_object_for_edit(
|
||||
CTX_data_ensure_evaluated_depsgraph(C), obact, true, false, true);
|
||||
BKE_sculpt_update_object_for_edit(CTX_data_ensure_evaluated_depsgraph(C), obact, true);
|
||||
|
||||
SCULPT_undo_push_begin(obact, op);
|
||||
Vector<PBVHNode *> nodes = blender::bke::pbvh::search_gather(obact->sculpt->pbvh, {});
|
||||
|
|
|
@ -304,8 +304,7 @@ static void transform_active_color(bContext *C,
|
|||
Object *obact = CTX_data_active_object(C);
|
||||
|
||||
/* Ensure valid sculpt state. */
|
||||
BKE_sculpt_update_object_for_edit(
|
||||
CTX_data_ensure_evaluated_depsgraph(C), obact, true, false, true);
|
||||
BKE_sculpt_update_object_for_edit(CTX_data_ensure_evaluated_depsgraph(C), obact, true);
|
||||
|
||||
SCULPT_undo_push_begin(obact, op);
|
||||
|
||||
|
|
|
@ -4952,8 +4952,7 @@ void SCULPT_stroke_modifiers_check(const bContext *C, Object *ob, const Brush *b
|
|||
(!BKE_sculptsession_use_pbvh_draw(ob, rv3d) && need_pmap))
|
||||
{
|
||||
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
|
||||
BKE_sculpt_update_object_for_edit(
|
||||
depsgraph, ob, need_pmap, false, SCULPT_tool_is_paint(brush->sculpt_tool));
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, SCULPT_tool_is_paint(brush->sculpt_tool));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5331,33 +5330,19 @@ static void sculpt_brush_init_tex(Sculpt *sd, SculptSession *ss)
|
|||
}
|
||||
}
|
||||
|
||||
static void sculpt_brush_stroke_init(bContext *C, wmOperator *op)
|
||||
static void sculpt_brush_stroke_init(bContext *C)
|
||||
{
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
ToolSettings *tool_settings = CTX_data_tool_settings(C);
|
||||
Sculpt *sd = tool_settings->sculpt;
|
||||
SculptSession *ss = CTX_data_active_object(C)->sculpt;
|
||||
Brush *brush = BKE_paint_brush(&sd->paint);
|
||||
int mode = RNA_enum_get(op->ptr, "mode");
|
||||
bool need_pmap, needs_colors;
|
||||
bool need_mask = false;
|
||||
|
||||
if (brush->sculpt_tool == SCULPT_TOOL_MASK) {
|
||||
need_mask = true;
|
||||
}
|
||||
|
||||
if (brush->sculpt_tool == SCULPT_TOOL_CLOTH ||
|
||||
brush->deform_target == BRUSH_DEFORM_TARGET_CLOTH_SIM)
|
||||
{
|
||||
need_mask = true;
|
||||
}
|
||||
|
||||
view3d_operator_needs_opengl(C);
|
||||
sculpt_brush_init_tex(sd, ss);
|
||||
|
||||
need_pmap = sculpt_needs_connectivity_info(sd, brush, ss, mode);
|
||||
needs_colors = SCULPT_tool_is_paint(brush->sculpt_tool) &&
|
||||
!SCULPT_use_image_paint_brush(&tool_settings->paint_mode, ob);
|
||||
const bool needs_colors = SCULPT_tool_is_paint(brush->sculpt_tool) &&
|
||||
!SCULPT_use_image_paint_brush(&tool_settings->paint_mode, ob);
|
||||
|
||||
if (needs_colors) {
|
||||
BKE_sculpt_color_layer_create_if_needed(ob);
|
||||
|
@ -5366,8 +5351,7 @@ static void sculpt_brush_stroke_init(bContext *C, wmOperator *op)
|
|||
/* CTX_data_ensure_evaluated_depsgraph should be used at the end to include the updates of
|
||||
* earlier steps modifying the data. */
|
||||
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
|
||||
BKE_sculpt_update_object_for_edit(
|
||||
depsgraph, ob, need_pmap, need_mask, SCULPT_tool_is_paint(brush->sculpt_tool));
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, SCULPT_tool_is_paint(brush->sculpt_tool));
|
||||
|
||||
ED_paint_tool_update_sticky_shading_color(C, ob);
|
||||
}
|
||||
|
@ -5842,7 +5826,7 @@ static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, const wmEvent
|
|||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
sculpt_brush_stroke_init(C, op);
|
||||
sculpt_brush_stroke_init(C);
|
||||
|
||||
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
|
||||
Brush *brush = BKE_paint_brush(&sd->paint);
|
||||
|
@ -5896,7 +5880,7 @@ static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, const wmEvent
|
|||
|
||||
static int sculpt_brush_stroke_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
sculpt_brush_stroke_init(C, op);
|
||||
sculpt_brush_stroke_init(C);
|
||||
|
||||
op->customdata = paint_stroke_new(C,
|
||||
op,
|
||||
|
|
|
@ -1471,7 +1471,7 @@ static int sculpt_cloth_filter_modal(bContext *C, wmOperator *op, const wmEvent
|
|||
|
||||
SCULPT_vertex_random_access_ensure(ss);
|
||||
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, true, true, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
|
||||
const int totverts = SCULPT_vertex_count_get(ss);
|
||||
|
||||
|
@ -1522,7 +1522,7 @@ static int sculpt_cloth_filter_invoke(bContext *C, wmOperator *op, const wmEvent
|
|||
SCULPT_vertex_random_access_ensure(ss);
|
||||
|
||||
/* Needs mask data to be available as it is used when solving the constraints. */
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, true, true, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
|
||||
SCULPT_stroke_id_next(ob);
|
||||
|
||||
|
|
|
@ -181,7 +181,7 @@ static void sample_detail_voxel(bContext *C, ViewContext *vc, const int mval[2])
|
|||
/* Update the active vertex. */
|
||||
const float mval_fl[2] = {float(mval[0]), float(mval[1])};
|
||||
SCULPT_cursor_geometry_info_update(C, &sgi, mval_fl, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, true, false, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
|
||||
/* Average the edge length of the connected edges to the active vertex. */
|
||||
PBVHVertRef active_vertex = SCULPT_active_vertex_get(ss);
|
||||
|
|
|
@ -1800,7 +1800,7 @@ static int sculpt_expand_modal(bContext *C, wmOperator *op, const wmEvent *event
|
|||
|
||||
/* Update SculptSession data. */
|
||||
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, true, true, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
sculpt_expand_ensure_sculptsession_data(ob);
|
||||
|
||||
/* Update and get the active vertex (and face) from the cursor. */
|
||||
|
@ -2183,7 +2183,7 @@ static int sculpt_expand_invoke(bContext *C, wmOperator *op, const wmEvent *even
|
|||
}
|
||||
}
|
||||
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, true, true, needs_colors);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, needs_colors);
|
||||
|
||||
/* Do nothing when the mesh has 0 vertices. */
|
||||
const int totvert = SCULPT_vertex_count_get(ss);
|
||||
|
|
|
@ -478,7 +478,7 @@ static int sculpt_face_set_create_exec(bContext *C, wmOperator *op)
|
|||
ss->face_sets = BKE_sculpt_face_sets_ensure(ob);
|
||||
Mesh *mesh = static_cast<Mesh *>(ob->data);
|
||||
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, true, mode == SCULPT_FACE_SET_MASKED, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
|
||||
const int tot_vert = SCULPT_vertex_count_get(ss);
|
||||
float threshold = 0.5f;
|
||||
|
@ -743,7 +743,7 @@ static int sculpt_face_set_init_exec(bContext *C, wmOperator *op)
|
|||
|
||||
const int mode = RNA_enum_get(op->ptr, "mode");
|
||||
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, true, false, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
|
||||
/* Dyntopo not supported. */
|
||||
if (BKE_pbvh_type(ss->pbvh) == PBVH_BMESH) {
|
||||
|
@ -918,7 +918,7 @@ static int sculpt_face_set_change_visibility_exec(bContext *C, wmOperator *op)
|
|||
|
||||
Mesh *mesh = BKE_object_get_original_mesh(ob);
|
||||
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, true, true, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
|
||||
/* Not supported for dyntopo. */
|
||||
if (BKE_pbvh_type(ss->pbvh) == PBVH_BMESH) {
|
||||
|
@ -1507,7 +1507,7 @@ static bool sculpt_face_set_edit_init(bContext *C, wmOperator *op)
|
|||
}
|
||||
|
||||
ss->face_sets = BKE_sculpt_face_sets_ensure(ob);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, true, false, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -1550,7 +1550,7 @@ static int sculpt_face_set_edit_invoke(bContext *C, wmOperator *op, const wmEven
|
|||
Object *ob = CTX_data_active_object(C);
|
||||
SculptSession *ss = ob->sculpt;
|
||||
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, true, false, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
|
||||
/* Update the current active Face Set and Vertex as the operator can be used directly from the
|
||||
* tool without brush cursor. */
|
||||
|
@ -1601,7 +1601,7 @@ static int sculpt_face_sets_invert_visibility_exec(bContext *C, wmOperator *op)
|
|||
Mesh *mesh = static_cast<Mesh *>(ob->data);
|
||||
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
|
||||
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, true, true, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
|
||||
/* Not supported for dyntopo. */
|
||||
if (BKE_pbvh_type(ss->pbvh) == PBVH_BMESH) {
|
||||
|
|
|
@ -357,7 +357,7 @@ static int sculpt_color_filter_init(bContext *C, wmOperator *op)
|
|||
/* CTX_data_ensure_evaluated_depsgraph should be used at the end to include the updates of
|
||||
* earlier steps modifying the data. */
|
||||
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, true, false, true);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, true);
|
||||
|
||||
SCULPT_filter_cache_init(C,
|
||||
ob,
|
||||
|
|
|
@ -167,7 +167,7 @@ static int sculpt_mask_filter_exec(bContext *C, wmOperator *op)
|
|||
MultiresModifierData *mmd = BKE_sculpt_multires_active(scene, ob);
|
||||
BKE_sculpt_mask_layers_ensure(CTX_data_depsgraph_pointer(C), CTX_data_main(C), ob, mmd);
|
||||
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, true, true, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
|
||||
SculptSession *ss = ob->sculpt;
|
||||
PBVH *pbvh = ob->sculpt->pbvh;
|
||||
|
|
|
@ -935,8 +935,7 @@ static int sculpt_mesh_filter_modal(bContext *C, wmOperator *op, const wmEvent *
|
|||
|
||||
sculpt_mesh_update_strength(op, ss, prev_mval, mval);
|
||||
|
||||
bool needs_pmap = sculpt_mesh_filter_needs_pmap(filter_type);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, needs_pmap, false, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
|
||||
sculpt_mesh_filter_apply(C, op);
|
||||
|
||||
|
@ -991,7 +990,7 @@ static int sculpt_mesh_filter_start(bContext *C, wmOperator *op)
|
|||
const bool use_automasking = SCULPT_is_automasking_enabled(sd, nullptr, nullptr);
|
||||
const bool needs_topology_info = sculpt_mesh_filter_needs_pmap(filter_type) || use_automasking;
|
||||
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, needs_topology_info, false, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
SculptSession *ss = ob->sculpt;
|
||||
|
||||
const eMeshFilterDeformAxis deform_axis = eMeshFilterDeformAxis(
|
||||
|
|
|
@ -115,7 +115,7 @@ static int sculpt_mask_init_exec(bContext *C, wmOperator *op)
|
|||
MultiresModifierData *mmd = BKE_sculpt_multires_active(CTX_data_scene(C), ob);
|
||||
BKE_sculpt_mask_layers_ensure(depsgraph, CTX_data_main(C), ob, mmd);
|
||||
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, true, true, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
|
||||
PBVH *pbvh = ob->sculpt->pbvh;
|
||||
Vector<PBVHNode *> nodes = blender::bke::pbvh::search_gather(pbvh, {});
|
||||
|
|
|
@ -84,7 +84,7 @@ static int sculpt_set_persistent_base_exec(bContext *C, wmOperator * /*op*/)
|
|||
return OPERATOR_FINISHED;
|
||||
}
|
||||
SCULPT_vertex_random_access_ensure(ss);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false, false, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
|
||||
SculptAttributeParams params = {0};
|
||||
params.permanent = true;
|
||||
|
@ -285,7 +285,7 @@ static void sculpt_init_session(Main *bmain, Depsgraph *depsgraph, Scene *scene,
|
|||
BKE_scene_graph_evaluated_ensure(depsgraph, bmain);
|
||||
|
||||
/* This function expects a fully evaluated depsgraph. */
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false, false, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
|
||||
SculptSession *ss = ob->sculpt;
|
||||
if (ss->face_sets) {
|
||||
|
@ -575,7 +575,7 @@ void SCULPT_geometry_preview_lines_update(bContext *C, SculptSession *ss, float
|
|||
return;
|
||||
}
|
||||
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, true, true, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
|
||||
float brush_co[3];
|
||||
copy_v3_v3(brush_co, SCULPT_active_vertex_co_get(ss));
|
||||
|
@ -640,7 +640,7 @@ static int sculpt_sample_color_invoke(bContext *C, wmOperator *op, const wmEvent
|
|||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
BKE_sculpt_update_object_for_edit(CTX_data_depsgraph_pointer(C), ob, true, false, false);
|
||||
BKE_sculpt_update_object_for_edit(CTX_data_depsgraph_pointer(C), ob, false);
|
||||
|
||||
/* No color attribute? Set color to white. */
|
||||
if (!SCULPT_has_colors(ss)) {
|
||||
|
@ -915,7 +915,7 @@ static int sculpt_mask_by_color_invoke(bContext *C, wmOperator *op, const wmEven
|
|||
MultiresModifierData *mmd = BKE_sculpt_multires_active(CTX_data_scene(C), ob);
|
||||
BKE_sculpt_mask_layers_ensure(depsgraph, CTX_data_main(C), ob, mmd);
|
||||
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, true, true, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
SCULPT_vertex_random_access_ensure(ss);
|
||||
|
||||
/* Tools that are not brushes do not have the brush gizmo to update the vertex as the mouse move,
|
||||
|
@ -1064,7 +1064,7 @@ static int sculpt_bake_cavity_exec(bContext *C, wmOperator *op)
|
|||
MultiresModifierData *mmd = BKE_sculpt_multires_active(CTX_data_scene(C), ob);
|
||||
BKE_sculpt_mask_layers_ensure(depsgraph, CTX_data_main(C), ob, mmd);
|
||||
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, true, true, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
SCULPT_vertex_random_access_ensure(ss);
|
||||
|
||||
SCULPT_undo_push_begin(ob, op);
|
||||
|
|
|
@ -62,7 +62,7 @@ void ED_sculpt_init_transform(bContext *C,
|
|||
copy_v3_v3(ss->prev_pivot_scale, ss->pivot_scale);
|
||||
|
||||
SCULPT_undo_push_begin_ex(ob, undo_name);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false, false, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
|
||||
ss->pivot_rot[3] = 1.0f;
|
||||
|
||||
|
@ -304,7 +304,7 @@ void ED_sculpt_update_modal_transform(bContext *C, Object *ob)
|
|||
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
|
||||
|
||||
SCULPT_vertex_random_access_ensure(ss);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false, false, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
|
||||
switch (sd->transform_mode) {
|
||||
case SCULPT_TRANSFORM_MODE_ALL_VERTICES: {
|
||||
|
@ -398,7 +398,7 @@ static int sculpt_set_pivot_position_exec(bContext *C, wmOperator *op)
|
|||
|
||||
int mode = RNA_enum_get(op->ptr, "mode");
|
||||
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false, true, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
|
||||
/* Pivot to center. */
|
||||
if (mode == SCULPT_PIVOT_POSITION_ORIGIN) {
|
||||
|
|
|
@ -397,7 +397,7 @@ static bool sculpt_undo_restore_coords(bContext *C, Depsgraph *depsgraph, Sculpt
|
|||
if (kb) {
|
||||
ob->shapenr = BLI_findindex(&key->block, kb) + 1;
|
||||
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false, false, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
WM_event_add_notifier(C, NC_OBJECT | ND_DATA, ob);
|
||||
}
|
||||
else {
|
||||
|
@ -868,7 +868,6 @@ static void sculpt_undo_restore_list(bContext *C, Depsgraph *depsgraph, ListBase
|
|||
SubdivCCG *subdiv_ccg = ss->subdiv_ccg;
|
||||
bool update = false, rebuild = false, update_mask = false, update_visibility = false;
|
||||
bool update_face_sets = false;
|
||||
bool need_mask = false;
|
||||
bool need_refine_subdiv = false;
|
||||
bool clear_automask_cache = false;
|
||||
|
||||
|
@ -880,14 +879,6 @@ static void sculpt_undo_restore_list(bContext *C, Depsgraph *depsgraph, ListBase
|
|||
/* Restore pivot. */
|
||||
copy_v3_v3(ss->pivot_pos, unode->pivot_pos);
|
||||
copy_v3_v3(ss->pivot_rot, unode->pivot_rot);
|
||||
if (STREQ(unode->idname, ob->id.name)) {
|
||||
if (unode->type == SCULPT_UNDO_MASK) {
|
||||
/* Is possible that we can't do the mask undo (below)
|
||||
* because of the vertex count. */
|
||||
need_mask = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (clear_automask_cache) {
|
||||
|
@ -902,7 +893,7 @@ static void sculpt_undo_restore_list(bContext *C, Depsgraph *depsgraph, ListBase
|
|||
* ensure object is updated after the node is handled. */
|
||||
const SculptUndoNode *first_unode = (const SculptUndoNode *)lb->first;
|
||||
if (first_unode->type != SCULPT_UNDO_GEOMETRY) {
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false, need_mask, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
}
|
||||
|
||||
if (sculpt_undo_bmesh_restore(C, static_cast<SculptUndoNode *>(lb->first), ob, ss)) {
|
||||
|
@ -991,7 +982,7 @@ static void sculpt_undo_restore_list(bContext *C, Depsgraph *depsgraph, ListBase
|
|||
case SCULPT_UNDO_GEOMETRY:
|
||||
need_refine_subdiv = true;
|
||||
sculpt_undo_geometry_restore(unode, ob);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false, need_mask, false);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false);
|
||||
break;
|
||||
|
||||
case SCULPT_UNDO_DYNTOPO_BEGIN:
|
||||
|
|
Loading…
Reference in New Issue