diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-11-05 13:50:58 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-11-05 13:50:58 +0300 |
commit | cacd68c3359c74f5f2ab7bae304ffeb59ee6e9da (patch) | |
tree | 9b2ca3d2eea82189c8700889973f0f5dd7c59a3b /source/blender/makesrna/intern/rna_ID.c | |
parent | 06d5d53a240cf98aee52a45317ac2f979be7e58a (diff) |
python console autocomplete would crash (missing NULL check for pose channels)
add rna functions id.animation_data_create() and id.animation_data_clear() - works for all ID types that support animdata.
Diffstat (limited to 'source/blender/makesrna/intern/rna_ID.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_ID.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index bc5c99f0a1e..3de347cf80e 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -69,6 +69,7 @@ EnumPropertyItem id_type_items[] = { #include "BKE_idprop.h" #include "BKE_library.h" +#include "BKE_animsys.h" /* name functions that ignore the first two ID characters */ void rna_ID_name_get(PointerRNA *ptr, char *value) @@ -326,6 +327,15 @@ static void rna_def_ID(BlenderRNA *brna) RNA_def_function_ui_description(func, "Create a copy of this datablock (not supported for all datablocks)."); parm= RNA_def_pointer(func, "id", "ID", "", "New copy of the ID."); RNA_def_function_return(func, parm); + + func= RNA_def_function(srna, "animation_data_create", "BKE_id_add_animdata"); + RNA_def_function_ui_description(func, "Create animation data to this ID, note that not all ID types support this."); + parm= RNA_def_pointer(func, "anim_data", "AnimData", "", "New animation data or NULL."); + RNA_def_function_return(func, parm); + + func= RNA_def_function(srna, "animation_data_clear", "BKE_free_animdata"); + RNA_def_function_ui_description(func, "Clear animation on this this ID."); + } static void rna_def_library(BlenderRNA *brna) |