PDA

View Full Version : set pixel Aspect ratio?


dandruff
09-22-2009, 06:39 AM
In a script I'm making I need to set the PixelAspect Ratio (defaultResolution.pixelAspect) to 1. When I do so in my code, maya automaticly changes the value back. I've tried to lock the attribute and to use "alteredValue" but that doesnt work either. However if I change the attribute after the script is done running, maya doesn't change it back. How chould I do to get it to stay as I set it?
Thanks in advance // Markus

dandruff
09-23-2009, 06:38 AM
Well, let me answer this post myself... You'll have to set the Device Aspect Ratio and then Maya sets 'par' for you. This is the code that did the trick (python);

width = 1024.0
height = 768.0
cmds.setAttr( 'defaultResolution.deviceAspectRatio', ( ( width ) / ( height ) ) )

CGTalk Moderation
09-23-2009, 06:38 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.