|
Blender V4.3
|
#include "DNA_anim_types.h"#include "DNA_gpencil_legacy_types.h"#include "DNA_mask_types.h"#include "MEM_guardedalloc.h"#include "BLI_listbase.h"#include "BLI_math_vector.h"#include "BLI_rect.h"#include "BKE_context.hh"#include "BKE_fcurve.hh"#include "BKE_gpencil_legacy.h"#include "BKE_grease_pencil.hh"#include "BKE_key.hh"#include "BKE_layer.hh"#include "BKE_mask.h"#include "BKE_nla.hh"#include "ED_anim_api.hh"#include "ED_keyframes_edit.hh"#include "ED_markers.hh"#include "WM_api.hh"#include "WM_types.hh"#include "transform.hh"#include "transform_snap.hh"#include "transform_convert.hh"Go to the source code of this file.
Functions | |
| static bool | is_td2d_int (TransData2D *td2d) |
Grease Pencil Transform helpers | |
| static void | grease_pencil_transdata_add_drawing_users (const GreasePencil &grease_pencil) |
| static void | grease_pencil_transdata_remove_drawing_users (const GreasePencil &grease_pencil) |
| static bool | grease_pencil_layer_initialize_trans_data (const GreasePencil &grease_pencil, blender::bke::greasepencil::Layer &layer, const blender::Span< int > frames_affected, const bool use_duplicates) |
| static bool | grease_pencil_layer_reset_trans_data (blender::bke::greasepencil::Layer &layer) |
| static bool | grease_pencil_layer_update_trans_data (blender::bke::greasepencil::Layer &layer, const int src_frame_number, const int dst_frame_number) |
| static bool | grease_pencil_layer_apply_trans_data (GreasePencil &grease_pencil, blender::bke::greasepencil::Layer &layer, const bool canceled, const bool duplicate) |
Action Transform Creation | |
| static int | count_fcurve_keys (FCurve *fcu, char side, float cfra, bool is_prop_edit) |
| static int | count_gplayer_frames (bGPDlayer *gpl, char side, float cfra, bool is_prop_edit) |
| static int | count_grease_pencil_frames (const blender::bke::greasepencil::Layer *layer, const char side, const float cfra, const bool is_prop_edit, const bool use_duplicated) |
| static int | count_masklayer_frames (MaskLayer *masklay, char side, float cfra, bool is_prop_edit) |
| static void | TimeToTransData (TransData *td, TransData2D *td2d, BezTriple *bezt, AnimData *adt, float ypos) |
| static TransData * | ActionFCurveToTransData (TransData *td, TransData2D **td2dv, FCurve *fcu, AnimData *adt, char side, float cfra, bool is_prop_edit, float ypos) |
| static int | GPLayerToTransData (TransData *td, TransData2D *td2d, bGPDlayer *gpl, char side, float cfra, bool is_prop_edit, float ypos) |
| static int | GreasePencilLayerToTransData (TransData *td, TransData2D *td2d, GreasePencil *grease_pencil, blender::bke::greasepencil::Layer *layer, const char side, const float cfra, const bool is_prop_edit, const float ypos, const bool duplicate) |
| static int | MaskLayerToTransData (TransData *td, TransData2D *td2d, MaskLayer *masklay, char side, float cfra, bool is_prop_edit, float ypos) |
| static void | createTransActionData (bContext *C, TransInfo *t) |
Action Transform Flush | |
| static void | invert_snap (eSnapMode &snap_mode) |
| static void | recalcData_actedit (TransInfo *t) |
Special After Transform Action | |
| static int | masklay_shape_cmp_frame (void *thunk, const void *a, const void *b) |
| static void | posttrans_mask_clean (Mask *mask) |
| static void | posttrans_gpd_clean (bGPdata *gpd) |
| static void | posttrans_action_clean (bAnimContext *ac, bAction *act) |
| static void | special_aftertrans_update__actedit (bContext *C, TransInfo *t) |
Variables | |
| TransConvertTypeInfo | TransConvertType_Action |
|
static |
Definition at line 436 of file transform_convert_action.cc.
References FCurve::bezt, ELEM, BezTriple::f2, FrameOnMouseSide(), SELECT, TimeToTransData(), FCurve::totvert, and BezTriple::vec.
Referenced by createTransActionData().
Fully select selected beztriples, but only include if it's on the right side of cfra.
Definition at line 267 of file transform_convert_action.cc.
References FCurve::bezt, count, ELEM, BezTriple::f2, FrameOnMouseSide(), SELECT, FCurve::totvert, and BezTriple::vec.
Referenced by createTransActionData().
|
static |
Fully select selected beztriples, but only include if it's on the right side of cfra.
Definition at line 298 of file transform_convert_action.cc.
References count, FrameOnMouseSide(), bGPDlayer::frames, GP_FRAME_SELECT, and LISTBASE_FOREACH.
Referenced by createTransActionData().
|
static |
Definition at line 322 of file transform_convert_action.cc.
References FrameOnMouseSide().
Referenced by createTransActionData().
|
static |
Fully select selected beztriples, but only include if it's on the right side of cfra.
Definition at line 360 of file transform_convert_action.cc.
References count, FrameOnMouseSide(), LISTBASE_FOREACH, MASK_SHAPE_SELECT, and MaskLayer::splines_shapes.
Referenced by createTransActionData().
Definition at line 640 of file transform_convert_action.cc.
References abs(), ActionFCurveToTransData(), ANIM_animdata_filter(), ANIM_animdata_freelist(), ANIM_animdata_get_context(), ANIM_nla_mapping_get(), ANIMFILTER_DATA_VISIBLE, ANIMFILTER_FOREDIT, ANIMTYPE_ACTION_SLOT, ANIMTYPE_ANIMDATA, ANIMTYPE_DSARM, ANIMTYPE_DSCACHEFILE, ANIMTYPE_DSCAM, ANIMTYPE_DSCUR, ANIMTYPE_DSGPENCIL, ANIMTYPE_DSHAIR, ANIMTYPE_DSLAM, ANIMTYPE_DSLAT, ANIMTYPE_DSLINESTYLE, ANIMTYPE_DSMAT, ANIMTYPE_DSMBALL, ANIMTYPE_DSMCLIP, ANIMTYPE_DSMESH, ANIMTYPE_DSNTREE, ANIMTYPE_DSPART, ANIMTYPE_DSPOINTCLOUD, ANIMTYPE_DSSKEY, ANIMTYPE_DSSPK, ANIMTYPE_DSTEX, ANIMTYPE_DSVOLUME, ANIMTYPE_DSWOR, ANIMTYPE_FCURVE, ANIMTYPE_FILLACT_LAYERED, ANIMTYPE_FILLACTD, ANIMTYPE_FILLDRIVERS, ANIMTYPE_GPDATABLOCK, ANIMTYPE_GPLAYER, ANIMTYPE_GREASE_PENCIL_DATABLOCK, ANIMTYPE_GREASE_PENCIL_LAYER, ANIMTYPE_GREASE_PENCIL_LAYER_GROUP, ANIMTYPE_GROUP, ANIMTYPE_MASKDATABLOCK, ANIMTYPE_MASKLAYER, ANIMTYPE_NLAACTION, ANIMTYPE_NLACONTROLS, ANIMTYPE_NLACURVE, ANIMTYPE_NLATRACK, ANIMTYPE_NONE, ANIMTYPE_NUM_TYPES, ANIMTYPE_OBJECT, ANIMTYPE_PALETTE, ANIMTYPE_SCENE, ANIMTYPE_SHAPEKEY, ANIMTYPE_SPECIALDATA__UNUSED, ANIMTYPE_SUMMARY, FCurve::bezt, BKE_nla_tweakedit_remap(), BLI_assert_unreachable, BLI_rctf_cent_y(), BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_rcti_size_x(), BLI_rcti_size_y(), count, count_fcurve_keys(), count_gplayer_frames(), count_grease_pencil_frames(), count_masklayer_frames(), View2D::cur, bAnimContext::data, TransDataContainer::data, TransDataContainer::data_2d, TransDataContainer::data_len, bAnimContext::datatype, TransData::dist, ELEM, BezTriple::f2, fabs(), filter(), TransInfo::flag, float, FLT_MAX, TransInfo::frame_side, FrameOnMouseSide(), bGPDlayer::frames, GP_FRAME_SELECT, GPLayerToTransData(), GreasePencilLayerToTransData(), LISTBASE_FOREACH, View2D::mask, MASK_SHAPE_SELECT, MaskLayerToTransData(), MEM_callocN, min, TransInfo::mode, NLATIME_CONVERT_UNMAP, TransData::rdist, TransInfo::region, TransInfo::scene, SELECT, MaskLayer::splines_shapes, T_DUPLICATED_KEYFRAMES, T_PROP_EDIT, TFM_TIME_EXTEND, FCurve::totvert, TRANS_DATA_CONTAINER_FIRST_SINGLE, transform_convert_frame_side_dir_get(), ARegion::v2d, and BezTriple::vec.
|
static |
This function advances the address to which td points to, so it must return the new address so that the next time new transform data is added, it doesn't overwrite the existing ones: e.g. td += GPLayerToTransData(td, ...);
| side | is needed for the extend mode. 'B' = both sides, 'R'/'L' mean only data on the named side are used. |
Definition at line 480 of file transform_convert_action.cc.
References BLI_assert, count, float, FrameOnMouseSide(), bGPDlayer::frames, GP_FRAME_SELECT, is_td2d_int(), LISTBASE_FOREACH, TransData2D::loc, TransData2D::loc2d_i, and TD_SELECTED.
Referenced by createTransActionData().
|
static |
Definition at line 204 of file transform_convert_action.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_overwrite(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::clear(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), blender::bke::greasepencil::LayerTransformData::duplicated_frames_buffer, blender::bke::greasepencil::LayerTransformData::frames_destination, blender::bke::greasepencil::LayerTransformData::frames_static, blender::bke::greasepencil::LayerTransformData::frames_transformed, GP_DRAWING, grease_pencil_transdata_remove_drawing_users(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::items(), blender::bke::greasepencil::LayerTransformData::status, GreasePencilDrawingBase::type, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::values(), and wrap().
Referenced by special_aftertrans_update__actedit().
|
static |
Definition at line 86 of file transform_convert_action.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_overwrite(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::clear(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), blender::bke::greasepencil::LayerTransformData::duplicated_frames_buffer, blender::bke::greasepencil::LayerTransformData::frames_destination, blender::bke::greasepencil::LayerTransformData::frames_duration, blender::bke::greasepencil::LayerTransformData::frames_static, blender::bke::greasepencil::LayerTransformData::frames_transformed, grease_pencil_transdata_add_drawing_users(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove_as(), and blender::bke::greasepencil::LayerTransformData::status.
Referenced by GreasePencilLayerToTransData().
|
static |
Definition at line 147 of file transform_convert_action.cc.
References blender::bke::greasepencil::LayerTransformData::status.
Referenced by recalcData_actedit().
|
static |
Definition at line 162 of file transform_convert_action.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_overwrite(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), blender::bke::greasepencil::LayerTransformData::frames_destination, blender::bke::greasepencil::LayerTransformData::frames_duration, blender::bke::greasepencil::LayerTransformData::frames_static, blender::bke::greasepencil::LayerTransformData::frames_transformed, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default(), and blender::bke::greasepencil::LayerTransformData::status.
Referenced by recalcData_actedit().
|
static |
Definition at line 54 of file transform_convert_action.cc.
References blender::bke::greasepencil::Drawing::add_user(), GP_DRAWING, and wrap().
Referenced by grease_pencil_layer_initialize_trans_data().
|
static |
Definition at line 71 of file transform_convert_action.cc.
References GP_DRAWING, blender::bke::greasepencil::Drawing::remove_user(), and wrap().
Referenced by grease_pencil_layer_apply_trans_data().
|
static |
Fills td and td2d with transform data for each frame of the grease pencil layer that is on the side of the frame cfra. It also updates the runtime data of the layer to keep track of the transform. This is why the layer is not const here.
Definition at line 526 of file transform_convert_action.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::Vector< T, InlineBufferCapacity, Allocator >::as_span(), BLI_assert, float, FrameOnMouseSide(), grease_pencil_layer_initialize_trans_data(), is_td2d_int(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::items(), TransData2D::loc, TD_GREASE_PENCIL_FRAME, and TD_SELECTED.
Referenced by createTransActionData().
|
static |
Definition at line 999 of file transform_convert_action.cc.
References SCE_SNAP_TO_FRAME, and SCE_SNAP_TO_SECOND.
Referenced by recalcData_actedit().
|
static |
Definition at line 43 of file transform_convert_action.cc.
References TransData2D::h1, and TransData2D::loc2d_i.
Referenced by GPLayerToTransData(), GreasePencilLayerToTransData(), MaskLayerToTransData(), recalcData_actedit(), and TimeToTransData().
|
static |
Definition at line 1113 of file transform_convert_action.cc.
References b, MaskLayerShape::flag, MaskLayerShape::frame, and MASK_SHAPE_SELECT.
Referenced by posttrans_mask_clean().
|
static |
Refer to comment above GPLayerToTransData, this is the same but for masks.
Definition at line 604 of file transform_convert_action.cc.
References BLI_assert, count, float, FrameOnMouseSide(), is_td2d_int(), LISTBASE_FOREACH, TransData2D::loc, TransData2D::loc2d_i, MASK_SHAPE_SELECT, and MaskLayer::splines_shapes.
Referenced by createTransActionData().
|
static |
Called by special_aftertrans_update to make sure selected keyframes replace any other keyframes which may reside on that frame (that is not selected). remake_action_ipos should have already been called.
Definition at line 1204 of file transform_convert_action.cc.
References ANIM_animdata_filter(), ANIM_animdata_freelist(), ANIM_nla_mapping_apply_fcurve(), ANIM_nla_mapping_get(), ANIMCONT_ACTION, ANIMFILTER_DATA_VISIBLE, ANIMFILTER_FCURVESONLY, ANIMFILTER_FOREDIT, BKE_fcurve_merge_duplicate_keys(), filter(), LISTBASE_FOREACH, and SELECT.
Referenced by special_aftertrans_update__actedit().
|
static |
Definition at line 1170 of file transform_convert_action.cc.
References BKE_gpencil_layer_frame_delete(), BKE_gpencil_layer_frames_sort(), BLI_assert, DEG_id_tag_update(), bGPDframe::framenum, bGPdata::id, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, bGPdata::layers, LISTBASE_FOREACH, NA_EDITED, NC_GPENCIL, bGPDframe::next, and WM_main_add_notifier().
Referenced by special_aftertrans_update__actedit().
|
static |
Definition at line 1132 of file transform_convert_action.cc.
References BKE_mask_layer_shape_unlink(), BLI_assert, BLI_listbase_sort_r(), MaskLayerShape::frame, LISTBASE_FOREACH, masklay_shape_cmp_frame(), NA_EDITED, NC_MASK, MaskLayerShape::next, and WM_main_add_notifier().
Referenced by special_aftertrans_update__actedit().
|
static |
Definition at line 1013 of file transform_convert_action.cc.
References ANIM_animdata_context_getdata(), ANIM_animdata_filter(), ANIM_animdata_freelist(), ANIM_list_elem_update(), ANIMCONT_MASK, ANIMFILTER_ANIMDATA, ANIMFILTER_DATA_VISIBLE, ANIMTYPE_GREASE_PENCIL_LAYER, bAnimContext::area, TransInfo::area, BKE_view_layer_active_object_get(), BKE_view_layer_synced_ensure(), bAnimContext::bmain, TransInfo::context, CTX_data_main(), bAnimContext::data, TransDataContainer::data, TransDataContainer::data_2d, TransDataContainer::data_len, bAnimContext::datatype, filter(), ListBase::first, SpaceAction::flag, TransSnap::flag, grease_pencil_layer_reset_trans_data(), grease_pencil_layer_update_trans_data(), invert_snap(), is_td2d_int(), LISTBASE_FOREACH, TransData2D::loc, TransData2D::loc2d_i, MOD_SNAP_INVERT, TransSnap::mode, TransInfo::modifiers, bAnimContext::obact, bAnimContext::region, TransInfo::region, ARegion::regiontype, bAnimContext::regiontype, round_fl_to_int(), SACTION_NOREALTIMEUPDATES, SCE_SNAP, bAnimContext::scene, TransInfo::scene, bAnimContext::sl, ScrArea::spacedata, bAnimContext::spacetype, ScrArea::spacetype, TransInfo::state, TD_GREASE_PENCIL_FRAME, TD_NOTIMESNAP, TRANS_CANCEL, TRANS_DATA_CONTAINER_FIRST_SINGLE, TRANS_RUNNING, transform_convert_flush_handle2D(), transform_snap_anim_flush_data(), TransInfo::tsnap, bAnimContext::view_layer, and TransInfo::view_layer.
Definition at line 1237 of file transform_convert_action.cc.
References ALE_FCURVE, ALE_GPFRAME, ALE_GREASE_PENCIL_CEL, ALE_MASKLAY, ANIM_animdata_filter(), ANIM_animdata_freelist(), ANIM_animdata_get_context(), ANIM_editkeyframes_refresh(), ANIM_nla_mapping_apply_fcurve(), ANIM_nla_mapping_get(), ANIMCONT_ACTION, ANIMCONT_DOPESHEET, ANIMCONT_GPENCIL, ANIMCONT_MASK, ANIMCONT_SHAPEKEY, ANIMCONT_TIMELINE, ANIMFILTER_DATA_VISIBLE, ANIMFILTER_FOREDIT, TransInfo::area, BKE_fcurve_merge_duplicate_keys(), BKE_key_from_object(), BLI_assert_msg, bAnimContext::data, bAnimContext::datatype, DEG_id_tag_update(), ED_context_get_markers(), ED_markers_post_apply_transform(), ELEM, ListBase::first, SpaceAction::flag, TransInfo::flag, TransInfo::frame_side, grease_pencil_layer_apply_trans_data(), Object::id, ID_RECALC_ANIMATION, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, LISTBASE_FOREACH, TransInfo::mode, bAnimContext::obact, Object::pose, posttrans_action_clean(), posttrans_gpd_clean(), posttrans_mask_clean(), SACTION_MARKERS_MOVE, SACTION_NOTRANSKEYCULL, TransInfo::scene, SELECT, ScrArea::spacedata, TransInfo::state, T_DUPLICATED_KEYFRAMES, TFM_TIME_SCALE, TFM_TIME_TRANSLATE, TRANS_CANCEL, and TransInfo::values_final.
|
static |
Definition at line 385 of file transform_convert_action.cc.
References BKE_nla_tweakedit_remap(), BLI_assert, copy_v2_v2(), copy_v3_v3(), BezTriple::f2, TransData2D::h1, TransData2D::h2, TransData2D::ih1, TransData2D::ih2, is_td2d_int(), TransData2D::loc, TransData2D::loc2d, NLATIME_CONVERT_MAP, SELECT, TD_MOVEHANDLE1, TD_MOVEHANDLE2, TD_SELECTED, time, and BezTriple::vec.
Referenced by ActionFCurveToTransData().
| TransConvertTypeInfo TransConvertType_Action |
Definition at line 1432 of file transform_convert_action.cc.
Referenced by convert_type_get(), and init_proportional_edit().