72 printf(
"ERROR: armature set active bone - new active doesn't come from this armature\n");
107 "Armature '%s' not in edit mode, cannot add an editbone",
114 static void rna_Armature_edit_bone_remove(
bArmature *arm,
122 "Armature '%s' not in edit mode, cannot remove an editbone",
130 "Armature '%s' does not contain bone '%s'",
223 char name_esc[
sizeof(bone->
name) * 2];
232 return BLI_sprintfN(
"pose.bones[\"%s\"].bone", name_esc);
252 static void rna_bone_layer_set(
int *layer,
const bool *values)
257 for (i = 0; i < 32; i++) {
267 for (i = 0; i < 32; i++) {
272 *layer &= ~(1u << i);
277 static void rna_Bone_layer_set(
PointerRNA *
ptr,
const bool *values)
282 rna_bone_layer_set(&bone->
layer, values);
287 static bool rna_use_inherit_scale_get(
char inherit_scale_mode)
292 static void rna_use_inherit_scale_set(
char *inherit_scale_mode,
bool value)
295 if (value != cur_value) {
300 static bool rna_EditBone_use_inherit_scale_get(
PointerRNA *
ptr)
302 return rna_use_inherit_scale_get(((
EditBone *)
ptr->
data)->inherit_scale_mode);
305 static void rna_EditBone_use_inherit_scale_set(
PointerRNA *
ptr,
bool value)
307 rna_use_inherit_scale_set(&((
EditBone *)
ptr->
data)->inherit_scale_mode, value);
312 return rna_use_inherit_scale_get(((
Bone *)
ptr->
data)->inherit_scale_mode);
315 static void rna_Bone_use_inherit_scale_set(
PointerRNA *
ptr,
bool value)
317 rna_use_inherit_scale_set(&((
Bone *)
ptr->
data)->inherit_scale_mode, value);
320 static void rna_Armature_layer_set(
PointerRNA *
ptr,
const bool *values)
326 for (i = 0; i < 32; i++) {
336 for (i = 0; i < 32; i++) {
338 arm->
layer |= (1u << i);
341 arm->
layer &= ~(1u << i);
346 static void rna_EditBone_name_set(
PointerRNA *
ptr,
const char *value)
350 char oldname[
sizeof(ebone->
name)], newname[
sizeof(ebone->
name)];
360 static void rna_Bone_name_set(
PointerRNA *
ptr,
const char *value)
364 char oldname[
sizeof(bone->
name)], newname[
sizeof(bone->
name)];
374 static void rna_EditBone_layer_set(
PointerRNA *
ptr,
const bool values[])
377 rna_bone_layer_set(&
data->layer, values);
380 static void rna_EditBone_connected_check(
EditBone *ebone)
397 static void rna_EditBone_connected_set(
PointerRNA *
ptr,
bool value)
408 rna_EditBone_connected_check(ebone);
439 if (parbone == ebone) {
443 for (pbone = parbone->
parent; pbone; pbone = pbone->
parent) {
444 if (pbone == ebone) {
450 rna_EditBone_connected_check(ebone);
454 static void rna_EditBone_matrix_get(
PointerRNA *
ptr,
float *values)
460 static void rna_EditBone_matrix_set(
PointerRNA *
ptr,
const float *values)
494 if (obt->data == arm && obt->pose) {
497 if (pchan && pchan->
bone == bone) {
504 rna_Armature_dependency_update(bmain,
scene,
ptr);
593 rna_Armature_update_data(bmain,
scene,
ptr);
599 Bone *bone = (
Bone *)internal->link;
604 else if (bone->
next) {
605 internal->link = (
Link *)bone->
next;
608 internal->link =
NULL;
612 if (bone && bone->
next) {
613 internal->link = (
Link *)bone->
next;
642 static void rna_Armature_transform(
bArmature *arm,
float mat[16])
653 # define RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone) \
656 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); \
658 else if (is_editbone) { \
659 RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update"); \
662 RNA_def_property_update(prop, 0, "rna_Armature_update_data"); \
674 prop,
"Roll In",
"Roll offset for the start of the B-Bone, adjusts twist");
681 prop,
"Roll Out",
"Roll offset for the end of the B-Bone, adjusts twist");
684 if (is_posebone ==
false) {
687 prop,
"Inherit End Roll",
"Add Roll Out of the Start Handle bone to the Roll In value");
698 prop,
"In X",
"X-axis handle offset for start of the B-Bone's curve, adjusts curvature");
705 prop,
"In Z",
"Z-axis handle offset for start of the B-Bone's curve, adjusts curvature");
712 prop,
"Out X",
"X-axis handle offset for end of the B-Bone's curve, adjusts curvature");
719 prop,
"Out Z",
"Z-axis handle offset for end of the B-Bone's curve, adjusts curvature");
737 if (is_posebone ==
false) {
740 prop,
"Scale Easing",
"Multiply the final easing values by the Scale In/Out Y factors");
755 "Scale factors for the start of the B-Bone, adjusts thickness (for tapering effects)");
767 "Scale factors for the end of the B-Bone, adjusts thickness (for tapering effects)");
770 # undef RNA_DEF_CURVEBONE_UPDATE
780 "Use connected parent and children to compute the handle"},
785 "Use the position of the specified bone to compute the handle"},
790 "Use the offset of the specified bone from rest pose to compute the handle"},
795 "Use the orientation of the specified bone to compute the handle, ignoring the location"},
805 "Inherit scaling, but remove shearing of the child in the rest orientation"},
810 "Rotate non-uniform parent scaling to align with the child, applying parent X "
811 "scale to child X axis, and so forth"},
816 "Inherit uniform scaling representing the overall change in the volume of the parent"},
822 "Ignore parent scaling without compensating for parent shear. "
823 "Replicates the effect of disabling the original Inherit Scale checkbox"},
866 prop,
"Connected",
"When bone has a parent, bone's head is stuck to the parent's tail");
872 prop,
"Inherit Rotation",
"Bone inherits rotation or scale from parent bone");
879 "Multiply Vertex Group with Envelope",
880 "When deforming bone, multiply effects of Vertex Group weights with Envelope influence");
890 prop,
"Inherit Scale",
"Specifies how the bone inherits scaling from the parent bone");
898 prop,
"Inherit Scale",
"DEPRECATED: Bone inherits scaling from parent bone");
901 prop,
"rna_EditBone_use_inherit_scale_get",
"rna_EditBone_use_inherit_scale_set");
905 prop,
"rna_Bone_use_inherit_scale_get",
"rna_Bone_use_inherit_scale_set");
916 prop,
"Relative Parenting",
"Object children will use relative transform, like deform");
925 "Bone is always displayed in wireframe regardless of viewport shading mode "
926 "(useful for non-obstructive custom bone shapes)");
935 "When bone doesn't have a parent, it receives cyclic offset effects (Deprecated)");
956 prop,
"Envelope Deform Distance",
"Bone deformation distance (for Envelope deform only)");
962 prop,
"Envelope Deform Weight",
"Bone deformation weight (for Envelope deform only)");
977 prop,
"Envelope Head Radius",
"Radius of head of bone (for Envelope deform only)");
991 prop,
"Envelope Tail Radius",
"Radius of tail of bone (for Envelope deform only)");
1004 prop,
"B-Bone Segments",
"Number of subdivisions of bone (for B-Bones only)");
1034 prop,
"B-Bone Start Handle Type",
"Selects how the start handle of the B-Bone is computed");
1042 prop,
"rna_EditBone_bbone_prev_get",
"rna_EditBone_bbone_prev_set",
NULL,
NULL);
1052 prop,
"B-Bone Start Handle",
"Bone that serves as the start handle for the B-Bone curve");
1057 "Start Handle Scale",
1058 "Multiply B-Bone Scale In channels by the local scale values of the start handle. "
1059 "This is done after the Scale Easing option and isn't affected by it");
1067 "Start Handle Ease",
1068 "Multiply the B-Bone Ease In channel by the local Y scale value of the start handle. "
1069 "This is done after the Scale Easing option and isn't affected by it");
1079 prop,
"B-Bone End Handle Type",
"Selects how the end handle of the B-Bone is computed");
1087 prop,
"rna_EditBone_bbone_next_get",
"rna_EditBone_bbone_next_set",
NULL,
NULL);
1097 prop,
"B-Bone End Handle",
"Bone that serves as the end handle for the B-Bone curve");
1103 "Multiply B-Bone Scale Out channels by the local scale values of the end handle. "
1104 "This is done after the Scale Easing option and isn't affected by it");
1113 "Multiply the B-Bone Ease Out channel by the local Y scale value of the end handle. "
1114 "This is done after the Scale Easing option and isn't affected by it");
1161 "Bone is not visible when it is not in Edit Mode (i.e. in Object or Pose Modes)");
1197 prop,
"Bone Armature-Relative Matrix",
"4x4 bone matrix relative to armature");
1204 prop,
"Tail",
"Location of tail end of the bone relative to its parent");
1212 prop,
"Armature-Relative Tail",
"Location of tail end of the bone relative to armature");
1220 prop,
"Head",
"Location of head end of the bone relative to its parent");
1228 prop,
"Armature-Relative Head",
"Location of head end of the bone relative to armature");
1257 prop,
"rna_EditBone_parent_get",
"rna_EditBone_parent_set",
NULL,
NULL);
1335 "Matrix combining location and rotation of the bone (head position, direction and roll), "
1336 "in armature space (does not include/support bone's length/size)");
1398 parm =
RNA_def_string(func,
"name",
"Object", 0,
"",
"New name for the bone");
1401 parm =
RNA_def_pointer(func,
"bone",
"EditBone",
"",
"Newly created edit bone");
1409 parm =
RNA_def_pointer(func,
"bone",
"EditBone",
"",
"EditBone to remove");
1423 {
ARM_OCTA,
"OCTAHEDRAL", 0,
"Octahedral",
"Display bones as octahedral shape (default)"},
1424 {
ARM_LINE,
"STICK", 0,
"Stick",
"Display bones as simple 2D lines with dots"},
1429 "Display bones as boxes, showing subdivision and B-Splines"},
1434 "Display bones as extruded spheres, showing deformation influence volume"},
1439 "Display bones as thin wires, showing subdivision and B-Splines"},
1443 {0,
"POSE", 0,
"Pose Position",
"Show armature in posed state"},
1448 "Show Armature in binding pose state (no posing possible)"},
1456 "Armature data-block containing a hierarchy of bones, usually used for rigging characters");
1462 parm =
RNA_def_float_matrix(func,
"matrix", 4, 4,
NULL, 0.0f, 0.0f,
"",
"Matrix", 0.0f, 0.0f);
1475 "rna_Armature_bones_next",
1480 "rna_Armature_bones_lookup_string",
1497 prop,
"Pose Position",
"Show armature in binding pose or final posed state");
1523 "Layer Proxy Protection",
1524 "Protected layers in Proxy Instances are restored to Proxy settings "
1525 "on file reload and undo");
1541 "The position for the axes on the bone. Increasing the value moves it "
1542 "closer to the tip; decreasing moves it closer to the root");
1554 prop,
"X-Axis Mirror",
"Apply changes to matching bone on opposite side of X-Axis");
1561 prop,
"Display Custom Bone Shapes",
"Display bones with their custom shapes");
Blender kernel action and pose functionality.
struct bPoseChannel * BKE_pose_channel_find_name(const struct bPose *pose, const char *name)
struct Bone * BKE_armature_find_bone_name(struct bArmature *arm, const char *name)
void BKE_armature_refresh_layer_used(struct Depsgraph *depsgraph, struct bArmature *arm)
void BKE_pchan_rebuild_bbone_handles(struct bPose *pose, struct bPoseChannel *pchan)
bool BKE_id_is_in_global_main(struct ID *id)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float normalize_v3(float r[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f)
size_t size_t char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
size_t size_t char size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL()
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL(1
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
@ ID_RECALC_COPY_ON_WRITE
@ BONE_RELATIVE_PARENTING
@ BBONE_ADD_PARENT_END_ROLL
@ BBONE_HANDLE_SCALE_EASE
@ BONE_INHERIT_SCALE_FULL
@ BONE_INHERIT_SCALE_NONE
@ BONE_INHERIT_SCALE_FIX_SHEAR
@ BONE_INHERIT_SCALE_NONE_LEGACY
@ BONE_INHERIT_SCALE_ALIGNED
@ BONE_INHERIT_SCALE_AVERAGE
Object is a sort of wrapper for general info.
#define RNA_POINTER_INVALIDATE(ptr)
#define RNA_TRANSLATION_PREC_DEFAULT
@ PROPOVERRIDE_NO_COMPARISON
EditBone * ED_armature_ebone_add(bArmature *arm, const char *name)
void ED_armature_transform(bArmature *arm, const float mat[4][4], const bool do_props)
void ED_armature_bone_rename(Main *bmain, bArmature *arm, const char *oldnamep, const char *newnamep)
void ED_armature_ebone_transform_mirror_update(bArmature *arm, EditBone *ebo, bool check_select)
void ED_armature_ebone_to_mat4(EditBone *ebone, float r_mat[4][4])
void ED_armature_ebone_remove(bArmature *arm, EditBone *exBone)
void ED_armature_ebone_from_mat4(EditBone *ebone, const float mat[4][4])
return(oflags[bm->toolflag_index].f &oflag) !=0
T length(const vec_base< T, Size > &a)
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
PointerRNA rna_pointer_inherit_refine(PointerRNA *ptr, StructRNA *type, void *data)
void rna_def_animdata_common(StructRNA *srna)
void RNA_def_armature(BlenderRNA *brna)
static void rna_def_bone(BlenderRNA *brna)
#define RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone)
static void rna_def_bone_common(StructRNA *srna, int editbone)
static void rna_def_edit_bone(BlenderRNA *brna)
static void rna_def_armature(BlenderRNA *brna)
static void rna_def_armature_edit_bones(BlenderRNA *brna, PropertyRNA *cprop)
void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone, bool is_editbone)
static void rna_def_armature_bones(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_api_armature_edit_bone(StructRNA *srna)
void RNA_api_bone(StructRNA *srna)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_define_lib_overridable(const bool make_overridable)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_property_float_default(PropertyRNA *prop, float value)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
PropertyRNA * RNA_def_float_matrix(StructOrFunctionRNA *cont_, const char *identifier, int rows, int columns, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_define_verify_sdna(bool verify)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
const float rna_default_scale_3d[3]
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int length[])
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
const int rna_matrix_dimsize_4x4[]
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_struct_name_property(struct StructRNA *srna, struct PropertyRNA *prop)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
const int rna_matrix_dimsize_3x3[]
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_struct_idprops_func(StructRNA *srna, const char *idproperties)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
ListBaseIterator listbase
union CollectionPropertyIterator::@1147 internal
struct EditBone * bbone_next
struct EditBone * bbone_prev
struct EditBone * act_edbone
void WM_main_add_notifier(unsigned int type, void *reference)