Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_action.c
| Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | static void rna_ActionGroup_channels_next(CollectionPropertyIterator *iter) | ||||
| } | } | ||||
| else { | else { | ||||
| internal->link = NULL; | internal->link = NULL; | ||||
| } | } | ||||
| iter->valid = (internal->link != NULL); | iter->valid = (internal->link != NULL); | ||||
| } | } | ||||
| static PointerRNA rna_ActionGroup_parent_get(PointerRNA *ptr) | |||||
| { | |||||
| bActionGroup *data = (bActionGroup *)(ptr->data); | |||||
| return rna_pointer_inherit_refine(ptr, &RNA_ActionGroup, data->parent); | |||||
| } | |||||
| static void rna_ActionGroup_parent_set(PointerRNA *ptr, | |||||
| PointerRNA value, | |||||
| struct ReportList *UNUSED(reports)) | |||||
| { | |||||
| bActionGroup *grp = (bActionGroup *)(ptr->data); | |||||
| bActionGroup *pgrp, *pargrp = (bActionGroup *)(value.data); | |||||
| /* within same action */ | |||||
| if (value.owner_id != ptr->owner_id) { | |||||
| return; | |||||
| } | |||||
| /* make sure this is a valid child */ | |||||
| if (pargrp == grp) { | |||||
| return; | |||||
| } | |||||
| for (pgrp = pargrp->parent; pgrp; pgrp = pgrp->parent) { | |||||
| if (pgrp == grp) { | |||||
| return; | |||||
| } | |||||
| } | |||||
| grp->parent = pargrp; | |||||
| } | |||||
| static bActionGroup *rna_Action_groups_new(bAction *act, const char name[]) | static bActionGroup *rna_Action_groups_new(bAction *act, const char name[]) | ||||
| { | { | ||||
| return action_groups_add_new(act, name); | return action_groups_add_new(act, name); | ||||
| } | } | ||||
| static void rna_Action_groups_remove(bAction *act, ReportList *reports, PointerRNA *agrp_ptr) | static void rna_Action_groups_remove(bAction *act, ReportList *reports, PointerRNA *agrp_ptr) | ||||
| { | { | ||||
| bActionGroup *agrp = agrp_ptr->data; | bActionGroup *agrp = agrp_ptr->data; | ||||
| ▲ Show 20 Lines • Show All 561 Lines • ▼ Show 20 Lines | static void rna_def_action_group(BlenderRNA *brna) | ||||
| */ | */ | ||||
| prop = RNA_def_property(srna, "channels", PROP_COLLECTION, PROP_NONE); | prop = RNA_def_property(srna, "channels", PROP_COLLECTION, PROP_NONE); | ||||
| RNA_def_property_collection_sdna(prop, NULL, "channels", NULL); | RNA_def_property_collection_sdna(prop, NULL, "channels", NULL); | ||||
| RNA_def_property_struct_type(prop, "FCurve"); | RNA_def_property_struct_type(prop, "FCurve"); | ||||
| RNA_def_property_collection_funcs( | RNA_def_property_collection_funcs( | ||||
| prop, NULL, "rna_ActionGroup_channels_next", NULL, NULL, NULL, NULL, NULL, NULL); | prop, NULL, "rna_ActionGroup_channels_next", NULL, NULL, NULL, NULL, NULL, NULL); | ||||
| RNA_def_property_ui_text(prop, "Channels", "F-Curves in this group"); | RNA_def_property_ui_text(prop, "Channels", "F-Curves in this group"); | ||||
| prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); | |||||
| RNA_def_property_struct_type(prop, "ActionGroup"); | |||||
| RNA_def_property_pointer_funcs( | |||||
| prop, "rna_ActionGroup_parent_get", "rna_ActionGroup_parent_set", NULL, NULL); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_ui_text(prop, "Parent", "Parent action group"); | |||||
| prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_SELECTED); | RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_SELECTED); | ||||
| RNA_def_property_ui_text(prop, "Select", "Action group is selected"); | RNA_def_property_ui_text(prop, "Select", "Action group is selected"); | ||||
| RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL); | RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL); | ||||
| prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_PROTECTED); | RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_PROTECTED); | ||||
| RNA_def_property_ui_text(prop, "Lock", "Action group is locked"); | RNA_def_property_ui_text(prop, "Lock", "Action group is locked"); | ||||
| ▲ Show 20 Lines • Show All 218 Lines • Show Last 20 Lines | |||||