SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Home / forum / Animation / Mel Scripts & Programming / query render globals?
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 13-07-2004, 06:32 PM   #1
Dann
Registered User
 
Dann's Avatar
 
Join Date: Feb 2003
Location: Los Angeles
Posts: 695
Thanks: 0
Thanked 2 Times in 2 Posts
Default query render globals?

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

Thanks.
Dann is offline   Reply With Quote
Old 13-07-2004, 07:34 PM   #2
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

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
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
Old 14-07-2004, 01:14 AM   #3
dannyngan
Registered User
 
dannyngan's Avatar
 
Join Date: Dec 2002
Location: Seattle, WA
Posts: 1,154
Thanks: 0
Thanked 1 Time in 1 Post
Default

(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.
__________________
Danny Ngan
Animator | Amaze Entertainment
my website | my blog | my job
dannyngan is offline   Reply With Quote
Old 14-07-2004, 02:14 AM   #4
Dann
Registered User
 
Dann's Avatar
 
Join Date: Feb 2003
Location: Los Angeles
Posts: 695
Thanks: 0
Thanked 2 Times in 2 Posts
Default

That looks like it's just what I'm looking for. Thanks Danny.
Dann is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch Rending Render Layers Ozgalis Lighting & Rendering 7 07-01-2011 06:04 PM

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.