Page MenuHome

Sculpt: Pose Brush Scale/Transform deform mode
ClosedPublic

Authored by Pablo Dobarro (pablodp606) on Apr 8 2020, 2:31 AM.
Tokens
"Like" token, awarded by TheRedWaxPolice."Love" token, awarded by TheAngerSpecialist."Burninate" token, awarded by lamoot."Love" token, awarded by asmitty."Burninate" token, awarded by thecavelap."Burninate" token, awarded by AnityEx."100" token, awarded by Frozen_Death_Knight.

Details

Summary

This is an alternative deformation brush for the Pose Brush intended
quickly change the proportions of the mesh. The regular mode scales
using the segment's origin as a pivot. The inverted mode drags the
entire segment using the grab delta.

The only difference with the regular pose brush is that it is not
compatible with IK, so the option is disabled and set to 1 segment. The
rest of the options should work as expected.

Diff Detail

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

Event Timeline

Sergey Sharybin (sergey) requested changes to this revision.May 18 2020, 9:35 AM
Sergey Sharybin (sergey) added inline comments.
source/blender/editors/sculpt_paint/sculpt_pose.c
137

const

145–146

unit_qt

153

const

661–663

Why this and only this deformation need single segment?

723–726

This is the same code as above. Consider adding something like:

static int pose_brush_num_effective_segments(const Brush *brush)
{
  /* Explanation why this is a special case goes here. */
  if (brush->pose_deform_type == BRUSH_POSE_DEFORM_SCALE_TRASLATE) {
    return 1;
  }
  return brush->pose_ik_segments;
}

This will also allow to have const qualifier for tot_segments here,

868–873

Avoid cases like

if (condition) {
  // Many lines of code.
}
else {
  // Even more lines of code.
}

Those are two different distinct code paths, which can be easily moved to own functions.

919–921

What is this about?

This revision now requires changes to proceed.May 18 2020, 9:35 AM
Pablo Dobarro (pablodp606) marked 7 inline comments as done.
  • Review Update

From reading the code seems fine, can't spot any obvious issues.
Don't currently have time for user level test, so leaving this up to you ;) If you trust this works as expected go ahead with the commit.

This revision is now accepted and ready to land.May 19 2020, 12:59 PM