diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:17:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:21:24 +0300 |
commit | e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch) | |
tree | 8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/editors/space_nla/nla_ops.c | |
parent | b3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff) |
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/editors/space_nla/nla_ops.c')
-rw-r--r-- | source/blender/editors/space_nla/nla_ops.c | 189 |
1 files changed, 94 insertions, 95 deletions
diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index 6653c3995b5..51d6232cf71 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -40,7 +40,6 @@ #include "RNA_access.h" - #include "nla_intern.h" /* own include */ /* ************************** poll callbacks for operators **********************************/ @@ -48,138 +47,138 @@ /* tweakmode is NOT enabled */ bool nlaop_poll_tweakmode_off(bContext *C) { - Scene *scene; - - /* for now, we check 2 things: - * 1) active editor must be NLA - * 2) tweakmode is currently set as a 'per-scene' flag - * so that it will affect entire NLA data-sets, - * but not all AnimData blocks will be in tweakmode for - * various reasons - */ - if (ED_operator_nla_active(C) == 0) - return 0; - - scene = CTX_data_scene(C); - if ((scene == NULL) || (scene->flag & SCE_NLA_EDIT_ON)) - return 0; - - return 1; + Scene *scene; + + /* for now, we check 2 things: + * 1) active editor must be NLA + * 2) tweakmode is currently set as a 'per-scene' flag + * so that it will affect entire NLA data-sets, + * but not all AnimData blocks will be in tweakmode for + * various reasons + */ + if (ED_operator_nla_active(C) == 0) + return 0; + + scene = CTX_data_scene(C); + if ((scene == NULL) || (scene->flag & SCE_NLA_EDIT_ON)) + return 0; + + return 1; } /* tweakmode IS enabled */ bool nlaop_poll_tweakmode_on(bContext *C) { - Scene *scene; - - /* for now, we check 2 things: - * 1) active editor must be NLA - * 2) tweakmode is currently set as a 'per-scene' flag - * so that it will affect entire NLA data-sets, - * but not all AnimData blocks will be in tweakmode for - * various reasons - */ - if (ED_operator_nla_active(C) == 0) - return 0; - - scene = CTX_data_scene(C); - if ((scene == NULL) || !(scene->flag & SCE_NLA_EDIT_ON)) - return 0; - - return 1; + Scene *scene; + + /* for now, we check 2 things: + * 1) active editor must be NLA + * 2) tweakmode is currently set as a 'per-scene' flag + * so that it will affect entire NLA data-sets, + * but not all AnimData blocks will be in tweakmode for + * various reasons + */ + if (ED_operator_nla_active(C) == 0) + return 0; + + scene = CTX_data_scene(C); + if ((scene == NULL) || !(scene->flag & SCE_NLA_EDIT_ON)) + return 0; + + return 1; } /* is tweakmode enabled - for use in NLA operator code */ bool nlaedit_is_tweakmode_on(bAnimContext *ac) { - if (ac && ac->scene) - return (ac->scene->flag & SCE_NLA_EDIT_ON) != 0; - return 0; + if (ac && ac->scene) + return (ac->scene->flag & SCE_NLA_EDIT_ON) != 0; + return 0; } /* ************************** registration - operator types **********************************/ void nla_operatortypes(void) { - /* view */ - WM_operatortype_append(NLA_OT_properties); + /* view */ + WM_operatortype_append(NLA_OT_properties); - /* channels */ - WM_operatortype_append(NLA_OT_channels_click); + /* channels */ + WM_operatortype_append(NLA_OT_channels_click); - WM_operatortype_append(NLA_OT_action_pushdown); - WM_operatortype_append(NLA_OT_action_unlink); + WM_operatortype_append(NLA_OT_action_pushdown); + WM_operatortype_append(NLA_OT_action_unlink); - WM_operatortype_append(NLA_OT_tracks_add); - WM_operatortype_append(NLA_OT_tracks_delete); + WM_operatortype_append(NLA_OT_tracks_add); + WM_operatortype_append(NLA_OT_tracks_delete); - WM_operatortype_append(NLA_OT_selected_objects_add); + WM_operatortype_append(NLA_OT_selected_objects_add); - /* select */ - WM_operatortype_append(NLA_OT_click_select); - WM_operatortype_append(NLA_OT_select_box); - WM_operatortype_append(NLA_OT_select_all); - WM_operatortype_append(NLA_OT_select_leftright); + /* select */ + WM_operatortype_append(NLA_OT_click_select); + WM_operatortype_append(NLA_OT_select_box); + WM_operatortype_append(NLA_OT_select_all); + WM_operatortype_append(NLA_OT_select_leftright); - /* view */ - WM_operatortype_append(NLA_OT_view_all); - WM_operatortype_append(NLA_OT_view_selected); - WM_operatortype_append(NLA_OT_view_frame); + /* view */ + WM_operatortype_append(NLA_OT_view_all); + WM_operatortype_append(NLA_OT_view_selected); + WM_operatortype_append(NLA_OT_view_frame); - WM_operatortype_append(NLA_OT_previewrange_set); + WM_operatortype_append(NLA_OT_previewrange_set); - /* edit */ - WM_operatortype_append(NLA_OT_tweakmode_enter); - WM_operatortype_append(NLA_OT_tweakmode_exit); + /* edit */ + WM_operatortype_append(NLA_OT_tweakmode_enter); + WM_operatortype_append(NLA_OT_tweakmode_exit); - WM_operatortype_append(NLA_OT_actionclip_add); - WM_operatortype_append(NLA_OT_transition_add); - WM_operatortype_append(NLA_OT_soundclip_add); + WM_operatortype_append(NLA_OT_actionclip_add); + WM_operatortype_append(NLA_OT_transition_add); + WM_operatortype_append(NLA_OT_soundclip_add); - WM_operatortype_append(NLA_OT_meta_add); - WM_operatortype_append(NLA_OT_meta_remove); + WM_operatortype_append(NLA_OT_meta_add); + WM_operatortype_append(NLA_OT_meta_remove); - WM_operatortype_append(NLA_OT_duplicate); - WM_operatortype_append(NLA_OT_delete); - WM_operatortype_append(NLA_OT_split); + WM_operatortype_append(NLA_OT_duplicate); + WM_operatortype_append(NLA_OT_delete); + WM_operatortype_append(NLA_OT_split); - WM_operatortype_append(NLA_OT_mute_toggle); + WM_operatortype_append(NLA_OT_mute_toggle); - WM_operatortype_append(NLA_OT_swap); - WM_operatortype_append(NLA_OT_move_up); - WM_operatortype_append(NLA_OT_move_down); + WM_operatortype_append(NLA_OT_swap); + WM_operatortype_append(NLA_OT_move_up); + WM_operatortype_append(NLA_OT_move_down); - WM_operatortype_append(NLA_OT_action_sync_length); + WM_operatortype_append(NLA_OT_action_sync_length); - WM_operatortype_append(NLA_OT_make_single_user); + WM_operatortype_append(NLA_OT_make_single_user); - WM_operatortype_append(NLA_OT_apply_scale); - WM_operatortype_append(NLA_OT_clear_scale); + WM_operatortype_append(NLA_OT_apply_scale); + WM_operatortype_append(NLA_OT_clear_scale); - WM_operatortype_append(NLA_OT_snap); + WM_operatortype_append(NLA_OT_snap); - WM_operatortype_append(NLA_OT_fmodifier_add); - WM_operatortype_append(NLA_OT_fmodifier_copy); - WM_operatortype_append(NLA_OT_fmodifier_paste); + WM_operatortype_append(NLA_OT_fmodifier_add); + WM_operatortype_append(NLA_OT_fmodifier_copy); + WM_operatortype_append(NLA_OT_fmodifier_paste); } /* ************************** registration - keymaps **********************************/ void nla_keymap(wmKeyConfig *keyconf) { - /* keymap for all regions ------------------------------------------- */ - WM_keymap_ensure(keyconf, "NLA Generic", SPACE_NLA, 0); - - /* channels ---------------------------------------------------------- */ - /* Channels are not directly handled by the NLA Editor module, but are inherited from the Animation module. - * Most of the relevant operations, keymaps, drawing, etc. can therefore all - * be found in that module instead, as there are many similarities with the other Animation Editors. - * - * However, those operations which involve clicking on channels and/or - * the placement of them in the view are implemented here instead - */ - WM_keymap_ensure(keyconf, "NLA Channels", SPACE_NLA, 0); - - /* data ------------------------------------------------------------- */ - WM_keymap_ensure(keyconf, "NLA Editor", SPACE_NLA, 0); + /* keymap for all regions ------------------------------------------- */ + WM_keymap_ensure(keyconf, "NLA Generic", SPACE_NLA, 0); + + /* channels ---------------------------------------------------------- */ + /* Channels are not directly handled by the NLA Editor module, but are inherited from the Animation module. + * Most of the relevant operations, keymaps, drawing, etc. can therefore all + * be found in that module instead, as there are many similarities with the other Animation Editors. + * + * However, those operations which involve clicking on channels and/or + * the placement of them in the view are implemented here instead + */ + WM_keymap_ensure(keyconf, "NLA Channels", SPACE_NLA, 0); + + /* data ------------------------------------------------------------- */ + WM_keymap_ensure(keyconf, "NLA Editor", SPACE_NLA, 0); } |