[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [27418] trunk/blender/source/blender/ makesrna/intern/rna_ID.c: rna/py api function for removing ID blocks, id. unused_clear()
Brecht Van Lommel
brecht at blender.org
Thu Mar 11 18:18:07 CET 2010
Revision: 27418
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27418
Author: blendix
Date: 2010-03-11 18:18:06 +0100 (Thu, 11 Mar 2010)
Log Message:
-----------
rna/py api function for removing ID blocks, id.unused_clear()
(revision 27409 from render25 branch)
Revision Links:
--------------
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27409
Modified Paths:
--------------
trunk/blender/source/blender/makesrna/intern/rna_ID.c
Modified: trunk/blender/source/blender/makesrna/intern/rna_ID.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_ID.c 2010-03-11 17:16:03 UTC (rev 27417)
+++ trunk/blender/source/blender/makesrna/intern/rna_ID.c 2010-03-11 17:18:06 UTC (rev 27418)
@@ -246,6 +246,12 @@
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 @@
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.");
More information about the Bf-blender-cvs
mailing list