Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt.c')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 605d72e1e20..ca4ad39d14e 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -632,7 +632,7 @@ bool sculpt_brush_test_cube(SculptBrushTest *test, const float co[3], float loca
if (local_co[0] <= side && local_co[1] <= side && local_co[2] <= side) {
float p = 4.0f;
-
+
test->dist = ((powf(local_co[0], p) +
powf(local_co[1], p) +
powf(local_co[2], p)) / powf(side, p));
@@ -731,7 +731,7 @@ static float calc_overlap(StrokeCache *cache, const char symm, const char axis,
{
float mirror[3];
float distsq;
-
+
/* flip_v3_v3(mirror, cache->traced_location, symm); */
flip_v3_v3(mirror, cache->true_location, symm);
@@ -1120,7 +1120,7 @@ static float brush_strength(
case SCULPT_TOOL_DRAW:
case SCULPT_TOOL_LAYER:
return alpha * flip * pressure * overlap * feather;
-
+
case SCULPT_TOOL_MASK:
overlap = (1 + overlap) / 2;
switch ((BrushMaskTool)brush->mask_tool) {
@@ -1153,7 +1153,7 @@ static float brush_strength(
}
else {
/* reduce strength for DEEPEN, PEAKS, and CONTRAST */
- return 0.5f * alpha * flip * pressure * overlap * feather;
+ return 0.5f * alpha * flip * pressure * overlap * feather;
}
case SCULPT_TOOL_SMOOTH:
@@ -1210,7 +1210,7 @@ float tex_strength(SculptSession *ss, const Brush *br,
avg = 1;
}
else if (mtex->brush_map_mode == MTEX_MAP_MODE_3D) {
- /* Get strength by feeding the vertex
+ /* Get strength by feeding the vertex
* location directly into a texture */
avg = BKE_brush_sample_tex_3D(scene, br, point, rgba, 0, ss->tex_pool);
}
@@ -1220,7 +1220,7 @@ float tex_strength(SculptSession *ss, const Brush *br,
/* if the active area is being applied for symmetry, flip it
* across the symmetry axis and rotate it back to the original
- * position in order to project it. This insures that the
+ * position in order to project it. This insures that the
* brush texture will be oriented correctly. */
flip_v3_v3(symm_point, point, cache->mirror_symmetry_pass);
@@ -1280,16 +1280,16 @@ bool sculpt_search_sphere_cb(PBVHNode *node, void *data_v)
BKE_pbvh_node_get_original_BB(node, bb_min, bb_max);
else
BKE_pbvh_node_get_BB(node, bb_min, bb_max);
-
+
for (i = 0; i < 3; ++i) {
if (bb_min[i] > center[i])
nearest[i] = bb_min[i];
else if (bb_max[i] < center[i])
nearest[i] = bb_max[i];
else
- nearest[i] = center[i];
+ nearest[i] = center[i];
}
-
+
sub_v3_v3v3(t, center, nearest);
return len_squared_v3(t) < data->radius_squared;
@@ -1400,7 +1400,7 @@ static void update_sculpt_normal(Sculpt *sd, Object *ob,
{
const Brush *brush = BKE_paint_brush(&sd->paint);
StrokeCache *cache = ob->sculpt->cache;
-
+
if (cache->mirror_symmetry_pass == 0 &&
cache->radial_symmetry_pass == 0 &&
(cache->first_time || !(brush->flag & BRUSH_ORIGINAL_NORMAL)))
@@ -2042,7 +2042,7 @@ static void do_mask_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
{
SculptSession *ss = ob->sculpt;
Brush *brush = BKE_paint_brush(&sd->paint);
-
+
switch ((BrushMaskTool)brush->mask_tool) {
case BRUSH_MASK_DRAW:
do_mask_brush_draw(sd, ob, nodes, totnode);
@@ -2189,7 +2189,7 @@ static void do_crease_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnod
mul_v3_v3fl(offset, ss->cache->sculpt_normal_symm, ss->cache->radius);
mul_v3_v3(offset, ss->cache->scale);
mul_v3_fl(offset, bstrength);
-
+
/* we divide out the squared alpha and multiply by the squared crease to give us the pinch strength */
crease_correction = brush->crease_pinch_factor * brush->crease_pinch_factor;
brush_alpha = BKE_brush_alpha_get(scene, brush);
@@ -4037,7 +4037,7 @@ static void do_symmetrical_brush_actions(
cache->bstrength = brush_strength(sd, cache, feather, ups);
cache->symmetry = symm;
- /* symm is a bit combination of XYZ - 1 is mirror X; 2 is Y; 3 is XY; 4 is Z; 5 is XZ; 6 is YZ; 7 is XYZ */
+ /* symm is a bit combination of XYZ - 1 is mirror X; 2 is Y; 3 is XY; 4 is Z; 5 is XZ; 6 is YZ; 7 is XYZ */
for (i = 0; i <= symm; ++i) {
if (i == 0 || (symm & i && (symm != 5 || i != 3) && (symm != 6 || (i != 3 && i != 5)))) {
cache->mirror_symmetry_pass = i;
@@ -4172,14 +4172,14 @@ static void sculpt_init_mirror_clipping(Object *ob, SculptSession *ss)
(md->mode & eModifierMode_Realtime))
{
MirrorModifierData *mmd = (MirrorModifierData *)md;
-
+
if (mmd->flag & MOD_MIR_CLIPPING) {
/* check each axis for mirroring */
for (i = 0; i < 3; ++i) {
if (mmd->flag & (MOD_MIR_AXIS_X << i)) {
/* enable sculpt clipping */
ss->cache->flag |= CLIP_X << i;
-
+
/* update the clip tolerance */
if (mmd->tolerance >
ss->cache->clip_tolerance[i])
@@ -4268,7 +4268,7 @@ static void sculpt_update_cache_invariants(
Paint *p = &sd->paint;
Brush *br;
int size = BKE_brush_size_get(scene, brush);
-
+
BLI_strncpy(cache->saved_active_brush_name, brush->id.name + 2,
sizeof(cache->saved_active_brush_name));
@@ -4364,7 +4364,7 @@ static void sculpt_update_cache_invariants(
#define PIXEL_INPUT_THRESHHOLD 5
if (brush->sculpt_tool == SCULPT_TOOL_ROTATE)
cache->dial = BLI_dial_initialize(cache->initial_mouse, PIXEL_INPUT_THRESHHOLD);
-
+
#undef PIXEL_INPUT_THRESHHOLD
}
@@ -4943,7 +4943,7 @@ static void sculpt_stroke_update_step(bContext *C, struct PaintStroke *UNUSED(st
Object *ob = CTX_data_active_object(C);
SculptSession *ss = ob->sculpt;
const Brush *brush = BKE_paint_brush(&sd->paint);
-
+
sculpt_stroke_modifiers_check(C, ob, brush);
sculpt_update_cache_variants(C, sd, ob, itemptr);
sculpt_restore_mesh(sd, ob);
@@ -5042,7 +5042,7 @@ static void sculpt_stroke_done(const bContext *C, struct PaintStroke *UNUSED(str
sculpt_undo_push_end();
BKE_pbvh_update(ss->pbvh, PBVH_UpdateOriginalBB, NULL);
-
+
if (BKE_pbvh_type(ss->pbvh) == PBVH_BMESH)
BKE_pbvh_bmesh_after_stroke(ss->pbvh);
@@ -5086,7 +5086,7 @@ static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, const wmEvent
paint_stroke_data_free(op);
return OPERATOR_PASS_THROUGH;
}
-
+
if ((retval = op->type->modal(C, op, event)) == OPERATOR_FINISHED) {
paint_stroke_data_free(op);
return OPERATOR_FINISHED;
@@ -5096,7 +5096,7 @@ static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, const wmEvent
OPERATOR_RETVAL_CHECK(retval);
BLI_assert(retval == OPERATOR_RUNNING_MODAL);
-
+
return OPERATOR_RUNNING_MODAL;
}
@@ -5143,7 +5143,7 @@ static void SCULPT_OT_brush_stroke(wmOperatorType *ot)
ot->name = "Sculpt";
ot->idname = "SCULPT_OT_brush_stroke";
ot->description = "Sculpt a stroke into the geometry";
-
+
/* api callbacks */
ot->invoke = sculpt_brush_stroke_invoke;
ot->modal = paint_stroke_modal;
@@ -5160,7 +5160,7 @@ static void SCULPT_OT_brush_stroke(wmOperatorType *ot)
RNA_def_boolean(ot->srna, "ignore_background_click", 0,
"Ignore Background Click",
- "Clicks on the background do not start the stroke");
+ "Clicks on the background do not start the stroke");
}
/**** Reset the copy of the mesh that is being sculpted on (currently just for the layer brush) ****/
@@ -5184,11 +5184,11 @@ static void SCULPT_OT_set_persistent_base(wmOperatorType *ot)
ot->name = "Set Persistent Base";
ot->idname = "SCULPT_OT_set_persistent_base";
ot->description = "Reset the copy of the mesh that is being sculpted on";
-
+
/* api callbacks */
ot->exec = sculpt_set_persistent_base_exec;
ot->poll = sculpt_mode_poll;
-
+
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
@@ -5290,7 +5290,7 @@ void sculpt_dynamic_topology_enable_ex(
/* Enable dynamic topology */
me->flag |= ME_SCULPT_DYNAMIC_TOPOLOGY;
-
+
/* Enable logging for undo/redo */
ss->bm_log = BM_log_create(ss->bm);
@@ -5510,12 +5510,12 @@ static void SCULPT_OT_dynamic_topology_toggle(wmOperatorType *ot)
ot->name = "Dynamic Topology Toggle";
ot->idname = "SCULPT_OT_dynamic_topology_toggle";
ot->description = "Dynamic topology alters the mesh topology while sculpting";
-
+
/* api callbacks */
ot->invoke = sculpt_dynamic_topology_toggle_invoke;
ot->exec = sculpt_dynamic_topology_toggle_exec;
ot->poll = sculpt_mode_poll;
-
+
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
@@ -5548,11 +5548,11 @@ static void SCULPT_OT_optimize(wmOperatorType *ot)
ot->name = "Optimize";
ot->idname = "SCULPT_OT_optimize";
ot->description = "Recalculate the sculpt BVH to improve performance";
-
+
/* api callbacks */
ot->exec = sculpt_optimize_exec;
ot->poll = sculpt_and_dynamic_topology_poll;
-
+
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
@@ -5602,7 +5602,7 @@ static void SCULPT_OT_symmetrize(wmOperatorType *ot)
ot->name = "Symmetrize";
ot->idname = "SCULPT_OT_symmetrize";
ot->description = "Symmetrize the topology modifications";
-
+
/* api callbacks */
ot->exec = sculpt_symmetrize_exec;
ot->poll = sculpt_and_dynamic_topology_poll;
@@ -5745,7 +5745,7 @@ void ED_object_sculptmode_exit_ex(
if (mmd) {
multires_force_update(ob);
}
-
+
/* Not needed for now. */
#if 0
const int flush_recalc = ed_object_sculptmode_flush_recalc_flag(scene, ob, mmd);
@@ -5819,11 +5819,11 @@ static void SCULPT_OT_sculptmode_toggle(wmOperatorType *ot)
ot->name = "Sculpt Mode";
ot->idname = "SCULPT_OT_sculptmode_toggle";
ot->description = "Toggle sculpt mode in 3D view";
-
+
/* api callbacks */
ot->exec = sculpt_mode_toggle_exec;
ot->poll = ED_operator_object_active_editable_mesh;
-
+
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}