Blender V5.3
blender::ed Namespace Reference

Namespaces

namespace  animation
namespace  animrig
namespace  asset
namespace  asset_browser
namespace  curves
namespace  file
namespace  geometry
namespace  graph
namespace  greasepencil
namespace  image_trace
namespace  io
namespace  mesh
namespace  motionpath
namespace  object
namespace  outliner
namespace  pointcloud
namespace  sculpt_paint
namespace  space_node
namespace  spreadsheet
namespace  tests
namespace  text
namespace  transform
namespace  uv
namespace  view3d
namespace  viewer_path
namespace  vse

Classes

struct  Rotation
class  AnimTransformable

Typedefs

using TransformFloats = Array<float, 4>
using TransformFloatPtrs = Array<float *, 4>

Enumerations

enum  RotationModeIndices : uint8_t { ROT_IDX_QUATERNION , ROT_IDX_AXIS_ANGLE , ROT_IDX_EULER , ROT_IDX_MAX_ENUM }
enum  AxisMutable : uint8_t { AXIS_MUTABLE_X = 1 << 0 , AXIS_MUTABLE_Y = 1 << 1 , AXIS_MUTABLE_Z = 1 << 2 , AXIS_MUTABLE_ALL = (1 << 8) - 1 }

Functions

static bool is_axis_mutable (const int index, const AxisMutable axis_flag)
static TransformFloats copy_pointers_to_values (const Span< float * > value)
static void copy_span_into_mutable_span (const Span< float > value, MutableSpan< float > target, const AxisMutable axis_flag)
static void blend_linear (MutableSpan< float > values, const float target, const float factor, const AxisMutable axis_flag)
static void blend_linear (MutableSpan< float > values, const Span< float > target, const float factor, const AxisMutable axis_flag)
Array< float > property_interpolated (const Span< float > a, const Span< float > b, const float factor)
Vector< ed::AnimTransformable > selected_transformables_from_context (bContext &C)
Rotation identity_rotation (const eRotationModes mode)
static void interpolate_axis_angle (const float a_angle, const float3 &a_axis, const float b_angle, const float3 &b_axis, const float factor, float *r_angle, float r_axis[3])
Rotation rotation_interpolated (const Rotation &a, const Rotation &b, const float factor)
static void build_rotations_array (Array< TransformFloatPtrs > &rotations, float *euler, float *quat, float *axis, float *angle)
 ENUM_OPERATORS (AxisMutable)

Typedef Documentation

◆ TransformFloatPtrs

Definition at line 55 of file ED_anim_transformable.hh.

◆ TransformFloats

Definition at line 54 of file ED_anim_transformable.hh.

Enumeration Type Documentation

◆ AxisMutable

Used to limit the modification of properties to certain axes.

Enumerator
AXIS_MUTABLE_X 
AXIS_MUTABLE_Y 
AXIS_MUTABLE_Z 
AXIS_MUTABLE_ALL 

All bits set to 1 so support generic properties larger than 3. Note that this doesn't mean the W axis is supported. See #AnimTransformable::set_property.

Definition at line 35 of file ED_anim_transformable.hh.

◆ RotationModeIndices

Enumerator
ROT_IDX_QUATERNION 
ROT_IDX_AXIS_ANGLE 
ROT_IDX_EULER 
ROT_IDX_MAX_ENUM 

Definition at line 142 of file transformable.cc.

Function Documentation

◆ blend_linear() [1/2]

void blender::ed::blend_linear ( MutableSpan< float > values,
const float target,
const float factor,
const AxisMutable axis_flag )
static

◆ blend_linear() [2/2]

void blender::ed::blend_linear ( MutableSpan< float > values,
const Span< float > target,
const float factor,
const AxisMutable axis_flag )
static

Blend the given values towards target. The indices are matched up and the Span lengths are expected to match.

Definition at line 89 of file transformable.cc.

References blend_linear(), blender::BLI_assert(), blender::MutableSpan< T >::index_range(), is_axis_mutable(), blender::MutableSpan< T >::size(), and blender::Span< T >::size().

◆ build_rotations_array()

◆ copy_pointers_to_values()

◆ copy_span_into_mutable_span()

◆ ENUM_OPERATORS()

blender::ed::ENUM_OPERATORS ( AxisMutable )

References ENUM_OPERATORS().

Referenced by ENUM_OPERATORS().

◆ identity_rotation()

Rotation blender::ed::identity_rotation ( eRotationModes mode)

Returns a rotation representing "no rotation" for the given mode.

Definition at line 223 of file transformable.cc.

References blender::BLI_assert(), identity_rotation(), blender::ROT_MODE_AXISANGLE, blender::ROT_MODE_QUAT, and blender::ROT_MODE_ZYX.

Referenced by identity_rotation(), blender::pose_slide_rest_pose_apply(), and blender::ed::tests::TEST_F().

◆ interpolate_axis_angle()

void blender::ed::interpolate_axis_angle ( const float a_angle,
const float3 & a_axis,
const float b_angle,
const float3 & b_axis,
const float factor,
float * r_angle,
float r_axis[3] )
static

◆ is_axis_mutable()

bool blender::ed::is_axis_mutable ( const int index,
const AxisMutable axis_flag )
static

Returns true if the given property index matches the axis flag. Always returns true if no flag is set.

Definition at line 40 of file transformable.cc.

References is_axis_mutable().

Referenced by blend_linear(), blend_linear(), copy_span_into_mutable_span(), is_axis_mutable(), and blender::ed::AnimTransformable::set_property().

◆ property_interpolated()

Array< float > blender::ed::property_interpolated ( Span< float > a,
Span< float > b,
float factor )

Interpolate the values linearly based on factor and returns a new Array. Asserts that both spans are the same length. With the factor at 0 the values will match a.

Definition at line 103 of file transformable.cc.

References b, blender::BLI_assert(), blender::Span< T >::index_range(), blender::interpf(), property_interpolated(), and blender::Span< T >::size().

Referenced by blender::pose_slide_apply_linear(), blender::pose_slide_apply_property_snapshots(), and property_interpolated().

◆ rotation_interpolated()

Rotation blender::ed::rotation_interpolated ( const Rotation & a,
const Rotation & b,
float factor )

Returns a new rotation, interpolated between a and b based on factor. If factor is 0 the result is a. If the rotation mode on a and b does not match, then b is converted into the mode of a first. The returned rotation is always in the rotation mode of a. Quaternion rotations use spherical interpolation, all other modes use linear.

Definition at line 252 of file transformable.cc.

References b, blender::Array< T, InlineBufferCapacity, Allocator >::data(), blender::Array< T, InlineBufferCapacity, Allocator >::index_range(), blender::interp_qt_qtqt(), blender::interpf(), interpolate_axis_angle(), blender::ed::Rotation::mode, blender::Array< T, InlineBufferCapacity, Allocator >::reinitialize(), blender::ROT_MODE_AXISANGLE, blender::ROT_MODE_QUAT, rotation_interpolated(), blender::Array< T, InlineBufferCapacity, Allocator >::size(), and blender::ed::Rotation::values.

Referenced by blender::pose_slide_apply_quat(), and rotation_interpolated().

◆ selected_transformables_from_context()