PDA

View Full Version : Switching tabs in the Render Settings Window


LeeGriggs
09-24-2007, 08:31 AM
Hello, would anyone know how to switch between the Common and mental ray tabs in the Render Settings window via mel?

The script editor does not display any mel commands being used when switching between the two even with 'echo all commands' switched on. Does this mean it is not possible?

cheers,
lee

cpan
09-24-2007, 09:56 AM
not in front of maya now, but take a look at what command is invoked from the
Render with > mentalray and Render with > Maya Software menus.

Hoju
09-24-2007, 04:27 PM
currentRenderer();
//Returns the name of the current renderer.

setCurrentRenderer("mayaSoftware");
setCurrentRenderer("mentalRay");
These procedures are located in a script called supportRenderers.mel that ships with Maya.;)

GiantG
09-24-2007, 10:50 PM
This works as well:


getAttr defaultRenderGlobals.currentRenderer;

setAttr defaultRenderGlobals.currentRenderer -type "string" "mayaSoftware";
setAttr defaultRenderGlobals.currentRenderer -type "string" "mentalRay";
setAttr defaultRenderGlobals.currentRenderer -type "string" "mayaHardware";

LeeGriggs
09-25-2007, 02:51 PM
sorry, perhaps I did not make myself clear enough.

I dont want to switch between renderers, I want to switch between the tabs at the top of the Render Settings Window from 'Common' to 'Mental Ray' and vice versa.

cheers,
lee

GiantG
09-26-2007, 08:08 AM
Why do you want to switch the tabs?

You can set your default render as written above and then acces all you attributes via mel.

Example
setAttr "defaultRenderGlobals.imageFormat" 7;

will turn for every renderer the image format to IFF

or

setAttr "miDefaultOptions.caustics" 1;

is a mental ray only attribute that can be accessed directly when you set your renderer to mental ray

Maybe i don't get the point?!?


Greetz

LeeGriggs
09-26-2007, 09:01 AM
ok, I basically want to assign some mel to a keyboard shortcut that will display the Common tab in the render settings window. It would be nice if it toggled between the mental ray tab in the render settings window and the Common tab.

I cant think of any other way of explaining this :)

I could screengrab the Maya Render Settings window if that would help?

cheers,
lee

cpan
09-26-2007, 01:31 PM
unifiedRenderGlobalsWindow;
int $index = 2;


string $renderer = `currentRenderer`;
if (`isDisplayingAllRendererTabs`)
$renderer = "masterLayer";

string $tabLayout = `getRendererTabLayout $renderer`;
tabLayout -e -sti $index $tabLayout;


paste this on a shelf/hotkey and just change the $index variable
to display a different tab.

if you don't use render layers, $index = 1 means the common tab
and $index = 2 means the renderer tab.

if you use render layers the $index goes through all the tabs as it
increases.

LeeGriggs
09-26-2007, 04:54 PM
beautiful :thumbsup:

CGTalk Moderation
09-26-2007, 04:54 PM
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.