[Durian-svn] [2906] Tiny script by Cam that's actually quite usefull in cleanup!
dolf
institute at blender.org
Wed May 5 14:24:29 CEST 2010
Revision: 2906
https://blenderinstitute.dyndns.org/durian-svn/?do=log&project=durian&path=/&rev=2906
Author: dolf
Date: 2010-05-05 14:24:29 +0200 (Wed, 05 May 2010)
Log Message:
-----------
Tiny script by Cam that's actually quite usefull in cleanup!
Added Paths:
-----------
pro/scripts/utilities/removeUnusedGroups.py
Added: pro/scripts/utilities/removeUnusedGroups.py
===================================================================
--- pro/scripts/utilities/removeUnusedGroups.py (rev 0)
+++ pro/scripts/utilities/removeUnusedGroups.py 2010-05-05 12:24:29 UTC (rev 2906)
@@ -0,0 +1,39 @@
+'''
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *
+ * Contributor(s): Campbell (and Dolf added the header)
+ *
+ * ***** END GPL LICENSE BLOCK *****
+'''
+
+# This script removes the groups that aren't in use from a blender file (uncomment the user_clear line)
+
+for b in bpy.data.groups: b.tag = False
+for b in bpy.data.groups:
+ if b.library == None:
+ for o in bpy.data.objects:
+ if o.dupli_group == b:
+ b.tag = True
+for b in bpy.data.groups:
+ if b.library is None:
+ if b.tag==False:
+ print(b)
+ # b.user_clear()
+ else:
+ print("USING:", b)
+
More information about the Durian-svn
mailing list