Resolution Gate not updating with RenderGlobal change


#1

I have created a new window, modelPanel and camera and hooked it all up and turned on the Resolution Gate…
I also have 4 radio buttons that change the width and height of the resolution (they work fine, I can see the values changing in the render settings window)…
But the Gate is not updating… In fact, even manually changing the render dimensions is not updating the gate in this new window. It always seem stuck to whatever resolution was set at the time the window was created… I cant see why it wouldn’t update…

This is happening at the beginning:

#======= Set up the Camera View port ==========
        if mc.window("TKdumWin", exists = True):
            mc.deleteUI("TKdumWin")
            mc.windowPref ("TKdumWin", remove=True) 
        TKViewfinder = mc.window("TKdumWin",t="TonKamera View Finder", w=1100, h=800, s=True)
        form = mc.formLayout()
        TK_editor = mc.modelEditor()
        column = mc.columnLayout('true')

        #    Set up the window layout attachments.
        mc.formLayout( form, edit=True, attachForm=[(column, 'top', 20), (column, 'left', 20), (TK_editor, 'top', 20), (TK_editor, 'bottom', 20), (TK_editor, 'right', 20)], attachNone=[(column, 'bottom'), (column, 'right')], attachControl=(TK_editor, 'left', 0, column))
        #   Attach the camera to the model editor.
        mc.modelEditor( TK_editor, edit=True, camera=CameraName[0], displayAppearance="smoothShaded", activeOnly=False,allObjects=0)
        mc.modelEditor( TK_editor, edit=True, camera=CameraName[0], polymeshes=True)
        mc.setAttr("hardwareRenderingGlobals.ssaoEnable", 1)
        mc.setAttr("hardwareRenderingGlobals.lineAAEnable",1)
        mc.setAttr("hardwareRenderingGlobals.multiSampleEnable",1)
        #mc.setAttr("hardwareRenderingGlobals.motionBlurEnable",1)
        mc.showWindow( TKViewfinder )
        mc.setAttr(CameraName[0]+".displayResolution",1)
        mc.setAttr(CameraName[0]+".displayGateMaskOpacity", 1)
        mc.setAttr(CameraName[0]+".displayGateMaskColor", 0,0,0, type='double3' )
        
        #Disable Camera Selectin Menu
        mc.control(camMenuSelect, edit=True, en=False)

And this is my Function for updating the Render settings:

def changeRes():
    selectedAR = mc.radioCollection(AR_buttons, q=True, select=True)
    mc.select("defaultRenderGlobals", r=True)
    if selectedAR == "ar4:3" :
        mc.setAttr("defaultResolution.width", 800)
        mc.setAttr("defaultResolution.height", 600)
    elif selectedAR == "ar1p85:1":
        mc.setAttr("defaultResolution.width", 1998)
        mc.setAttr("defaultResolution.height" ,1080)
    elif selectedAR == "ar16:9":
        mc.setAttr("defaultResolution.width", 1920)
        mc.setAttr("defaultResolution.height", 1080)
    elif selectedAR == "ar2p39:1":
        mc.setAttr("defaultResolution.width", 2000)
        mc.setAttr("defaultResolution.height", 837)

If anyone has any ideas about why its not updating, I’d love to get some feedback


#2

Wow… This forum is great… every time I post a problem, I feel so stupid, that I double my efforts and keep looking, and I find the solution on my own… I love it!!

Anyway, the issue above was resolved by me figuring out that I had clicked “maintain device aspect ratio” by mistake… so it kept changing the Pixel aspect ration to main the the device aspect ratio, hence it looked like the Resolution gate was not updating… one click later, and my code works like a charm.

Regards,
The Village Idiot