diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-12-14 07:49:31 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-12-14 08:17:10 +0300 |
commit | c097c7b855d4b01950494dc369e9def59486b0fd (patch) | |
tree | d6a9c5a7108e97b0c38f5ba6cb4ded2a2e45ba2e /source/blender/blenkernel/intern | |
parent | c1f5d8d023c6fdef67efbc6ce2af49e384c9bd98 (diff) |
Cleanup: correct unbalanced doxygen groups
Also add groups in some files.
Diffstat (limited to 'source/blender/blenkernel/intern')
22 files changed, 304 insertions, 86 deletions
diff --git a/source/blender/blenkernel/intern/attribute_access.cc b/source/blender/blenkernel/intern/attribute_access.cc index c1a83e65362..1a4265d936b 100644 --- a/source/blender/blenkernel/intern/attribute_access.cc +++ b/source/blender/blenkernel/intern/attribute_access.cc @@ -1522,3 +1522,5 @@ bool AnonymousAttributeFieldInput::is_equal_to(const fn::FieldNode &other) const } } // namespace blender::bke + +/** \} */ diff --git a/source/blender/blenkernel/intern/blender_user_menu.c b/source/blender/blenkernel/intern/blender_user_menu.c index edd89357fd5..b186d376e52 100644 --- a/source/blender/blenkernel/intern/blender_user_menu.c +++ b/source/blender/blenkernel/intern/blender_user_menu.c @@ -110,3 +110,5 @@ void BKE_blender_user_menu_item_free_list(ListBase *lb) } BLI_listbase_clear(lb); } + +/** \} */ diff --git a/source/blender/blenkernel/intern/bvhutils.cc b/source/blender/blenkernel/intern/bvhutils.cc index b447d35b37b..a68119fbc1d 100644 --- a/source/blender/blenkernel/intern/bvhutils.cc +++ b/source/blender/blenkernel/intern/bvhutils.cc @@ -181,6 +181,7 @@ static void bvhtree_balance(BVHTree *tree, const bool isolate) } /** \} */ + /* -------------------------------------------------------------------- */ /** \name Local Callbacks * \{ */ @@ -1717,6 +1718,10 @@ BVHTree *BKE_bvhtree_from_editmesh_get(BVHTreeFromEditMesh *data, /** \} */ +/* -------------------------------------------------------------------- */ +/** \name Free Functions + * \{ */ + void free_bvhtree_from_editmesh(struct BVHTreeFromEditMesh *data) { if (data->tree) { diff --git a/source/blender/blenkernel/intern/displist_tangent.c b/source/blender/blenkernel/intern/displist_tangent.c index 5c969d52aea..4451961ad94 100644 --- a/source/blender/blenkernel/intern/displist_tangent.c +++ b/source/blender/blenkernel/intern/displist_tangent.c @@ -29,6 +29,10 @@ /* interface */ #include "mikktspace.h" +/* -------------------------------------------------------------------- */ +/** \name Internal Types + * \{ */ + typedef struct { const DispList *dl; float (*tangent)[4]; /* destination */ diff --git a/source/blender/blenkernel/intern/fcurve_driver.c b/source/blender/blenkernel/intern/fcurve_driver.c index c2b3b24c4b2..5496519e53b 100644 --- a/source/blender/blenkernel/intern/fcurve_driver.c +++ b/source/blender/blenkernel/intern/fcurve_driver.c @@ -1285,3 +1285,5 @@ float evaluate_driver(PathResolvedRNA *anim_rna, /* Return value for driver. */ return driver->curval; } + +/** \} */ diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c index 13e7cadb034..39122b33683 100644 --- a/source/blender/blenkernel/intern/fluid.c +++ b/source/blender/blenkernel/intern/fluid.c @@ -4573,10 +4573,10 @@ void BKE_fluid_particle_system_destroy(struct Object *ob, const int particle_typ } } -#endif /* WITH_FLUID */ - /** \} */ +#endif /* WITH_FLUID */ + /* -------------------------------------------------------------------- */ /** \name Public Data Access API * diff --git a/source/blender/blenkernel/intern/geometry_component_curve.cc b/source/blender/blenkernel/intern/geometry_component_curve.cc index bd3912ddfc0..1e24b29038d 100644 --- a/source/blender/blenkernel/intern/geometry_component_curve.cc +++ b/source/blender/blenkernel/intern/geometry_component_curve.cc @@ -386,14 +386,14 @@ static const CurveEval *get_curve_from_component_for_read(const GeometryComponen /** \} */ +namespace blender::bke { + /* -------------------------------------------------------------------- */ /** \name Builtin Spline Attributes * * Attributes with a value for every spline, stored contiguously or in every spline separately. * \{ */ -namespace blender::bke { - class BuiltinSplineAttributeProvider final : public BuiltinAttributeProvider { using AsReadAttribute = GVArray (*)(const CurveEval &data); using AsWriteAttribute = GVMutableArray (*)(CurveEval &data); @@ -1485,6 +1485,8 @@ static ComponentAttributeProviders create_attribute_providers_for_curve() {&spline_custom_data, &point_custom_data}); } +/** \} */ + } // namespace blender::bke const blender::bke::ComponentAttributeProviders *CurveComponent::get_attribute_providers() const @@ -1493,5 +1495,3 @@ const blender::bke::ComponentAttributeProviders *CurveComponent::get_attribute_p blender::bke::create_attribute_providers_for_curve(); return &providers; } - -/** \} */ diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 312bbcc5a07..13338f33bd6 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -2345,6 +2345,8 @@ void BKE_gpencil_visible_stroke_iter(bGPdata *gpd, } } +/** \} */ + /* -------------------------------------------------------------------- */ /** \name Advanced Iterator * diff --git a/source/blender/blenkernel/intern/gpencil_geom.cc b/source/blender/blenkernel/intern/gpencil_geom.cc index 84a9735ac5c..b5190f598c6 100644 --- a/source/blender/blenkernel/intern/gpencil_geom.cc +++ b/source/blender/blenkernel/intern/gpencil_geom.cc @@ -67,7 +67,9 @@ using blender::float3; using blender::Span; -/* GP Object - Bound-box Support. */ +/* -------------------------------------------------------------------- */ +/** \name Grease Pencil Object: Bound-box Support + * \{ */ bool BKE_gpencil_stroke_minmax(const bGPDstroke *gps, const bool use_select, @@ -190,7 +192,11 @@ BoundBox *BKE_gpencil_boundbox_get(Object *ob) return ob->runtime.bb; } -/* ************************************************** */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Stroke Sample + * \{ */ static int stroke_march_next_point(const bGPDstroke *gps, const int index_next_pt, @@ -736,6 +742,12 @@ bool BKE_gpencil_stroke_stretch(bGPDstroke *gps, return true; } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Stroke Trim + * \{ */ + bool BKE_gpencil_stroke_trim_points(bGPDstroke *gps, const int index_from, const int index_to) { bGPDspoint *pt = gps->points, *new_pt; @@ -788,6 +800,12 @@ bool BKE_gpencil_stroke_trim_points(bGPDstroke *gps, const int index_from, const return true; } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Stroke Split + * \{ */ + bool BKE_gpencil_stroke_split(bGPdata *gpd, bGPDframe *gpf, bGPDstroke *gps, @@ -840,6 +858,12 @@ bool BKE_gpencil_stroke_split(bGPdata *gpd, return true; } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Stroke Shrink + * \{ */ + bool BKE_gpencil_stroke_shrink(bGPDstroke *gps, const float dist, const short mode) { #define START 1 @@ -912,9 +936,13 @@ bool BKE_gpencil_stroke_shrink(bGPDstroke *gps, const float dist, const short mo return true; } -/** - * Apply smooth position to stroke point. - */ + +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Stroke Smooth Positions + * \{ */ + bool BKE_gpencil_stroke_smooth_point(bGPDstroke *gps, int i, float inf, const bool smooth_caps) { bGPDspoint *pt = &gps->points[i]; @@ -987,6 +1015,12 @@ bool BKE_gpencil_stroke_smooth_point(bGPDstroke *gps, int i, float inf, const bo return true; } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Stroke Smooth Strength + * \{ */ + bool BKE_gpencil_stroke_smooth_strength(bGPDstroke *gps, int point_index, float influence) { bGPDspoint *ptb = &gps->points[point_index]; @@ -1059,6 +1093,12 @@ bool BKE_gpencil_stroke_smooth_strength(bGPDstroke *gps, int point_index, float return true; } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Stroke Smooth Thickness + * \{ */ + bool BKE_gpencil_stroke_smooth_thickness(bGPDstroke *gps, int point_index, float influence) { bGPDspoint *ptb = &gps->points[point_index]; @@ -1130,6 +1170,12 @@ bool BKE_gpencil_stroke_smooth_thickness(bGPDstroke *gps, int point_index, float return true; } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Stroke Smooth UV + * \{ */ + bool BKE_gpencil_stroke_smooth_uv(bGPDstroke *gps, int point_index, float influence) { bGPDspoint *ptb = &gps->points[point_index]; @@ -1378,6 +1424,12 @@ static void gpencil_calc_stroke_fill_uv(const float (*points2d)[2], } } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Stroke Fill Triangulate + * \{ */ + void BKE_gpencil_stroke_fill_triangulate(bGPDstroke *gps) { BLI_assert(gps->totpoints >= 3); @@ -1713,6 +1765,12 @@ bool BKE_gpencil_stroke_close(bGPDstroke *gps) return true; } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Dissolve Points + * \{ */ + void BKE_gpencil_dissolve_points(bGPdata *gpd, bGPDframe *gpf, bGPDstroke *gps, const short tag) { bGPDspoint *pt; @@ -1795,6 +1853,12 @@ void BKE_gpencil_dissolve_points(bGPdata *gpd, bGPDframe *gpf, bGPDstroke *gps, } } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Normal Calculation + * \{ */ + void BKE_gpencil_stroke_normal(const bGPDstroke *gps, float r_normal[3]) { if (gps->totpoints < 3) { @@ -1825,7 +1889,11 @@ void BKE_gpencil_stroke_normal(const bGPDstroke *gps, float r_normal[3]) normalize_v3(r_normal); } -/* Stroke Simplify ------------------------------------- */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Stroke Simplify + * \{ */ void BKE_gpencil_stroke_simplify_adaptive(bGPdata *gpd, bGPDstroke *gps, float epsilon) { @@ -2103,7 +2171,11 @@ void BKE_gpencil_stroke_subdivide(bGPdata *gpd, bGPDstroke *gps, int level, int BKE_gpencil_stroke_geometry_update(gpd, gps); } -/* Merge by distance ------------------------------------- */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Merge by Distance + * \{ */ void BKE_gpencil_stroke_merge_distance(bGPdata *gpd, bGPDframe *gpf, @@ -3386,7 +3458,11 @@ void BKE_gpencil_stroke_copy_to_keyframes( BLI_ghash_free(frame_list, nullptr, nullptr); } -/* Stroke Uniform Subdivide ------------------------------------- */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Stroke Uniform Subdivide + * \{ */ struct tSamplePoint { struct tSamplePoint *next, *prev; @@ -3598,8 +3674,11 @@ void BKE_gpencil_stroke_from_view_space(RegionView3D *rv3d, } } -/* ----------------------------------------------------------------------------- */ -/* Stroke to perimeter */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Stroke to Perimeter + * \{ */ struct tPerimeterPoint { struct tPerimeterPoint *next, *prev; @@ -4102,4 +4181,5 @@ bool BKE_gpencil_stroke_is_pressure_constant(bGPDstroke *gps) return true; } + /** \} */ diff --git a/source/blender/blenkernel/intern/icons.cc b/source/blender/blenkernel/intern/icons.cc index c7cdf81deaf..059caaa27f9 100644 --- a/source/blender/blenkernel/intern/icons.cc +++ b/source/blender/blenkernel/intern/icons.cc @@ -1022,4 +1022,5 @@ int BKE_icon_ensure_studio_light(struct StudioLight *sl, int id_type) icon->id_type = id_type; return icon_id; } + /** \} */ diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index c21f3dd0bcf..bb6458331da 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -345,6 +345,7 @@ static IDProperty *IDP_CopyArray(const IDProperty *prop, const int flag) return newp; } + /** \} */ /* -------------------------------------------------------------------- */ @@ -444,6 +445,7 @@ void IDP_FreeString(IDProperty *prop) MEM_freeN(prop->data.pointer); } } + /** \} */ /* -------------------------------------------------------------------- */ @@ -708,6 +710,7 @@ static void IDP_FreeGroup(IDProperty *prop, const bool do_id_user) } BLI_freelistN(&prop->data.group); } + /** \} */ /* -------------------------------------------------------------------- */ diff --git a/source/blender/blenkernel/intern/image_gpu.cc b/source/blender/blenkernel/intern/image_gpu.cc index 8b1441f812c..4440e4b101a 100644 --- a/source/blender/blenkernel/intern/image_gpu.cc +++ b/source/blender/blenkernel/intern/image_gpu.cc @@ -84,8 +84,9 @@ bool BKE_image_has_gpu_texture_premultiplied_alpha(Image *image, ImBuf *ibuf) } /* -------------------------------------------------------------------- */ -/** \name UDIM gpu texture +/** \name UDIM GPU Texture * \{ */ + static bool is_over_resolution_limit(int w, int h, bool limit_gl_texture_size) { return (w > GPU_texture_size_with_limit(w, limit_gl_texture_size) || @@ -643,6 +644,7 @@ void BKE_image_free_old_gputextures(Main *bmain) } } } + /** \} */ /* -------------------------------------------------------------------- */ diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index 5a9e9f1c2ff..1484d35f28a 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -77,7 +77,9 @@ static const short g_base_collection_flags = (BASE_VISIBLE_DEPSGRAPH | BASE_VISI /* prototype */ static void object_bases_iterator_next(BLI_Iterator *iter, const int flag); -/*********************** Layer Collections and bases *************************/ +/* -------------------------------------------------------------------- */ +/** \name Layer Collections and Bases + * \{ */ static LayerCollection *layer_collection_add(ListBase *lb_parent, Collection *collection) { @@ -113,7 +115,11 @@ static Base *object_base_new(Object *ob) return base; } -/********************************* View Layer ********************************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name View Layer + * \{ */ /* RenderLayer */ @@ -393,7 +399,12 @@ void BKE_view_layer_base_select_and_set_active(struct ViewLayer *view_layer, Bas } } -/**************************** Copy View Layer and Layer Collections ***********************/ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Copy View Layer and Layer Collections + * \{ */ + static void layer_aov_copy_data(ViewLayer *view_layer_dst, const ViewLayer *view_layer_src, ListBase *aovs_dst, @@ -677,7 +688,10 @@ int BKE_layer_collection_findindex(ViewLayer *view_layer, const LayerCollection return index_from_collection(&view_layer->layer_collections, lc, &i); } -/*********************************** Syncing ********************************* +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Syncing * * The layer collection tree mirrors the scene collection tree. Whenever that * changes we need to synchronize them so that there is a corresponding layer @@ -687,9 +701,9 @@ int BKE_layer_collection_findindex(ViewLayer *view_layer, const LayerCollection * * The view layer also contains a list of bases for each object that exists * in at least one layer collection. That list is also synchronized here, and - * stores state like selection. */ - -/* This API allows to temporarily forbid resync of LayerCollections. + * stores state like selection. + * + * This API allows to temporarily forbid resync of LayerCollections. * * This can greatly improve performances in cases where those functions get * called a lot (e.g. during massive remappings of IDs). @@ -698,19 +712,20 @@ int BKE_layer_collection_findindex(ViewLayer *view_layer, const LayerCollection * code must ensures it resync LayerCollections before any UI/Event loop * handling can happen. * - * WARNING: This is not threadsafe at all, only use from main thread. + * \warning This is not threadsafe at all, only use from main thread. * - * NOTE: It is probably needed to use #BKE_main_collection_sync_remap instead + * \note It is probably needed to use #BKE_main_collection_sync_remap instead * of just #BKE_main_collection_sync after disabling LayerCollection resync, * unless it is absolutely certain that no ID remapping (or any other process * that may invalidate the caches) will happen while it is disabled. * - * NOTE: This is a quick and safe band-aid around the long-known issue + * \note This is a quick and safe band-aid around the long-known issue * regarding this resync process. * Proper fix would be to make resync itself lazy, i.e. only happen * when actually needed. * See also T73411. - */ + * \{ */ + static bool no_resync = false; void BKE_layer_collection_resync_forbid(void) @@ -1319,7 +1334,11 @@ void BKE_main_collection_sync_remap(const Main *bmain) BKE_main_collection_sync(bmain); } -/* ---------------------------------------------------------------------- */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Object Selection + * \{ */ bool BKE_layer_collection_objects_select(ViewLayer *view_layer, LayerCollection *lc, bool deselect) { @@ -1397,7 +1416,11 @@ bool BKE_layer_collection_has_layer_collection(LayerCollection *lc_parent, return false; } -/* ---------------------------------------------------------------------- */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Object Visibility + * \{ */ void BKE_base_set_visible(Scene *scene, ViewLayer *view_layer, Base *base, bool extend) { @@ -1471,6 +1494,12 @@ bool BKE_object_is_visible_in_viewport(const View3D *v3d, const struct Object *o return true; } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Collection Isolation & Local View + * \{ */ + static void layer_collection_flag_set_recursive(LayerCollection *lc, const int flag) { lc->flag |= flag; @@ -1904,6 +1933,8 @@ static void objects_iterator_end(BLI_Iterator *iter) object_bases_iterator_end(iter); } +/** \} */ + /* -------------------------------------------------------------------- */ /** \name BKE_view_layer_selected_objects_iterator * See: #FOREACH_SELECTED_OBJECT_BEGIN @@ -2093,7 +2124,9 @@ void BKE_view_layer_bases_in_mode_iterator_end(BLI_Iterator *UNUSED(iter)) /** \} */ -/* Evaluation. */ +/* -------------------------------------------------------------------- */ +/** \name Evaluation + * \{ */ void BKE_base_eval_flags(Base *base) { @@ -2153,6 +2186,12 @@ void BKE_layer_eval_view_layer_indexed(struct Depsgraph *depsgraph, layer_eval_view_layer(depsgraph, scene, view_layer); } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Blend File I/O + * \{ */ + static void write_layer_collections(BlendWriter *writer, ListBase *lb) { LISTBASE_FOREACH (LayerCollection *, lc, lb) { @@ -2273,6 +2312,8 @@ void BKE_view_layer_blend_read_lib(BlendLibReader *reader, Library *lib, ViewLay IDP_BlendReadLib(reader, view_layer->id_properties); } +/** \} */ + /* -------------------------------------------------------------------- */ /** \name Shader AOV * \{ */ diff --git a/source/blender/blenkernel/intern/layer_utils.c b/source/blender/blenkernel/intern/layer_utils.c index 51ea7f58469..3760fe8a976 100644 --- a/source/blender/blenkernel/intern/layer_utils.c +++ b/source/blender/blenkernel/intern/layer_utils.c @@ -214,4 +214,5 @@ Object *BKE_view_layer_non_active_selected_object(struct ViewLayer *view_layer, FOREACH_SELECTED_OBJECT_END; return ob_result; } + /** \} */ diff --git a/source/blender/blenkernel/intern/mesh_evaluate.cc b/source/blender/blenkernel/intern/mesh_evaluate.cc index e79c9646ea4..5cc1b4e4860 100644 --- a/source/blender/blenkernel/intern/mesh_evaluate.cc +++ b/source/blender/blenkernel/intern/mesh_evaluate.cc @@ -912,6 +912,7 @@ void BKE_mesh_convert_mfaces_to_mpolys_ex(ID *id, #undef ME_FGON } + /** \} */ void BKE_mesh_mdisp_flip(MDisps *md, const bool use_loop_mdisp_flip) @@ -1181,6 +1182,7 @@ void BKE_mesh_flush_select_from_verts(Mesh *me) BKE_mesh_flush_select_from_verts_ex( me->mvert, me->totvert, me->mloop, me->medge, me->totedge, me->mpoly, me->totpoly); } + /** \} */ /* -------------------------------------------------------------------- */ @@ -1240,4 +1242,5 @@ void BKE_mesh_calc_relative_deform(const MPoly *mpoly, MEM_freeN(vert_accum); } + /** \} */ diff --git a/source/blender/blenkernel/intern/mesh_remap.c b/source/blender/blenkernel/intern/mesh_remap.c index 149ea6a6936..5b5378bd829 100644 --- a/source/blender/blenkernel/intern/mesh_remap.c +++ b/source/blender/blenkernel/intern/mesh_remap.c @@ -50,7 +50,7 @@ static CLG_LogRef LOG = {"bke.mesh"}; /* -------------------------------------------------------------------- */ -/** \name Some generic helpers. +/** \name Some Generic Helpers * \{ */ static bool mesh_remap_bvhtree_query_nearest(BVHTreeFromMesh *treedata, @@ -117,8 +117,8 @@ static bool mesh_remap_bvhtree_query_raycast(BVHTreeFromMesh *treedata, /** \} */ -/** - * \name Auto-match. +/* -------------------------------------------------------------------- */ +/** \name Auto-match. * * Find transform of a mesh to get best match with another. * \{ */ @@ -315,7 +315,7 @@ void BKE_mesh_remap_find_best_match_from_mesh(const MVert *verts_dst, /** \} */ /* -------------------------------------------------------------------- */ -/** \name Mesh to mesh mapping +/** \name Mesh to Mesh Mapping * \{ */ void BKE_mesh_remap_calc_source_cddata_masks_from_map_modes(const int UNUSED(vert_mode), diff --git a/source/blender/blenkernel/intern/mesh_runtime.c b/source/blender/blenkernel/intern/mesh_runtime.c index b5d863778aa..45c84ed0862 100644 --- a/source/blender/blenkernel/intern/mesh_runtime.c +++ b/source/blender/blenkernel/intern/mesh_runtime.c @@ -291,10 +291,10 @@ void BKE_mesh_batch_cache_free(Mesh *me) /** \} */ /* -------------------------------------------------------------------- */ -/** \name Mesh runtime debug helpers. +/** \name Mesh Runtime Debug Helpers * \{ */ -/* evaluated mesh info printing function, - * to help track down differences output */ + +/* Evaluated mesh info printing function, to help track down differences output. */ #ifndef NDEBUG # include "BLI_dynstr.h" diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c index f5daf641445..ba86c0fd449 100644 --- a/source/blender/blenkernel/intern/mesh_validate.c +++ b/source/blender/blenkernel/intern/mesh_validate.c @@ -193,6 +193,7 @@ static int search_polyloop_cmp(const void *v1, const void *v2) /* Else, sort on loopstart. */ return sp1->loopstart > sp2->loopstart ? 1 : sp1->loopstart < sp2->loopstart ? -1 : 0; } + /** \} */ /* -------------------------------------------------------------------- */ @@ -1288,6 +1289,7 @@ void BKE_mesh_strip_loose_edges(Mesh *me) MEM_freeN(new_idx); } + /** \} */ /* -------------------------------------------------------------------- */ diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c index e9bda6d0eb5..fc2e7d0a6a3 100644 --- a/source/blender/blenkernel/intern/movieclip.c +++ b/source/blender/blenkernel/intern/movieclip.c @@ -2144,4 +2144,5 @@ void BKE_movieclip_free_gputexture(struct MovieClip *clip) MEM_freeN(tex); } } + /** \} */ diff --git a/source/blender/blenkernel/intern/object.cc b/source/blender/blenkernel/intern/object.cc index e74d9d3ee61..af971e27c52 100644 --- a/source/blender/blenkernel/intern/object.cc +++ b/source/blender/blenkernel/intern/object.cc @@ -4294,6 +4294,12 @@ void BKE_scene_foreach_display_point(Depsgraph *depsgraph, DEG_OBJECT_ITER_END; } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Object Transform Channels (Backup/Restore) + * \{ */ + /** * See struct members from #Object in DNA_object_types.h */ @@ -4354,17 +4360,11 @@ void BKE_object_tfm_restore(Object *ob, void *obtfm_pt) copy_m4_m4(ob->imat, obtfm->imat); } -bool BKE_object_parent_loop_check(const Object *par, const Object *ob) -{ - /* test if 'ob' is a parent somewhere in par's parents */ - if (par == nullptr) { - return false; - } - if (ob == par) { - return true; - } - return BKE_object_parent_loop_check(par->parent, ob); -} +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Object Evaluation/Update API + * \{ */ static void object_handle_update_proxy(Depsgraph *depsgraph, Scene *scene, @@ -4589,6 +4589,12 @@ Lattice *BKE_object_get_evaluated_lattice(const Object *object) return lt_eval; } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Object Point Cache + * \{ */ + static int pc_cmp(const void *a, const void *b) { const LinkData *ad = (const LinkData *)a, *bd = (const LinkData *)b; @@ -4653,6 +4659,8 @@ void BKE_object_delete_ptcache(Object *ob, int index) BLI_freelinkN(&ob->pc_ids, link); } +/** \} */ + /* -------------------------------------------------------------------- */ /** \name Object Data Shape Key Insert * \{ */ @@ -4891,6 +4899,22 @@ bool BKE_object_shapekey_remove(Main *bmain, Object *ob, KeyBlock *kb) /** \} */ +/* -------------------------------------------------------------------- */ +/** \name Object Query API + * \{ */ + +bool BKE_object_parent_loop_check(const Object *par, const Object *ob) +{ + /* test if 'ob' is a parent somewhere in par's parents */ + if (par == nullptr) { + return false; + } + if (ob == par) { + return true; + } + return BKE_object_parent_loop_check(par->parent, ob); +} + bool BKE_object_flag_test_recursive(const Object *ob, short flag) { if (ob->flag & flag) { @@ -5129,6 +5153,26 @@ MovieClip *BKE_object_movieclip_get(Scene *scene, Object *ob, bool use_default) return clip; } +bool BKE_object_supports_material_slots(struct Object *ob) +{ + return ELEM(ob->type, + OB_MESH, + OB_CURVE, + OB_SURF, + OB_FONT, + OB_MBALL, + OB_HAIR, + OB_POINTCLOUD, + OB_VOLUME, + OB_GPENCIL); +} + +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Object Runtime + * \{ */ + void BKE_object_runtime_reset(Object *object) { memset(&object->runtime, 0, sizeof(object->runtime)); @@ -5154,6 +5198,12 @@ void BKE_object_runtime_free_data(Object *object) BKE_object_runtime_reset(object); } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Object Relationships + * \{ */ + /** * Find an associated armature object. */ @@ -5284,6 +5334,12 @@ void BKE_object_groups_clear(Main *bmain, Scene *scene, Object *ob) } } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Object KD-Tree + * \{ */ + KDTree_3d *BKE_object_as_kdtree(Object *ob, int *r_tot) { KDTree_3d *tree = nullptr; @@ -5401,6 +5457,12 @@ KDTree_3d *BKE_object_as_kdtree(Object *ob, int *r_tot) return tree; } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Object Modifier Utilities + * \{ */ + bool BKE_object_modifier_use_time(Scene *scene, Object *ob, ModifierData *md, @@ -5659,6 +5721,12 @@ void BKE_object_update_select_id(struct Main *bmain) } } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Object Conversion + * \{ */ + Mesh *BKE_object_to_mesh(Depsgraph *depsgraph, Object *object, bool preserve_all_data_layers) { BKE_object_to_mesh_clear(object); @@ -5726,16 +5794,4 @@ void BKE_object_replace_data_on_shallow_copy(Object *ob, ID *new_data) ob->id.py_instance = nullptr; } -bool BKE_object_supports_material_slots(struct Object *ob) -{ - return ELEM(ob->type, - OB_MESH, - OB_CURVE, - OB_SURF, - OB_FONT, - OB_MBALL, - OB_HAIR, - OB_POINTCLOUD, - OB_VOLUME, - OB_GPENCIL); -} +/** \} */ diff --git a/source/blender/blenkernel/intern/object_deform.c b/source/blender/blenkernel/intern/object_deform.c index 0ec2854544e..fb4f4a14265 100644 --- a/source/blender/blenkernel/intern/object_deform.c +++ b/source/blender/blenkernel/intern/object_deform.c @@ -99,6 +99,7 @@ void BKE_object_defgroup_remap_update_users(Object *ob, const int *map) } } } + /** \} */ /* -------------------------------------------------------------------- */ @@ -140,6 +141,7 @@ MDeformVert *BKE_object_defgroup_data_create(ID *id) return NULL; } + /** \} */ /* -------------------------------------------------------------------- */ @@ -232,6 +234,7 @@ bool BKE_object_defgroup_clear_all(Object *ob, const bool use_selection) return changed; } + /** \} */ /* -------------------------------------------------------------------- */ @@ -531,6 +534,7 @@ bool BKE_object_defgroup_array_get(ID *id, MDeformVert **dvert_arr, int *dvert_t *dvert_tot = 0; return false; } + /** \} */ /* --- functions for getting vgroup aligned maps --- */ diff --git a/source/blender/blenkernel/intern/undo_system.c b/source/blender/blenkernel/intern/undo_system.c index a2f27c9e3b6..743ae91f6f7 100644 --- a/source/blender/blenkernel/intern/undo_system.c +++ b/source/blender/blenkernel/intern/undo_system.c @@ -61,13 +61,39 @@ static CLG_LogRef LOG = {"bke.undosys"}; /* -------------------------------------------------------------------- */ +/** \name Undo Types + * \{ */ + +const UndoType *BKE_UNDOSYS_TYPE_IMAGE = NULL; +const UndoType *BKE_UNDOSYS_TYPE_MEMFILE = NULL; +const UndoType *BKE_UNDOSYS_TYPE_PAINTCURVE = NULL; +const UndoType *BKE_UNDOSYS_TYPE_PARTICLE = NULL; +const UndoType *BKE_UNDOSYS_TYPE_SCULPT = NULL; +const UndoType *BKE_UNDOSYS_TYPE_TEXT = NULL; + +static ListBase g_undo_types = {NULL, NULL}; + +static const UndoType *BKE_undosys_type_from_context(bContext *C) +{ + LISTBASE_FOREACH (const UndoType *, ut, &g_undo_types) { + /* No poll means we don't check context. */ + if (ut->poll && ut->poll(C)) { + return ut; + } + } + return NULL; +} + +/** \} */ + +/* -------------------------------------------------------------------- */ /** \name Internal Nested Undo Checks * * Make sure we're not running undo operations from 'step_encode', 'step_decode' callbacks. * bugs caused by this situation aren't _that_ hard to spot but aren't always so obvious. * Best we have a check which shows the problem immediately. - * * \{ */ + #define WITH_NESTED_UNDO_CHECK #ifdef WITH_NESTED_UNDO_CHECK @@ -90,32 +116,9 @@ static bool g_undo_callback_running = false; # define UNDO_NESTED_CHECK_BEGIN ((void)0) # define UNDO_NESTED_CHECK_END ((void)0) #endif -/** \} */ -/* -------------------------------------------------------------------- */ -const UndoType *BKE_UNDOSYS_TYPE_IMAGE = NULL; -const UndoType *BKE_UNDOSYS_TYPE_MEMFILE = NULL; -const UndoType *BKE_UNDOSYS_TYPE_PAINTCURVE = NULL; -const UndoType *BKE_UNDOSYS_TYPE_PARTICLE = NULL; -const UndoType *BKE_UNDOSYS_TYPE_SCULPT = NULL; -const UndoType *BKE_UNDOSYS_TYPE_TEXT = NULL; /** \} */ -/* UndoType */ - -static ListBase g_undo_types = {NULL, NULL}; - -static const UndoType *BKE_undosys_type_from_context(bContext *C) -{ - LISTBASE_FOREACH (const UndoType *, ut, &g_undo_types) { - /* No poll means we don't check context. */ - if (ut->poll && ut->poll(C)) { - return ut; - } - } - return NULL; -} - /* -------------------------------------------------------------------- */ /** \name Internal Callback Wrappers * @@ -445,6 +448,10 @@ void BKE_undosys_stack_limit_steps_and_memory(UndoStack *ustack, int steps, size /** \} */ +/* -------------------------------------------------------------------- */ +/** \name Undo Step + * \{ */ + UndoStep *BKE_undosys_step_push_init_with_type(UndoStack *ustack, bContext *C, const char *name, |