|
1 | 1 | Display Commands |
2 | 2 | ================ |
3 | 3 |
|
4 | | -*To be written.* |
| 4 | +Display commands control mmSolver's custom Viewport 2.0 renderers. |
| 5 | +Two renderers are provided — MM Standard Renderer and MM Silhouette |
| 6 | +Renderer — each registered as a Viewport 2.0 override and documented |
| 7 | +in detail in :ref:`Viewport Renderers <renderer-ref>`. |
5 | 8 |
|
6 | | -``mmRenderer`` Command |
7 | | -++++++++++++++++++++++ |
| 9 | +Each renderer exposes a thin Maya command that forces a refresh of the |
| 10 | +active 3D view. Settings for the Silhouette Renderer are stored on the |
| 11 | +``mmRenderGlobalsSilhouette`` node and adjusted via ``setAttr``. |
8 | 12 |
|
9 | | -The ``mmRenderer`` command is unfinished and is disabled in the C++ |
10 | | -build by default. |
| 13 | + |
| 14 | +``mmRendererStandard`` Command |
| 15 | +++++++++++++++++++++++++++++++ |
| 16 | + |
| 17 | +``mmRendererStandard`` triggers a forced refresh of the active Viewport |
| 18 | +2.0 panel when the MM Standard Renderer is active. It supports |
| 19 | +``-query`` mode (no flags beyond enabling query are defined). The |
| 20 | +command is not undoable. |
| 21 | + |
| 22 | +See :ref:`renderer-ref` for how to activate and use the MM Standard |
| 23 | +Renderer. |
| 24 | + |
| 25 | +Flags |
| 26 | +----- |
| 27 | + |
| 28 | +The command accepts ``-query`` mode only. No additional flags are |
| 29 | +defined; calling the command refreshes the active view. |
| 30 | + |
| 31 | +Return |
| 32 | +------ |
| 33 | + |
| 34 | +Returns nothing. |
| 35 | + |
| 36 | +Example |
| 37 | +------- |
| 38 | + |
| 39 | +Python Example: |
| 40 | + |
| 41 | +.. code:: python |
| 42 | +
|
| 43 | + import maya.cmds |
| 44 | +
|
| 45 | + # Force a refresh of the active view. |
| 46 | + maya.cmds.mmRendererStandard() |
| 47 | +
|
| 48 | +MEL Example: |
| 49 | + |
| 50 | +.. code:: text |
| 51 | +
|
| 52 | + mmRendererStandard; |
| 53 | +
|
| 54 | +
|
| 55 | +``mmRendererSilhouette`` Command |
| 56 | ++++++++++++++++++++++++++++++++++ |
| 57 | + |
| 58 | +``mmRendererSilhouette`` triggers a forced refresh of the active |
| 59 | +Viewport 2.0 panel when the MM Silhouette Renderer is active. It |
| 60 | +supports ``-query`` mode (no flags beyond enabling query are defined). |
| 61 | +The command is not undoable. |
| 62 | + |
| 63 | +The silhouette effect is configured through the |
| 64 | +``mmRenderGlobalsSilhouette`` node, which is created automatically when |
| 65 | +the renderer is first activated. Use ``setAttr`` to change the |
| 66 | +settings described below. |
| 67 | + |
| 68 | +See :ref:`renderer-silhouette-ref` for full usage instructions and a |
| 69 | +description of each setting. |
| 70 | + |
| 71 | +Flags |
| 72 | +----- |
| 73 | + |
| 74 | +The command accepts ``-query`` mode only. No additional flags are |
| 75 | +defined; calling the command refreshes the active view. |
| 76 | + |
| 77 | +``mmRenderGlobalsSilhouette`` Node Attributes |
| 78 | +--------------------------------------------- |
| 79 | + |
| 80 | +The silhouette settings live on the ``mmRenderGlobalsSilhouette`` node. |
| 81 | + |
| 82 | +======================== ========= =============== ========================================================= |
| 83 | +Attribute Type Default Description |
| 84 | +======================== ========= =============== ========================================================= |
| 85 | +``enable`` bool ``true`` Toggle the silhouette effect on or off. |
| 86 | +``overrideColor`` bool ``true`` Use the ``color`` attribute for all objects. |
| 87 | +``depthOffset`` float ``-1.0`` Depth separation between solid and wireframe geometry. |
| 88 | +``width`` float ``2.0`` Width of silhouette lines. |
| 89 | +``color`` float3 ``0, 1, 0`` Silhouette line colour (green by default). |
| 90 | +``alpha`` float ``1.0`` Opacity of silhouette lines. |
| 91 | +``cullFace`` enum ``Back`` Back-face culling; ``Back``, ``Front``, ``FrontAndBack``. |
| 92 | +``operationNum`` uint8 ``255`` (all) Limit rendering to the first N operations (debug). |
| 93 | +======================== ========= =============== ========================================================= |
| 94 | + |
| 95 | +Return |
| 96 | +------ |
| 97 | + |
| 98 | +Returns nothing. |
| 99 | + |
| 100 | +Example |
| 101 | +------- |
| 102 | + |
| 103 | +Python Example: |
| 104 | + |
| 105 | +.. code:: python |
| 106 | +
|
| 107 | + import maya.cmds |
| 108 | +
|
| 109 | + # Force a refresh of the active view. |
| 110 | + maya.cmds.mmRendererSilhouette() |
| 111 | +
|
| 112 | + # Change the silhouette colour to red. |
| 113 | + maya.cmds.setAttr('mmRenderGlobalsSilhouette.color', 1, 0, 0, type='double3') |
| 114 | +
|
| 115 | + # Increase line width. |
| 116 | + maya.cmds.setAttr('mmRenderGlobalsSilhouette.width', 3.0) |
| 117 | +
|
| 118 | + # Disable the effect temporarily. |
| 119 | + maya.cmds.setAttr('mmRenderGlobalsSilhouette.enable', False) |
| 120 | +
|
| 121 | +MEL Example: |
| 122 | + |
| 123 | +.. code:: text |
| 124 | +
|
| 125 | + mmRendererSilhouette; |
| 126 | +
|
| 127 | + // Change silhouette colour to red. |
| 128 | + setAttr mmRenderGlobalsSilhouette.color -type double3 1 0 0; |
| 129 | +
|
| 130 | + // Increase line width. |
| 131 | + setAttr mmRenderGlobalsSilhouette.width 3.0; |
| 132 | +
|
| 133 | + // Disable the effect temporarily. |
| 134 | + setAttr mmRenderGlobalsSilhouette.enable false; |
0 commit comments