Notifications
Clear all

[Closed] Optimize/Clean CAD scene hierarchy

Hi there,

I’m trying to clean some imported CAD data (*.3ds) and my script does make strange things. The problem is, the scene hierarchy is represented as dummy objects with linked objects but this is not as comfortable as grouped objects.

I tried lots of things and ended up with this:

function groupHierarchy=
	(
		local oldHelpers = #()
		for o in helpers where o.children.count > 0 do
		(
			group o.children name:o.name
			o.parent = undefined
			append oldHelpers o
		)
		-- I got unknown system exceptions when deleting the dummy directly...
		for h in oldHelpers where h.children.count == 0 do delete h
		free oldHelpers
	)

Anyone having a better solution?
The hierarchy should stay intact but the objects should be grouped together instead of linked to a parent dummy. The group should be named like the dummy and the dummy should get deleted as there is no need for it anymore. One problem is that some dummies are linked to dummies as well…

Thanks in advance!