Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/animation/anim_channels_defines.c
| Show First 20 Lines • Show All 4,334 Lines • ▼ Show 20 Lines | |||||
| /* callback for widget sliders - insert keyframes */ | /* callback for widget sliders - insert keyframes */ | ||||
| static void achannel_setting_slider_cb(bContext *C, void *id_poin, void *fcu_poin) | static void achannel_setting_slider_cb(bContext *C, void *id_poin, void *fcu_poin) | ||||
| { | { | ||||
| ID *id = (ID *)id_poin; | ID *id = (ID *)id_poin; | ||||
| AnimData *adt = BKE_animdata_from_id(id); | AnimData *adt = BKE_animdata_from_id(id); | ||||
| FCurve *fcu = (FCurve *)fcu_poin; | FCurve *fcu = (FCurve *)fcu_poin; | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | |||||
| ReportList *reports = CTX_wm_reports(C); | ReportList *reports = CTX_wm_reports(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| ToolSettings *ts = scene->toolsettings; | ToolSettings *ts = scene->toolsettings; | ||||
| ListBase nla_cache = {NULL, NULL}; | ListBase nla_cache = {NULL, NULL}; | ||||
| PointerRNA id_ptr, ptr; | PointerRNA id_ptr, ptr; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| short flag = 0; | short flag = 0; | ||||
| bool done = false; | bool done = false; | ||||
| float cfra; | float cfra; | ||||
| /* Get RNA pointer */ | /* Get RNA pointer */ | ||||
| RNA_id_pointer_create(id, &id_ptr); | RNA_id_pointer_create(id, &id_ptr); | ||||
| /* Get NLA context for value remapping */ | /* Get NLA context for value remapping */ | ||||
| NlaKeyframingContext *nla_context = BKE_animsys_get_nla_keyframing_context( | NlaKeyframingContext *nla_context = BKE_animsys_get_nla_keyframing_context( | ||||
| &nla_cache, depsgraph, &id_ptr, adt, (float)CFRA); | &nla_cache, &id_ptr, adt, (float)CFRA, false); | ||||
| /* get current frame and apply NLA-mapping to it (if applicable) */ | /* get current frame and apply NLA-mapping to it (if applicable) */ | ||||
| cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP); | cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP); | ||||
| /* get flags for keyframing */ | /* get flags for keyframing */ | ||||
| flag = ANIM_get_keyframing_flags(scene, 1); | flag = ANIM_get_keyframing_flags(scene, 1); | ||||
| /* try to resolve the path stored in the F-Curve */ | /* try to resolve the path stored in the F-Curve */ | ||||
| Show All 22 Lines | |||||
| /* callback for shapekey widget sliders - insert keyframes */ | /* callback for shapekey widget sliders - insert keyframes */ | ||||
| static void achannel_setting_slider_shapekey_cb(bContext *C, void *key_poin, void *kb_poin) | static void achannel_setting_slider_shapekey_cb(bContext *C, void *key_poin, void *kb_poin) | ||||
| { | { | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| Key *key = (Key *)key_poin; | Key *key = (Key *)key_poin; | ||||
| KeyBlock *kb = (KeyBlock *)kb_poin; | KeyBlock *kb = (KeyBlock *)kb_poin; | ||||
| char *rna_path = BKE_keyblock_curval_rnapath_get(key, kb); | char *rna_path = BKE_keyblock_curval_rnapath_get(key, kb); | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | |||||
| ReportList *reports = CTX_wm_reports(C); | ReportList *reports = CTX_wm_reports(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| ToolSettings *ts = scene->toolsettings; | ToolSettings *ts = scene->toolsettings; | ||||
| ListBase nla_cache = {NULL, NULL}; | ListBase nla_cache = {NULL, NULL}; | ||||
| PointerRNA id_ptr, ptr; | PointerRNA id_ptr, ptr; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| short flag = 0; | short flag = 0; | ||||
| bool done = false; | bool done = false; | ||||
| float cfra; | float cfra; | ||||
| /* Get RNA pointer */ | /* Get RNA pointer */ | ||||
| RNA_id_pointer_create((ID *)key, &id_ptr); | RNA_id_pointer_create((ID *)key, &id_ptr); | ||||
| /* Get NLA context for value remapping */ | /* Get NLA context for value remapping */ | ||||
| NlaKeyframingContext *nla_context = BKE_animsys_get_nla_keyframing_context( | NlaKeyframingContext *nla_context = BKE_animsys_get_nla_keyframing_context( | ||||
| &nla_cache, depsgraph, &id_ptr, key->adt, (float)CFRA); | &nla_cache, &id_ptr, key->adt, (float)CFRA, false); | ||||
| /* get current frame and apply NLA-mapping to it (if applicable) */ | /* get current frame and apply NLA-mapping to it (if applicable) */ | ||||
| cfra = BKE_nla_tweakedit_remap(key->adt, (float)CFRA, NLATIME_CONVERT_UNMAP); | cfra = BKE_nla_tweakedit_remap(key->adt, (float)CFRA, NLATIME_CONVERT_UNMAP); | ||||
| /* get flags for keyframing */ | /* get flags for keyframing */ | ||||
| flag = ANIM_get_keyframing_flags(scene, 1); | flag = ANIM_get_keyframing_flags(scene, 1); | ||||
| /* try to resolve the path stored in the F-Curve */ | /* try to resolve the path stored in the F-Curve */ | ||||
| ▲ Show 20 Lines • Show All 681 Lines • Show Last 20 Lines | |||||