Delete Empty Layers

0 votes
Version: 
v1.0
Date Updated: 
01/05/2016
Author Name: 
Preeti Panchal

* Title: Delete Empty Layers

* Description:
-- Deletes Empty Layers

AttachmentSize
preetis_tools-deleteemptylayers.ms744 bytes

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jazznazz's picture

that worked beautifully!

that worked beautifully!

StormBrig's picture

Thanks. This is more clever

Thanks. This is more clever way for latest version of 3ds max and its "new" layer manager.

wobi's picture

This might be more up to date

fn delete_empty_layers =
(
	local counter = 0
 
	for id = LayerManager.count - 1 to 1 by -1 do
	(
		local layer = LayerManager.getLayer id
 
		local contains_nodes = LayerManager.doesLayerHierarchyContainNodes layer.name
 
		if not contains_nodes then
		(
			local deleted = LayerManager.deleteLayerByName layer.name
 
			if deleted then counter += 1
		)
	)
 
	return counter
)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.