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.
Details
Diff Detail
- Repository
- rB Blender
- Branch
- mesh-symmetry (branched from master)
- Build Status
Buildable 9571 Build 9571: arc lint + arc unit
Event Timeline
This updates all paint modes to use the new symmetry flags. @Germano Cavalcante (mano-wii) Is it ok to replace all instances of ME_EDIT_MIRROR_X with the new flags?
Good to see this property being unified.
If the default value of the mesh edit remains the same (without symmetry), I see no problem.
Ok, now XYZ symmetry options are shared between vetex paint, texture paint, weight paint, sculpt and edit mode. If everything works correctly, do we want to keep the old flags and RNA properties for something or should I remove and deprecate them?
For compatibility the property could just keep the name use_mirror_x and add use_mirror_y and use_mirror_z? If we want to change the UI as well to symmetry that's possible for consistency, but the Python API doesn't need to break for this I think.
This will also need version patching to keep the existing flag from edit mode, or it could keep using editflag.
Overall it looks good to me.
| release/scripts/startup/bl_ui/space_view3d_toolbar.py | ||
|---|---|---|
| 1093 | This ipaint seems to be no longer used here | |
| source/blender/makesdna/DNA_mesh_types.h | ||
| 267 | I think it would be nice to remove (plus change the value of others and versioning) or rename these ME_EDIT_MIRROR_ flags to ME_FLAG_UNUSED_ since they are no longer used. | |
Looking at the patch, what is the purpose of moving the flags to a new symmetry member, rather than just leaving it in editflag? It seems simpler to just leave things as they were and make sculpting use those flags.
| release/scripts/startup/bl_ui/space_view3d_toolbar.py | ||
|---|---|---|
| 995 | The same mirror X option is now in two places. Previously it was already confusing, but the tooltip for the old option explained that one was for mirroring the brushes. The best solution would be to support Y and Z mirroring everywhere. I haven't checked how complicated that is. If it's too complicated, is there something better we can do here? | |
Looking at the patch, what is the purpose of moving the flags to a new symmetry member, rather than just leaving it in editflag?
I thought that it may be less confusing to have a separate variable and flags for symmetry options that are intended to be supported in all modes. Right now editflag contains flags that are mode specific, like ME_EDIT_PAINT_VERT_SEL.
| release/scripts/startup/bl_ui/space_view3d_toolbar.py | ||
|---|---|---|
| 995 | I'm not familiar with the weight paint tools and with the transform tools, so I'm not sure why it is not supported. I've only seen the Y and Z symmetry flags being used once in the transform code. | |
I personally don't see much issue in having the flags in editflag, but either way is fine.
Initial code review.
| release/scripts/startup/bl_ui/space_view3d_toolbar.py | ||
|---|---|---|
| 1104–1107 | The mesh = context.object.data should be assigned. | |
| source/blender/blenloader/intern/versioning_290.c | ||
| 492–493 | These flags could be cleared at the same time, so we can re-use them later. (their declaration should then have /* cleared */ after it, so we know reusing is safe). | |
| source/blender/makesdna/DNA_mesh_types.h | ||
| 269–270 | These should be named ME_EDITFLAG_UNUSED_*, as we already have ME_FLAG_UNUSED_* for Mesh.flag. | |
This causes changed behavior in weight paint mode where both sculpt symmetry and weight mirror are enabled at once, this makes it impossible to paint onto symmetrically named groups.
Attached video, behavior from master on the left, this patch is on the right.
We could have an option for weight paint to make symmetry apply to Symmetry: [Brush | Vertex Group] since it seems highly unlikely we want to enable both at once.
Also noticed weight-paint will use Y and Z symmetry, if they have been set in other mode.
@Campbell Barton (campbellbarton) In that case, wouldn't it make more sense to add a separate flag for using vertex group symmetry and keep these flags only for brush symmetry to be consistent with the rest of the modes? Should that change be part of this patch?
@Campbell Barton (campbellbarton) Ok, now weight paint should work as expected. There are separate options to control the brush symmetry (using the unified symmetry flags like in any other mode) and the L/R vertex groups symmetry