Shot Mask for Maya

The Shot Mask script allows users to quickly and easily create a shot mask and frame counter for any camera in the scene. The powerful GUI interface provides an interactive approach for creating shot masks while the extensive class methods allow for custom generation through scripting.

By providing a robust and flexible layout system, users have control over element positions, size, color and more. Shot mask settings are persistent between Maya sessions and can be altered at any time.

Downloads

Available for Maya 2011+

Note: The more recent Shot Mask VP2.0 for Maya is also available for Maya 2015+

Installation

  1. Download shot_mask.zip and extract the contents of the file
  2. Copy shot_mask.py to the scripts directory (or a location on the PYTHONPATH)
  3. To display the GUI, execute the commands:
    from shot_mask import ShotMaskUi
    ShotMaskUi.display()

Troubleshooting

If you see blocky text (in a shaded view), perform the following set of steps (this should only need to be done once):

New Method (try this one first)

  1. Create and select any NURBS surface
  2. From Maya's main menu select Modify->Convert->NURBS to Polygons (Options)
  3. Set the Tessellation method to "Standard fit"
  4. Set the Type to "Triangles"
  5. Click Tessalate (this will apply the changes)
  6. Delete the NURBS surface and try to recreate the Shot Mask

Old Method (for Maya 2016 and earlier)

  1. From Maya's main menu, select Create->Text (Options)
  2. Set the type to Polygons
  3. Click create
  4. Delete the text and try to recreate the Shot Mask

Scripting

The shot_mask module contains two classes, ShotMask and ShotMaskUi, allowing for integration into custom scripts.

ShotMaskUi Class

As mentioned in the installation instructions, the GUI can be displayed through the display() class method:

# Display the shot mask GUI
from shot_mask import ShotMaskUi
ShotMaskUi.display()

ShotMask Class

The ShotMask class contains the logic for creating the shot mask and altering the appearance. To import the ShotMask class:

from shot_mask import ShotMask

ShotMask Class Methods

ShotMask.create(camera=None)
Create the shot mask and constrain it to the camera. If a camera is not specified, use the active viewport camera.

ShotMask.delete()
Delete the shot mask (if it exists).

ShotMask.exists()
Returns True if the shot mask exists, False otherwise.

ShotMask.set_label_text(position, text)
Set the text for the label at position index.
Index mapping: 0=Top-Left, 1=Top-Center, 2=Top-Left, 3=Bottom-Left, 4=Bottom-Center, 5=Bottom-Left

ShotMask.label_text(position)
Get the text of the label at the position index.
Index mapping: 0=Top-Left, 1=Top-Center, 2=Top-Left, 3=Bottom-Left, 4=Bottom-Center, 5=Bottom-Left

ShotMask.set_label_scale(position, scale)
Set the scale of the label at the position index.

ShotMask.label_scale(position)
Get the scale of the label at the position index.

ShotMask.set_label_offset(position, offset_x, offset_y)
Set the offset_x and offset_y of the label at the position index.

ShotMask.label_offset(position)
Set the offset_x and offset_y of the label at the position index. Returns a list.

ShotMask.set_label_font(font)
Set the font of all labels.

ShotMask.label_font()
Get the font of all labels.

ShotMask.set_label_color(red, green, blue, transparency)
Set the label color and transparency.

ShotMask.label_color()
Get the label color and transparency. Returns a list.

ShotMask.set_camera_name(name)
Set the name of the camera to display the shot mask on. If the string is empty, the active viewport camera will be used instead.

ShotMask.exists(camera_name)
Returns the name of the camera to display the shot mask on.

ShotMask.set_counter_position(position)
Set the position of the counter by position index.
Index Mapping: 0=Top-Left, 1=Top-Right, 2=Bottom-Left, 3=Bottom-Right

ShotMask.counter_position()
Get the position of the counter by position index.
Index Mapping: 0=Top-Left, 1=Top-Right, 2=Bottom-Left, 3=Bottom-Right

ShotMask.set_counter_scale(scale)
Set the scale of the counter.

ShotMask.counter_scale()
Get the scale of the counter

ShotMask.set_counter_offset(offset_x, offset_y)
Set the x and y offsets of the counter.

ShotMask.counter_offset()
Get the x and y offsets of the counter. Returns a list

ShotMask.set_counter_padding(padding)
Set the padding of the counter.

ShotMask.counter_padding()
Get the padding of the counter.

ShotMask.set_border_visible(top, bottom)
Set the visibility of the borders.

ShotMask.border_visible()
Get the visibility of the borders. Returns a list.

ShotMask.set_border_thickness(thickness)
Set the thickness of the borders.

ShotMask.border_thickness()
Get the thickness of the borders.

ShotMask.set_border_scale(top_scale, bottom_scale)
Set the scale of the borders.

ShotMask.border_scale()
Get the scale of the borders.

ShotMask.set_border_color(red, green, blue, transparency)
Set the color and transparency of the borders.

ShotMask.border_color()
Get the color and transparency of the borders. Returns a list.