Timeline: property names have the property menu (#407)
Right-clicking a property's name in the Timeline did nothing, so
Position's dimensions could be separated only from the Graph Editor.
As in After Effects, it now opens the property's menu: Reset, Edit
Value…, Separate Dimensions (Position and, once separated, X / Y / Z
Position, checked), Add / Remove Expression and Add Property to
Essential Graphics. Only Position separates, as in After Effects
(Scale stays one property).
`prop.reset` without `default` used to leave the value as it was: it
now gives the property its own default (an effect parameter's, or a
Transform property's, shared with Layer ▸ Transform ▸ Reset), which
also makes the Properties panel's Reset reset the values. `prop.set
{layer, prop}` without `value` opens the value dialog, like
`keys.set`.
Tests: timeline_property_names_have_the_property_menu
(ui_blank_context_menus), reset_gives_a_property_its_default (engine).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
9c9e954ee2
commit
79bf5a6b59
@@ -482,6 +482,43 @@ fn pick_whip_generates_ae_reference_expressions() {
|
||||
assert!(s.execute("prop.pickWhip", json!({"layer": l, "path": "transform/opacity", "target": {"layer": l, "path": "transform/opacity"}})).is_err());
|
||||
}
|
||||
|
||||
/// #407: Reset without a value gives a property its own default (a Transform property's, an
|
||||
/// effect parameter's) besides removing its keyframes and expression.
|
||||
#[test]
|
||||
fn reset_gives_a_property_its_default() {
|
||||
let (mut s, l) = setup();
|
||||
s.execute("effect.apply", json!({"layer": l, "effect": "Gaussian Blur"})).unwrap();
|
||||
let blur = prop(&s, l, "effects/#1/blurriness").value;
|
||||
let set = [
|
||||
("transform/anchor", json!([10, 20, 0])),
|
||||
("transform/position", json!([10, 20, 0])),
|
||||
("transform/scale", json!([50, 70, 100])),
|
||||
("transform/rotation", json!(30)),
|
||||
("transform/opacity", json!(40)),
|
||||
("effects/#1/blurriness", json!(25)),
|
||||
];
|
||||
for (path, v) in &set {
|
||||
s.execute("prop.set", json!({"layer": l, "path": path, "value": v})).unwrap();
|
||||
}
|
||||
animate(&mut s, l, "transform/rotation", &[(0.0, json!(10)), (1.0, json!(20))]);
|
||||
s.execute("prop.setExpression", json!({"layer": l, "path": "transform/opacity", "expression": "50"})).unwrap();
|
||||
for (path, _) in &set {
|
||||
s.execute("prop.reset", json!({"layer": l, "path": path})).unwrap();
|
||||
}
|
||||
let v = |s: &Session, path: &str| prop(s, l, path).value;
|
||||
assert_eq!(v(&s, "transform/anchor"), KV::Vec3([50.0, 50.0, 0.0]), "the solid's centre");
|
||||
assert_eq!(v(&s, "transform/position"), KV::Vec3([200.0, 150.0, 0.0]), "the comp's centre");
|
||||
assert_eq!(v(&s, "transform/scale"), KV::Vec3([100.0; 3]));
|
||||
assert_eq!(v(&s, "transform/rotation"), KV::Scalar(0.0));
|
||||
assert!(!prop(&s, l, "transform/rotation").is_animated());
|
||||
assert_eq!(v(&s, "transform/opacity"), KV::Scalar(100.0));
|
||||
assert!(prop(&s, l, "transform/opacity").expr.is_none());
|
||||
assert_eq!(v(&s, "effects/#1/blurriness"), blur);
|
||||
// A given default still wins.
|
||||
s.execute("prop.reset", json!({"layer": l, "path": "transform/opacity", "default": 30})).unwrap();
|
||||
assert_eq!(v(&s, "transform/opacity"), KV::Scalar(30.0));
|
||||
}
|
||||
|
||||
/// #363: dropped on one of the target's values the pick whip picks that dimension
|
||||
/// (`position[0]`), as in After Effects; a multi-dimension property follows it on every axis.
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user