mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-30 04:57:54 -06:00
Shapes: Wiggle Paths has Spatial Phase, which slides its wiggle along the path
Wiggle Paths had Size, Detail, Points, Wiggles/Second, Correlation, Temporal Phase and Random Seed, but no Spatial Phase, which After Effects lists among its properties (ADBE Vector Spatial Phase). Spatial Phase now moves each point's own displacement along its subpath: 360 degrees is once around, and a fraction of a point is interpolated between neighbors. At 0 degrees a path draws as before. A project saved without the property gets it at 0 degrees, after Temporal Phase, when it opens. Scripts can read and set every Wiggle Paths property by its match name.
This commit is contained in:
@@ -209,6 +209,14 @@ const SHAPE_PROPS: &[(&str, &str, &str)] = &[
|
||||
("twist", "angle", "ADBE Vector Twist Angle"),
|
||||
("twist", "center", "ADBE Vector Twist Center"),
|
||||
("merge", "mode", "ADBE Vector Merge Type"),
|
||||
("wiggle", "size", "ADBE Vector Roughen Size"),
|
||||
("wiggle", "detail", "ADBE Vector Roughen Detail"),
|
||||
("wiggle", "points", "ADBE Vector Roughen Points"),
|
||||
("wiggle", "speed", "ADBE Vector Temporal Freq"),
|
||||
("wiggle", "correlation", "ADBE Vector Correlation"),
|
||||
("wiggle", "phase", "ADBE Vector Temporal Phase"),
|
||||
("wiggle", "spatialPhase", "ADBE Vector Spatial Phase"),
|
||||
("wiggle", "seed", "ADBE Vector Random Seed"),
|
||||
];
|
||||
|
||||
/// Effects: our effect id → AE match name (the documented ones; the rest keep our id).
|
||||
|
||||
@@ -258,6 +258,44 @@ fn an_undefined_name_mentioned_earlier_reports_its_use_in_the_reading_function()
|
||||
assert_eq!(e.line, Some(6), "{e:?}");
|
||||
}
|
||||
|
||||
/// Scripts reach Wiggle Paths' properties, Spatial Phase included, by their match names.
|
||||
#[test]
|
||||
fn wiggle_paths_properties_by_match_name() {
|
||||
let mut s = session();
|
||||
let o = ok(
|
||||
&mut s,
|
||||
r#"
|
||||
var c = app.project.items.addComp("W", 200, 200, 1, 2, 30);
|
||||
var sh = c.layers.addShape();
|
||||
var w = sh.property("ADBE Root Vectors Group").addProperty("ADBE Vector Filter - Roughen");
|
||||
w.property("ADBE Vector Spatial Phase").setValue(45);
|
||||
var names = [];
|
||||
for (var i = 1; i <= w.numProperties; i++) names.push(w.property(i).matchName);
|
||||
[w.matchName, w.property("ADBE Vector Spatial Phase").name, names]
|
||||
"#,
|
||||
);
|
||||
assert_eq!(
|
||||
o.result,
|
||||
json!([
|
||||
"ADBE Vector Filter - Roughen",
|
||||
"Spatial Phase",
|
||||
[
|
||||
"ADBE Vector Roughen Size",
|
||||
"ADBE Vector Roughen Detail",
|
||||
"ADBE Vector Roughen Points",
|
||||
"ADBE Vector Temporal Freq",
|
||||
"ADBE Vector Correlation",
|
||||
"ADBE Vector Temporal Phase",
|
||||
"ADBE Vector Spatial Phase",
|
||||
"ADBE Vector Random Seed"
|
||||
]
|
||||
])
|
||||
);
|
||||
let (_, c) = comp_named(&s, "W");
|
||||
let sh = c.layers.iter().find(|l| l.props.sub("contents").is_some()).unwrap();
|
||||
assert_eq!(sh.props.prop("contents/wiggle/spatialPhase").unwrap().value, KV::Scalar(45.0));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn match_names_and_lookups() {
|
||||
let mut s = session();
|
||||
|
||||
Reference in New Issue
Block a user