Announcement

Collapse
No announcement yet.

an "empty/clean memory button" after render wish.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • an "empty/clean memory button" after render wish.

    When there is very huge scene with proxies, where you can't make 6 follow render without crash, and you must restart max and push the render button and don't sleep.
    I think that's a max problem but it only happen with Vray .
    =:-/
    Laurent

  • #2
    To get some sleep you can queue them up in backburner as separate jobs, that way Max will use less memory to render and flush the memory every job.
    Eric Boer
    Dev

    Comment


    • #3
      I use RErender's solution all the time but here's something that will help you as well.

      Type: gc() in that little box in the lower left-hand corner of your Max workspace. It will force max to dump a lot of the stuff in its memory.

      Note, however, that the command will also clear your undo history. When you issue the command the only thing that will happen is a number will come up in the box where you just typed. No prompt or anything else, but your memory usage will have gone down if it was possible to clear some of the stuff out.

      Comment


      • #4
        That gave me an idea:

        Code:
        callbacks.removeScripts  #postRenderFrame id:#86it
        callbacks.addScript #postRenderFrame "(gc())" id:#86it
        If you create a script out of these two lines and run it it will add a callback to run gc() after each frame. If you make a script with just the first line it will remove the callback. I tried it on a quick test scene and it seems to work but it is as is and without warranty.
        Eric Boer
        Dev

        Comment


        • #5
          Code:
          freescenebitmaps()
          gc()
          this sequence would make even more memory available in case you had many texturemaps called at rendertime.

          Code:
          gc light:true
          won't flush the undo buffers

          Re,

          Lele

          Comment


          • #6
            Thanks for the tips but It would be better with a single button
            =:-/
            Laurent

            Comment


            • #7
              easy as that:
              Code:
              macroScript cleanMemory 
              category: "MAX Script Tools" 
              buttonText: "CleanMem" 
              toolTip: "Frees up the memory Max uses without erasing the undo history. Prints amount of free memory (on the heap) in bytes to the listener"
              (
              freeSceneBitmaps()
              print (gc light:true)
              )
              save to a .mcr file
              put it to your max/ui/macroscripts directory
              restart max
              customize ui
              it will reside under the category "MAX Script Tools"
              pull onto a toolbar of your choice

              cu, mike
              ps: feel free to modify the button name, category or tooltip as you like

              Comment


              • #8
                Hey thanks a lot mike!
                =:-/
                Laurent

                Comment


                • #9
                  well, you still don't sleep with that one, quess you don't have to be as awake though
                  Eric Boer
                  Dev

                  Comment


                  • #10
                    Also, freeing scene bitmaps does not make much sense since they will just need to loaded again to render.
                    Eric Boer
                    Dev

                    Comment


                    • #11
                      makes sense if you are currently working on a scene with tons of objects with displayed textures
                      seems max reserves memory for every single texture per object rather than once per texture
                      and the memory doesnt get freed up unless you use freeSceneBitmaps()

                      other than that you are right

                      Comment


                      • #12
                        right, but the point of the thread was to get Priad some sleep.
                        Eric Boer
                        Dev

                        Comment


                        • #13
                          Also, freeing scene bitmaps does not make much sense since they will just need to loaded again to render.
                          If you load in a bunch of HDRs into environment then keep swapping, you'll quickly want to free up those unused bitmaps... It came in very handy when making my HDR DVD.
                          LunarStudio Architectural Renderings
                          HDRSource HDR & sIBL Libraries
                          Lunarlog - LunarStudio and HDRSource Blog

                          Comment


                          • #14
                            cant you make a script with a render button that says..render scene using scenes render settings, on render end run script "cleanup.mcr

                            ---------------------------------------------------
                            MSN addresses are not for newbies or warez users to contact the pros and bug them with
                            stupid questions the forum can answer.

                            Comment


                            • #15
                              right, see above
                              Eric Boer
                              Dev

                              Comment

                              Working...
                              X