|
Blender V4.3
|
#include "DNA_anim_types.h"#include "DNA_space_types.h"#include "MEM_guardedalloc.h"#include "BLI_math_matrix.h"#include "BLI_math_vector.h"#include "BKE_context.hh"#include "BKE_fcurve.hh"#include "BKE_layer.hh"#include "BKE_nla.hh"#include "BKE_report.hh"#include "ED_anim_api.hh"#include "ED_keyframes_edit.hh"#include "UI_view2d.hh"#include "transform.hh"#include "transform_constraints.hh"#include "transform_convert.hh"#include "transform_snap.hh"Go to the source code of this file.
Classes | |
| struct | TransDataGraph |
| struct | BeztMap |
Functions | |
Graph Editor Transform Creation | |
| static void | bezt_to_transdata (TransData *td, TransData2D *td2d, TransDataGraph *tdg, AnimData *adt, BezTriple *bezt, int bi, bool selected, bool ishandle, bool intvals, const float mtx[3][3], const float smtx[3][3], float unit_scale, float offset) |
| static bool | graph_edit_is_translation_mode (TransInfo *t) |
| static bool | graph_edit_use_local_center (TransInfo *t) |
| static void | enable_autolock (TransInfo *t, SpaceGraph *space_graph) |
| static void | graph_bezt_get_transform_selection (const TransInfo *t, const BezTriple *bezt, const bool use_handle, bool *r_left_handle, bool *r_key, bool *r_right_handle) |
| static void | graph_key_shortest_dist (TransInfo *t, FCurve *fcu, TransData *td_start, TransData *td, int cfra, bool use_handle) |
| static void | createTransGraphEditData (bContext *C, TransInfo *t) |
Graph Editor Transform Flush | |
| static bool | fcu_test_selected (FCurve *fcu) |
| static void | flushTransGraphData (TransInfo *t) |
| static blender::Vector< BeztMap > | bezt_to_beztmaps (BezTriple *bezts, const int totvert) |
| static void | sort_time_beztmaps (const blender::MutableSpan< BeztMap > bezms) |
| static void | update_trans_data (TransData *td, const FCurve *fcu, const int new_index, const bool swap_handles) |
| static void | update_transdata_bezt_pointers (TransDataContainer *tc, const blender::Map< float *, int > &trans_data_map, const FCurve *fcu, const blender::Span< BeztMap > bezms) |
| static void | remake_graph_transdata (TransInfo *t, const blender::Span< FCurve * > fcurves) |
| static void | recalcData_graphedit (TransInfo *t) |
Special After Transform Graph | |
| static void | special_aftertrans_update__graph (bContext *C, TransInfo *t) |
Variables | |
| TransConvertTypeInfo | TransConvertType_Graph |
|
static |
Converts an FCurve's BezTriple array to a BeztMap vector.
Definition at line 744 of file transform_convert_graph.cc.
References BeztMap::bezt, blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), BeztMap::oldIndex, and BeztMap::swap_handles.
|
static |
Helper function for createTransGraphEditData, which is responsible for associating source data with transform data.
Definition at line 46 of file transform_convert_graph.cc.
References TransData::axismtx, BKE_nla_tweakedit_remap(), copy_m3_m3(), copy_v2_v2(), copy_v3_v3(), TransData::dist, TransData::ext, FLT_MAX, TransData2D::h1, TransData2D::h2, TransData2D::ih1, TransData2D::ih2, TransData2D::loc, TransData2D::loc2d, TransData::mtx, NLATIME_CONVERT_MAP, TransDataGraph::offset, TransData::smtx, TD_INTVALUES, TD_NOTIMESNAP, TD_SELECTED, TransDataGraph::unit_scale, and BezTriple::vec.
Referenced by createTransGraphEditData().
It is important to note that this doesn't always act on the selection (like it's usually done), it acts on a subset of it. E.g. the selection code may leave a hint that we just dragged on a left or right handle (SIPO_RUNTIME_FLAG_TWEAK_HANDLES_LEFT/RIGHT) and then we only transform the selected left or right handles accordingly. The points to be transformed are tagged with BEZT_FLAG_TEMP_TAG; some lower level curve functions may need to be made aware of this. It's ugly that these act based on selection state anyway.
Definition at line 232 of file transform_convert_graph.cc.
References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), ANIM_animdata_filter(), ANIM_animdata_freelist(), ANIM_animdata_get_context(), ANIM_get_normalization_flags(), ANIM_nla_mapping_get(), ANIM_unit_mapping_get_factor(), ANIM_UNITCONV_ONLYSEL, ANIM_UNITCONV_SELVERTS, ANIMFILTER_CURVE_VISIBLE, ANIMFILTER_DATA_VISIBLE, ANIMFILTER_FCURVESONLY, ANIMFILTER_FOREDIT, blender::Vector< T, InlineBufferCapacity, Allocator >::append(), TransInfo::area, FCurve::bezt, BEZT_FLAG_TEMP_TAG, bezt_to_transdata(), BKE_nla_tweakedit_remap(), count, TransDataContainer::custom, bAnimContext::data, TransCustomData::data, TransDataContainer::data, TransDataContainer::data_2d, TransDataContainer::data_len, bAnimContext::datatype, TransData::dist, ELEM, enable_autolock(), BezTriple::f1, BezTriple::f2, BezTriple::f3, FCURVE_INT_VALUES, filter(), ListBase::first, FCurve::flag, SpaceGraph::flag, TransInfo::flag, float, TransInfo::frame_side, FrameOnMouseSide(), graph_bezt_get_transform_selection(), graph_edit_is_translation_mode(), graph_edit_use_local_center(), graph_key_shortest_dist(), BezTriple::h1, BezTriple::h2, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM, Scene::id, initTransDataCurveHandles(), IS_EQF, LISTBASE_FOREACH, MEM_callocN, TransInfo::mode, mul_v3_fl(), NLATIME_CONVERT_UNMAP, TransData::rdist, TransInfo::region, bAnimContext::scene, TransInfo::scene, SIPO_AUTOLOCK_AXIS, SIPO_NOHANDLES, bAnimContext::sl, ScrArea::spacedata, T_PROP_EDIT, TD_MOVEHANDLE1, TD_MOVEHANDLE2, testhandles_fcurve(), TFM_RESIZE, TFM_ROTATION, TFM_TIME_EXTEND, FCurve::totvert, TRANS_DATA_CONTAINER_FIRST_SINGLE, transform_convert_frame_side_dir_get(), TransCustomDataContainer::type, UI_view2d_scale_get(), unit_m3(), TransCustomData::use_free, and BezTriple::vec.
|
static |
Definition at line 148 of file transform_convert_graph.cc.
References SpaceGraph_Runtime::flag, initSelectConstraint(), TransInfo::mode, SpaceGraph::runtime, SIPO_RUNTIME_FLAG_TWEAK_HANDLES_LEFT, SIPO_RUNTIME_FLAG_TWEAK_HANDLES_RIGHT, and TFM_TRANSLATION.
Referenced by createTransGraphEditData().
|
static |
Definition at line 658 of file transform_convert_graph.cc.
References FCurve::bezt, BEZT_ISSEL_ANY, and FCurve::totvert.
Referenced by recalcData_graphedit().
|
static |
This function is called on recalc_data to apply the transforms applied to the transdata on to the actual keyframe data.
Definition at line 680 of file transform_convert_graph.cc.
References BKE_nla_tweakedit_remap(), TransDataContainer::custom, TransCustomData::data, TransDataContainer::data, TransDataContainer::data_2d, TransDataContainer::data_len, TransSnap::flag, floorf, TransData2D::loc, TransData2D::loc2d, TransSnap::mode, NLATIME_CONVERT_UNMAP, TransDataGraph::offset, SCE_SNAP, TransInfo::state, TD_INTVALUES, TD_NOTIMESNAP, TRANS_CANCEL, TRANS_DATA_CONTAINER_FIRST_SINGLE, transform_convert_flush_handle2D(), transform_snap_anim_flush_data(), TransInfo::tsnap, TransCustomDataContainer::type, and TransDataGraph::unit_scale.
Referenced by recalcData_graphedit().
|
static |
Get the effective selection of a triple for transform, i.e. return if the left handle, right handle and/or the center point should be affected by transform.
Definition at line 170 of file transform_convert_graph.cc.
References TransInfo::area, BezTriple::f1, BezTriple::f2, BezTriple::f3, ListBase::first, SpaceGraph_Runtime::flag, TransInfo::is_launch_event_drag, left, SpaceGraph::runtime, SELECT, SIPO_RUNTIME_FLAG_TWEAK_HANDLES_LEFT, SIPO_RUNTIME_FLAG_TWEAK_HANDLES_RIGHT, and ScrArea::spacedata.
Referenced by createTransGraphEditData(), and graph_key_shortest_dist().
|
static |
Definition at line 138 of file transform_convert_graph.cc.
References ELEM, TransInfo::mode, TFM_TIME_SLIDE, TFM_TIME_TRANSLATE, and TFM_TRANSLATION.
Referenced by createTransGraphEditData(), and graph_edit_use_local_center().
|
static |
Definition at line 143 of file transform_convert_graph.cc.
References TransInfo::around, graph_edit_is_translation_mode(), and V3D_AROUND_LOCAL_ORIGINS.
Referenced by createTransGraphEditData().
|
static |
Definition at line 201 of file transform_convert_graph.cc.
References FCurve::bezt, TransData::dist, fabs(), FLT_MAX, TransInfo::frame_side, FrameOnMouseSide(), graph_bezt_get_transform_selection(), min_ff(), TransData::rdist, FCurve::totvert, and BezTriple::vec.
Referenced by createTransGraphEditData().
|
static |
Definition at line 915 of file transform_convert_graph.cc.
References ANIM_animdata_context_getdata(), ANIM_animdata_filter(), ANIM_animdata_freelist(), ANIM_list_elem_update(), ANIMFILTER_CURVE_VISIBLE, ANIMFILTER_DATA_VISIBLE, ANIMFILTER_FCURVESONLY, ANIMFILTER_FOREDIT, blender::Vector< T, InlineBufferCapacity, Allocator >::append(), bAnimContext::area, TransInfo::area, BEZT_FLAG_TEMP_TAG, BKE_fcurve_handles_recalc_ex(), BKE_view_layer_active_object_get(), BKE_view_layer_synced_ensure(), bAnimContext::bmain, TransInfo::context, CTX_data_main(), bAnimContext::data, bAnimContext::datatype, fcu_test_selected(), filter(), ListBase::first, SpaceGraph::flag, flushTransGraphData(), blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), LISTBASE_FOREACH, bAnimContext::obact, bAnimContext::region, TransInfo::region, ARegion::regiontype, bAnimContext::regiontype, remake_graph_transdata(), bAnimContext::scene, TransInfo::scene, SIPO_NOREALTIMEUPDATES, bAnimContext::sl, ScrArea::spacedata, bAnimContext::spacetype, ScrArea::spacetype, test_time_fcurve(), bAnimContext::view_layer, and TransInfo::view_layer.
|
static |
Definition at line 875 of file transform_convert_graph.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), TransInfo::area, TransDataContainer::data_2d, TransDataContainer::data_len, ListBase::first, SpaceGraph::flag, blender::Span< T >::index_range(), TransData2D::loc2d, blender::threading::parallel_for(), SIPO_NOHANDLES, ScrArea::spacedata, and TRANS_DATA_CONTAINER_FIRST_SINGLE.
Referenced by recalcData_graphedit().
|
static |
Definition at line 764 of file transform_convert_graph.cc.
References BeztMap::bezt, blender::IndexRange::drop_back(), blender::MutableSpan< T >::index_range(), blender::MutableSpan< T >::size(), and BezTriple::vec.
Definition at line 989 of file transform_convert_graph.cc.
References ANIM_animdata_filter(), ANIM_animdata_freelist(), ANIM_animdata_get_context(), ANIM_editkeyframes_refresh(), ANIM_nla_mapping_apply_fcurve(), ANIM_nla_mapping_get(), ANIMFILTER_CURVE_VISIBLE, ANIMFILTER_DATA_VISIBLE, ANIMFILTER_FCURVESONLY, ANIMFILTER_FOREDIT, TransInfo::area, BEZT_FLAG_TEMP_TAG, BKE_fcurve_merge_duplicate_keys(), bAnimContext::data, bAnimContext::datatype, ListBase::first, SpaceGraph::flag, TransInfo::flag, LISTBASE_FOREACH, SIPO_NOHANDLES, SIPO_NOTRANSKEYCULL, ScrArea::spacedata, TransInfo::state, T_DUPLICATED_KEYFRAMES, and TRANS_CANCEL.
|
inlinestatic |
Definition at line 796 of file transform_convert_graph.cc.
References FCurve::bezt, BezTriple::h1, TransDataCurveHandleFlags::h1, BezTriple::h2, TransDataCurveHandleFlags::h2, TransData::hdata, and TD_BEZTRIPLE.
Referenced by update_transdata_bezt_pointers().
|
static |
Definition at line 814 of file transform_convert_graph.cc.
References BeztMap::bezt, FCurve::bezt, TransDataContainer::data, TransDataContainer::data_2d, TransData2D::h1, TransData2D::h2, blender::Span< T >::index_range(), TransData2D::loc2d, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr(), BeztMap::oldIndex, BeztMap::swap_handles, update_trans_data(), and BezTriple::vec.
| TransConvertTypeInfo TransConvertType_Graph |
Definition at line 1051 of file transform_convert_graph.cc.
Referenced by convert_type_get(), and init_proportional_edit().