mayaMatchMoveSolver
mayaMatchMoveSolver copied to clipboard
mmRenderer - Viewport Cycle with Hotkey
Could you add a feature that allows a single Shortcut key to cycle through Silhouette, Wireframe, and Shaded modes?
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;
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.
Hey @arunmv91,
I've implemented a "Cycle Viewport Display Preset" tool, that can be run with the backtick () key to go forwards, and ALT+backtick () key to go backwards.
The three display presets are currently defined as:
Silhouette (with Hold-Outs)- Displays :Silhouette edges with hold-out geometry.Hidden-Line (with Hold-Outs)- Displays Hidden-Line (wireframe) edges with hold-out geometry.All Shaded- Displays all geometry as shaded, and disables hold-out rendering.
I'll release this in the next release, v0.5.6.
Let me know what you think of this.
Works perfect David, this is exactly what i was looking for.. Thank You..