Cleanup: correct unbalanced doxygen groups

Also add groups in some files.
This commit is contained in:
Campbell Barton 2021-12-14 15:49:31 +11:00
parent c1f5d8d023
commit c097c7b855
160 changed files with 948 additions and 311 deletions

View File

@ -2278,6 +2278,7 @@ void GHOST_SystemX11::putClipboard(const char *buffer, bool selection) const
/* -------------------------------------------------------------------- */
/** \name Message Box
* \{ */
class DialogData {
public:
/* Width of the dialog. */

View File

@ -307,6 +307,7 @@ GHOST_XrSession::LifeExpectancy GHOST_XrSession::handleStateChangeEvent(
return SESSION_KEEP_ALIVE;
}
/** \} */ /* State Management */
/* -------------------------------------------------------------------- */

View File

@ -307,8 +307,6 @@ void DM_add_tessface_layer(struct DerivedMesh *dm, int type, eCDAllocType alloct
void DM_add_loop_layer(DerivedMesh *dm, int type, eCDAllocType alloctype, void *layer);
void DM_add_poly_layer(struct DerivedMesh *dm, int type, eCDAllocType alloctype, void *layer);
/** \} */
/* -------------------------------------------------------------------- */
/** \name Custom Data Access Functions
*

View File

@ -132,6 +132,7 @@ void BKE_lattice_deform_coords_with_editmesh(const struct Object *ob_lattice,
const char *defgrp_name,
const float fac,
struct BMEditMesh *em_target);
/** \} */
#ifdef __cplusplus

View File

@ -541,6 +541,7 @@ void ntreeBlendReadExpand(struct BlendExpander *expander, struct bNodeTree *ntre
/* -------------------------------------------------------------------- */
/** \name Node Tree Interface
* \{ */
struct bNodeSocket *ntreeFindSocketInterface(struct bNodeTree *ntree,
eNodeSocketInOut in_out,
const char *identifier);
@ -1108,6 +1109,7 @@ bool BKE_node_tree_iter_step(struct NodeTreeIterStore *ntreeiter,
} \
} \
((void)0)
/** \} */
/* -------------------------------------------------------------------- */
@ -1568,6 +1570,7 @@ int ntreeTexExecTree(struct bNodeTree *ntree,
int cfra,
int preview,
struct MTex *mtex);
/** \} */
/* -------------------------------------------------------------------- */
@ -1719,6 +1722,7 @@ int ntreeTexExecTree(struct bNodeTree *ntree,
#define GEO_NODE_INPUT_MESH_EDGE_NEIGHBORS 1143
#define GEO_NODE_INPUT_MESH_ISLAND 1144
#define GEO_NODE_INPUT_SCENE_TIME 1145
/** \} */
/* -------------------------------------------------------------------- */

View File

@ -171,11 +171,12 @@ typedef enum eUndoTypeFlags {
UNDOTYPE_FLAG_DECODE_ACTIVE_STEP = 1 << 1,
} eUndoTypeFlags;
/* Expose since we need to perform operations on specific undo types (rarely). */
/* -------------------------------------------------------------------- */
/** \name Public Undo Types
*
* Unfortunately we need this for a handful of places.
* Expose since we need to perform operations on specific undo types (rarely).
* \{ */
extern const UndoType *BKE_UNDOSYS_TYPE_IMAGE;
extern const UndoType *BKE_UNDOSYS_TYPE_MEMFILE;
extern const UndoType *BKE_UNDOSYS_TYPE_PAINTCURVE;
@ -183,6 +184,8 @@ extern const UndoType *BKE_UNDOSYS_TYPE_PARTICLE;
extern const UndoType *BKE_UNDOSYS_TYPE_SCULPT;
extern const UndoType *BKE_UNDOSYS_TYPE_TEXT;
/** \} */
#define BKE_UNDOSYS_TYPE_IS_MEMFILE_SKIP(ty) ELEM(ty, BKE_UNDOSYS_TYPE_IMAGE)
UndoStack *BKE_undosys_stack_create(void);

View File

@ -1522,3 +1522,5 @@ bool AnonymousAttributeFieldInput::is_equal_to(const fn::FieldNode &other) const
}
} // namespace blender::bke
/** \} */

View File

@ -110,3 +110,5 @@ void BKE_blender_user_menu_item_free_list(ListBase *lb)
}
BLI_listbase_clear(lb);
}
/** \} */

View File

@ -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) {

View File

@ -29,6 +29,10 @@
/* interface */
#include "mikktspace.h"
/* -------------------------------------------------------------------- */
/** \name Internal Types
* \{ */
typedef struct {
const DispList *dl;
float (*tangent)[4]; /* destination */

View File

@ -1285,3 +1285,5 @@ float evaluate_driver(PathResolvedRNA *anim_rna,
/* Return value for driver. */
return driver->curval;
}
/** \} */

View File

@ -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
*

View File

@ -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;
}
/** \} */

View File

@ -2345,6 +2345,8 @@ void BKE_gpencil_visible_stroke_iter(bGPdata *gpd,
}
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Advanced Iterator
*

View File

@ -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;
}
/** \} */

View File

@ -1022,4 +1022,5 @@ int BKE_icon_ensure_studio_light(struct StudioLight *sl, int id_type)
icon->id_type = id_type;
return icon_id;
}
/** \} */

View File

@ -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);
}
/** \} */
/* -------------------------------------------------------------------- */

View File

@ -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)
}
}
}
/** \} */
/* -------------------------------------------------------------------- */

View File

@ -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
* \{ */

View File

@ -214,4 +214,5 @@ Object *BKE_view_layer_non_active_selected_object(struct ViewLayer *view_layer,
FOREACH_SELECTED_OBJECT_END;
return ob_result;
}
/** \} */

View File

@ -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);
}
/** \} */

View File

@ -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),

View File

@ -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"

View File

@ -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);
}
/** \} */
/* -------------------------------------------------------------------- */

View File

@ -2144,4 +2144,5 @@ void BKE_movieclip_free_gputexture(struct MovieClip *clip)
MEM_freeN(tex);
}
}
/** \} */

View File

@ -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);
}
/** \} */

View File

@ -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 --- */

View File

@ -60,14 +60,40 @@
/** We only need this locally. */
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,

View File

@ -213,6 +213,8 @@ DLRBT_Node *BLI_dlrbTree_add(DLRBT_Tree *tree,
*/
void BLI_dlrbTree_insert(DLRBT_Tree *tree, DLRBT_Node *node);
/** \} */
#ifdef __cplusplus
}
#endif

View File

