Bone relation lines: draw between axis points #105427
|
@ -80,6 +80,7 @@ class DATA_PT_display(ArmatureButtonsPanel, Panel):
|
|||
sub = row.row(align=True)
|
||||
sub.active = arm.show_axes
|
||||
sub.prop(arm, "axes_position", text="Position")
|
||||
col.prop(arm, "relation_line_position", text="Relations")
|
||||
|
||||
|
||||
class DATA_MT_bone_group_context_menu(Menu):
|
||||
|
|
|
@ -4027,6 +4027,13 @@ void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain)
|
|||
}
|
||||
}
|
||||
|
||||
if (!DNA_struct_elem_find(fd->filesdna, "bArmature", "float", "relation_line_position")) {
|
||||
/* Convert the axes draw position to its default (tip of parent bone). */
|
||||
LISTBASE_FOREACH (bArmature *, arm, &bmain->armatures) {
|
||||
arm->relation_line_position = 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Keep this block, even when empty. */
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2052,7 +2052,7 @@ static void draw_bone_relations(ArmatureDrawContext *ctx,
|
|||
ebone->tail,
|
||||
ebone->parent->head,
|
||||
ebone->parent->tail,
|
||||
arm->axes_position);
|
||||
arm->relation_line_position);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2068,7 +2068,7 @@ static void draw_bone_relations(ArmatureDrawContext *ctx,
|
|||
pchan->pose_tail,
|
||||
pchan->parent->pose_head,
|
||||
pchan->parent->pose_tail,
|
||||
arm->axes_position);
|
||||
arm->relation_line_position);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -143,6 +143,12 @@ typedef struct bArmature {
|
|||
|
||||
/** Relative position of the axes on the bone, from head (0.0f) to tail (1.0f). */
|
||||
float axes_position;
|
||||
|
||||
/** Relative position of the parent-child relation lines on the bone, from
|
||||
* head (0.0f) to tail (1.0f). Only controls the parent side of the line; the
|
||||
* child side is always drawn to the head of the bone. */
|
||||
float relation_line_position;
|
||||
char _pad2[4];
|
||||
} bArmature;
|
||||
|
||||
/* armature->flag */
|
||||
|
|
|
@ -1554,6 +1554,18 @@ static void rna_def_armature(BlenderRNA *brna)
|
|||
"closer to the tip; decreasing moves it closer to the root");
|
||||
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
|
||||
|
||||
prop = RNA_def_property(srna, "relation_line_position", PROP_FLOAT, PROP_FACTOR);
|
||||
RNA_def_property_float_sdna(prop, NULL, "relation_line_position");
|
||||
RNA_def_property_range(prop, 0.0, 1.0);
|
||||
RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 1);
|
||||
RNA_def_property_ui_text(
|
||||
prop,
|
||||
"Relation Line Position",
|
||||
"The start position of the relation lines from parent to child bones. Increasing the value "
|
||||
"moves it "
|
||||
"closer to the tip of the parent; decreasing moves it closer to the root");
|
||||
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
|
||||
|
||||
prop = RNA_def_property(srna, "show_names", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DRAWNAMES);
|
||||
RNA_def_property_ui_text(prop, "Display Names", "Display bone names");
|
||||
|
|
Loading…
Reference in New Issue