This commit is contained in:
Brandon Thomas committed 2026-10-31 10:54:52 -04:00
commit d3001efade
3 files changed
+62 -1

No files matched your search

+8
View File
@@ -254,6 +254,14 @@ const SHAPE_PROPS: &[(&str, &str, &str)] = &[
("wiggler", "seed", "ADBE Vector Random Seed"),
("wiggler", "transform", "ADBE Vector Wiggler Transform"),
("merge", "mode", "ADBE Vector Merge Type"),
("offset", "amount", "ADBE Vector Offset Amount"),
("offset", "join", "ADBE Vector Offset Line Join"),
("offset", "miter", "ADBE Vector Offset Miter Limit"),
("offset", "copies", "ADBE Vector Offset Copies"),
("offset", "copyOffset", "ADBE Vector Offset Copy Offset"),
("zigzag", "size", "ADBE Vector Zigzag Size"),
("zigzag", "ridges", "ADBE Vector Zigzag Detail"),
("zigzag", "points", "ADBE Vector Zigzag Points"),
("wiggle", "size", "ADBE Vector Roughen Size"),
("wiggle", "detail", "ADBE Vector Roughen Detail"),
("wiggle", "points", "ADBE Vector Roughen Points"),
+53
View File
@@ -309,6 +309,59 @@ fn wiggle_paths_properties_by_match_name() {
assert_eq!(sh.props.prop("contents/wiggle/spatialPhase").unwrap().value, KV::Scalar(45.0));
}
/// Scripts reach Offset Paths' and Zig Zag's properties by their match names.
#[test]
fn offset_paths_and_zig_zag_properties_by_match_name() {
let mut s = session();
let o = ok(
&mut s,
r#"
var c = app.project.items.addComp("O", 200, 200, 1, 2, 30);
var sh = c.layers.addShape();
var root = sh.property("ADBE Root Vectors Group");
root.addProperty("ADBE Vector Filter - Offset");
root.addProperty("ADBE Vector Filter - Zigzag");
var o = root.property("ADBE Vector Filter - Offset");
var z = root.property("ADBE Vector Filter - Zigzag");
var on = ["ADBE Vector Offset Amount", "ADBE Vector Offset Line Join", "ADBE Vector Offset Miter Limit",
"ADBE Vector Offset Copies", "ADBE Vector Offset Copy Offset"];
var zn = ["ADBE Vector Zigzag Size", "ADBE Vector Zigzag Detail", "ADBE Vector Zigzag Points"];
var names = [];
for (var i = 0; i < on.length; i++) names.push([o.property(on[i]).matchName, o.property(on[i]).name]);
for (var j = 0; j < zn.length; j++) names.push([z.property(zn[j]).matchName, z.property(zn[j]).name]);
var before = [o.property("ADBE Vector Offset Amount").value, o.property("ADBE Vector Offset Line Join").value,
z.property("ADBE Vector Zigzag Points").value];
o.property("ADBE Vector Offset Amount").setValue(-6);
o.property("ADBE Vector Offset Copies").setValue(3);
z.property("ADBE Vector Zigzag Detail").setValue(8);
[names, before, o.property("ADBE Vector Offset Nope") === null, z.property("ADBE Vector Zigzag Nope") === null]
"#,
);
assert_eq!(
o.result,
json!([
[
["ADBE Vector Offset Amount", "Amount"],
["ADBE Vector Offset Line Join", "Line Join"],
["ADBE Vector Offset Miter Limit", "Miter Limit"],
["ADBE Vector Offset Copies", "Copies"],
["ADBE Vector Offset Copy Offset", "Copy Offset"],
["ADBE Vector Zigzag Size", "Size"],
["ADBE Vector Zigzag Detail", "Ridges per segment"],
["ADBE Vector Zigzag Points", "Points"]
],
[10, 1, 1],
true,
true
])
);
let (_, c) = comp_named(&s, "O");
let sh = c.layers.iter().find(|l| l.props.sub("contents").is_some()).unwrap();
assert_eq!(sh.props.prop("contents/offset/amount").unwrap().value, KV::Scalar(-6.0));
assert_eq!(sh.props.prop("contents/offset/copies").unwrap().value, KV::Scalar(3.0));
assert_eq!(sh.props.prop("contents/zigzag/ridges").unwrap().value, KV::Scalar(8.0));
}
#[test]
fn match_names_and_lookups() {
let mut s = session();
+1 -1
View File
@@ -18,7 +18,7 @@ our own scripts; no real-world script library has been run against both apps.
| Expression object model | `thisComp`, `thisLayer`, `wiggle`, `loopOut`, `valueAtTime`, `sampleImage`, `footage()`, text style API… | Same members, from the reference, including `propertyGroup(countUp)` and a group's `propertyIndex` for name-independent rigs (#1619) | good | `crates/expr/src/tests.rs`, `tests/property_group.rs`; behaviour of edge cases unmeasured (G1) |
| Expression editing | Inline field, error bar, pick whip, Expression Language menu, external editors | Inline field that grows, error bar, pick whips (property and value), language menu | partial | External editor support (#364) |
| Expression performance | Cached, multi-frame | Per-thread boa contexts | unknown | No benchmark |
| Scripting object model | `app`, `Project`, items, layers, properties, keys, eases, render queue, `TextDocument`, `Shape`, markers, `File`/`Folder`, `Socket`, `app.settings` | Same classes, edits run through undoable engine commands; match names table; layers, groups and properties are callable (`layer("Effects")(1)` is `.property(...)`) | good | `crates/script` tests (≈ 10 test files) |
| Scripting object model | `app`, `Project`, items, layers, properties, keys, eases, render queue, `TextDocument`, `Shape`, markers, `File`/`Folder`, `Socket`, `app.settings` | Same classes, edits run through undoable engine commands; match names table, the properties of Offset Paths and Zig Zag included; layers, groups and properties are callable (`layer("Effects")(1)` is `.property(...)`) | good | `crates/script` tests (≈ 10 test files) |
| `$.evalFile`, `BridgeTalk` | Evaluate another script file; identify the host application and message other Adobe applications | `$.evalFile` evaluates a file relative to the calling file (nested at most 32 deep, under the scripts' file gate) and returns its last value; `BridgeTalk` names the host honestly (`appName` `effectcraft`, its version); messaging other applications throws "not supported" | partial | `tests_evalfile.rs` (#760); no inter-application messaging |
| ScriptUI | Dialogs, palettes, dockable panels, resource strings, `onDraw` / ScriptUIGraphics, mouse events | Same, dockable panels reopen at launch; a docked panel gets its dock's size and `onResize` (`scriptui.resize`, #2585); a drag keeps reaching the control it started on past the window edge, and `MouseEvent.buttons` reports the held buttons (#2584) | good | `ui_scriptui`, `tests_ui*` |
| `app.scheduleTask` / `cancelTask` | One-shot and repeating tasks (polling, panel refresh) until `cancelTask` | Same: repeating tasks run every `delay` ms (at least 50 ms, at most 64 pending per script) until `cancelTask`, until they throw (reported once, then cancelled), or until their owner goes: a script's last window closing, or the project closing for scripts without windows (a Startup script's tasks go on until EffectCraft quits); frontends tick them every frame, agents with `script.runTasks` | good | `tests_tasks.rs` (#773); one-shot tasks of a script file still run right after it, not after their delay |