[new script] Merge active layers

hey all,

this is my first real useful script. For the current scene, it takes all the objects from the active layers, and import them in the first active layers. Not terribly fancy, but it was useful to me.


# ------------------------------------------------
# Merge Active Layers v0.1
# By: Olivier Saraja (olivS)
# Date: 04 february 2006
# License: GPL
# ------------------------------------------------
# Usage: this script will work only on the current
# scene. It will merge all the objects from the
# active layers into the first layer active
#
import Blender
from Blender import Scene, Object
print '==============='
print 'Start of the script'
scn = Scene.GetCurrent()
print 'Name of the scene: ', scn
children = scn.getChildren()
print 'List of objects from the scene: ', children
list_layers = scn.getLayers()
print 'List of active layers: ', list_layers
for ll in list_layers:
	first_layer = ll
	break
print 'Merging layer: ', first_layer
item=0
for obj in children:
	obj = children[item]
	for ln in obj.layers:
		for ll in list_layers:
			if (ln == ll):
				fusion = 1
				obj.layers = [first_layer]
				break
			else:
				fusion=0
	print obj, 'fusion = ', fusion
	item = item + 1
print 'End of script'

Hope someone will find some interest in it.

Cheers