Portrait to Landscape (Resolution Preset)

14 views
Skip to first unread message

Macbeth R.

unread,
Aug 21, 2015, 8:42:26 AM8/21/15
to Python Programming for Autodesk Maya
I'm trying to make a portrait resolution preset via python, but for some reason if a execute this little script line by line it works,
but if I try to execute all as a script, the last line, the one that changes pixel aspect, doesn't work, is not being changed to 1.

cmds.setAttr("defaultResolution.aspectLock", 0)
cmds.setAttr("defaultResolution.width", 720)
cmds.setAttr("defaultResolution.height", 1280)
cmds.setAttr("defaultResolution.aspectLock", 1)
cmds.setAttr("defaultResolution.pixelAspect", 1)

I already try without luck:
- time.sleep(1), wait one second between commands.
- cmds.evalDeferred()
maya.utils.executeDeferred()
- put it inside a function

Any ideas why this could happen?? or workarounds for this?

Thanks!
Reply all
Reply to author
Forward
0 new messages