Blender V5.3
idprop.cc File Reference
#include <cfloat>
#include <climits>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <xxhash.h>
#include <fmt/format.h>
#include "BLI_listbase.hh"
#include "BLI_math_base_c.hh"
#include "BLI_set.hh"
#include "BLI_string.hh"
#include "BLI_string_utf8.hh"
#include "BLI_utildefines.hh"
#include "BKE_idprop.hh"
#include "BKE_idprop_hash.hh"
#include "BKE_lib_id.hh"
#include "CLG_log.h"
#include "MEM_guardedalloc.h"
#include "BLO_read_write.hh"
#include "BLI_strict_flags.hh"

Go to the source code of this file.

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::bke
namespace  blender::bke::idprop

Macros

#define IDP_ARRAY_REALLOC_LIMIT   200

Functions

void blender::bke::idprop::hash (const IDProperty &base_prop, XXH3_state_t *hash_state)
Main Functions (IDProperty Main API)
static void blender::idp_free_property_content_recurse (IDProperty *prop, const bool do_id_user, const int recursion_depth)
static void blender::idp_free_property_recurse (IDProperty *prop, const bool do_id_user, const int recursion_depth)
int blender::IDP_coerce_to_int_or_zero (const IDProperty *prop)
double blender::IDP_coerce_to_double_or_zero (const IDProperty *prop)
float blender::IDP_coerce_to_float_or_zero (const IDProperty *prop)
IDProperty * blender::IDP_CopyProperty_ex (const IDProperty *prop, int flag) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
IDProperty * blender::IDP_CopyProperty (const IDProperty *prop) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void blender::IDP_CopyPropertyContent (IDProperty *dst, const IDProperty *src) ATTR_NONNULL()
IDProperty * blender::IDP_GetProperties (ID *id) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
IDProperty * blender::IDP_EnsureProperties (ID *id) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
IDProperty * blender::IDP_ID_system_properties_get (ID *id) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
IDProperty * blender::IDP_ID_system_properties_ensure (ID *id) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
bool blender::IDP_EqualsProperties_ex (const IDProperty *prop1, const IDProperty *prop2, bool is_strict) ATTR_WARN_UNUSED_RESULT
bool blender::IDP_EqualsProperties (const IDProperty *prop1, const IDProperty *prop2) ATTR_WARN_UNUSED_RESULT
IDProperty * blender::IDP_New (char type, const IDPropertyTemplate *val, StringRef name, eIDPropertyFlag flags={}) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
IDProperty * blender::IDP_NewInt (int value, blender::StringRef name, eIDPropertyFlag flags={})
void blender::IDP_ui_data_free_unique_contents (IDPropertyUIData *ui_data, eIDPropertyUIDataType type, const IDPropertyUIData *other)
static void blender::ui_data_free (IDPropertyUIData *ui_data, const eIDPropertyUIDataType type)
void blender::IDP_ui_data_free (IDProperty *prop)
void blender::IDP_FreeProperty_ex (IDProperty *prop, bool do_id_user)
void blender::IDP_FreeProperty (IDProperty *prop)
void blender::IDP_ClearProperty (IDProperty *prop)
void blender::IDP_Reset (IDProperty *prop, const IDProperty *reference)
static void blender::idp_foreach_property_recurse (IDProperty *id_property_root, const int type_filter, const int recursion_depth, const FunctionRef< void(IDProperty *id_property)> callback)
void blender::IDP_foreach_property (IDProperty *id_property_root, const int type_filter, const FunctionRef< void(IDProperty *id_property)> callback)
static void blender::idp_blend_write_recurse (BlendWriter *writer, const IDProperty *prop, const int recursion_depth)
static void blender::IDP_WriteProperty_OnlyData (const IDProperty *prop, BlendWriter *writer, const int recursion_depth)
static void blender::write_ui_data (const IDProperty *prop, BlendWriter *writer)
static void blender::IDP_WriteArray (const IDProperty *prop, BlendWriter *writer, const int recursion_depth)
static void blender::IDP_WriteIDPArray (const IDProperty *prop, BlendWriter *writer, const int recursion_depth)
static void blender::IDP_WriteString (const IDProperty *prop, BlendWriter *writer)
static void blender::IDP_WriteGroup (const IDProperty *prop, BlendWriter *writer, const int recursion_depth)
void blender::IDP_BlendWrite (BlendWriter *writer, const IDProperty *prop)
static void blender::IDP_DirectLinkProperty (IDProperty *prop, BlendDataReader *reader, const int recursion_depth)
static void blender::read_ui_data (IDProperty *prop, BlendDataReader *reader)
static void blender::IDP_DirectLinkIDPArray (IDProperty *prop, BlendDataReader *reader, const int recursion_depth)
static void blender::IDP_DirectLinkArray (IDProperty *prop, BlendDataReader *reader, const int recursion_depth)
static void blender::IDP_DirectLinkString (IDProperty *prop, BlendDataReader *reader)
static void blender::IDP_DirectLinkGroup (IDProperty *prop, BlendDataReader *reader, const int recursion_depth)
void blender::IDP_BlendReadData_impl (BlendDataReader *reader, IDProperty **prop, const char *caller_func_id)
eIDPropertyUIDataType blender::IDP_ui_data_type (const IDProperty *prop)
bool blender::IDP_ui_data_supported (const IDProperty *prop)
static IDPropertyUIData * blender::ui_data_alloc (const eIDPropertyUIDataType type)
IDPropertyUIData * blender::IDP_ui_data_ensure (IDProperty *prop)
static IDPropertyUIData * blender::convert_base_ui_data (IDPropertyUIData *src, const eIDPropertyUIDataType dst_type)
IDPropertyUIData * blender::IDP_TryConvertUIData (IDPropertyUIData *src, eIDPropertyUIDataType src_type, eIDPropertyUIDataType dst_type)
String Functions (IDProperty String API)
IDProperty * blender::IDP_NewStringMaxSize (const char *st, size_t st_maxncpy, StringRef name, eIDPropertyFlag flags={}) ATTR_WARN_UNUSED_RESULT
IDProperty * blender::IDP_NewString (const char *st, StringRef name, eIDPropertyFlag flags={}) ATTR_WARN_UNUSED_RESULT
IDProperty * blender::IDP_NewString (const StringRef value, const StringRef name, const eIDPropertyFlag flags)
static IDProperty * blender::IDP_CopyString (const IDProperty *prop, const int flag)
void blender::IDP_AssignStringMaxSize (IDProperty *prop, const char *st, size_t st_maxncpy) ATTR_NONNULL()
void blender::IDP_AssignString (IDProperty *prop, const char *st) ATTR_NONNULL()
void blender::IDP_FreeString (IDProperty *prop) ATTR_NONNULL()
Enum Type (IDProperty Enum API)
void blender::IDP_EnumItemsFree (IDPropertyUIDataEnumItem *items, int items_num)
static void blender::IDP_int_ui_data_free_enum_items (IDPropertyUIDataInt *ui_data)
const IDPropertyUIDataEnumItem * blender::IDP_EnumItemFind (const IDProperty *prop)
bool blender::IDP_EnumItemsValidate (const IDPropertyUIDataEnumItem *items, int items_num, void(*error_fn)(const char *))
ID Type (IDProperty ID API)
static IDProperty * blender::IDP_CopyID (const IDProperty *prop, const int flag)
void blender::IDP_AssignID (IDProperty *prop, ID *id, int flag)
Group Functions (IDProperty Group API)
static IDProperty * blender::IDP_CopyGroup (const IDProperty *prop, const int flag)
void blender::IDP_SyncGroupValues (IDProperty *dest, const IDProperty *src) ATTR_NONNULL()
void blender::IDP_SyncGroupTypes (IDProperty *dest, const IDProperty *src, bool do_arraylen) ATTR_NONNULL()
void blender::IDP_ReplaceGroupInGroup (IDProperty *dest, const IDProperty *src) ATTR_NONNULL()
void blender::IDP_ReplaceInGroup_ex (IDProperty *group, IDProperty *prop, IDProperty *prop_exist, int flag)
void blender::IDP_ReplaceInGroup (IDProperty *group, IDProperty *prop) ATTR_NONNULL()
void blender::IDP_MergeGroup_ex (IDProperty *dest, const IDProperty *src, bool do_overwrite, int flag) ATTR_NONNULL()
void blender::IDP_MergeGroup (IDProperty *dest, const IDProperty *src, bool do_overwrite) ATTR_NONNULL()
bool blender::IDP_AddToGroup (IDProperty *group, IDProperty *prop) ATTR_NONNULL()
void blender::IDP_RemoveFromGroup (IDProperty *group, IDProperty *prop) ATTR_NONNULL()
void blender::IDP_FreeFromGroup (IDProperty *group, IDProperty *prop) ATTR_NONNULL()
IDProperty * blender::IDP_GetPropertyFromGroup (const IDProperty *prop, StringRef name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
IDProperty * blender::IDP_GetPropertyFromGroup_null (const IDProperty *prop, StringRef name) ATTR_WARN_UNUSED_RESULT
IDProperty * blender::IDP_GetPropertyTypeFromGroup (const IDProperty *prop, StringRef name, char type) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
static void blender::IDP_FreeGroup (IDProperty *prop, const bool do_id_user, const int recursion_depth)
std::optional< StringRefNull > blender::IDP_group_lookup_string (const IDProperty &group, StringRef name)
std::optional< float > blender::IDP_group_lookup_float (const IDProperty &group, StringRef name)
std::optional< int > blender::IDP_group_lookup_int (const IDProperty &group, StringRef name)
std::optional< bool > blender::IDP_group_lookup_bool (const IDProperty &group, StringRef name)
std::optional< Span< float > > blender::IDP_group_lookup_float_array (const IDProperty &group, StringRef name, int required_size)
Debugging
const IDProperty * blender::_IDP_assert_type (const IDProperty *prop, char ty)
const IDProperty * blender::_IDP_assert_type_and_subtype (const IDProperty *prop, char ty, char sub_ty)
const IDProperty * blender::_IDP_assert_type_mask (const IDProperty *prop, int ty_mask)

Variables

static CLG_LogRef blender::LOG = {"lib.idprop"}
static size_t blender::idp_size_table []
constexpr int blender::MAX_IDPROP_DEPTH_LEVEL = 1026
constexpr int blender::MAX_IDPROP_DEPTH_LEVEL_FOR_WRITE = MAX_IDPROP_DEPTH_LEVEL - 1
constexpr int blender::MAX_IDPROP_DEPTH_LEVEL_FOR_READ = MAX_IDPROP_DEPTH_LEVEL - 2

Array Functions (IDP Array API)

#define GETPROP(prop, i)
IDProperty * blender::IDP_NewIDPArray (StringRef name) ATTR_WARN_UNUSED_RESULT
IDProperty * blender::IDP_CopyIDPArray (const IDProperty *array, int flag) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
static void blender::IDP_FreeIDPArray (IDProperty *prop, const bool do_id_user, const int recursion_depth)
void blender::IDP_SetIndexArray (IDProperty *prop, int index, IDProperty *item) ATTR_NONNULL()
IDProperty * blender::IDP_GetIndexArray (IDProperty *prop, int index) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void blender::IDP_AppendArray (IDProperty *prop, IDProperty *item)
static void blender::idp_group_children_map_ensure (IDProperty &prop)
static int blender::idp_resize_grow_size_calc (const int newsize)
void blender::IDP_ResizeIDPArray (IDProperty *prop, int newlen)
static void blender::idp_resize_group_array (IDProperty *prop, int newlen, void *newarr, const bool do_id_users, const int recursion_depth)
void blender::IDP_ResizeArray (IDProperty *prop, int newlen)
static void blender::IDP_FreeArray (IDProperty *prop, const bool do_id_user, const int recursion_depth)
IDPropertyUIData * blender::IDP_ui_data_copy (const IDProperty *prop)
static IDProperty * blender::idp_generic_copy (const IDProperty *prop, const int)
static IDProperty * blender::IDP_CopyArray (const IDProperty *prop, const int flag)

Macro Definition Documentation

◆ GETPROP

#define GETPROP ( prop,
i )

◆ IDP_ARRAY_REALLOC_LIMIT

#define IDP_ARRAY_REALLOC_LIMIT   200

if the new is 'IDP_ARRAY_REALLOC_LIMIT' items less, than #IDProperty.totallen, reallocate anyway.

Definition at line 47 of file idprop.cc.

Referenced by blender::IDP_ResizeArray(), and blender::IDP_ResizeIDPArray().