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-10-09 06:11:43 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-10-09 06:11:43 +0400
commitee8078fb12f3697a9f8d49b35a4de21d3f7e32ae (patch)
tree084243c936250af18188ff67aa9c8f892983bad0
parenta378668ac2c0220863311df4bc5e1aa8114e6bd2 (diff)
fix for BUILTIN_KSI_WholeCharacter keying custom string/collection/group properties
-rw-r--r--release/scripts/startup/keyingsets_builtins.py11
-rw-r--r--source/blender/python/intern/bpy_rna.c10
2 files changed, 19 insertions, 2 deletions
diff --git a/release/scripts/startup/keyingsets_builtins.py b/release/scripts/startup/keyingsets_builtins.py
index e99966ce58f..c7922a0dfa1 100644
--- a/release/scripts/startup/keyingsets_builtins.py
+++ b/release/scripts/startup/keyingsets_builtins.py
@@ -353,8 +353,13 @@ class BUILTIN_KSI_WholeCharacter(KeyingSetInfo):
# custom properties
def doCustomProps(ksi, ks, bone):
+
+ prop_type_compat = {bpy.types.BooleanProperty,
+ bpy.types.IntProperty,
+ bpy.types.FloatProperty}
+
# go over all custom properties for bone
- for prop, val in bone.items():
+ for prop in bone.keys():
# ignore special "_RNA_UI" used for UI editing
if prop == "_RNA_UI":
continue
@@ -362,7 +367,9 @@ class BUILTIN_KSI_WholeCharacter(KeyingSetInfo):
# for now, just add all of 'em
prop_rna = type(bone).bl_rna.properties.get(prop, None)
if prop_rna is None:
- ksi.addProp(ks, bone, '["%s"]' % prop)
+ prop_path = '["%s"]' % prop
+ if bone.path_resolve(prop_path, False).rna_type in prop_type_compat:
+ ksi.addProp(ks, bone, prop_path)
elif prop_rna.is_animatable:
ksi.addProp(ks, bone, prop)
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index f79f1d01a96..4bdcc7838f1 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -3655,12 +3655,22 @@ static PyObject *pyrna_struct_get_id_data(BPy_DummyPointerRNA *self)
Py_RETURN_NONE;
}
+static PyObject *pyrna_struct_get_rna_type(BPy_PropertyRNA *self)
+{
+ PointerRNA tptr;
+ RNA_pointer_create(NULL, &RNA_Property, self->prop, &tptr);
+ return pyrna_struct_Subtype(&tptr);
+}
+
+
+
/*****************************************************************************/
/* Python attributes get/set structure: */
/*****************************************************************************/
static PyGetSetDef pyrna_prop_getseters[]= {
{(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)"The :class:`ID` object this datablock is from or None, (not available for all data types)", NULL},
+ {(char *)"rna_type", (getter)pyrna_struct_get_rna_type, (setter)NULL, (char *)"The property type for introspection", NULL},
{NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};