fix [#28821] Whole Character keying set ignores non animatable propertyflag
authorCampbell Barton <ideasman42@gmail.com>
Sat, 8 Oct 2011 12:27:52 +0000 (12:27 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 8 Oct 2011 12:27:52 +0000 (12:27 +0000)
release/scripts/startup/keyingsets_builtins.py
source/blender/makesrna/intern/rna_rna.c

index 6b12c95..e99966c 100644 (file)
@@ -360,7 +360,12 @@ class BUILTIN_KSI_WholeCharacter(KeyingSetInfo):
                 continue
 
             # for now, just add all of 'em
-            ksi.addProp(ks, bone, '["%s"]' % (prop))
+            prop_rna = type(bone).bl_rna.properties.get(prop, None)
+            if prop_rna is None:
+                ksi.addProp(ks, bone, '["%s"]' % prop)
+            elif prop_rna.is_animatable:
+                ksi.addProp(ks, bone, prop)
+
 
 ###############################
 
index 454fd62..376b0c5 100644 (file)
@@ -506,6 +506,13 @@ static int rna_Property_readonly_get(PointerRNA *ptr)
        return prop->flag & PROP_EDITABLE ? 0:1;
 }
 
+static int rna_Property_animatable_get(PointerRNA *ptr)
+{
+       PropertyRNA *prop= (PropertyRNA*)ptr->data;
+
+       return (prop->flag & PROP_ANIMATABLE) != 0;
+}
+
 static int rna_Property_use_output_get(PointerRNA *ptr)
 {
        PropertyRNA *prop= (PropertyRNA*)ptr->data;
@@ -1066,6 +1073,11 @@ static void rna_def_property(BlenderRNA *brna)
        RNA_def_property_boolean_funcs(prop, "rna_Property_readonly_get", NULL);
        RNA_def_property_ui_text(prop, "Read Only", "Property is editable through RNA");
 
+       prop= RNA_def_property(srna, "is_animatable", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+       RNA_def_property_boolean_funcs(prop, "rna_Property_animatable_get", NULL);
+       RNA_def_property_ui_text(prop, "Animatable", "Property is animatable through RNA");
+
        prop= RNA_def_property(srna, "is_required", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
        RNA_def_property_boolean_funcs(prop, "rna_Property_is_required_get", NULL);