Unify all XYZ symmetry options using Mesh Symmetry
This adds XYZ symmetry as a property of meshes and updates all modes to use the mesh symmetry by default to have a consistent tool behavior between all modes and when switching objects. Reviewed By: brecht, mano-wii, campbellbarton Maniphest Tasks: T79785 Differential Revision: https://developer.blender.org/D8587
This commit is contained in:
parent
827dfd76dd
commit
5502517c3c
Notes:
blender-bot
2023-05-20 17:00:47 +02:00
Referenced by commit36b6ea6cb1
, Weight Paint: fix Multi-Paint weight display after rB5502517c3. Referenced by commitc51a70537b
, Fix T81745: Auto Weights fails with Mirror mod + Vertex Groups X Referenced by commit084d911010
, Fix T81461: Weight paint crash with "Vertex Groups X Symmetry" option Referenced by issue #84838, Enable "X" will also activate Symmetry mirror for weight painting in 2.91 Referenced by issue #84518, XYZ symmetry options: unclear release notes Referenced by issue #79785, Make XYZ symmetry a property of Objects Referenced by issue #108107, Update sculpt mode symmetry options as properties of meshes
|
@ -152,47 +152,27 @@ class VIEW3D_HT_tool_header(Header):
|
|||
sub.scale_x = 0.6
|
||||
return row, sub
|
||||
|
||||
if mode_string == 'EDIT_MESH':
|
||||
_row, sub = row_for_mirror()
|
||||
sub.prop(context.object.data, "use_mirror_x", text="X", toggle=True)
|
||||
sub.prop(context.object.data, "use_mirror_y", text="Y", toggle=True)
|
||||
sub.prop(context.object.data, "use_mirror_z", text="Z", toggle=True)
|
||||
tool_settings = context.tool_settings
|
||||
layout.prop(tool_settings, "use_mesh_automerge", text="")
|
||||
elif mode_string == 'EDIT_ARMATURE':
|
||||
if mode_string == 'EDIT_ARMATURE':
|
||||
_row, sub = row_for_mirror()
|
||||
sub.prop(context.object.data, "use_mirror_x", text="X", toggle=True)
|
||||
elif mode_string == 'POSE':
|
||||
_row, sub = row_for_mirror()
|
||||
sub.prop(context.object.pose, "use_mirror_x", text="X", toggle=True)
|
||||
elif mode_string == 'PAINT_WEIGHT':
|
||||
elif mode_string in {'EDIT_MESH', 'PAINT_WEIGHT', 'SCULPT', 'PAINT_VERTEX'}:
|
||||
# Mesh Modes, Use Mesh Symmetry
|
||||
row, sub = row_for_mirror()
|
||||
wpaint = context.tool_settings.weight_paint
|
||||
sub.prop(wpaint, "use_symmetry_x", text="X", toggle=True)
|
||||
sub.prop(wpaint, "use_symmetry_y", text="Y", toggle=True)
|
||||
sub.prop(wpaint, "use_symmetry_z", text="Z", toggle=True)
|
||||
row.popover(panel="VIEW3D_PT_tools_weightpaint_symmetry_for_topbar", text="")
|
||||
elif mode_string == 'SCULPT':
|
||||
row, sub = row_for_mirror()
|
||||
sculpt = context.tool_settings.sculpt
|
||||
sub.prop(sculpt, "use_symmetry_x", text="X", toggle=True)
|
||||
sub.prop(sculpt, "use_symmetry_y", text="Y", toggle=True)
|
||||
sub.prop(sculpt, "use_symmetry_z", text="Z", toggle=True)
|
||||
row.popover(panel="VIEW3D_PT_sculpt_symmetry_for_topbar", text="")
|
||||
elif mode_string == 'PAINT_TEXTURE':
|
||||
_row, sub = row_for_mirror()
|
||||
ipaint = context.tool_settings.image_paint
|
||||
sub.prop(ipaint, "use_symmetry_x", text="X", toggle=True)
|
||||
sub.prop(ipaint, "use_symmetry_y", text="Y", toggle=True)
|
||||
sub.prop(ipaint, "use_symmetry_z", text="Z", toggle=True)
|
||||
# No need for a popover, the panel only has these options.
|
||||
elif mode_string == 'PAINT_VERTEX':
|
||||
row, sub = row_for_mirror()
|
||||
vpaint = context.tool_settings.vertex_paint
|
||||
sub.prop(vpaint, "use_symmetry_x", text="X", toggle=True)
|
||||
sub.prop(vpaint, "use_symmetry_y", text="Y", toggle=True)
|
||||
sub.prop(vpaint, "use_symmetry_z", text="Z", toggle=True)
|
||||
row.popover(panel="VIEW3D_PT_tools_vertexpaint_symmetry_for_topbar", text="")
|
||||
sub.prop(context.object.data, "use_mirror_x", text="X", toggle=True)
|
||||
sub.prop(context.object.data, "use_mirror_y", text="Y", toggle=True)
|
||||
sub.prop(context.object.data, "use_mirror_z", text="Z", toggle=True)
|
||||
if mode_string == 'EDIT_MESH':
|
||||
tool_settings = context.tool_settings
|
||||
layout.prop(tool_settings, "use_mesh_automerge", text="")
|
||||
elif mode_string == 'PAINT_WEIGHT':
|
||||
row.popover(panel="VIEW3D_PT_tools_weightpaint_symmetry_for_topbar", text="")
|
||||
elif mode_string == 'SCULPT':
|
||||
row.popover(panel="VIEW3D_PT_sculpt_symmetry_for_topbar", text="")
|
||||
elif mode_string == 'PAINT_VERTEX':
|
||||
row.popover(panel="VIEW3D_PT_tools_vertexpaint_symmetry_for_topbar", text="")
|
||||
|
||||
# Expand panels from the side-bar as popovers.
|
||||
popover_kw = {"space_type": 'VIEW_3D', "region_type": 'UI', "category": "Tool"}
|
||||
|
|
|
@ -123,16 +123,16 @@ class View3DPanel:
|
|||
# **************** standard tool clusters ******************
|
||||
|
||||
# Used by vertex & weight paint
|
||||
def draw_vpaint_symmetry(layout, vpaint):
|
||||
def draw_vpaint_symmetry(layout, vpaint, mesh):
|
||||
|
||||
col = layout.column()
|
||||
col.use_property_split = True
|
||||
col.use_property_decorate = False
|
||||
|
||||
row = col.row(heading="Mirror", align=True)
|
||||
row.prop(vpaint, "use_symmetry_x", text="X", toggle=True)
|
||||
row.prop(vpaint, "use_symmetry_y", text="Y", toggle=True)
|
||||
row.prop(vpaint, "use_symmetry_z", text="Z", toggle=True)
|
||||
row.prop(mesh, "use_mirror_x", text="X", toggle=True)
|
||||
row.prop(mesh, "use_mirror_y", text="Y", toggle=True)
|
||||
row.prop(mesh, "use_mirror_z", text="Z", toggle=True)
|
||||
|
||||
col.prop(vpaint, "radial_symmetry", text="Radial")
|
||||
|
||||
|
@ -397,6 +397,7 @@ class VIEW3D_PT_tools_brush_settings_advanced(Panel, View3DPaintBrushPanel):
|
|||
bl_options = {'DEFAULT_CLOSED'}
|
||||
bl_ui_units_x = 14
|
||||
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
|
@ -907,9 +908,10 @@ class VIEW3D_PT_sculpt_symmetry(Panel, View3DPaintPanel):
|
|||
sculpt = context.tool_settings.sculpt
|
||||
|
||||
row = layout.row(align=True, heading="Mirror")
|
||||
row.prop(sculpt, "use_symmetry_x", text="X", toggle=True)
|
||||
row.prop(sculpt, "use_symmetry_y", text="Y", toggle=True)
|
||||
row.prop(sculpt, "use_symmetry_z", text="Z", toggle=True)
|
||||
mesh = context.object.data
|
||||
row.prop(mesh, "use_mirror_x", text="X", toggle=True)
|
||||
row.prop(mesh, "use_mirror_y", text="Y", toggle=True)
|
||||
row.prop(mesh, "use_mirror_z", text="Z", toggle=True)
|
||||
|
||||
row = layout.row(align=True, heading="Lock")
|
||||
row.prop(sculpt, "lock_x", text="X", toggle=True)
|
||||
|
@ -957,7 +959,12 @@ class VIEW3D_PT_tools_weightpaint_symmetry(Panel, View3DPaintPanel):
|
|||
layout = self.layout
|
||||
tool_settings = context.tool_settings
|
||||
wpaint = tool_settings.weight_paint
|
||||
draw_vpaint_symmetry(layout, wpaint)
|
||||
draw_vpaint_symmetry(layout, wpaint, context.object.data)
|
||||
|
||||
col = layout.column()
|
||||
row = col.row(align=True)
|
||||
row.prop(context.object.data, 'use_mirror_vertex_group_x')
|
||||
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_weightpaint_symmetry_for_topbar(Panel):
|
||||
|
@ -1035,7 +1042,7 @@ class VIEW3D_PT_tools_vertexpaint_symmetry(Panel, View3DPaintPanel):
|
|||
layout = self.layout
|
||||
tool_settings = context.tool_settings
|
||||
vpaint = tool_settings.vertex_paint
|
||||
draw_vpaint_symmetry(layout, vpaint)
|
||||
draw_vpaint_symmetry(layout, vpaint, context.object.data)
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_vertexpaint_symmetry_for_topbar(Panel):
|
||||
|
@ -1091,9 +1098,6 @@ class VIEW3D_PT_tools_imagepaint_symmetry(Panel, View3DPaintPanel):
|
|||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
tool_settings = context.tool_settings
|
||||
ipaint = tool_settings.image_paint
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
|
@ -1103,9 +1107,10 @@ class VIEW3D_PT_tools_imagepaint_symmetry(Panel, View3DPaintPanel):
|
|||
col = split.column()
|
||||
|
||||
row = col.row(align=True)
|
||||
row.prop(ipaint, "use_symmetry_x", text="X", toggle=True)
|
||||
row.prop(ipaint, "use_symmetry_y", text="Y", toggle=True)
|
||||
row.prop(ipaint, "use_symmetry_z", text="Z", toggle=True)
|
||||
mesh = context.object.data
|
||||
row.prop(mesh, "use_mirror_x", text="X", toggle=True)
|
||||
row.prop(mesh, "use_mirror_y", text="Y", toggle=True)
|
||||
row.prop(mesh, "use_mirror_z", text="Z", toggle=True)
|
||||
|
||||
|
||||
# TODO, move to space_view3d.py
|
||||
|
|
|
@ -750,5 +750,14 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Unify symmetry as a mesh property. */
|
||||
if (!DNA_struct_elem_find(fd->filesdna, "Mesh", "char", "symmetry")) {
|
||||
LISTBASE_FOREACH (Mesh *, mesh, &bmain->meshes) {
|
||||
/* The previous flags used to store mesh symmery in edit mode match the new ones that are
|
||||
* used in mesh->symmery. */
|
||||
mesh->symmetry = mesh->editflag & (ME_SYMMETRY_X | ME_SYMMETRY_Y | ME_SYMMETRY_Z);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -395,7 +395,7 @@ static void drw_mesh_weight_state_extract(Object *ob,
|
|||
wstate->flags |= DRW_MESH_WEIGHT_STATE_MULTIPAINT |
|
||||
(ts->auto_normalize ? DRW_MESH_WEIGHT_STATE_AUTO_NORMALIZE : 0);
|
||||
|
||||
if (me->editflag & ME_EDIT_MIRROR_X) {
|
||||
if (me->symmetry & ME_SYMMETRY_X) {
|
||||
BKE_object_defgroup_mirror_selection(ob,
|
||||
wstate->defgroup_len,
|
||||
wstate->defgroup_sel,
|
||||
|
|
|
@ -2512,7 +2512,7 @@ static int edbm_do_smooth_vertex_exec(bContext *C, wmOperator *op)
|
|||
}
|
||||
|
||||
/* mirror before smooth */
|
||||
if (((Mesh *)obedit->data)->editflag & ME_EDIT_MIRROR_X) {
|
||||
if (((Mesh *)obedit->data)->symmetry & ME_SYMMETRY_X) {
|
||||
EDBM_verts_mirror_cache_begin(em, 0, false, true, false, use_topology);
|
||||
}
|
||||
|
||||
|
@ -2559,7 +2559,7 @@ static int edbm_do_smooth_vertex_exec(bContext *C, wmOperator *op)
|
|||
}
|
||||
|
||||
/* apply mirror */
|
||||
if (((Mesh *)obedit->data)->editflag & ME_EDIT_MIRROR_X) {
|
||||
if (((Mesh *)obedit->data)->symmetry & ME_SYMMETRY_X) {
|
||||
EDBM_verts_mirror_apply(em, BM_ELEM_SELECT, 0);
|
||||
EDBM_verts_mirror_cache_end(em);
|
||||
}
|
||||
|
@ -2657,7 +2657,7 @@ static int edbm_do_smooth_laplacian_vertex_exec(bContext *C, wmOperator *op)
|
|||
}
|
||||
|
||||
/* Mirror before smooth. */
|
||||
if (((Mesh *)obedit->data)->editflag & ME_EDIT_MIRROR_X) {
|
||||
if (((Mesh *)obedit->data)->symmetry & ME_SYMMETRY_X) {
|
||||
EDBM_verts_mirror_cache_begin(em, 0, false, true, false, use_topology);
|
||||
}
|
||||
|
||||
|
@ -2683,7 +2683,7 @@ static int edbm_do_smooth_laplacian_vertex_exec(bContext *C, wmOperator *op)
|
|||
}
|
||||
|
||||
/* Apply mirror. */
|
||||
if (((Mesh *)obedit->data)->editflag & ME_EDIT_MIRROR_X) {
|
||||
if (((Mesh *)obedit->data)->symmetry & ME_SYMMETRY_X) {
|
||||
EDBM_verts_mirror_apply(em, BM_ELEM_SELECT, 0);
|
||||
EDBM_verts_mirror_cache_end(em);
|
||||
}
|
||||
|
|
|
@ -952,9 +952,10 @@ static int quadriflow_remesh_exec(bContext *C, wmOperator *op)
|
|||
job->smooth_normals = RNA_boolean_get(op->ptr, "smooth_normals");
|
||||
|
||||
/* Update the target face count if symmetry is enabled */
|
||||
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
|
||||
if (sd && job->use_paint_symmetry) {
|
||||
job->symmetry_axes = (eSymmetryAxes)(sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL);
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
if (ob && job->use_paint_symmetry) {
|
||||
Mesh *mesh = BKE_mesh_from_object(ob);
|
||||
job->symmetry_axes = (eSymmetryAxes)mesh->symmetry;
|
||||
for (char i = 0; i < 3; i++) {
|
||||
eSymmetryAxes symm_it = (eSymmetryAxes)(1 << i);
|
||||
if (job->symmetry_axes & symm_it) {
|
||||
|
|
|
@ -578,7 +578,7 @@ void ED_vgroup_vert_active_mirror(Object *ob, int def_nr)
|
|||
BMEditMesh *em = me->edit_mesh;
|
||||
MDeformVert *dvert_act;
|
||||
|
||||
if (me->editflag & ME_EDIT_MIRROR_X) {
|
||||
if (me->symmetry & ME_SYMMETRY_X) {
|
||||
if (em) {
|
||||
BMVert *eve_act;
|
||||
dvert_act = ED_mesh_active_dvert_get_em(ob, &eve_act);
|
||||
|
@ -634,7 +634,7 @@ static bool vgroup_normalize_active_vertex(Object *ob, eVGroupSelect subset_type
|
|||
BKE_defvert_normalize_subset(dvert_act, vgroup_validmap, vgroup_tot);
|
||||
MEM_freeN((void *)vgroup_validmap);
|
||||
|
||||
if (me->editflag & ME_EDIT_MIRROR_X) {
|
||||
if (me->symmetry & ME_SYMMETRY_X) {
|
||||
if (em) {
|
||||
const int cd_dvert_offset = CustomData_get_offset(&em->bm->vdata, CD_MDEFORMVERT);
|
||||
ED_mesh_defvert_mirror_update_em(ob, eve_act, -1, -1, cd_dvert_offset);
|
||||
|
@ -667,7 +667,7 @@ static void vgroup_copy_active_to_sel(Object *ob, eVGroupSelect subset_type)
|
|||
if (BM_elem_flag_test(eve, BM_ELEM_SELECT) && eve != eve_act) {
|
||||
MDeformVert *dv = BM_ELEM_CD_GET_VOID_P(eve, cd_dvert_offset);
|
||||
BKE_defvert_copy_subset(dv, dvert_act, vgroup_validmap, vgroup_tot);
|
||||
if (me->editflag & ME_EDIT_MIRROR_X) {
|
||||
if (me->symmetry & ME_SYMMETRY_X) {
|
||||
ED_mesh_defvert_mirror_update_em(ob, eve, -1, i, cd_dvert_offset);
|
||||
}
|
||||
}
|
||||
|
@ -684,7 +684,7 @@ static void vgroup_copy_active_to_sel(Object *ob, eVGroupSelect subset_type)
|
|||
for (i = 0; i < me->totvert; i++, dv++) {
|
||||
if ((me->mvert[i].flag & SELECT) && dv != dvert_act) {
|
||||
BKE_defvert_copy_subset(dv, dvert_act, vgroup_validmap, vgroup_tot);
|
||||
if (me->editflag & ME_EDIT_MIRROR_X) {
|
||||
if (me->symmetry & ME_SYMMETRY_X) {
|
||||
ED_mesh_defvert_mirror_update_ob(ob, -1, i);
|
||||
}
|
||||
}
|
||||
|
@ -1592,7 +1592,7 @@ static void vgroup_levels_subset(Object *ob,
|
|||
|
||||
const bool use_vert_sel = vertex_group_use_vert_sel(ob);
|
||||
const bool use_mirror = (ob->type == OB_MESH) ?
|
||||
(((Mesh *)ob->data)->editflag & ME_EDIT_MIRROR_X) != 0 :
|
||||
(((Mesh *)ob->data)->symmetry & ME_SYMMETRY_X) != 0 :
|
||||
false;
|
||||
|
||||
ED_vgroup_parray_alloc(ob->data, &dvert_array, &dvert_tot, use_vert_sel);
|
||||
|
@ -1747,7 +1747,7 @@ static bool *vgroup_selected_get(Object *ob)
|
|||
/* Mirror the selection if X Mirror is enabled. */
|
||||
Mesh *me = BKE_mesh_from_object(ob);
|
||||
|
||||
if (me && (me->editflag & ME_EDIT_MIRROR_X) != 0) {
|
||||
if (me && (me->symmetry & ME_SYMMETRY_X) != 0) {
|
||||
BKE_object_defgroup_mirror_selection(ob, defbase_tot, mask, mask, &sel_count);
|
||||
}
|
||||
}
|
||||
|
@ -1847,7 +1847,7 @@ static void vgroup_invert_subset(Object *ob,
|
|||
int dvert_tot = 0;
|
||||
const bool use_vert_sel = vertex_group_use_vert_sel(ob);
|
||||
const bool use_mirror = (ob->type == OB_MESH) ?
|
||||
(((Mesh *)ob->data)->editflag & ME_EDIT_MIRROR_X) != 0 :
|
||||
(((Mesh *)ob->data)->symmetry & ME_SYMMETRY_X) != 0 :
|
||||
false;
|
||||
|
||||
ED_vgroup_parray_alloc(ob->data, &dvert_array, &dvert_tot, use_vert_sel);
|
||||
|
@ -1905,7 +1905,7 @@ static void vgroup_smooth_subset(Object *ob,
|
|||
int *vgroup_subset_map = BLI_array_alloca(vgroup_subset_map, subset_count);
|
||||
float *vgroup_subset_weights = BLI_array_alloca(vgroup_subset_weights, subset_count);
|
||||
const bool use_mirror = (ob->type == OB_MESH) ?
|
||||
(((Mesh *)ob->data)->editflag & ME_EDIT_MIRROR_X) != 0 :
|
||||
(((Mesh *)ob->data)->symmetry & ME_SYMMETRY_X) != 0 :
|
||||
false;
|
||||
const bool use_select = vertex_group_use_vert_sel(ob);
|
||||
const bool use_hide = use_select;
|
||||
|
@ -2219,7 +2219,7 @@ static void vgroup_clean_subset(Object *ob,
|
|||
int dvert_tot = 0;
|
||||
const bool use_vert_sel = vertex_group_use_vert_sel(ob);
|
||||
const bool use_mirror = (ob->type == OB_MESH) ?
|
||||
(((Mesh *)ob->data)->editflag & ME_EDIT_MIRROR_X) != 0 :
|
||||
(((Mesh *)ob->data)->symmetry & ME_SYMMETRY_X) != 0 :
|
||||
false;
|
||||
|
||||
ED_vgroup_parray_alloc(ob->data, &dvert_array, &dvert_tot, use_vert_sel);
|
||||
|
@ -2249,7 +2249,7 @@ static void vgroup_quantize_subset(Object *ob,
|
|||
int dvert_tot = 0;
|
||||
const bool use_vert_sel = vertex_group_use_vert_sel(ob);
|
||||
const bool use_mirror = (ob->type == OB_MESH) ?
|
||||
(((Mesh *)ob->data)->editflag & ME_EDIT_MIRROR_X) != 0 :
|
||||
(((Mesh *)ob->data)->symmetry & ME_SYMMETRY_X) != 0 :
|
||||
false;
|
||||
ED_vgroup_parray_alloc(ob->data, &dvert_array, &dvert_tot, use_vert_sel);
|
||||
|
||||
|
@ -4286,14 +4286,14 @@ static void vgroup_copy_active_to_sel_single(Object *ob, const int def_nr)
|
|||
if (dw) {
|
||||
dw->weight = weight_act;
|
||||
|
||||
if (me->editflag & ME_EDIT_MIRROR_X) {
|
||||
if (me->symmetry & ME_SYMMETRY_X) {
|
||||
ED_mesh_defvert_mirror_update_em(ob, eve, -1, i, cd_dvert_offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (me->editflag & ME_EDIT_MIRROR_X) {
|
||||
if (me->symmetry & ME_SYMMETRY_X) {
|
||||
ED_mesh_defvert_mirror_update_em(ob, eve_act, -1, -1, cd_dvert_offset);
|
||||
}
|
||||
}
|
||||
|
@ -4313,14 +4313,14 @@ static void vgroup_copy_active_to_sel_single(Object *ob, const int def_nr)
|
|||
MDeformWeight *dw = BKE_defvert_find_index(dv, def_nr);
|
||||
if (dw) {
|
||||
dw->weight = weight_act;
|
||||
if (me->editflag & ME_EDIT_MIRROR_X) {
|
||||
if (me->symmetry & ME_SYMMETRY_X) {
|
||||
ED_mesh_defvert_mirror_update_ob(ob, -1, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (me->editflag & ME_EDIT_MIRROR_X) {
|
||||
if (me->symmetry & ME_SYMMETRY_X) {
|
||||
ED_mesh_defvert_mirror_update_ob(ob, -1, v_act);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -403,7 +403,7 @@ void PE_hide_keys_time(Scene *scene, PTCacheEdit *edit, float cfra)
|
|||
static int pe_x_mirror(Object *ob)
|
||||
{
|
||||
if (ob->type == OB_MESH) {
|
||||
return (((Mesh *)ob->data)->editflag & ME_EDIT_MIRROR_X);
|
||||
return (((Mesh *)ob->data)->symmetry & ME_SYMMETRY_X);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -1090,7 +1090,7 @@ static void cursor_draw_point_with_symmetry(const uint gpuattr,
|
|||
Object *ob,
|
||||
const float radius)
|
||||
{
|
||||
const char symm = sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL;
|
||||
const char symm = SCULPT_mesh_symmetry_xyz_get(ob);
|
||||
float location[3], symm_rot_mat[4][4];
|
||||
|
||||
for (int i = 0; i <= symm; i++) {
|
||||
|
|
|
@ -5887,7 +5887,8 @@ void *paint_proj_new_stroke(bContext *C, Object *ob, const float mouse[2], int m
|
|||
|
||||
ps_handle->orig_brush_size = BKE_brush_size_get(scene, ps_handle->brush);
|
||||
|
||||
ps_handle->symmetry_flags = settings->imapaint.paint.symmetry_flags & PAINT_SYMM_AXIS_ALL;
|
||||
Mesh *mesh = BKE_mesh_from_object(ob);
|
||||
ps_handle->symmetry_flags = mesh->symmetry;
|
||||
ps_handle->ps_views_tot = 1 + (pow_i(2, count_bits_i(ps_handle->symmetry_flags)) - 1);
|
||||
bool is_multi_view = (ps_handle->ps_views_tot != 1);
|
||||
|
||||
|
|
|
@ -312,8 +312,6 @@ static void sculpt_gesture_context_init_common(bContext *C,
|
|||
{
|
||||
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
|
||||
ED_view3d_viewcontext_init(C, &sgcontext->vc, depsgraph);
|
||||
|
||||
Sculpt *sd = sgcontext->vc.scene->toolsettings->sculpt;
|
||||
Object *ob = sgcontext->vc.obact;
|
||||
|
||||
/* Operator properties. */
|
||||
|
@ -323,7 +321,7 @@ static void sculpt_gesture_context_init_common(bContext *C,
|
|||
sgcontext->ss = ob->sculpt;
|
||||
|
||||
/* Symmetry. */
|
||||
sgcontext->symm = sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL;
|
||||
sgcontext->symm = SCULPT_mesh_symmetry_xyz_get(ob);
|
||||
|
||||
/* View Normal. */
|
||||
float mat[3][3];
|
||||
|
|
|
@ -765,7 +765,7 @@ static void do_weight_paint_vertex_single(
|
|||
MDeformWeight *dw_mirr;
|
||||
|
||||
/* from now on we can check if mirrors enabled if this var is -1 and not bother with the flag */
|
||||
if (me->editflag & ME_EDIT_MIRROR_X) {
|
||||
if (me->editflag & ME_EDIT_VERTEX_GROUPS_X_SYMMETRY) {
|
||||
index_mirr = mesh_get_x_mirror_vert(ob, NULL, index, topology);
|
||||
vgroup_mirr = wpi->mirror.index;
|
||||
|
||||
|
@ -961,7 +961,7 @@ static void do_weight_paint_vertex_multi(
|
|||
float dw_rel_free, dw_rel_locked;
|
||||
|
||||
/* from now on we can check if mirrors enabled if this var is -1 and not bother with the flag */
|
||||
if (me->editflag & ME_EDIT_MIRROR_X) {
|
||||
if (me->editflag & ME_EDIT_VERTEX_GROUPS_X_SYMMETRY) {
|
||||
index_mirr = mesh_get_x_mirror_vert(ob, NULL, index, topology);
|
||||
|
||||
if (index_mirr != -1 && index_mirr != index) {
|
||||
|
@ -1610,7 +1610,7 @@ static bool wpaint_stroke_test_start(bContext *C, wmOperator *op, const float mo
|
|||
int i;
|
||||
bDeformGroup *dg;
|
||||
|
||||
if (me->editflag & ME_EDIT_MIRROR_X) {
|
||||
if (me->editflag & ME_EDIT_VERTEX_GROUPS_X_SYMMETRY) {
|
||||
BKE_object_defgroup_mirror_selection(
|
||||
ob, defbase_tot, defbase_sel, defbase_sel, &defbase_tot_sel);
|
||||
}
|
||||
|
@ -2173,7 +2173,8 @@ static void wpaint_paint_leaves(bContext *C,
|
|||
|
||||
/* NOTE: current mirroring code cannot be run in parallel */
|
||||
TaskParallelSettings settings;
|
||||
BKE_pbvh_parallel_range_settings(&settings, !(me->editflag & ME_EDIT_MIRROR_X), totnode);
|
||||
BKE_pbvh_parallel_range_settings(
|
||||
&settings, !(me->flag & ME_EDIT_VERTEX_GROUPS_X_SYMMETRY), totnode);
|
||||
|
||||
switch ((eBrushWeightPaintTool)brush->weightpaint_tool) {
|
||||
case WPAINT_TOOL_AVERAGE:
|
||||
|
@ -2291,7 +2292,7 @@ static void wpaint_do_symmetrical_brush_actions(
|
|||
Mesh *me = ob->data;
|
||||
SculptSession *ss = ob->sculpt;
|
||||
StrokeCache *cache = ss->cache;
|
||||
const char symm = wp->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL;
|
||||
const char symm = SCULPT_mesh_symmetry_xyz_get(ob);
|
||||
int i = 0;
|
||||
|
||||
/* initial stroke */
|
||||
|
@ -3311,7 +3312,7 @@ static void vpaint_do_symmetrical_brush_actions(
|
|||
Mesh *me = ob->data;
|
||||
SculptSession *ss = ob->sculpt;
|
||||
StrokeCache *cache = ss->cache;
|
||||
const char symm = vp->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL;
|
||||
const char symm = SCULPT_mesh_symmetry_xyz_get(ob);
|
||||
int i = 0;
|
||||
|
||||
/* initial stroke */
|
||||
|
|
|
@ -120,8 +120,13 @@ static int weight_from_bones_exec(bContext *C, wmOperator *op)
|
|||
Mesh *me = ob->data;
|
||||
int type = RNA_enum_get(op->ptr, "type");
|
||||
|
||||
ED_object_vgroup_calc_from_armature(
|
||||
op->reports, depsgraph, scene, ob, armob, type, (me->editflag & ME_EDIT_MIRROR_X));
|
||||
ED_object_vgroup_calc_from_armature(op->reports,
|
||||
depsgraph,
|
||||
scene,
|
||||
ob,
|
||||
armob,
|
||||
type,
|
||||
(me->editflag & ME_EDIT_VERTEX_GROUPS_X_SYMMETRY));
|
||||
|
||||
DEG_id_tag_update(&me->id, 0);
|
||||
DEG_relations_tag_update(CTX_data_main(C));
|
||||
|
@ -232,7 +237,7 @@ static int weight_sample_invoke(bContext *C, wmOperator *op, const wmEvent *even
|
|||
vc.obact, defbase_tot, &defbase_tot_sel);
|
||||
|
||||
if (defbase_tot_sel > 1) {
|
||||
if (me->editflag & ME_EDIT_MIRROR_X) {
|
||||
if (me->editflag & ME_EDIT_VERTEX_GROUPS_X_SYMMETRY) {
|
||||
BKE_object_defgroup_mirror_selection(
|
||||
vc.obact, defbase_tot, defbase_sel, defbase_sel, &defbase_tot_sel);
|
||||
}
|
||||
|
@ -458,7 +463,7 @@ static bool weight_paint_set(Object *ob, float paintweight)
|
|||
vgroup_active = ob->actdef - 1;
|
||||
|
||||
/* if mirror painting, find the other group */
|
||||
if (me->editflag & ME_EDIT_MIRROR_X) {
|
||||
if (me->editflag & ME_EDIT_VERTEX_GROUPS_X_SYMMETRY) {
|
||||
vgroup_mirror = ED_wpaint_mirror_vgroup_ensure(ob, vgroup_active);
|
||||
}
|
||||
|
||||
|
@ -486,7 +491,7 @@ static bool weight_paint_set(Object *ob, float paintweight)
|
|||
dw_prev->weight = dw->weight; /* set the undo weight */
|
||||
dw->weight = paintweight;
|
||||
|
||||
if (me->editflag & ME_EDIT_MIRROR_X) { /* x mirror painting */
|
||||
if (me->editflag & ME_EDIT_VERTEX_GROUPS_X_SYMMETRY) { /* x mirror painting */
|
||||
int j = mesh_get_x_mirror_vert(ob, NULL, vidx, topology);
|
||||
if (j >= 0) {
|
||||
/* copy, not paint again */
|
||||
|
|
|
@ -118,7 +118,7 @@ bool ED_wpaint_ensure_data(bContext *C,
|
|||
}
|
||||
|
||||
if (flag & WPAINT_ENSURE_MIRROR) {
|
||||
if (me->editflag & ME_EDIT_MIRROR_X) {
|
||||
if (me->editflag & ME_EDIT_VERTEX_GROUPS_X_SYMMETRY) {
|
||||
int mirror = ED_wpaint_mirror_vgroup_ensure(ob, ob->actdef - 1);
|
||||
if (vgroup_index) {
|
||||
vgroup_index->mirror = mirror;
|
||||
|
|
|
@ -296,6 +296,12 @@ float *SCULPT_brush_deform_target_vertex_co_get(SculptSession *ss,
|
|||
return iter->co;
|
||||
}
|
||||
|
||||
char SCULPT_mesh_symmetry_xyz_get(Object *object)
|
||||
{
|
||||
const Mesh *mesh = BKE_mesh_from_object(object);
|
||||
return mesh->symmetry;
|
||||
}
|
||||
|
||||
/* Sculpt Face Sets and Visibility. */
|
||||
|
||||
int SCULPT_active_face_set_get(SculptSession *ss)
|
||||
|
@ -1057,7 +1063,7 @@ void SCULPT_floodfill_add_initial_with_symmetry(
|
|||
Sculpt *sd, Object *ob, SculptSession *ss, SculptFloodFill *flood, int index, float radius)
|
||||
{
|
||||
/* Add active vertex and symmetric vertices to the queue. */
|
||||
const char symm = sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL;
|
||||
const char symm = SCULPT_mesh_symmetry_xyz_get(ob);
|
||||
for (char i = 0; i <= symm; ++i) {
|
||||
if (SCULPT_is_symmetry_iteration_valid(i, symm)) {
|
||||
int v = -1;
|
||||
|
@ -1081,7 +1087,7 @@ void SCULPT_floodfill_add_active(
|
|||
Sculpt *sd, Object *ob, SculptSession *ss, SculptFloodFill *flood, float radius)
|
||||
{
|
||||
/* Add active vertex and symmetric vertices to the queue. */
|
||||
const char symm = sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL;
|
||||
const char symm = SCULPT_mesh_symmetry_xyz_get(ob);
|
||||
for (char i = 0; i <= symm; ++i) {
|
||||
if (SCULPT_is_symmetry_iteration_valid(i, symm)) {
|
||||
int v = -1;
|
||||
|
@ -6247,7 +6253,7 @@ static void do_symmetrical_brush_actions(Sculpt *sd,
|
|||
Brush *brush = BKE_paint_brush(&sd->paint);
|
||||
SculptSession *ss = ob->sculpt;
|
||||
StrokeCache *cache = ss->cache;
|
||||
const char symm = sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL;
|
||||
const char symm = SCULPT_mesh_symmetry_xyz_get(ob);
|
||||
|
||||
float feather = calc_symmetry_feather(sd, ss->cache);
|
||||
|
||||
|
|
|
@ -213,7 +213,7 @@ static float *SCULPT_topology_automasking_init(Sculpt *sd, Object *ob, float *au
|
|||
.automask_factor = automask_factor,
|
||||
.radius = ss->cache->radius,
|
||||
.use_radius = sculpt_automasking_is_constrained_by_radius(brush),
|
||||
.symm = sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL,
|
||||
.symm = SCULPT_mesh_symmetry_xyz_get(ob),
|
||||
};
|
||||
copy_v3_v3(fdata.location, SCULPT_active_vertex_co_get(ss));
|
||||
SCULPT_floodfill_execute(ss, &flood, automask_floodfill_cb, &fdata);
|
||||
|
|
|
@ -648,7 +648,7 @@ static void do_boundary_brush_bend_task_cb_ex(void *__restrict userdata,
|
|||
SculptSession *ss = data->ob->sculpt;
|
||||
const int symm_area = ss->cache->mirror_symmetry_pass;
|
||||
SculptBoundary *boundary = ss->cache->boundaries[symm_area];
|
||||
const ePaintSymmetryFlags symm = data->sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL;
|
||||
const ePaintSymmetryFlags symm = SCULPT_mesh_symmetry_xyz_get(data->ob);
|
||||
const Brush *brush = data->brush;
|
||||
|
||||
const float strength = ss->cache->bstrength;
|
||||
|
@ -699,7 +699,7 @@ static void do_boundary_brush_slide_task_cb_ex(void *__restrict userdata,
|
|||
SculptSession *ss = data->ob->sculpt;
|
||||
const int symm_area = ss->cache->mirror_symmetry_pass;
|
||||
SculptBoundary *boundary = ss->cache->boundaries[symm_area];
|
||||
const ePaintSymmetryFlags symm = data->sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL;
|
||||
const ePaintSymmetryFlags symm = SCULPT_mesh_symmetry_xyz_get(data->ob);
|
||||
const Brush *brush = data->brush;
|
||||
|
||||
const float strength = ss->cache->bstrength;
|
||||
|
@ -741,7 +741,7 @@ static void do_boundary_brush_inflate_task_cb_ex(void *__restrict userdata,
|
|||
SculptSession *ss = data->ob->sculpt;
|
||||
const int symm_area = ss->cache->mirror_symmetry_pass;
|
||||
SculptBoundary *boundary = ss->cache->boundaries[symm_area];
|
||||
const ePaintSymmetryFlags symm = data->sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL;
|
||||
const ePaintSymmetryFlags symm = SCULPT_mesh_symmetry_xyz_get(data->ob);
|
||||
const Brush *brush = data->brush;
|
||||
|
||||
const float strength = ss->cache->bstrength;
|
||||
|
@ -785,7 +785,7 @@ static void do_boundary_brush_grab_task_cb_ex(void *__restrict userdata,
|
|||
SculptSession *ss = data->ob->sculpt;
|
||||
const int symm_area = ss->cache->mirror_symmetry_pass;
|
||||
SculptBoundary *boundary = ss->cache->boundaries[symm_area];
|
||||
const ePaintSymmetryFlags symm = data->sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL;
|
||||
const ePaintSymmetryFlags symm = SCULPT_mesh_symmetry_xyz_get(data->ob);
|
||||
const Brush *brush = data->brush;
|
||||
|
||||
const float strength = ss->cache->bstrength;
|
||||
|
@ -825,7 +825,7 @@ static void do_boundary_brush_twist_task_cb_ex(void *__restrict userdata,
|
|||
SculptSession *ss = data->ob->sculpt;
|
||||
const int symm_area = ss->cache->mirror_symmetry_pass;
|
||||
SculptBoundary *boundary = ss->cache->boundaries[symm_area];
|
||||
const ePaintSymmetryFlags symm = data->sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL;
|
||||
const ePaintSymmetryFlags symm = SCULPT_mesh_symmetry_xyz_get(data->ob);
|
||||
const Brush *brush = data->brush;
|
||||
|
||||
const float strength = ss->cache->bstrength;
|
||||
|
|
|
@ -88,6 +88,9 @@ float SCULPT_raycast_init(struct ViewContext *vc,
|
|||
float ray_normal[3],
|
||||
bool original);
|
||||
|
||||
/* Symmetry */
|
||||
char SCULPT_mesh_symmetry_xyz_get(Object *object);
|
||||
|
||||
/* Sculpt PBVH abstraction API */
|
||||
void SCULPT_vertex_random_access_ensure(struct SculptSession *ss);
|
||||
|
||||
|
|
|
@ -213,7 +213,7 @@ static int sculpt_mask_expand_modal(bContext *C, wmOperator *op, const wmEvent *
|
|||
|
||||
/* Pivot position. */
|
||||
if (RNA_boolean_get(op->ptr, "update_pivot")) {
|
||||
const char symm = sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL;
|
||||
const char symm = SCULPT_mesh_symmetry_xyz_get(ob);
|
||||
const float threshold = 0.2f;
|
||||
float avg[3];
|
||||
int total = 0;
|
||||
|
|
|
@ -230,7 +230,7 @@ static void pose_brush_grow_factor_task_cb_ex(void *__restrict userdata,
|
|||
SculptThreadedTaskData *data = userdata;
|
||||
PoseGrowFactorTLSData *gftd = tls->userdata_chunk;
|
||||
SculptSession *ss = data->ob->sculpt;
|
||||
const char symm = data->sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL;
|
||||
const char symm = SCULPT_mesh_symmetry_xyz_get(data->ob);
|
||||
PBVHVertexIter vd;
|
||||
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
|
||||
{
|
||||
|
@ -561,7 +561,7 @@ void SCULPT_pose_calc_pose_data(Sculpt *sd,
|
|||
|
||||
PoseFloodFillData fdata = {
|
||||
.radius = radius,
|
||||
.symm = sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL,
|
||||
.symm = SCULPT_mesh_symmetry_xyz_get(ob),
|
||||
.pose_factor = r_pose_factor,
|
||||
.tot_co = 0,
|
||||
};
|
||||
|
@ -777,7 +777,7 @@ static SculptPoseIKChain *pose_ik_chain_init_face_sets(
|
|||
|
||||
PoseFloodFillData fdata = {
|
||||
.radius = radius,
|
||||
.symm = sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL,
|
||||
.symm = SCULPT_mesh_symmetry_xyz_get(ob),
|
||||
.pose_factor = ik_chain->segments[s].weights,
|
||||
.tot_co = 0,
|
||||
.fallback_count = 0,
|
||||
|
@ -1134,7 +1134,7 @@ void SCULPT_do_pose_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
|
|||
{
|
||||
SculptSession *ss = ob->sculpt;
|
||||
Brush *brush = BKE_paint_brush(&sd->paint);
|
||||
const ePaintSymmetryFlags symm = sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL;
|
||||
const ePaintSymmetryFlags symm = SCULPT_mesh_symmetry_xyz_get(ob);
|
||||
|
||||
/* The pose brush applies all enabled symmetry axis in a single iteration, so the rest can be
|
||||
* ignored. */
|
||||
|
|
|
@ -124,7 +124,7 @@ void ED_sculpt_update_modal_transform(struct bContext *C)
|
|||
Object *ob = CTX_data_active_object(C);
|
||||
SculptSession *ss = ob->sculpt;
|
||||
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
|
||||
const char symm = sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL;
|
||||
const char symm = SCULPT_mesh_symmetry_xyz_get(ob);
|
||||
|
||||
SCULPT_vertex_random_access_ensure(ss);
|
||||
BKE_sculpt_update_object_for_edit(depsgraph, ob, false, false, false);
|
||||
|
@ -243,12 +243,11 @@ static EnumPropertyItem prop_sculpt_pivot_position_types[] = {
|
|||
|
||||
static int sculpt_set_pivot_position_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
SculptSession *ss = ob->sculpt;
|
||||
ARegion *region = CTX_wm_region(C);
|
||||
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
|
||||
const char symm = sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL;
|
||||
const char symm = SCULPT_mesh_symmetry_xyz_get(ob);
|
||||
|
||||
int mode = RNA_enum_get(op->ptr, "mode");
|
||||
|
||||
|
|
|
@ -165,9 +165,9 @@ void initTransDataContainers_FromObjectData(TransInfo *t,
|
|||
TransDataContainer *tc = &t->data_container[i];
|
||||
if (((t->flag & T_NO_MIRROR) == 0) && ((t->options & CTX_NO_MIRROR) == 0) &&
|
||||
(objects[i]->type == OB_MESH)) {
|
||||
tc->use_mirror_axis_x = (((Mesh *)objects[i]->data)->editflag & ME_EDIT_MIRROR_X) != 0;
|
||||
tc->use_mirror_axis_y = (((Mesh *)objects[i]->data)->editflag & ME_EDIT_MIRROR_Y) != 0;
|
||||
tc->use_mirror_axis_z = (((Mesh *)objects[i]->data)->editflag & ME_EDIT_MIRROR_Z) != 0;
|
||||
tc->use_mirror_axis_x = (((Mesh *)objects[i]->data)->symmetry & ME_SYMMETRY_X) != 0;
|
||||
tc->use_mirror_axis_y = (((Mesh *)objects[i]->data)->symmetry & ME_SYMMETRY_Y) != 0;
|
||||
tc->use_mirror_axis_z = (((Mesh *)objects[i]->data)->symmetry & ME_SYMMETRY_Z) != 0;
|
||||
}
|
||||
|
||||
if (object_mode & OB_MODE_EDIT) {
|
||||
|
|
|
@ -221,7 +221,9 @@ typedef struct Mesh {
|
|||
float remesh_voxel_adaptivity;
|
||||
char remesh_mode;
|
||||
|
||||
char _pad1[3];
|
||||
char symmetry;
|
||||
|
||||
char _pad1[2];
|
||||
|
||||
int face_sets_color_seed;
|
||||
/* Stores the initial Face Set to be rendered white. This way the overlay can be enabled by
|
||||
|
@ -265,7 +267,7 @@ enum {
|
|||
|
||||
/* me->editflag */
|
||||
enum {
|
||||
ME_EDIT_MIRROR_X = 1 << 0,
|
||||
ME_EDIT_VERTEX_GROUPS_X_SYMMETRY = 1 << 0,
|
||||
ME_EDIT_MIRROR_Y = 1 << 1, /* unused so far */
|
||||
ME_EDIT_MIRROR_Z = 1 << 2, /* unused so far */
|
||||
|
||||
|
@ -320,6 +322,13 @@ enum {
|
|||
ME_SIMPLE_SUBSURF = 1,
|
||||
};
|
||||
|
||||
/* me->symmetry */
|
||||
typedef enum eMeshSymmetryType {
|
||||
ME_SYMMETRY_X = 1 << 0,
|
||||
ME_SYMMETRY_Y = 1 << 1,
|
||||
ME_SYMMETRY_Z = 1 << 2,
|
||||
} eMeshSymmetryType;
|
||||
|
||||
#define MESH_MAX_VERTS 2000000000L
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -3271,6 +3271,29 @@ static void rna_def_mesh(BlenderRNA *brna)
|
|||
|
||||
/* End remesh */
|
||||
|
||||
/* Symmetry */
|
||||
prop = RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "symmetry", ME_SYMMETRY_X);
|
||||
RNA_def_property_ui_text(prop, "X", "Enable symmetry in the X axis");
|
||||
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
|
||||
|
||||
prop = RNA_def_property(srna, "use_mirror_y", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "symmetry", ME_SYMMETRY_Y);
|
||||
RNA_def_property_ui_text(prop, "Y", "Enable symmetry in the Y axis");
|
||||
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
|
||||
|
||||
prop = RNA_def_property(srna, "use_mirror_z", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "symmetry", ME_SYMMETRY_Z);
|
||||
RNA_def_property_ui_text(prop, "Z", "Enable symmetry in the Z axis");
|
||||
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
|
||||
|
||||
prop = RNA_def_property(srna, "use_mirror_vertex_group_x", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_VERTEX_GROUPS_X_SYMMETRY);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Vertex Groups X Symmetry", "Mirror the left/right vertex groups when painting");
|
||||
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
|
||||
/* End Symmetry */
|
||||
|
||||
prop = RNA_def_property(srna, "use_auto_smooth", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_AUTOSMOOTH);
|
||||
RNA_def_property_ui_text(
|
||||
|
@ -3331,19 +3354,6 @@ static void rna_def_mesh(BlenderRNA *brna)
|
|||
# endif
|
||||
|
||||
/* editflag */
|
||||
prop = RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_X);
|
||||
RNA_def_property_ui_text(prop, "X Mirror", "X Axis mirror editing");
|
||||
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
|
||||
|
||||
prop = RNA_def_property(srna, "use_mirror_y", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_Y);
|
||||
RNA_def_property_ui_text(prop, "Y Mirror", "Y Axis mirror editing");
|
||||
|
||||
prop = RNA_def_property(srna, "use_mirror_z", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_Z);
|
||||
RNA_def_property_ui_text(prop, "Z Mirror", "Z Axis mirror editing");
|
||||
|
||||
prop = RNA_def_property(srna, "use_mirror_topology", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_TOPO);
|
||||
RNA_def_property_ui_text(prop,
|
||||
|
|
Loading…
Reference in New Issue