Revert "Cleanup: armature bone display type naming"

This reverts commit 2149f462d4 (broke Windows x64 compilation on CI).

Pull Request: https://projects.blender.org/blender/blender/pulls/138994
This commit is contained in:
Thomas Dinges
2025-05-16 21:01:41 +02:00
committed by Aras Pranckevicius
parent 0d7e958006
commit cef7cb4534
10 changed files with 36 additions and 40 deletions

View File

@@ -4343,7 +4343,7 @@ static void version_set_default_bone_drawtype(Main *bmain)
{
LISTBASE_FOREACH (bArmature *, arm, &bmain->armatures) {
blender::animrig::ANIM_armature_foreach_bone(
&arm->bonebase, [](Bone *bone) { bone->drawtype = ARM_DRAW_TYPE_ARMATURE_DEFINED; });
&arm->bonebase, [](Bone *bone) { bone->drawtype = ARM_BONE_DEFAULT; });
BLI_assert_msg(!arm->edbo, "Armatures should not be saved in edit mode");
}
}

View File

@@ -1246,7 +1246,7 @@ static void draw_points(const Armatures::DrawContext *ctx,
copy_v4_v4(col_wire_root, (ctx->const_color) ? ctx->const_color : &theme.colors.vert.x);
copy_v4_v4(col_wire_tail, (ctx->const_color) ? ctx->const_color : &theme.colors.vert.x);
const bool is_envelope_draw = (ctx->drawtype == ARM_DRAW_TYPE_ENVELOPE);
const bool is_envelope_draw = (ctx->drawtype == ARM_ENVELOPE);
const float envelope_ignore = -1.0f;
col_wire_tail[3] = col_wire_root[3] = get_bone_wire_thickness(ctx, boneflag);
@@ -1574,19 +1574,19 @@ static void bone_draw(const eArmature_Drawtype drawtype,
}
switch (drawtype) {
case ARM_DRAW_TYPE_OCTA:
case ARM_OCTA:
bone_draw_octa(ctx, bone, boneflag, select_id);
break;
case ARM_DRAW_TYPE_STICK:
case ARM_LINE:
bone_draw_line(ctx, bone, boneflag, select_id);
break;
case ARM_DRAW_TYPE_B_BONE:
case ARM_B_BONE:
bone_draw_b_bone(ctx, bone, boneflag, select_id);
break;
case ARM_DRAW_TYPE_ENVELOPE:
case ARM_ENVELOPE:
bone_draw_envelope(ctx, bone, boneflag, select_id);
break;
case ARM_DRAW_TYPE_WIRE:
case ARM_WIRE:
bone_draw_wire(ctx, bone, boneflag, select_id);
break;
default:
@@ -1865,7 +1865,7 @@ static void bone_draw_update_display_matrix(const eArmature_Drawtype drawtype,
if (use_custom_shape) {
draw_bone_update_disp_matrix_custom_shape(bone);
}
else if (ELEM(drawtype, ARM_DRAW_TYPE_B_BONE, ARM_DRAW_TYPE_WIRE)) {
else if (ELEM(drawtype, ARM_B_BONE, ARM_WIRE)) {
draw_bone_update_disp_matrix_bbone(bone);
}
else {
@@ -1926,7 +1926,7 @@ void Armatures::draw_armature_edit(Armatures::DrawContext *ctx)
draw_bone_relations(ctx, bone, boneflag);
}
const eArmature_Drawtype drawtype = eBone->drawtype == ARM_DRAW_TYPE_ARMATURE_DEFINED ?
const eArmature_Drawtype drawtype = eBone->drawtype == ARM_BONE_DEFAULT ?
arm_drawtype :
eArmature_Drawtype(eBone->drawtype);
bone_draw_update_display_matrix(drawtype, false, bone);
@@ -2060,7 +2060,7 @@ void Armatures::draw_armature_pose(Armatures::DrawContext *ctx)
draw_bone_relations(ctx, bone_ptr, boneflag);
}
const eArmature_Drawtype drawtype = bone->drawtype == ARM_DRAW_TYPE_ARMATURE_DEFINED ?
const eArmature_Drawtype drawtype = bone->drawtype == ARM_BONE_DEFAULT ?
arm_drawtype :
eArmature_Drawtype(bone->drawtype);
bone_draw_update_display_matrix(drawtype, use_custom_shape, bone_ptr);

View File

@@ -478,7 +478,7 @@ class Armatures : Overlay {
/* Note: can be mutated inside `draw_armature_pose()`. */
eArmatureDrawMode draw_mode = ARM_DRAW_MODE_OBJECT;
eArmature_Drawtype drawtype = ARM_DRAW_TYPE_OCTA;
eArmature_Drawtype drawtype = ARM_OCTA;
Armatures::BoneBuffers *bone_buf = nullptr;
Resources *res = nullptr;

View File

@@ -70,7 +70,7 @@ EditBone *ED_armature_ebone_add(bArmature *arm, const char *name)
BLI_addtail(arm->edbo, bone);
bone->flag |= BONE_TIPSEL;
bone->drawtype = ARM_DRAW_TYPE_ARMATURE_DEFINED;
bone->drawtype = ARM_BONE_DEFAULT;
bone->weight = 1.0f;
bone->dist = 0.25f;
bone->xwidth = 0.1f;

View File

@@ -2805,7 +2805,7 @@ static Object *modifier_skin_armature_create(Depsgraph *depsgraph, Main *bmain,
bArmature *arm = static_cast<bArmature *>(arm_ob->data);
ANIM_armature_bonecoll_show_all(arm);
arm_ob->dtx |= OB_DRAW_IN_FRONT;
arm->drawtype = ARM_DRAW_TYPE_STICK;
arm->drawtype = ARM_LINE;
arm->edbo = MEM_callocN<ListBase>("edbo armature");
MVertSkin *mvert_skin = static_cast<MVertSkin *>(

View File

@@ -117,7 +117,7 @@ static bool WIDGETGROUP_armature_spline_poll(const bContext *C, wmGizmoGroupType
Object *ob = BKE_object_pose_armature_get(base->object);
if (ob) {
const bArmature *arm = static_cast<const bArmature *>(ob->data);
if (arm->drawtype == ARM_DRAW_TYPE_B_BONE) {
if (arm->drawtype == ARM_B_BONE) {
bPoseChannel *pchan = BKE_pose_channel_active_if_bonecoll_visible(ob);
if (pchan && pchan->bone->segments > 1) {
return true;

View File

@@ -45,7 +45,7 @@ eTfmMode transform_mode_really_used(bContext *C, eTfmMode mode)
return TFM_RESIZE;
}
bArmature *arm = static_cast<bArmature *>(ob->data);
if (arm->drawtype == ARM_DRAW_TYPE_ENVELOPE) {
if (arm->drawtype == ARM_ENVELOPE) {
return TFM_BONE_ENVELOPE_DIST;
}
}

View File

@@ -15,12 +15,12 @@
.deformflag = ARM_DEF_VGROUP | ARM_DEF_ENVELOPE, \
.flag = ARM_COL_CUSTOM, /* custom bone-group colors */ \
.layer = 1, \
.drawtype = ARM_DRAW_TYPE_OCTA, \
.drawtype = ARM_OCTA, \
}
#define _DNA_DEFAULT_Bone \
{ \
.drawtype = ARM_DRAW_TYPE_ARMATURE_DEFINED, \
.drawtype = ARM_BONE_DEFAULT, \
}
/* clang-format on */

View File

@@ -374,12 +374,12 @@ typedef enum eArmature_Flag {
/* armature->drawtype */
typedef enum eArmature_Drawtype {
ARM_DRAW_TYPE_ARMATURE_DEFINED = -1, /* Use draw type from Armature (only used on Bones). */
ARM_DRAW_TYPE_OCTA = 0,
ARM_DRAW_TYPE_STICK = 1,
ARM_DRAW_TYPE_B_BONE = 2,
ARM_DRAW_TYPE_ENVELOPE = 3,
ARM_DRAW_TYPE_WIRE = 4,
ARM_BONE_DEFAULT = -1, /* Use draw type from Armature (only used on Bones). */
ARM_OCTA = 0,
ARM_LINE = 1,
ARM_B_BONE = 2,
ARM_ENVELOPE = 3,
ARM_WIRE = 4,
} eArmature_Drawtype;
/* armature->deformflag */

View File

@@ -1364,24 +1364,24 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
};
static const EnumPropertyItem prop_drawtype_items[] = {
{ARM_DRAW_TYPE_ARMATURE_DEFINED,
"ARMATURE_DEFINED",
{ARM_BONE_DEFAULT,
"USE_ARMATURE_SETTING",
0,
"Armature Defined",
"Use Armature Setting",
"Use display mode from armature (default)"},
{ARM_DRAW_TYPE_OCTA, "OCTAHEDRAL", 0, "Octahedral", "Display bones as octahedral shape"},
{ARM_DRAW_TYPE_STICK, "STICK", 0, "Stick", "Display bones as simple 2D lines with dots"},
{ARM_DRAW_TYPE_B_BONE,
{ARM_OCTA, "OCTAHEDRAL", 0, "Octahedral", "Display bones as octahedral shape"},
{ARM_LINE, "STICK", 0, "Stick", "Display bones as simple 2D lines with dots"},
{ARM_B_BONE,
"BBONE",
0,
"B-Bone",
"Display bones as boxes, showing subdivision and B-Splines"},
{ARM_DRAW_TYPE_ENVELOPE,
{ARM_ENVELOPE,
"ENVELOPE",
0,
"Envelope",
"Display bones as extruded spheres, showing deformation influence volume"},
{ARM_DRAW_TYPE_WIRE,
{ARM_WIRE,
"WIRE",
0,
"Wire",
@@ -2158,23 +2158,19 @@ static void rna_def_armature(BlenderRNA *brna)
PropertyRNA *parm;
static const EnumPropertyItem prop_drawtype_items[] = {
{ARM_DRAW_TYPE_OCTA,
"OCTAHEDRAL",
0,
"Octahedral",
"Display bones as octahedral shape (default)"},
{ARM_DRAW_TYPE_STICK, "STICK", 0, "Stick", "Display bones as simple 2D lines with dots"},
{ARM_DRAW_TYPE_B_BONE,
{ARM_OCTA, "OCTAHEDRAL", 0, "Octahedral", "Display bones as octahedral shape (default)"},
{ARM_LINE, "STICK", 0, "Stick", "Display bones as simple 2D lines with dots"},
{ARM_B_BONE,
"BBONE",
0,
"B-Bone",
"Display bones as boxes, showing subdivision and B-Splines"},
{ARM_DRAW_TYPE_ENVELOPE,
{ARM_ENVELOPE,
"ENVELOPE",
0,
"Envelope",
"Display bones as extruded spheres, showing deformation influence volume"},
{ARM_DRAW_TYPE_WIRE,
{ARM_WIRE,
"WIRE",
0,
"Wire",