* #4368: Add / Match / Remove Grain gain After Effects' missing controls
Shared grain groups (crates/effects/src/grain_shared.rs), all functional:
- Application > Channel Balance (9 per-channel shadow/midtone/highlight multipliers)
- Sampling > Source Frame, Noise Sample Points 1-10 (used by Sampling Process "Manual"),
Match Grain's per-point Intensity 1-10
- Blend with Original: Amount, Combine Match and Mask Using, Blur Matte, Color Matching
(RGB / Hue / Chroma, tolerance, softness, invert) and Masking Layer (layer, mode, size fit)
Remove Grain: Channel Noise Reduction (R/G/B), Chroma Suppression, Noise Size Bias,
Clean Solid Areas.
New instances follow After Effects' Effect Controls order; saved instances keep their
stored order and get the new controls with defaults that render unchanged (Source Frame
-1 = the frame being rendered for projects saved before it).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* #4368: grain sampling review fixes
- Manual Noise Sample Points skip boxes whose surround reaches transparent pixels (the
automatic rule), and each kept box keeps its own point's Intensity.
- Remove Grain measures a fixed Source Frame that is the current frame before Temporal
Filtering, as other frames are measured; Source Frame -1 keeps the old measurement.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* #4368: Match Grain's historical Masks choice no longer samples the unmasked Source
Historical mask reads aren't available, so layer_sample_frame returns None for
the Masks choice and the caller falls back to the current-frame layer_masks
read. Source and Effects & Masks historical reads are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* #4368: Masks at a historical Source Frame; legacy Roto Brush keys with grain above
Match Grain's Masks choice at a historical Source Frame now samples the
layer with its masks as they are at that frame: EffectHost gains
layer_masks_at (default None, the current-frame fallback), and the
renderer's FxHost implements it like layer_masks at another time.
Roto Brush Input Keys saved by 0.24 hash the effects above the brush.
Opening an old project adds the grain effects' 89 new controls and
Manual to Sampling Process, so the legacy text now leaves the added
controls out while they hold the value an old project gets (Source
Frame -1 via legacy_default) and restores Sampling Process's 0.24
options. The ADDED_SINCE_0_24 mechanism is taken as-is from #4374
(with an Added::Legacy variant and a POPUPS_0_24 table added).
Tests: grain_shared historical Masks test, render
layer_masks_at_reads_the_masks_of_that_time, legacy.rs unit tests and
an analysis_signature test on an old project with grain above a frozen
brush (fixture grain-0.24.json written by the pre-#4368 code). That
last test is #[ignore]d: its 0.24 key derivation did not reproduce the
base fixture's key in a local run.
Not compiled locally after the final edits; CI is the check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* #4368: un-ignore the grain legacy Roto Brush key test
The test reproduced 0.24's Roto Brush Input Key from the fixture as opened, but the fixture's
3D Camera Tracker (above the brush) holds a stand-in Solve that 0.24 didn't have when it made
the key: the first edit clears it (camera_track::invalidate), and only then does the legacy text
give ROTO_INPUT_0_24. The derivation now adds a render queue item first, as the fixture's own
test does, and the test runs again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: FredApps <FredApps@users.noreply.github.com>
* #4368: VR effects: field of view, glitch transform/sub/noise, gradient points 6-8, converter sizing
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* #4368: VR effects: address review (partial-FOV gradient points, plane-to-sphere source, work-scale controls, target restriction)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* #4368: VR sphere-to-plane: no panic on sub-pixel cube faces or empty images
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* #4368: VR effects: empty eyes skip the filter, wrap_pad accepts empty images
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* #4368: VR Output Frame Width projects from the source; Fractal Noise generates only the visible crop
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* #4368: VR Digital Glitch: scanline spacing in output pixels on a reduced work image
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* #4368: VR cube-map input: clamp to the pixel centres inside a face with fractional edges
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* #4368: VR review fixes: minification filtering, partial-field scanlines, legacy stereo Plane to Sphere, FOV canvas cap
- VR Converter / Sphere to Plane: when Output Frame Width resizes the frame, the projection
averages a grid of samples over each output pixel's source footprint (measured from the
neighbouring pixels' source positions, up to 8 x 8), staying inside the source eye and the
cube face of the pixel's centre. Unresized conversions are unchanged (and match the GPU).
- VR Digital Glitch: on a reduced work image (narrow field of view) scanlines are drawn
afterwards at the eye's own resolution, keeping Target Point attenuation, so the default
spacing of 2 still alternates rows instead of tinting evenly.
- VR Plane to Sphere: a hidden Split Eyes version flag (legacy default off on upgrade, off
when missing) keeps projects saved before the per-eye placement rendering a stereo frame as
one sphere on the GPU path; new instances split the eyes. Golden from origin/main 9dcb8871.
- Partial field canvas: the 4x-frame-pixels cap is enforced after rounding to whole pixels and
the one-pixel minimum (floor: the canvas of a one-pixel eye).
Regression tests: shrinking_output_frame_width_keeps_minification_filtering,
partial_field_scanlines_alternate_at_the_default_spacing,
partial_field_canvas_stays_within_its_pixel_budget,
migrate::legacy_stereo_plane_to_sphere_renders_as_before.
Not compiled locally after the final test tweak; CI is the check. An earlier local run of
the vr:: and migrate:: tests compiled and passed all but one test bound, since narrowed to the
middle of the view. Clippy not run locally.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Puppet: press-drag with a pin tool places the pin and drags it
With a Puppet pin tool, a press on the layer's art followed by a drag did
nothing: a pin took a click to place and a second press to move. As in
After Effects, the pin now goes down where the button does and follows the
pointer while it is held. Position and Advanced pins carry the mesh to the
release point, Starch and Overlap pins are placed where the drag ends, and a
Bend pin (no position) stays where it was placed. puppet.addPin takes a
`merge` key so the add and the following puppet.movePin steps are one undo
step. A plain click still just adds a pin.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Puppet: store a drag-placed Starch/Overlap pin's rest like a click
puppet.movePin wrote the raw (deformed-space) point into a Starch or
Overlap pin's rest, while puppet.addPin maps a click back to the rest
mesh. On a deformed mesh a press-drag and a click at the same point
stored different rests. movePin now maps the point through the mesh's
current deformation without the pin itself (puppet::overlay_without),
as addPin does before the pin exists, so a drag, a click and a later
drag of an existing pin all rest under the pointer. Position, Advanced
and Bend pins are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Puppet: decide the pin kind before evaluating a drag's rest mapping
Position, Advanced and Bend pin drags no longer evaluate the deformation just to discard it; only Starch and Overlap pins map through the rest mesh.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Puppet: place a dragged Starch/Overlap pin on the mesh under the release, solve only its mesh
A press-drag that places a Starch or Overlap pin now ends with `puppet.movePin` `place: true`,
which moves the pin into the mesh a click at the release point would choose (the first mesh the
point is on or beside, deformed without the pin), in the gesture's undo step. It used to stay in
the pressed mesh's Deform group, acting on nothing under it.
While dragging, the rest point is mapped through the pin's own mesh only
(`puppet::overlay_of_pin`), not every mesh of the layer, so each pointer move builds and solves
one mesh.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Puppet: a dragged Starch/Overlap pin released on unmeshed art meshes it, as a click does
`puppet.movePin` with `place` now does what a click at the release point does when that point
is on no mesh: on art no mesh covers, it adds a mesh there (with the current mesh options) and
moves the pin onto it, resting at the release point, in the drag's undo step. Where a click
would place nothing (the art is already a mesh's own), the pin keeps its mesh.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Puppet: a Starch/Overlap drag released off the art places it only where a click would
The end of a drag that placed a Starch or Overlap pin now asks the same question a click does
(`puppet_click_layer`, shared by press, click and release): only when a click at the release
point would put a pin on this layer does `puppet.movePin` get `place`. A release on empty canvas
used to mesh the unmeshed art nearest the pointer, which a click there never does; the pin now
stays on its mesh.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Puppet: a Starch/Overlap drag that leaves the mesh its press made removes that mesh
The first Starch or Overlap press on unmeshed art makes a mesh for the new pin.
When the release puts the pin on another mesh (or a new one on another piece),
the press-made mesh was left behind empty: Show Mesh outlined it and the
renderer kept rasterizing it. `puppet.addPin` now reports `newMesh`; the viewer
keeps that mesh in the gesture and passes it to the release's `puppet.movePin`
as `madeMesh`, which removes it in the same edit when the pin was its only pin
and the placement is elsewhere. Meshes that existed before the gesture,
including empty ones, are never removed. Undo stays one step.
Test: puppet_starch_drag_off_unmeshed_art_leaves_no_mesh_behind (two islands:
release piece meshed; no Puppet effect at all; a pre-existing empty mesh that
must stay). The puppet viewer tests were built and run locally (15 pass; the new
test fails with the fix disabled). Clippy and the engine test suite were not
run locally; CI is the check for those.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
* #4368: add the missing properties of the smaller effects
Adds the After Effects properties missing from Paint Beads, Sphere Wrap, Card Wipe,
Warp Stabilizer, Cylinder Wrap, Vector Blur, Light Rays, Page Curl, Plastic Shading, Radio
Waves, Slant and Block Reveal, Bulge, Color Neutralizer, Convolution Kernel, Cross Blur,
Directional Smear, Dual Lens Warp, Edge Tile Repeat, Environment Map, Hexagonal Tiles,
Kaleidoscope, OCIO CDL Transform, Organic Displacement, Paint Bucket, Radial Blur, Radial
Light Burst, Refine Soft Matte, Source Composite, Strobe Light, Surface Spotlight, Temporal
Motion Blur, Turbulent Displace, Two-Point Bend and Wave Warp. New properties sit in After
Effects order and drive the render; defaults reproduce the previous output and old projects
load unchanged (Card Wipe's new Y/Z jitter speeds start from the old single speed). GPU paths
fall back to the CPU when a new control is active.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* #4368: review fixes (identity pixels at High antialiasing, light normalisation, 100% blend)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* #4368: fix the deferred review findings (Page Curl, Edge Tile, Plastic, Chatter Reduction, Hexagonal Tiles, Warp Stabilizer)
- Page Curl: the corner drag places the fold so the corner lands on Fold Position for any curl radius; an unmoved corner shows no Back Page; the GPU path falls back to the CPU for corner drags and Back Page layers.
- Edge Tile: Repeat Blend Borders blends with what the neighbouring tile shows, flip included.
- Plastic Shading: Ambient Light Color tints only the ambient term, lit with the light colour, and nothing without ambient light.
- Refine Soft Matte: Chatter Reduction rejects outer frames where the matte moves.
- Hexagonal Tiles: Lock Center Tile keeps the grid centred on the layer while Center moves the picture.
- Warp Stabilizer: the Target Layer is fitted over the whole frame, not this layer's buffer bounds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* #4368: legacy Roto Brush keys leave out the parameters added since 0.24
Roto Brush keys saved by 0.22-0.24 hash the Debug text of every effect above the brush. The
new properties of #4368 (Warp Stabilizer's Advanced options among them) are added when such
a project opens, so the legacy key no longer matched and the saved analysis was dropped
(tests::analysis_signature). The legacy text now leaves out each parameter added since 0.24
while it still holds the value an old project gets (its default, or for Card Wipe's split
jitter speeds the single speed), along with a layer parameter's source choice and groups of
only new parameters.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* #4368: review fixes (Curve Size, Paint Beads light and GPU fallback, Radial Blur seed, pinned High antialiasing, Card Wipe keys, ambient tint, target Source)
- Radio Waves: Curve Size subdivides its own interval, so small sizes draw their own curve.
- Paint Beads: point-light height follows the layer size, not a padded buffer; the GPU path
hands non-default Wobble, Light and Shading to the CPU.
- Radial Blur: seeded Zoom jitter is half a real ladder step and never crosses the centre.
- High antialiasing keeps pixels the warp leaves in place at their centre (pinned edges).
- Card Wipe migration copies an animated shared jitter speed (keyframes, expression); the
legacy Roto Brush key compares the copy in full.
- Plastic Shading: the Ambient Light Color clamp limits only the tint's change.
- Warp Stabilizer: the Target Layer honours its Source choice.
- tests_4368: an unknown parameter fails the test instead of passing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* #4368: Plastic Ambient Light Color scales with the light intensity
At Light Intensity 0 the surface is unlit (the layer as it is), so the ambient tint is scaled
by the intensity as the light colour is: a black Ambient Light Color no longer turns it black.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* #4368: Two-Point Bend Preserve Length renders on the CPU
The GPU kernel draws only the Normal arc mapping; Distort = Preserve Length is listed in the
catalog's CPU-only controls so the effect falls back to the CPU (Normal stays on the GPU).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Puppet: a mesh that spreads a pin's pull and keeps its area (#2866)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Puppet: adding a pin and solving agree on what the pin holds (#2866)
`puppet.addPin` chose a new pin's position by whether the click was on the deformed mesh, while the solve
chooses what the pin holds by whether its rest point is on the rest mesh. On a turned mesh a click just
off the outline unmaps to a rest point on the mesh: the pin held that point, but at the click, which
pulled the mesh over (6 px at a third of a turn).
Both now use `puppet::held_point`, and a pin that holds a point goes where that point is now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Tests: the off-mesh pin test checks a pin was added (#2866)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Puppet: a solve that fits a frame, shared by drawing and the overlay (#2866)
The solve was redone for the overlay after drawing, ran every refinement round however little they
moved, and built a fresh banded factor for each of up to five sets of stiffened weights, with room
for one of 320 MB.
- A round that moves no vertex 1e-4 px ends the refinement. On the far drags, the push, the cross
and the S curve that changes no vertex by 1e-4 px, at 40 rounds or 200.
- Stiffened weights refactor into the same storage in the same order, and the factor's inner loops
run over slices (same sums in the same order, so the same numbers).
- The factor is capped at 8 million values (64 MB). The densest mesh the tool builds (a target of
20,000 triangles) needs 4.7 million; past the cap conjugate gradients solve the same system.
- Drawing and the overlay (`puppet.info`, adding a pin, the Puppet tools) share one cached solve.
On a 1280x720 solid with a far drag: 20,000 triangles 15.3 s to about 2.7 s, 10,000 2.2 s to about
0.8 s; with the pins at rest, 5.4 s to about 1 s.
The module doc now describes point pins.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Tests: pin edge cases, the refinement mapping and smoothing (#2866)
- Mesh Rotation Refinement to rounds: the default (40), 0, negative, past the maximum, NaN and
infinities.
- A pin on a vertex holds that vertex; one on an edge between two triangles holds the same point
through either; one off the outline by round-off holds the point on it, and one further off its
nearest vertex at the same offset; a Bend pin alone keeps its vertex in place.
- Smoothing falls back to the solve when the vertices don't match the mesh or no split is worth it,
and every small triangle lies in the triangle its `parent` names.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Puppet: the drawing keeps pins on their points and overlapping sheets apart (#2866)
- Smoothing bent the drawn mesh away from the points pins hold inside triangles: on the far drags
and the S curve the image under a pin landed up to 10 px from it. The vertex gradients the
smoothing uses now take the least change that puts each held point where the solve did (a few
sweeps for pins sharing a vertex); edges still depend only on their two vertices, so no cracks.
- A 2x2 sample cell shared by two overlapping sheets coloured all its samples with the first
sheet's read. A sheet whose source disagrees with the first's by more than 2 px now reads its own
colour at its own first sample, weighted by its own samples; one sheet's cells read as before.
- The solver comparisons check both solves are the same length and finite before measuring how far
apart they are (`f64::max` skips a NaN).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Puppet: held pins stay on their points together, and a narrow sheet in a pixel keeps its colour (#2866)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Puppet: the solve follows pins smoothly past what the mesh can give (#2866)
Stiffening triangles from the last solve's shape swung from pass to pass when
pins asked for more than the mesh could give, so half a pixel of drag moved
it hundreds of pixels. The stage is removed; the stress tests' limits are
set to what the solve now gives.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* #2866: bound the Puppet solver's pin system and keep saved rigs' look
The drawing's hold on pinned points solved one dense system over every
held pin: n x (n + 2) values and O(n^3) elimination per render, with n
uncapped. Points only meet through shared mesh vertices, so the system
now splits into groups of linked points; a group of up to 128 points is
solved exactly as before, a larger one by 32 passes of cyclic
projection, so memory and work grow linearly with the pin count.
Rigs saved before this change keep their look: a hidden Solver Version
parameter defaults to the current solve for new instances, and
migrate::legacy_default gives instances saved without it the first
solve, which renders through puppet/legacy.rs (main's solve and
drawing, bit-identical on four test rigs). The overlay and addPin's
placement follow the rig's version.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: FredApps <FredApps@users.noreply.github.com>
* Preserve frozen Object Matte data on project import
* Discard frozen mattes when import changes a nested source
* Verify frozen matte media and layer inputs on import
---------
Co-authored-by: ViktorBystrov72 <18964918+ViktorBystrov72@users.noreply.github.com>
Co-authored-by: Fredrik Hallin <fredrik.hallin@guidelinegeo.com>
* fix(render): Fill keeps a scaled-up text layer's working image small (#4158)
A layer's effect stack skips the cover of the whole layer rectangle only
when every effect is in SKIPS_COVER. Fill was not, so a text layer with
Fill scaled up to ~900 % got a working image the size of the scaled layer
rectangle on every frame, and a render reached tens of GB.
Fill without Invert only recolours pixels the layer already has (masked
or not), so it now skips the cover too. Inverted, it paints the layer's
transparent area and keeps it. The check reads the instance's Invert
value, so EffectSpec gains skips_cover_for(params).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(render): a feathered Fill keeps the cover (#4158)
With a feather, a Fill mask edge outside the painted pixels still blurs
into them, so the coverage has to be computed beyond the painted bounds.
Keep the cover when either feather is set; unfeathered Fill (the default)
still skips it. Adds a covered-reference test with a feathered mask whose
edge lies just outside the painted content (fails without this change).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
- Cryptomatte planes: a plane a render holds is not offered for its gone channels, and the entry
limit holds while renders hold every plane.
- Footage frames and whole stills held elsewhere are not offered to the memory accountant.
- Purge (clear frames) makes decodes in flight stale: their frames are not kept or joined.
- Plane store: a size refusal of a merged decode is not handed to a request that fits alone;
slimming a shared set and copies for the disk cache take memory fallibly, and planes the disk
cache can't take are not copied.
- Disk cache: the plane encoder's scratch is taken fallibly; no memory skips the entry.
- Region of interest: rows follow the projected transform of a 2D layer under a 3D parent, and
a frame of another size than its footage is read whole.
- The box filter's work bound is checked without a wall clock.
With the padding cut to its budget, a Distance larger than what's left
of the margin moved the layer out of the buffer before the blur, so the
blur had nothing to spread back in: a 64 x 48 layer moved 3000 px at
Softness 8000 left no shadow at all. The cut-margin path now samples
only the fraction of the move and lets the blur move the rest:
raster::gaussian_blur_unbounded_at evaluates the transparent-edged blur
of the image at a whole-pixel shift, through a window the size of the
buffer, so content outside the window still reaches into it. Margins
that fit are unchanged.
The blur's intermediate rows are freed before the output is allocated,
so it holds at most three buffers at once. On an M-series Mac a
4096 x 4096 layer at Softness 30000 takes 0.51 s, and 1080p 0.13 s.