Page MenuHome

Fix T92469: Transform tools inaccessible in weight-paint + pose mode
ClosedPublic

Authored by Campbell Barton (campbellbarton) on Oct 29 2021, 6:41 AM.

Details

Summary

Expose transform tools when in weight paint mode with pose-mode enabled,
displaying transform tools in the toolbar, as is already done in object & pose mode.

These are only shown when weight-paint + pose mode are active at once.

This allows single key-strokes to activate tools, needed when tool-access is set as the default action for G/R/S key bindings.


Screenshot of the toolbar with transform tools in weight+pose mode:

Diff Detail

Repository
rB Blender
Branch
TEMP-POSE-TOOLS (branched from master)
Build Status
Buildable 18305
Build 18305: arc lint + arc unit

Event Timeline

Campbell Barton (campbellbarton) requested review of this revision.Oct 29 2021, 6:41 AM
Campbell Barton (campbellbarton) created this revision.
Campbell Barton (campbellbarton) retitled this revision from Expose transform tools in weight-paint + pose mode to Fix T92469: Show transform tools in weight-paint + pose mode.Oct 29 2021, 6:42 AM
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)

This looks good to me. I can test this further once it lands in master.

This revision is now accepted and ready to land.Nov 2 2021, 9:43 AM

I don't think this works as intended.

  1. Open the attached blend file, which is set up as per the steps in T92469}
  2. Press R to enable rotate mode and rotate by dragging the widget
  3. Press G and see the widget change to the translate widget
  4. Drag an arrow of the widget. It still rotates.

This looks good to me. I can test this further once it lands in master.

Our build bots can build branches & patches as well. I think it's a better idea to use that & test things properly before they land in master.


As for reviewing the code, the _tools dict that things are appended to in this patch is under-documented. There is no indication as to what the keys are, and equally no docs about what the values in the dictionary are. Anonymous lambda functions don't add to the local readability/understandability either. All I can see is that the new code is somewhat similar to the old code, but doing a review so superficially is of little use to anybody.

Sybren A. Stüvel (sybren) requested changes to this revision.Nov 8 2021, 12:24 PM
This revision now requires changes to proceed.Nov 8 2021, 12:24 PM

I don't think this works as intended.

  1. Open the attached blend file, which is set up as per the steps in T92469}
  2. Press R to enable rotate mode and rotate by dragging the widget
  3. Press G and see the widget change to the translate widget
  4. Drag an arrow of the widget. It still rotates.

This is working as intended, connected bones fall back to rotate when they are connected or location is locked, and fallback to scale when rotation is locked.

This is how pose mode gizmos already work (without weight-paint being enabled), so I think it's out of scope for this patch to make changes here.

As for reviewing the code, the _tools dict that things are appended to in this patch is under-documented. There is no indication as to what the keys are, and equally no docs about what the values in the dictionary are. Anonymous lambda functions don't add to the local readability/understandability either. All I can see is that the new code is somewhat similar to the old code, but doing a review so superficially is of little use to anybody.

The _tools are for internal use, to store data to return from tools_from_context and tools_all, committed some code comments noting this as well as notes on the dictionary values.

The new comments help a bit, but the overall design of the code is so far away from what I would find good design, that I really can't comment on whether this change is doing the right thing or not. Because of this, I'll resign as reviewer.

This revision is now accepted and ready to land.Nov 8 2021, 3:05 PM
Campbell Barton (campbellbarton) retitled this revision from Fix T92469: Show transform tools in weight-paint + pose mode to Fix T92469: Transform tools inaccessible in weight-paint + pose mode.Nov 9 2021, 5:44 AM