Announcement

Collapse
No announcement yet.

Changing Render Aspect Ratio by script doesn't change viewport aspect ratio

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

  • Changing Render Aspect Ratio by script doesn't change viewport aspect ratio

    I'm writing a python script and I'm trying to work out how to make the viewport update as when I set the attribute with Python for "vraySettings.width" it doesn't change the viewport frame. If I change it in the VRay Render Settings UI it changes the viewport aspect ratio.... any ideas?
    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.

  • #2
    Found out how... you need to set the defaultResolution values too.

    cmds.setAttr("defaultResolution.width", newWidth)
    cmds.setAttr("defaultResolution.height", newHeight)
    cmds.setAttr("defaultResolution.deviceAspectRatio" , (newWidth / newHeight)
    cmds.setAttr("defaultResolution.lockDeviceAspectRa tio", 0)
    cmds.setAttr("defaultResolution.pixelAspect", 1.0)
    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


    • #3
      We automatically do this when stuff is changed in the UI (we transfer to the defaultResolution node) but it might not work for script accessing those values in the vraySettings.
      Alex Yolov
      Product Manager
      V-Ray for Maya, Chaos Player
      www.chaos.com

      Comment


      • #4
        Yeah I ripped apart the template files for VRay and found out what VRay was doing under the hood
        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

        Working...
        X