Maya Camera Sensor // Documentation

CAMERA.SENSOR  //  LENS & FILM‑BACK MATRIX

Version 1.3  |  Dockable Sensor / Lens Switcher with Live Viewport Gate

01  —  Annotated UI Overview Hover a callout number to highlight it. Image size: 603x1113

Camera Sensor is a dockable panel that behaves like the Attribute Editor: pick a camera body (sensor / film-back size) and a lens (focal length) from presets and the perspective / camera viewport gate updates live — no bake, no apply button. An animated top-view FOV wedge in the header opens and closes as you change focal length, and you can save full setups into A/B slots to compare framing on a shot.

  • 1
    Animated FOV Header

    A top-view diagram of the lens — a little camera body at the apex with a wedge fanning out in front of it. The wedge opens on wide / short lenses and closes on telephoto, easing toward the new angle so the change reads as an animation. The readout shows the live horizontal field of view in degrees (52.0° here) and the focal length in mm, and it accounts for anamorphic squeeze. See section 02 for the maths.

  • 2
    Target — Active Viewport

    Drives whatever camera the focused viewport is looking through. It reads the active model editor even when the tool itself has focus, so you can “look through a cam and tweak” exactly like the Attribute Editor.

  • 3
    Target — Scene Camera

    Switches targeting to an explicit camera chosen from the dropdown below — best when A/B comparing or when the camera you want isn't the one you're looking through.

  • 4
    Camera Dropdown

    Lists every non-default camera in the scene (Maya's persp/top/front/side are filtered out). Selecting one seeds the whole UI from that camera's current sensor, squeeze and focal length.

  • 5
    Refresh

    Re-scans the scene for cameras — handy after importing, creating or renaming one.

  • 6
    Target Readout

    Confirms the exact cameraShape being driven (e.g. → cameraShape2), so you always know where your changes are landing.

  • 7
    Sensor Preset Dropdown

    Grouped list of real bodies — Digital Cinema, Film Stock, Stills / Consumer — plus a Custom… entry. Choosing a preset fills the three fields below and writes the film back immediately. Anamorphic presets also set the squeeze.

  • 8
    Width (mm)

    Horizontal film-back size in millimetres. Written to horizontalFilmAperture as inches (mm ÷ 25.4). Editable directly for a custom sensor.

  • 9
    Height (mm)

    Vertical film-back size in millimetres → verticalFilmAperture. Together with width it sets the gate's aspect ratio.

  • 10
    Squeeze

    Anamorphic squeeze ratio → lensSqueezeRatio. 1.0 is spherical; 2.00 (shown) is classic 2× anamorphic. This widens both the FOV wedge and the distortion guide horizontally.

  • 11
    Lens Preset Dropdown

    Common primes from 8 mm to 600 mm. Pick one to snap the focal length; the field reads Custom… when the value doesn't match a prime.

  • 12
    Focal Slider

    Drag for any focal length in between the primes. The FOV wedge in the header opens / closes live as you scrub.

  • 13
    Focal Spin-box

    Type an exact focal length in mm → focalLength. Slider, spin-box and dropdown stay in sync.

  • 14
    Resolution Gate

    Toggles the resolution gate (displayResolution) so the render framing is drawn in the viewport.

  • 15
    Film Gate

    Toggles the film gate (displayFilmGate) — the physical sensor outline. Either gate turns on the gate mask automatically.

  • 16
    Mask Opacity

    How dark the area outside the gate is drawn (displayGateMaskOpacity) — 0 = invisible, 1 = solid black surround.

  • 17
    Show Dotted Edge Guide

    Builds / removes the dashed distortion guide parented to the camera. Anything outside the ring is in the heavy lens-distortion zone. See section 04 for a viewport example.

  • 18
    Inset %

    How far in from the frame edge the dotted ring sits — 86% shown here (set by Auto, see #29). The guide rebuilds live to track the current frustum. Editable directly when Auto is off; greyed out when Auto is on so you can still see what was applied.

  • 29
    Auto inset  NEW · v1.3

    Tick to have the tool pick the inset for you based on focal length — wider lenses pull in because barrel distortion grows toward the frame edge; telephotos ease off because there's very little distortion to mind. The computed value is mirrored into field #18 so you can always see what was applied. Curve (mm → %):  8→72 · 14→76 · 24→82 · 35→86 · 50→90 · 85→93 · 135→95 · 300→96, log-interpolated in between.

  • 19
    Slot List

    Saved setups, each showing its name, focal length and sensor size. Double-click a row to recall it. This is the heart of A/B comparison.

  • 20
    Slot Name Field

    Name the setup before saving (e.g. FullFrame 35mm). Leave it blank and the tool auto-names it from the focal length and sensor size.

  • 21
    Save Current

    Snapshots the entire current setup — sensor, squeeze, focal length and gate settings — into a new slot. Slots persist per-user via optionVar (JSON).

  • 22
    Recall

    Applies the selected slot to the current target camera.

  • 23
    Delete

    Removes the selected slot (and clears it from A/B if it was assigned).

  • 24
    Set A

    Assigns the selected slot to comparison slot A.

  • 25
    Set B

    Assigns the selected slot to comparison slot B.

  • 26
    Flip A/B

    Bounces the target camera between the A and B setups so you can judge two framings on the same shot with one click.

  • 27
    A/B Assignment Readout

    Shows which slots are bound to A and B, and which one is currently showing after a flip.

  • 28
    Status Readout

    Confirms the last write (e.g. ✓ 24.9×18.7mm · 51mm) in green, or an error in red if there's no target camera.

02  —  How It Drives the Camera Live attribute writes, no bake

In Maya a “camera” is really just a film-back size plus a focal length. The tool writes those two values (and the gate flags) straight onto the target cameraShape inside a single undo chunk, then refreshes the viewport — which is why the gate updates the instant you move a control.

Millimetres in, inches out

Humans talk in millimetres; Maya stores film back in inches. Every preset is held in mm and divided by 25.4 on write. The attributes touched per change:

horizontalFilmAperture  ←  W mm / 25.4
verticalFilmAperture    ←  H mm / 25.4
lensSqueezeRatio       ←  anamorphic squeeze (1.0 = spherical)
focalLength           ←  lens (mm)
displayResolution / displayFilmGate / displayGateMask(Opacity)  ←  gate

The Animated FOV Header

The header solves the horizontal field of view from the same numbers the camera uses:

H‑FOV = 2 · atan( (sensorW · squeeze / 2) / focal )

A short timer eases the drawn angle toward the new value, so flipping 24 mm → 200 mm visibly closes the wedge like an iris rather than snapping. It works even with no camera selected, reading straight from the UI values.

Anamorphic Squeeze Lives on the Film Back

Squeeze is a property of the sensor, not the lens — so it sits on the Sensor / Film Back panel as lensSqueezeRatio. Picking an Anamorphic 35 preset auto-fills the squeeze; ratios for 1.33x, 1.5x, 1.8x and 2x ship as presets, or dial any value by hand. The FOV wedge and the distortion guide both widen horizontally to match.

03  —  Sensor & Lens Reference What ships in the dropdowns

🎥 Digital Cinema

ARRI Alexa 35 · LF · 65 · RED V-Raptor 8K VV · RED Komodo 6K · Sony Venice 2 · Blackmagic URSA 12K. The modern VFX workhorses, Super35 through large format.

🎞 Film Stock

Super 35 · 35mm Academy · Anamorphic 35 (1.33× / 1.5× / 1.8× / 2×) · 65mm / IMAX · 16mm. The photochemical looks, with anamorphic squeeze baked into the preset.

📷 Stills / Consumer

Full Frame (36×24) · APS-C · Micro 4/3 · iPhone (main). For previs, virtual production and mograph framing.

Lens Primes

The lens dropdown offers the focal lengths a DP actually reaches for — ultra-wide through super-tele — and the slider covers everything in between:

8 · 12 · 14 · 16   ultra-wide
18 · 21 · 24 · 28   wide
32 · 35 · 40 · 50   standard
65 · 75 · 85   short tele / portrait
100 · 135 · 200 · 300 · 400 · 600   tele / super-tele

04  —  A/B Compare & Distortion Guide Decide the look, mind the edges

A/B Compare Slots

Type a name and press Save current to snapshot the full setup — sensor size, squeeze, focal length and gate settings — into a slot. Select a slot and press Set A or Set B to assign it, then ⇄ FLIP A/B bounces the target camera between the two so you can judge framing on the actual shot. Recall applies the selected slot; Delete removes it. Slots are saved per-user via optionVar (JSON), so reusable “looks” travel from scene to scene.

The dotted distortion frame guide shown in a Maya viewport
The edge guide in a Maya viewport — the inset rectangle inside the resolution gate marks the guide boundary; anything past it sits in the heavy lens-distortion zone.

The Dotted Distortion Guide

Anamorphic and post lens-distortion bow hardest near the frame edges. Turn on Show dotted edge guide and the tool parents a template (dashed, dimmed, unselectable) rectangle to the camera, sized to the frustum at your Inset %. Anything drifting outside that ring is in the heavy-distortion zone — a clear cue for when an object should or shouldn't enter frame. It rebuilds live as you change sensor, lens or inset. Tick Auto next to the inset and the tool will pick the percentage for you, tightening on wide lenses where barrel distortion is heaviest and easing off on telephotos where it's negligible.

Good to Know

The guide is a real scene curve parented to the target camera, so it is technically visible from other cameras too — normal for a layout aid. Toggling it off removes it from the current target. Building and removing the guide runs inside an undo chunk, and your selection is saved and restored so the new curve never hijacks what you had selected.

05  —  Workflow From empty camera to chosen lens

Run It

exec(open('C:/path/to/CameraSensorTool/CameraSensorTool.py').read())
run()