Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Eagar <joeedh@gmail.com>2008-10-06 14:24:32 +0400
committerJoseph Eagar <joeedh@gmail.com>2008-10-06 14:24:32 +0400
commit16f199bda3aa6a55218be43a9afc953a1e059e55 (patch)
tree32989259ced7550d91603368b435d6105151bb9d /source/blender/blenkernel/intern/idprop.c
parentba720030be454fa36bb4e43b59896ea3753bb585 (diff)
one-liner fix for id property duplication bug
Diffstat (limited to 'source/blender/blenkernel/intern/idprop.c')
-rw-r--r--source/blender/blenkernel/intern/idprop.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c
index dd3e34c51e7..f83f66daa85 100644
--- a/source/blender/blenkernel/intern/idprop.c
+++ b/source/blender/blenkernel/intern/idprop.c
@@ -220,6 +220,10 @@ IDProperty *IDP_CopyGroup(IDProperty *prop)
return newp;
}
+/*
+ replaces a property with the same name in a group, or adds
+ it if the propery doesn't exist.
+*/
void IDP_ReplaceInGroup(IDProperty *group, IDProperty *prop)
{
IDProperty *loop;
@@ -230,8 +234,7 @@ void IDP_ReplaceInGroup(IDProperty *group, IDProperty *prop)
BLI_remlink(&group->data.group, loop);
IDP_FreeProperty(loop);
- MEM_freeN(loop);
-
+ MEM_freeN(loop);
return;
}
}
@@ -263,7 +266,7 @@ int IDP_InsertToGroup(IDProperty *group, IDProperty *previous, IDProperty *pnew)
}
group->len++;
-
+
BLI_insertlink(&group->data.group, previous, pnew);
return 1;
}
@@ -349,6 +352,7 @@ IDProperty *IDP_GetProperties(ID *id, int create_if_needed)
if (create_if_needed) {
id->properties = MEM_callocN(sizeof(IDProperty), "IDProperty");
id->properties->type = IDP_GROUP;
+ strcpy(id->name, "top_level_group");
}
return id->properties;
}
@@ -424,7 +428,7 @@ IDProperty *IDP_New(int type, IDPropertyTemplate val, char *name)
return prop;
}
-/*NOTE: this will free all child properties of list arrays and groups!
+/*NOTE: this will free all child properties including list arrays and groups!
Also, note that this does NOT unlink anything! Plus it doesn't free
the actual IDProperty struct either.*/
void IDP_FreeProperty(IDProperty *prop)
@@ -442,7 +446,8 @@ void IDP_FreeProperty(IDProperty *prop)
}
}
-/*Unlinks any IDProperty<->ID linkage that might be going on.*/
+/*Unlinks any IDProperty<->ID linkage that might be going on.
+ note: currently unused.*/
void IDP_UnlinkProperty(IDProperty *prop)
{
switch (prop->type) {