max場景瘦身,加快場景的開啟速度(多種方法)

liunono921發表於2015-09-03



-------------垃圾回收-------------------

gc()


------------釋放給點陣圖的記憶體----------------

freeSceneBitmaps()


---------------清除撤消/重做緩衝區-----------------------

clearUndoBuffer()



disableSceneRedraw()
Max create mode


清十分確定場景是您所需場景後,再呼叫此函式

clearUndoBuffer()


disableSceneRedraw()
Max create mode


(
        t = trackviewnodes
        n = t[#Max_MotionClip_Manager]
        try(
                deleteTrackViewController t n.controller
        )catch(getcurrentException())
)


--清除TrackViewNodes
try(
        --numNoteTracks trackviewnodes[#max_motionClip_manager]
        while (numNoteTRacks TrackViewNodes.Max_MotionClip_Manager > 0) do
                (
                        deleteNoteTrack TrackViewNodes.Max_MotionClip_Manager (getNoteTrack TrackViewNodes.Max_MotionClip_Manager 1)
                )
)catch(getcurrentException())


--清除Collisions
reactor.clearStoredCollisions()


unhide objects
gc()


enableSceneRedraw()



completeRedraw()



for i = 1 to theMixer.numMaxMixers() do
(
theMixer.removeMaxMixer 1 false 1


)



for i in sme.GetNumViews() to 1 by -1 do
                (
                        sme.DeleteView i false
                )


sme.CreateView "View1"






for j in SchematicViews.numViews() to 1 by -1 do
                (
                SchematicViews.delete j
         )




fn deleteAllNoteTracks = 
(
        if DefNoteTrack == undefined do (notetrack "").classid
        for nt in (getClassInstances DefNoteTrack asTrackViewPick:on) do
        (
                while (numNoteTracks nt.client) > 0 do deleteNoteTrack nt.client (getNoteTrack nt.client 1)
        )
)



(t=trackviewnodes;n=t[#Max_MotionClip_Manager];deleteTrackViewController t n.controller)




 trackIndex = 1
 m = trackViewNodes[trackIndex]
 disableSceneRedraw()
 undo off
 (
         while (m != undefined) do
         (
                 ct = numNoteTracks m
                 id = ct
                 for i = 1 to ct do
                 (
                         tr = getNoteTrack m id
                         deleteNoteTrack m tr
                         id = id - 1
                         ith = mod i 200
                 )
                 trackIndex = trackIndex + 1
                 m = trackViewNodes[trackIndex]
         )
 )
 enableSceneRedraw()
 messagebox "Done!"

clearUndoBuffer()
disableSceneRedraw()
Max create mode
清除撤消/重做緩衝區。十分確定場景是您所需場景後,再呼叫此函式

相關文章