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>2011-02-02 02:53:54 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-02-02 02:53:54 +0300
commit19efa4301a5f2545eddfd4e5e56943d9a1d9f5cf (patch)
treefc5e6c9c4696c8ae0da56ab219e688f315ead1e0 /source/blender/makesrna/intern/rna_access.c
parent501703020a60a446e7dc344a4f56b140f99dc440 (diff)
fix crash from report [#25746] Adding keyframes to nested custom properties (IDProperties) of a bone causes segfault
though keyframing still doesn't work, it gives an error instead. also use const char * in more parts of the py/rna api.
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r--source/blender/makesrna/intern/rna_access.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index e6802d03ec4..6c09b349d9b 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -2460,7 +2460,7 @@ int RNA_raw_type_sizeof(RawPropertyType type)
}
}
-static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, char *propname, void *inarray, RawPropertyType intype, int inlen, int set)
+static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, const char *propname, void *inarray, RawPropertyType intype, int inlen, int set)
{
StructRNA *ptype;
PointerRNA itemptr;
@@ -2762,12 +2762,12 @@ RawPropertyType RNA_property_raw_type(PropertyRNA *prop)
return prop->rawtype;
}
-int RNA_property_collection_raw_get(ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, char *propname, void *array, RawPropertyType type, int len)
+int RNA_property_collection_raw_get(ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, const char *propname, void *array, RawPropertyType type, int len)
{
return rna_raw_access(reports, ptr, prop, propname, array, type, len, 0);
}
-int RNA_property_collection_raw_set(ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, char *propname, void *array, RawPropertyType type, int len)
+int RNA_property_collection_raw_set(ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, const char *propname, void *array, RawPropertyType type, int len)
{
return rna_raw_access(reports, ptr, prop, propname, array, type, len, 1);
}
@@ -3423,12 +3423,19 @@ static char *rna_path_from_ID_to_idpgroup(PointerRNA *ptr)
IDProperty *needle;
BLI_assert(ptr->id.data != NULL);
+
+ /* TODO, Support Bones/PoseBones. no pointers stored to the bones from here, only the ID. See example in [#25746]
+ * unless this is added only way to find this is to also search all bones and pose bones of an armature or object */
RNA_id_pointer_create(ptr->id.data, &id_ptr);
haystack= RNA_struct_idprops(&id_ptr, FALSE);
- needle= ptr->data;
-
- return rna_idp_path(&id_ptr, haystack, needle, NULL);
+ if(haystack) { /* can fail when called on bones */
+ needle= ptr->data;
+ return rna_idp_path(&id_ptr, haystack, needle, NULL);
+ }
+ else {
+ return NULL;
+ }
}
char *RNA_path_from_ID_to_struct(PointerRNA *ptr)