diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-03-11 20:18:06 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-03-11 20:18:06 +0300 |
commit | d82e88d26521cdd8fa30c73ea3d3634721d971bd (patch) | |
tree | e11a6f352927cc15e08744288e980694769a2079 /source/blender/makesrna/intern/rna_ID.c | |
parent | bb3168afbe54e282873cd72d84bd16ee9ecb6d22 (diff) |
rna/py api function for removing ID blocks, id.unused_clear()
(revision 27409 from render25 branch)
Diffstat (limited to 'source/blender/makesrna/intern/rna_ID.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_ID.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index c47bd74b1fb..aa6414e854d 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -246,6 +246,12 @@ ID *rna_ID_copy(ID *id) return NULL; } +void rna_ID_user_clear(ID *id) +{ + id->us= 0; /* dont save */ + id->flag &= ~LIB_FAKEUSER; +} + #else static void rna_def_ID_properties(BlenderRNA *brna) @@ -372,6 +378,9 @@ static void rna_def_ID(BlenderRNA *brna) parm= RNA_def_pointer(func, "id", "ID", "", "New copy of the ID."); RNA_def_function_return(func, parm); + func= RNA_def_function(srna, "user_clear", "rna_ID_user_clear"); + RNA_def_function_ui_description(func, "Clears the user count of a datablock so its not saved, on reload the data will be removed."); + 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."); |