Cleanup: Use the SCULPT_ prefix in all sculpt_intern functions

This commit is contained in:
Pablo Dobarro 2020-03-06 15:24:15 +01:00
parent b201a67faa
commit 69d4aec55f
11 changed files with 658 additions and 655 deletions

View File

@ -580,7 +580,7 @@ static bool sculpt_get_brush_geometry(bContext *C,
if (vc->obact->sculpt && vc->obact->sculpt->pbvh) {
if (!ups->stroke_active) {
hit = sculpt_stroke_get_location(C, location, mouse);
hit = SCULPT_stroke_get_location(C, location, mouse);
}
else {
hit = ups->last_hit;
@ -1212,7 +1212,7 @@ static void sculpt_geometry_preview_lines_draw(const uint gpuattr, SculptSession
if (ss->preview_vert_index_count > 0) {
immBegin(GPU_PRIM_LINES, ss->preview_vert_index_count);
for (int i = 0; i < ss->preview_vert_index_count; i++) {
immVertex3fv(gpuattr, sculpt_vertex_co_get(ss, ss->preview_vert_index_list[i]));
immVertex3fv(gpuattr, SCULPT_vertex_co_get(ss, ss->preview_vert_index_list[i]));
}
immEnd();
}
@ -1439,7 +1439,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
/* Update the active vertex. */
if ((mode == PAINT_MODE_SCULPT) && ss && !ups->stroke_active) {
prev_active_vertex_index = ss->active_vertex_index;
is_cursor_over_mesh = sculpt_cursor_geometry_info_update(
is_cursor_over_mesh = SCULPT_cursor_geometry_info_update(
C, &gi, mouse, (brush->falloff_shape == PAINT_FALLOFF_SHAPE_SPHERE));
}
/* Use special paint crosshair cursor in all paint modes. */
@ -1551,7 +1551,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
if (brush->sculpt_tool == SCULPT_TOOL_GRAB && (brush->flag & BRUSH_GRAB_ACTIVE_VERTEX) &&
!is_multires) {
if (BKE_pbvh_type(ss->pbvh) == PBVH_FACES && ss->deform_modifiers_active) {
sculpt_geometry_preview_lines_update(C, ss, rds);
SCULPT_geometry_preview_lines_update(C, ss, rds);
sculpt_geometry_preview_lines_draw(pos, ss);
}
}

View File

@ -97,7 +97,7 @@ static void partialvis_update_mesh(Object *ob,
BKE_pbvh_node_get_verts(pbvh, node, &vert_indices, &mvert);
paint_mask = CustomData_get_layer(&me->vdata, CD_PAINT_MASK);
sculpt_undo_push_node(ob, node, SCULPT_UNDO_HIDDEN);
SCULPT_undo_push_node(ob, node, SCULPT_UNDO_HIDDEN);
for (i = 0; i < totvert; i++) {
MVert *v = &mvert[vert_indices[i]];
@ -145,7 +145,7 @@ static void partialvis_update_grids(Depsgraph *depsgraph,
grid_hidden = BKE_pbvh_grid_hidden(pbvh);
CCGKey key = *BKE_pbvh_get_grid_key(pbvh);
sculpt_undo_push_node(ob, node, SCULPT_UNDO_HIDDEN);
SCULPT_undo_push_node(ob, node, SCULPT_UNDO_HIDDEN);
for (int i = 0; i < totgrid; i++) {
int any_hidden = 0;
@ -274,7 +274,7 @@ static void partialvis_update_bmesh(Object *ob,
other = BKE_pbvh_bmesh_node_other_verts(node);
faces = BKE_pbvh_bmesh_node_faces(node);
sculpt_undo_push_node(ob, node, SCULPT_UNDO_HIDDEN);
SCULPT_undo_push_node(ob, node, SCULPT_UNDO_HIDDEN);
partialvis_update_bmesh_verts(bm, unique, action, area, planes, &any_changed, &any_visible);
@ -369,10 +369,10 @@ static int hide_show_exec(bContext *C, wmOperator *op)
/* Start undo. */
switch (action) {
case PARTIALVIS_HIDE:
sculpt_undo_push_begin("Hide area");
SCULPT_undo_push_begin("Hide area");
break;
case PARTIALVIS_SHOW:
sculpt_undo_push_begin("Show area");
SCULPT_undo_push_begin("Show area");
break;
}
@ -395,7 +395,7 @@ static int hide_show_exec(bContext *C, wmOperator *op)
}
/* End undo. */
sculpt_undo_push_end();
SCULPT_undo_push_end();
/* Ensure that edges and faces get hidden as well (not used by
* sculpt but it looks wrong when entering editmode otherwise). */
@ -450,7 +450,7 @@ void PAINT_OT_hide_show(struct wmOperatorType *ot)
ot->modal = WM_gesture_box_modal;
ot->exec = hide_show_exec;
/* Sculpt-only for now. */
ot->poll = sculpt_mode_poll_view3d;
ot->poll = SCULPT_mode_poll_view3d;
ot->flag = OPTYPE_REGISTER;

View File

@ -115,7 +115,7 @@ static void mask_flood_fill_task_cb(void *__restrict userdata,
PBVHVertexIter vi;
sculpt_undo_push_node(data->ob, node, SCULPT_UNDO_MASK);
SCULPT_undo_push_node(data->ob, node, SCULPT_UNDO_MASK);
BKE_pbvh_vertex_iter_begin(data->pbvh, node, vi, PBVH_ITER_UNIQUE)
{
@ -157,7 +157,7 @@ static int mask_flood_fill_exec(bContext *C, wmOperator *op)
BKE_pbvh_search_gather(pbvh, NULL, NULL, &nodes, &totnode);
sculpt_undo_push_begin("Mask flood fill");
SCULPT_undo_push_begin("Mask flood fill");
MaskTaskData data = {
.ob = ob,
@ -178,7 +178,7 @@ static int mask_flood_fill_exec(bContext *C, wmOperator *op)
BKE_pbvh_update_vertex_data(pbvh, PBVH_UpdateMask);
sculpt_undo_push_end();
SCULPT_undo_push_end();
if (nodes) {
MEM_freeN(nodes);
@ -200,7 +200,7 @@ void PAINT_OT_mask_flood_fill(struct wmOperatorType *ot)
/* API callbacks. */
ot->exec = mask_flood_fill_exec;
ot->poll = sculpt_mode_poll;
ot->poll = SCULPT_mode_poll;
ot->flag = OPTYPE_REGISTER;
@ -272,7 +272,7 @@ static void mask_box_select_task_cb(void *__restrict userdata,
if (!any_masked) {
any_masked = true;
sculpt_undo_push_node(data->ob, node, SCULPT_UNDO_MASK);
SCULPT_undo_push_node(data->ob, node, SCULPT_UNDO_MASK);
if (data->multires) {
BKE_pbvh_node_mark_normals_update(node);
@ -317,7 +317,7 @@ bool ED_sculpt_mask_box_select(struct bContext *C, ViewContext *vc, const rcti *
pbvh = ob->sculpt->pbvh;
multires = (BKE_pbvh_type(pbvh) == PBVH_GRIDS);
sculpt_undo_push_begin("Mask box fill");
SCULPT_undo_push_begin("Mask box fill");
for (int symmpass = 0; symmpass <= symm; symmpass++) {
if (symmpass == 0 || (symm & symmpass && (symm != 5 || symmpass != 3) &&
@ -359,7 +359,7 @@ bool ED_sculpt_mask_box_select(struct bContext *C, ViewContext *vc, const rcti *
BKE_pbvh_update_vertex_data(pbvh, PBVH_UpdateMask);
sculpt_undo_push_end();
SCULPT_undo_push_end();
ED_region_tag_redraw(ar);
@ -440,7 +440,7 @@ static void mask_gesture_lasso_task_cb(void *__restrict userdata,
if (!any_masked) {
any_masked = true;
sculpt_undo_push_node(data->ob, node, SCULPT_UNDO_MASK);
SCULPT_undo_push_node(data->ob, node, SCULPT_UNDO_MASK);
BKE_pbvh_node_mark_redraw(node);
if (data->multires) {
@ -504,7 +504,7 @@ static int paint_mask_gesture_lasso_exec(bContext *C, wmOperator *op)
pbvh = ob->sculpt->pbvh;
multires = (BKE_pbvh_type(pbvh) == PBVH_GRIDS);
sculpt_undo_push_begin("Mask lasso fill");
SCULPT_undo_push_begin("Mask lasso fill");
for (int symmpass = 0; symmpass <= symm; symmpass++) {
if ((symmpass == 0) || (symm & symmpass && (symm != 5 || symmpass != 3) &&
@ -548,7 +548,7 @@ static int paint_mask_gesture_lasso_exec(bContext *C, wmOperator *op)
BKE_pbvh_update_vertex_data(pbvh, PBVH_UpdateMask);
sculpt_undo_push_end();
SCULPT_undo_push_end();
ED_region_tag_redraw(vc.ar);
MEM_freeN((void *)mcords);
@ -571,7 +571,7 @@ void PAINT_OT_mask_lasso_gesture(wmOperatorType *ot)
ot->modal = WM_gesture_lasso_modal;
ot->exec = paint_mask_gesture_lasso_exec;
ot->poll = sculpt_mode_poll;
ot->poll = SCULPT_mode_poll;
ot->flag = OPTYPE_REGISTER;

View File

@ -1050,7 +1050,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
/* Sculpt mode */
keymap = WM_keymap_ensure(keyconf, "Sculpt", 0, 0);
keymap->poll = sculpt_mode_poll;
keymap->poll = SCULPT_mode_poll;
/* Vertex Paint mode */
keymap = WM_keymap_ensure(keyconf, "Vertex Paint", 0, 0);

View File

@ -560,7 +560,7 @@ static void paint_brush_stroke_add_step(bContext *C,
stroke->last_pressure = pressure;
if (paint_stroke_use_scene_spacing(brush, mode)) {
sculpt_stroke_get_location(C, stroke->last_world_space_position, stroke->last_mouse_position);
SCULPT_stroke_get_location(C, stroke->last_world_space_position, stroke->last_mouse_position);
mul_m4_v3(stroke->vc.obact->obmat, stroke->last_world_space_position);
}
@ -817,7 +817,7 @@ static int paint_space_stroke(bContext *C,
if (use_scene_spacing) {
float world_space_position[3];
bool hit = sculpt_stroke_get_location(C, world_space_position, final_mouse);
bool hit = SCULPT_stroke_get_location(C, world_space_position, final_mouse);
mul_m4_v3(stroke->vc.obact->obmat, world_space_position);
if (hit && stroke->stroke_over_mesh) {
sub_v3_v3v3(d_world_space_position, world_space_position, stroke->last_world_space_position);
@ -1403,7 +1403,7 @@ int paint_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event)
stroke->last_pressure = sample_average.pressure;
copy_v2_v2(stroke->last_mouse_position, sample_average.mouse);
if (paint_stroke_use_scene_spacing(br, mode)) {
stroke->stroke_over_mesh = sculpt_stroke_get_location(
stroke->stroke_over_mesh = SCULPT_stroke_get_location(
C, stroke->last_world_space_position, sample_average.mouse);
mul_m4_v3(stroke->vc.obact->obmat, stroke->last_world_space_position);
}

View File

@ -1147,7 +1147,7 @@ static void ed_vwpaintmode_enter_generic(Main *bmain,
/* Create vertex/weight paint mode session data */
if (ob->sculpt) {
if (ob->sculpt->cache) {
sculpt_cache_free(ob->sculpt->cache);
SCULPT_cache_free(ob->sculpt->cache);
ob->sculpt->cache = NULL;
}
BKE_sculptsession_free(ob);
@ -1220,7 +1220,7 @@ static void ed_vwpaintmode_exit_generic(Object *ob, const eObjectMode mode_flag)
/* If the cache is not released by a cancel or a done, free it now. */
if (ob->sculpt && ob->sculpt->cache) {
sculpt_cache_free(ob->sculpt->cache);
SCULPT_cache_free(ob->sculpt->cache);
ob->sculpt->cache = NULL;
}
@ -1753,9 +1753,9 @@ static void do_wpaint_brush_blur_task_cb_ex(void *__restrict userdata,
const bool use_vert_sel = (data->me->editflag & ME_EDIT_PAINT_VERT_SEL) != 0;
SculptBrushTest test;
SculptBrushTestFn sculpt_brush_test_sq_fn = sculpt_brush_test_init_with_falloff_shape(
SculptBrushTestFn sculpt_brush_test_sq_fn = SCULPT_brush_test_init_with_falloff_shape(
ss, &test, data->brush->falloff_shape);
const float *sculpt_normal_frontface = sculpt_brush_frontface_normal_from_falloff_shape(
const float *sculpt_normal_frontface = SCULPT_brush_frontface_normal_from_falloff_shape(
ss, data->brush->falloff_shape);
/* For each vertex */
@ -1850,9 +1850,9 @@ static void do_wpaint_brush_smear_task_cb_ex(void *__restrict userdata,
if (cache->is_last_valid && (normalize_v3(brush_dir) != 0.0f)) {
SculptBrushTest test;
SculptBrushTestFn sculpt_brush_test_sq_fn = sculpt_brush_test_init_with_falloff_shape(
SculptBrushTestFn sculpt_brush_test_sq_fn = SCULPT_brush_test_init_with_falloff_shape(
ss, &test, data->brush->falloff_shape);
const float *sculpt_normal_frontface = sculpt_brush_frontface_normal_from_falloff_shape(
const float *sculpt_normal_frontface = SCULPT_brush_frontface_normal_from_falloff_shape(
ss, data->brush->falloff_shape);
/* For each vertex */
@ -1957,9 +1957,9 @@ static void do_wpaint_brush_draw_task_cb_ex(void *__restrict userdata,
const bool use_vert_sel = (data->me->editflag & ME_EDIT_PAINT_VERT_SEL) != 0;
SculptBrushTest test;
SculptBrushTestFn sculpt_brush_test_sq_fn = sculpt_brush_test_init_with_falloff_shape(
SculptBrushTestFn sculpt_brush_test_sq_fn = SCULPT_brush_test_init_with_falloff_shape(
ss, &test, data->brush->falloff_shape);
const float *sculpt_normal_frontface = sculpt_brush_frontface_normal_from_falloff_shape(
const float *sculpt_normal_frontface = SCULPT_brush_frontface_normal_from_falloff_shape(
ss, data->brush->falloff_shape);
/* For each vertex */
@ -2026,9 +2026,9 @@ static void do_wpaint_brush_calc_average_weight_cb_ex(
accum->value = 0.0;
SculptBrushTest test;
SculptBrushTestFn sculpt_brush_test_sq_fn = sculpt_brush_test_init_with_falloff_shape(
SculptBrushTestFn sculpt_brush_test_sq_fn = SCULPT_brush_test_init_with_falloff_shape(
ss, &test, data->brush->falloff_shape);
const float *sculpt_normal_frontface = sculpt_brush_frontface_normal_from_falloff_shape(
const float *sculpt_normal_frontface = SCULPT_brush_frontface_normal_from_falloff_shape(
ss, data->brush->falloff_shape);
/* For each vertex */
@ -2148,9 +2148,9 @@ static PBVHNode **vwpaint_pbvh_gather_generic(
.radius_squared = ss->cache->radius_squared,
.original = true,
};
BKE_pbvh_search_gather(ss->pbvh, sculpt_search_sphere_cb, &data, &nodes, r_totnode);
BKE_pbvh_search_gather(ss->pbvh, SCULPT_search_sphere_cb, &data, &nodes, r_totnode);
if (use_normal) {
sculpt_pbvh_calc_area_normal(
SCULPT_pbvh_calc_area_normal(
brush, ob, nodes, *r_totnode, true, ss->cache->sculpt_normal_symm);
}
else {
@ -2168,7 +2168,7 @@ static PBVHNode **vwpaint_pbvh_gather_generic(
.original = true,
.dist_ray_to_aabb_precalc = &dist_ray_to_aabb_precalc,
};
BKE_pbvh_search_gather(ss->pbvh, sculpt_search_circle_cb, &data, &nodes, r_totnode);
BKE_pbvh_search_gather(ss->pbvh, SCULPT_search_circle_cb, &data, &nodes, r_totnode);
if (use_normal) {
copy_v3_v3(ss->cache->sculpt_normal_symm, ss->cache->view_normal);
}
@ -2194,7 +2194,7 @@ static void wpaint_do_paint(bContext *C,
{
SculptSession *ss = ob->sculpt;
ss->cache->radial_symmetry_pass = i;
sculpt_cache_calc_brushdata_symm(ss->cache, symm, axis, angle);
SCULPT_cache_calc_brushdata_symm(ss->cache, symm, axis, angle);
int totnode;
PBVHNode **nodes = vwpaint_pbvh_gather_generic(ob, wp, sd, brush, &totnode);
@ -2249,7 +2249,7 @@ static void wpaint_do_symmetrical_brush_actions(
if ((symm & i && (symm != 5 || i != 3) && (symm != 6 || (i != 3 && i != 5)))) {
cache->mirror_symmetry_pass = i;
cache->radial_symmetry_pass = 0;
sculpt_cache_calc_brushdata_symm(cache, i, 0, 0);
SCULPT_cache_calc_brushdata_symm(cache, i, 0, 0);
if (i & (1 << 0)) {
wpaint_do_paint(C, ob, wp, sd, wpd, wpi, me, brush, i, 'X', 0, 0);
@ -2345,7 +2345,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
swap_m4m4(wpd->vc.rv3d->persmat, mat);
rcti r;
if (sculpt_get_redraw_rect(vc->ar, CTX_wm_region_view3d(C), ob, &r)) {
if (SCULPT_get_redraw_rect(vc->ar, CTX_wm_region_view3d(C), ob, &r)) {
if (ss->cache) {
ss->cache->current_r = r;
}
@ -2413,7 +2413,7 @@ static void wpaint_stroke_done(const bContext *C, struct PaintStroke *stroke)
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
sculpt_cache_free(ob->sculpt->cache);
SCULPT_cache_free(ob->sculpt->cache);
ob->sculpt->cache = NULL;
}
@ -2423,7 +2423,7 @@ static int wpaint_invoke(bContext *C, wmOperator *op, const wmEvent *event)
op->customdata = paint_stroke_new(C,
op,
sculpt_stroke_get_location,
SCULPT_stroke_get_location,
wpaint_stroke_test_start,
wpaint_stroke_update_step,
NULL,
@ -2447,7 +2447,7 @@ static int wpaint_exec(bContext *C, wmOperator *op)
{
op->customdata = paint_stroke_new(C,
op,
sculpt_stroke_get_location,
SCULPT_stroke_get_location,
wpaint_stroke_test_start,
wpaint_stroke_update_step,
NULL,
@ -2464,7 +2464,7 @@ static void wpaint_cancel(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_active_object(C);
if (ob->sculpt->cache) {
sculpt_cache_free(ob->sculpt->cache);
SCULPT_cache_free(ob->sculpt->cache);
ob->sculpt->cache = NULL;
}
@ -2710,7 +2710,7 @@ static void do_vpaint_brush_calc_average_color_cb_ex(void *__restrict userdata,
memset(accum->value, 0, sizeof(accum->value));
SculptBrushTest test;
SculptBrushTestFn sculpt_brush_test_sq_fn = sculpt_brush_test_init_with_falloff_shape(
SculptBrushTestFn sculpt_brush_test_sq_fn = SCULPT_brush_test_init_with_falloff_shape(
ss, &test, data->brush->falloff_shape);
/* For each vertex */
@ -2778,9 +2778,9 @@ static void do_vpaint_brush_draw_task_cb_ex(void *__restrict userdata,
const bool use_face_sel = (data->me->editflag & ME_EDIT_PAINT_FACE_SEL) != 0;
SculptBrushTest test;
SculptBrushTestFn sculpt_brush_test_sq_fn = sculpt_brush_test_init_with_falloff_shape(
SculptBrushTestFn sculpt_brush_test_sq_fn = SCULPT_brush_test_init_with_falloff_shape(
ss, &test, data->brush->falloff_shape);
const float *sculpt_normal_frontface = sculpt_brush_frontface_normal_from_falloff_shape(
const float *sculpt_normal_frontface = SCULPT_brush_frontface_normal_from_falloff_shape(
ss, data->brush->falloff_shape);
/* For each vertex */
@ -2877,9 +2877,9 @@ static void do_vpaint_brush_blur_task_cb_ex(void *__restrict userdata,
const bool use_face_sel = (data->me->editflag & ME_EDIT_PAINT_FACE_SEL) != 0;
SculptBrushTest test;
SculptBrushTestFn sculpt_brush_test_sq_fn = sculpt_brush_test_init_with_falloff_shape(
SculptBrushTestFn sculpt_brush_test_sq_fn = SCULPT_brush_test_init_with_falloff_shape(
ss, &test, data->brush->falloff_shape);
const float *sculpt_normal_frontface = sculpt_brush_frontface_normal_from_falloff_shape(
const float *sculpt_normal_frontface = SCULPT_brush_frontface_normal_from_falloff_shape(
ss, data->brush->falloff_shape);
/* For each vertex */
@ -3001,9 +3001,9 @@ static void do_vpaint_brush_smear_task_cb_ex(void *__restrict userdata,
if (cache->is_last_valid && (normalize_v3(brush_dir) != 0.0f)) {
SculptBrushTest test;
SculptBrushTestFn sculpt_brush_test_sq_fn = sculpt_brush_test_init_with_falloff_shape(
SculptBrushTestFn sculpt_brush_test_sq_fn = SCULPT_brush_test_init_with_falloff_shape(
ss, &test, data->brush->falloff_shape);
const float *sculpt_normal_frontface = sculpt_brush_frontface_normal_from_falloff_shape(
const float *sculpt_normal_frontface = SCULPT_brush_frontface_normal_from_falloff_shape(
ss, data->brush->falloff_shape);
/* For each vertex */
@ -3203,7 +3203,7 @@ static void vpaint_do_paint(bContext *C,
{
SculptSession *ss = ob->sculpt;
ss->cache->radial_symmetry_pass = i;
sculpt_cache_calc_brushdata_symm(ss->cache, symm, axis, angle);
SCULPT_cache_calc_brushdata_symm(ss->cache, symm, axis, angle);
int totnode;
PBVHNode **nodes = vwpaint_pbvh_gather_generic(ob, vp, sd, brush, &totnode);
@ -3258,7 +3258,7 @@ static void vpaint_do_symmetrical_brush_actions(
if (symm & i && (symm != 5 || i != 3) && (symm != 6 || (i != 3 && i != 5))) {
cache->mirror_symmetry_pass = i;
cache->radial_symmetry_pass = 0;
sculpt_cache_calc_brushdata_symm(cache, i, 0, 0);
SCULPT_cache_calc_brushdata_symm(cache, i, 0, 0);
if (i & (1 << 0)) {
vpaint_do_paint(C, sd, vp, vpd, ob, me, brush, i, 'X', 0, 0);
@ -3355,7 +3355,7 @@ static void vpaint_stroke_done(const bContext *C, struct PaintStroke *stroke)
MEM_freeN(vpd);
sculpt_cache_free(ob->sculpt->cache);
SCULPT_cache_free(ob->sculpt->cache);
ob->sculpt->cache = NULL;
}
@ -3365,7 +3365,7 @@ static int vpaint_invoke(bContext *C, wmOperator *op, const wmEvent *event)
op->customdata = paint_stroke_new(C,
op,
sculpt_stroke_get_location,
SCULPT_stroke_get_location,
vpaint_stroke_test_start,
vpaint_stroke_update_step,
NULL,
@ -3390,7 +3390,7 @@ static int vpaint_exec(bContext *C, wmOperator *op)
{
op->customdata = paint_stroke_new(C,
op,
sculpt_stroke_get_location,
SCULPT_stroke_get_location,
vpaint_stroke_test_start,
vpaint_stroke_update_step,
NULL,
@ -3407,7 +3407,7 @@ static void vpaint_cancel(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_active_object(C);
if (ob->sculpt->cache) {
sculpt_cache_free(ob->sculpt->cache);
SCULPT_cache_free(ob->sculpt->cache);
ob->sculpt->cache = NULL;
}

File diff suppressed because it is too large Load Diff

View File

@ -112,7 +112,7 @@ static void cloth_brush_add_length_constraint(SculptSession *ss, const int v1, c
cloth_sim->length_constraints[cloth_sim->tot_length_constraints].v1 = v1;
cloth_sim->length_constraints[cloth_sim->tot_length_constraints].v2 = v2;
cloth_sim->length_constraints[cloth_sim->tot_length_constraints].length = len_v3v3(
sculpt_vertex_co_get(ss, v1), sculpt_vertex_co_get(ss, v2));
SCULPT_vertex_co_get(ss, v1), SCULPT_vertex_co_get(ss, v2));
cloth_sim->tot_length_constraints++;
@ -220,7 +220,7 @@ static void do_cloth_brush_apply_forces_task_cb_ex(void *__restrict userdata,
const float bstrength = ss->cache->bstrength;
SculptBrushTest test;
SculptBrushTestFn sculpt_brush_test_sq_fn = sculpt_brush_test_init_with_falloff_shape(
SculptBrushTestFn sculpt_brush_test_sq_fn = SCULPT_brush_test_init_with_falloff_shape(
ss, &test, data->brush->falloff_shape);
/* For Pich Perpendicular Deform Type. */
@ -262,15 +262,15 @@ static void do_cloth_brush_apply_forces_task_cb_ex(void *__restrict userdata,
}
const float fade = sim_factor * bstrength *
tex_strength(ss,
brush,
vd.co,
dist,
vd.no,
vd.fno,
vd.mask ? *vd.mask : 0.0f,
vd.index,
tls->thread_id);
SCULPT_brush_strength_factor(ss,
brush,
vd.co,
dist,
vd.no,
vd.fno,
vd.mask ? *vd.mask : 0.0f,
vd.index,
tls->thread_id);
float brush_disp[3];
float normal[3];
@ -337,7 +337,7 @@ static void do_cloth_brush_apply_forces_task_cb_ex(void *__restrict userdata,
static SculptClothSimulation *cloth_brush_simulation_create(SculptSession *ss, Brush *brush)
{
const int totverts = sculpt_vertex_count_get(ss);
const int totverts = SCULPT_vertex_count_get(ss);
SculptClothSimulation *cloth_sim;
cloth_sim = MEM_callocN(sizeof(SculptClothSimulation), "cloth constraints");
@ -448,8 +448,8 @@ static void cloth_brush_satisfy_constraints(SculptSession *ss,
mul_v3_v3fl(correction_vector, v1_to_v2, 1.0f - (constraint_distance / current_distance));
mul_v3_v3fl(correction_vector_half, correction_vector, 0.5f);
const float mask_v1 = (1.0f - sculpt_vertex_mask_get(ss, v1));
const float mask_v2 = (1.0f - sculpt_vertex_mask_get(ss, v2));
const float mask_v1 = (1.0f - SCULPT_vertex_mask_get(ss, v1));
const float mask_v2 = (1.0f - SCULPT_vertex_mask_get(ss, v2));
const float sim_factor_v1 = cloth_brush_simulation_falloff_get(
brush, ss->cache->radius, ss->cache->initial_location, cloth_sim->init_pos[v1]);
@ -569,7 +569,7 @@ void SCULPT_do_cloth_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
{
SculptSession *ss = ob->sculpt;
Brush *brush = BKE_paint_brush(&sd->paint);
const int totverts = sculpt_vertex_count_get(ss);
const int totverts = SCULPT_vertex_count_get(ss);
/* In the first brush step of each symmetry pass, build the constraints for the vertices in all
* nodes inside the simulation's limits. */
@ -581,8 +581,8 @@ void SCULPT_do_cloth_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
if (ss->cache->mirror_symmetry_pass == 0) {
ss->cache->cloth_sim = cloth_brush_simulation_create(ss, brush);
for (int i = 0; i < totverts; i++) {
copy_v3_v3(ss->cache->cloth_sim->prev_pos[i], sculpt_vertex_co_get(ss, i));
copy_v3_v3(ss->cache->cloth_sim->init_pos[i], sculpt_vertex_co_get(ss, i));
copy_v3_v3(ss->cache->cloth_sim->prev_pos[i], SCULPT_vertex_co_get(ss, i));
copy_v3_v3(ss->cache->cloth_sim->init_pos[i], SCULPT_vertex_co_get(ss, i));
}
}
@ -594,7 +594,7 @@ void SCULPT_do_cloth_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
/* Store the initial state in the simulation. */
for (int i = 0; i < totverts; i++) {
copy_v3_v3(ss->cache->cloth_sim->pos[i], sculpt_vertex_co_get(ss, i));
copy_v3_v3(ss->cache->cloth_sim->pos[i], SCULPT_vertex_co_get(ss, i));
}
/* Apply forces to the vertices. */

View File

@ -43,11 +43,11 @@ struct bContext;
enum ePaintSymmetryFlags;
bool sculpt_mode_poll(struct bContext *C);
bool sculpt_mode_poll_view3d(struct bContext *C);
bool SCULPT_mode_poll(struct bContext *C);
bool SCULPT_mode_poll_view3d(struct bContext *C);
/* checks for a brush, not just sculpt mode */
bool sculpt_poll(struct bContext *C);
bool sculpt_poll_view3d(struct bContext *C);
bool SCULPT_poll(struct bContext *C);
bool SCULPT_poll_view3d(struct bContext *C);
/* Updates */
@ -65,19 +65,19 @@ typedef struct SculptCursorGeometryInfo {
float active_vertex_co[3];
} SculptCursorGeometryInfo;
bool sculpt_stroke_get_location(struct bContext *C, float out[3], const float mouse[2]);
bool sculpt_cursor_geometry_info_update(bContext *C,
bool SCULPT_stroke_get_location(struct bContext *C, float out[3], const float mouse[2]);
bool SCULPT_cursor_geometry_info_update(bContext *C,
SculptCursorGeometryInfo *out,
const float mouse[2],
bool use_sampled_normal);
void sculpt_geometry_preview_lines_update(bContext *C, struct SculptSession *ss, float radius);
void SCULPT_geometry_preview_lines_update(bContext *C, struct SculptSession *ss, float radius);
/* Sculpt PBVH abstraction API */
void sculpt_vertex_random_access_init(struct SculptSession *ss);
void SCULPT_vertex_random_access_init(struct SculptSession *ss);
int sculpt_vertex_count_get(struct SculptSession *ss);
const float *sculpt_vertex_co_get(struct SculptSession *ss, int index);
float sculpt_vertex_mask_get(struct SculptSession *ss, int index);
int SCULPT_vertex_count_get(struct SculptSession *ss);
const float *SCULPT_vertex_co_get(struct SculptSession *ss, int index);
float SCULPT_vertex_mask_get(struct SculptSession *ss, int index);
#define SCULPT_VERTEX_NEIGHBOR_FIXED_CAPACITY 256
typedef struct SculptVertexNeighborIter {
@ -96,14 +96,14 @@ typedef struct SculptVertexNeighborIter {
bool is_duplicate;
} SculptVertexNeighborIter;
void sculpt_vertex_neighbors_get(struct SculptSession *ss,
void SCULPT_vertex_neighbors_get(struct SculptSession *ss,
const int index,
const bool include_duplicates,
SculptVertexNeighborIter *iter);
/* Iterator over neighboring vertices. */
#define sculpt_vertex_neighbors_iter_begin(ss, v_index, neighbor_iterator) \
sculpt_vertex_neighbors_get(ss, v_index, false, &neighbor_iterator); \
SCULPT_vertex_neighbors_get(ss, v_index, false, &neighbor_iterator); \
for (neighbor_iterator.i = 0; neighbor_iterator.i < neighbor_iterator.size; \
neighbor_iterator.i++) { \
neighbor_iterator.index = ni.neighbors[ni.i];
@ -240,8 +240,8 @@ struct SculptPoseIKChain *SCULPT_pose_ik_chain_init(struct Sculpt *sd,
void SCULPT_pose_ik_chain_free(struct SculptPoseIKChain *ik_chain);
/* Sculpt Visibility API */
void sculpt_visibility_sync_all_face_sets_to_vertices(struct SculptSession *ss);
void sculpt_visibility_sync_all_vertex_to_face_sets(struct SculptSession *ss);
void SCULPT_visibility_sync_all_face_sets_to_vertices(struct SculptSession *ss);
void SCULPT_visibility_sync_all_vertex_to_face_sets(struct SculptSession *ss);
/* Undo */
@ -447,36 +447,36 @@ typedef struct {
struct DistRayAABB_Precalc *dist_ray_to_aabb_precalc;
} SculptSearchCircleData;
void sculpt_brush_test_init(struct SculptSession *ss, SculptBrushTest *test);
bool sculpt_brush_test_sphere(SculptBrushTest *test, const float co[3]);
bool sculpt_brush_test_sphere_sq(SculptBrushTest *test, const float co[3]);
bool sculpt_brush_test_sphere_fast(const SculptBrushTest *test, const float co[3]);
bool sculpt_brush_test_cube(SculptBrushTest *test,
void SCULPT_brush_test_init(struct SculptSession *ss, SculptBrushTest *test);
bool SCULPT_brush_test_sphere(SculptBrushTest *test, const float co[3]);
bool SCULPT_brush_test_sphere_sq(SculptBrushTest *test, const float co[3]);
bool SCULPT_brush_test_sphere_fast(const SculptBrushTest *test, const float co[3]);
bool SCULPT_brush_test_cube(SculptBrushTest *test,
const float co[3],
const float local[4][4],
const float roundness);
bool sculpt_brush_test_circle_sq(SculptBrushTest *test, const float co[3]);
bool sculpt_search_sphere_cb(PBVHNode *node, void *data_v);
bool sculpt_search_circle_cb(PBVHNode *node, void *data_v);
bool SCULPT_brush_test_circle_sq(SculptBrushTest *test, const float co[3]);
bool SCULPT_search_sphere_cb(PBVHNode *node, void *data_v);
bool SCULPT_search_circle_cb(PBVHNode *node, void *data_v);
SculptBrushTestFn sculpt_brush_test_init_with_falloff_shape(SculptSession *ss,
SculptBrushTestFn SCULPT_brush_test_init_with_falloff_shape(SculptSession *ss,
SculptBrushTest *test,
char falloff_shape);
const float *sculpt_brush_frontface_normal_from_falloff_shape(SculptSession *ss,
const float *SCULPT_brush_frontface_normal_from_falloff_shape(SculptSession *ss,
char falloff_shape);
float tex_strength(struct SculptSession *ss,
const struct Brush *br,
const float point[3],
const float len,
const short vno[3],
const float fno[3],
const float mask,
const int vertex_index,
const int thread_id);
float SCULPT_brush_strength_factor(struct SculptSession *ss,
const struct Brush *br,
const float point[3],
const float len,
const short vno[3],
const float fno[3],
const float mask,
const int vertex_index,
const int thread_id);
/* just for vertex paint. */
bool sculpt_pbvh_calc_area_normal(const struct Brush *brush,
bool SCULPT_pbvh_calc_area_normal(const struct Brush *brush,
Object *ob,
PBVHNode **nodes,
int totnode,
@ -633,21 +633,21 @@ typedef struct FilterCache {
int active_face_set;
} FilterCache;
void sculpt_cache_calc_brushdata_symm(StrokeCache *cache,
void SCULPT_cache_calc_brushdata_symm(StrokeCache *cache,
const char symm,
const char axis,
const float angle);
void sculpt_cache_free(StrokeCache *cache);
void SCULPT_cache_free(StrokeCache *cache);
SculptUndoNode *sculpt_undo_push_node(Object *ob, PBVHNode *node, SculptUndoType type);
SculptUndoNode *sculpt_undo_get_node(PBVHNode *node);
void sculpt_undo_push_begin(const char *name);
void sculpt_undo_push_end(void);
SculptUndoNode *SCULPT_undo_push_node(Object *ob, PBVHNode *node, SculptUndoType type);
SculptUndoNode *SCULPT_undo_get_node(PBVHNode *node);
void SCULPT_undo_push_begin(const char *name);
void SCULPT_undo_push_end(void);
void sculpt_vertcos_to_key(Object *ob, KeyBlock *kb, const float (*vertCos)[3]);
void SCULPT_vertcos_to_key(Object *ob, KeyBlock *kb, const float (*vertCos)[3]);
void sculpt_update_object_bounding_box(struct Object *ob);
void SCULPT_update_object_bounding_box(struct Object *ob);
bool sculpt_get_redraw_rect(struct ARegion *ar, struct RegionView3D *rv3d, Object *ob, rcti *rect);
bool SCULPT_get_redraw_rect(struct ARegion *ar, struct RegionView3D *rv3d, Object *ob, rcti *rect);
#endif

View File

@ -275,11 +275,11 @@ static void sculpt_pose_grow_pose_factor(Sculpt *sd,
bool grow_next_iteration = true;
float prev_len = FLT_MAX;
data.prev_mask = MEM_mallocN(sculpt_vertex_count_get(ss) * sizeof(float), "prev mask");
data.prev_mask = MEM_mallocN(SCULPT_vertex_count_get(ss) * sizeof(float), "prev mask");
while (grow_next_iteration) {
zero_v3(gftd.pos_avg);
gftd.pos_count = 0;
memcpy(data.prev_mask, pose_factor, sculpt_vertex_count_get(ss) * sizeof(float));
memcpy(data.prev_mask, pose_factor, SCULPT_vertex_count_get(ss) * sizeof(float));
BKE_pbvh_parallel_range(0, totnode, &data, pose_brush_grow_factor_task_cb_ex, &settings);
if (gftd.pos_count != 0) {
@ -295,7 +295,7 @@ static void sculpt_pose_grow_pose_factor(Sculpt *sd,
}
else {
grow_next_iteration = false;
memcpy(pose_factor, data.prev_mask, sculpt_vertex_count_get(ss) * sizeof(float));
memcpy(pose_factor, data.prev_mask, SCULPT_vertex_count_get(ss) * sizeof(float));
}
}
else {
@ -311,7 +311,7 @@ static void sculpt_pose_grow_pose_factor(Sculpt *sd,
if (r_pose_origin) {
copy_v3_v3(r_pose_origin, gftd.pos_avg);
}
memcpy(pose_factor, data.prev_mask, sculpt_vertex_count_get(ss) * sizeof(float));
memcpy(pose_factor, data.prev_mask, SCULPT_vertex_count_get(ss) * sizeof(float));
}
}
}
@ -363,7 +363,7 @@ static bool pose_floodfill_cb(
data->pose_factor[to_v] = 1.0f;
}
const float *co = sculpt_vertex_co_get(ss, to_v);
const float *co = SCULPT_vertex_co_get(ss, to_v);
if (sculpt_pose_brush_is_vertex_inside_brush_radius(
co, data->pose_initial_co, data->radius, data->symm)) {
return true;
@ -393,7 +393,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_init(ss);
/* Calculate the pose rotation point based on the boundaries of the brush factor. */
SculptFloodFill flood;
@ -467,7 +467,7 @@ SculptPoseIKChain *SCULPT_pose_ik_chain_init(Sculpt *sd,
const float chain_segment_len = radius * (1.0f + br->pose_offset);
float next_chain_segment_target[3];
int totvert = sculpt_vertex_count_get(ss);
int totvert = SCULPT_vertex_count_get(ss);
int nearest_vertex_index = SCULPT_nearest_vertex_get(sd, ob, initial_location, FLT_MAX, true);
/* Init the buffers used to keep track of the changes in the pose factors as more segments are

View File

@ -198,7 +198,7 @@ static bool sculpt_undo_restore_coords(bContext *C, Depsgraph *depsgraph, Sculpt
}
/* Propagate new coords to keyblock. */
sculpt_vertcos_to_key(ob, ss->shapekey_active, vertCos);
SCULPT_vertcos_to_key(ob, ss->shapekey_active, vertCos);
/* PBVH uses it's own mvert array, so coords should be */
/* propagated to PBVH here. */
@ -550,7 +550,7 @@ static void sculpt_undo_restore_list(bContext *C, Depsgraph *depsgraph, ListBase
BKE_sculpt_update_object_for_edit(depsgraph, ob, true, need_mask);
sculpt_visibility_sync_all_face_sets_to_vertices(ss);
SCULPT_visibility_sync_all_face_sets_to_vertices(ss);
BKE_pbvh_update_vertex_data(ss->pbvh, PBVH_UpdateVisibility);
if (BKE_pbvh_type(ss->pbvh) == PBVH_FACES) {
@ -659,7 +659,7 @@ static void sculpt_undo_restore_list(bContext *C, Depsgraph *depsgraph, ListBase
}
if (update_visibility) {
sculpt_visibility_sync_all_vertex_to_face_sets(ss);
SCULPT_visibility_sync_all_vertex_to_face_sets(ss);
BKE_pbvh_update_visibility(ss->pbvh);
}
@ -691,7 +691,7 @@ static void sculpt_undo_restore_list(bContext *C, Depsgraph *depsgraph, ListBase
DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
}
else {
sculpt_update_object_bounding_box(ob);
SCULPT_update_object_bounding_box(ob);
}
}
@ -783,7 +783,7 @@ static bool sculpt_undo_cleanup(bContext *C, ListBase *lb)
}
#endif
SculptUndoNode *sculpt_undo_get_node(PBVHNode *node)
SculptUndoNode *SCULPT_undo_get_node(PBVHNode *node)
{
UndoSculpt *usculpt = sculpt_undo_get_nodes();
@ -1092,7 +1092,7 @@ static SculptUndoNode *sculpt_undo_bmesh_push(Object *ob, PBVHNode *node, Sculpt
return unode;
}
SculptUndoNode *sculpt_undo_push_node(Object *ob, PBVHNode *node, SculptUndoType type)
SculptUndoNode *SCULPT_undo_push_node(Object *ob, PBVHNode *node, SculptUndoType type)
{
SculptSession *ss = ob->sculpt;
SculptUndoNode *unode;
@ -1119,7 +1119,7 @@ SculptUndoNode *sculpt_undo_push_node(Object *ob, PBVHNode *node, SculptUndoType
BLI_thread_unlock(LOCK_CUSTOM1);
return unode;
}
else if ((unode = sculpt_undo_get_node(node))) {
else if ((unode = SCULPT_undo_get_node(node))) {
BLI_thread_unlock(LOCK_CUSTOM1);
return unode;
}
@ -1180,7 +1180,7 @@ SculptUndoNode *sculpt_undo_push_node(Object *ob, PBVHNode *node, SculptUndoType
return unode;
}
void sculpt_undo_push_begin(const char *name)
void SCULPT_undo_push_begin(const char *name)
{
UndoStack *ustack = ED_undo_stack_get();
@ -1190,7 +1190,7 @@ void sculpt_undo_push_begin(const char *name)
BKE_undosys_step_push_init_with_type(ustack, C, name, BKE_UNDOSYS_TYPE_SCULPT);
}
void sculpt_undo_push_end(void)
void SCULPT_undo_push_end(void)
{
UndoSculpt *usculpt = sculpt_undo_get_nodes();
SculptUndoNode *unode;
@ -1363,14 +1363,14 @@ static void sculpt_undosys_step_free(UndoStep *us_p)
void ED_sculpt_undo_geometry_begin(struct Object *ob, const char *name)
{
sculpt_undo_push_begin(name);
sculpt_undo_push_node(ob, NULL, SCULPT_UNDO_GEOMETRY);
SCULPT_undo_push_begin(name);
SCULPT_undo_push_node(ob, NULL, SCULPT_UNDO_GEOMETRY);
}
void ED_sculpt_undo_geometry_end(struct Object *ob)
{
sculpt_undo_push_node(ob, NULL, SCULPT_UNDO_GEOMETRY);
sculpt_undo_push_end();
SCULPT_undo_push_node(ob, NULL, SCULPT_UNDO_GEOMETRY);
SCULPT_undo_push_end();
}
/* Export for ED_undo_sys. */