Page MenuHome

Sculpt: Option to transform only the sculpt pivot
Needs ReviewPublic

Authored by Pablo Dobarro (pablodp606) on Nov 12 2020, 5:46 PM.

Details

Summary

This adds an option to the transform tools in sculpt mode which allows
transforming only the pivot without applying the transformation to the
geometry.

Withtout having the transform gizmo always visible during transform this
is not that useful, but this will allow to start adding more settings
for new features in the transform operator in sculpt mode (deformation
targets, falloffs...).

Diff Detail

Repository
rB Blender
Branch
sculpt-transform-pivot (branched from master)
Build Status
Buildable 11242
Build 11242: arc lint + arc unit

Event Timeline

Pablo Dobarro (pablodp606) requested review of this revision.Nov 12 2020, 5:46 PM
Pablo Dobarro (pablodp606) created this revision.

Will this be supported?

I often parent my objects and these settings are essential.

Sergey Sharybin (sergey) requested changes to this revision.Nov 13 2020, 10:13 AM

To me this seems to be more of a design issue and I am not convinced at this time that this is the right solution. I'm not even sure what the problem is.
Please follow Infringements of a Path, and outline bigger scale problem you're solving, followed with more clear design.

source/blender/editors/sculpt_paint/sculpt_transform.c
132–134

Either the output should happen few lines above, or there is an undocumented dependency between this operator and random access/object update.

source/blender/makesdna/DNA_scene_types.h
2212

Explanation?
What happens? What pivot? Object pivot? Origin?

This revision now requires changes to proceed.Nov 13 2020, 10:13 AM

I'm not even sure what the problem is.

This looks like it solves (partially) a huge problem, which is the ability to freely move/position the transform gizmo/pivot anywhere you want without transforming the mesh... and this is crucial when you need to transform unmasked parts of the mesh from a very specific location etc, which happens a lot during sculpting/posing... Without it we'd need to do some dirty tricks like masking the entire mesh every time we need to position/move the transform gizmo/pivot, which is a no go obviously...

By the way, this is a standard feature in most 3d apps... so it's great to see this coming to blender...

@TheRedWaxPolice (TheRedWaxPolice), sure, but then my questions are:

  • Why is it only planned for the sculpt mode?
  • How can it be used already? Are there any tools which have immediate benefit, or is it preparation for coming changes in tools?

@TheRedWaxPolice (TheRedWaxPolice), sure, but then my questions are:~

  • Why is it only planned for the sculpt mode?

Yeah, I agree with you here... In most 3d apps this is also available in edit mode etc... So yeah, it would be nice to have it globally available...
But still, I guess it wouldn't hurt to have it initially available in sculpt mode as an experimental feature in the meantime?... 🙂

  • How can it be used already? Are there any tools which have immediate benefit, or is it preparation for coming changes in tools?

For me, the main benefit here is really to be able to freely move the transform gizmo/pivot.. that alone is a huge improvement... and it's requested a lot actually...
Now, if other tools could somehow benefit from this too, I'd consider it a nice bonus.. 🙂

Pablo Dobarro (pablodp606) marked an inline comment as done.Nov 20 2020, 12:43 AM

@Sergey Sharybin (sergey) The transform operator in Sculpt Mode does not transform individual elements directly. It can only transform one element, which is called the "Sculpt Pivot" (which is not the same as the object origin or the transform origin). This element is stored as part of the SculptSession. Currently, the transform gizmo will appear in the position of the pivot by default.

When you perform a transformation, the transform operator transforms the location/rotation/scale of the Sculpt Pivot and then Sculpt Mode is responsible for copying the same transformation to all vertices. This copying operation takes into account symmetry, masking and any other sculpt specific features implemented in future patches like elasticity, automasking, cloth sim or collisions. With this design, the transform operator can work like any other brush, it can be multithreaded and optimized like all sculpt tools and the transform code does not have to know about any sculpt specific features.

What this patch does is just adding an option to skip that copying operation, so you are just transforming the pivot without transforming the vertices. It is just the same as masking all vertices and using transform to move the pivot, but exposed more intuitively as many users expect. This feature by itself is not a dependency of anything else.

Of course, there are a lot of UI/UX improvements that can be done to make more clear and usable how the transform tools works in sculpt mode, like showing the gizmo while transforming (so you know where you are moving the pivot), or maybe rendering the pivot as part of the cursor overlay. This is just a first step towards that goal. See T80392

Similar to the tool side of the elastic transform patch, the python code seems suspecious, but i'm not sure if there is a way to make it fitting better into design.

Moving the transform gizmo sounds really useful in combination with D9653: Sculpt: Elastic Transform. It would be nice if there was some more convenient way of quickly moving the transform gizmo without having to dig through menues.

I might be wrong, but I can't think of any usecase where we place and move the 3d cursor. Perhaps the same hotkey used for placing the 3d cursor in EDIT MODE could be used to move the transform gizmo when in SCULPT MODE?

There is already the operator that does that, the only thing that needs to be decided is a keymap entry for it.
Also, after D9622, this functionality can be added as a shortcut that positions the pivot inside of the mesh volume, which is probably the most convenient option in most cases.

I saw we accept this patch.

Here's a rebased diff for latest master.

I tried the rebased patch and it works well. @Joseph Eagar (joeedh) can you update this revision or open a new one? Then we can open this up for review again.