|
Blender V5.3
|
#include <ED_anim_transformable.hh>
Public Types | |
| enum class | Type : int8_t { POSE_BONE , OBJECT } |
| enum class | PropertyType : int8_t { LOCATION , ROTATION , SCALE } |
Provides a common interface to transform values for multiple structs. In a way this is similar to RNA, however RNA has the issue that the properties don't have consistent naming making it impossible to work with them in a generic way.
Definition at line 83 of file ED_anim_transformable.hh.
|
strong |
| Enumerator | |
|---|---|
| LOCATION | |
| ROTATION | |
| SCALE | |
Definition at line 90 of file ED_anim_transformable.hh.
|
strong |
| Enumerator | |
|---|---|
| POSE_BONE | |
| OBJECT | |
Definition at line 85 of file ED_anim_transformable.hh.
| blender::ed::AnimTransformable::AnimTransformable | ( | Object & | owner_id, |
| bPoseChannel & | pchan ) |
Definition at line 307 of file transformable.cc.
References AnimTransformable(), blender::bPoseChannel::loc, name(), and owner_id().
Referenced by AnimTransformable(), and AnimTransformable().
|
explicit |
Definition at line 321 of file transformable.cc.
References AnimTransformable(), blender::Object::loc, and name().
| void blender::ed::AnimTransformable::blend_property_to | ( | PropertyType | prop_type, |
| float | target, | ||
| float | factor, | ||
| AxisMutable | axis_flag ) |
Overloaded function that blends all values of the given property type to the same float.
Definition at line 472 of file transformable.cc.
References blender::ed::blend_linear(), blend_rotation_to(), blender::BLI_assert(), LOCATION, blender::ROT_MODE_QUAT, ROTATION, SCALE, and blender::Array< T, InlineBufferCapacity, Allocator >::size().
| void blender::ed::AnimTransformable::blend_property_to | ( | PropertyType | prop_type, |
| Span< float > | target, | ||
| float | factor, | ||
| AxisMutable | axis_flag ) |
Do a linear blend of the property values towards the given target. It is asserted that the given span size equals the property size. When setting the rotation property, it is the responsibility of the caller to ensure that the values are in the correct mode. It is assumed the target is in the same rotation mode as the transformable.
Definition at line 441 of file transformable.cc.
References blender::ed::blend_linear(), blend_rotation_to(), BLI_assert_msg, LOCATION, ROTATION, SCALE, blender::Array< T, InlineBufferCapacity, Allocator >::size(), and blender::Span< T >::size().
Referenced by data(), blender::pose_bone_blend_to(), blender::pose_slide_apply_linear(), blender::pose_slide_rest_pose_apply(), blender::ed::tests::TEST_F(), blender::ed::tests::TEST_F(), and blender::ed::tests::TEST_F().
| void blender::ed::AnimTransformable::blend_rotation_to | ( | const Rotation & | target, |
| float | factor, | ||
| AxisMutable | axis_flag ) |
Blends the rotation to the given target. If the rotation mode of the transformable and that of the target does not match, the target is converted. This uses the correct interpolation math depending on the rotation mode (LERP for euler, SLERP for quaternion). At factor 0, the current rotation remains unchanged.
Definition at line 561 of file transformable.cc.
References blender::ed::blend_linear(), blender::BLI_assert(), blender::ed::Rotation::converted_to_mode(), blender::Array< T, InlineBufferCapacity, Allocator >::data(), blender::IndexRange::IndexRange(), blender::interp_qt_qtqt(), blender::ed::interpolate_axis_angle(), blender::normalize_qt(), blender::result, blender::ROT_MODE_AXISANGLE, blender::ROT_MODE_QUAT, blender::ROT_MODE_ZYX, blender::Array< T, InlineBufferCapacity, Allocator >::size(), and blender::ed::Rotation::values.
Referenced by blend_property_to(), blend_property_to(), data(), blender::pose_bone_blend_to(), blender::pose_slide_apply_quat(), blender::pose_slide_rest_pose_apply(), and blender::ed::tests::TEST_F().
| Object * blender::ed::AnimTransformable::data | ( | ) | const |
Definition at line 341 of file transformable.cc.
References blender::BLI_assert(), and OBJECT.
| bPoseChannel * blender::ed::AnimTransformable::data | ( | ) | const |
Definition at line 335 of file transformable.cc.
References blender::BLI_assert(), and POSE_BONE.
References blend_property_to(), blend_rotation_to(), get_property(), get_rotation(), get_rotation_for_mode(), get_rotation_mode(), get_world_space(), rna_path(), rna_path_to_property(), rna_path_to_rotation(), rna_path_to_rotation_mode(), set_property(), set_rotation(), set_rotation_mode(), T, and world_to_local().
Referenced by blender::pose_bone_blend_to().
|
inline |
Definition at line 139 of file ED_anim_transformable.hh.
Referenced by blender::convert_rotation_mode_channelbag(), and blender::ed::animrig::ensure_baked_fcurves().
| TransformFloats blender::ed::AnimTransformable::get_property | ( | PropertyType | prop_type | ) | const |
Returns a copy of the property values for the given property type. While this will return the values of the current rotation mode for PropertyType::ROTATION, it is best to use the explicit function for it so a Rotation struct is returned which has more features for dealing with different rotation modes.
Definition at line 390 of file transformable.cc.
References BLI_assert_unreachable, blender::ed::copy_pointers_to_values(), LOCATION, ROTATION, and SCALE.
Referenced by blender::ed::animrig::clean_baked_fcurves(), data(), blender::pose_bone_blend_to(), blender::pose_slide_apply_linear(), blender::store_starting_transform(), blender::ed::tests::TEST_F(), blender::ed::tests::TEST_F(), and blender::ed::tests::TEST_F().
| Rotation blender::ed::AnimTransformable::get_rotation | ( | ) | const |
Returns a copy of the rotation in the mode the transformable is currently in.
Definition at line 518 of file transformable.cc.
References get_rotation_for_mode().
Referenced by data(), blender::ed::animrig::paste_world_space(), blender::pose_bone_blend_to(), blender::pose_slide_apply_quat(), blender::store_starting_transform(), blender::ed::tests::TEST_F(), and blender::ed::tests::TEST_F().
| Rotation blender::ed::AnimTransformable::get_rotation_for_mode | ( | eRotationModes | mode | ) | const |
Returns a copy of the rotation for the given mode. This is not the current rotation converted to the given mode, but the values of the underlying rotation properties for the given mode. For example, this can return the axis-angle rotation property values, even when the transformable is in quaternion mode.
Definition at line 523 of file transformable.cc.
References blender::BLI_assert(), and blender::ed::copy_pointers_to_values().
Referenced by blender::convert_rotation_mode_range(), data(), and get_rotation().
| eRotationModes blender::ed::AnimTransformable::get_rotation_mode | ( | ) | const |
Returns the current rotation mode of the transformable.
Definition at line 551 of file transformable.cc.
Referenced by blender::ed::animrig::build_fcurves_for_paste(), blender::convert_rotation_keys(), data(), blender::pose_slide_apply(), blender::pose_slide_rest_pose_apply(), blender::ed::tests::TEST_F(), and blender::ed::tests::TEST_F().
| float4x4 blender::ed::AnimTransformable::get_world_space | ( | const Depsgraph & | depsgraph | ) | const |
Returns the evaluated world space matrix.
Definition at line 616 of file transformable.cc.
References blender::BKE_pose_channel_find_name(), blender::BLI_assert(), BLI_assert_unreachable, blender::DEG_get_evaluated_id(), blender::MatBase< float, 4, 4 >::identity(), OBJECT, blender::Object::pose, POSE_BONE, and blender::bPoseChannel::pose_mat.
Referenced by blender::ed::animrig::copy_world_space(), and data().
|
inline |
Definition at line 144 of file ED_anim_transformable.hh.
Referenced by AnimTransformable(), AnimTransformable(), blender::ed::animrig::copy_world_space(), blender::pose_bone_blend_to(), and blender::ed::animrig::transformable_to_deg_identifier().
|
inline |
Definition at line 134 of file ED_anim_transformable.hh.
Referenced by AnimTransformable(), blender::ed::animrig::build_fcurves_for_paste(), blender::convert_to_rotation_mode(), blender::ed::animrig::paste_world_space(), blender::pose_slide_apply_linear(), blender::pose_slide_apply_quat(), blender::pose_slide_invoke_common(), and blender::ed::animrig::transformable_to_deg_identifier().
| StringRefNull blender::ed::AnimTransformable::rna_path | ( | ) | const |
Definition at line 347 of file transformable.cc.
Referenced by data(), and blender::ed::tests::TEST_F().
| std::string blender::ed::AnimTransformable::rna_path_to_property | ( | const StringRef | property_name | ) | const |
Generic function that returns an rna path to the transformable for the property with the given name. Note that the resulting string doesn't need to be a valid and existing RNA path. It is up to the caller to pass the correct string for that.
Definition at line 371 of file transformable.cc.
| std::string blender::ed::AnimTransformable::rna_path_to_property | ( | PropertyType | prop_type | ) | const |
Returns a string to the given property type.
Definition at line 352 of file transformable.cc.
References blender::animrig::get_rotation_mode_path(), LOCATION, rna_path_to_property(), ROTATION, and SCALE.
Referenced by blender::ed::animrig::build_fcurves_for_paste(), data(), blender::pose_slide_apply_linear(), blender::pose_slide_apply_quat(), rna_path_to_property(), rna_path_to_rotation(), and rna_path_to_rotation_mode().
| std::string blender::ed::AnimTransformable::rna_path_to_rotation | ( | eRotationModes | rotation_mode | ) | const |
Definition at line 379 of file transformable.cc.
References blender::animrig::get_rotation_mode_path(), and rna_path_to_property().
Referenced by blender::bake_rotation_fcurves(), blender::convert_rotation_mode_channelbag(), data(), and blender::remove_rotation_fcurves().
| std::string blender::ed::AnimTransformable::rna_path_to_rotation_mode | ( | ) | const |
Definition at line 385 of file transformable.cc.
References rna_path_to_property().
Referenced by blender::ed::animrig::build_fcurves_for_paste(), blender::convert_rotation_keys(), and data().
| void blender::ed::AnimTransformable::set_property | ( | PropertyType | prop_type, |
| Span< float > | values, | ||
| AxisMutable | axis_flag ) |
Generic way to set the given transform property. It is asserted that the value count matches the current rotation mode. Use set_rotation to automatically convert to the correct mode.
Definition at line 408 of file transformable.cc.
References blender::ed::AXIS_MUTABLE_ALL, blender::BLI_assert(), BLI_assert_unreachable, blender::ed::copy_span_into_mutable_span(), blender::Array< T, InlineBufferCapacity, Allocator >::index_range(), blender::ed::is_axis_mutable(), LOCATION, blender::ROT_MODE_QUAT, ROTATION, SCALE, blender::Array< T, InlineBufferCapacity, Allocator >::size(), and blender::Span< T >::size().
Referenced by blender::ed::animrig::clean_baked_fcurves(), data(), blender::pose_slide_apply_linear(), blender::slide_subjects_reset(), and blender::ed::tests::TEST_F().
| void blender::ed::AnimTransformable::set_rotation | ( | const Rotation & | rotation | ) |
Sets the rotation for the mode the transformable is currently in. If that doesn't match with the given rotation, the rotation is converted.
Definition at line 533 of file transformable.cc.
References blender::BLI_assert(), blender::Array< T, InlineBufferCapacity, Allocator >::index_range(), and blender::ed::Rotation::values.
Referenced by data(), blender::pose_slide_apply_quat(), blender::slide_subjects_reset(), blender::ed::tests::TEST_F(), and blender::ed::tests::TEST_F().
| void blender::ed::AnimTransformable::set_rotation_mode | ( | eRotationModes | mode | ) |
Only sets the rotation mode, does not touch the rotation properties or their animation.
Definition at line 556 of file transformable.cc.
Referenced by data().
|
inline |
Definition at line 129 of file ED_anim_transformable.hh.
Referenced by blender::pose_bone_blend_to(), blender::slide_subjects_refresh(), and blender::ed::animrig::transformable_to_deg_identifier().
| float4x4 blender::ed::AnimTransformable::world_to_local | ( | const Depsgraph & | depsgraph, |
| const float4x4 & | world_matrix ) const |
Converts the given world space matrix into local space using the evaluated depsgraph.
Definition at line 640 of file transformable.cc.
References blender::BKE_armature_mat_pose_to_bone(), blender::BKE_object_delta_matrix_get(), blender::BKE_pose_channel_find_name(), blender::BLI_assert(), BLI_assert_unreachable, blender::DEG_get_evaluated_id(), blender::MatBase< float, 4, 4 >::identity(), blender::math::invert(), OBJECT, blender::Object::parent, blender::Object::parentinv, blender::Object::pose, POSE_BONE, and blender::MatBase< T, NumCol, NumRow, Alignment >::ptr().
Referenced by data(), and blender::ed::animrig::paste_world_space().