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>2006-11-17 11:19:58 +0300
committerJoseph Eagar <joeedh@gmail.com>2006-11-17 11:19:58 +0300
commitab141e143947c9691fb747ad8d9fd8842c4dacde (patch)
treef0be2678aee5e5ba2bef3175e94e5aa64477d8d3 /source/blender/blenkernel/BKE_idprop.h
parent80f7ea96c83d8ae442b961906dc838ec03f06f00 (diff)
=ID Properties Python Update=
IDProperties now have a sanity check to prevent different ID properties in the same group from having the same name. The appropriate code has been added to the python bindings to catch this and raise an error.
Diffstat (limited to 'source/blender/blenkernel/BKE_idprop.h')
-rw-r--r--source/blender/blenkernel/BKE_idprop.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h
index d61d274dd36..09083364fd9 100644
--- a/source/blender/blenkernel/BKE_idprop.h
+++ b/source/blender/blenkernel/BKE_idprop.h
@@ -48,7 +48,22 @@ void IDP_LinkID(struct IDProperty *prop, ID *id);
void IDP_UnlinkID(struct IDProperty *prop);
/*-------- Group Functions -------*/
-void IDP_AddToGroup(struct IDProperty *group, struct IDProperty *prop);
+/*
+This function has a sanity check to make sure ID properties with the same name don't
+get added to the group.
+
+The sanity check just means the property is not added to the group if another property
+exists with the same name; the client code using ID properties then needs to detect this
+(the function that adds new properties to groups, IDP_AddToGroup, returns 0 if a property can't
+be added to the group, and 1 if it can) and free the property.
+
+Currently the code to free ID properties is designesd to leave the actual struct
+you pass it un-freed, this is needed for how the system works. This means
+to free an ID property, you first call IDP_FreeProperty then MEM_freeN the
+struct. In the future this will just be IDP_FreeProperty and the code will
+be reorganized to work properly.
+*/
+int IDP_AddToGroup(struct IDProperty *group, struct IDProperty *prop);
void IDP_RemFromGroup(struct IDProperty *group, struct IDProperty *prop);
IDProperty *IDP_GetPropertyFromGroup(struct IDProperty *prop, char *name);