<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Outputting as a EXR through python. in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/outputting-as-a-exr-through-python/m-p/12861950#M877</link>
    <description>&lt;P&gt;I want to output a file as a exr through the render settings for VRay. I have some code but I either get errors or it doesn't actually output anything once rendering. If you're able to help figure out why or how to properly set it up that would be great thank you!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;    options = QFileDialog.Options()
    options |= QFileDialog.DontUseNativeDialog  # Optional: Use this if you don't want the native dialog

    file_dialog = QFileDialog()
    file_dialog.setWindowTitle("Choose save location")
    file_dialog.setAcceptMode(QFileDialog.AcceptSave)
    file_dialog.setNameFilter("EXR files (*.exr)")
    file_dialog.setDefaultSuffix("exr")
    file_location, _ = file_dialog.getSaveFileName(options=options)
    
    if file_location:
        if not file_location.endswith(".exr"):
            file_location += ".exr"
        print("Selected file location: ", file_location)

        rt = pymxs.runtime
        
        # Ensure we are using V-Ray renderer
        if rt.classof(rt.renderers.current) != rt.VRay:
            rt.renderers.current = rt.VRay()
        
        # Set the render output file
        rt.renderers.current.output_on = True
        rt.renderers.current.output_file = file_location
        rt.renderers.current.output_rawFileName = file_location

        # Configure EXR settings using setOption method
        rt.renderers.current.output_saveRawFile = True
        rt.renderers.current.output_rawFileType = 1  # EXR
        rt.renderers.current.output_exr_compression = 3  # ZIPS compression
        rt.renderers.current.output_exr_bitsPerChannel = 16  # 16-bit EXR
        rt.renderers.current.output_exr_autoDataWindow = True
        rt.renderers.current.output_exr_applyColorMapping = True

        # Print settings to verify (for debugging purposes)
        print("Output File:", rt.renderers.current.output_rawFileName)
        print("EXR Compression:", rt.renderers.current.output_exr_compression)
        print("EXR Bits per Channel:", rt.renderers.current.output_exr_bitsPerChannel)

        # Initiate the render process
        rt.renderScene()
    else:
        print("No file selected")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Jul 2024 09:39:33 GMT</pubDate>
    <dc:creator>joe_jobson</dc:creator>
    <dc:date>2024-07-02T09:39:33Z</dc:date>
    <item>
      <title>Outputting as a EXR through python.</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/outputting-as-a-exr-through-python/m-p/12861950#M877</link>
      <description>&lt;P&gt;I want to output a file as a exr through the render settings for VRay. I have some code but I either get errors or it doesn't actually output anything once rendering. If you're able to help figure out why or how to properly set it up that would be great thank you!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;    options = QFileDialog.Options()
    options |= QFileDialog.DontUseNativeDialog  # Optional: Use this if you don't want the native dialog

    file_dialog = QFileDialog()
    file_dialog.setWindowTitle("Choose save location")
    file_dialog.setAcceptMode(QFileDialog.AcceptSave)
    file_dialog.setNameFilter("EXR files (*.exr)")
    file_dialog.setDefaultSuffix("exr")
    file_location, _ = file_dialog.getSaveFileName(options=options)
    
    if file_location:
        if not file_location.endswith(".exr"):
            file_location += ".exr"
        print("Selected file location: ", file_location)

        rt = pymxs.runtime
        
        # Ensure we are using V-Ray renderer
        if rt.classof(rt.renderers.current) != rt.VRay:
            rt.renderers.current = rt.VRay()
        
        # Set the render output file
        rt.renderers.current.output_on = True
        rt.renderers.current.output_file = file_location
        rt.renderers.current.output_rawFileName = file_location

        # Configure EXR settings using setOption method
        rt.renderers.current.output_saveRawFile = True
        rt.renderers.current.output_rawFileType = 1  # EXR
        rt.renderers.current.output_exr_compression = 3  # ZIPS compression
        rt.renderers.current.output_exr_bitsPerChannel = 16  # 16-bit EXR
        rt.renderers.current.output_exr_autoDataWindow = True
        rt.renderers.current.output_exr_applyColorMapping = True

        # Print settings to verify (for debugging purposes)
        print("Output File:", rt.renderers.current.output_rawFileName)
        print("EXR Compression:", rt.renderers.current.output_exr_compression)
        print("EXR Bits per Channel:", rt.renderers.current.output_exr_bitsPerChannel)

        # Initiate the render process
        rt.renderScene()
    else:
        print("No file selected")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 09:39:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/outputting-as-a-exr-through-python/m-p/12861950#M877</guid>
      <dc:creator>joe_jobson</dc:creator>
      <dc:date>2024-07-02T09:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting as a EXR through python.</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/outputting-as-a-exr-through-python/m-p/12862065#M878</link>
      <description>&lt;P&gt;And what is the request? Sympathy?&amp;nbsp;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 10:13:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/outputting-as-a-exr-through-python/m-p/12862065#M878</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2024-06-26T10:13:21Z</dc:date>
    </item>
  </channel>
</rss>

