Object *ob= (Object *)owner_id;
/* only consider if F-Curve involves pose.bones */
- if ((fcu->rna_path) && strstr(fcu->rna_path, "bones")) {
+ if ((fcu->rna_path) && strstr(fcu->rna_path, "pose.bones")) {
bPoseChannel *pchan;
char *bone_name;
/* get bone-name, and check if this bone is selected */
- bone_name= BLI_getQuotedStr(fcu->rna_path, "bones[");
+ bone_name= BLI_getQuotedStr(fcu->rna_path, "pose.bones[");
pchan= get_pose_channel(ob->pose, bone_name);
if (bone_name) MEM_freeN(bone_name);
#include "rna_internal.h"
+#include "DNA_anim_types.h"
#include "DNA_action_types.h"
#include "DNA_scene_types.h"
#ifdef RNA_RUNTIME
+static void rna_ActionGroup_channels_next(CollectionPropertyIterator *iter)
+{
+ ListBaseIterator *internal= iter->internal;
+ FCurve *fcu= (FCurve*)internal->link;
+ bActionGroup *grp= fcu->grp;
+
+ /* only continue if the next F-Curve (if existant) belongs in the same group */
+ if ((fcu->next) && (fcu->next->grp == grp))
+ internal->link= (Link*)fcu->next;
+ else
+ internal->link= NULL;
+
+ iter->valid= (internal->link != NULL);
+}
+
#else
static void rna_def_dopesheet(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
- /* dna warns not to treat the Action Channel listbase in the Action Group struct like a
- normal listbase. I'll leave this here but comment out, for Joshua to review. He can
- probably shed some more light on why this is */
- /*prop= RNA_def_property(srna, "channels", PROP_COLLECTION, PROP_NONE);
+ /* WARNING: be very careful when working with this list, since the endpoint is not
+ * defined like a standard ListBase. Adding/removing channels from this list needs
+ * extreme care, otherwise the F-Curve list running through adjacent groups does
+ * not match up with the one stored in the Action, resulting in curves which do not
+ * show up in animation editors. For that reason, such operations are currently
+ * prohibited.
+ */
+ prop= RNA_def_property(srna, "channels", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "channels", NULL);
RNA_def_property_struct_type(prop, "FCurve");
- RNA_def_property_ui_text(prop, "Channels", "F-Curves in this group.");*/
+ RNA_def_property_collection_funcs(prop, 0, "rna_ActionGroup_channels_next", 0, 0, 0, 0, 0);
+ RNA_def_property_ui_text(prop, "Channels", "F-Curves in this group.");
prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_SELECTED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Driver", "Channel Driver (only set for Driver F-Curves)");
+ prop= RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "grp");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX this is not editable for now, since editing this will easily break the visible hierarchy
+ RNA_def_property_ui_text(prop, "Group", "Action Group that this F-Curve belongs to.");
+
/* Path + Array Index */
prop= RNA_def_property(srna, "data_path", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_FCurve_RnaPath_get", "rna_FCurve_RnaPath_length", "rna_FCurve_RnaPath_set");