Merge remote-tracking branch 'origin/main' into HEAD

This commit is contained in:
bflatastic
2026-10-30 07:04:56 +07:00
62 changed files with 1807 additions and 150 deletions
+8
View File
@@ -185,6 +185,7 @@ pub const SHAPE_ITEMS: &[(&str, &str)] = &[
("trim", "ADBE Vector Filter - Trim"),
("twist", "ADBE Vector Filter - Twist"),
("wiggle", "ADBE Vector Filter - Roughen"),
("wiggler", "ADBE Vector Filter - Wiggler"),
("zigzag", "ADBE Vector Filter - Zigzag"),
];
@@ -246,6 +247,12 @@ const SHAPE_PROPS: &[(&str, &str, &str)] = &[
("pucker", "amount", "ADBE Vector PuckerBloat Amount"),
("twist", "angle", "ADBE Vector Twist Angle"),
("twist", "center", "ADBE Vector Twist Center"),
("wiggler", "speed", "ADBE Vector Xform Temporal Freq"),
("wiggler", "correlation", "ADBE Vector Correlation"),
("wiggler", "phase", "ADBE Vector Temporal Phase"),
("wiggler", "spatialPhase", "ADBE Vector Spatial Phase"),
("wiggler", "seed", "ADBE Vector Random Seed"),
("wiggler", "transform", "ADBE Vector Wiggler Transform"),
("merge", "mode", "ADBE Vector Merge Type"),
("wiggle", "size", "ADBE Vector Roughen Size"),
("wiggle", "detail", "ADBE Vector Roughen Detail"),
@@ -439,6 +446,7 @@ pub fn shape_kind(name: &str) -> Option<&'static str> {
"twist" => "twist",
"zigzag" => "zigzag",
"wigglepaths" => "wiggle",
"wiggletransform" => "wiggler",
"mergepaths" => "merge",
_ => return None,
})
+2 -1
View File
@@ -1706,7 +1706,8 @@ Object.defineProperty(FootageItem.prototype, "mainSource", {
return this.__mainSource;
},
});
FootageItem.prototype.replace = function (f) { __call("file.replaceFootage", { item: this.__id, path: __str(f) }); };
// replace() swaps in one file, even a numbered still (replaceWithSequence brings a run), as in After Effects.
FootageItem.prototype.replace = function (f) { __call("file.replaceFootage", { item: this.__id, path: __str(f), sequence: false }); };
FootageItem.prototype.replaceWithSequence = function (f, forceAlphabetical) {
__call("file.replaceFootage", { item: this.__id, path: __str(f), sequence: true, alphabetical: !!forceAlphabetical });
};
+30
View File
@@ -372,6 +372,31 @@ fn match_names_and_lookups() {
assert_eq!(sh.props.prop("contents/#1/contents/fill/color").unwrap().value, KV::Color([1.0, 0.0, 0.0, 1.0]));
}
/// Scripts add a Wiggle Transform by its match name or display name and reach its properties.
#[test]
fn wiggle_transform_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 root = sh.property("ADBE Root Vectors Group");
var w = root.addProperty("ADBE Vector Filter - Wiggler");
var byName = root.addProperty("Wiggle Transform");
w.property("ADBE Vector Wiggler Transform").property("Position").setValue([20, 10]);
[
w.matchName, w.name, byName.matchName, w.property("ADBE Vector Xform Temporal Freq").value,
w.property("ADBE Vector Spatial Phase").name, w.property("ADBE Vector Wiggler Transform").name
]
"#,
);
assert_eq!(o.result, json!(["ADBE Vector Filter - Wiggler", "Wiggle Transform 1", "ADBE Vector Filter - Wiggler", 2, "Spatial Phase", "Transform"]));
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/wiggler/transform/position").unwrap().value, KV::Vec2([20.0, 10.0]));
}
#[test]
fn keyframes_eases_and_interpolation() {
let mut s = session();
@@ -1063,6 +1088,11 @@ fn footage_proxies_sequences_and_conform_rate() {
let paths: Vec<String> =
s.project.items.values().filter_map(|i| if let ItemKind::Footage(f) = &i.kind { Some(f.path.replace('\\', "/")) } else { None }).collect();
assert!(paths.iter().any(|f| f.contains("take_")), "replaced with the take sequence: {paths:?}");
// replace() swaps in the one file, even a numbered still, as in After Effects.
ok(&mut s, &format!("app.project.item(1).replace(new File('{}'))", p("shot_0002.png")));
let kinds: Vec<_> =
s.project.items.values().filter_map(|i| if let ItemKind::Footage(f) = &i.kind { Some((f.kind, f.path.replace('\\', "/"))) } else { None }).collect();
assert!(kinds.iter().any(|(k, f)| *k == effectcraft_engine::project::FootageKind::Still && f.ends_with("shot_0002.png")), "{kinds:?}");
let _ = std::fs::remove_dir_all(&dir);
}