Announcement

Collapse
No announcement yet.

proxy memory footprint: copy vs instance

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

  • proxy memory footprint: copy vs instance

    it's been mentioned a few times on the forum that instancing is the appropriate method for duplicating vray proxies, but i wonder: does "copying" a proxy instead of instancing actually create another version of the proxy in memory at any point when rendering, or otherwise affect performance?

    i ask because it's not uncommon to have a bunch of instanced proxies, then have a few of them split out into a separate file, and then merged back in for whatever reason. the instance link is broken, but the proxies are still referencing the same .vrmesh. having to re-instance these objects would be time consuming.

    i would've thought it wouldn't matter since vray would be directed to the same mesh no matter what, but i couldn't find any posts that said anything other than "always instance."

    anyone?

    thanks,
    greg

  • #2
    If they are not instanced, the same information will be loaded twice and take twice the RAM.

    It is possible to write a script to replace proxies pointing to the same .vrmesh files with instances though - I know I wrote this once, but I have to find it.

    Best regards,
    Vlado
    I only act like I know everything, Rogers.

    Comment


    • #3
      so presumably this is the same for Xref files as well?
      i.e. - two (or more) proxies, all in different Xref scenes, but all pointing to the same proxy file - these can't be instances so the same proxy will be loaded twice and take up twice the memory?

      A script to re-instanciate would certainly help in optimising scenes - this would be very welcome....

      Comment


      • #4
        *bump*
        sorry to bump this, but just wondering if this is indeed correct? If so that script mentioned would be a welcome tool for optimising scenes just before final renders - I'm sure it's not that hard to write, but I have absolutely no experience in max script myself...

        Comment


        • #5
          yep it's an easy one - what you do is decide which object you want to bet the master one - lets say it's called proxy_01 in your scene for example. You select all the objects you want to be an instance of proxy_01 and in your listener you type:

          $.baseobject = $proxy_01

          And hit return - done. What it'll do is swap one object with another and instance them - it'll keep the scale, position and rotation of the original. You can use this to quickly replace one object with another too but if there's differences in size in the two original objects at 100% scale you'll get a change in sizes. For example if you've got a hedgerow or a forest and you swap one bush or tree for another, you may get gaps or overlaps if one tree is bigger or smaller than another when swapped. Thankfully every tree will be affected the same way so select em all and do a local pivot scale to adjust.

          Comment


          • #6
            Here is my original script; save it somewhere and choose MAXScript > Run. Then you will get a new MacroScript called "VRayProxy instance" that you can drag to a toolbar.

            When you execute the script, it will find all proxies that reference the same .vrmesh file and will make them instances.

            Best regards,
            Vlado
            Attached Files
            I only act like I know everything, Rogers.

            Comment


            • #7
              Gods sake Vlado - I sweated over my script for ages

              Comment


              • #8
                Thank you, this just saved me a day of work on a massive scene i am working on right now.
                The instancing of the trees was broken because i had to merge several times.
                The script worked flawless,
                memory usage is way down now.

                Thanks again, this is a really useful script.
                Reflect, repent and reboot.
                Order shall return.

                Comment


                • #9
                  thank you so much Vlado.
                  This is hugely appreciated, as always.

                  Many thanks.

                  Comment


                  • #10
                    The soulburn scripts have a script that does this as well.

                    Regards,
                    Mike
                    http://mikebracken.cgsociety.org/gallery/

                    Comment


                    • #11
                      Originally posted by mmikee View Post
                      The soulburn scripts have a script that does this as well.

                      Regards,
                      Mike
                      Hmm, the script I wrote specifically compares the file names of the V-Ray proxy objects, I doubt Neil's scripts do that.

                      Best regards,
                      Vlado
                      I only act like I know everything, Rogers.

                      Comment


                      • #12
                        Originally posted by vlado View Post
                        Here is my original script...
                        Your pretty good at that scripting thing, maybe you should do it professionally. Thanks as always.
                        www.dpict3d.com - "That's a very nice rendering, Dave. I think you've improved a great deal." - HAL9000... At least I have one fan.

                        Comment


                        • #13
                          Sorry, I just meant that it can replace a bunch of proxies with an instance of the same.


                          Regards,
                          Mike
                          http://mikebracken.cgsociety.org/gallery/

                          Comment


                          • #14
                            this may be a bit off topic, but if i have a lot of instanced proxies and a variety of materials applied to them, will it still only load the proxy once into memory for all of them?.

                            I have a repeated house model that varies only with regard to the materials so am wondering if it is worth creating an instanced proxy for it

                            Comment


                            • #15
                              Yep, it will only load it once; materials don't matter.

                              Best regards,
                              Vlado
                              I only act like I know everything, Rogers.

                              Comment

                              Working...
                              X