86 printf(
"ERROR: armature set active bone - new active doesn't come from this armature\n");
121 "Armature '%s' not in edit mode, cannot add an editbone",
128 static void rna_Armature_edit_bone_remove(
bArmature *arm,
136 "Armature '%s' not in edit mode, cannot remove an editbone",
144 "Armature '%s' does not contain bone '%s'",
162 if (ob->data == arm && ob->pose) {
246 char name_esc[
sizeof(bone->
name) * 2];
255 return BLI_sprintfN(
"pose.bones[\"%s\"].bone", name_esc);
267 if (create && !bone->
prop) {
279 if (create && !ebone->
prop) {
287 static void rna_bone_layer_set(
int *layer,
const bool *values)
292 for (i = 0; i < 32; i++) {
302 for (i = 0; i < 32; i++) {
307 *layer &= ~(1u << i);
312 static void rna_Bone_layer_set(
PointerRNA *
ptr,
const bool *values)
317 rna_bone_layer_set(&bone->
layer, values);
322 static bool rna_use_inherit_scale_get(
char inherit_scale_mode)
327 static void rna_use_inherit_scale_set(
char *inherit_scale_mode,
bool value)
330 if (value != cur_value) {
335 static bool rna_EditBone_use_inherit_scale_get(
PointerRNA *
ptr)
337 return rna_use_inherit_scale_get(((
EditBone *)
ptr->
data)->inherit_scale_mode);
340 static void rna_EditBone_use_inherit_scale_set(
PointerRNA *
ptr,
bool value)
342 rna_use_inherit_scale_set(&((
EditBone *)
ptr->
data)->inherit_scale_mode, value);
347 return rna_use_inherit_scale_get(((
Bone *)
ptr->
data)->inherit_scale_mode);
350 static void rna_Bone_use_inherit_scale_set(
PointerRNA *
ptr,
bool value)
352 rna_use_inherit_scale_set(&((
Bone *)
ptr->
data)->inherit_scale_mode, value);
355 static void rna_Armature_layer_set(
PointerRNA *
ptr,
const bool *values)
361 for (i = 0; i < 32; i++) {
371 for (i = 0; i < 32; i++) {
373 arm->
layer |= (1u << i);
376 arm->
layer &= ~(1u << i);
381 static void rna_EditBone_name_set(
PointerRNA *
ptr,
const char *value)
385 char oldname[
sizeof(ebone->
name)], newname[
sizeof(ebone->
name)];
395 static void rna_Bone_name_set(
PointerRNA *
ptr,
const char *value)
399 char oldname[
sizeof(bone->
name)], newname[
sizeof(bone->
name)];
409 static void rna_EditBone_layer_set(
PointerRNA *
ptr,
const bool values[])
412 rna_bone_layer_set(&
data->layer, values);
415 static void rna_EditBone_connected_check(
EditBone *ebone)
432 static void rna_EditBone_connected_set(
PointerRNA *
ptr,
bool value)
443 rna_EditBone_connected_check(ebone);
474 if (parbone == ebone) {
478 for (pbone = parbone->
parent; pbone; pbone = pbone->
parent) {
479 if (pbone == ebone) {
485 rna_EditBone_connected_check(ebone);
489 static void rna_EditBone_matrix_get(
PointerRNA *
ptr,
float *values)
495 static void rna_EditBone_matrix_set(
PointerRNA *
ptr,
const float *values)
529 if (obt->data == arm && obt->pose) {
532 if (pchan && pchan->
bone == bone) {
539 rna_Armature_dependency_update(bmain,
scene,
ptr);
628 rna_Armature_update_data(bmain,
scene,
ptr);
634 Bone *bone = (
Bone *)internal->link;
639 else if (bone->
next) {
640 internal->link = (
Link *)bone->
next;
643 internal->link =
NULL;
647 if (bone && bone->
next) {
648 internal->link = (
Link *)bone->
next;
677 static void rna_Armature_transform(
bArmature *arm,
float *mat)
688 # define RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone, is_editbone) \
691 RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); \
693 else if (is_editbone) { \
694 RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update"); \
697 RNA_def_property_update(prop, 0, "rna_Armature_update_data"); \
709 prop,
"Roll In",
"Roll offset for the start of the B-Bone, adjusts twist");
716 prop,
"Roll Out",
"Roll offset for the end of the B-Bone, adjusts twist");
719 if (is_posebone ==
false) {
722 prop,
"Inherit End Roll",
"Add Roll Out of the Start Handle bone to the Roll In value");
733 prop,
"In X",
"X-axis handle offset for start of the B-Bone's curve, adjusts curvature");
740 prop,
"In Y",
"Y-axis handle offset for start of the B-Bone's curve, adjusts curvature");
747 prop,
"Out X",
"X-axis handle offset for end of the B-Bone's curve, adjusts curvature");
754 prop,
"Out Y",
"Y-axis handle offset for end of the B-Bone's curve, adjusts curvature");
780 "X-axis scale factor for start of the B-Bone, "
781 "adjusts thickness (for tapering effects)");
791 "Y-axis scale factor for start of the B-Bone, "
792 "adjusts thickness (for tapering effects)");
802 "X-axis scale factor for end of the B-Bone, "
803 "adjusts thickness (for tapering effects)");
813 "Y-axis scale factor for end of the B-Bone, "
814 "adjusts thickness (for tapering effects)");
817 # undef RNA_DEF_CURVEBONE_UPDATE
827 "Use connected parent and children to compute the handle"},
832 "Use the position of the specified bone to compute the handle"},
837 "Use the offset of the specified bone from rest pose to compute the handle"},
842 "Use the orientation of the specified bone to compute the handle, ignoring the location"},
852 "Inherit scaling, but remove shearing of the child in the rest orientation"},
857 "Rotate non-uniform parent scaling to align with the child, applying parent X "
858 "scale to child X axis, and so forth"},
863 "Inherit uniform scaling representing the overall change in the volume of the parent"},
869 "Ignore parent scaling without compensating for parent shear. "
870 "Replicates the effect of disabling the original Inherit Scale checkbox"},
913 prop,
"Connected",
"When bone has a parent, bone's head is stuck to the parent's tail");
919 prop,
"Inherit Rotation",
"Bone inherits rotation or scale from parent bone");
926 "Multiply Vertex Group with Envelope",
927 "When deforming bone, multiply effects of Vertex Group weights with Envelope influence");
937 prop,
"Inherit Scale",
"Specifies how the bone inherits scaling from the parent bone");
945 prop,
"Inherit Scale",
"DEPRECATED: Bone inherits scaling from parent bone");
948 prop,
"rna_EditBone_use_inherit_scale_get",
"rna_EditBone_use_inherit_scale_set");
952 prop,
"rna_Bone_use_inherit_scale_get",
"rna_Bone_use_inherit_scale_set");
963 prop,
"Relative Parenting",
"Object children will use relative transform, like deform");
972 "Bone is always displayed in wireframe regardless of viewport shading mode "
973 "(useful for non-obstructive custom bone shapes)");
982 "When bone doesn't have a parent, it receives cyclic offset effects (Deprecated)");
1003 prop,
"Envelope Deform Distance",
"Bone deformation distance (for Envelope deform only)");
1009 prop,
"Envelope Deform Weight",
"Bone deformation weight (for Envelope deform only)");
1024 prop,
"Envelope Head Radius",
"Radius of head of bone (for Envelope deform only)");
1038 prop,
"Envelope Tail Radius",
"Radius of tail of bone (for Envelope deform only)");
1051 prop,
"B-Bone Segments",
"Number of subdivisions of bone (for B-Bones only)");
1080 prop,
"B-Bone Start Handle Type",
"Selects how the start handle of the B-Bone is computed");
1088 prop,
"rna_EditBone_bbone_prev_get",
"rna_EditBone_bbone_prev_set",
NULL,
NULL);
1097 prop,
"B-Bone Start Handle",
"Bone that serves as the start handle for the B-Bone curve");
1104 prop,
"B-Bone End Handle Type",
"Selects how the end handle of the B-Bone is computed");
1112 prop,
"rna_EditBone_bbone_next_get",
"rna_EditBone_bbone_next_set",
NULL,
NULL);
1121 prop,
"B-Bone End Handle",
"Bone that serves as the end handle for the B-Bone curve");
1166 "Bone is not visible when it is not in Edit Mode (i.e. in Object or Pose Modes)");
1202 prop,
"Bone Armature-Relative Matrix",
"4x4 bone matrix relative to armature");
1209 prop,
"Tail",
"Location of tail end of the bone relative to its parent");
1217 prop,
"Armature-Relative Tail",
"Location of tail end of the bone relative to armature");
1225 prop,
"Head",
"Location of head end of the bone relative to its parent");
1233 prop,
"Armature-Relative Head",
"Location of head end of the bone relative to armature");
1262 prop,
"rna_EditBone_parent_get",
"rna_EditBone_parent_set",
NULL,
NULL);
1340 "Matrix combining location and rotation of the bone (head position, direction and roll), "
1341 "in armature space (does not include/support bone's length/size)");
1403 parm =
RNA_def_string(func,
"name",
"Object", 0,
"",
"New name for the bone");
1406 parm =
RNA_def_pointer(func,
"bone",
"EditBone",
"",
"Newly created edit bone");
1414 parm =
RNA_def_pointer(func,
"bone",
"EditBone",
"",
"EditBone to remove");
1428 {
ARM_OCTA,
"OCTAHEDRAL", 0,
"Octahedral",
"Display bones as octahedral shape (default)"},
1429 {
ARM_LINE,
"STICK", 0,
"Stick",
"Display bones as simple 2D lines with dots"},
1434 "Display bones as boxes, showing subdivision and B-Splines"},
1439 "Display bones as extruded spheres, showing deformation influence volume"},
1444 "Display bones as thin wires, showing subdivision and B-Splines"},
1448 {0,
"POSE", 0,
"Pose Position",
"Show armature in posed state"},
1453 "Show Armature in binding pose state (no posing possible)"},
1461 "Armature data-block containing a hierarchy of bones, usually used for rigging characters");
1467 parm =
RNA_def_float_matrix(func,
"matrix", 4, 4,
NULL, 0.0f, 0.0f,
"",
"Matrix", 0.0f, 0.0f);
1480 "rna_Armature_bones_next",
1485 "rna_Armature_bones_lookup_string",
1502 prop,
"Pose Position",
"Show armature in binding pose or final posed state");
1528 "Layer Proxy Protection",
1529 "Protected layers in Proxy Instances are restored to Proxy settings "
1530 "on file reload and undo");
1546 "The position for the axes on the bone. Increasing the value moves it "
1547 "closer to the tip; decreasing moves it closer to the root");
1559 prop,
"X-Axis Mirror",
"Apply changes to matching bone on opposite side of X-Axis");
1566 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)
struct IDProperty * IDP_New(const char type, const IDPropertyTemplate *val, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
bool BKE_id_is_in_global_main(struct ID *id)
void BKE_reportf(ReportList *reports, ReportType 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
size_t size_t char size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, const size_t dst_maxncpy) ATTR_NONNULL()
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
@ ID_RECALC_COPY_ON_WRITE
@ BONE_ADD_PARENT_END_ROLL
@ BONE_RELATIVE_PARENTING
@ 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
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
SIMD_FORCE_INLINE btScalar length(const btQuaternion &q)
Return the length of a quaternion.
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)
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_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
union CollectionPropertyIterator::@1099 internal
ListBaseIterator listbase
struct EditBone * bbone_next
struct EditBone * bbone_prev
struct EditBone * act_edbone
void WM_main_add_notifier(unsigned int type, void *reference)