Skip to content

Commit c77f8d7

Browse files
Docs - Improve docs for Maya commands.
1 parent daf6afa commit c77f8d7

5 files changed

Lines changed: 1533 additions & 25 deletions

File tree

docs/source/commands.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
Commands
22
========
33

4-
Custom commands in `mmSolver` are used to perform many tasks, such as
5-
solving the scene, modifying the scene, or calculating values.
4+
mmSolver provides a set of custom Maya commands (MEL / Python) for
5+
performing solves, querying scene information, processing animation
6+
curves, working with images, and more. These commands are the
7+
low-level building blocks that the high-level Python API and tools
8+
build upon; advanced users can call them directly from scripts.
69

7-
You can see the nodes split into categories below:
10+
Commands are split into the following categories:
811

912
.. toctree::
1013
:maxdepth: 4

docs/source/commands_display.rst

Lines changed: 129 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,134 @@
11
Display Commands
22
================
33

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>`.
58

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``.
812

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

Comments
 (0)