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!