Skip to content

mmRenderer - Viewport Cycle with Hotkey #277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
arunmv91 opened this issue Apr 27, 2025 · 2 comments
Open

mmRenderer - Viewport Cycle with Hotkey #277

arunmv91 opened this issue Apr 27, 2025 · 2 comments
Labels
good first issue maya tool A user tool inside Maya. user interface Related to a User Interface (Maya or Qt)
Milestone

Comments

@arunmv91
Copy link

Could you add a feature that allows a single Shortcut key to cycle through Silhouette, Wireframe, and Shaded modes?

@david-cattermole david-cattermole changed the title Viewport Shortcut Request. mmRenderer - Viewport Cycle with Hotkey Apr 27, 2025
@david-cattermole
Copy link
Owner

Hi @arunmv91,

I can look at adding a tool that you can bind to a Maya hotkey(s), perhaps with a default set up.
What hotkey do you suggest is used as the default?

Here is the list of default keys:
https://david-cattermole.github.io/mayaMatchMoveSolver/tools_hotkeys.html#default-hotkeys

I'd expect such a feature would work with a cycling nature, so you'd be able to cycle between the specific renderers with specific modes, forwards or backwards in the list. Is this what you'd expect?

How are you expecting to use this tool? What workflow would you expect to use this in exactly?


I've looked at this briefly and I've found that the following code can be used to set a modelPanel to use Viewport 2.0;

global string $gViewport2;   
string $currentPanel = `getPanel -withFocus`;   
string $panelType = `getPanel -to $currentPanel`;  
if ($panelType ==  "modelPanel") {      
    setRendererInModelPanel $gViewport2 $currentPanel;  
} else if ($panelType ==  "scriptedPanel") { 	
    string $cmd = "setRendererInModelPanel $gViewport2 "; 
    scriptedPanelRunTimeCmd( $cmd, $currentPanel ); 
}

Here are some (MEL) commands that can be used to set a specific modelPanel to either of the Viewport 2.0 renders:

// Set 'modelPanel4' to use MM Silhouette Renderer.
setRendererAndOverrideInModelPanel $gViewport2 mmRendererSilhouette modelPanel4;

// Set 'modelPanel4' to use MM Standard Renderer.
setRendererAndOverrideInModelPanel $gViewport2 mmRendererStandard modelPanel4;

// Set 'modelPanel4' to use Viewport 2.0 Renderer.
setRendererAndOverrideInModelPanel $gViewport2 "" modelPanel4;

@david-cattermole david-cattermole added good first issue maya tool A user tool inside Maya. user interface Related to a User Interface (Maya or Qt) labels Apr 27, 2025
@david-cattermole david-cattermole added this to the v0.6.0 milestone Apr 27, 2025
@arunmv91
Copy link
Author

arunmv91 commented Apr 29, 2025

Hi @david-cattermole
Thanks for looking into it,

I would prefer using the ` (Grave Accent) key as the default hotkey — the one just to the left of the number 1 key.

And yes, exactly — cycling between the three modes (Silhouette, Wireframe, and Shaded )

This would be really useful for quickly switching modes while doing rotoanim work and during playblasts of different modes, helping to avoid multiple mouse clicks and speeding up the workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue maya tool A user tool inside Maya. user interface Related to a User Interface (Maya or Qt)
Projects
None yet
Development

No branches or pull requests

2 participants