How to delete all Helpers with no Children?

Could anyone please help me delete all Point Helper objects in the scene that have no linked objects (Children)? Your assistance would be greatly appreciated. Thank you!

Comments

Comment viewing options

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

weird! now is working!

weird! now is working! )))
thanks once again

harumscarum's picture

Thank you! Unfortunately, I

Thank you! Unfortunately, I couldn't make it work. When I run the script, nothing happens. I made some edits by removing the portion 'and (h.children).count == 0' because in this case, all helpers are moving to HLP layers, not just the empty ones.
Appreciate your efforts!

harumscarum's picture

I would also appreciate help

I would also appreciate help with the MaxScript command to move all Helper objects to the 'HLP' layer. Thank you!

miauu's picture

.

For the Point helpers only:

(
	hlpLayer = layerManager.getLayerFromName "HLP"
	if hlpLayer == undefined do hlpLayer = layerManager.newLayerFromName "HLP"
	for h in helpers where (classof h == Point) and (h.children).count == 0 do hlpLayer.addNode h	
)

For all helpers:

(
	hlpLayer = layerManager.getLayerFromName "HLP"
	if hlpLayer == undefined do hlpLayer = layerManager.newLayerFromName "HLP"
	for h in helpers where (h.children).count == 0 do hlpLayer.addNode h	
)
harumscarum's picture

works like a charm - thank

works like a charm - thank you!

harumscarum's picture

Thanks

unfortunately nothing is happens with the Helper object once I run script

miauu's picture

.

delete (for h in helpers where (classof h == Point) and (h.children).count == 0 collect h)
jahman's picture

.

try this

delete (for h in helpers where (classof h == Point) and (h.children == undefined) collect h)

Comment viewing options

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