Create plug-in lights with the Light Editor

All plug-in lights can be created in the Light Editor. After loading the plug-in, Maya automatically adds the plug-in light to the Light Editor with a default icon. You can then create plug-in lights in the scene by clicking the light icon.

All plug-in lights are automatically added, provided that the plug-in node uses the light classification string.

To verify that your plug-in node uses the light classification string, run the following MEL command:

getClassification <nodeType>

For example, getClassification pointLight returns drawdb/light/pointLight:light.

light in the returned string denotes light classification.

drawdb/light/<light type> denotes a Viewport 2.0 light classification. If a plug-in uses one of the existing internal classifications (such as drawdb/light/directionalLight), then Maya will automatically use the corresponding shader for lighting as well as the internal Viewport 2.0 geometry evaluator for UI drawing in the viewport.

Note: If the Light Editor is already open when you load your plug-in, you must close and re-open the editor to refresh its display before you can see the plug-in light creation icon.

Customize the display of your plug-in light in the Light Editor

Create a template file to customize the plug-in light attributes shown in the editor, the creation MEL command, and the icon used.

Customization is possible but not required. If no icon is provided, then a default one is used. If no MEL command is provided, then the command:

shadingNode -asLight <lighttype>

is executed to create the light source.

Sample template files can be found in the ../scripts/AETemplates folder of your installation directory and are prefixed with LE; for example: LEspotLightTemplate.mel for spotlights.