Cleanup: use doxygen comments in BKE, consistent comment blocks

Also remove doxygen comment use for comments in the functions body.
This commit is contained in:
Campbell Barton
2025-04-22 06:13:33 +00:00
parent 2372167e96
commit 720b00ae50
29 changed files with 468 additions and 292 deletions

View File

@@ -78,18 +78,24 @@ struct BlendfileLinkAppendContextItem {
/** ID type. */
short idcode;
/** Type of action to perform on this item, and general status tag information.
* NOTE: Mostly used by append post-linking processing. */
/**
* Type of action to perform on this item, and general status tag information.
* NOTE: Mostly used by append post-linking processing.
*/
char action;
char tag;
/** Newly linked ID (nullptr until it has been successfully linked). */
ID *new_id;
/** Library ID from which the #new_id has been linked (nullptr until it has been successfully
* linked). */
/**
* Library ID from which the #new_id has been linked
* (nullptr until it has been successfully linked).
*/
Library *source_library;
/** Liboverride of the linked ID (nullptr until it has been successfully created or an existing
* one has been found). */
/**
* Liboverride of the linked ID
* (nullptr until it has been successfully created or an existing one has been found).
*/
ID *liboverride_id;
/**
* Whether the item has a matching local ID that was already appended from the same source
@@ -102,12 +108,15 @@ struct BlendfileLinkAppendContextItem {
void *userdata;
};
/** A blendfile library entry in the `libraries` vector from #BlendfileLinkAppendContext. */
/** A blend-file library entry in the `libraries` vector from #BlendfileLinkAppendContext. */
struct BlendfileLinkAppendContextLibrary {
std::string path; /* Absolute .blend file path. */
BlendHandle *blo_handle; /* Blend file handle, if any. */
bool blo_handle_is_owned; /* Whether the blend file handle is owned, or borrowed. */
/* The blendfile report associated with the `blo_handle`, if owned. */
/** Absolute .blend file path. */
std::string path;
/** Blend file handle, if any. */
BlendHandle *blo_handle;
/** Whether the blend file handle is owned, or borrowed. */
bool blo_handle_is_owned;
/** The blend-file report associated with the `blo_handle`, if owned. */
BlendFileReadReport bf_reports;
};
@@ -284,11 +293,13 @@ short BKE_blendfile_link_append_context_item_idcode_get(BlendfileLinkAppendConte
enum eBlendfileLinkAppendForeachItemFlag {
/** Loop over directly linked items (i.e. those explicitly defined by user code). */
BKE_BLENDFILE_LINK_APPEND_FOREACH_ITEM_FLAG_DO_DIRECT = 1 << 0,
/** Loop over indirectly linked items (i.e. those defined by internal code, as dependencies of
/**
* Loop over indirectly linked items (i.e. those defined by internal code, as dependencies of
* direct ones).
*
* IMPORTANT: Those 'indirect' items currently may not cover **all** indirectly linked data.
* See comments in #foreach_libblock_link_append_callback. */
* See comments in #foreach_libblock_link_append_callback.
*/
BKE_BLENDFILE_LINK_APPEND_FOREACH_ITEM_FLAG_DO_INDIRECT = 1 << 1,
};

View File

@@ -23,8 +23,8 @@ struct ReportList;
/** \name Core `foreach_path` API.
* \{ */
/** Flags controlling the behavior of the generic BPath API. */
enum eBPathForeachFlag {
/* Flags controlling the behavior of the generic BPath API. */
/**
* Ensures the `absolute_base_path` member of #BPathForeachPathData is initialized properly with
* the path of the current .blend file. This can be used by the callbacks to convert relative
@@ -37,21 +37,27 @@ enum eBPathForeachFlag {
BKE_BPATH_FOREACH_PATH_SKIP_PACKED = (1 << 2),
/** Resolve tokens within a virtual filepath to a single, concrete, filepath. */
BKE_BPATH_FOREACH_PATH_RESOLVE_TOKEN = (1 << 3),
/* Skip weak reference paths. Those paths are typically 'nice to have' extra information, but are
/**
* Skip weak reference paths. Those paths are typically 'nice to have' extra information, but are
* not used as actual source of data by the current .blend file.
*
* NOTE: Currently this only concerns the weak reference to a library file stored in
* `ID::library_weak_reference`. */
* `ID::library_weak_reference`.
*/
BKE_BPATH_TRAVERSE_SKIP_WEAK_REFERENCES = (1 << 5),
/** Flags not affecting the generic BPath API. Those may be used by specific IDTypeInfo
* `foreach_path` implementations and/or callbacks to implement specific behaviors. */
/**
* Flags not affecting the generic BPath API. Those may be used by specific IDTypeInfo
* `foreach_path` implementations and/or callbacks to implement specific behaviors.
*/
/** Skip paths where a single dir is used with an array of files, eg. sequence strip images or
/**
* Skip paths where a single dir is used with an array of files, eg. sequence strip images or
* point-caches. In this case only use the first file path is processed.
*
* This is needed for directory manipulation callbacks which might otherwise modify the same
* directory multiple times. */
* directory multiple times.
*/
BKE_BPATH_FOREACH_PATH_SKIP_MULTIFILE = (1 << 8),
/**
* Reload data (when the path is edited).
@@ -91,8 +97,10 @@ struct BPathForeachPathData {
/* 'Private' data, caller don't need to set those. */
/** The root to use as base for relative paths. Only set if `BKE_BPATH_FOREACH_PATH_ABSOLUTE`
* flag is set, NULL otherwise. */
/**
* The root to use as base for relative paths.
* Only set if #BKE_BPATH_FOREACH_PATH_ABSOLUTE flag is set, NULL otherwise.
*/
const char *absolute_base_path;
/** ID owning the path being processed. */

View File

@@ -216,13 +216,15 @@ bool BKE_collection_object_cyclic_check(Main *bmain, Object *object, Collection
ListBase BKE_collection_object_cache_get(Collection *collection);
ListBase BKE_collection_object_cache_instanced_get(Collection *collection);
/** Free the object cache of given `collection` and all of its ancestors (recursively).
/**
* Free the object cache of given `collection` and all of its ancestors (recursively).
*
* \param bmain: The Main database owning the collection. May be `nullptr`, only used if doing
* depsgraph tagging.
* \param id_create_flag: Flags controlling ID creation, used here to enable or
* not depsgraph tagging of affected IDs (e.g. #LIB_ID_CREATE_NO_DEG_TAG would prevent depsgraph
* tagging). */
* not depsgraph tagging of affected IDs
* (e.g. #LIB_ID_CREATE_NO_DEG_TAG would prevent depsgraph tagging).
*/
void BKE_collection_object_cache_free(const Main *bmain,
Collection *collection,
const int id_create_flag);

View File

@@ -41,8 +41,10 @@ typedef struct bConstraintOb {
/** type of owner. */
short type;
/** rotation order for constraint owner (as defined in #eEulerRotationOrders in
* BLI_math_rotation.h) */
/**
* Rotation order for constraint owner
* (as defined in #eEulerRotationOrders in BLI_math_rotation.h).
*/
short rotOrder;
} bConstraintOb;

View File

@@ -504,7 +504,8 @@ BezTriple *BKE_bezier_array_merge(
*/
void BKE_fcurve_delete_key(FCurve *fcu, int index);
/** Delete an index range of keyframes from an F-curve. This is more performant than individually
/**
* Delete an index range of keyframes from an F-curve. This is more performant than individually
* removing keys.
* Has a complexity of O(N) with respect to number of keys in `fcu`.
*

View File

@@ -136,8 +136,10 @@ typedef enum eDriverVariablePropertyResult {
DRIVER_VAR_PROPERTY_FALLBACK,
/** The target property could not be resolved. */
DRIVER_VAR_PROPERTY_INVALID,
/** The property was resolved (output parameters are set),
* but the array index is out of bounds. */
/**
* The property was resolved (output parameters are set),
* but the array index is out of bounds.
*/
DRIVER_VAR_PROPERTY_INVALID_INDEX
} eDriverVariablePropertyResult;

View File

@@ -29,8 +29,10 @@ struct FileHandlerType {
char import_operator[OP_MAX_TYPENAME];
/** Export operator name. */
char export_operator[OP_MAX_TYPENAME];
/** Formatted string of file extensions supported by the file handler, each extension should
* start with a `.` and be separated by `;`. For Example: `".blend;.ble"`. */
/**
* Formatted string of file extensions supported by the file handler, each extension should
* start with a `.` and be separated by `;`. For Example: `".blend;.ble"`.
*/
char file_extensions_str[FH_MAX_FILE_EXTENSIONS_STR];
/** Check if file handler can be used on file drop. */

View File

@@ -20,8 +20,10 @@ namespace blender::bke {
* gizmo node).
*/
struct NodeGizmoID {
/** Storing only the hash of the compute context is enough here and is cheaper than making a deep
* copy of the actual compute context. */
/**
* Storing only the hash of the compute context is enough here and is cheaper than making a deep
* copy of the actual compute context.
*/
ComputeContextHash compute_context_hash;
int node_id;

View File

@@ -30,12 +30,17 @@ enum {
IDTYPE_FLAGS_NO_COPY = 1 << 0,
/** Indicates that the given IDType does not support linking/appending from a library file. */
IDTYPE_FLAGS_NO_LIBLINKING = 1 << 1,
/** Indicates that the given IDType should not be directly linked from a library file, but may be
* appended.
* NOTE: Mutually exclusive with `IDTYPE_FLAGS_NO_LIBLINKING`. */
/**
* Indicates that the given IDType should not be directly linked from a library file,
* but may be appended.
* NOTE: Mutually exclusive with `IDTYPE_FLAGS_NO_LIBLINKING`.
*/
IDTYPE_FLAGS_ONLY_APPEND = 1 << 2,
/** Allow to re-use an existing local ID with matching weak library reference instead of creating
* a new copy of it, when appending. See also #LibraryWeakReference in `DNA_ID.h`. */
/**
* Allow to re-use an existing local ID with matching weak library reference
* instead of creating a new copy of it, when appending.
* See also #LibraryWeakReference in `DNA_ID.h`.
*/
IDTYPE_FLAGS_APPEND_IS_REUSABLE = 1 << 3,
/** Indicates that the given IDType does not have animation data. */
IDTYPE_FLAGS_NO_ANIMDATA = 1 << 4,
@@ -65,10 +70,12 @@ enum {
};
struct IDCacheKey {
/* The session UID of the ID owning the cached data. */
/** The session UID of the ID owning the cached data. */
unsigned int id_session_uid;
/* Value uniquely identifying the cache within its ID.
* Typically the offset of its member in the data-block struct, but can be anything. */
/**
* Value uniquely identifying the cache within its ID.
* Typically the offset of its member in the data-block struct, but can be anything.
*/
size_t identifier;
};
@@ -91,8 +98,10 @@ using IDTypeMakeLocalFunction = void (*)(Main *bmain, ID *id, int flags);
using IDTypeForeachIDFunction = void (*)(ID *id, LibraryForeachIDData *data);
enum eIDTypeInfoCacheCallbackFlags {
/** Indicates to the callback that cache may be stored in the .blend file,
* so its pointer should not be cleared at read-time. */
/**
* Indicates to the callback that cache may be stored in the .blend file,
* so its pointer should not be cleared at read-time.
*/
IDTYPE_CACHE_CB_FLAGS_PERSISTENT = 1 << 0,
};
using IDTypeForeachCacheFunctionCallback =

View File

@@ -153,29 +153,39 @@ void *BKE_id_new_nomain(short type, const char *name);
*/
enum {
/* *** Generic options (should be handled by all ID types copying, ID creation, etc.). *** */
/** Create data-block outside of any main database -
* similar to 'localize' functions of materials etc. */
/**
* Create data-block outside of any main database -
* similar to 'localize' functions of materials etc.
*/
LIB_ID_CREATE_NO_MAIN = 1 << 0,
/** Do not affect user reference-count of data-blocks used by new one
/**
* Do not affect user reference-count of data-blocks used by new one
* (which also gets zero user-count then).
* Implies LIB_ID_CREATE_NO_MAIN. */
* Implies LIB_ID_CREATE_NO_MAIN.
*/
LIB_ID_CREATE_NO_USER_REFCOUNT = 1 << 1,
/** Assume given 'newid' already points to allocated memory for whole data-block
/**
* Assume given 'newid' already points to allocated memory for whole data-block
* (ID + data) - USE WITH CAUTION!
* Implies LIB_ID_CREATE_NO_MAIN. */
* Implies LIB_ID_CREATE_NO_MAIN.
*/
LIB_ID_CREATE_NO_ALLOCATE = 1 << 2,
/** Do not tag new ID for update in depsgraph. */
LIB_ID_CREATE_NO_DEG_TAG = 1 << 8,
/** Very similar to #LIB_ID_CREATE_NO_MAIN, and should never be used with it (typically combined
/**
* Very similar to #LIB_ID_CREATE_NO_MAIN, and should never be used with it (typically combined
* with #LIB_ID_CREATE_LOCALIZE or #LIB_ID_COPY_LOCALIZE in fact).
* It ensures that IDs created with it will get the #ID_TAG_LOCALIZED tag, and uses some
* specific code in some copy cases (mostly for node trees). */
* specific code in some copy cases (mostly for node trees).
*/
LIB_ID_CREATE_LOCAL = 1 << 9,
/** Create for the depsgraph, when set #ID_TAG_COPIED_ON_EVAL must be set.
* Internally this is used to share some pointers instead of duplicating them. */
/**
* Create for the depsgraph, when set #ID_TAG_COPIED_ON_EVAL must be set.
* Internally this is used to share some pointers instead of duplicating them.
*/
LIB_ID_COPY_SET_COPIED_ON_WRITE = 1 << 10,
/* *** Specific options to some ID types or usages. *** */
@@ -190,8 +200,10 @@ enum {
LIB_ID_COPY_NO_ANIMDATA = 1 << 19,
/** Do not copy id->override_library, used by ID data-block override routines. */
LIB_ID_COPY_NO_LIB_OVERRIDE = 1 << 21,
/** When copying local sub-data (like constraints or modifiers), do not set their "library
* override local data" flag. */
/**
* When copying local sub-data (like constraints or modifiers), do not set their "library
* override local data" flag.
*/
LIB_ID_COPY_NO_LIB_OVERRIDE_LOCAL_DATA_FLAG = 1 << 22,
/* *** XXX Hackish/not-so-nice specific behaviors needed for some corner cases. *** */
@@ -295,7 +307,8 @@ struct IDNewNameResult {
UNCHANGED_COLLISION = 1,
/** Successfully renamed, without any collision with another ID's name. */
RENAMED_NO_COLLISION = 2,
/** Successfully renamed, requested new name was adjusted to avoid collision with another ID.
/**
* Successfully renamed, requested new name was adjusted to avoid collision with another ID.
*/
RENAMED_COLLISION_ADJUSTED = 3,
/**
@@ -305,7 +318,8 @@ struct IDNewNameResult {
RENAMED_COLLISION_FORCED = 4,
} action = Action::UNCHANGED;
/** The colliding ID, if any.
/**
* The colliding ID, if any.
*
* \warning Currently will be `nullptr` in #RENAMED_COLLISION_ADJUSTED case, for performance
* reasons (avoid an ID lookup by name) when doing 'standard' #RenameExistingNever renames.
@@ -355,14 +369,17 @@ ID *BKE_libblock_find_name_and_library_filepath(Main *bmain,
* See also eDupli_ID_Flags for options controlling what kind of IDs to duplicate.
*/
enum eLibIDDuplicateFlags {
/** This call to a duplicate function is part of another call for some parent ID.
/**
* This call to a duplicate function is part of another call for some parent ID.
* Therefore, this sub-process should not clear `newid` pointers, nor handle remapping itself.
* NOTE: In some cases (like Object one), the duplicate function may be called on the root ID
* with this flag set, as remapping and/or other similar tasks need to be handled by the caller.
*/
LIB_ID_DUPLICATE_IS_SUBPROCESS = 1 << 0,
/** This call is performed on a 'root' ID, and should therefore perform some decisions regarding
* sub-IDs (dependencies), check for linked vs. locale data, etc. */
/**
* This call is performed on a 'root' ID, and should therefore perform some decisions regarding
* sub-IDs (dependencies), check for linked vs. locale data, etc.
*/
LIB_ID_DUPLICATE_IS_ROOT_ID = 1 << 1,
};

View File

@@ -225,8 +225,10 @@ enum LibraryForeachIDFlag {
* ignored.
*/
IDWALK_DO_LIBRARY_POINTER = (1 << 10),
/** Also process the DNA-deprecated pointers. Should only be used in readfile related code (for
* proper lib_linking and expanding of older files). */
/**
* Also process the DNA-deprecated pointers. Should only be used in readfile related code
* (for proper lib_linking and expanding of older files).
*/
IDWALK_DO_DEPRECATED_POINTERS = (1 << 11),
};
ENUM_OPERATORS(LibraryForeachIDFlag, IDWALK_DO_DEPRECATED_POINTERS);

View File

@@ -79,12 +79,14 @@ enum {
* the 'separate' mesh operator.
*/
ID_REMAP_FORCE_OBDATA_IN_EDITMODE = 1 << 7,
/** Do remapping of `lib` Library pointers of IDs (by default these are completely ignored).
/**
* Do remapping of `lib` Library pointers of IDs (by default these are completely ignored).
*
* WARNING: Use with caution. This is currently a 'raw' remapping, with no further processing. In
* particular, DO NOT use this to make IDs local (i.e. remap a library pointer to NULL), unless
* the calling code takes care of the rest of the required changes (ID tags & flags updates,
* etc.). */
* the calling code takes care of the rest of the required changes
* (ID tags & flags updates, etc.).
*/
ID_REMAP_DO_LIBRARY_POINTERS = 1 << 8,
/**

View File

@@ -55,60 +55,75 @@ struct MainIDRelationsEntryItem {
MainIDRelationsEntryItem *next;
union {
/* For `from_ids` list, a user of the hashed ID. */
/** For `from_ids` list, a user of the hashed ID. */
ID *from;
/* For `to_ids` list, an ID used by the hashed ID. */
/** For `to_ids` list, an ID used by the hashed ID. */
ID **to;
} id_pointer;
/* Session uid of the `id_pointer`. */
/** Session uid of the `id_pointer`. */
uint session_uid;
LibraryForeachIDCallbackFlag usage_flag; /* Using IDWALK_ enums, defined in BKE_lib_query.hh */
/** Using IDWALK_ enums, defined in BKE_lib_query.hh */
LibraryForeachIDCallbackFlag usage_flag;
};
struct MainIDRelationsEntry {
/* Linked list of IDs using that ID. */
/** Linked list of IDs using that ID. */
MainIDRelationsEntryItem *from_ids;
/* Linked list of IDs used by that ID. */
/** Linked list of IDs used by that ID. */
MainIDRelationsEntryItem *to_ids;
/* Session uid of the ID matching that entry. */
/** Session UID of the ID matching that entry. */
uint session_uid;
/* Runtime tags, users should ensure those are reset after usage. */
/** Runtime tags, users should ensure those are reset after usage. */
uint tags;
};
/** #MainIDRelationsEntry.tags */
enum eMainIDRelationsEntryTags {
/* Generic tag marking the entry as to be processed. */
/** Generic tag marking the entry as to be processed. */
MAINIDRELATIONS_ENTRY_TAGS_DOIT = 1 << 0,
/* Generic tag marking the entry as processed in the `to` direction (i.e. the IDs used by this
* item have been processed). */
/**
* Generic tag marking the entry as processed in the `to` direction
* (i.e. the IDs used by this item have been processed).
*/
MAINIDRELATIONS_ENTRY_TAGS_PROCESSED_TO = 1 << 4,
/* Generic tag marking the entry as processed in the `from` direction (i.e. the IDs using this
* item have been processed). */
/**
* Generic tag marking the entry as processed in the `from` direction
* (i.e. the IDs using this item have been processed).
*/
MAINIDRELATIONS_ENTRY_TAGS_PROCESSED_FROM = 1 << 5,
/* Generic tag marking the entry as processed. */
/** Generic tag marking the entry as processed. */
MAINIDRELATIONS_ENTRY_TAGS_PROCESSED = MAINIDRELATIONS_ENTRY_TAGS_PROCESSED_TO |
MAINIDRELATIONS_ENTRY_TAGS_PROCESSED_FROM,
/* Generic tag marking the entry as being processed in the `to` direction (i.e. the IDs used by
* this item are being processed). Useful for dependency loops detection and handling. */
/**
* Generic tag marking the entry as being processed in the `to` direction
* (i.e. the IDs used by this item are being processed).
* Useful for dependency loops detection and handling.
*/
MAINIDRELATIONS_ENTRY_TAGS_INPROGRESS_TO = 1 << 8,
/* Generic tag marking the entry as being processed in the `from` direction (i.e. the IDs using
* this item are being processed). Useful for dependency loops detection and handling. */
/**
* Generic tag marking the entry as being processed in the `from` direction
* (i.e. the IDs using this item are being processed).
* Useful for dependency loops detection and handling.
*/
MAINIDRELATIONS_ENTRY_TAGS_INPROGRESS_FROM = 1 << 9,
/* Generic tag marking the entry as being processed. Useful for dependency loops detection and
* handling. */
/**
* Generic tag marking the entry as being processed.
* Useful for dependency loops detection and handling.
*/
MAINIDRELATIONS_ENTRY_TAGS_INPROGRESS = MAINIDRELATIONS_ENTRY_TAGS_INPROGRESS_TO |
MAINIDRELATIONS_ENTRY_TAGS_INPROGRESS_FROM,
};
struct MainIDRelations {
/* Mapping from an ID pointer to all of its parents (IDs using it) and children (IDs it uses).
* Values are `MainIDRelationsEntry` pointers. */
/**
* Mapping from an ID pointer to all of its parents (IDs using it) and children (IDs it uses).
* Values are `MainIDRelationsEntry` pointers.
*/
GHash *relations_from_pointers;
/* NOTE: we could add more mappings when needed (e.g. from session uid?). */
@@ -119,7 +134,7 @@ struct MainIDRelations {
};
enum {
/* Those bmain relations include pointers/usages from editors. */
/** Those bmain relations include pointers/usages from editors. */
MAINIDRELATIONS_INCLUDE_UI = 1 << 0,
};
@@ -140,7 +155,8 @@ struct Main {
char filepath[1024]; /* 1024 = FILE_MAX */
short versionfile, subversionfile; /* see BLENDER_FILE_VERSION, BLENDER_FILE_SUBVERSION */
short minversionfile, minsubversionfile;
/** The currently opened .blend file was written from a newer version of Blender, and has forward
/**
* The currently opened .blend file was written from a newer version of Blender, and has forward
* compatibility issues (data loss).
*
* \note In practice currently this is only based on the version numbers, in the future it
@@ -224,7 +240,8 @@ struct Main {
*/
Library *curlib;
/** Listbase for all ID types, containing all IDs for the current Main. */
/* List bases for all ID types, containing all IDs for the current #Main. */
ListBase scenes;
ListBase libraries;
ListBase objects;
@@ -237,7 +254,8 @@ struct Main {
ListBase lattices;
ListBase lights;
ListBase cameras;
ListBase ipo; /* Deprecated (only for versioning). */
/** Deprecated (only for versioning). */
ListBase ipo;
ListBase shapekeys;
ListBase worlds;
ListBase screens;
@@ -254,8 +272,10 @@ struct Main {
ListBase particles;
ListBase palettes;
ListBase paintcurves;
ListBase wm; /* Singleton (exception). */
ListBase gpencils; /* Legacy Grease Pencil. */
/** Singleton (exception). */
ListBase wm;
/** Legacy Grease Pencil. */
ListBase gpencils;
ListBase grease_pencils;
ListBase movieclips;
ListBase masks;
@@ -337,19 +357,26 @@ struct MainMergeReport {
/** Number of IDs from source Main that have been moved into destination Main. */
int num_merged_ids = 0;
/** Number of (non-library) IDs from source Main that were expected to have a matching ID in
* destination Main, but did not. These have not been moved, and their usages have been remapped
* to null. */
/**
* Number of (non-library) IDs from source Main that were expected
* to have a matching ID in destination Main, but did not.
* These have not been moved, and their usages have been remapped to null.
*/
int num_unknown_ids = 0;
/** Number of (non-library) IDs from source Main that already had a matching ID in destination
* Main. */
/**
* Number of (non-library) IDs from source Main that already had a matching ID
* in destination Main.
*/
int num_remapped_ids = 0;
/** Number of Library IDs from source Main that already had a matching Library ID in destination
* Main. */
/**
* Number of Library IDs from source Main that already had a matching Library ID
* in destination Main.
*/
int num_remapped_libraries = 0;
};
/** Merge the content of `bmain_src` into `bmain_dst`.
/**
* Merge the content of `bmain_src` into `bmain_dst`.
*
* In case of collision (ID from same library with same name), the existing ID in `bmain_dst` is
* kept, the one from `bmain_src` is left in its original Main, and its usages in `bmain_dst` (from
@@ -363,7 +390,8 @@ struct MainMergeReport {
* they are dropped, their usages are remapped to null, and a warning is printed.
*
* Since `bmain_src` is either empty or contains left-over IDs with (likely) invalid ID
* relationships and other potential issues after the merge, it is always freed. */
* relationships and other potential issues after the merge, it is always freed.
*/
void BKE_main_merge(Main *bmain_dst, Main **r_bmain_src, MainMergeReport &reports);
/**

View File

@@ -50,8 +50,7 @@ struct MaskLayer *BKE_mask_layer_active(struct Mask *mask);
void BKE_mask_layer_active_set(struct Mask *mask, struct MaskLayer *masklay);
void BKE_mask_layer_remove(struct Mask *mask, struct MaskLayer *masklay);
/** \brief Free all animation keys for a mask layer.
*/
/** \brief Free all animation keys for a mask layer. */
void BKE_mask_layer_free_shapes(struct MaskLayer *masklay);
void BKE_mask_layer_free(struct MaskLayer *masklay);
void BKE_mask_layer_free_list(struct ListBase *masklayers);

View File

@@ -256,10 +256,11 @@ struct MLoopNorSpace {
* aligned).
*/
float ref_beta;
/** All loops using this lnor space (i.e. smooth fan of loops),
/**
* All loops using this lnor space (i.e. smooth fan of loops),
* as (depending on owning MLoopNorSpaceArrary.data_type):
* - Indices (uint_in_ptr), or
* - BMLoop pointers. */
* - Indices (uint_in_ptr), or
* - BMLoop pointers. */
struct LinkNode *loops;
char flags;
};

View File

@@ -79,7 +79,8 @@ struct DerivedMesh {
int (*getNumLoops)(DerivedMesh *dm);
int (*getNumPolys)(DerivedMesh *dm);
/** Return a pointer to the entire array of verts/edges/face from the
/**
* Return a pointer to the entire array of verts/edges/face from the
* derived mesh. if such an array does not exist yet, it will be created,
* and freed on the next ->release(). consider using getVert/Edge/Face if
* you are only interested in a few verts/edges/faces.
@@ -93,8 +94,9 @@ struct DerivedMesh {
int *(*getCornerEdgeArray)(DerivedMesh *dm);
int *(*getPolyArray)(DerivedMesh *dm);
/** Copy all verts/edges/faces from the derived mesh into
* *{vert/edge/face}_r (must point to a buffer large enough)
/**
* Copy all verts/edges/faces from the derived mesh into
* `*{vert/edge/face}_r` (must point to a buffer large enough).
*/
void (*copyVertArray)(DerivedMesh *dm, float (*r_positions)[3]);
void (*copyEdgeArray)(DerivedMesh *dm, blender::int2 *r_edge);
@@ -102,9 +104,9 @@ struct DerivedMesh {
void (*copyCornerEdgeArray)(DerivedMesh *dm, int *r_corner_edges);
void (*copyPolyArray)(DerivedMesh *dm, int *r_face_offsets);
/** Return a pointer to the entire array of vert/edge/face custom data
* from the derived mesh (this gives a pointer to the actual data, not
* a copy)
/**
* Return a pointer to the entire array of vert/edge/face custom data
* from the derived mesh (this gives a pointer to the actual data, not a copy).
*/
void *(*getVertDataArray)(DerivedMesh *dm, eCustomDataType type);
void *(*getEdgeDataArray)(DerivedMesh *dm, eCustomDataType type);
@@ -122,8 +124,10 @@ struct DerivedMesh {
* - Can be undefined
* - Must be defined for modifiers that only deform however. */
/** Release reference to the DerivedMesh. This function decides internally
* if the DerivedMesh will be freed, or cached for later use. */
/**
* Release reference to the DerivedMesh. This function decides internally
* if the DerivedMesh will be freed, or cached for later use.
*/
void (*release)(DerivedMesh *dm);
};
@@ -168,10 +172,12 @@ void DM_release(DerivedMesh *dm);
*/
void DM_set_only_copy(DerivedMesh *dm, const CustomData_MeshMasks *mask);
/* creates a CDDerivedMesh from the given Mesh, this will reference the
/**
* Creates a CDDerivedMesh from the given Mesh, this will reference the
* original data in Mesh, but it is safe to apply vertex coordinates or
* calculate normals as those functions will automatically create new
* data to not overwrite the original. */
* data to not overwrite the original.
*/
DerivedMesh *CDDM_from_mesh(Mesh *mesh);
/* -------------------------------------------------------------------- */

View File

@@ -143,18 +143,24 @@ using TexWalkFunc = void (*)(void *user_data,
enum ModifierApplyFlag {
/** Render time. */
MOD_APPLY_RENDER = 1 << 0,
/** Result of evaluation will be cached, so modifier might
* want to cache data for quick updates (used by subdivision-surface) */
/**
* Result of evaluation will be cached, so modifier might
* want to cache data for quick updates (used by subdivision-surface).
*/
MOD_APPLY_USECACHE = 1 << 1,
/** Modifier evaluated for undeformed texture coordinates */
MOD_APPLY_ORCO = 1 << 2,
/** Ignore scene simplification flag and use subdivisions
* level set in multires modifier. */
/**
* Ignore scene simplification flag and use subdivisions
* level set in multires modifier.
*/
MOD_APPLY_IGNORE_SIMPLIFY = 1 << 3,
/** The effect of this modifier will be applied to the original geometry
/**
* The effect of this modifier will be applied to the original geometry
* The modifier itself will be removed from the modifier stack.
* This flag can be checked to ignore rendering display data to the mesh.
* See `OBJECT_OT_modifier_apply` operator. */
* See `OBJECT_OT_modifier_apply` operator.
*/
MOD_APPLY_TO_ORIGINAL = 1 << 4,
};
ENUM_OPERATORS(ModifierApplyFlag, MOD_APPLY_TO_ORIGINAL);
@@ -165,8 +171,10 @@ struct ModifierUpdateDepsgraphContext {
DepsNodeHandle *node;
};
/* Contains the information for deformXXX and applyXXX functions below that
* doesn't change between consecutive modifiers. */
/**
* Contains the information for deformXXX and applyXXX functions below that
* doesn't change between consecutive modifiers.
*/
struct ModifierEvalContext {
Depsgraph *depsgraph;
Object *object;
@@ -174,28 +182,31 @@ struct ModifierEvalContext {
};
struct ModifierTypeInfo {
/* A unique identifier for this modifier. Used to generate the panel id type name.
* See #BKE_modifier_type_panel_id. */
/**
* A unique identifier for this modifier. Used to generate the panel id type name.
* See #BKE_modifier_type_panel_id.
*/
char idname[64];
/* The user visible name for this modifier */
/** The user visible name for this modifier. */
char name[64];
/* The DNA struct name for the modifier data type, used to
* write the DNA data out.
/**
* The DNA struct name for the modifier data type,
* used to write the DNA data out.
*/
char struct_name[64];
/* The size of the modifier data type, used by allocation. */
/** The size of the modifier data type, used by allocation. */
int struct_size;
/* StructRNA of this modifier. This is typically something like RNA_*Modifier. */
/** StructRNA of this modifier. This is typically something like `RNA_*Modifier`. */
StructRNA *srna;
ModifierTypeType type;
ModifierTypeFlag flags;
/* Icon of the modifier. Usually something like ICON_MOD_*. */
/** Icon of the modifier. Usually something like ICON_MOD_*. */
int icon;
/********************* Non-optional functions *********************/
@@ -401,10 +412,10 @@ struct ModifierTypeInfo {
blender::FunctionRef<void(const IDCacheKey &cache_key, void **cache_p, uint flags)> fn);
};
/* Used to set a modifier's panel type. */
/** Used to set a modifier's panel type. */
#define MODIFIER_TYPE_PANEL_PREFIX "MOD_PT_"
/* Initialize modifier's global data (type info and some common global storage). */
/** Initialize modifier's global data (type info and some common global storage). */
void BKE_modifier_init();
const ModifierTypeInfo *BKE_modifier_get_info(ModifierType type);
@@ -417,7 +428,8 @@ const ModifierTypeInfo *BKE_modifier_get_info(ModifierType type);
void BKE_modifier_type_panel_id(ModifierType type, char *r_idname);
void BKE_modifier_panel_expand(ModifierData *md);
/* Modifier utility calls, do call through type pointer and return
/**
* Modifier utility calls, do call through type pointer and return
* default values if pointer is optional.
*/
ModifierData *BKE_modifier_new(int type);
@@ -461,14 +473,18 @@ bool BKE_modifier_is_enabled(const Scene *scene, ModifierData *md, int required_
*/
bool BKE_modifier_is_nonlocal_in_liboverride(const Object *ob, const ModifierData *md);
/* Set modifier execution error.
* The message will be shown in the interface and will be logged as an error to the console. */
/**
* Set modifier execution error.
* The message will be shown in the interface and will be logged as an error to the console.
*/
void BKE_modifier_set_error(const Object *ob, ModifierData *md, const char *format, ...)
ATTR_PRINTF_FORMAT(3, 4);
/* Set modifier execution warning, which does not prevent the modifier from being applied but which
* might need an attention. The message will only be shown in the interface, but will not appear in
* the logs. */
/**
* Set modifier execution warning, which does not prevent the modifier from being applied but which
* might need an attention. The message will only be shown in the interface,
* but will not appear in the logs.
*/
void BKE_modifier_set_warning(const Object *ob, ModifierData *md, const char *format, ...)
ATTR_PRINTF_FORMAT(3, 4);

View File

@@ -338,8 +338,10 @@ class bNodeRuntime : NonCopyable, NonMovable {
/** Used to avoid running forward compatibility code more often than necessary. */
bool forward_compatible_versioning_done = false;
/** If this node is reroute and this reroute is not logically linked with any source except other
* reroute, this will be true. */
/**
* If this node is reroute and this reroute is not logically linked with any source except other
* reroute, this will be true.
*/
bool is_dangling_reroute = false;
/** Only valid if #topology_cache_is_dirty is false. */

View File

@@ -67,7 +67,7 @@ struct wmWindowManager;
/* spacetype has everything stored to get an editor working, it gets initialized via
* #ED_spacetypes_init() in `editors/space_api/spacetypes.cc` */
/* an editor in Blender is a combined ScrArea + SpaceType + SpaceData */
/* an editor in Blender is a combined ScrArea + SpaceType + SpaceData. */
#define BKE_ST_MAXNAME 64
@@ -79,46 +79,51 @@ struct wmSpaceTypeListenerParams {
};
struct SpaceType {
char name[BKE_ST_MAXNAME]; /* for menus */
int spaceid; /* unique space identifier */
int iconid; /* icon lookup for menus */
/** For menus. */
char name[BKE_ST_MAXNAME];
/** Unique space identifier. */
int spaceid;
/** Icon lookup for menus. */
int iconid;
/* Initial allocation, after this WM will call init() too. Some editors need
* area and scene data (e.g. frame range) to set their initial scrolling. */
/**
* Initial allocation, after this WM will call init() too.
* Some editors need area and scene data (e.g. frame range) to set their initial scrolling.
*/
SpaceLink *(*create)(const ScrArea *area, const Scene *scene);
/* not free spacelink itself */
/** Not free spacelink itself. */
void (*free)(SpaceLink *sl);
/* init is to cope with file load, screen (size) changes, check handlers */
/** Init is to cope with file load, screen (size) changes, check handlers. */
void (*init)(wmWindowManager *wm, ScrArea *area);
/* exit is called when the area is hidden or removed */
/** Exit is called when the area is hidden or removed. */
void (*exit)(wmWindowManager *wm, ScrArea *area);
/* Listeners can react to bContext changes */
/** Listeners can react to bContext changes. */
void (*listener)(const wmSpaceTypeListenerParams *params);
/* called when the mouse moves out of the area */
/** Called when the mouse moves out of the area. */
void (*deactivate)(ScrArea *area);
/** Refresh context, called after file-reads, #ED_area_tag_refresh(). */
void (*refresh)(const bContext *C, ScrArea *area);
/* after a spacedata copy, an init should result in exact same situation */
/** After a spacedata copy, an init should result in exact same situation. */
SpaceLink *(*duplicate)(SpaceLink *sl);
/* register operator types on startup */
/** Register operator types on startup. */
void (*operatortypes)();
/* add default items to WM keymap */
/** Add default items to WM keymap. */
void (*keymap)(wmKeyConfig *keyconf);
/* on startup, define dropboxes for spacetype+regions */
/** On startup, define dropboxes for spacetype+regions. */
void (*dropboxes)();
/* initialize gizmo-map-types and gizmo-group-types with the region */
/** Initialize gizmo-map-types and gizmo-group-types with the region. */
void (*gizmos)();
/* return context data */
/** Return context data. */
bContextDataCallback context;
/* Used when we want to replace an ID by another (or NULL). */
/** Used when we want to replace an ID by another (or NULL). */
void (*id_remap)(ScrArea *area, SpaceLink *sl, const blender::bke::id::IDRemapper &mappings);
/**
@@ -132,9 +137,9 @@ struct SpaceType {
void (*space_subtype_set)(ScrArea *area, int value);
void (*space_subtype_item_extend)(bContext *C, EnumPropertyItem **item, int *totitem);
/* Return a custom name, based on subtype or other reason. */
/** Return a custom name, based on subtype or other reason. */
blender::StringRefNull (*space_name_get)(const ScrArea *area);
/* Return a custom icon, based on subtype or other reason. */
/** Return a custom icon, based on subtype or other reason. */
int (*space_icon_get)(const ScrArea *area);
/**
@@ -152,7 +157,7 @@ struct SpaceType {
*/
void (*blend_write)(BlendWriter *writer, SpaceLink *space_link);
/* region type definitions */
/** Region type definitions. */
ListBase regiontypes;
/* read and write... */
@@ -163,11 +168,12 @@ struct SpaceType {
~SpaceType();
};
/* region types are also defined using spacetypes_init, via a callback */
/* Region types are also defined using spacetypes_init, via a callback. */
struct wmRegionListenerParams {
wmWindow *window;
ScrArea *area; /* Can be NULL when the region is not part of an area. */
/** Can be NULL when the region is not part of an area. */
ScrArea *area;
ARegion *region;
const wmNotifier *notifier;
const Scene *scene;
@@ -194,12 +200,12 @@ struct RegionPollParams {
struct ARegionType {
ARegionType *next, *prev;
/** Unique identifier within this space, defines `RGN_TYPE_xxxx`. */
int regionid;
int regionid; /* unique identifier within this space, defines RGN_TYPE_xxxx */
/* add handlers, stuff you only do once or on area/region type/size changes */
/** Add handlers, stuff you only do once or on area/region type/size changes. */
void (*init)(wmWindowManager *wm, ARegion *region);
/* exit is called when the region is hidden or removed */
/** Exit is called when the region is hidden or removed. */
void (*exit)(wmWindowManager *wm, ARegion *region);
/**
* Optional callback to decide whether the region should be treated as existing given the
@@ -208,7 +214,7 @@ struct ARegionType {
* space-data set.
*/
bool (*poll)(const RegionPollParams *params);
/* draw entirely, view changes should be handled here */
/** Draw entirely, view changes should be handled here. */
void (*draw)(const bContext *C, ARegion *region);
/**
* Handler to draw overlays. This handler is called every draw loop.
@@ -218,28 +224,28 @@ struct ARegionType {
* that another thread may be modifying
*/
void (*draw_overlay)(const bContext *C, ARegion *region);
/* optional, compute button layout before drawing for dynamic size */
/** Optional, compute button layout before drawing for dynamic size. */
void (*layout)(const bContext *C, ARegion *region);
/* snap the size of the region (can be NULL for no snapping). */
/** Snap the size of the region (can be NULL for no snapping). */
int (*snap_size)(const ARegion *region, int size, int axis);
/* contextual changes should be handled here */
/** Contextual changes should be handled here. */
void (*listener)(const wmRegionListenerParams *params);
/* Optional callback to generate subscriptions. */
/** Optional callback to generate subscriptions. */
void (*message_subscribe)(const wmRegionMessageSubscribeParams *params);
void (*free)(ARegion *);
/* split region, copy data optionally */
/** Split region, copy data optionally. */
void *(*duplicate)(void *poin);
/* register operator types on startup */
/** Register operator types on startup. */
void (*operatortypes)();
/* add items to keymap */
/** Add items to keymap. */
void (*keymap)(wmKeyConfig *keyconf);
/* allows default cursor per region */
/** Allows default cursor per region. */
void (*cursor)(wmWindow *win, ScrArea *area, ARegion *region);
/* return context data */
/** Return context data. */
bContextDataCallback context;
/**
@@ -253,74 +259,87 @@ struct ARegionType {
* through other means, like to adjust for a scaled down window.
*/
void (*on_user_resize)(const ARegion *region);
/* Is called whenever the current visible View2D's region changes.
/**
* Is called whenever the current visible View2D's region changes.
*
* Used from user code such as view navigation/zoom operators to inform region about changes.
* The goal is to support zoom-to-fit features which gets disabled when manual navigation is
* performed.
*
* This callback is not called on indirect changes of the current viewport (which could happen
* when the `v2d->tot is changed and `cur` is adopted accordingly). */
* when the `v2d->tot is changed and `cur` is adopted accordingly).
*/
void (*on_view2d_changed)(const bContext *C, ARegion *region);
/* custom drawing callbacks */
/** Custom drawing callbacks. */
ListBase drawcalls;
/* panels type definitions */
/** Panels type definitions. */
ListBase paneltypes;
/* header type definitions */
/** Header type definitions. */
ListBase headertypes;
/* hardcoded constraints, smaller than these values region is not visible */
/** Hardcoded constraints, smaller than these values region is not visible. */
int minsizex, minsizey;
/* when new region opens (region prefsizex/y are zero then */
/** When new region opens (region prefsizex/y are zero then. */
int prefsizex, prefsizey;
/* default keymaps to add */
/** Default keymaps to add. */
int keymapflag;
/* return without drawing.
* lock is set by region definition, and copied to do_lock by render. can become flag. */
/**
* Return without drawing.
* lock is set by region definition, and copied to do_lock by render. can become flag.
*/
short do_lock, lock;
/** Don't handle gizmos events behind #uiBlock's with #UI_BLOCK_CLIP_EVENTS flag set. */
bool clip_gizmo_events_by_ui;
/* call cursor function on each move event */
/** Call cursor function on each move event. */
short event_cursor;
};
/* panel types */
/* Panel types. */
struct PanelType {
PanelType *next, *prev;
char idname[BKE_ST_MAXNAME]; /* unique name */
char label[BKE_ST_MAXNAME]; /* for panel header */
const char *description; /* for panel tooltip */
/** Unique name. */
char idname[BKE_ST_MAXNAME];
/** For panel header. */
char label[BKE_ST_MAXNAME];
/** For panel tooltip. */
const char *description;
char translation_context[BKE_ST_MAXNAME];
char context[BKE_ST_MAXNAME]; /* for buttons window */
char category[BKE_ST_MAXNAME]; /* for category tabs */
char owner_id[128]; /* for work-spaces to selectively show. */
char parent_id[BKE_ST_MAXNAME]; /* parent idname for sub-panels */
/** For buttons window. */
char context[BKE_ST_MAXNAME];
/** For category tabs. */
char category[BKE_ST_MAXNAME];
/** For work-spaces to selectively show. */
char owner_id[128];
/** Parent idname for sub-panels. */
char parent_id[BKE_ST_MAXNAME];
/** Boolean property identifier of the panel custom data. Used to draw a highlighted border. */
char active_property[BKE_ST_MAXNAME];
char pin_to_last_property[BKE_ST_MAXNAME];
short space_type;
short region_type;
/* For popovers, 0 for default. */
/** For popovers, 0 for default. */
int ui_units_x;
/** For popovers, position the popover at the given offset (multiplied by #UI_UNIT_X/#UI_UNIT_Y)
* relative to the top left corner, if it's not attached to a button. */
/**
* For popovers, position the popover at the given offset (multiplied by #UI_UNIT_X/#UI_UNIT_Y)
* relative to the top left corner, if it's not attached to a button.
*/
blender::float2 offset_units_xy;
int order;
int flag;
/* verify if the panel should draw or not */
/** Verify if the panel should draw or not. */
bool (*poll)(const bContext *C, PanelType *pt);
/* draw header (optional) */
/** Draw header (optional) */
void (*draw_header)(const bContext *C, Panel *panel);
/* draw header preset (optional) */
/** Draw header preset (optional) */
void (*draw_header_preset)(const bContext *C, Panel *panel);
/* draw entirely, view changes should be handled here */
/** Draw entirely, view changes should be handled here. */
void (*draw)(const bContext *C, Panel *panel);
/**
* Listener to redraw the region this is contained in on changes. Only used for panels displayed
@@ -347,15 +366,15 @@ struct PanelType {
*/
void (*set_list_data_expand_flag)(const bContext *C, Panel *pa, short expand_flag);
/* sub panels */
/** Sub panels. */
PanelType *parent;
ListBase children;
/* RNA integration */
/** RNA integration. */
ExtensionRNA rna_ext;
};
/* #PanelType.flag */
/** #PanelType.flag */
enum {
PANEL_TYPE_DEFAULT_CLOSED = (1 << 0),
PANEL_TYPE_NO_HEADER = (1 << 1),
@@ -400,7 +419,7 @@ struct LayoutPanels {
};
struct Panel_Runtime {
/* Applied to Panel.ofsx, but saved separately so we can track changes between redraws. */
/** Applied to Panel.ofsx, but saved separately so we can track changes between redraws. */
int region_ofsx = 0;
/**
@@ -412,11 +431,13 @@ struct Panel_Runtime {
*/
PointerRNA *custom_data_ptr = nullptr;
/* Pointer to the panel's block. Useful when changes to panel #uiBlocks
* need some context from traversal of the panel "tree". */
/**
* Pointer to the panel's block. Useful when changes to panel #uiBlocks
* need some context from traversal of the panel "tree".
*/
uiBlock *block = nullptr;
/* Non-owning pointer. The context is stored in the block. */
/** Non-owning pointer. The context is stored in the block. */
bContextStore *context = nullptr;
/** Information about nested layout panels generated in layout code. */
@@ -440,7 +461,10 @@ struct ARegionRuntime {
*/
rcti visible_rect = {};
/* The offset needed to not overlap with window scroll-bars. Only used by HUD regions for now. */
/**
* The offset needed to not overlap with window scroll-bars.
* Only used by HUD regions for now.
*/
int offset_x = 0;
int offset_y = 0;
@@ -478,7 +502,7 @@ struct ARegionRuntime {
/** Private, cached notifier events. */
short do_draw_paintcursor;
/* Dummy panel used in popups so they can support layout panels. */
/** Dummy panel used in popups so they can support layout panels. */
Panel *popup_block_panel = nullptr;
};
@@ -498,57 +522,60 @@ using uiListDrawItemFunc = void (*)(uiList *ui_list,
int index,
int flt_flag);
/* Draw the filtering part of an uiList */
/** Draw the filtering part of an uiList. */
using uiListDrawFilterFunc = void (*)(uiList *ui_list, const bContext *C, uiLayout *layout);
/* Filter items of an uiList */
/** Filter items of an uiList. */
using uiListFilterItemsFunc = void (*)(uiList *ui_list,
const bContext *C,
PointerRNA *,
const char *propname);
/* Listen to notifiers. Only for lists defined in C. */
/** Listen to notifiers. Only for lists defined in C. */
using uiListListener = void (*)(uiList *ui_list, wmRegionListenerParams *params);
struct uiListType {
uiListType *next, *prev;
char idname[BKE_ST_MAXNAME]; /* unique name */
/** Unique name. */
char idname[BKE_ST_MAXNAME];
uiListDrawItemFunc draw_item;
uiListDrawFilterFunc draw_filter;
uiListFilterItemsFunc filter_items;
/* For lists defined in C only. */
/** For lists defined in C only. */
uiListListener listener;
/* RNA integration */
/** RNA integration. */
ExtensionRNA rna_ext;
};
/* header types */
/* Header types. */
struct HeaderType {
HeaderType *next, *prev;
char idname[BKE_ST_MAXNAME]; /* unique name */
/** Unique name. */
char idname[BKE_ST_MAXNAME];
int space_type;
int region_type;
bool (*poll)(const bContext *C, HeaderType *ht);
/* draw entirely, view changes should be handled here */
/** Draw entirely, view changes should be handled here. */
void (*draw)(const bContext *C, Header *header);
/* RNA integration */
/** RNA integration. */
ExtensionRNA rna_ext;
};
struct Header {
HeaderType *type; /* runtime */
uiLayout *layout; /* runtime for drawing */
/** Runtime. */
HeaderType *type;
/** Runtime for drawing. */
uiLayout *layout;
};
/* menu types */
/* Menu types. */
enum class MenuTypeFlag {
/**
@@ -566,35 +593,42 @@ ENUM_OPERATORS(MenuTypeFlag, MenuTypeFlag::ContextDependent)
struct MenuType {
MenuType *next, *prev;
char idname[BKE_ST_MAXNAME]; /* unique name */
char label[BKE_ST_MAXNAME]; /* for button text */
/** Unique name. */
char idname[BKE_ST_MAXNAME];
/** For button text. */
char label[BKE_ST_MAXNAME];
char translation_context[BKE_ST_MAXNAME];
char owner_id[128]; /* optional, see: #wmOwnerID */
/** Optional, see: #wmOwnerID. */
char owner_id[128];
const char *description;
/* verify if the menu should draw or not */
/** Verify if the menu should draw or not. */
bool (*poll)(const bContext *C, MenuType *mt);
/* draw entirely, view changes should be handled here */
/** Draw entirely, view changes should be handled here. */
void (*draw)(const bContext *C, Menu *menu);
void (*listener)(const wmRegionListenerParams *params);
MenuTypeFlag flag;
/* RNA integration */
/** RNA integration. */
ExtensionRNA rna_ext;
};
struct Menu {
MenuType *type; /* runtime */
uiLayout *layout; /* runtime for drawing */
/** Runtime. */
MenuType *type;
/** Runtime for drawing. */
uiLayout *layout;
};
/* asset shelf types */
/* Asset shelf types. */
/* #AssetShelfType.flag */
enum AssetShelfTypeFlag {
/** Do not trigger asset dragging on drag events. Drag events can be overridden with custom
* keymap items then. */
/**
* Do not trigger asset dragging on drag events.
* Drag events can be overridden with custom keymap items then.
*/
ASSET_SHELF_TYPE_FLAG_NO_ASSET_DRAG = (1 << 0),
ASSET_SHELF_TYPE_FLAG_DEFAULT_VISIBLE = (1 << 1),
ASSET_SHELF_TYPE_FLAG_STORE_CATALOGS_IN_PREFS = (1 << 2),
@@ -606,7 +640,8 @@ ENUM_OPERATORS(AssetShelfTypeFlag, ASSET_SHELF_TYPE_FLAG_MAX);
#define ASSET_SHELF_PREVIEW_SIZE_DEFAULT 64
struct AssetShelfType {
char idname[BKE_ST_MAXNAME]; /* unique name */
/** Unique name. */
char idname[BKE_ST_MAXNAME];
int space_type;
@@ -620,8 +655,10 @@ struct AssetShelfType {
/** Determine if asset shelves of this type should be available in current context or not. */
bool (*poll)(const bContext *C, const AssetShelfType *shelf_type);
/** Determine if an individual asset should be visible or not. May be a temporary design,
* visibility should first and foremost be controlled by asset traits. */
/**
* Determine if an individual asset should be visible or not. May be a temporary design,
* visibility should first and foremost be controlled by asset traits.
*/
bool (*asset_poll)(const AssetShelfType *shelf_type,
const blender::asset_system::AssetRepresentation *asset);
@@ -633,7 +670,7 @@ struct AssetShelfType {
const AssetWeakReference *(*get_active_asset)(const AssetShelfType *shelf_type);
/* RNA integration */
/** RNA integration. */
ExtensionRNA rna_ext;
};
@@ -644,7 +681,8 @@ ARegionType *BKE_regiontype_from_id(const SpaceType *st, int regionid);
blender::Span<std::unique_ptr<SpaceType>> BKE_spacetypes_list();
void BKE_spacetype_register(std::unique_ptr<SpaceType> st);
bool BKE_spacetype_exists(int spaceid);
void BKE_spacetypes_free(); /* only for quitting blender */
/** Only for quitting blender. */
void BKE_spacetypes_free();
/* Space-data. */

View File

@@ -81,8 +81,10 @@ struct UndoStep {
bool skip;
/** Some situations require the global state to be stored, edge cases when exiting modes. */
bool use_memfile_step;
/** When this is true, undo/memfile read code is allowed to re-use old data-blocks for unchanged
* IDs, and existing depsgraphs. This has to be forbidden in some cases (like renamed IDs). */
/**
* When this is true, undo/memfile read code is allowed to re-use old data-blocks for unchanged
* IDs, and existing depsgraphs. This has to be forbidden in some cases (like renamed IDs).
*/
bool use_old_bmain_data;
/** For use by undo systems that accumulate changes (mesh-sculpt & image-painting). */
bool is_applied;

View File

@@ -1377,7 +1377,7 @@ static int nlaevalchan_validate_index(const NlaEvalChannel *nec, int index)
static bool nlaevalchan_validate_index_ex(const NlaEvalChannel *nec, const int array_index)
{
/** Although array_index comes from fcurve, that doesn't necessarily mean the property has that
/* Although array_index comes from fcurve, that doesn't necessarily mean the property has that
* many elements. */
const int index = nlaevalchan_validate_index(nec, array_index);
@@ -1878,15 +1878,15 @@ static bool nla_blend_get_inverted_strip_value(const int blendmode,
return false;
}
/** Math:
/* Math:
*
* blended_value = inf * (lower_value * strip_value) + (1 - inf) * lower_value
* blended_value - (1 - inf) * lower_value = inf * (lower_value * strip_value)
* (blended_value - (1 - inf) * lower_value) / (inf * lower_value) = strip_value
* (blended_value - lower_value + inf * lower_value) / (inf * lower_value) = strip_value
* ((blended_value - lower_value) / (inf * lower_value)) + 1 = strip_value
* blended_value = inf * (lower_value * strip_value) + (1 - inf) * lower_value
* blended_value - (1 - inf) * lower_value = inf * (lower_value * strip_value)
* (blended_value - (1 - inf) * lower_value) / (inf * lower_value) = strip_value
* (blended_value - lower_value + inf * lower_value) / (inf * lower_value) = strip_value
* ((blended_value - lower_value) / (inf * lower_value)) + 1 = strip_value
*
* strip_value = ((blended_value - lower_value) / (inf * lower_value)) + 1
* strip_value = ((blended_value - lower_value) / (inf * lower_value)) + 1
*/
*r_strip_value = ((blended_value - lower_value) / (influence * lower_value)) + 1.0f;
return true;
@@ -1897,13 +1897,13 @@ static bool nla_blend_get_inverted_strip_value(const int blendmode,
default:
/** Math:
/* Math:
*
* blended_value = lower_value * (1.0f - inf) + (strip_value * inf)
* blended_value - lower_value * (1.0f - inf) = (strip_value * inf)
* (blended_value - lower_value * (1.0f - inf)) / inf = strip_value
* blended_value = lower_value * (1.0f - inf) + (strip_value * inf)
* blended_value - lower_value * (1.0f - inf) = (strip_value * inf)
* (blended_value - lower_value * (1.0f - inf)) / inf = strip_value
*
* strip_value = (blended_value - lower_value * (1.0f - inf)) / inf
* strip_value = (blended_value - lower_value * (1.0f - inf)) / inf
*/
*r_strip_value = (blended_value - lower_value * (1.0f - influence)) / influence;
return true;
@@ -3666,8 +3666,8 @@ void nlasnapshot_blend_get_inverted_upper_snapshot(NlaEvalData *eval_data,
LISTBASE_FOREACH (NlaEvalChannel *, nec, &eval_data->channels) {
NlaEvalChannelSnapshot *blended_necs = nlaeval_snapshot_get(blended_snapshot, nec->index);
if (blended_necs == nullptr) {
/** We assume the caller only wants a subset of channels to be inverted, those that exist
* within \a blended_snapshot. */
/* We assume the caller only wants a subset of channels to be inverted,
* those that exist within `blended_snapshot`. */
continue;
}

View File

@@ -233,19 +233,25 @@ struct ReuseOldBMainData {
Main *new_bmain;
Main *old_bmain;
/** Data generated and used by calling WM code to handle keeping WM and UI IDs as best as
/**
* Data generated and used by calling WM code to handle keeping WM and UI IDs as best as
* possible across file reading.
*
* \note May be null in undo (memfile) case. */
* \note May be null in undo (memfile) case.
*/
BlendFileReadWMSetupData *wm_setup_data;
/** Storage for all remapping rules (old_id -> new_id) required by the preservation of old IDs
* into the new Main. */
/**
* Storage for all remapping rules (old_id -> new_id) required by the preservation of old IDs
* into the new Main.
*/
id::IDRemapper *remapper;
bool is_libraries_remapped;
/** Used to find matching IDs by name/lib in new main, to remap ID usages of data ported over
* from old main. */
/**
* Used to find matching IDs by name/lib in new main, to remap ID usages of data ported over
* from old main.
*/
IDNameLib_Map *id_map;
};

View File

@@ -176,7 +176,7 @@ struct LayerTypeInfo {
/** A function used by mesh validating code, must ensures passed item has valid data. */
cd_validate validate;
/** functions necessary for geometry collapse */
/** Functions necessary for geometry collapse. */
bool (*equal)(const void *data1, const void *data2);
void (*multiply)(void *data, float fac);
void (*initminmax)(void *min, void *max);
@@ -184,17 +184,19 @@ struct LayerTypeInfo {
void (*dominmax)(const void *data1, void *min, void *max);
void (*copyvalue)(const void *source, void *dest, int mixmode, const float mixfactor);
/** a function to read data from a cdf file */
/** A function to read data from a cdf file. */
bool (*read)(CDataFile *cdf, void *data, int count);
/** a function to write data to a cdf file */
/** A function to write data to a cdf file. */
bool (*write)(CDataFile *cdf, const void *data, int count);
/** a function to determine file size */
/** A function to determine file size. */
size_t (*filesize)(CDataFile *cdf, const void *data, int count);
/** a function to determine max allowed number of layers,
* should be null or return -1 if no limit */
/**
* A function to determine max allowed number of layers,
* should be null or return -1 if no limit.
*/
int (*layers_max)();
};

View File

@@ -203,8 +203,10 @@ struct PaintBakeData {
/** speed vector in global space movement per frame, if required */
Vec3f *velocity;
Vec3f *prev_velocity;
/** special temp data for post-p velocity based brushes like smudge
* 3 float dir vec + 1 float str */
/**
* Special temp data for post-p velocity based brushes like smudge
* 3 float dir vec + 1 float str.
*/
float *brush_velocity;
/** copy of previous frame vertices. used to observe surface movement. */
float (*prev_positions)[3];

View File

@@ -98,8 +98,10 @@ using FCurveConvertCB = void(FCurve &fcurve);
* converted.
*/
struct AnimDataFCurveConvertor {
/** Source and destination RNA paths (relative to the relevant root paths stored in the owner
* #AnimDataConvertor data). */
/**
* Source and destination RNA paths
* (relative to the relevant root paths stored in the owner #AnimDataConvertor data).
*/
const char *relative_rna_path_src;
const char *relative_rna_path_dst;
@@ -179,8 +181,10 @@ class AnimDataConvertor {
blender::Vector<FCurve *> fcurves_from_src_main_action = {};
blender::Vector<FCurve *> fcurves_from_src_tmp_action = {};
blender::Vector<FCurve *> fcurves_from_src_drivers = {};
/** Generic 'has done something' flag, used to decide whether depsgraph tagging for updates is
* needed. */
/**
* Generic 'has done something' flag, used to decide whether depsgraph tagging for updates is
* needed.
*/
bool has_changes = false;
public:

View File

@@ -800,10 +800,12 @@ struct LibOverrideGroupTagData {
blender::Set<ID *> linked_ids_hierarchy_default_override;
bool do_create_linked_overrides_set;
/** Helpers to mark or unmark an ID as part of the processed (reference of) liboverride
/**
* Helpers to mark or unmark an ID as part of the processed (reference of) liboverride
* hierarchy.
*
* \return `true` if the given ID is tagged as missing linked data, `false` otherwise. */
* \return `true` if the given ID is tagged as missing linked data, `false` otherwise.
*/
bool id_tag_set(ID *id, const bool is_missing)
{
if (do_create_linked_overrides_set) {

View File

@@ -53,12 +53,16 @@ struct LibraryForeachIDData {
/** Callback flags that are forbidden for all callback calls for current processed data. */
LibraryForeachIDCallbackFlag cb_flag_clear;
/* Function to call for every ID pointers of current processed data, and its opaque user data
* pointer. */
/**
* Function to call for every ID pointers of current processed data, and its opaque user data
* pointer.
*/
blender::FunctionRef<LibraryIDLinkCallback> callback;
void *user_data;
/** Store the returned value from the callback, to decide how to continue the processing of ID
* pointers for current data. */
/**
* Store the returned value from the callback, to decide how to continue the processing of ID
* pointers for current data.
*/
int status;
/* To handle recursion. */
@@ -657,7 +661,8 @@ void BKE_library_ID_test_usages(Main *bmain,
/* ***** IDs usages.checking/tagging. ***** */
/* Internal data for the common processing of the 'unused IDs' query functions.
/**
* Internal data for the common processing of the 'unused IDs' query functions.
*
* While #LibQueryUnusedIDsData is a subset of this internal struct, they need to be kept separate,
* since this struct is used with partially 'enforced' values for some parameters by the
@@ -804,7 +809,8 @@ static bool lib_query_unused_ids_has_exception_user(ID &id, UnusedIDsData &data)
return false;
}
/* Returns `true` if given ID is detected as part of at least one dependency loop, false otherwise.
/**
* Returns `true` if given ID is detected as part of at least one dependency loop, false otherwise.
*/
static bool lib_query_unused_ids_tag_recurse(ID *id, UnusedIDsData &data)
{

View File

@@ -389,7 +389,7 @@ void BKE_nlatrack_insert_after(ListBase *nla_tracks,
BLI_assert(nla_tracks);
BLI_assert(new_track);
/** If nullptr, then caller intends to insert a new head. But, tracks are not allowed to be
/* If nullptr, then caller intends to insert a new head. But, tracks are not allowed to be
* placed before library overrides. So it must inserted after the last override. */
if (prev == nullptr) {
NlaTrack *first_track = (NlaTrack *)nla_tracks->first;

View File

@@ -72,8 +72,10 @@ typedef struct NlaEvalChannelSnapshot {
/** For an upper snapshot channel, marks values that should be blended. */
NlaValidMask blend_domain;
/** Only used for keyframe remapping. Any values not in the \a remap_domain will not be used
* for keyframe remapping. */
/**
* Only used for keyframe remapping.
* Any values not in the \a remap_domain will not be used for keyframe remapping.
*/
NlaValidMask remap_domain;
int length; /* Number of values in the property. */