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:
co-authored by
Claude Opus 5.5
parent
470ea7a3af
commit
f816cd5e38
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user