ScriptSpot

Forum topic · Scripts Wanted

clean bloated max file

By hippiearchitect · 2014-04-11

Description

hi so after much research into the cause of files that are too large or take up too much memory i have found two scripts that do the heavy lifting for cleaning out a max file. i was hoping there was a way of combining them into one maxscript i can run from the tool bar. I don't know that much but i do know the following does not work:

please help

macroScript Clean
category:"Clean"
toolTip:"Clean"
buttonText:"Clean"
(
t=trackviewnodes;n=t[#Anim_Layer_Control_Manager];deleteTrackViewController t n.controller;gc()
t=trackviewnodes;n=t[#Max_MotionClip_Manager];deleteTrackViewController t n.controller;gc()
)

Comments (5)

@3dwannabI know this thread

RobH2 · 2019-04-12

@3dwannab

I know this thread is kind of old but a recent post at AreaMax led me here.

This is potentially a useful script. I did run it on a 98mb file in Max 2020 and it increased the file size to 324mb. I wonder if this script is incompatible with Max's newer code? Have you tried the script on a newer version of Max?

Edit: I tried the script on two other files and both grew in size about 3X. Just wanted to make sure it wasn't an anomaly with that one file.

hippiearchitect · 2014-04-11

i have, but these two scripts do more to clean my bloated files then that script does.

Use code below

3dwannab · 2014-12-06

macroScript Cleanup category:"3dwannab" buttontext:"Cleanup" tooltip:"Clean Motion Clips + Layer Controls resulting in smaller file sizes"
(
if querybox "Clean Motion Clips + Layer Controls by 3dwannab (◣_◢)\n\nAre you sure ?" title:"Cleanup by 3dwannab (◣_◢)" beep:true
	then
		(
		t=trackviewnodes
		n=t[#Max_MotionClip_Manager]
		if n!=undefined then deleteTrackViewController t n.controller
		gc()
		t=trackviewnodes
		n=t[#Anim_Layer_Control_Manager]
		if n!=undefined then deleteTrackViewController t n.controller
		gc()
		messagebox "Cleanup complete of:\nMax_MotionClip_Manager + Anim_Layer_Control_Manager nodes\n\nGoodbye...(◣_◢)" title:"Cleanup by 3dwannab (◣_◢)"  beep:true
	)
	else
	(
		-- DO NOTHING
	)
)

Or (Clean Motion Clips, Layer Controls + Retimer Managers)

3dwannab · 2019-01-14

macroScript Cleanup category:"3dwannab" buttontext:"Cleanup" tooltip:"Clean Motion Clips, Layer Controls + Retimer Managers resulting in smaller file sizes"
(
if querybox "Clean Motion Clips, Layer Controls + Retimer Managers by 3dwannab (◣_◢)\n\nAre you sure ?" title:"Cleanup by 3dwannab (◣_◢)" beep:true
	then
		(
		t=trackviewnodes
		n=t[#Max_MotionClip_Manager]
		if n!=undefined then deleteTrackViewController t n.controller
		gc()
		t=trackviewnodes
		n=t[#Anim_Layer_Control_Manager]
		if n!=undefined then deleteTrackViewController t n.controller
		gc()
		t=trackviewnodes
		n=t[#Retimer_Manager]
		if n!=undefined then deleteTrackViewController t n.controller
		gc()
		messagebox "Resave + reset max!!!!\n\nCleanup complete of:\n-------------------------------------------\nMax_MotionClip_Manager\nAnim_Layer_Control_Manager nodes\nRetimer_Managers\n-------------------------------------------\n\nGoodbye...(◣_◢)" title:"Cleanup by 3dwannab (◣_◢)"  beep:true
	)
	else
	(
		-- DO NOTHING
	)
)