@ -43,6 +43,10 @@ extern "C" {
# endif
#endif
/* -------------------------------------------------------------------- */
/** \name GHash Types
* \{ */
typedef unsigned int (*GHashHashFP)(const void *key);
/** returns false when equal */
typedef bool (*GHashCmpFP)(const void *a, const void *b);
@ -74,6 +78,8 @@ enum {
#endif
};
/** \} */
/* -------------------------------------------------------------------- */
/** \name GHash API
*
@ -340,12 +346,11 @@ BLI_INLINE bool BLI_ghashIterator_done(const GHashIterator *ghi)
/** \} */
/* -------------------------------------------------------------------- */
/** \name GSet API
/** \name GSet Types
* A 'set' implementation (unordered collection of unique elements).
*
* Internally this is a 'GHash' without any keys,
* which is why this API's are in the same header & source file.
*
* \{ */
typedef struct GSet GSet;
@ -357,10 +362,13 @@ typedef GHashKeyCopyFP GSetKeyCopyFP;
typedef GHashIterState GSetIterState;
/** \} */
/** \name GSet Public API
*
* Use ghash API to give 'set' functionality
* \{ */
GSet *BLI_gset_new_ex(GSetHashFP hashfp,
GSetCmpFP cmpfp,
const char *info,
@ -521,6 +529,7 @@ double BLI_gset_calc_quality_ex(GSet *gs,
double BLI_ghash_calc_quality(GHash *gh);
double BLI_gset_calc_quality(GSet *gs);
#endif /* GHASH_INTERNAL_API */
/** \} */
/* -------------------------------------------------------------------- */

View File

@ -37,8 +37,6 @@
extern "C" {
#endif
/** \} */
/* -------------------------------------------------------------------- */
/** \name Polygons
* \{ */

View File

@ -32,8 +32,6 @@
extern "C" {
#endif
/** \} */
/* -------------------------------------------------------------------- */
/** \name Init
* \{ */

View File

@ -32,6 +32,10 @@
extern "C" {
#endif
/* -------------------------------------------------------------------- */
/** \name Conversion Defines
* \{ */
#define RAD2DEG(_rad) ((_rad) * (180.0 / M_PI))
#define DEG2RAD(_deg) ((_deg) * (M_PI / 180.0))

View File

@ -42,7 +42,12 @@ extern "C" {
/** \} */
/** Explode given time value expressed in seconds, into a set of days, hours, minutes, seconds
/* -------------------------------------------------------------------- */
/** \name Time API
* \{ */
/**
* Explode given time value expressed in seconds, into a set of days, hours, minutes, seconds
* and/or milliseconds (depending on which return parameters are not NULL).
*
* \note The smallest given return parameter will get the potential fractional remaining time

View File

@ -491,6 +491,7 @@ int BLI_string_find_split_words(const char *str,
* Avoid repeating destination with `sizeof(..)`.
* \note `ARRAY_SIZE` allows pointers on some platforms.
* \{ */
#define STRNCPY(dst, src) BLI_strncpy(dst, src, ARRAY_SIZE(dst))
#define STRNCPY_RLEN(dst, src) BLI_strncpy_rlen(dst, src, ARRAY_SIZE(dst))
#define SNPRINTF(dst, format, ...) BLI_snprintf(dst, ARRAY_SIZE(dst), format, __VA_ARGS__)
@ -500,6 +501,7 @@ int BLI_string_find_split_words(const char *str,
len += BLI_strncpy_rlen(dst + len, suffix, ARRAY_SIZE(dst) - len)
#define STR_CONCATF(dst, len, format, ...) \
len += BLI_snprintf_rlen(dst + len, ARRAY_SIZE(dst) - len, format, __VA_ARGS__)
/** \} */
/* -------------------------------------------------------------------- */

View File

@ -224,8 +224,10 @@ int BLI_str_utf8_offset_from_column(const char *str, int column) ATTR_WARN_UNUSE
* Avoid repeating destination with `sizeof(..)`.
* \note `ARRAY_SIZE` allows pointers on some platforms.
* \{ */
#define STRNCPY_UTF8(dst, src) BLI_strncpy_utf8(dst, src, ARRAY_SIZE(dst))
#define STRNCPY_UTF8_RLEN(dst, src) BLI_strncpy_utf8_rlen(dst, src, ARRAY_SIZE(dst))
/** \} */
#ifdef __cplusplus

View File

@ -949,6 +949,8 @@ void BLI_ghashIterator_free(GHashIterator *ghi)
/** \} */
/* -------------------------------------------------------------------- */
/** \name GSet Public API
* \{ */
GSet *BLI_gset_new_ex(GSetHashFP hashfp,
GSetCmpFP cmpfp,

View File

@ -120,6 +120,7 @@ static float box_ymax_get(const BoxPack *box)
{
return box->v[TR]->y;
}
/** \} */
/* -------------------------------------------------------------------- */
@ -165,6 +166,7 @@ static void box_ymax_set(BoxPack *box, const float f)
box->v[TR]->y = f;
box_v34y_update(box);
}
/** \} */
/* -------------------------------------------------------------------- */
@ -275,6 +277,7 @@ static int vertex_sort(const void *p1, const void *p2, void *vs_ctx_p)
}
return 0;
}
/** \} */
void BLI_box_pack_2d(BoxPack *boxarray, const uint len, float *r_tot_x, float *r_tot_y)

View File

@ -718,6 +718,7 @@ float dist_squared_ray_to_aabb_v3_simple(const float ray_origin[3],
dist_squared_ray_to_aabb_v3_precalc(&data, ray_origin, ray_direction);
return dist_squared_ray_to_aabb_v3(&data, bb_min, bb_max, r_point, r_depth);
}
/** \} */
/* -------------------------------------------------------------------- */
@ -917,6 +918,7 @@ float dist_squared_to_projected_aabb_simple(const float projmat[4][4],
bool dummy[3] = {true, true, true};
return dist_squared_to_projected_aabb(&data, bbmin, bbmax, dummy);
}
/** \} */
void closest_on_tri_to_point_v3(

View File

@ -634,6 +634,7 @@ void _va_mul_m3_series_9(float r[3][3],
mul_m3_m3m3(r, r, m7);
mul_m3_m3m3(r, r, m8);
}
/** \} */
/* -------------------------------------------------------------------- */
@ -722,6 +723,7 @@ void _va_mul_m4_series_9(float r[4][4],
mul_m4_m4m4(r, r, m7);
mul_m4_m4m4(r, r, m8);
}
/** \} */
void mul_v2_m3v2(float r[2], const float m[3][3], const float v[2])

View File

@ -42,6 +42,10 @@
// #define DEBUG_STRSIZE
/* -------------------------------------------------------------------- */
/** \name String Duplicate/Copy
* \{ */
char *BLI_strdupn(const char *str, const size_t len)
{
char *n = MEM_mallocN(len + 1, "strdup");
@ -150,6 +154,12 @@ size_t BLI_strcpy_rlen(char *__restrict dst, const char *__restrict src)
return srclen;
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name String Printing
* \{ */
size_t BLI_vsnprintf(char *__restrict buffer,
size_t maxncpy,
const char *__restrict format,
@ -247,6 +257,12 @@ char *BLI_sprintfN(const char *__restrict format, ...)
return n;
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name String Escape/Un-Escape
* \{ */
size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, const size_t dst_maxncpy)
{
@ -349,6 +365,12 @@ const char *BLI_str_escape_find_quote(const char *str)
return (*str == '"') ? str : NULL;
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name String Quote/Un-Quote
* \{ */
bool BLI_str_quoted_substr_range(const char *__restrict str,
const char *__restrict prefix,
int *__restrict r_start,
@ -432,6 +454,12 @@ bool BLI_str_quoted_substr(const char *__restrict str,
return is_complete;
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name String Replace
* \{ */
char *BLI_str_replaceN(const char *__restrict str,
const char *__restrict substr_old,
const char *__restrict substr_new)
@ -513,6 +541,10 @@ bool BLI_str_replace_table_exact(char *string,
/** \} */
/* -------------------------------------------------------------------- */
/** \name String Comparison/Matching
* \{ */
int BLI_strcaseeq(const char *a, const char *b)
{
return (BLI_strcasecmp(a, b) == 0);
@ -806,71 +838,11 @@ int BLI_strcmp_ignore_pad(const char *str1, const char *str2, const char pad)
}
}
size_t BLI_strnlen(const char *s, const size_t maxlen)
{
size_t len;
/** \} */
for (len = 0; len < maxlen; len++, s++) {
if (!*s) {
break;
}
}
return len;
}
void BLI_str_tolower_ascii(char *str, const size_t len)
{
size_t i;
for (i = 0; (i < len) && str[i]; i++) {
if (str[i] >= 'A' && str[i] <= 'Z') {
str[i] += 'a' - 'A';
}
}
}
void BLI_str_toupper_ascii(char *str, const size_t len)
{
size_t i;
for (i = 0; (i < len) && str[i]; i++) {
if (str[i] >= 'a' && str[i] <= 'z') {
str[i] -= 'a' - 'A';
}
}
}
void BLI_str_rstrip(char *str)
{
for (int i = (int)strlen(str) - 1; i >= 0; i--) {
if (isspace(str[i])) {
str[i] = '\0';
}
else {
break;
}
}
}
int BLI_str_rstrip_float_zero(char *str, const char pad)
{
char *p = strchr(str, '.');
int totstrip = 0;
if (p) {
char *end_p;
p++; /* position at first decimal place */
end_p = p + (strlen(p) - 1); /* position at last character */
if (end_p > p) {
while (end_p != p && *end_p == '0') {
*end_p = pad;
end_p--;
totstrip++;
}
}
}
return totstrip;
}
/* -------------------------------------------------------------------- */
/** \name String Comparison at Start/End
* \{ */
int BLI_str_index_in_array_n(const char *__restrict str,
const char **__restrict str_array,
@ -933,6 +905,96 @@ bool BLI_str_endswith(const char *__restrict str, const char *__restrict end)
return BLI_strn_endswith(str, end, slength);
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name String Length
* \{ */
size_t BLI_strnlen(const char *s, const size_t maxlen)
{
size_t len;
for (len = 0; len < maxlen; len++, s++) {
if (!*s) {
break;
}
}
return len;
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name String Case Conversion
* \{ */
void BLI_str_tolower_ascii(char *str, const size_t len)
{
size_t i;
for (i = 0; (i < len) && str[i]; i++) {
if (str[i] >= 'A' && str[i] <= 'Z') {
str[i] += 'a' - 'A';
}
}
}
void BLI_str_toupper_ascii(char *str, const size_t len)
{
size_t i;
for (i = 0; (i < len) && str[i]; i++) {
if (str[i] >= 'a' && str[i] <= 'z') {
str[i] -= 'a' - 'A';
}
}
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name String Stripping
* \{ */
void BLI_str_rstrip(char *str)
{
for (int i = (int)strlen(str) - 1; i >= 0; i--) {
if (isspace(str[i])) {
str[i] = '\0';
}
else {
break;
}
}
}
int BLI_str_rstrip_float_zero(char *str, const char pad)
{
char *p = strchr(str, '.');
int totstrip = 0;
if (p) {
char *end_p;
p++; /* position at first decimal place */
end_p = p + (strlen(p) - 1); /* position at last character */
if (end_p > p) {
while (end_p != p && *end_p == '0') {
*end_p = pad;
end_p--;
totstrip++;
}
}
}
return totstrip;
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name String Split (Partition)
* \{ */
size_t BLI_str_partition(const char *str, const char delim[], const char **sep, const char **suf)
{
return BLI_str_partition_ex(str, NULL, delim, sep, suf, false);
@ -993,6 +1055,47 @@ size_t BLI_str_partition_ex(const char *str,
return end ? (size_t)(end - str) : strlen(str);
}
int BLI_string_find_split_words(
const char *str, const size_t len, const char delim, int r_words[][2], int words_max)
{
int n = 0, i;
bool charsearch = true;
/* Skip leading spaces */
for (i = 0; (i < len) && (str[i] != '\0'); i++) {
if (str[i] != delim) {
break;
}
}
for (; (i < len) && (str[i] != '\0') && (n < words_max); i++) {
if ((str[i] != delim) && (charsearch == true)) {
r_words[n][0] = i;
charsearch = false;
}
else {
if ((str[i] == delim) && (charsearch == false)) {
r_words[n][1] = i - r_words[n][0];
n++;
charsearch = true;
}
}
}
if (charsearch == false) {
r_words[n][1] = i - r_words[n][0];
n++;
}
return n;
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name String Formatting (Numeric)
* \{ */
static size_t BLI_str_format_int_grouped_ex(char src[16], char dst[16], int num_len)
{
char *p_src = src;
@ -1082,37 +1185,4 @@ void BLI_str_format_attribute_domain_size(char dst[7], int number_to_format)
BLI_snprintf(dst, dst_len, "%.*f%s", decimals, number_to_format_converted, units[order]);
}
int BLI_string_find_split_words(
const char *str, const size_t len, const char delim, int r_words[][2], int words_max)
{
int n = 0, i;
bool charsearch = true;
/* Skip leading spaces */
for (i = 0; (i < len) && (str[i] != '\0'); i++) {
if (str[i] != delim) {
break;
}
}
for (; (i < len) && (str[i] != '\0') && (n < words_max); i++) {
if ((str[i] != delim) && (charsearch == true)) {
r_words[n][0] = i;
charsearch = false;
}
else {
if ((str[i] == delim) && (charsearch == false)) {
r_words[n][1] = i - r_words[n][0];
n++;
charsearch = true;
}
}
}
if (charsearch == false) {
r_words[n][1] = i - r_words[n][0];
n++;
}
return n;
}
/** \} */

View File

@ -6,8 +6,8 @@
namespace blender::tests {
/**
* \name Conversions
/* -------------------------------------------------------------------- */
/** \name Conversions
* \{ */
TEST(color, ThemeByteToFloat)

View File

@ -1139,6 +1139,10 @@ static int *read_file_thumbnail(FileData *fd)
/** \} */
/* -------------------------------------------------------------------- */
/** \name File Data API
* \{ */
static FileData *filedata_new(BlendFileReadReport *reports)
{
BLI_assert(reports != NULL);

View File

@ -94,6 +94,7 @@ static bool bmw_edge_is_wire(const BMWalker *walker, const BMEdge *e)
}
return BM_edge_is_wire(e);
}
/** \} */
/* -------------------------------------------------------------------- */
@ -107,6 +108,7 @@ static bool bmw_edge_is_wire(const BMWalker *walker, const BMEdge *e)
*
* \todo Add restriction flag/callback for wire edges.
* \{ */
static void bmw_VertShellWalker_visitEdge(BMWalker *walker, BMEdge *e)
{
BMwShellWalker *shellWalk = NULL;
@ -236,6 +238,7 @@ static void *bmw_VertShellWalker_step(BMWalker *walker)
*
* \note this is mainly useful to loop over a shell delimited by edges.
* \{ */
static void bmw_LoopShellWalker_visitLoop(BMWalker *walker, BMLoop *l)
{
BMwLoopShellWalker *shellWalk = NULL;
@ -509,6 +512,7 @@ static void *bmw_LoopShellWireWalker_step(BMWalker *walker)
* Starts at an edge on the mesh and walks over the 'shell' it belongs
* to via visiting connected faces.
* \{ */
static void bmw_FaceShellWalker_visitEdge(BMWalker *walker, BMEdge *e)
{
BMwShellWalker *shellWalk = NULL;
@ -564,6 +568,7 @@ static void *bmw_FaceShellWalker_step(BMWalker *walker)
return e;
}
/** \} */
/* -------------------------------------------------------------------- */
@ -573,6 +578,7 @@ static void *bmw_FaceShellWalker_step(BMWalker *walker)
*
* Walk from a vertex to all connected vertices.
* \{ */
static void bmw_ConnectedVertexWalker_visitVertex(BMWalker *walker, BMVert *v)
{
BMwConnectedVertexWalker *vwalk;
@ -640,6 +646,7 @@ static void *bmw_ConnectedVertexWalker_step(BMWalker *walker)
*
* \todo Add restriction flag/callback for wire edges.
* \{ */
static void bmw_IslandboundWalker_begin(BMWalker *walker, void *data)
{
BMLoop *l = data;
@ -735,6 +742,7 @@ static void *bmw_IslandboundWalker_step(BMWalker *walker)
*
* \todo Add restriction flag/callback for wire edges.
* \{ */
static void bmw_IslandWalker_begin(BMWalker *walker, void *data)
{
BMwIslandWalker *iwalk = NULL;
@ -1299,6 +1307,7 @@ static void *bmw_FaceLoopWalker_step(BMWalker *walker)
* Conditions for starting and stepping the edge ring have been
* tuned to match behavior users expect (dating back to v2.4x).
* \{ */
static void bmw_EdgeringWalker_begin(BMWalker *walker, void *data)
{
BMwEdgeringWalker *lwalk, owalk, *owalk_pt;
@ -1850,6 +1859,12 @@ static BMWalker bmw_ConnectedVertexWalker_Type = {
BM_VERT, /* Valid restrict masks. */
};
/** \} */
/* -------------------------------------------------------------------- */
/** \name All Walker Types
* \{ */
BMWalker *bm_walker_types[] = {
&bmw_VertShellWalker_Type, /* #BMW_VERT_SHELL */
&bmw_LoopShellWalker_Type, /* #BMW_LOOP_SHELL */
@ -1868,3 +1883,5 @@ BMWalker *bm_walker_types[] = {
};
const int bm_totwalkers = ARRAY_SIZE(bm_walker_types);
/** \} */

View File

@ -120,19 +120,18 @@ typedef struct PathLinkState {
float co_prev[3];
} PathLinkState;
/**
* \name Min Dist Dir Util
/* -------------------------------------------------------------------- */
/** \name Min Dist Dir Util
*
* Simply getting the closest intersecting vert/edge is _not_ good enough. see T43792
* we need to get the closest in both directions since the absolute closest may be a dead-end.
*
* Logic is simple:
*
* - first intersection, store the direction.
* - successive intersections will update the first distance if its aligned with the first hit.
* - First intersection, store the direction.
* - Successive intersections will update the first distance if its aligned with the first hit.
* otherwise update the opposite distance.
* - caller stores best outcome in both directions.
*
* - Caller stores best outcome in both directions.
* \{ */
typedef struct MinDistDir {

View File

@ -88,7 +88,7 @@ static short plane_point_test_v3(const float plane[4],
*
* Hide flag access
* (for more readable code since same flag is used differently for vert/edge-face).
*/
* \{ */
/** Enable when vertex is in the center and its faces have been added to the stack. */
BLI_INLINE void vert_is_center_enable(BMVert *v)

View File

@ -580,4 +580,5 @@ LinkNode *BM_mesh_calc_path_face(BMesh *bm,
return path;
}
/** \} */

View File

@ -198,6 +198,7 @@ struct LinkNode *BM_mesh_calc_path_uv_vert(BMesh *bm,
/* -------------------------------------------------------------------- */
/** \name BM_mesh_calc_path_uv_edge
* \{ */
/* TODO(campbell): not very urgent, since the operator fakes this using vertex path. */
/** \} */

View File

@ -1223,6 +1223,7 @@ static BMEdge *bm_face_region_pivot_edge_find(BMFace **faces_region,
return e_pivot;
}
/** \} */
#endif /* USE_PIVOT_SEARCH */

View File

@ -967,6 +967,7 @@ static void eevee_lightbake_render_scene_to_planars(EEVEE_ViewLayerData *sldata,
sldata->probes->planar_data,
sldata->probes->num_planar);
}
/** \} */
/* -------------------------------------------------------------------- */

View File

@ -830,6 +830,7 @@ struct GPUShader *EEVEE_shaders_subsurface_translucency_sh_get()
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Volumes
* \{ */

View File

@ -1920,6 +1920,7 @@ static void draw_bone_name(ArmatureDrawContext *ctx,
DRW_TEXT_CACHE_GLOBALSPACE | DRW_TEXT_CACHE_STRING_PTR,
color);
}
/** \} */
/* -------------------------------------------------------------------- */
@ -2328,3 +2329,5 @@ void OVERLAY_pose_draw(OVERLAY_Data *vedata)
DRW_draw_pass(psl->armature_ps[1]);
}
}
/** \} */

View File

@ -47,6 +47,10 @@
#include "draw_cache_impl.h"
#include "draw_manager.h"
/* -------------------------------------------------------------------- */
/** \name Internal Defines
* \{ */
#define VCLASS_LIGHT_AREA_SHAPE (1 << 0)
#define VCLASS_LIGHT_SPOT_SHAPE (1 << 1)
#define VCLASS_LIGHT_SPOT_BLEND (1 << 2)
@ -77,6 +81,12 @@
#define DRW_SPHERE_SHAPE_LATITUDE_HIGH 80
#define DRW_SPHERE_SHAPE_LONGITUDE_HIGH 60
/** \} */
/* -------------------------------------------------------------------- */
/** \name Internal Types
* \{ */
typedef struct Vert {
float pos[3];
int class;
@ -163,6 +173,8 @@ void DRW_shape_cache_free(void)
}
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Procedural Batches
* \{ */
@ -765,6 +777,8 @@ GPUBatch *DRW_cache_normal_arrow_get(void)
return SHC.drw_normal_arrow;
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Dummy VBO's
*
@ -3137,6 +3151,8 @@ GPUBatch *DRW_cache_pointcloud_surface_get(Object *object)
return DRW_pointcloud_batch_cache_get_surface(object);
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Volume
* \{ */

View File

@ -56,6 +56,7 @@ namespace blender::draw {
/* ---------------------------------------------------------------------- */
/** \name Mesh Elements Extract Struct
* \{ */
using TaskId = int;
using TaskLen = int;
@ -158,6 +159,7 @@ class ExtractorRunDatas : public Vector<ExtractorRunData> {
/* ---------------------------------------------------------------------- */
/** \name ExtractTaskData
* \{ */
struct ExtractTaskData {
const MeshRenderData *mr = nullptr;
MeshBatchCache *cache = nullptr;
@ -495,6 +497,7 @@ static struct TaskNode *extract_task_node_create(struct TaskGraph *task_graph,
/* ---------------------------------------------------------------------- */
/** \name Task Node - Update Mesh Render Data
* \{ */
struct MeshRenderDataUpdateTaskData {
MeshRenderData *mr = nullptr;
MeshBufferCache *cache = nullptr;
@ -778,6 +781,8 @@ static void mesh_buffer_cache_create_requested(struct TaskGraph *task_graph,
#endif
}
/** \} */
} // namespace blender::draw
extern "C" {
@ -814,5 +819,3 @@ void mesh_buffer_cache_create_requested(struct TaskGraph *task_graph,
}
} // extern "C"
/** \} */

View File

@ -174,8 +174,8 @@ void mesh_render_data_update_loose_geom(MeshRenderData *mr,
/** \name Polygons sorted per material
*
* Contains polygon indices sorted based on their material.
*
* \{ */
static void mesh_render_data_polys_sorted_load(MeshRenderData *mr, const MeshBufferCache *cache);
static void mesh_render_data_polys_sorted_ensure(MeshRenderData *mr, MeshBufferCache *cache);
static void mesh_render_data_polys_sorted_build(MeshRenderData *mr, MeshBufferCache *cache);

View File

@ -47,7 +47,10 @@
#define BEZIER_HANDLE (1 << 3)
#define COLOR_SHIFT 5
/* ---------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
/** \name Internal Types
* \{ */
typedef struct GpencilBatchCache {
/** Instancing Data */
GPUVertBuf *vbo;
@ -74,6 +77,12 @@ typedef struct GpencilBatchCache {
int cache_frame;
} GpencilBatchCache;
/** \} */
/* -------------------------------------------------------------------- */
/** \name Internal Utilities
* \{ */
static bool gpencil_batch_cache_valid(GpencilBatchCache *cache, bGPdata *gpd, int cfra)
{
bool valid = true;
@ -151,6 +160,12 @@ static GpencilBatchCache *gpencil_batch_cache_get(Object *ob, int cfra)
return cache;
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name BKE Callbacks
* \{ */
void DRW_gpencil_batch_cache_dirty_tag(bGPdata *gpd)
{
gpd->flag |= GP_DATA_CACHE_IS_DIRTY;
@ -166,7 +181,7 @@ void DRW_gpencil_batch_cache_free(bGPdata *gpd)
/** \} */
/* -------------------------------------------------------------------- */
/** \name Vertex Formats.
/** \name Vertex Formats
* \{ */
/* MUST match the format below. */
@ -247,7 +262,7 @@ static GPUVertFormat *gpencil_color_format(void)
/** \} */
/* -------------------------------------------------------------------- */
/** \name Vertex Buffers.
/** \name Vertex Buffers
* \{ */
typedef struct gpIterData {
@ -681,8 +696,9 @@ void DRW_cache_gpencil_sbuffer_clear(Object *ob)
/** \} */
/* ---------------------------------------------------------------------- */
/* Edit GPencil Batches */
/* -------------------------------------------------------------------- */
/** \name Edit GPencil Batches
* \{ */
#define GP_EDIT_POINT_SELECTED (1 << 0)
#define GP_EDIT_STROKE_SELECTED (1 << 1)

View File

@ -41,8 +41,9 @@
static void metaball_batch_cache_clear(MetaBall *mb);
/* ---------------------------------------------------------------------- */
/* MetaBall GPUBatch Cache */
/* -------------------------------------------------------------------- */
/** \name MetaBall GPUBatch Cache
* \{ */
typedef struct MetaBallBatchCache {
GPUBatch *batch;
@ -175,6 +176,8 @@ static GPUIndexBuf *mball_batch_cache_get_edges_adj_lines(Object *ob, MetaBallBa
return cache->edges_adj_lines;
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Public Object/MetaBall API
* \{ */
@ -303,3 +306,5 @@ int DRW_metaball_material_count_get(MetaBall *mb)
{
return max_ii(1, mb->totcol);
}
/** \} */

View File

@ -407,6 +407,7 @@ void DRW_instance_data_list_resize(DRWInstanceDataList *idatalist)
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Sparse Uniform Buffer
* \{ */

View File

@ -3226,6 +3226,8 @@ void DRW_xr_drawing_end(void)
#endif
/** \} */
/* -------------------------------------------------------------------- */
/** \name Internal testing API for gtests
* \{ */

View File

@ -497,4 +497,5 @@ void DRW_select_buffer_context_create(Base **bases, const uint bases_len, short
select_ctx->select_mode = select_mode;
memset(select_ctx->persmat, 0, sizeof(select_ctx->persmat));
}
/** \} */

View File

@ -283,6 +283,7 @@ void DRW_draw_cursor_2d(void)
DRW_draw_cursor_2d_ex(region, sima->cursor);
}
}
/** \} */
/* **************************** 3D Gizmo ******************************** */

View File

@ -168,7 +168,9 @@ BLI_INLINE const float *bm_face_no_get(const MeshRenderData *mr, const BMFace *e
/* ---------------------------------------------------------------------- */
/** \name Mesh Elements Extract Struct
* \{ */
/* TODO(jbakker): move parameters inside a struct. */
typedef void(ExtractTriBMeshFn)(const MeshRenderData *mr,
BMLoop **elt,
const int elt_index,

View File

@ -388,5 +388,3 @@ const MeshExtract extract_edituv_lines = blender::draw::create_extractor_edituv_
const MeshExtract extract_edituv_points = blender::draw::create_extractor_edituv_points();
const MeshExtract extract_edituv_fdots = blender::draw::create_extractor_edituv_fdots();
}
/** \} */

View File

@ -110,10 +110,9 @@ constexpr MeshExtract create_extractor_fdots()
}
/** \} */
} // namespace blender::draw
extern "C" {
const MeshExtract extract_fdots = blender::draw::create_extractor_fdots();
}
/** \} */

View File

@ -173,8 +173,6 @@ static void extract_lines_adjacency_finish(const MeshRenderData *UNUSED(mr),
#undef NO_EDGE
/** \} */
constexpr MeshExtract create_extractor_lines_adjacency()
{
MeshExtract extractor = {nullptr};
@ -189,10 +187,10 @@ constexpr MeshExtract create_extractor_lines_adjacency()
return extractor;
}
/** \} */
} // namespace blender::draw
extern "C" {
const MeshExtract extract_lines_adjacency = blender::draw::create_extractor_lines_adjacency();
}
/** \} */

View File

@ -103,8 +103,6 @@ static void extract_lines_paint_mask_finish(const MeshRenderData *UNUSED(mr),
MEM_freeN(data->select_map);
}
/** \} */
constexpr MeshExtract create_extractor_lines_paint_mask()
{
MeshExtract extractor = {nullptr};
@ -118,10 +116,10 @@ constexpr MeshExtract create_extractor_lines_paint_mask()
return extractor;
}
/** \} */
} // namespace blender::draw
extern "C" {
const MeshExtract extract_lines_paint_mask = blender::draw::create_extractor_lines_paint_mask();
}
/** \} */

View File

@ -32,6 +32,7 @@ namespace blender::draw {
/* ---------------------------------------------------------------------- */
/** \name Extract Point Indices
* \{ */
static void extract_points_init(const MeshRenderData *mr,
struct MeshBatchCache *UNUSED(cache),
void *UNUSED(buf),
@ -173,10 +174,10 @@ constexpr MeshExtract create_extractor_points()
return extractor;
}
/** \} */
} // namespace blender::draw
extern "C" {
const MeshExtract extract_points = blender::draw::create_extractor_points();
}
/** \} */

View File

@ -28,6 +28,7 @@ namespace blender::draw {
/* ---------------------------------------------------------------------- */
/** \name Extract Face-dots Normal and edit flag
* \{ */
#define NOR_AND_FLAG_DEFAULT 0
#define NOR_AND_FLAG_SELECT 1
#define NOR_AND_FLAG_ACTIVE -1
@ -114,6 +115,7 @@ constexpr MeshExtract create_extractor_fdots_nor()
/* ---------------------------------------------------------------------- */
/** \name Extract Face-dots High Quality Normal and edit flag
* \{ */
static void extract_fdots_nor_hq_init(const MeshRenderData *mr,
struct MeshBatchCache *UNUSED(cache),
void *buf,

View File

@ -121,6 +121,7 @@ constexpr MeshExtract create_extractor_lnor()
}
/** \} */
/* ---------------------------------------------------------------------- */
/** \name Extract HQ Loop Normal
* \{ */

View File

@ -302,6 +302,12 @@ void armature_select_mirrored(struct bArmature *arm);
/** Only works when tagged. */
void armature_tag_unselect(struct bArmature *arm);
/** \} */
/* -------------------------------------------------------------------- */
/** \name Selection Picking
* \{ */
struct EditBone *ED_armature_pick_ebone(struct bContext *C,
const int xy[2],
bool findunsel,
@ -337,6 +343,12 @@ struct Bone *ED_armature_pick_bone_from_selectbuffer(struct Base **bases,
bool do_nearest,
struct Base **r_base);
/** \} */
/* -------------------------------------------------------------------- */
/** \name Iteration
* \{ */
/**
* XXX: bone_looper is only to be used when we want to access settings
* (i.e. editability/visibility/selected) that context doesn't offer.
@ -345,3 +357,5 @@ int bone_looper(struct Object *ob,
struct Bone *bone,
void *data,
int (*bone_func)(struct Object *, struct Bone *, void *));
/** \} */

View File

@ -318,6 +318,7 @@ StringRef AssetList::filepath() const
{
return filelist_dir(filelist_);
}
/** \} */
/* -------------------------------------------------------------------- */

View File

@ -71,8 +71,6 @@
static int kill_selection(Object *obedit, int ins);
/** \} */
/* -------------------------------------------------------------------- */
/** \name Internal Utilities
* \{ */

View File

@ -59,6 +59,10 @@
#include "../gizmo_geometry.h"
#include "../gizmo_library_intern.h"
/* -------------------------------------------------------------------- */
/** \name Internal Types
* \{ */
typedef struct ButtonGizmo2D {
wmGizmo gizmo;
bool is_init;
@ -69,7 +73,11 @@ typedef struct ButtonGizmo2D {
#define CIRCLE_RESOLUTION 32
/** \} */
/* -------------------------------------------------------------------- */
/** \name Internal API
* \{ */
static void button2d_geom_draw_backdrop(const wmGizmo *gz,
const float color[4],

View File

@ -5337,6 +5337,7 @@ void GPENCIL_OT_stroke_merge_by_distance(wmOperatorType *ot)
ot->srna, "use_unselected", 0, "Unselected", "Use whole stroke, not only selected points");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
/** \} */
/* -------------------------------------------------------------------- */

View File

@ -51,6 +51,10 @@
#include "gpencil_intern.h"
/* -------------------------------------------------------------------- */
/** \name Enter Edit-Mode
* \{ */
/* Poll callback for checking if there is an active layer and we are in curve edit mode. */
static bool gpencil_curve_edit_mode_poll(bContext *C)
{
@ -135,6 +139,12 @@ void GPENCIL_OT_stroke_enter_editcurve_mode(wmOperatorType *ot)
RNA_def_property_ui_range(prop, FLT_MIN, 10.0f, 0.1f, 5);
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Set Handle Type
* \{ */
static int gpencil_editcurve_set_handle_type_exec(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_active_object(C);

View File

@ -248,6 +248,7 @@ static void select_all_curve_points(bGPdata *gpd, bGPDstroke *gps, bGPDcurve *gp
/* -------------------------------------------------------------------- */
/** \name Select All Operator
* \{ */
static bool gpencil_select_all_poll(bContext *C)
{
bGPdata *gpd = ED_gpencil_data_get_active(C);

View File

@ -1717,8 +1717,8 @@ uiBut *uiDefHotKeyevtButS(uiBlock *block,
const char *tip);
/**
* \param arg is pointer to string/name, use UI_but_func_search_set() below to make this work.
* here a1 and a2, if set, control thumbnail preview rows/cols.
* \param arg: A pointer to string/name, use #UI_but_func_search_set() below to make this work.
* here `a1` and `a2`, if set, control thumbnail preview rows/cols.
*/
uiBut *uiDefSearchBut(uiBlock *block,
void *arg,

View File

@ -80,6 +80,6 @@ void template_breadcrumbs(uiLayout &layout, Span<ContextPathItem> context_path)
}
}
} // namespace blender::ui
/** \} */
} // namespace blender::ui

View File

@ -103,8 +103,10 @@ wmKeyMap *eyedropper_colorband_modal_keymap(wmKeyConfig *keyconf)
/* -------------------------------------------------------------------- */
/* Utility Functions
*/
/** \name Generic Shared Functions
* \{ */
static void eyedropper_draw_cursor_text_ex(const int x, const int y, const char *name)
{
const uiFontStyle *fstyle = UI_FSTYLE_WIDGET;

View File

@ -57,6 +57,7 @@
/* -------------------------------------------------------------------- */
/** \name Utilities
* \{ */
struct HudRegionData {
short regionid;
};

View File

@ -305,8 +305,7 @@ int UI_pie_menu_invoke_from_rna_enum(struct bContext *C,
/** \} */
/* -------------------------------------------------------------------- */
/**
* \name Pie Menu Levels
/** \name Pie Menu Levels
*
* Pie menus can't contain more than 8 items (yet).
* When using #uiItemsFullEnumO, a "More" button is created that calls
@ -318,7 +317,6 @@ int UI_pie_menu_invoke_from_rna_enum(struct bContext *C,
* Ideally we'd have some way of handling this for all kinds of pie items, but that's tricky.
*
* - Julian (Feb 2016)
*
* \{ */
typedef struct PieMenuLevelData {

View File

@ -2234,8 +2234,6 @@ void uiTemplateGpencilModifiers(uiLayout *UNUSED(layout), bContext *C)
/** \} */
/** \} */
#define ERROR_LIBDATA_MESSAGE TIP_("Can't edit external library data")
/* -------------------------------------------------------------------- */

View File

@ -4647,6 +4647,8 @@ static int widget_roundbox_set(uiBut *but, rcti *rect)
return roundbox;
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Public API
* \{ */

View File

@ -1365,6 +1365,7 @@ void UI_view2d_dot_grid_draw(const View2D *v2d,
immUnbindProgram();
}
/** \} */
/* -------------------------------------------------------------------- */

View File

@ -47,8 +47,6 @@
#include "lattice_intern.h"
/** \} */
/* -------------------------------------------------------------------- */
/** \name Make Regular Operator
* \{ */

View File

@ -411,4 +411,5 @@ void EDBM_preselect_elem_update_preview(struct EditMesh_PreSelElem *psel,
BLI_assert(0);
}
}
/** \} */

View File

@ -974,6 +974,7 @@ static int similar_edge_select_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
/** \} */
/* -------------------------------------------------------------------- */
@ -1255,6 +1256,7 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
/** \} */
/* -------------------------------------------------------------------- */

View File

@ -1679,6 +1679,8 @@ void OBJECT_OT_modifier_set_active(wmOperatorType *ot)
}
/** \} */
/* ------------------------------------------------------------------- */
/** \name Copy Modifier To Selected Operator
* \{ */
@ -2678,6 +2680,7 @@ void OBJECT_OT_skin_armature_create(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
edit_modifier_properties(ot);
}
/** \} */
/* ------------------------------------------------------------------- */

View File

@ -402,6 +402,8 @@ void OBJECT_OT_shaderfx_add(wmOperatorType *ot)
RNA_def_property_translation_context(ot->prop, BLT_I18NCONTEXT_ID_ID);
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Generic Functions for Operators Using Names and Data Context
* \{ */

View File

@ -2226,10 +2226,10 @@ void SCENE_OT_freestyle_stroke_material_create(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
#endif /* WITH_FREESTYLE */
/** \} */
#endif /* WITH_FREESTYLE */
/* -------------------------------------------------------------------- */
/** \name Texture Slot Move Operator
* \{ */

View File

@ -4405,6 +4405,7 @@ static void SCREEN_OT_region_context_menu(wmOperatorType *ot)
*
* Animation Step.
* \{ */
static bool screen_animation_region_supports_time_follow(eSpace_Type spacetype,
eRegion_Type regiontype)
{

View File

@ -130,6 +130,7 @@ bool ED_wpaint_ensure_data(bContext *C,
return true;
}
/** \} */
int ED_wpaint_mirror_vgroup_ensure(Object *ob, const int vgroup_active)

View File

@ -102,13 +102,15 @@
#include <stdlib.h>
#include <string.h>
/* Sculpt PBVH abstraction API
/* -------------------------------------------------------------------- */
/** \name Sculpt PBVH Abstraction API
*
* This is read-only, for writing use PBVH vertex iterators. There vd.index matches
* the indices used here.
*
* For multi-resolution, the same vertex in multiple grids is counted multiple times, with
* different index for each grid. */
* different index for each grid.
* \{ */
void SCULPT_vertex_random_access_ensure(SculptSession *ss)
{
@ -1068,9 +1070,13 @@ void SCULPT_tag_update_overlays(bContext *C)
}
}
/* Sculpt Flood Fill API
/** \} */
/* -------------------------------------------------------------------- */
/** \name Sculpt Flood Fill API
*
* Iterate over connected vertices, starting from one or more initial vertices. */
* Iterate over connected vertices, starting from one or more initial vertices.
* \{ */
void SCULPT_floodfill_init(SculptSession *ss, SculptFloodFill *flood)
{
@ -1181,12 +1187,13 @@ void SCULPT_floodfill_free(SculptFloodFill *flood)
flood->queue = NULL;
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Tool Capabilities
*
* Avoid duplicate checks, internal logic only,
* share logic with #rna_def_sculpt_capabilities where possible.
*
* \{ */
static bool sculpt_tool_needs_original(const char sculpt_tool)
@ -1246,13 +1253,18 @@ static int sculpt_brush_needs_normal(const SculptSession *ss, const Brush *brush
(brush->mtex.brush_map_mode == MTEX_MAP_MODE_AREA)) ||
sculpt_brush_use_topology_rake(ss, brush);
}
/** \} */
static bool sculpt_brush_needs_rake_rotation(const Brush *brush)
{
return SCULPT_TOOL_HAS_RAKE(brush->sculpt_tool) && (brush->rake_factor != 0.0f);
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Sculpt Init/Update
* \{ */
typedef enum StrokeFlags {
CLIP_X = 1,
CLIP_Y = 2,
@ -1374,11 +1386,12 @@ static void sculpt_project_v3_normal_align(SculptSession *ss,
grab_delta, ss->cache->sculpt_normal_symm, (len_signed * normal_weight) * len_view_scale);
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name SculptProjectVector
*
* Fast-path for #project_plane_v3_v3v3
*
* \{ */
typedef struct SculptProjectVector {
@ -1415,7 +1428,9 @@ static void sculpt_project_v3(const SculptProjectVector *spvc, const float vec[3
/** \} */
/**********************************************************************/
/* -------------------------------------------------------------------- */
/** \name Sculpt Dynamic Topology
* \{ */
bool SCULPT_stroke_is_dynamic_topology(const SculptSession *ss, const Brush *brush)
{
@ -1430,7 +1445,11 @@ bool SCULPT_stroke_is_dynamic_topology(const SculptSession *ss, const Brush *bru
SCULPT_TOOL_HAS_DYNTOPO(brush->sculpt_tool));
}
/*** paint mesh ***/
/** \} */
/* -------------------------------------------------------------------- */
/** \name Sculpt Paint Mesh
* \{ */
static void paint_mesh_restore_co_task_cb(void *__restrict userdata,
const int n,
@ -1885,6 +1904,8 @@ static float calc_symmetry_feather(Sculpt *sd, StrokeCache *cache)
return 1.0f / overlap;
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Calculate Normal and Center
*
@ -2213,8 +2234,10 @@ bool SCULPT_pbvh_calc_area_normal(const Brush *brush,
return data.any_vertex_sampled;
}
/* This calculates flatten center and area normal together,
* amortizing the memory bandwidth and loop overhead to calculate both at the same time. */
/**
* This calculates flatten center and area normal together,
* amortizing the memory bandwidth and loop overhead to calculate both at the same time.
*/
static void calc_area_normal_and_center(
Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, float r_area_no[3], float r_area_co[3])
{
@ -2274,6 +2297,10 @@ static void calc_area_normal_and_center(
/** \} */
/* -------------------------------------------------------------------- */
/** \name Generic Brush Utilities
* \{ */
/**
* Return modified brush strength. Includes the direction of the brush, positive
* values pull vertices, negative values push. Uses tablet pressure and a
@ -2827,6 +2854,12 @@ static void update_brush_local_mat(Sculpt *sd, Object *ob)
}
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Sculpt Topology Rake (Shared Utility)
* \{ */
typedef struct {
SculptSession *ss;
const float *ray_start;
@ -2939,6 +2972,12 @@ static void bmesh_topology_rake(
}
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Sculpt Mask Brush
* \{ */
static void do_mask_brush_draw_task_cb_ex(void *__restrict userdata,
const int n,
const TaskParallelTLS *__restrict tls)
@ -3010,6 +3049,8 @@ static void do_mask_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
}
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Sculpt Multires Displacement Eraser Brush
* \{ */
@ -3078,6 +3119,7 @@ static void do_displacement_eraser_brush(Sculpt *sd, Object *ob, PBVHNode **node
/** \} */
/* -------------------------------------------------------------------- */
/** \name Sculpt Multires Displacement Smear Brush
* \{ */
@ -3220,6 +3262,10 @@ static void do_displacement_smear_brush(Sculpt *sd, Object *ob, PBVHNode **nodes
/** \} */
/* -------------------------------------------------------------------- */
/** \name Sculpt Draw Brush
* \{ */
static void do_draw_brush_task_cb_ex(void *__restrict userdata,
const int n,
const TaskParallelTLS *__restrict tls)
@ -3374,6 +3420,8 @@ static void do_draw_sharp_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int to
BLI_task_parallel_range(0, totnode, &data, do_draw_sharp_brush_task_cb_ex, &settings);
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Sculpt Topology Brush
* \{ */
@ -3698,6 +3746,10 @@ static void calc_sculpt_plane(
/** \} */
/* -------------------------------------------------------------------- */
/** \name Sculpt Crease & Blob Brush
* \{ */
/**
* Used for 'SCULPT_TOOL_CREASE' and 'SCULPT_TOOL_BLOB'
*/
@ -4934,6 +4986,8 @@ static void do_flatten_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totno
BLI_task_parallel_range(0, totnode, &data, do_flatten_brush_task_cb_ex, &settings);
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Sculpt Clay Brush
* \{ */
@ -5466,6 +5520,8 @@ static void do_scrape_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnod
BLI_task_parallel_range(0, totnode, &data, do_scrape_brush_task_cb_ex, &settings);
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Sculpt Clay Thumb Brush
* \{ */
@ -5640,6 +5696,10 @@ static void do_clay_thumb_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int to
/** \} */
/* -------------------------------------------------------------------- */
/** \name Sculpt Gravity Brush
* \{ */
static void do_gravity_task_cb_ex(void *__restrict userdata,
const int n,
const TaskParallelTLS *__restrict tls)
@ -5710,6 +5770,12 @@ static void do_gravity(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode, fl
BLI_task_parallel_range(0, totnode, &data, do_gravity_task_cb_ex, &settings);
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Sculpt Prush Utilities
* \{ */
void SCULPT_vertcos_to_key(Object *ob, KeyBlock *kb, const float (*vertCos)[3])
{
Mesh *me = (Mesh *)ob->data;
@ -9346,6 +9412,12 @@ static void SCULPT_OT_mask_by_color(wmOperatorType *ot)
1.0f);
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Operator Registration
* \{ */
void ED_operatortypes_sculpt(void)
{
WM_operatortype_append(SCULPT_OT_brush_stroke);
@ -9384,3 +9456,5 @@ void ED_operatortypes_sculpt(void)
WM_operatortype_append(SCULPT_OT_expand);
}
/** \} */

View File

@ -57,6 +57,10 @@
#include <math.h>
#include <stdlib.h>
/* -------------------------------------------------------------------- */
/** \name Internal Utilities
* \{ */
typedef struct {
const float *ray_start;
bool hit;
@ -82,6 +86,12 @@ static bool sculpt_and_dynamic_topology_poll(bContext *C)
return SCULPT_mode_poll(C) && ob->sculpt->bm;
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Detail Flood Fill
* \{ */
static int sculpt_detail_flood_fill_exec(bContext *C, wmOperator *UNUSED(op))
{
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
@ -147,6 +157,12 @@ void SCULPT_OT_detail_flood_fill(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Sample Detail Size
* \{ */
typedef enum eSculptSampleDetailModeTypes {
SAMPLE_DETAIL_DYNTOPO = 0,
SAMPLE_DETAIL_VOXEL = 1,
@ -364,13 +380,17 @@ void SCULPT_OT_sample_detail_size(wmOperatorType *ot)
"Target sculpting workflow that is going to use the sampled size");
}
/* Dynamic-topology detail size.
/** \} */
/* -------------------------------------------------------------------- */
/** \name Dynamic-topology detail size
*
* Currently, there are two operators editing the detail size:
* - SCULPT_OT_set_detail_size uses radial control for all methods
* - SCULPT_OT_dyntopo_detail_size_edit shows a triangle grid representation of the detail
* resolution (for constant detail method, falls back to radial control for the remaining methods).
*/
* - #SCULPT_OT_set_detail_size uses radial control for all methods
* - #SCULPT_OT_dyntopo_detail_size_edit shows a triangle grid representation of the detail
* resolution (for constant detail method,
* falls back to radial control for the remaining methods).
* \{ */
static void set_brush_rc_props(PointerRNA *ptr, const char *prop)
{
@ -429,6 +449,8 @@ void SCULPT_OT_set_detail_size(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Dyntopo Detail Size Edit Operator
* \{ */
@ -759,3 +781,5 @@ void SCULPT_OT_dyntopo_detail_size_edit(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/** \} */

View File

@ -911,6 +911,7 @@ void CLIP_OT_view_zoom_ratio(wmOperatorType *ot)
-FLT_MAX,
FLT_MAX);
}
/** \} */
/* -------------------------------------------------------------------- */
@ -988,6 +989,7 @@ void CLIP_OT_view_all(wmOperatorType *ot)
prop = RNA_def_boolean(ot->srna, "fit_view", 0, "Fit View", "Fit frame to the viewport");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
/** \} */
/* -------------------------------------------------------------------- */
@ -1052,6 +1054,7 @@ void CLIP_OT_view_selected(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_LOCK_BYPASS;
}
/** \} */
/* -------------------------------------------------------------------- */
@ -1172,6 +1175,7 @@ void CLIP_OT_change_frame(wmOperatorType *ot)
/* rna */
RNA_def_int(ot->srna, "frame", 0, MINAFRAME, MAXFRAME, "Frame", "", MINAFRAME, MAXFRAME);
}
/** \} */
/* -------------------------------------------------------------------- */
@ -1584,6 +1588,7 @@ void CLIP_OT_rebuild_proxy(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER;
}
/** \} */
/* -------------------------------------------------------------------- */
@ -1623,10 +1628,10 @@ void CLIP_OT_mode_set(wmOperatorType *ot)
RNA_def_enum(ot->srna, "mode", rna_enum_clip_editor_mode_items, SC_MODE_TRACKING, "Mode", "");
}
#ifdef WITH_INPUT_NDOF
/** \} */
#ifdef WITH_INPUT_NDOF
/* -------------------------------------------------------------------- */
/** \name NDOF Operator
* \{ */
@ -1725,6 +1730,7 @@ void CLIP_OT_prefetch(wmOperatorType *ot)
ot->invoke = clip_prefetch_invoke;
ot->modal = clip_prefetch_modal;
}
/** \} */
/* -------------------------------------------------------------------- */
@ -1764,6 +1770,7 @@ void CLIP_OT_set_scene_frames(wmOperatorType *ot)
ot->poll = ED_space_clip_view_clip_poll;
ot->exec = clip_set_scene_frames_exec;
}
/** \} */
/* -------------------------------------------------------------------- */

View File

@ -728,10 +728,10 @@ void IMAGE_OT_view_zoom(wmOperatorType *ot)
WM_operator_properties_use_cursor_init(ot);
}
#ifdef WITH_INPUT_NDOF
/** \} */
#ifdef WITH_INPUT_NDOF
/* -------------------------------------------------------------------- */
/** \name NDOF Operator
* \{ */
@ -4136,3 +4136,5 @@ void IMAGE_OT_tile_fill(wmOperatorType *ot)
def_fill_tile(ot->srna);
}
/** \} */

View File

@ -78,8 +78,6 @@ static void outliner_show_active(SpaceOutliner *space_outliner,
TreeElement *te,
ID *id);
/** \} */
/* -------------------------------------------------------------------- */
/** \name Highlight on Cursor Motion Operator
* \{ */
@ -2227,8 +2225,6 @@ static bool ed_operator_outliner_id_orphans_active(bContext *C)
return true;
}
/** \} */
static int outliner_orphans_purge_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
{
Main *bmain = CTX_data_main(C);

View File

@ -298,6 +298,10 @@ enum {
/** \} */
/* -------------------------------------------------------------------- */
/** \name Transform Types
* \{ */
typedef struct TransSnapPoint {
struct TransSnapPoint *next, *prev;
float co[3];

View File

@ -2092,6 +2092,7 @@ void recalcData_mesh(TransInfo *t)
tc_mesh_partial_update(t, tc, &partial_state);
}
}
/** \} */
/* -------------------------------------------------------------------- */
@ -2157,4 +2158,5 @@ void special_aftertrans_update__mesh(bContext *UNUSED(C), TransInfo *t)
break;
}
}
/** \} */

View File

@ -303,4 +303,5 @@ void recalcData_mesh_skin(TransInfo *t)
BKE_editmesh_looptri_and_normals_calc(em);
}
}
/** \} */

Some files were not shown because too many files have changed in this diff Show More