38 #define IDP_ARRAY_REALLOC_LIMIT 200
59 #define GETPROP(prop, i) &(IDP_IDPArray(prop)[i])
82 for (
int i = 0; i < narray->
len; i++) {
101 for (
int i = 0; i < prop->
len; i++) {
114 if (index >= prop->
len || index < 0) {
146 if (newlen <= prop->totallen) {
148 for (
int i = newlen; i < prop->
len; i++) {
155 if (newlen >= prop->
len) {
162 if (newlen < prop->
len) {
164 for (
int i = newlen; i < prop->
len; i++) {
177 int newsize = newlen;
178 newsize = (newsize >> 3) + (newsize < 9 ? 3 : 6) + newsize;
191 if (newlen >= prop->
len) {
196 for (
int a = prop->
len;
a < newlen;
a++) {
205 for (
int a = newlen;
a < prop->
len;
a++) {
213 const bool is_grow = newlen >= prop->
len;
230 int newsize = newlen;
231 newsize = (newsize >> 3) + (newsize < 9 ? 3 : 6) + newsize;
233 if (is_grow ==
false) {
240 if (is_grow ==
true) {
321 for (
a = 0;
a < prop->
len;
a++) {
351 int stlen = (int)strlen(
st) + 1;
353 if (maxlen > 0 && maxlen < stlen) {
386 int stlen = (int)strlen(
st);
387 if (maxlen > 0 && maxlen < stlen) {
406 int newlen = prop->
len + (int)strlen(
st);
419 int newlen = str1->
len + append->
len - 1;
497 if (other && prop->
type == other->
type) {
498 switch (prop->
type) {
521 if (prop_src !=
NULL) {
523 if ((prop_dst->type != prop_src->
type || prop_dst->subtype != prop_src->
subtype) ||
525 (prop_src->
len != prop_dst->len))) {
546 for (loop =
dest->data.group.first; loop; loop = loop->
next) {
568 if (prop_exist !=
NULL) {
587 const bool do_overwrite,
598 if (prop_exist !=
NULL) {
611 if (prop_exist !=
NULL) {
681 return (idprop && idprop->
type ==
type) ? idprop :
NULL;
706 switch (prop->
type) {
720 switch (prop->
type) {
734 switch (prop->
type) {
748 switch (prop->
type) {
781 return id->properties;
784 if (create_if_needed) {
792 return id->properties;
797 if (prop1 ==
NULL && prop2 ==
NULL) {
800 if (prop1 ==
NULL || prop2 ==
NULL) {
801 return is_strict ? false :
true;
807 switch (prop1->
type) {
811 #if !defined(NDEBUG) && defined(WITH_PYTHON)
815 if ((p1 != p2) && ((
fabsf(p1 - p2) /
max_ff(p1, p2)) < 0.001f)) {
817 "WARNING: Comparing two float properties that have nearly the same value (%f vs. "
832 return (((prop1->
len == prop2->
len) &&
843 if (is_strict && prop1->
len != prop2->
len) {
861 if (prop1->
len != prop2->
len) {
865 for (
int i = 0; i < prop1->
len; i++) {
902 *(
double *)&prop->
data.
val = val->
d;
1057 switch (prop->
type) {
1112 if (reference !=
NULL) {
1118 const int type_filter,
1122 if (!id_property_root) {
1126 if (type_filter == 0 || (1 << id_property_root->
type) & type_filter) {
1131 switch (id_property_root->
type) {
1140 for (
int i = 0; i < id_property_root->
len; i++) {
1204 for (
a = 0;
a < prop->
len;
a++) {
1219 for (
int a = 0;
a < prop->
len;
a++) {
1241 switch (prop->
type) {
1324 for (
int i = 0; i < prop->
len; i++) {
1338 for (
int i = 0; i < prop->
len; i++) {
1372 switch (prop->
type) {
1407 "%s: found unknown IDProperty type %d, reset to Integer one !\n", __func__, prop->
type);
1427 printf(
"%s: found non group data, freeing type %d!\n", caller_func_id, (*prop)->type);
1441 switch (prop->
type) {
1445 if (
IDP_Id(prop) && !newaddr &&
G.debug) {
1446 printf(
"Error while loading \"%s\". Data not found in file!\n", prop->
name);
1454 for (
int i = 0; i < prop->
len; i++) {
1477 switch (prop->
type) {
1483 for (
int i = 0; i < prop->
len; i++) {
1537 ui_data->
min = INT_MIN;
1538 ui_data->
max = INT_MAX;
1547 ui_data->
min = -FLT_MAX;
1548 ui_data->
max = FLT_MAX;
1551 ui_data->
step = 1.0f;
#define IDP_IDPArray(prop)
void(* IDPForeachPropertyCallback)(struct IDProperty *id_property, void *user_data)
void IDP_print(const struct IDProperty *prop)
@ IDP_UI_DATA_TYPE_UNSUPPORTED
@ IDP_UI_DATA_TYPE_STRING
@ LIB_ID_CREATE_NO_USER_REFCOUNT
void id_us_min(struct ID *id)
void id_us_plus(struct ID *id)
#define BLI_assert_unreachable()
BLI_INLINE void BLI_endian_switch_int64(int64_t *val) ATTR_NONNULL(1)
BLI_INLINE void BLI_endian_switch_int32(int *val) ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void BLI_insertlinkreplace(ListBase *listbase, void *vreplacelink, void *vnewlink) ATTR_NONNULL(1
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findstring(const struct ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE float max_ff(float a, float b)
Strict compiler flags for areas of code we want to ensure don't do conversions without us knowing abo...
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
#define STREQLEN(a, b, n)
void BLO_write_double_array(BlendWriter *writer, uint num, const double *data_ptr)
#define BLO_read_data_address(reader, ptr_p)
ID * BLO_read_get_new_id_address(BlendLibReader *reader, struct Library *lib, struct ID *id)
void BLO_write_int32_array(BlendWriter *writer, uint num, const int32_t *data_ptr)
void BLO_read_double_array(BlendDataReader *reader, int array_size, double **ptr_p)
void BLO_read_int32_array(BlendDataReader *reader, int array_size, int32_t **ptr_p)
#define BLO_write_struct(writer, struct_name, data_ptr)
void BLO_read_list(BlendDataReader *reader, struct ListBase *list)
void BLO_write_string(BlendWriter *writer, const char *data_ptr)
#define BLO_write_struct_array(writer, struct_name, array_size, data_ptr)
#define BLO_expand(expander, id)
bool BLO_read_requires_endian_switch(BlendDataReader *reader)
void BLO_write_raw(BlendWriter *writer, size_t size_in_bytes, const void *data_ptr)
void BLO_read_pointer_array(BlendDataReader *reader, void **ptr_p)
typedef double(DMatrix)[4][4]
#define CLOG_ERROR(clg_ref,...)
#define DEFAULT_ALLOC_FOR_NULL_STRINGS
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
#define MEM_recallocN(vmemh, len)
DEGForeachIDComponentCallback callback
SyclQueue void void * src
#define IDP_ARRAY_REALLOC_LIMIT
void IDP_SyncGroupTypes(IDProperty *dest, const IDProperty *src, const bool do_arraylen)
void IDP_Reset(IDProperty *prop, const IDProperty *reference)
void IDP_ui_data_free(IDProperty *prop)
bool IDP_InsertToGroup(IDProperty *group, IDProperty *previous, IDProperty *pnew)
bool IDP_AddToGroup(IDProperty *group, IDProperty *prop)
static void IDP_WriteGroup(const IDProperty *prop, BlendWriter *writer)
IDProperty * IDP_GetProperties(ID *id, const bool create_if_needed)
void IDP_ConcatStringC(IDProperty *prop, const char *st)
float IDP_coerce_to_float_or_zero(const IDProperty *prop)
void IDP_ConcatString(IDProperty *str1, IDProperty *append)
void IDP_BlendReadExpand(struct BlendExpander *expander, IDProperty *prop)
bool IDP_EqualsProperties_ex(IDProperty *prop1, IDProperty *prop2, const bool is_strict)
eIDPropertyUIDataType IDP_ui_data_type(const IDProperty *prop)
bool IDP_ui_data_supported(const IDProperty *prop)
static void idp_resize_group_array(IDProperty *prop, int newlen, void *newarr)
IDProperty * IDP_NewString(const char *st, const char *name, int maxlen)
void IDP_SyncGroupValues(IDProperty *dest, const IDProperty *src)
IDProperty * IDP_CopyProperty(const IDProperty *prop)
void IDP_ReplaceGroupInGroup(IDProperty *dest, const IDProperty *src)
void IDP_MergeGroup_ex(IDProperty *dest, const IDProperty *src, const bool do_overwrite, const int flag)
static IDProperty * IDP_CopyArray(const IDProperty *prop, const int flag)
void IDP_foreach_property(IDProperty *id_property_root, const int type_filter, IDPForeachPropertyCallback callback, void *user_data)
static IDProperty * IDP_CopyID(const IDProperty *prop, const int flag)
static void IDP_FreeIDPArray(IDProperty *prop, const bool do_id_user)
void IDP_FreeString(IDProperty *prop)
static IDProperty * IDP_CopyGroup(const IDProperty *prop, const int flag)
static void IDP_DirectLinkIDPArray(IDProperty *prop, BlendDataReader *reader)
void IDP_WriteProperty_OnlyData(const IDProperty *prop, BlendWriter *writer)
void IDP_CopyPropertyContent(IDProperty *dst, IDProperty *src)
void IDP_RemoveFromGroup(IDProperty *group, IDProperty *prop)
IDProperty * IDP_NewIDPArray(const char *name)
void IDP_FreeProperty(IDProperty *prop)
static size_t idp_size_table[]
void IDP_AssignID(IDProperty *prop, ID *id, const int flag)
int IDP_coerce_to_int_or_zero(const IDProperty *prop)
IDProperty * IDP_CopyProperty_ex(const IDProperty *prop, const int flag)
void IDP_FreeProperty_ex(IDProperty *prop, const bool do_id_user)
void IDP_AssignString(IDProperty *prop, const char *st, int maxlen)
static IDProperty * IDP_CopyString(const IDProperty *prop, const int flag)
void IDP_FreePropertyContent(IDProperty *prop)
void IDP_ReplaceInGroup_ex(IDProperty *group, IDProperty *prop, IDProperty *prop_exist)
void IDP_BlendReadLib(BlendLibReader *reader, Library *lib, IDProperty *prop)
void IDP_FreePropertyContent_ex(IDProperty *prop, const bool do_id_user)
static void IDP_DirectLinkGroup(IDProperty *prop, BlendDataReader *reader)
void IDP_FreeFromGroup(IDProperty *group, IDProperty *prop)
static void IDP_DirectLinkString(IDProperty *prop, BlendDataReader *reader)
void IDP_ClearProperty(IDProperty *prop)
static IDProperty * idp_generic_copy(const IDProperty *prop, const int UNUSED(flag))
IDPropertyUIData * IDP_ui_data_ensure(IDProperty *prop)
IDProperty * IDP_GetPropertyFromGroup(const IDProperty *prop, const char *name)
double IDP_coerce_to_double_or_zero(const IDProperty *prop)
void IDP_ResizeIDPArray(IDProperty *prop, int newlen)
static void IDP_DirectLinkProperty(IDProperty *prop, BlendDataReader *reader)
IDPropertyUIData * IDP_ui_data_copy(const IDProperty *prop)
static void IDP_FreeGroup(IDProperty *prop, const bool do_id_user)
void IDP_MergeGroup(IDProperty *dest, const IDProperty *src, const bool do_overwrite)
static void IDP_DirectLinkArray(IDProperty *prop, BlendDataReader *reader)
IDProperty * IDP_GetIndexArray(IDProperty *prop, int index)
void IDP_AppendArray(IDProperty *prop, IDProperty *item)
static void IDP_WriteString(const IDProperty *prop, BlendWriter *writer)
IDProperty * IDP_GetPropertyTypeFromGroup(const IDProperty *prop, const char *name, const char type)
void IDP_SetIndexArray(IDProperty *prop, int index, IDProperty *item)
void IDP_ResizeArray(IDProperty *prop, int newlen)
void IDP_ui_data_free_unique_contents(IDPropertyUIData *ui_data, const eIDPropertyUIDataType type, const IDPropertyUIData *other)
void IDP_ReplaceInGroup(IDProperty *group, IDProperty *prop)
static void IDP_WriteArray(const IDProperty *prop, BlendWriter *writer)
void IDP_BlendWrite(BlendWriter *writer, const IDProperty *prop)
static void write_ui_data(const IDProperty *prop, BlendWriter *writer)
static void read_ui_data(IDProperty *prop, BlendDataReader *reader)
IDProperty * IDP_CopyIDPArray(const IDProperty *array, const int flag)
void IDP_FreeArray(IDProperty *prop)
static void IDP_WriteIDPArray(const IDProperty *prop, BlendWriter *writer)
void IDP_BlendReadData_impl(BlendDataReader *reader, IDProperty **prop, const char *caller_func_id)
bool IDP_EqualsProperties(IDProperty *prop1, IDProperty *prop2)
IDProperty * IDP_New(const char type, const IDPropertyTemplate *val, const char *name)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
size_t(* MEM_allocN_len)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
static const pxr::TfToken st("st", pxr::TfToken::Immortal)
static void copy(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node)
IDPropertyUIData * ui_data
struct IDPropertyTemplate::@27 array
struct IDPropertyTemplate::@26 string