Sample footage pixels in script expressions (#1000)
A script reading an expression that calls sampleImage on a footage layer got [0,0,0,0]: the script evaluator built its EvalCtx with EvalCtx::new, which has no footage source, so the renderer substituted transparent frames (solids and shapes stayed correct because they are procedural). Pass the session's footage source, as the app's renderer and diagnostics already do.
This commit is contained in:
@@ -468,6 +468,9 @@ fn value(s: &Session, a: &J) -> R {
|
||||
} else {
|
||||
let mut ctx = EvalCtx::new(&s.project, cid, c, t);
|
||||
ctx.expr = s.expr.as_deref();
|
||||
// Sample expressions (`sampleImage`) read footage through the session's source; without
|
||||
// it footage layers sample as transparent (#1000).
|
||||
ctx.footage = Some(s.footage.as_ref());
|
||||
ctx.value(l, p)
|
||||
};
|
||||
Ok(js_value(c, &v))
|
||||
|
||||
Reference in New Issue
Block a user