Scripting: a stroke's Dashes use After Effects' match names (#815)

Dashes reported its children as `dash`, `gap`, `offset`, so
`property("ADBE Vector Stroke Dash 1")` was null and addProperty threw.
They now report ADBE Vector Stroke Dash 1-3 / Gap 1-3 / Offset.
addProperty with one of those names returns the existing property
(EffectCraft's Dashes always holds Dash 1, Gap 1 and Offset) or adds the
Dash/Gap 2 or 3 pair through shape.dashes.add. Lookups by the old ids
still work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
redonion23
2026-10-13 03:04:12 +02:00
co-authored by Claude Opus 5.5
parent 470ea7a3af
commit f816cd5e38
4 changed files with 68 additions and 0 deletions
+9
View File
@@ -715,6 +715,15 @@ PropertyGroup.prototype.addProperty = function (name) {
var p = { comp: L.__comp, layer: L.__id, kind: r.shape };
if (r.group !== null && r.group !== undefined) p.group = r.group;
uid = __call("layer.addShapeItem", p).uid;
} else if (r.kind === "existing") {
uid = r.uid;
} else if (r.kind === "dash") {
// Dash/Gap 2 and 3 come as a pair: add pairs until the one asked for exists.
var dp = { comp: L.__comp, layer: L.__id, prop: r.stroke };
for (var n = 0; n < 3 && !this.property(name); n++) __call("shape.dashes.add", dp);
var added = this.property(name);
if (!added) throw __err("Can not add \"" + name + "\" to Dashes");
return added;
} else if (r.kind === "animator") {
uid = __call("layer.addTextAnimator", { comp: L.__comp, layer: L.__id, properties: [] }).animator;
} else if (r.kind === "animatorProperty") {