42static float rna_PoseBone_do_envelope(
bPoseChannel *chan,
const float vec[3])
56static void rna_PoseBone_bbone_segment_index(
66 "Bone '%s' has out of date B-Bone segment data - depsgraph update required!",
74static void rna_PoseBone_bbone_segment_matrix(
84 "Bone '%s' has out of date B-Bone segment data - depsgraph update required!",
90 reports,
RPT_ERROR,
"Invalid index %d for B-Bone segments of '%s'!", index, pchan->
name);
102static void rna_PoseBone_compute_bbone_handles(
bPoseChannel *pchan,
121 &
params, ret_h1, ret_roll1, ret_h2, ret_roll2, ease || offsets, offsets);
124static void rna_Pose_apply_pose_from_action(
ID *pose_owner,
127 const float evaluation_time)
136 pose_owner_ob, action, slot_handle, &anim_eval_context);
143static void rna_Pose_blend_pose_from_action(
ID *pose_owner,
146 const float blend_factor,
147 const float evaluation_time)
156 pose_owner_ob, action, slot_handle, &anim_eval_context, blend_factor);
163static void rna_Pose_backup_create(
ID *pose_owner,
bAction *action)
171static bool rna_Pose_backup_restore(
ID *pose_owner,
bContext *C)
188static void rna_Pose_backup_clear(
ID *pose_owner)
203 func =
RNA_def_function(srna,
"apply_pose_from_action",
"rna_Pose_apply_pose_from_action");
207 "Apply the given action to this pose by evaluating it at a specific time. Only updates the "
208 "pose of selected bones, or all bones if none are selected.");
209 parm =
RNA_def_pointer(func,
"action",
"Action",
"Action",
"The Action containing the pose");
217 "Time at which the given action is evaluated to obtain the pose",
221 func =
RNA_def_function(srna,
"blend_pose_from_action",
"rna_Pose_blend_pose_from_action");
224 "Blend the given action into this pose by evaluating it at a "
225 "specific time. Only updates the "
226 "pose of selected bones, or all bones if none are selected.");
227 parm =
RNA_def_pointer(func,
"action",
"Action",
"Action",
"The Action containing the pose");
235 "How much the given Action affects the final pose",
244 "Time at which the given action is evaluated to obtain the pose",
251 "Create a backup of the current pose. Only those bones that are animated in the Action are "
252 "backed up. The object owns the backup, and each object can have only one backup at a time. "
253 "When you no longer need it, it must be freed use `backup_clear()`.");
259 "An Action with animation data for the bones. "
260 "Only the animated bones will be included in the backup.");
267 "Restore the previously made pose backup. "
268 "This can be called multiple times. See `Pose.backup_create()` for more info.");
275 "`True` when the backup was restored, `False` if there was no backup to restore");
280 func,
"Free a previously made pose backup. See `Pose.backup_create()` for more info.");
289 func =
RNA_def_function(srna,
"evaluate_envelope",
"rna_PoseBone_do_envelope");
298 "Position in 3d space to evaluate",
308 func =
RNA_def_function(srna,
"bbone_segment_index",
"rna_PoseBone_bbone_segment_index");
311 func,
"Retrieve the index and blend factor of the B-Bone segments based on vertex position");
319 "Vertex position in armature pose space",
332 func =
RNA_def_function(srna,
"bbone_segment_matrix",
"rna_PoseBone_bbone_segment_matrix");
334 func,
"Retrieve the matrix of the joint between B-Bone segments if available");
340 parm =
RNA_def_int(func,
"index", 0, 0, INT_MAX,
"",
"Index of the segment endpoint", 0, 10000);
342 parm =
RNA_def_boolean(func,
"rest",
false,
"",
"Return the rest pose matrix");
345 func =
RNA_def_function(srna,
"compute_bbone_handles",
"rna_PoseBone_compute_bbone_handles");
347 func,
"Retrieve the vectors and rolls coming from B-Bone custom handles");
352 parm,
"",
"The direction vector of the start handle in bone local space");
364 parm =
RNA_def_boolean(func,
"rest",
false,
"",
"Return the rest pose state");
365 parm =
RNA_def_boolean(func,
"ease",
false,
"",
"Apply scale from ease values");
367 func,
"offsets",
false,
"",
"Apply roll and curve offsets from bone properties");
Functions and classes to work with Actions.
Functions to work with animation poses.
void BKE_pchan_bbone_deform_segment_index(const bPoseChannel *pchan, const float *co, int *r_index, float *r_blend_next)
void BKE_pchan_bbone_spline_params_get(bPoseChannel *pchan, bool rest, BBoneSplineParameters *param)
float distfactor_to_bone(const float vec[3], const float b1[3], const float b2[3], float rad1, float rad2, float rdist)
void BKE_pchan_bbone_handles_compute(const BBoneSplineParameters *param, float h1[3], float *r_roll1, float h2[3], float *r_roll2, bool ease, bool offsets)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
void BKE_pose_backup_create_on_object(struct Object *ob, const struct bAction *action)
void BKE_pose_backup_clear(struct Object *ob)
bool BKE_pose_backup_restore_on_object(struct Object *ob)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void copy_m4_m4(float m1[4][4], const float m2[4][4])
void DEG_id_tag_update(ID *id, unsigned int flags)
Object is a sort of wrapper for general info.
slot_handle_t first_slot_handle(const ::bAction &dna_action)
void pose_apply_action_selected_bones(Object *ob, bAction *action, slot_handle_t slot_handle, const AnimationEvalContext *anim_eval_context)
decltype(::ActionSlot::handle) slot_handle_t
void pose_apply_action_blend(Object *ob, bAction *action, slot_handle_t slot_handle, const AnimationEvalContext *anim_eval_context, float blend_factor)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *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_multi_array(PropertyRNA *prop, int dimension, const int length[])
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)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_array(PropertyRNA *prop, int length)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
const int rna_matrix_dimsize_4x4[]
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_function_flag(FunctionRNA *func, int flag)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_function_output(FunctionRNA *, PropertyRNA *ret)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_api_pose(StructRNA *srna)
void RNA_api_pose_channel(StructRNA *srna)
struct Mat4 * bbone_pose_mats
struct Mat4 * bbone_rest_mats
struct bPoseChannel_Runtime runtime
void WM_event_add_notifier(const bContext *C, uint type, void *reference)