Blender
V3.3
|
#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_string_utils.h"
#include "BKE_action.h"
#include "BKE_animsys.h"
#include "BKE_appdir.h"
#include "BKE_armature.h"
#include "BKE_blender_copybuffer.h"
#include "BKE_context.h"
#include "BKE_deform.h"
#include "BKE_idprop.h"
#include "BKE_layer.h"
#include "BKE_main.h"
#include "BKE_object.h"
#include "BKE_report.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_prototypes.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_armature.h"
#include "ED_keyframing.h"
#include "ED_screen.h"
#include "ED_util.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "armature_intern.h"
Go to the source code of this file.
Classes | |
struct | ApplyArmature_ParentState |
typedef struct ApplyArmature_ParentState ApplyArmature_ParentState |
|
static |
Definition at line 365 of file pose_transform.c.
References AnimData::action, Object::adt, applyarmature_fix_boneparents(), applyarmature_process_selected_recursive(), applyarmature_reset_constraints(), applyarmature_set_edit_position(), applyarmature_transfer_properties(), BKE_armature_from_object(), BKE_object_obdata_is_libdata(), BKE_object_pose_armature_get(), BKE_pose_channel_find_name(), BKE_pose_where_is(), BKE_report(), BLI_freelistN(), bArmature::bonebase, C, bPose::chanbase, CTX_data_active_object(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_data_selected_pose_bones(), DEG_get_evaluated_object(), DEG_id_tag_update(), depsgraph, ED_armature_ebone_find_name(), ED_armature_edit_free(), ED_armature_from_edit(), ED_armature_to_edit(), bArmature::edbo, ListBase::first, Object::id, ID_RECALC_COPY_ON_WRITE, LISTBASE_FOREACH, bPoseChannel::name, NC_OBJECT, ND_POSE, bPoseChannel::next, NULL, OB_ARMATURE, OPERATOR_CANCELLED, OPERATOR_FINISHED, Object::pose, bPoseChannel::pose_mat, bPoseChannel::pose_tail, wmOperator::ptr, wmOperator::reports, RNA_boolean_get(), RPT_ERROR, RPT_WARNING, scene, Object::type, and WM_event_add_notifier().
Referenced by POSE_OT_armature_apply().
|
static |
Definition at line 452 of file pose_transform.c.
References C, CTX_wm_manager(), wmWindowManager::id, wmOperator::layout, NULL, wmOperator::properties, ptr, RNA_pointer_create(), wmOperatorType::srna, wmOperator::type, and uiItemR().
Referenced by POSE_OT_armature_apply().
|
static |
Definition at line 162 of file pose_transform.c.
References applyarmature_set_edit_position(), ED_armature_ebone_find_name(), bArmature::edbo, EditBone::head, mul_m4_m4m3(), mul_v3_m4v3(), bPoseChannel::name, EditBone::roll, sub_v3_v3v3(), EditBone::tail, and vec_roll_to_mat3().
Referenced by applyarmature_process_selected_recursive().
|
static |
Definition at line 59 of file pose_transform.c.
References BKE_object_apply_mat4(), BKE_object_workob_calc_parent(), C, CTX_data_depsgraph_pointer(), CTX_data_main(), depsgraph, ListBase::first, Object::id, invert_m4_m4(), ID::next, Main::objects, Object::obmat, PARBONE, Object::parent, Object::parentinv, Object::partype, and scene.
Referenced by apply_armature_pose2bones_exec().
|
static |
Definition at line 193 of file pose_transform.c.
References applyarmature_adjust_edit_position(), applyarmature_set_edit_position(), applyarmature_transfer_properties(), Bone::arm_mat, BKE_bone_offset_matrix_get(), BKE_bone_parent_transform_apply(), BKE_bone_parent_transform_calc_from_matrices(), BKE_bone_parent_transform_clear(), BKE_bone_parent_transform_combine(), BKE_bone_parent_transform_invert(), BKE_pose_channel_find_name(), BLI_findptr(), ApplyArmature_ParentState::bone, BONE_CONNECTED, Bone::childbase, copy_v3_fl3(), PointerRNA::data, ED_armature_ebone_find_name(), bArmature::edbo, Bone::flag, float(), Bone::inherit_scale_mode, invert_m4(), invert_m4_m4(), is_zero_v3(), Bone::length, LISTBASE_FOREACH, bPoseChannel::loc, BoneParentTransform::loc_mat, mul_m4_m4m4(), mul_m4_v3(), mul_v3_mat3_m4v3(), bPoseChannel::name, Bone::name, ApplyArmature_ParentState::new_arm_mat, ApplyArmature_ParentState::new_rest_mat, bPoseChannel::parent, Bone::parent, bPoseChannel::pose_mat, ptr, and unit_m4().
Referenced by apply_armature_pose2bones_exec().
|
static |
Definition at line 325 of file pose_transform.c.
References CONSTRAINT_TYPE_STRETCHTO, bConstraint::data, bStretchToConstraint::orglength, and bConstraint::type.
Referenced by applyarmature_reset_bone_constraints().
|
static |
Definition at line 344 of file pose_transform.c.
References applyarmature_reset_bone_constraint(), bPoseChannel::constraints, and LISTBASE_FOREACH.
Referenced by applyarmature_reset_constraints().
Definition at line 353 of file pose_transform.c.
References applyarmature_reset_bone_constraints(), BLI_assert, BONE_SELECTED, bPose::chanbase, ListBase::first, and NULL.
Referenced by apply_armature_pose2bones_exec().
|
static |
Definition at line 89 of file pose_transform.c.
References copy_m3_m4(), copy_m4_m3(), copy_v3_v3(), EditBone::head, mat3_vec_to_roll(), EditBone::roll, sub_v3_v3v3(), EditBone::tail, and vec_roll_to_mat3().
Referenced by apply_armature_pose2bones_exec(), applyarmature_adjust_edit_position(), and applyarmature_process_selected_recursive().
|
static |
Definition at line 122 of file pose_transform.c.
References bPoseChannel::bone, copy_v3_fl(), EditBone::curve_in_x, bPoseChannel::curve_in_x, EditBone::curve_in_z, bPoseChannel::curve_in_z, EditBone::curve_out_x, bPoseChannel::curve_out_x, EditBone::curve_out_z, bPoseChannel::curve_out_z, EditBone::ease1, bPoseChannel::ease1, EditBone::ease2, bPoseChannel::ease2, bPoseChannel::eul, bPoseChannel::loc, mul_v3_v3(), bPoseChannel::quat, EditBone::roll1, bPoseChannel::roll1, EditBone::roll2, bPoseChannel::roll2, bPoseChannel::rotAngle, bPoseChannel::rotAxis, EditBone::scale_in, bPoseChannel::scale_in, EditBone::scale_out, bPoseChannel::scale_out, Bone::segments, bPoseChannel::size, unit_axis_angle(), unit_qt(), and zero_v3().
Referenced by apply_armature_pose2bones_exec(), and applyarmature_process_selected_recursive().
|
static |
Definition at line 976 of file pose_transform.c.
References bPoseChannel::loc, OB_LOCK_LOCX, OB_LOCK_LOCY, OB_LOCK_LOCZ, and bPoseChannel::protectflag.
Referenced by pchan_clear_loc_with_mirrored().
|
static |
Definition at line 990 of file pose_transform.c.
References BKE_pose_channel_get_mirrored(), bPose::flag, bPoseChannel::name, NULL, pchan_clear_loc(), and POSE_MIRROR_EDIT.
Referenced by pchan_clear_transforms(), and pose_clear_loc_exec().
|
static |
Definition at line 1002 of file pose_transform.c.
References axis_angle_to_eulO(), copy_v3_v3(), bPoseChannel::curve_in_x, bPoseChannel::curve_in_z, bPoseChannel::curve_out_x, bPoseChannel::curve_out_z, bPoseChannel::eul, eul_to_quat(), EULER_ORDER_DEFAULT, eulO_to_axis_angle(), IS_EQF, mul_qt_fl(), normalize_qt_qt(), OB_LOCK_ROT4D, OB_LOCK_ROTW, OB_LOCK_ROTX, OB_LOCK_ROTY, OB_LOCK_ROTZ, bPoseChannel::protectflag, bPoseChannel::quat, quat_to_eul(), bPoseChannel::roll1, bPoseChannel::roll2, ROT_MODE_AXISANGLE, ROT_MODE_QUAT, bPoseChannel::rotAngle, bPoseChannel::rotAxis, bPoseChannel::rotmode, unit_axis_angle(), unit_qt(), and zero_v3().
Referenced by pchan_clear_rot_with_mirrored().
|
static |
Definition at line 1129 of file pose_transform.c.
References BKE_pose_channel_get_mirrored(), bPose::flag, bPoseChannel::name, NULL, pchan_clear_rot(), and POSE_MIRROR_EDIT.
Referenced by pchan_clear_transforms(), and pose_clear_rot_exec().
|
static |
Definition at line 944 of file pose_transform.c.
References copy_v3_fl(), bPoseChannel::ease1, bPoseChannel::ease2, OB_LOCK_SCALEX, OB_LOCK_SCALEY, OB_LOCK_SCALEZ, bPoseChannel::protectflag, bPoseChannel::scale_in, bPoseChannel::scale_out, and bPoseChannel::size.
Referenced by pchan_clear_scale_with_mirrored().
|
static |
Definition at line 964 of file pose_transform.c.
References BKE_pose_channel_get_mirrored(), bPose::flag, bPoseChannel::name, NULL, pchan_clear_scale(), and POSE_MIRROR_EDIT.
Referenced by pchan_clear_transforms(), and pose_clear_scale_exec().
|
static |
Definition at line 1141 of file pose_transform.c.
References pchan_clear_loc_with_mirrored(), pchan_clear_rot_with_mirrored(), and pchan_clear_scale_with_mirrored().
Referenced by pose_clear_transforms_exec().
|
static |
Perform paste pose, for a single bone.
ob | Object where bone to paste to lives |
chan | Bone that pose to paste comes from |
selOnly | Only paste on selected bones |
flip | Flip on x-axis |
Definition at line 607 of file pose_transform.c.
References axis_angle_to_eulO(), axis_angle_to_quat(), BKE_pose_channel_find_name(), BLI_string_flip_side_name(), BLI_strncpy(), bPoseChannel::bone, BONE_SELECTED, copy_qt_qt(), copy_v3_v3(), bPoseChannel::curve_in_x, bPoseChannel::curve_in_z, bPoseChannel::curve_out_x, bPoseChannel::curve_out_z, bPoseChannel::ease1, bPoseChannel::ease2, bPoseChannel::eul, eul_to_quat(), EULER_ORDER_DEFAULT, eulO_to_axis_angle(), eulO_to_quat(), bPoseChannel::flag, Bone::flag, IDP_CopyProperty(), IDP_SyncGroupValues(), bPoseChannel::loc, MAXBONENAME, bPoseChannel::name, normalize_qt(), NULL, Object::pose, bPoseChannel::prop, bPoseChannel::quat, quat_to_axis_angle(), quat_to_eul(), quat_to_eulO(), bPoseChannel::roll1, bPoseChannel::roll2, ROT_MODE_AXISANGLE, bPoseChannel::rotAngle, bPoseChannel::rotAxis, bPoseChannel::rotmode, bPoseChannel::scale_in, bPoseChannel::scale_out, and bPoseChannel::size.
Referenced by pose_clear_user_transforms_exec(), and pose_paste_exec().
|
static |
Definition at line 1285 of file pose_transform.c.
References ANIM_KS_LOCATION_ID, C, pchan_clear_loc_with_mirrored(), and pose_clear_transform_generic_exec().
Referenced by POSE_OT_loc_clear().
|
static |
Definition at line 1258 of file pose_transform.c.
References ANIM_KS_ROTATION_ID, C, pchan_clear_rot_with_mirrored(), and pose_clear_transform_generic_exec().
Referenced by POSE_OT_rot_clear().
|
static |
Definition at line 1231 of file pose_transform.c.
References ANIM_KS_SCALING_ID, C, pchan_clear_scale_with_mirrored(), and pose_clear_transform_generic_exec().
Referenced by POSE_OT_scale_clear().
|
static |
Definition at line 1151 of file pose_transform.c.
References ANIM_apply_keyingset(), ANIM_get_keyingset_for_autokeying(), ANIM_relative_keyingset_add_source(), autokeyframe_cfra_can_key(), BKE_pose_channel_find_name(), BKE_report(), BLI_freelistN(), BLI_listbase_is_empty(), C, RenderData::cfra, CTX_data_ensure_evaluated_depsgraph(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), DEG_get_evaluated_object(), DEG_id_tag_update(), depsgraph, ED_pose_recalculate_paths(), ELEM, FOREACH_OBJECT_IN_MODE_BEGIN, FOREACH_OBJECT_IN_MODE_END, FOREACH_PCHAN_SELECTED_IN_OBJECT_BEGIN, FOREACH_PCHAN_SELECTED_IN_OBJECT_END, Scene::id, ID_RECALC_GEOMETRY, MODIFYKEY_MODE_INSERT, MOTIONPATH_BAKE_HAS_PATHS, NC_OBJECT, ND_TRANSFORM, NULL, OB_ARMATURE, OB_MODE_POSE, OPERATOR_CANCELLED, OPERATOR_FINISHED, Object::pose, POSE_PATH_CALC_RANGE_FULL, Scene::r, wmOperator::reports, RPT_ERROR, scene, and WM_event_add_notifier().
Referenced by pose_clear_loc_exec(), pose_clear_rot_exec(), pose_clear_scale_exec(), and pose_clear_transforms_exec().
|
static |
Definition at line 1312 of file pose_transform.c.
References ANIM_KS_LOC_ROT_SCALE_ID, C, pchan_clear_transforms(), and pose_clear_transform_generic_exec().
Referenced by POSE_OT_transforms_clear().
|
static |
Definition at line 1340 of file pose_transform.c.
References Object::adt, ADT_RECALC_ANIM, BKE_animsys_eval_context_construct(), BKE_animsys_evaluate_animdata(), BKE_pose_copy_data(), BKE_pose_rest(), BLI_freelistN(), BLI_strncpy(), C, RenderData::cfra, bPose::chanbase, CTX_data_depsgraph_pointer(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), Object::data, DEG_id_tag_update(), depsgraph, ListBase::first, FOREACH_OBJECT_IN_MODE_BEGIN, FOREACH_OBJECT_IN_MODE_END, Object::id, ID_RECALC_GEOMETRY, IDP_FreeProperty(), MEM_freeN, ID::name, NC_OBJECT, ND_TRANSFORM, bPoseChannel::next, NULL, OB_ARMATURE, OB_MODE_POSE, OPERATOR_FINISHED, Object::pose, pose_bone_do_paste(), bPoseChannel::prop, wmOperator::ptr, Scene::r, RNA_boolean_get(), scene, Object::type, and WM_event_add_notifier().
Referenced by POSE_OT_user_transforms_clear().
|
static |
Definition at line 755 of file pose_transform.c.
References bArmature::adt, Object::adt, Main::armatures, BKE_copybuffer_copy_begin(), BKE_copybuffer_copy_end(), BKE_copybuffer_copy_tag_ID(), BKE_main_blendfile_path_from_global(), BKE_main_free(), BKE_main_new(), BKE_object_pose_armature_get(), BKE_report(), BKE_tempdir_base(), BLI_addtail(), BLI_join_dirfile(), BLI_listbase_clear(), C, CTX_data_active_object(), Object::data, ELEM, FILE_MAX, Main::filepath, Object::id, NULL, Main::objects, OPERATOR_CANCELLED, OPERATOR_FINISHED, Object::pose, wmOperator::reports, RPT_ERROR, RPT_INFO, set_pose_keys(), str, and STRNCPY.
Referenced by POSE_OT_copy().
void POSE_OT_armature_apply | ( | wmOperatorType * | ot | ) |
Definition at line 463 of file pose_transform.c.
References apply_armature_pose2bones_exec(), apply_armature_pose2bones_ui(), wmOperatorType::description, ED_operator_posemode(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_boolean(), wmOperatorType::srna, and wmOperatorType::ui.
Referenced by ED_operatortypes_armature().
void POSE_OT_copy | ( | wmOperatorType * | ot | ) |
Definition at line 804 of file pose_transform.c.
References wmOperatorType::description, ED_operator_posemode(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, ot, wmOperatorType::poll, and pose_copy_exec().
Referenced by ED_operatortypes_armature().
void POSE_OT_loc_clear | ( | wmOperatorType * | ot | ) |
Definition at line 1291 of file pose_transform.c.
References wmOperatorType::description, ED_operator_posemode(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, and pose_clear_loc_exec().
Referenced by ED_operatortypes_armature().
void POSE_OT_paste | ( | wmOperatorType * | ot | ) |
Definition at line 906 of file pose_transform.c.
References wmOperatorType::description, ED_operator_posemode(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, pose_paste_exec(), PROP_SKIP_SAVE, RNA_def_boolean(), RNA_def_property_flag(), and wmOperatorType::srna.
Referenced by ED_operatortypes_armature().
void POSE_OT_rot_clear | ( | wmOperatorType * | ot | ) |
Definition at line 1264 of file pose_transform.c.
References wmOperatorType::description, ED_operator_posemode(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, and pose_clear_rot_exec().
Referenced by ED_operatortypes_armature().
void POSE_OT_scale_clear | ( | wmOperatorType * | ot | ) |
Definition at line 1237 of file pose_transform.c.
References wmOperatorType::description, ED_operator_posemode(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, and pose_clear_scale_exec().
Referenced by ED_operatortypes_armature().
void POSE_OT_transforms_clear | ( | wmOperatorType * | ot | ) |
Definition at line 1318 of file pose_transform.c.
References wmOperatorType::description, ED_operator_posemode(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, and pose_clear_transforms_exec().
Referenced by ED_operatortypes_armature().
void POSE_OT_user_transforms_clear | ( | wmOperatorType * | ot | ) |
Definition at line 1401 of file pose_transform.c.
References wmOperatorType::description, ED_operator_posemode(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, pose_clear_user_transforms_exec(), RNA_def_boolean(), and wmOperatorType::srna.
Referenced by ED_operatortypes_armature().
void POSE_OT_visual_transform_apply | ( | wmOperatorType * | ot | ) |
Definition at line 556 of file pose_transform.c.
References wmOperatorType::description, ED_operator_posemode(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, and pose_visual_transform_apply_exec().
Referenced by ED_operatortypes_armature().
|
static |
Definition at line 825 of file pose_transform.c.
References ANIM_get_keyingset_for_autokeying(), ANIM_KS_WHOLE_CHARACTER_ID, bPose::avs, BKE_copybuffer_read(), BKE_main_blendfile_path_from_global(), BKE_main_free(), BKE_main_new(), BKE_object_pose_armature_get(), BKE_report(), BKE_tempdir_base(), BLI_join_dirfile(), BLI_listbase_count_at_most(), C, bPose::chanbase, CTX_data_active_object(), CTX_DATA_COUNT, CTX_data_scene(), DEG_id_tag_update(), ED_autokeyframe_pchan(), ED_pose_recalculate_paths(), ELEM, FILE_MAX, Main::filepath, FILTER_ID_OB, ListBase::first, bPoseChannel::flag, Object::id, ID_RECALC_GEOMETRY, MOTIONPATH_BAKE_HAS_PATHS, NC_OBJECT, ND_POSE, bPoseChannel::next, NULL, Main::objects, OPERATOR_CANCELLED, OPERATOR_FINISHED, bAnimVizSettings::path_bakeflag, Object::pose, pose_bone_do_paste(), POSE_KEY, POSE_PATH_CALC_RANGE_FULL, wmOperator::ptr, wmOperator::reports, RNA_boolean_get(), RPT_ERROR, scene, str, STRNCPY, and WM_event_add_notifier().
Referenced by POSE_OT_paste().
|
static |
Definition at line 492 of file pose_transform.c.
References BKE_armature_mat_pose_to_bone(), BKE_pchan_apply_mat4(), BLI_listbase_count(), BONE_SELECTED, C, CTX_data_ensure_evaluated_depsgraph(), CTX_data_view_layer(), CTX_wm_view3d(), DEG_id_tag_update(), FOREACH_OBJECT_IN_MODE_BEGIN, FOREACH_OBJECT_IN_MODE_END, ID_RECALC_GEOMETRY, LISTBASE_FOREACH_INDEX, MEM_freeN, MEM_mallocN, NC_OBJECT, ND_POSE, OB_ARMATURE, OB_MODE_POSE, OPERATOR_FINISHED, PBONE_VISIBLE, and WM_event_add_notifier().
Referenced by POSE_OT_visual_transform_apply().
Definition at line 580 of file pose_transform.c.
References bPoseChannel::bone, BONE_SELECTED, bPose::chanbase, Object::data, ListBase::first, bPoseChannel::flag, Bone::flag, Bone::layer, bArmature::layer, bPoseChannel::next, Object::pose, and POSE_KEY.
Referenced by pose_copy_exec().