Announcement

Collapse
No announcement yet.

pixel aspect ratio does not update when we do it through pymel

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

  • pixel aspect ratio does not update when we do it through pymel

    Hi.
    We are using a script to dispatch various render cameras to deadline from within a single file. As some cameras use different aspect ratios, we do need to set these prior to saving the respective files.
    However, we do run into the following problem: When we set the width and height of the output image manually from within the GUI, Maya automatically sets the correct device aspect ratio and everything renders fine. When we do it through pymel, however:
    Code:
    pc.setAttr( 'vraySettings.width', 2250 )
    pc.setAttr( 'vraySettings.height', 4096 )
    the device aspect remains unchanged from whatever it was set to, originally, causing the images from deadline to appear 'zoomed out', of course. We cannot seem to change the device aspect through pymel, so my question is: Does anyone have an idea how we could do this within our script? Is there a way to force update the device aspect ratio? Or can it be changed manually through pymel?
    Thanks in advance,
    J

  • #2
    I'm not too familiar with MEL script, however, this seems to work:
    Code:
    setAttr vraySettings.width 2250;
    setAttr vraySettings.height 4096;​
    Maybe you need to remove the comma.
    Aleksandar Hadzhiev | chaos.com
    Chaos Support Representative | contact us

    Comment


    • #3
      That is not the issue - the pymel code above works aswell.
      The issue is, that if we change the image resolution though a the script as per above, the device aspect ratio does NOT get updated, so you get a totally different image (appears to be zoomed out a lot when you switch from landscape to portrait, where the aspect ratio SHOULD be a fraction of 1). Does that make sense? I could set up an example scene and send that with a simple script if that helps?
      Last edited by k_18; 19-06-2023, 07:04 AM.

      Comment


      • #4
        I see. It seems the pixel aspect ratio gets unlocked. Try adding this line as well:
        Code:
        setAttr vraySettings.pxa 1
        It will keep the pixel aspect ratio at 1 and change the device aspect ratio instead.
        Last edited by hermit.crab; 20-06-2023, 01:46 AM.
        Aleksandar Hadzhiev | chaos.com
        Chaos Support Representative | contact us

        Comment


        • #5
          Thanks, Aleks, will try that now and report back

          Comment

          Working...
          X