Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2010-03-11 20:18:06 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2010-03-11 20:18:06 +0300
commitd82e88d26521cdd8fa30c73ea3d3634721d971bd (patch)
treee11a6f352927cc15e08744288e980694769a2079 /source/blender/makesrna
parentbb3168afbe54e282873cd72d84bd16ee9ecb6d22 (diff)
rna/py api function for removing ID blocks, id.unused_clear()
(revision 27409 from render25 branch)
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_ID.c9
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.");