diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/view2d_ops.c | 42 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_collections.c | 105 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_convert.c | 72 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_input.c | 96 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_mode.c | 14 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_unwrap_ops.c | 108 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_files_link.c | 14 |
8 files changed, 344 insertions, 111 deletions
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 17af0cff23a..2adf441514b 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -62,7 +62,7 @@ static bool view2d_poll(bContext *C) /** \} */ /* -------------------------------------------------------------------- */ -/** \name View Pan Operator +/** \name View Pan Shared Utilities * \{ */ /** @@ -74,9 +74,9 @@ static bool view2d_poll(bContext *C) * - `deltax, deltay` - define how much to move view by (relative to zoom-correction factor) */ -/* ------------------ Shared 'core' stuff ---------------------- */ - -/* temp customdata for operator */ +/** + * Temporary custom-data for operator. + */ typedef struct v2dViewPanData { /** screen where view pan was initiated */ bScreen *sc; @@ -209,7 +209,11 @@ static void view_pan_exit(wmOperator *op) } } -/* ------------------ Modal Drag Version (1) ---------------------- */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name View Pan Operator (modal drag-pan) + * \{ */ /* for 'redo' only, with no user input */ static int view_pan_exec(bContext *C, wmOperator *op) @@ -350,7 +354,11 @@ static void VIEW2D_OT_pan(wmOperatorType *ot) RNA_def_int(ot->srna, "deltay", 0, INT_MIN, INT_MAX, "Delta Y", "", INT_MIN, INT_MAX); } -/* ------------------ Scrollwheel Versions (2) ---------------------- */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name View Pan Operator (single step) + * \{ */ /* this operator only needs this single callback, where it calls the view_pan_*() methods */ static int view_scrollright_exec(bContext *C, wmOperator *op) @@ -541,7 +549,7 @@ static void VIEW2D_OT_scroll_up(wmOperatorType *ot) /** \} */ /* -------------------------------------------------------------------- */ -/** \name View Zoom Operator (single-step) +/** \name View Zoom Shared Utilities * \{ */ /** @@ -558,9 +566,9 @@ static void VIEW2D_OT_scroll_up(wmOperatorType *ot) * amount to enlarge 'cur' by. */ -/* ------------------ 'Shared' stuff ------------------------ */ - -/* temp customdata for operator */ +/** + * Temporary custom-data for operator. + */ typedef struct v2dViewZoomData { View2D *v2d; /* view2d we're operating in */ ARegion *region; @@ -768,7 +776,11 @@ static void view_zoomstep_apply(bContext *C, wmOperator *op) C, vzd, zoom_to_pos, RNA_float_get(op->ptr, "zoomfacx"), RNA_float_get(op->ptr, "zoomfacy")); } -/* --------------- Individual Operators ------------------- */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name View Zoom Operator (single step) + * \{ */ /* cleanup temp customdata */ static void view_zoomstep_exit(wmOperator *op) @@ -1400,6 +1412,12 @@ static void VIEW2D_OT_zoom_border(wmOperatorType *ot) WM_operator_properties_gesture_box_zoom(ot); } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name NDOF Pan/Zoom Operator + * \{ */ + #ifdef WITH_INPUT_NDOF static int view2d_ndof_invoke(bContext *C, wmOperator *op, const wmEvent *event) { @@ -1731,8 +1749,6 @@ enum { SCROLLHANDLE_MAX_OUTSIDE, } /*eV2DScrollerHandle_Zone*/; -/* ------------------------ */ - /** * Check if mouse is within scroller handle. * diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 2506c7472e3..9c3534a88b1 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -4796,10 +4796,10 @@ static void SCREEN_OT_box_select(wmOperatorType *ot) /* -------------------------------------------------------------------- */ /** \name Full Screen Back Operator + * + * Use for generic full-screen 'back' button. * \{ */ -/* *********************** generic fullscreen 'back' button *************** */ - static int fullscreen_back_exec(bContext *C, wmOperator *op) { bScreen *screen = CTX_wm_screen(C); diff --git a/source/blender/editors/space_outliner/outliner_collections.c b/source/blender/editors/space_outliner/outliner_collections.c index 8da085f436d..8563b7d8c24 100644 --- a/source/blender/editors/space_outliner/outliner_collections.c +++ b/source/blender/editors/space_outliner/outliner_collections.c @@ -53,6 +53,8 @@ #include "outliner_intern.h" /* own include */ /* -------------------------------------------------------------------- */ +/** \name Utility API + * \{ */ bool outliner_is_collection_tree_element(const TreeElement *te) { @@ -133,8 +135,30 @@ TreeTraversalAction outliner_find_selected_objects(TreeElement *te, void *custom return TRAVERSE_CONTINUE; } +/** + * Populates the \param objects: ListBase with all the outliner selected objects + * We store it as (Object *)LinkData->data + * \param objects: expected to be empty + */ +void ED_outliner_selected_objects_get(const bContext *C, ListBase *objects) +{ + SpaceOutliner *soops = CTX_wm_space_outliner(C); + struct IDsSelectedData data = {{NULL}}; + outliner_tree_traverse( + soops, &soops->tree, 0, TSE_SELECTED, outliner_find_selected_objects, &data); + LISTBASE_FOREACH (LinkData *, link, &data.selected_array) { + TreeElement *ten_selected = (TreeElement *)link->data; + Object *ob = (Object *)TREESTORE(ten_selected)->id; + BLI_addtail(objects, BLI_genericNodeN(ob)); + } + BLI_freelistN(&data.selected_array); +} + +/** \} */ + /* -------------------------------------------------------------------- */ -/* Poll functions. */ +/** \name Poll Functions + * \{ */ bool ED_outliner_collections_editor_poll(bContext *C) { @@ -148,7 +172,11 @@ static bool outliner_view_layer_collections_editor_poll(bContext *C) return (so != NULL) && (so->outlinevis == SO_VIEW_LAYER); } -/********************************* New Collection ****************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name New Collection + * \{ */ struct CollectionNewData { bool error; @@ -237,7 +265,11 @@ void OUTLINER_OT_collection_new(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_SKIP_SAVE); } -/**************************** Delete Collection ******************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Delete Collection + * \{ */ struct CollectionEditData { Scene *scene; @@ -369,7 +401,11 @@ void OUTLINER_OT_collection_delete(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_SKIP_SAVE); } -/****************************** Select Objects *******************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Select/Deselect Collection Objects + * \{ */ struct CollectionObjectsSelectData { bool error; @@ -457,7 +493,11 @@ void OUTLINER_OT_collection_objects_deselect(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/************************** Duplicate Collection *****************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Duplicate Collection + * \{ */ struct CollectionDuplicateData { TreeElement *te; @@ -578,7 +618,11 @@ void OUTLINER_OT_collection_duplicate(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/**************************** Link Collection ******************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Link Collection + * \{ */ static int collection_link_exec(bContext *C, wmOperator *op) { @@ -636,7 +680,11 @@ void OUTLINER_OT_collection_link(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/************************** Instance Collection ******************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Instance Collection + * \{ */ static int collection_instance_exec(bContext *C, wmOperator *UNUSED(op)) { @@ -703,7 +751,11 @@ void OUTLINER_OT_collection_instance(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/************************** Exclude Collection ******************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Exclude Collection + * \{ */ static TreeTraversalAction layer_collection_find_data_to_edit(TreeElement *te, void *customdata) { @@ -945,7 +997,11 @@ void OUTLINER_OT_collection_indirect_only_clear(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/************************** Visibility Operators ******************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Visibility for Collection Operators + * \{ */ static int collection_isolate_exec(bContext *C, wmOperator *op) { @@ -1129,6 +1185,12 @@ void OUTLINER_OT_collection_hide_inside(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Enable/Disable Collection Operators + * \{ */ + static bool collection_flag_poll(bContext *C, bool clear, int flag) { if (!ED_outliner_collections_editor_poll(C)) { @@ -1310,6 +1372,12 @@ struct OutlinerHideEditData { GSet *bases_to_edit; }; +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Visibility for Collection & Object Operators + * \{ */ + static TreeTraversalAction outliner_hide_find_data_to_edit(TreeElement *te, void *customdata) { struct OutlinerHideEditData *data = customdata; @@ -1433,21 +1501,4 @@ void OUTLINER_OT_unhide_all(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/** - * Populates the \param objects: ListBase with all the outliner selected objects - * We store it as (Object *)LinkData->data - * \param objects: expected to be empty - */ -void ED_outliner_selected_objects_get(const bContext *C, ListBase *objects) -{ - SpaceOutliner *soops = CTX_wm_space_outliner(C); - struct IDsSelectedData data = {{NULL}}; - outliner_tree_traverse( - soops, &soops->tree, 0, TSE_SELECTED, outliner_find_selected_objects, &data); - LISTBASE_FOREACH (LinkData *, link, &data.selected_array) { - TreeElement *ten_selected = (TreeElement *)link->data; - Object *ob = (Object *)TREESTORE(ten_selected)->id; - BLI_addtail(objects, BLI_genericNodeN(ob)); - } - BLI_freelistN(&data.selected_array); -} +/** \} */ diff --git a/source/blender/editors/transform/transform_convert.c b/source/blender/editors/transform/transform_convert.c index 09ee9081baf..c3949899dff 100644 --- a/source/blender/editors/transform/transform_convert.c +++ b/source/blender/editors/transform/transform_convert.c @@ -96,7 +96,9 @@ void transform_around_single_fallback(TransInfo *t) } } -/* ************************** Functions *************************** */ +/* -------------------------------------------------------------------- */ +/** \name Proportional Editing + * \{ */ static int trans_data_compare_dist(const void *a, const void *b) { @@ -333,7 +335,11 @@ static void set_prop_dist(TransInfo *t, const bool with_dist) MEM_freeN(td_table); } -/* ********************* pose mode ************* */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Pose Mode + * \{ */ static short apply_targetless_ik(Object *ob) { @@ -506,7 +512,11 @@ int count_set_pose_transflags(Object *ob, return total; } -/* -------- Auto-IK ---------- */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Pose Mode (Auto-IK) + * \{ */ /* adjust pose-channel's auto-ik chainlen */ static bool pchan_autoik_adjust(bPoseChannel *pchan, short chainlen) @@ -631,7 +641,11 @@ static void pose_grab_with_ik_clear(Main *bmain, Object *ob) } } -/* ********************* curve/surface ********* */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Curve Surface + * \{ */ void calc_distanceCurveVerts(TransData *head, TransData *tail) { @@ -701,7 +715,11 @@ TransDataCurveHandleFlags *initTransDataCurveHandles(TransData *td, struct BezTr return hdata; } -/* ********************* UV ****************** */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name UV Coordinates + * \{ */ bool clipUVTransform(TransInfo *t, float vec[2], const bool resize) { @@ -787,7 +805,11 @@ void clipUVData(TransInfo *t) } } -/* ********************* ANIMATION EDITORS (GENERAL) ************************* */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Animation Editors (General) + * \{ */ /** * For modal operation: `t->center_global` may not have been set yet. @@ -828,7 +850,11 @@ bool FrameOnMouseSide(char side, float frame, float cframe) } } -/* ********************* ACTION EDITOR ****************** */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Animation Editor + * \{ */ static int masklay_shape_cmp_frame(void *thunk, const void *a, const void *b) { @@ -1088,7 +1114,11 @@ static void posttrans_action_clean(bAnimContext *ac, bAction *act) ANIM_animdata_freelist(&anim_data); } -/* ********************* GRAPH EDITOR ************************* */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Graph Editor + * \{ */ /* struct for use in re-sorting BezTriples during Graph Editor transform */ typedef struct BeztMap { @@ -1259,6 +1289,12 @@ static void beztmap_to_data(TransInfo *t, FCurve *fcu, BeztMap *bezms, int totve MEM_freeN(adjusted); } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Transform Utilities + * \{ */ + /* This function is called by recalcData during the Transform loop to recalculate * the handles of curves and sort the keyframes so that the curves draw correctly. * It is only called if some keyframes have moved out of order. @@ -1297,8 +1333,6 @@ void remake_graph_transdata(TransInfo *t, ListBase *anim_data) } } -/* *********************** Transform data ******************* */ - /* Little helper function for ObjectToTransData used to give certain * constraints (ChildOf, FollowPath, and others that may be added) * inverse corrections for transform, so that they aren't in CrazySpace. @@ -1384,6 +1418,12 @@ bool constraints_list_needinv(TransInfo *t, ListBase *list) return false; } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Transform (Auto-Keyframing) + * \{ */ + /** * Auto-keyframing feature - for objects * @@ -1682,6 +1722,12 @@ void autokeyframe_pose(bContext *C, Scene *scene, Object *ob, int tmode, short t } } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Transform (After-Transform Update) + * \{ */ + /* Return if we need to update motion paths, only if they already exist, * and we will insert a keyframe at the end of transform. */ bool motionpath_need_update_pose(Scene *scene, Object *ob) @@ -2383,6 +2429,10 @@ int special_transform_moving(TransInfo *t) /** \} */ +/* -------------------------------------------------------------------- */ +/** \name Transform Data Create + * \{ */ + static int countAndCleanTransDataContainer(TransInfo *t) { BLI_assert(ELEM(t->data_len_all, 0, -1)); @@ -2777,3 +2827,5 @@ void createTransData(bContext *C, TransInfo *t) BLI_assert((!(t->flag & T_EDIT)) == (!(t->obedit_type != -1))); } + +/** \} */ diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c index 75463dcb7db..078020e932e 100644 --- a/source/blender/editors/transform/transform_input.c +++ b/source/blender/editors/transform/transform_input.c @@ -35,13 +35,17 @@ #include "MEM_guardedalloc.h" -/* ************************** INPUT FROM MOUSE *************************** */ +/* -------------------------------------------------------------------- */ +/** \name Callbacks for #MouseInput.apply + * \{ */ +/** Callback for #INPUT_VECTOR */ static void InputVector(TransInfo *t, MouseInput *mi, const double mval[2], float output[3]) { convertViewVec(t, output, mval[0] - mi->imval[0], mval[1] - mi->imval[1]); } +/** Callback for #INPUT_SPRING */ static void InputSpring(TransInfo *UNUSED(t), MouseInput *mi, const double mval[2], @@ -57,6 +61,7 @@ static void InputSpring(TransInfo *UNUSED(t), output[0] = ratio; } +/** Callback for #INPUT_SPRING_FLIP */ static void InputSpringFlip(TransInfo *t, MouseInput *mi, const double mval[2], float output[3]) { InputSpring(t, mi, mval, output); @@ -70,12 +75,14 @@ static void InputSpringFlip(TransInfo *t, MouseInput *mi, const double mval[2], } } +/** Callback for #INPUT_SPRING_DELTA */ static void InputSpringDelta(TransInfo *t, MouseInput *mi, const double mval[2], float output[3]) { InputSpring(t, mi, mval, output); output[0] -= 1.0f; } +/** Callback for #INPUT_TRACKBALL */ static void InputTrackBall(TransInfo *UNUSED(t), MouseInput *mi, const double mval[2], @@ -88,6 +95,7 @@ static void InputTrackBall(TransInfo *UNUSED(t), output[1] *= mi->factor; } +/** Callback for #INPUT_HORIZONTAL_RATIO */ static void InputHorizontalRatio(TransInfo *t, MouseInput *mi, const double mval[2], @@ -98,6 +106,7 @@ static void InputHorizontalRatio(TransInfo *t, output[0] = ((mval[0] - mi->imval[0]) / winx) * 2.0f; } +/** Callback for #INPUT_HORIZONTAL_ABSOLUTE */ static void InputHorizontalAbsolute(TransInfo *t, MouseInput *mi, const double mval[2], @@ -119,6 +128,7 @@ static void InputVerticalRatio(TransInfo *t, MouseInput *mi, const double mval[2 output[0] = ((mval[1] - mi->imval[1]) / winy) * -2.0f; } +/** Callback for #INPUT_VERTICAL_ABSOLUTE */ static void InputVerticalAbsolute(TransInfo *t, MouseInput *mi, const double mval[2], @@ -133,38 +143,7 @@ static void InputVerticalAbsolute(TransInfo *t, output[0] = dot_v3v3(t->viewinv[1], vec) * -2.0f; } -void setCustomPoints(TransInfo *UNUSED(t), - MouseInput *mi, - const int mval_start[2], - const int mval_end[2]) -{ - int *data; - - mi->data = MEM_reallocN(mi->data, sizeof(int) * 4); - - data = mi->data; - - data[0] = mval_start[0]; - data[1] = mval_start[1]; - data[2] = mval_end[0]; - data[3] = mval_end[1]; -} - -void setCustomPointsFromDirection(TransInfo *t, MouseInput *mi, const float dir[2]) -{ - BLI_ASSERT_UNIT_V2(dir); - const int win_axis = t->region ? ((abs((int)(t->region->winx * dir[0])) + - abs((int)(t->region->winy * dir[1]))) / - 2) : - 1; - const int mval_start[2] = { - mi->imval[0] + dir[0] * win_axis, - mi->imval[1] + dir[1] * win_axis, - }; - const int mval_end[2] = {mi->imval[0], mi->imval[1]}; - setCustomPoints(t, mi, mval_start, mval_end); -} - +/** Callback for #INPUT_CUSTOM_RATIO_FLIP */ static void InputCustomRatioFlip(TransInfo *UNUSED(t), MouseInput *mi, const double mval[2], @@ -191,6 +170,7 @@ static void InputCustomRatioFlip(TransInfo *UNUSED(t), } } +/** Callback for #INPUT_CUSTOM_RATIO */ static void InputCustomRatio(TransInfo *t, MouseInput *mi, const double mval[2], float output[3]) { InputCustomRatioFlip(t, mi, mval, output); @@ -202,6 +182,7 @@ struct InputAngle_Data { double mval_prev[2]; }; +/** Callback for #INPUT_ANGLE */ static void InputAngle(TransInfo *UNUSED(t), MouseInput *mi, const double mval[2], float output[3]) { struct InputAngle_Data *data = mi->data; @@ -270,6 +251,53 @@ static void InputAngleSpring(TransInfo *t, MouseInput *mi, const double mval[2], output[1] = toutput[0]; } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Custom 2D Start/End Coordinate API + * + * - #INPUT_CUSTOM_RATIO + * - #INPUT_CUSTOM_RATIO_FLIP + * \{ */ + +void setCustomPoints(TransInfo *UNUSED(t), + MouseInput *mi, + const int mval_start[2], + const int mval_end[2]) +{ + int *data; + + mi->data = MEM_reallocN(mi->data, sizeof(int) * 4); + + data = mi->data; + + data[0] = mval_start[0]; + data[1] = mval_start[1]; + data[2] = mval_end[0]; + data[3] = mval_end[1]; +} + +void setCustomPointsFromDirection(TransInfo *t, MouseInput *mi, const float dir[2]) +{ + BLI_ASSERT_UNIT_V2(dir); + const int win_axis = t->region ? ((abs((int)(t->region->winx * dir[0])) + + abs((int)(t->region->winy * dir[1]))) / + 2) : + 1; + const int mval_start[2] = { + mi->imval[0] + dir[0] * win_axis, + mi->imval[1] + dir[1] * win_axis, + }; + const int mval_end[2] = {mi->imval[0], mi->imval[1]}; + setCustomPoints(t, mi, mval_start, mval_end); +} + +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Setup & Handle Mouse Input + * \{ */ + void initMouseInput(TransInfo *UNUSED(t), MouseInput *mi, const float center[2], @@ -494,3 +522,5 @@ eRedrawFlag handleMouseInput(TransInfo *t, MouseInput *mi, const wmEvent *event) return redraw; } + +/** \} */ diff --git a/source/blender/editors/transform/transform_mode.c b/source/blender/editors/transform/transform_mode.c index 326fb791de3..31aae4f5b05 100644 --- a/source/blender/editors/transform/transform_mode.c +++ b/source/blender/editors/transform/transform_mode.c @@ -61,7 +61,9 @@ bool transdata_check_local_center(TransInfo *t, short around) (t->options & (CTX_MOVIECLIP | CTX_MASK | CTX_PAINT_CURVE)))); } -/* ************************** TRANSFORM LOCKS **************************** */ +/* -------------------------------------------------------------------- */ +/** \name Transform Locks + * \{ */ void protectedTransBits(short protectflag, float vec[3]) { @@ -211,7 +213,11 @@ static void protectedSizeBits(short protectflag, float size[3]) } } -/* ******************* TRANSFORM LIMITS ********************** */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Transform Limits + * \{ */ void constraintTransLim(TransInfo *t, TransData *td) { @@ -1104,9 +1110,7 @@ void doAnimEdit_SnapFrame( /** \} */ /* -------------------------------------------------------------------- */ -/* Transform Mode API */ - -/** \name Transform Frame Utils +/** \name Transform Mode Initialization * \{ */ void transform_mode_init(TransInfo *t, wmOperator *op, const int mode) diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index 84d38a88902..0814407a553 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -77,6 +77,10 @@ #include "uvedit_intern.h" #include "uvedit_parametrizer.h" +/* -------------------------------------------------------------------- */ +/** \name Utility Functions + * \{ */ + static void modifier_unwrap_state(Object *obedit, const Scene *scene, bool *r_use_subsurf) { ModifierData *md; @@ -133,13 +137,21 @@ static bool ED_uvedit_ensure_uvs(Object *obedit) return 1; } -/****************** Parametrizer Conversion ***************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Parametrizer Conversion + * \{ */ typedef struct UnwrapOptions { - bool topology_from_uvs; /* Connectivity based on UV coordinates instead of seams. */ - bool only_selected; /* Only affect selected faces. */ - bool fill_holes; /* Fill holes to better preserve shape. */ - bool correct_aspect; /* Correct for mapped image texture aspect ratio. */ + /** Connectivity based on UV coordinates instead of seams. */ + bool topology_from_uvs; + /** Only affect selected faces. */ + bool only_selected; + /** Fill holes to better preserve shape. */ + bool fill_holes; + /** Correct for mapped image texture aspect ratio. */ + bool correct_aspect; } UnwrapOptions; static bool uvedit_have_selection(const Scene *scene, BMEditMesh *em, const UnwrapOptions *options) @@ -635,7 +647,11 @@ static ParamHandle *construct_param_handle_subsurfed(const Scene *scene, return handle; } -/* ******************** Minimize Stretch operator **************** */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Minimize Stretch Operator + * \{ */ typedef struct MinStretch { const Scene *scene; @@ -908,7 +924,11 @@ void UV_OT_minimize_stretch(wmOperatorType *ot) 100); } -/* ******************** Pack Islands operator **************** */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Pack UV Islands Operator + * \{ */ static void uvedit_pack_islands(const Scene *scene, Object *ob, BMesh *bm) { @@ -1006,7 +1026,11 @@ void UV_OT_pack_islands(wmOperatorType *ot) ot->srna, "margin", 0.001f, 0.0f, 1.0f, "Margin", "Space between islands", 0.0f, 1.0f); } -/* ******************** Average Islands Scale operator **************** */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Average UV Islands Scale Operator + * \{ */ static int average_islands_scale_exec(bContext *C, wmOperator *UNUSED(op)) { @@ -1065,7 +1089,11 @@ void UV_OT_average_islands_scale(wmOperatorType *ot) ot->poll = ED_operator_uvedit; } -/**************** Live Unwrap *****************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Live UV Unwrap + * \{ */ static struct { ParamHandle **handles; @@ -1144,7 +1172,11 @@ void ED_uvedit_live_unwrap_end(short cancel) } } -/*************** UV Map Common Transforms *****************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name UV Map Common Transforms + * \{ */ #define VIEW_ON_EQUATOR 0 #define VIEW_ON_POLES 1 @@ -1427,7 +1459,18 @@ static void correct_uv_aspect(const Scene *scene, Object *ob, BMEditMesh *em) } } -/******************** Map Clip & Correct ******************/ +#undef VIEW_ON_EQUATOR +#undef VIEW_ON_POLES +#undef ALIGN_TO_OBJECT + +#undef POLAR_ZX +#undef POLAR_ZY + +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name UV Map Clip & Correct + * \{ */ static void uv_map_clip_correct_properties(wmOperatorType *ot) { @@ -1542,7 +1585,11 @@ static void uv_map_clip_correct(const Scene *scene, Object *ob, wmOperator *op) uv_map_clip_correct_multi(scene, &ob, 1, op); } -/* ******************** Unwrap operator **************** */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name UV Unwrap Operator + * \{ */ /* Assumes UV Map exists, doesn't run update funcs. */ static void uvedit_unwrap(const Scene *scene, Object *obedit, const UnwrapOptions *options) @@ -1783,7 +1830,12 @@ void UV_OT_unwrap(wmOperatorType *ot) ot->srna, "margin", 0.001f, 0.0f, 1.0f, "Margin", "Space between islands", 0.0f, 1.0f); } -/**************** Project From View operator **************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Project UV From View Operator + * \{ */ + static int uv_from_view_exec(bContext *C, wmOperator *op); static int uv_from_view_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) @@ -1969,7 +2021,11 @@ void UV_OT_project_from_view(wmOperatorType *ot) uv_map_clip_correct_properties(ot); } -/********************** Reset operator ********************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Reset UV Operator + * \{ */ static int reset_exec(bContext *C, wmOperator *UNUSED(op)) { @@ -2017,7 +2073,11 @@ void UV_OT_reset(wmOperatorType *ot) ot->poll = ED_operator_uvmap; } -/****************** Sphere Project operator ***************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Sphere UV Project Operator + * \{ */ static void uv_sphere_project(float target[2], const float source[3], @@ -2144,7 +2204,11 @@ void UV_OT_sphere_project(wmOperatorType *ot) uv_map_clip_correct_properties(ot); } -/***************** Cylinder Project operator **************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Cylinder UV Project Operator + * \{ */ static void uv_cylinder_project(float target[2], const float source[3], @@ -2238,7 +2302,9 @@ void UV_OT_cylinder_project(wmOperatorType *ot) uv_map_clip_correct_properties(ot); } -/******************* Cube Project operator ****************/ +/* -------------------------------------------------------------------- */ +/** \name Cube UV Project Operator + * \{ */ static void uvedit_unwrap_cube_project(BMesh *bm, float cube_size, @@ -2367,7 +2433,11 @@ void UV_OT_cube_project(wmOperatorType *ot) uv_map_clip_correct_properties(ot); } -/************************* Simple UVs for texture painting *****************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Simple UVs for Texture Painting + * \{ */ void ED_uvedit_add_simple_uvs(Main *bmain, const Scene *scene, Object *ob) { @@ -2403,3 +2473,5 @@ void ED_uvedit_add_simple_uvs(Main *bmain, const Scene *scene, Object *ob) scene->toolsettings->uv_flag |= UV_SYNC_SELECTION; } } + +/** \} */ diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c index c2c3b24469e..5acc8a5fbc6 100644 --- a/source/blender/windowmanager/intern/wm_files_link.c +++ b/source/blender/windowmanager/intern/wm_files_link.c @@ -74,7 +74,9 @@ #include "wm_files.h" -/* **************** link/append *************** */ +/* -------------------------------------------------------------------- */ +/** \name Link/Append Operator + * \{ */ static bool wm_link_append_poll(bContext *C) { @@ -618,10 +620,12 @@ void WM_OT_append(wmOperatorType *ot) "Localize all appended data, including those indirectly linked from other libraries"); } -/** \name Append single datablock and return it. +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Append Single Data-Block & Return it * * Used for appending workspace from startup files. - * * \{ */ ID *WM_file_append_datablock(Main *bmain, @@ -660,6 +664,10 @@ ID *WM_file_append_datablock(Main *bmain, /** \} */ +/* -------------------------------------------------------------------- */ +/** \name Library Relocate Operator & Library Reload API + * \{ */ + static int wm_lib_relocate_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Library *lib; |