clean bloated max file

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

Comment viewing options

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

@3dwannabI know this thread

@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.

"Who is staring at the sea is already sailing a little."

barigazy's picture

...

Are you tried this tool
http://www.scriptspot.com/3ds-max/scripts/cleaner

bga

hippiearchitect's picture

i have, but these two scripts

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

3dwannab's picture

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

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
	)
)
3dwannab's picture

Use code below

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
	)
)

Comment viewing options

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