Fix #152822: Bone Envelope/Size Tools affect the wrong properties

The Bone Envelope tool now actually edits the Envelope property.
Previously it changed the B-Bone Display Size.

The Bone Size tool now is called B-Bone Size, and actually affects the
B-Bone Size X/Z properties. Previously it edited the bone radius, only
effective in Envelope display mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/155349
This commit is contained in:
Aditya Bharadwaj 2026-06-18 18:01:26 +02:00 • committed by Sybren A. Stüvel
parent 692f3ff518
commit fc0bdbf779
3 changed files with 7 additions and 11 deletions

View file

@ -5759,7 +5759,7 @@ def km_edit_armature(params):
(op_tool_cycle, "builtin.bone_size"), params),
op_tool_optional(
("transform.transform", {"type": 'S', "value": 'PRESS', "alt": True},
{"properties": [("mode", 'BONE_ENVELOPE')]}),
{"properties": [("mode", 'BONE_ENVELOPE_DIST')]}),
(op_tool_cycle, "builtin.bone_envelope"), params),
op_tool_optional(
("transform.transform", {"type": 'R', "value": 'PRESS', "ctrl": True},
@ -7700,11 +7700,11 @@ def km_3d_view_tool_edit_armature_roll(params):
def km_3d_view_tool_edit_armature_bone_size(params):
return (
"3D View Tool: Edit Armature, Bone Size",
"3D View Tool: Edit Armature, B-Bone Size",
{"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
{"items": [
("transform.transform", {**params.tool_maybe_tweak_event, **params.tool_modifier},
{"properties": [("release_confirm", True), ("mode", 'BONE_ENVELOPE')]}),
("transform.bbone_resize", {**params.tool_maybe_tweak_event, **params.tool_modifier},
{"properties": [("release_confirm", True)]}),
]},
)
@ -7715,8 +7715,8 @@ def km_3d_view_tool_edit_armature_bone_envelope(params):
{"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
{"items": [
("transform.bbone_resize", {**params.tool_maybe_tweak_event, **params.tool_modifier},
{"properties": [("release_confirm", True)]}),
("transform.transform", {**params.tool_maybe_tweak_event, **params.tool_modifier},
{"properties": [("release_confirm", True), ("mode", 'BONE_ENVELOPE_DIST')]}),
]},
)

View file

@ -763,7 +763,7 @@ class _defs_edit_armature:
def bone_size():
return dict(
idname="builtin.bone_size",
label="Bone Size",
label="B-Bone Size",
icon="ops.transform.bone_size",
widget="VIEW3D_GGT_tool_generic_handle_free",
keymap=(),

View file

@ -50,10 +50,6 @@ eTfmMode transform_mode_really_used(bContext *C, eTfmMode mode)
if (ob->type != OB_ARMATURE) {
return TFM_RESIZE;
}
bArmature *arm = id_cast<bArmature *>(ob->data);
if (arm->drawtype == ARM_DRAW_TYPE_ENVELOPE) {
return TFM_BONE_ENVELOPE_DIST;
}
}
return mode;