Announcement

Collapse
No announcement yet.

scripting output path, filename and extention - How?

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

  • scripting output path, filename and extention - How?

    The new "State sets" don't record the file name or path - but I can see that I can use scripting to define it.
    does anyone know how to create the script, btw. I hoped the macro-recorder would show me the code, when
    I defined the path and filename the usual way, but it don't...

    I found a list on Scriptspot with Vray code, but Im not sure how to use it.
    http://www.scriptspot.com/forums/3ds...ender-settings

    Regards
    Erik

  • #2
    something like this?

    Code:
    vr = renderers.current
    
    outPath = "f://temp/"
    outFile = "output"
    extension = "exr"
    
    vr.output_splitfilename = outPath + outFile + "." + extension
    www.hofer-krol.de
    Visualization | Animation | Compositing

    Comment


    • #3
      Hi Henning,

      I'm not at the office right now, so I can't test.
      but if it works, it will solve my batch render problems with vray.

      Thanks

      Comment


      • #4
        Hi Henning
        I have testet the script and I get an image I/O error - when it trys to save
        tried with exr and jpg

        Regards
        Erik


        vr = renderers.current

        outPath = "D:\Priess_plate_plekter\render\final\test\tes t01"
        outFile = "test01"
        extension = "jpg"

        vr.output_splitfilename = outPath + outFile + "." + extension

        Comment


        • #5
          does the folder actually exist? Is it a spelling mistake in "tes t01"?

          Comment


          • #6
            No it was not a spelling mistake, I got i working with some of the stats sets but not all of them?
            It's strange since I used the same code...

            Erik

            Comment


            • #7
              What Version of 3dsmax are you using? You've got to beware of escape characters and know how to handle them, also I think you're missing a /. Added an extra line of code to make sure the output path is created too.

              Search for "String Literals" in the 3dsmax maxscript help for more info.

              Max 2008 +
              vr = renderers.current

              outPath = @"D:\Priess_plate_plekter\render\final\test\test01 \"
              makedir outPath all:true
              outFile = "test01"
              extension = "jpg"

              vr.output_splitfilename = outPath + outFile + "." + extension
              Max 9
              vr = renderers.current

              outPath = "D:\\Priess_plate_plekter\\render\\final\\test\\te st01\\"
              makedir outPath all:true
              outFile = "test01"
              extension = "jpg"

              vr.output_splitfilename = outPath + outFile + "." + extension
              Maxscript made easy....
              davewortley.wordpress.com
              Follow me here:
              facebook.com/MaxMadeEasy

              If you don't MaxScript, then have a look at my blog and learn how easy and powerful it can be.

              Comment


              • #8
                The problem lies somewhere else... 3dsMax Bitmap Object.
                When you start up max with an empty scene, assign Vray and run
                Code:
                rend  = renderers.current
                rend.output_on = true
                rend.output_splitgbuffer = true
                rend.output_splitfilename = "e:\\test.exr"
                it won't work.

                Now open up the render dialog, go to the Split Render Channels - path is in there and everything looks fine, but no file is saved.
                Open the file save dialog, and just confirm what's in there already
                Render again - bitmap saved!

                Reason seems to be, that for whatever reason no max bitmap object has been created for the Vray Framebuffer as long as the file save dialog is not opened and confirmed. Annoying as hell, and pretty dangerous in production if you rely on scripts for the split gbuffers output.
                But - here's a hacky workaround:
                Code:
                rend  = renderers.current
                rend.output_on = true
                rend.output_splitgbuffer = true
                mybitmap = bitmap 10 10 color:black filename:"e:\\test.jpg"
                save mybitmap
                rend.output_splitbitmap =  mybitmap
                rend.output_splitfilename = "e:\\test.exr"
                What it does is to create a little 10x10 black jpeg to then "convince" vray that there's a bitmap object already. VoilĂ , saving works without any need to open or edit anything.
                Would be glad though if there was another more elegant way to do it, so any help appreciated.

                Make sure to edit the pathes according to your needs, that's just rough code not to be meant to be used in production

                Best regards,
                Michael
                Last edited by Sushidelic; 07-03-2012, 03:46 AM. Reason: typo...
                This signature is only a temporary solution

                Comment


                • #9
                  Just found another two old threads mentioning the problem above

                  http://www.chaosgroup.com/forums/vbu...-maxscript-Bug
                  http://www.chaosgroup.com/forums/vbu...-via-maxscript Post #2 and #12
                  This signature is only a temporary solution

                  Comment

                  Working...
                  X