diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_animation.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_animation.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index 9adbf5f6b2e..6779e74700d 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -32,6 +32,8 @@ #include "BLI_utildefines.h" +#include "BLT_translation.h" + #include "MEM_guardedalloc.h" #include "RNA_access.h" @@ -45,7 +47,7 @@ #include "ED_keyframing.h" /* exported for use in API */ -EnumPropertyItem rna_enum_keyingset_path_grouping_items[] = { +const EnumPropertyItem rna_enum_keyingset_path_grouping_items[] = { {KSP_GROUP_NAMED, "NAMED", 0, "Named Group", ""}, {KSP_GROUP_NONE, "NONE", 0, "None", ""}, {KSP_GROUP_KSNAME, "KEYINGSET", 0, "Keying Set Name", ""}, @@ -55,7 +57,7 @@ EnumPropertyItem rna_enum_keyingset_path_grouping_items[] = { /* It would be cool to get rid of this 'INSERTKEY_' prefix in 'py strings' values, but it would break existing * exported keyingset... :/ */ -EnumPropertyItem rna_enum_keying_flag_items[] = { +const EnumPropertyItem rna_enum_keying_flag_items[] = { {INSERTKEY_NEEDED, "INSERTKEY_NEEDED", 0, "Only Needed", "Only insert keyframes where they're needed in the relevant F-Curves"}, {INSERTKEY_MATRIX, "INSERTKEY_VISUAL", 0, "Visual Keying", @@ -244,8 +246,9 @@ static void rna_KeyingSetInfo_unregister(Main *bmain, StructRNA *type) ANIM_keyingset_info_unregister(bmain, ksi); } -static StructRNA *rna_KeyingSetInfo_register(Main *bmain, ReportList *reports, void *data, const char *identifier, - StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) +static StructRNA *rna_KeyingSetInfo_register( + Main *bmain, ReportList *reports, void *data, const char *identifier, + StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) { KeyingSetInfo dummyksi = {NULL}; KeyingSetInfo *ksi; @@ -268,9 +271,10 @@ static StructRNA *rna_KeyingSetInfo_register(Main *bmain, ReportList *reports, v /* check if we have registered this info before, and remove it */ ksi = ANIM_keyingset_info_find_name(dummyksi.idname); - if (ksi && ksi->ext.srna) + if (ksi && ksi->ext.srna) { rna_KeyingSetInfo_unregister(bmain, ksi->ext.srna); - + } + /* create a new KeyingSetInfo type */ ksi = MEM_callocN(sizeof(KeyingSetInfo), "python keying set info"); memcpy(ksi, &dummyksi, sizeof(KeyingSetInfo)); @@ -515,7 +519,7 @@ static void rna_KeyingSet_paths_clear(KeyingSet *keyingset, ReportList *reports) /* needs wrapper function to push notifier */ static NlaTrack *rna_NlaTrack_new(AnimData *adt, bContext *C, NlaTrack *track) { - NlaTrack *new_track = add_nlatrack(adt, track); + NlaTrack *new_track = BKE_nlatrack_add(adt, track); WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_ADDED, NULL); @@ -531,7 +535,7 @@ static void rna_NlaTrack_remove(AnimData *adt, bContext *C, ReportList *reports, return; } - free_nlatrack(&adt->nla_tracks, track); + BKE_nlatrack_free(&adt->nla_tracks, track); RNA_POINTER_INVALIDATE(track_ptr); WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_REMOVED, NULL); @@ -671,7 +675,7 @@ static void rna_def_keyingset_info(BlenderRNA *brna) /* Regarding why we don't use rna_def_common_keying_flags() here: * - Using it would keep this case in sync with the other places - * where these options are exposed (which are optimised for being + * where these options are exposed (which are optimized for being * used in the UI). * - Unlike all the other places, this case is used for defining * new "built in" Keying Sets via the Python API. In that case, @@ -742,6 +746,7 @@ static void rna_def_keyingset_path(BlenderRNA *brna) RNA_def_property_enum_default(prop, ID_OB); RNA_def_property_enum_funcs(prop, NULL, "rna_ksPath_id_type_set", NULL); RNA_def_property_ui_text(prop, "ID Type", "Type of ID-block that can be used"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_ID); RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* XXX: maybe a bit too noisy */ /* Group */ |