Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt.c
| Show First 20 Lines • Show All 7,396 Lines • ▼ Show 20 Lines | switch (BKE_pbvh_type(pbvh)) { | ||||
| case PBVH_FACES: | case PBVH_FACES: | ||||
| /* Mesh Symmetrize. */ | /* Mesh Symmetrize. */ | ||||
| ED_sculpt_undo_geometry_begin(ob, "mesh symmetrize"); | ED_sculpt_undo_geometry_begin(ob, "mesh symmetrize"); | ||||
| Mesh *mesh = ob->data; | Mesh *mesh = ob->data; | ||||
| Mesh *mesh_mirror; | Mesh *mesh_mirror; | ||||
| MirrorModifierData mmd = {{0}}; | MirrorModifierData mmd = {{0}}; | ||||
| int axis = 0; | int axis = 0; | ||||
| mmd.flag = 0; | mmd.flag = 0; | ||||
| mmd.tolerance = 0.005f; | mmd.tolerance = 0.001f; | ||||
| switch (sd->symmetrize_direction) { | switch (sd->symmetrize_direction) { | ||||
| case BMO_SYMMETRIZE_NEGATIVE_X: | case BMO_SYMMETRIZE_NEGATIVE_X: | ||||
| axis = 0; | axis = 0; | ||||
| mmd.flag |= MOD_MIR_AXIS_X | MOD_MIR_BISECT_AXIS_X | MOD_MIR_BISECT_FLIP_AXIS_X; | mmd.flag |= MOD_MIR_AXIS_X | MOD_MIR_BISECT_AXIS_X | MOD_MIR_BISECT_FLIP_AXIS_X; | ||||
| break; | break; | ||||
| case BMO_SYMMETRIZE_NEGATIVE_Y: | case BMO_SYMMETRIZE_NEGATIVE_Y: | ||||
| axis = 1; | axis = 1; | ||||
| mmd.flag |= MOD_MIR_AXIS_Y | MOD_MIR_BISECT_AXIS_Y | MOD_MIR_BISECT_FLIP_AXIS_Y; | mmd.flag |= MOD_MIR_AXIS_Y | MOD_MIR_BISECT_AXIS_Y | MOD_MIR_BISECT_FLIP_AXIS_Y; | ||||
| ▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | static void SCULPT_OT_symmetrize(wmOperatorType *ot) | ||||
| ot->poll = sculpt_no_multires_poll; | ot->poll = sculpt_no_multires_poll; | ||||
| } | } | ||||
| /**** Toggle operator for turning sculpt mode on or off ****/ | /**** Toggle operator for turning sculpt mode on or off ****/ | ||||
| static void sculpt_init_session(Depsgraph *depsgraph, Scene *scene, Object *ob) | static void sculpt_init_session(Depsgraph *depsgraph, Scene *scene, Object *ob) | ||||
| { | { | ||||
| /* Create persistent sculpt mode data. */ | /* Create persistent sculpt mode data. */ | ||||
| BKE_sculpt_toolsettings_data_ensure(scene); | BKE_sculpt_toolsettings_data_ensure(scene); | ||||
jbakker: "Distance within which symmetrical vertices are merged" | |||||
| ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt session"); | ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt session"); | ||||
| ob->sculpt->mode_type = OB_MODE_SCULPT; | ob->sculpt->mode_type = OB_MODE_SCULPT; | ||||
| BKE_sculpt_update_object_for_edit(depsgraph, ob, false, false); | BKE_sculpt_update_object_for_edit(depsgraph, ob, false, false); | ||||
| /* Here we can detect geometry that was just added to Sculpt Mode as it has the | /* Here we can detect geometry that was just added to Sculpt Mode as it has the | ||||
| * SCULPT_FACE_SET_NONE assigned, so we can create a new Face Set for it. */ | * SCULPT_FACE_SET_NONE assigned, so we can create a new Face Set for it. */ | ||||
| /* In sculpt mode all geometry that is assigned to SCULPT_FACE_SET_NONE is considered as not | /* In sculpt mode all geometry that is assigned to SCULPT_FACE_SET_NONE is considered as not | ||||
| ▲ Show 20 Lines • Show All 355 Lines • Show Last 20 Lines | |||||
"Distance within which symmetrical vertices are merged"