Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Programming (https://simplymaya.com/forum/forumdisplay.php?f=32)
-   -   query render globals? (https://simplymaya.com/forum/showthread.php?t=12591)

Dann 13-07-2004 06:32 PM

query render globals?
 
How can I query the render globals? I need to access the resolution and aspect ration.

Thanks.

kbrown 13-07-2004 07:34 PM

That's a bit tricky one. First you need to find out what renderer is set to be used and then you need to find out from where those settings are coming. They've really mixed this up when they introduced the new render global system with the common and renderer specific settings... So honestly I don't know :)

dannyngan 14-07-2004 01:14 AM

(NOTE: I'm going to type out all the commands for the sake of anyone relatively new to MEL.)

You'll want to look at the scene node called "defaultResolution". You can verify its existence with this command:

Code:

ls -renderResolutions;
You can get a list of all attributes connected to that node via the "listAttr" command:

Code:

listAttr defaultResolution;
The list of attributes for defaultResolution includes entries for width, height, and deviceAspectRatio. To query those attributes:

Code:

getAttr defaultResolution.width;
getAttr defaultResolution.height;
getAttr defaultResolution.deviceAspectRatio;

Of course you can assign those values to variables as needed:

Code:

$width = `getAttr defaultResolution.width`;
$height = `getAttr defaultResolution.height`;

You may also want to check into the default nodes called "defaultRenderGlobals" and "defaultRenderQuality". They may contain additional rendering information that you may need.

Dann 14-07-2004 02:14 AM

That looks like it's just what I'm looking for. Thanks Danny.


All times are GMT. The time now is 03:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018