diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2020-08-11 03:12:08 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2020-08-12 19:02:47 +0300 |
commit | 010911d7226894455023f0f1051a0d5fd2b8bb56 (patch) | |
tree | ab81dd86e1161926188fe0ed5522e6348582bd8e | |
parent | 9f288490d5cc341c256aa9b80474aac4bd5f2d49 (diff) |
Clenaup: Rename random_access_init to random_access_ensure
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8529
12 files changed, 22 insertions, 22 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 3421bb2cce5..3cb4a4d858e 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -109,7 +109,7 @@ * For multi-resolution, the same vertex in multiple grids is counted multiple times, with * different index for each grid. */ -void SCULPT_vertex_random_access_init(SculptSession *ss) +void SCULPT_vertex_random_access_ensure(SculptSession *ss) { if (BKE_pbvh_type(ss->pbvh) == PBVH_BMESH) { BM_mesh_elem_index_ensure(ss->bm, BM_VERT); @@ -1000,7 +1000,7 @@ bool SCULPT_is_vertex_inside_brush_radius_symm(const float vertex[3], void SCULPT_floodfill_init(SculptSession *ss, SculptFloodFill *flood) { int vertex_count = SCULPT_vertex_count_get(ss); - SCULPT_vertex_random_access_init(ss); + SCULPT_vertex_random_access_ensure(ss); flood->queue = BLI_gsqueue_new(sizeof(int)); flood->visited_vertices = BLI_BITMAP_NEW(vertex_count, "visited vertices"); @@ -7696,7 +7696,7 @@ static int sculpt_set_persistent_base_exec(bContext *C, wmOperator *UNUSED(op)) SculptSession *ss = ob->sculpt; if (ss) { - SCULPT_vertex_random_access_init(ss); + SCULPT_vertex_random_access_ensure(ss); BKE_sculpt_update_object_for_edit(depsgraph, ob, false, false, false); MEM_SAFE_FREE(ss->persistent_base); @@ -8926,7 +8926,7 @@ static int sculpt_mask_by_color_invoke(bContext *C, wmOperator *op, const wmEven return OPERATOR_CANCELLED; } - SCULPT_vertex_random_access_init(ss); + 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, * so it needs to be updated here. */ diff --git a/source/blender/editors/sculpt_paint/sculpt_automasking.c b/source/blender/editors/sculpt_paint/sculpt_automasking.c index c475259623a..eef090f484e 100644 --- a/source/blender/editors/sculpt_paint/sculpt_automasking.c +++ b/source/blender/editors/sculpt_paint/sculpt_automasking.c @@ -338,23 +338,23 @@ void SCULPT_automasking_init(Sculpt *sd, Object *ob) } if (SCULPT_is_automasking_mode_enabled(sd, brush, BRUSH_AUTOMASKING_TOPOLOGY)) { - SCULPT_vertex_random_access_init(ss); + SCULPT_vertex_random_access_ensure(ss); SCULPT_topology_automasking_init(sd, ob, ss->cache->automask_factor); } if (SCULPT_is_automasking_mode_enabled(sd, brush, BRUSH_AUTOMASKING_FACE_SETS)) { - SCULPT_vertex_random_access_init(ss); + SCULPT_vertex_random_access_ensure(ss); sculpt_face_sets_automasking_init(sd, ob, ss->cache->automask_factor); } if (SCULPT_is_automasking_mode_enabled(sd, brush, BRUSH_AUTOMASKING_BOUNDARY_EDGES)) { - SCULPT_vertex_random_access_init(ss); + SCULPT_vertex_random_access_ensure(ss); SCULPT_boundary_automasking_init(ob, AUTOMASK_INIT_BOUNDARY_EDGES, brush->automasking_boundary_edges_propagation_steps, ss->cache->automask_factor); } if (SCULPT_is_automasking_mode_enabled(sd, brush, BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS)) { - SCULPT_vertex_random_access_init(ss); + SCULPT_vertex_random_access_ensure(ss); SCULPT_boundary_automasking_init(ob, AUTOMASK_INIT_BOUNDARY_FACE_SETS, brush->automasking_boundary_edges_propagation_steps, diff --git a/source/blender/editors/sculpt_paint/sculpt_boundary.c b/source/blender/editors/sculpt_paint/sculpt_boundary.c index a368214cb0b..c86e922a347 100644 --- a/source/blender/editors/sculpt_paint/sculpt_boundary.c +++ b/source/blender/editors/sculpt_paint/sculpt_boundary.c @@ -428,7 +428,7 @@ SculptBoundary *SCULPT_boundary_data_init(Object *object, { SculptSession *ss = object->sculpt; - SCULPT_vertex_random_access_init(ss); + SCULPT_vertex_random_access_ensure(ss); SCULPT_boundary_info_ensure(object); const int boundary_initial_vertex = sculpt_boundary_get_closest_boundary_vertex( diff --git a/source/blender/editors/sculpt_paint/sculpt_cloth.c b/source/blender/editors/sculpt_paint/sculpt_cloth.c index 9ca1453ec61..2637cb45906 100644 --- a/source/blender/editors/sculpt_paint/sculpt_cloth.c +++ b/source/blender/editors/sculpt_paint/sculpt_cloth.c @@ -1137,7 +1137,7 @@ static int sculpt_cloth_filter_modal(bContext *C, wmOperator *op, const wmEvent float len = event->prevclickx - event->mval[0]; filter_strength = filter_strength * -len * 0.001f * UI_DPI_FAC; - SCULPT_vertex_random_access_init(ss); + SCULPT_vertex_random_access_ensure(ss); BKE_sculpt_update_object_for_edit(depsgraph, ob, true, true, false); @@ -1185,7 +1185,7 @@ static int sculpt_cloth_filter_invoke(bContext *C, wmOperator *op, const wmEvent mouse[1] = event->mval[1]; SCULPT_cursor_geometry_info_update(C, &sgi, mouse, false); - SCULPT_vertex_random_access_init(ss); + 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); diff --git a/source/blender/editors/sculpt_paint/sculpt_detail.c b/source/blender/editors/sculpt_paint/sculpt_detail.c index e08f477c981..69c92f2baeb 100644 --- a/source/blender/editors/sculpt_paint/sculpt_detail.c +++ b/source/blender/editors/sculpt_paint/sculpt_detail.c @@ -176,7 +176,7 @@ static void sample_detail_voxel(bContext *C, ViewContext *vc, int mx, int my) SculptSession *ss = ob->sculpt; SculptCursorGeometryInfo sgi; - SCULPT_vertex_random_access_init(ss); + SCULPT_vertex_random_access_ensure(ss); /* Update the active vertex. */ const float mouse[2] = {mx, my}; diff --git a/source/blender/editors/sculpt_paint/sculpt_filter_mask.c b/source/blender/editors/sculpt_paint/sculpt_filter_mask.c index 37ffaed6ec7..e764df78c88 100644 --- a/source/blender/editors/sculpt_paint/sculpt_filter_mask.c +++ b/source/blender/editors/sculpt_paint/sculpt_filter_mask.c @@ -204,7 +204,7 @@ static int sculpt_mask_filter_exec(bContext *C, wmOperator *op) BKE_sculpt_update_object_for_edit(depsgraph, ob, true, true, false); - SCULPT_vertex_random_access_init(ss); + SCULPT_vertex_random_access_ensure(ss); if (!ob->sculpt->pmap) { return OPERATOR_CANCELLED; @@ -434,7 +434,7 @@ static int sculpt_dirty_mask_exec(bContext *C, wmOperator *op) BKE_sculpt_update_object_for_edit(depsgraph, ob, true, true, false); - SCULPT_vertex_random_access_init(ss); + SCULPT_vertex_random_access_ensure(ss); if (!ob->sculpt->pmap) { return OPERATOR_CANCELLED; diff --git a/source/blender/editors/sculpt_paint/sculpt_filter_mesh.c b/source/blender/editors/sculpt_paint/sculpt_filter_mesh.c index ed9f1c22ec5..9f6500f1421 100644 --- a/source/blender/editors/sculpt_paint/sculpt_filter_mesh.c +++ b/source/blender/editors/sculpt_paint/sculpt_filter_mesh.c @@ -500,7 +500,7 @@ static int sculpt_mesh_filter_modal(bContext *C, wmOperator *op, const wmEvent * float len = event->prevclickx - event->mval[0]; filter_strength = filter_strength * -len * 0.001f * UI_DPI_FAC; - SCULPT_vertex_random_access_init(ss); + SCULPT_vertex_random_access_ensure(ss); bool needs_pmap = sculpt_mesh_filter_needs_pmap(filter_type, use_face_sets); BKE_sculpt_update_object_for_edit(depsgraph, ob, needs_pmap, false, false); @@ -566,7 +566,7 @@ static int sculpt_mesh_filter_invoke(bContext *C, wmOperator *op, const wmEvent const bool use_face_sets = RNA_boolean_get(op->ptr, "use_face_sets"); - SCULPT_vertex_random_access_init(ss); + SCULPT_vertex_random_access_ensure(ss); const bool needs_topology_info = sculpt_mesh_filter_needs_pmap(filter_type, use_face_sets); BKE_sculpt_update_object_for_edit(depsgraph, ob, needs_topology_info, false, false); diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h index 79b1a5bde7b..caa858a5372 100644 --- a/source/blender/editors/sculpt_paint/sculpt_intern.h +++ b/source/blender/editors/sculpt_paint/sculpt_intern.h @@ -89,7 +89,7 @@ float SCULPT_raycast_init(struct ViewContext *vc, bool original); /* Sculpt PBVH abstraction API */ -void SCULPT_vertex_random_access_init(struct SculptSession *ss); +void SCULPT_vertex_random_access_ensure(struct SculptSession *ss); int SCULPT_vertex_count_get(struct SculptSession *ss); const float *SCULPT_vertex_co_get(struct SculptSession *ss, int index); diff --git a/source/blender/editors/sculpt_paint/sculpt_mask_expand.c b/source/blender/editors/sculpt_paint/sculpt_mask_expand.c index aaa61ee9ed3..0ae9baf7e2e 100644 --- a/source/blender/editors/sculpt_paint/sculpt_mask_expand.c +++ b/source/blender/editors/sculpt_paint/sculpt_mask_expand.c @@ -357,7 +357,7 @@ static int sculpt_mask_expand_invoke(bContext *C, wmOperator *op, const wmEvent mouse[0] = event->mval[0]; mouse[1] = event->mval[1]; - SCULPT_vertex_random_access_init(ss); + SCULPT_vertex_random_access_ensure(ss); op->customdata = MEM_mallocN(sizeof(float[2]), "initial mouse position"); copy_v2_v2(op->customdata, mouse); diff --git a/source/blender/editors/sculpt_paint/sculpt_pose.c b/source/blender/editors/sculpt_paint/sculpt_pose.c index 8a288877d43..4d41d069155 100644 --- a/source/blender/editors/sculpt_paint/sculpt_pose.c +++ b/source/blender/editors/sculpt_paint/sculpt_pose.c @@ -549,7 +549,7 @@ void SCULPT_pose_calc_pose_data(Sculpt *sd, float *r_pose_origin, float *r_pose_factor) { - SCULPT_vertex_random_access_init(ss); + SCULPT_vertex_random_access_ensure(ss); /* Calculate the pose rotation point based on the boundaries of the brush factor. */ SculptFloodFill flood; diff --git a/source/blender/editors/sculpt_paint/sculpt_smooth.c b/source/blender/editors/sculpt_paint/sculpt_smooth.c index 9a64830cc20..fd4006ce2d3 100644 --- a/source/blender/editors/sculpt_paint/sculpt_smooth.c +++ b/source/blender/editors/sculpt_paint/sculpt_smooth.c @@ -276,7 +276,7 @@ void SCULPT_smooth(Sculpt *sd, return; } - SCULPT_vertex_random_access_init(ss); + SCULPT_vertex_random_access_ensure(ss); SCULPT_boundary_info_ensure(ob); for (iteration = 0; iteration <= count; iteration++) { diff --git a/source/blender/editors/sculpt_paint/sculpt_transform.c b/source/blender/editors/sculpt_paint/sculpt_transform.c index f616817c330..4c54a0465b9 100644 --- a/source/blender/editors/sculpt_paint/sculpt_transform.c +++ b/source/blender/editors/sculpt_paint/sculpt_transform.c @@ -75,7 +75,7 @@ void ED_sculpt_init_transform(struct bContext *C) ss->pivot_rot[3] = 1.0f; - SCULPT_vertex_random_access_init(ss); + SCULPT_vertex_random_access_ensure(ss); SCULPT_filter_cache_init(ob, sd, SCULPT_UNDO_COORDS); } @@ -126,7 +126,7 @@ void ED_sculpt_update_modal_transform(struct bContext *C) Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); const char symm = sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL; - SCULPT_vertex_random_access_init(ss); + SCULPT_vertex_random_access_ensure(ss); BKE_sculpt_update_object_for_edit(depsgraph, ob, false, false, false); SculptThreadedTaskData data = { |