From 237175e7470c7a7bda7a5bd128bcbcb059c84073 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 14 Feb 2021 11:59:31 +1100 Subject: Cleanup: use doxy sections --- source/blender/editors/physics/particle_edit.c | 303 +++++++++++++++------- source/blender/editors/space_nla/nla_edit.c | 230 ++++++++++++---- source/blender/editors/space_view3d/view3d_draw.c | 42 ++- 3 files changed, 426 insertions(+), 149 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index d7e30f2b65c..ec3eb9c6a3a 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -88,7 +88,9 @@ #include "particle_edit_utildefines.h" -/**************************** utilities *******************************/ +/* -------------------------------------------------------------------- */ +/** \name Public Utilities + * \{ */ bool PE_poll(bContext *C) { @@ -178,9 +180,56 @@ void PE_free_ptcache_edit(PTCacheEdit *edit) MEM_freeN(edit); } -/************************************************/ -/* Edit Mode Helpers */ -/************************************************/ +int PE_minmax( + Depsgraph *depsgraph, Scene *scene, ViewLayer *view_layer, float min[3], float max[3]) +{ + Object *ob = OBACT(view_layer); + PTCacheEdit *edit = PE_get_current(depsgraph, scene, ob); + ParticleSystem *psys; + ParticleSystemModifierData *psmd_eval = NULL; + POINT_P; + KEY_K; + float co[3], mat[4][4]; + int ok = 0; + + if (!edit) { + return ok; + } + + if ((psys = edit->psys)) { + psmd_eval = edit->psmd_eval; + } + else { + unit_m4(mat); + } + + LOOP_VISIBLE_POINTS { + if (psys) { + psys_mat_hair_to_global( + ob, psmd_eval->mesh_final, psys->part->from, psys->particles + p, mat); + } + + LOOP_SELECTED_KEYS { + copy_v3_v3(co, key->co); + mul_m4_v3(mat, co); + DO_MINMAX(co, min, max); + ok = 1; + } + } + + if (!ok) { + BKE_object_minmax(ob, min, max, true); + ok = 1; + } + + return ok; +} + +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Edit Mode Helpers + * \{ */ int PE_start_edit(PTCacheEdit *edit) { @@ -409,7 +458,11 @@ static int pe_x_mirror(Object *ob) return 0; } -/****************** common struct passed to callbacks ******************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Common Struct Passed to Callbacks + * \{ */ typedef struct PEData { ViewContext vc; @@ -519,7 +572,11 @@ static void PE_free_random_generator(PEData *data) } } -/*************************** selection utilities *******************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Selection Utilities + * \{ */ static bool key_test_depth(const PEData *data, const float co[3], const int screen_co[2]) { @@ -632,7 +689,11 @@ static bool point_is_selected(PTCacheEditPoint *point) return 0; } -/*************************** iterators *******************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Iterators + * \{ */ typedef void (*ForPointFunc)(PEData *data, int point_index); typedef void (*ForHitPointFunc)(PEData *data, int point_index, float mouse_distance); @@ -905,9 +966,11 @@ static int count_selected_keys(Scene *scene, PTCacheEdit *edit) return sel; } -/************************************************/ -/* Particle Edit Mirroring */ -/************************************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Particle Edit Mirroring + * \{ */ static void PE_update_mirror_cache(Object *ob, ParticleSystem *psys) { @@ -1115,9 +1178,11 @@ static void PE_apply_mirror(Object *ob, ParticleSystem *psys) } } -/************************************************/ -/* Edit Calculation */ -/************************************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Edit Calculation + * \{ */ typedef struct DeflectEmitterIter { Object *object; @@ -1605,9 +1670,11 @@ void PE_update_object(Depsgraph *depsgraph, Scene *scene, Object *ob, int usefla } } -/************************************************/ -/* Edit Selections */ -/************************************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Edit Selections + * \{ */ /*-----selection callbacks-----*/ @@ -1703,7 +1770,11 @@ static void toggle_key_select(PEData *data, int point_index, int key_index, bool data->is_changed = true; } -/************************ de select all operator ************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name De-Select All Operator + * \{ */ static bool select_action_apply(PTCacheEditPoint *point, PTCacheEditKey *key, int action) { @@ -1794,7 +1865,11 @@ void PARTICLE_OT_select_all(wmOperatorType *ot) WM_operator_properties_select_all(ot); } -/************************ pick select operator ************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Pick Select Operator + * \{ */ bool PE_mouse_particles(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle) { @@ -1843,7 +1918,11 @@ bool PE_mouse_particles(bContext *C, const int mval[2], bool extend, bool desele return true; } -/************************ select root operator ************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Select Root Operator + * \{ */ static void select_root(PEData *data, int point_index) { @@ -1906,7 +1985,11 @@ void PARTICLE_OT_select_roots(wmOperatorType *ot) WM_operator_properties_select_action(ot, SEL_SELECT, false); } -/************************ select tip operator ************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Select Tip Operator + * \{ */ static void select_tip(PEData *data, int point_index) { @@ -1977,7 +2060,11 @@ void PARTICLE_OT_select_tips(wmOperatorType *ot) WM_operator_properties_select_action(ot, SEL_SELECT, false); } -/*********************** select random operator ************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Select Random Operator + * \{ */ enum { RAN_HAIR, RAN_POINTS }; @@ -2064,7 +2151,11 @@ void PARTICLE_OT_select_random(wmOperatorType *ot) "Select either hair or points"); } -/************************ select linked operator ************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Select Linked operator + * \{ */ static int select_linked_exec(bContext *C, wmOperator *UNUSED(op)) { @@ -2146,7 +2237,12 @@ void PARTICLE_OT_select_linked_pick(wmOperatorType *ot) RNA_def_int_vector(ot->srna, "location", 2, NULL, 0, INT_MAX, "Location", "", 0, 16384); } -/************************ box select operator ************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Box Select Operator + * \{ */ + bool PE_deselect_all_visible_ex(PTCacheEdit *edit) { bool changed = false; @@ -2211,7 +2307,11 @@ bool PE_box_select(bContext *C, const rcti *rect, const int sel_op) return data.is_changed; } -/************************ circle select operator ************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Circle Select Operator + * \{ */ bool PE_circle_select(bContext *C, const int sel_op, const int mval[2], float rad) { @@ -2244,7 +2344,11 @@ bool PE_circle_select(bContext *C, const int sel_op, const int mval[2], float ra return data.is_changed; } -/************************ lasso select operator ************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Lasso Select Operator + * \{ */ int PE_lasso_select(bContext *C, const int mcoords[][2], const int mcoords_len, const int sel_op) { @@ -2331,7 +2435,11 @@ int PE_lasso_select(bContext *C, const int mcoords[][2], const int mcoords_len, return OPERATOR_CANCELLED; } -/*************************** hide operator **************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Hide Operator + * \{ */ static int hide_exec(bContext *C, wmOperator *op) { @@ -2388,7 +2496,11 @@ void PARTICLE_OT_hide(wmOperatorType *ot) RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected"); } -/*************************** reveal operator **************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Reveal Operator + * \{ */ static int reveal_exec(bContext *C, wmOperator *op) { @@ -2435,7 +2547,11 @@ void PARTICLE_OT_reveal(wmOperatorType *ot) RNA_def_boolean(ot->srna, "select", true, "Select", ""); } -/************************ select less operator ************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Select Less Operator + * \{ */ static void select_less_keys(PEData *data, int point_index) { @@ -2498,7 +2614,11 @@ void PARTICLE_OT_select_less(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/************************ select more operator ************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Select More Operator + * \{ */ static void select_more_keys(PEData *data, int point_index) { @@ -2566,7 +2686,11 @@ void PARTICLE_OT_select_more(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/************************ rekey operator ************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Re-Key Operator + * \{ */ static void rekey_particle(PEData *data, int pa_index) { @@ -2723,7 +2847,11 @@ static void rekey_particle_to_time( pa->flag &= ~PARS_REKEY; } -/************************* utilities **************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Internal Utilities + * \{ */ static int remove_tagged_particles(Object *ob, ParticleSystem *psys, int mirror) { @@ -2905,7 +3033,11 @@ static void remove_tagged_keys(Depsgraph *depsgraph, Object *ob, ParticleSystem } } -/************************ subdivide operator *********************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Subdivide Operator + * \{ */ /* works like normal edit mode subdivide, inserts keys between neighboring selected keys */ static void subdivide_particle(PEData *data, int pa_index) @@ -3029,7 +3161,11 @@ void PARTICLE_OT_subdivide(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/************************ remove doubles operator *********************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Remove Doubles Operator + * \{ */ static int remove_doubles_exec(bContext *C, wmOperator *op) { @@ -3192,7 +3328,11 @@ void PARTICLE_OT_weight_set(wmOperatorType *ot) 1); } -/************************ cursor drawing *******************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Cursor Drawing + * \{ */ static void brush_drawcursor(bContext *C, int x, int y, void *UNUSED(customdata)) { @@ -3238,7 +3378,11 @@ static void toggle_particle_cursor(Scene *scene, bool enable) } } -/*************************** delete operator **************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Delete Operator + * \{ */ enum { DEL_PARTICLE, DEL_KEY }; @@ -3314,7 +3458,11 @@ void PARTICLE_OT_delete(wmOperatorType *ot) "Delete a full particle or only keys"); } -/*************************** mirror operator **************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Mirror Operator + * \{ */ static void PE_mirror_x(Depsgraph *depsgraph, Scene *scene, Object *ob, int tagged) { @@ -3526,7 +3674,11 @@ void PARTICLE_OT_mirror(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/************************* brush edit callbacks ********************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Brush Edit Callbacks + * \{ */ static void brush_comb(PEData *data, float UNUSED(mat[4][4]), @@ -4474,7 +4626,11 @@ static int brush_add(const bContext *C, PEData *data, short number) return n; } -/************************* brush edit operator ********************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Brush Edit Operator + * \{ */ typedef struct BrushEdit { Scene *scene; @@ -4864,7 +5020,11 @@ void PARTICLE_OT_brush_edit(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); } -/*********************** cut shape ***************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Cut Shape + * \{ */ static bool shape_cut_poll(bContext *C) { @@ -5070,54 +5230,11 @@ void PARTICLE_OT_shape_cut(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/************************ utilities ******************************/ - -int PE_minmax( - Depsgraph *depsgraph, Scene *scene, ViewLayer *view_layer, float min[3], float max[3]) -{ - Object *ob = OBACT(view_layer); - PTCacheEdit *edit = PE_get_current(depsgraph, scene, ob); - ParticleSystem *psys; - ParticleSystemModifierData *psmd_eval = NULL; - POINT_P; - KEY_K; - float co[3], mat[4][4]; - int ok = 0; - - if (!edit) { - return ok; - } - - if ((psys = edit->psys)) { - psmd_eval = edit->psmd_eval; - } - else { - unit_m4(mat); - } +/** \} */ - LOOP_VISIBLE_POINTS { - if (psys) { - psys_mat_hair_to_global( - ob, psmd_eval->mesh_final, psys->part->from, psys->particles + p, mat); - } - - LOOP_SELECTED_KEYS { - copy_v3_v3(co, key->co); - mul_m4_v3(mat, co); - DO_MINMAX(co, min, max); - ok = 1; - } - } - - if (!ok) { - BKE_object_minmax(ob, min, max, true); - ok = 1; - } - - return ok; -} - -/************************ particle edit toggle operator ************************/ +/* -------------------------------------------------------------------- */ +/** \name Particle Edit Toggle Operator + * \{ */ /* initialize needed data for bake edit */ void PE_create_particle_edit( @@ -5371,7 +5488,11 @@ void PARTICLE_OT_particle_edit_toggle(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/************************ set editable operator ************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Set Editable Operator + * \{ */ static int clear_edited_exec(bContext *C, wmOperator *UNUSED(op)) { @@ -5421,7 +5542,11 @@ void PARTICLE_OT_edited_clear(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/************************ Unify length operator ************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Unify length operator + * \{ */ static float calculate_point_length(PTCacheEditPoint *point) { @@ -5533,3 +5658,5 @@ void PARTICLE_OT_unify_length(struct wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } + +/** \} */ diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 7bfb753474d..dd381cc92fb 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -67,8 +67,9 @@ #include "nla_intern.h" /* own include */ #include "nla_private.h" /* FIXME... maybe this shouldn't be included? */ -/* *********************************************** */ -/* Utilities exported to other places... */ +/* -------------------------------------------------------------------- */ +/** \name Public Utilities + * \{ */ /* Perform validation for blending/extend settings */ void ED_nla_postop_refresh(bAnimContext *ac) @@ -92,14 +93,18 @@ void ED_nla_postop_refresh(bAnimContext *ac) ANIM_animdata_freelist(&anim_data); } -/* *********************************************** */ +/** \} */ + /* 'Special' Editing */ -/* ******************** Tweak-Mode Operators ***************************** */ /* 'Tweak mode' allows the action referenced by the active NLA-strip to be edited * as if it were the normal Active-Action of its AnimData block. */ +/* -------------------------------------------------------------------- */ +/** \name Enable Tweak-Mode Operator + * \{ */ + static int nlaedit_enable_tweakmode_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -195,7 +200,11 @@ void NLA_OT_tweakmode_enter(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_SKIP_SAVE); } -/* ------------- */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Disable Tweak-Mode Operator + * \{ */ /* NLA Editor internal API function for exiting tweakmode */ bool nlaedit_disable_tweakmode(bAnimContext *ac, bool do_solo) @@ -297,10 +306,13 @@ void NLA_OT_tweakmode_exit(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_SKIP_SAVE); } -/* *********************************************** */ +/** \} */ + /* NLA Strips Range Stuff */ -/* *************************** Calculate Range ************************** */ +/* -------------------------------------------------------------------- */ +/** \name Calculate NLA Strip Range + * \{ */ /* Get the min/max strip extents */ static void get_nlastrip_extents(bAnimContext *ac, float *min, float *max, const bool only_sel) @@ -354,7 +366,11 @@ static void get_nlastrip_extents(bAnimContext *ac, float *min, float *max, const } } -/* ****************** Automatic Preview-Range Operator ****************** */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Automatic Preview-Range Operator + * \{ */ static int nlaedit_previewrange_exec(bContext *C, wmOperator *UNUSED(op)) { @@ -401,7 +417,11 @@ void NLA_OT_previewrange_set(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/* ****************** View-All Operator ****************** */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name View-All Operator + * \{ */ /** * Find the extents of the active channel @@ -549,7 +569,11 @@ void NLA_OT_view_selected(wmOperatorType *ot) ot->flag = 0; } -/* *********************************************** */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name View-Frame Operator + * \{ */ static int nlaedit_viewframe_exec(bContext *C, wmOperator *op) { @@ -573,12 +597,16 @@ void NLA_OT_view_frame(wmOperatorType *ot) ot->flag = 0; } -/* *********************************************** */ +/** \} */ + /* NLA Editing Operations (Constructive/Destructive) */ -/* ******************** Add Action-Clip Operator ***************************** */ -/* Add a new Action-Clip strip to the active track - * (or the active block if no space in the track) */ +/* -------------------------------------------------------------------- */ +/** \name Add Action-Clip Operator + * + * Add a new Action-Clip strip to the active track + * (or the active block if no space in the track). + * \{ */ /* add the specified action as new strip */ static int nlaedit_add_actionclip_exec(bContext *C, wmOperator *op) @@ -724,8 +752,13 @@ void NLA_OT_actionclip_add(wmOperatorType *ot) ot->prop = prop; } -/* ******************** Add Transition Operator ***************************** */ -/* Add a new transition strip between selected strips */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Add Transition Operator + * + * Add a new transition strip between selected strips. + * \{ */ static int nlaedit_add_transition_exec(bContext *C, wmOperator *op) { @@ -849,8 +882,11 @@ void NLA_OT_transition_add(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/* ******************** Add Sound Clip Operator ***************************** */ -/* Add a new sound clip */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Add Sound Clip Operator + * \{ */ static int nlaedit_add_sound_exec(bContext *C, wmOperator *UNUSED(op)) { @@ -940,8 +976,13 @@ void NLA_OT_soundclip_add(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/* ******************** Add Meta-Strip Operator ***************************** */ -/* Add new meta-strips incorporating the selected strips */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Add Meta-Strip Operator + * + * Add new meta-strips incorporating the selected strips. + * \{ */ /* add the specified action as new strip */ static int nlaedit_add_meta_exec(bContext *C, wmOperator *UNUSED(op)) @@ -1012,8 +1053,13 @@ void NLA_OT_meta_add(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/* ******************** Remove Meta-Strip Operator ***************************** */ -/* Separate out the strips held by the selected meta-strips */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Remove Meta-Strip Operator + * + * Separate out the strips held by the selected meta-strips. + * \{ */ static int nlaedit_remove_meta_exec(bContext *C, wmOperator *UNUSED(op)) { @@ -1073,10 +1119,14 @@ void NLA_OT_meta_remove(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/* ******************** Duplicate Strips Operator ************************** */ -/* Duplicates the selected NLA-Strips, putting them on new tracks above the one - * the originals were housed in. - */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Duplicate Strips Operator + * + * Duplicates the selected NLA-Strips, + * putting them on new tracks above the one the originals were housed in. + * \{ */ static int nlaedit_duplicate_exec(bContext *C, wmOperator *op) { @@ -1200,8 +1250,13 @@ void NLA_OT_duplicate(wmOperatorType *ot) RNA_def_enum(ot->srna, "mode", rna_enum_transform_mode_types, TFM_TRANSLATION, "Mode", ""); } -/* ******************** Delete Strips Operator ***************************** */ -/* Deletes the selected NLA-Strips */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Delete Strips Operator + * + * Deletes the selected NLA-Strips. + * \{ */ static int nlaedit_delete_exec(bContext *C, wmOperator *UNUSED(op)) { @@ -1280,11 +1335,17 @@ void NLA_OT_delete(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/* ******************** Split Strips Operator ***************************** */ -/* Splits the selected NLA-Strips into two strips at the midpoint of the strip */ -/* TODO's? - * - multiple splits - * - variable-length splits? */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Split Strips Operator + * + * Splits the selected NLA-Strips into two strips at the midpoint of the strip. + * + * TODO's? + * - multiple splits + * - variable-length splits? + * \{ */ /* split a given Action-Clip strip */ static void nlaedit_split_strip_actclip( @@ -1435,11 +1496,15 @@ void NLA_OT_split(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/* *********************************************** */ +/** \} */ + /* NLA Editing Operations (Modifying) */ -/* ******************** Toggle Muting Operator ************************** */ -/* Toggles whether strips are muted or not */ +/* -------------------------------------------------------------------- */ +/** \name Toggle Muting Operator + * + * Toggles whether strips are muted or not. + * \{ */ static int nlaedit_toggle_mute_exec(bContext *C, wmOperator *UNUSED(op)) { @@ -1502,8 +1567,13 @@ void NLA_OT_mute_toggle(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/* ******************** Swap Strips Operator ************************** */ -/* Tries to exchange strips within their owner tracks */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Swap Strips Operator + * + * Tries to exchange strips within their owner tracks. + * \{ */ static int nlaedit_swap_exec(bContext *C, wmOperator *op) { @@ -1679,8 +1749,13 @@ void NLA_OT_swap(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/* ******************** Move Strips Up Operator ************************** */ -/* Tries to move the selected strips into the track above if possible. */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Move Strips Up Operator + * + * Tries to move the selected strips into the track above if possible. + * \{ */ static int nlaedit_move_up_exec(bContext *C, wmOperator *UNUSED(op)) { @@ -1765,8 +1840,13 @@ void NLA_OT_move_up(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/* ******************** Move Strips Down Operator ************************** */ -/* Tries to move the selected strips into the track above if possible. */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Move Strips Down Operator + * + * Tries to move the selected strips into the track above if possible. + * \{ */ static int nlaedit_move_down_exec(bContext *C, wmOperator *UNUSED(op)) { @@ -1851,8 +1931,13 @@ void NLA_OT_move_down(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/* ******************** Sync Action Length Operator ***************************** */ -/* Recalculate the extents of the action ranges used for the selected strips */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Sync Action Length Operator + * + * Recalculate the extents of the action ranges used for the selected strips. + * \{ */ static int nlaedit_sync_actlen_exec(bContext *C, wmOperator *op) { @@ -1940,8 +2025,13 @@ void NLA_OT_action_sync_length(wmOperatorType *ot) "Only sync the active length for the active strip"); } -/* ******************** Make Single User ********************************* */ -/* Ensure that each strip has its own action */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Make Single User + * + * Ensure that each strip has its own action. + * \{ */ static int nlaedit_make_single_user_exec(bContext *C, wmOperator *UNUSED(op)) { @@ -2026,8 +2116,13 @@ void NLA_OT_make_single_user(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/* ******************** Apply Scale Operator ***************************** */ -/* Reset the scaling of the selected strips to 1.0f */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Apply Scale Operator + * + * Reset the scaling of the selected strips to 1.0f. + * \{ */ /* apply scaling to keyframe */ static short bezt_apply_nlamapping(KeyframeEditData *ked, BezTriple *bezt) @@ -2139,8 +2234,13 @@ void NLA_OT_apply_scale(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/* ******************** Clear Scale Operator ***************************** */ -/* Reset the scaling of the selected strips to 1.0f */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Clear Scale Operator + * + * Reset the scaling of the selected strips to 1.0f. + * \{ */ static int nlaedit_clear_scale_exec(bContext *C, wmOperator *UNUSED(op)) { @@ -2204,8 +2304,13 @@ void NLA_OT_clear_scale(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/* ******************** Snap Strips Operator ************************** */ -/* Moves the start-point of the selected strips to the specified places */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Snap Strips Operator + * + * Moves the start-point of the selected strips to the specified places. + * \{ */ /* defines for snap keyframes tool */ static const EnumPropertyItem prop_nlaedit_snap_types[] = { @@ -2366,10 +2471,13 @@ void NLA_OT_snap(wmOperatorType *ot) ot->prop = RNA_def_enum(ot->srna, "type", prop_nlaedit_snap_types, 0, "Type", ""); } -/* *********************************************** */ +/** \} */ + /* NLA Modifiers */ -/* ******************** Add F-Modifier Operator *********************** */ +/* -------------------------------------------------------------------- */ +/** \name Add F-Modifier Operator + * \{ */ static const EnumPropertyItem *nla_fmodifier_itemf(bContext *C, PointerRNA *UNUSED(ptr), @@ -2515,7 +2623,11 @@ void NLA_OT_fmodifier_add(wmOperatorType *ot) "Only add a F-Modifier of the specified type to the active strip"); } -/* ******************** Copy F-Modifiers Operator *********************** */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Copy F-Modifiers Operator + * \{ */ static int nla_fmodifier_copy_exec(bContext *C, wmOperator *op) { @@ -2590,7 +2702,11 @@ void NLA_OT_fmodifier_copy(wmOperatorType *ot) #endif } -/* ******************** Paste F-Modifiers Operator *********************** */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Paste F-Modifiers Operator + * \{ */ static int nla_fmodifier_paste_exec(bContext *C, wmOperator *op) { @@ -2682,4 +2798,4 @@ void NLA_OT_fmodifier_paste(wmOperatorType *ot) "Replace existing F-Modifiers, instead of just appending to the end of the existing list"); } -/* *********************************************** */ +/** \} */ diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 478f48700ea..ddb57a916af 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -878,7 +878,11 @@ void ED_view3d_draw_depth(Depsgraph *depsgraph, ARegion *region, View3D *v3d, bo UI_Theme_Restore(&theme_state); } -/* ******************** other elements ***************** */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Other Elements + * \{ */ /** could move this elsewhere, but tied into #ED_view3d_grid_scale */ float ED_scene_grid_scale(const Scene *scene, const char **r_grid_unit) @@ -2149,7 +2153,11 @@ bool ED_view3d_clipping_test(const RegionView3D *rv3d, const float co[3], const return view3d_clipping_test(co, is_local ? rv3d->clip_local : rv3d->clip); } -/* *********************** backdraw for selection *************** */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Backdraw for Selection + * \{ */ /** * \note Only use in object mode. @@ -2251,7 +2259,11 @@ int ED_view3d_backbuf_sample_size_clamp(ARegion *region, const float dist) return (int)min_ff(ceilf(dist), (float)max_ii(region->winx, region->winx)); } -/* *********************** */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Z-Depth Utilities + * \{ */ void view3d_update_depths_rect(ARegion *region, ViewDepths *d, rcti *rect) { @@ -2383,7 +2395,11 @@ void ED_view3d_draw_depth_gpencil(Depsgraph *depsgraph, Scene *scene, ARegion *r GPU_depth_test(GPU_DEPTH_NONE); } -/* *********************** customdata **************** */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Custom-data Utilities + * \{ */ void ED_view3d_datamask(const bContext *C, const Scene *UNUSED(scene), @@ -2430,6 +2446,12 @@ void ED_view3d_screen_datamask(const bContext *C, } } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Region View Matrix Backup/Restore + * \{ */ + /** * Store values from #RegionView3D, set when drawing. * This is needed when we draw with to a viewport using a different matrix @@ -2472,6 +2494,12 @@ void ED_view3d_mats_rv3d_restore(struct RegionView3D *rv3d, struct RV3DMatrixSto rv3d->pixsize = rv3dmat->pixsize; } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name FPS Drawing + * \{ */ + /** * \note The info that this uses is updated in #ED_refresh_viewport_fps, * which currently gets called during #SCREEN_OT_animation_step. @@ -2531,6 +2559,12 @@ void ED_scene_draw_fps(const Scene *scene, int xoffset, int *yoffset) BLF_disable(font_id, BLF_SHADOW); } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Calculate Render Border + * \{ */ + static bool view3d_main_region_do_render_draw(const Scene *scene) { RenderEngineType *type = RE_engines_find(scene->r.engine); -- cgit v1.2.3