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:
authorCampbell Barton <ideasman42@gmail.com>2010-09-24 04:39:01 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-09-24 04:39:01 +0400
commit05f8e53d3361f1f043f7dcf520671d3fa3a79e32 (patch)
treeeff6b4f5028472557f85b29f72c9957a8a620566 /source/blender/makesrna/intern/rna_ID.c
parent3921f0528cc73d64e11da095903c961b1969b46e (diff)
bugfix [#23965] Segmentation fault when using bpy_struct.keyframe_insert() with nested custom property
Diffstat (limited to 'source/blender/makesrna/intern/rna_ID.c')
-rw-r--r--source/blender/makesrna/intern/rna_ID.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index b9ef92cdca1..4321f8aa711 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -252,6 +252,18 @@ void rna_ID_user_clear(ID *id)
id->flag &= ~LIB_FAKEUSER;
}
+static void rna_IDPArray_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ IDProperty *prop= (IDProperty *)ptr->data;
+ rna_iterator_array_begin(iter, IDP_IDPArray(prop), sizeof(IDProperty), prop->len, 0, NULL);
+}
+
+static int rna_IDPArray_length(PointerRNA *ptr)
+{
+ IDProperty *prop= (IDProperty *)ptr->data;
+ return prop->len;
+}
+
#else
static void rna_def_ID_properties(BlenderRNA *brna)
@@ -302,6 +314,11 @@ static void rna_def_ID_properties(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
RNA_def_property_struct_type(prop, "IDPropertyGroup");
+ prop= RNA_def_property(srna, "idp_array", PROP_COLLECTION, PROP_NONE);
+ RNA_def_property_struct_type(prop, "IDPropertyGroup");
+ RNA_def_property_collection_funcs(prop, "rna_IDPArray_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_IDPArray_length", 0, 0);
+ RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
+
// never tested, maybe its useful to have this?
#if 0
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);