37static void rna_EditBone_align_roll(
EditBone *ebo,
const float no[3])
43static float rna_Bone_do_envelope(
Bone *bone,
const float vec[3])
49 bone->rad_head *
scale,
50 bone->rad_tail *
scale,
54static void rna_Bone_convert_local_to_pose(
Bone *bone,
56 const float matrix[16],
57 const float matrix_local[16],
58 const float parent_matrix[16],
59 const float parent_matrix_local[16],
63 float offs_bone[4][4];
64 float (*bone_arm_mat)[4] =
reinterpret_cast<float (*)[4]
>(
const_cast<float *
>(matrix_local));
65 float (*parent_pose_mat)[4] =
reinterpret_cast<float (*)[4]
>(
const_cast<float *
>(parent_matrix));
66 float (*parent_arm_mat)[4] =
reinterpret_cast<float (*)[4]
>(
67 const_cast<float *
>(parent_matrix_local));
72 bone->flag, bone->inherit_scale_mode, bone_arm_mat,
nullptr,
nullptr, &bpt);
79 bone->flag, bone->inherit_scale_mode, offs_bone, parent_arm_mat, parent_pose_mat, &bpt);
87 reinterpret_cast<float (*)[4]
>(
const_cast<float *
>(matrix)),
88 reinterpret_cast<float (*)[4]
>(r_matrix));
91static void rna_Bone_MatrixFromAxisRoll(
const float axis[3],
float roll,
float r_matrix[9])
96static void rna_Bone_AxisRollFromMatrix(
const float matrix[9],
97 const float axis_override[3],
103 normalize_m3_m3(mat,
reinterpret_cast<float (*)[3]
>(
const_cast<float *
>(matrix)));
116static bool rna_BoneCollection_assign_abstract(
BoneCollection *bcoll,
120 bonecoll_assign_func_bone assign_bone,
121 bonecoll_assign_func_ebone assign_ebone)
129 Object *ob = id_cast<Object *>(bone_ptr->owner_id);
131 const bool made_any_change = assign_bone(bcoll, pchan->bone_get(*ob));
132 if (made_any_change) {
135 return made_any_change;
139 Bone *bone =
static_cast<Bone *
>(bone_ptr->data);
140 const bool made_any_change = assign_bone(bcoll, bone);
141 if (made_any_change) {
144 return made_any_change;
149 const bool made_any_change = assign_ebone(bcoll, ebone);
150 if (made_any_change) {
153 return made_any_change;
157 "%s is not supported, pass a Bone, PoseBone, or EditBone",
167 return rna_BoneCollection_assign_abstract(bcoll,
180 return rna_BoneCollection_assign_abstract(bcoll,
201 "Align the bone to a local-space roll so the Z axis "
202 "points in the direction of the vector given");
222 "Position in 3d space to evaluate",
231 func =
RNA_def_function(srna,
"convert_local_to_pose",
"rna_Bone_convert_local_to_pose");
233 "Transform a matrix from Local to Pose space (or back), taking "
234 "into account options like Inherit Scale and Local Location. "
235 "Unlike Object.convert_space, this uses custom rest and pose "
236 "matrices provided by the caller. If the parent matrices are "
237 "omitted, the bone is assumed to have no parent.");
253 parm,
"",
"The custom pose matrix of the parent bone (PoseBone.matrix)");
257 parm,
"",
"The custom rest matrix of the parent bone (Bone.matrix_local)");
258 RNA_def_boolean(func,
"invert",
false,
"",
"Convert from Pose to Local space");
261 func =
RNA_def_function(srna,
"MatrixFromAxisRoll",
"rna_Bone_MatrixFromAxisRoll");
276 func =
RNA_def_function(srna,
"AxisRollFromMatrix",
"rna_Bone_AxisRollFromMatrix");
278 "Convert a rotational matrix to the axis + roll representation. "
279 "Note that the resulting value of the roll may not be as "
280 "expected if the matrix has shear or negative determinant.");
289 parm,
"",
"The optional override for the axis (finds closest approximation for the matrix)");
308 func,
"bone",
"AnyType",
"",
"Bone, PoseBone, or EditBone to assign to this collection");
315 "Whether the bone was actually assigned; will be false if the bone was "
316 "already member of the collection");
323 func,
"bone",
"AnyType",
"",
"Bone, PoseBone, or EditBone to remove from this collection");
330 "Whether the bone was actually removed; will be false if the bone was "
331 "not a member of the collection to begin with");
C++ functions to deal with Armature collections (i.e. the successor of bone layers).
#define ND_BONE_COLLECTION
float2x2 invert(float2x2 mat)
float3x3 scale(float3x3 mat, float2 scale)
void WM_main_add_notifier(uint type, void *reference)
void mat3_vec_to_roll(const float mat[3][3], const float vec[3], float *r_roll)
bool ANIM_armature_bonecoll_assign(BoneCollection *bcoll, Bone *bone)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
bool ANIM_armature_bonecoll_assign_editbone(BoneCollection *bcoll, EditBone *ebone)
void vec_roll_to_mat3(const float vec[3], float roll, float r_mat[3][3])
void RNA_def_function_output(FunctionRNA *, PropertyRNA *ret)
void RNA_api_bone(StructRNA *srna)
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
void mat3_to_vec_roll(const float mat[3][3], float r_vec[3], float *r_roll)
void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int length[])
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
PropertyRNA * RNA_def_float_vector(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
float distfactor_to_bone(const float3 &position, const float3 &head, const float3 &tail, float radius_head, float radius_tail, float falloff_distance)
void BKE_bone_parent_transform_apply(const BoneParentTransform *bpt, const float inmat[4][4], float outmat[4][4])
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier_c_str, int type, int subtype)
void RNA_api_bonecollection(StructRNA *srna)
void BKE_bone_parent_transform_calc_from_matrices(int bone_flag, int inherit_scale_mode, const float offs_bone[4][4], const float parent_arm_mat[4][4], const float parent_pose_mat[4][4], BoneParentTransform *r_bpt)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
bool ANIM_armature_bonecoll_unassign_editbone(BoneCollection *bcoll, EditBone *ebone)
void BKE_bone_parent_transform_invert(BoneParentTransform *bpt)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier_c_str, const char *call)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
bool is_zero_m4(const float mat[4][4])
void normalize_m3_m3(float R[3][3], const float M[3][3]) ATTR_NONNULL()
MINLINE float normalize_v3_v3(float r[3], const float a[3])
const char * RNA_struct_identifier(const StructRNA *type)
void RNA_def_function_flag(FunctionRNA *func, FunctionFlag flag)
PropertyRNA * RNA_def_float_vector_xyz(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void RNA_api_armature_edit_bone(StructRNA *srna)
bool ANIM_armature_bonecoll_unassign(BoneCollection *bcoll, Bone *bone)
float ED_armature_ebone_roll_to_vector(const EditBone *bone, const float align_axis[3], const bool axis_only)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
void RNA_def_property_array(PropertyRNA *prop, int length)
const int rna_matrix_dimsize_4x4[]
const int rna_matrix_dimsize_3x3[]
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float