Announcement

Collapse
No announcement yet.

Exporting multiple Multichannel Files with single render process

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

  • Exporting multiple Multichannel Files with single render process

    I think this is a potentially confusing title so I'll try and break it down with my use-case scenario.

    In some cases there are RenderElements that are not compatible with deep data etc.

    I think it would be useful to be able to process a frame, and then have it export multiple files at once.

    In this manner they could be grouped.. eg. Deep exr with 3 - 4 RenderElements, Non-Deep EXR with differing RE's etc.



  • #2
    You can add an OutputDeepWriter plugin with post-translate python. This way you can output one non-deep and one deep file with the same render. The non-deep file will contain all of your render elements, but the deep file will only contain the deep channels you have specified.

    For example, if you add two channels, say Diffuse and Lighting, and set "deep output = true" for Diffuse and false for Lighting, the non-deep file will contain both, while the deep file will only contain the Diffuse. There's currently no way around this.

    Here's the documentation about the post-translate python API: https://docs.chaosgroup.com/display/...ed+V-Ray+Scene.
    You can see the OutputDeepWriter plugin documentation either with plgparams.exe that's installed alongside V-Ray: https://docs.chaosgroup.com/display/...Nodefromplugin
    The usage is
    Code:
    plgparams -plugindir <vrayplugins_dir_location> OutputDeepWriter
    or you can use the PluginDoc htmls that are also unpacked with the V-Ray installation (<maya_install_location>/vray/PluginDoc/index.html)

    A simple post-translate python would look like this:
    Code:
    from vray.utils import *
    
    dw=create('OutputDeepWriter', 'vrayOutputDeepWriter')
    dw.set('file', 'C:/Users/yolov/Desktop/deeptests/deepWrite.exr')
    Of course, you can use maya.cmds or pymel.core to fetch your project/images directory or even use vray.utils to get the img_dir value from the SettingsOutput plugin and pass it to the deepWriter.

    Note - This will only work if your output is set to multichannel exr!
    Alex Yolov
    Product Manager
    V-Ray for Maya, Chaos Player
    www.chaos.com

    Comment


    • #3
      Wow! thankyou so much for this information. This is very helpful and will have an enormous impact on my studios Vray pipeline.

      Comment


      • #4
        Just wish to follow up on this re. the information provided.
        Im looking at how I can find the calculated file name and folder for output including frame number etc - that would apply to any pipeline. ie. the filename as it is being written from the vray output

        Based on doc and information provided so far I can get this ( without frame number ):

        Code:
        from vray.utils import *
        
        
        so=findByType("SettingsOutput")[0]
        
        so.set('img_file_needFrameNumber', 1)
        
        
        
        
        img_file = so.get("img_file")
        
        img_dir = so.get("img_dir")
        
        fn = img_dir + "/" + ".".join(img_file.split('.')[:-1]) + '.deep.exr'
        
        print fn
        
        
        
        
        dw=create('OutputDeepWriter', 'vrayOutputDeepWriter')
        
        dw.set('file', fn)
        for a renderLayer "Characters" it outputs 'Characters.deep.exr'; ignores frame number
        Last edited by monsteradurm; 05-09-2018, 06:10 PM.

        Comment


        • #5
          Running your script works fine for me even in animation from the non-master render layer.
          The frame number is automatically appended, you don't need to set it in any way.

          Can you get me a scene? You can delete all geometry and so on - I just need to look at the script, render settings and render layers.
          What Maya version is this?
          Alex Yolov
          Product Manager
          V-Ray for Maya, Chaos Player
          www.chaos.com

          Comment


          • #6
            I can confirm this is working now with an adjustment to the amount of '.' characters in the file

            if i use:
            Code:
            from vray.utils import *
            so=findByType("SettingsOutput")[0]
            img_file = so.get("img_file")
            img_dir = so.get("img_dir")
            fn = img_dir + ".".join(img_file.split('.')[:-1]) + '_Deep_.exr'
            dw=create('OutputDeepWriter', 'vrayOutputDeepWriter')
            dw.set('file', fn)
            It works fine. I was previously printing fn to stdout, which wasnt printing the file number component.
            I also found that if I had [file].deep.exr It would put the frame number at the first '.' characters location. Switching to underscores helped control where the frame number would be positioned in the string.

            Cheers!

            Comment


            • #7
              Ah, great then. Thanks for the update
              Alex Yolov
              Product Manager
              V-Ray for Maya, Chaos Player
              www.chaos.com

              Comment

              Working...
              X