Skip to content

Timeline & Graph: Constrain proportions on shape size, unified graph curves, Shift tangent snap, and New Layer context menu - #236

Closed
asheekaasheeka wants to merge 1 commit into
storytold:mainfrom
asheekaasheeka:comforting
Closed

asheekaasheeka wants to merge 1 commit into
storytold:mainfrom
asheekaasheeka:comforting

Conversation

@asheekaasheeka

Copy link
Copy Markdown
  1. Constrain Proportions on Shape Layer Path Size
  • File: crates/ui-egui/src/panels/timeline.rs
  • Details:
    • Added is_prop_linkable and is_prop_constrained helper functions.
    • Linked properties now include size on LayerSource::Shape in addition to scale and mask feather.
    • Displays the chain link toggle icon next to Width/Height values.
    • When linked (default), scrubbing/typing Width proportionally scales Height and vice versa via constrained().
    • Added unit test scale_and_shape_size_are_linkable_and_constrained_by_default.
  1. Continuous Rasterization for Shape and Text Layers
  • File: crates/project/src/build.rs
  • Details:
    • build::layer() now initializes collapse: matches!(source, LayerSource::Text | LayerSource::Shape) on Switches.
    • Newly created text and shape layers have Continuous Rasterization enabled by default, preventing pixelation/blurriness when scaled up.
    • Added unit test shape_and_text_layers_default_to_continuous_rasterization.
  1. Unified Graph Editor Curves when Constrain Proportions is Active
  • Files: crates/ui-egui/src/panels/graph.rs, crates/ui-egui/src/panels/graph_tools.rs
  • Details:
    • curves() checks super::timeline::is_prop_constrained(). If true, dims is set to 1, producing a single unified curve with unified color and handles instead of separate red/green curves.
    • When dragging the tangent handle on a constrained curve, "dim" is omitted from keys.setEase params, updating speed and influence across all dimensions synchronously.
    • When dragging keyframe values on a constrained curve, "dim" is omitted from keys.transform params, scaling all dimensions together.
    • In transform_box(), params["dims"] is omitted when any selected key is constrained, transforming all components together.
  1. Tangent Handle Horizontal Snap with Shift in Graph Editor
  • File: crates/ui-egui/src/panels/graph.rs
  • Details:
    • When dragging Bezier tangent handles (hresp.dragged()), holding Shift snaps the tangent slope to horizontal (sp = 0.0), keeping the handle level with the keyframe.
    • When Shift is released, the handle rotates freely to any angle.
  1. "New Layer" Context Menu on Right-Click in Timeline
  • File: crates/ui-egui/src/panels/timeline.rs
  • Details:
    • Extracted new_layer_items(ui, actions) with Text, Solid, Light, Camera, Null, Shape, and Adjustment Layer creation actions.
    • Added timeline_empty_context_menu(ui, actions) bound to outline_empty.context_menu(...) (layer list empty area) and empty.context_menu(...) (track graph empty area).
    • Fixed closure borrow ordering in layer_menu to avoid Rust borrow checker conflicts.

…curves, Shift tangent snap, and New Layer context menu

1. Constrain Proportions on Shape Layer Path Size

 - File: crates/ui-egui/src/panels/timeline.rs
 - Details:
   - Added is_prop_linkable and is_prop_constrained helper functions.
   - Linked properties now include size on LayerSource::Shape in addition to scale and mask feather.
   - Displays the chain link toggle icon next to Width/Height values.
   - When linked (default), scrubbing/typing Width proportionally scales Height and vice versa via constrained().
   - Added unit test scale_and_shape_size_are_linkable_and_constrained_by_default.

 2. Continuous Rasterization for Shape and Text Layers

 - File: crates/project/src/build.rs
 - Details:
   - build::layer() now initializes collapse: matches!(source, LayerSource::Text | LayerSource::Shape) on Switches.
   - Newly created text and shape layers have Continuous Rasterization enabled by default, preventing
     pixelation/blurriness when scaled up.
   - Added unit test shape_and_text_layers_default_to_continuous_rasterization.

 3. Unified Graph Editor Curves when Constrain Proportions is Active

 - Files: crates/ui-egui/src/panels/graph.rs, crates/ui-egui/src/panels/graph_tools.rs
 - Details:
   - curves() checks super::timeline::is_prop_constrained(). If true, dims is set to 1, producing a single unified
     curve with unified color and handles instead of separate red/green curves.
   - When dragging the tangent handle on a constrained curve, "dim" is omitted from keys.setEase params, updating speed
     and influence across all dimensions synchronously.
   - When dragging keyframe values on a constrained curve, "dim" is omitted from keys.transform params, scaling all
     dimensions together.
   - In transform_box(), params["dims"] is omitted when any selected key is constrained, transforming all components
     together.

 4. Tangent Handle Horizontal Snap with Shift in Graph Editor

 - File: crates/ui-egui/src/panels/graph.rs
 - Details:
   - When dragging Bezier tangent handles (hresp.dragged()), holding Shift snaps the tangent slope to horizontal (sp =
     0.0), keeping the handle level with the keyframe.
   - When Shift is released, the handle rotates freely to any angle.

 5. "New Layer" Context Menu on Right-Click in Timeline

 - File: crates/ui-egui/src/panels/timeline.rs
 - Details:
   - Extracted new_layer_items(ui, actions) with Text, Solid, Light, Camera, Null, Shape, and Adjustment Layer creation
     actions.
   - Added timeline_empty_context_menu(ui, actions) bound to outline_empty.context_menu(...) (layer list empty area)
     and empty.context_menu(...) (track graph empty area).
   - Fixed closure borrow ordering in layer_menu to avoid Rust borrow checker conflicts.
@echelon

echelon commented Oct 9, 2026

Copy link
Copy Markdown
Member

Thank you for all of this! There are some genuinely nice ideas here. If you're not on our Discord yet, please join us: https://discord.gg/artcraft

Please rebase onto main and split it into separate PRs:

  • Drop the New-layer context menu. Main already has the Timeline empty-area New-layer menu, with automation ids. Please remove timeline_empty_context_menu and new_layer_items.
  • Drop the Collapse default. Please remove the build::layer default of collapse = true for Shape/Text. Render: text layers are always continuously rasterised #200 just made text always continuously rasterised, and AE leaves the switch off on new shape layers.
  • Graph Editor. AE shows separate X/Y curves for constrained Scale, so please keep them separate.
  • Shape Size. Match it by match_id and group kind rather than prop.name == "Size".

The Shift tangent snap and the Shape Size chain link are welcome as their own PRs, with tests.

Copy link
Copy Markdown
Member

@asheekaasheeka Thanks again! The head hasn't changed since the earlier review, and it now conflicts in graph.rs and timeline.rs. The Shift tangent snap and the Shape Size chain link would be welcome as separate PRs. For the chain link, please match by match_id rather than name == "Size", and add automation ids. The New Layer menu is already on main, and the merged single graph curve for constrained Scale doesn't match After Effects, so those parts can be dropped.

If you're not there yet, come hang out with us on Discord: https://discord.gg/artcraft


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants