mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-17 15:45:34 +00:00
#3538: layer keys and render reads include OCIO files and a config's LUTs
This commit is contained in:
3 files changed
+59
-11
No files matched your search
+2
-5
@@ -175,11 +175,8 @@ impl Dependencies<'_> {
|
||||
// Properties overrides, which the render applies: a LUT file one of
|
||||
// them names is read too (#3493).
|
||||
for o in crate::fx_host::essential_overrides(ctx, layer) {
|
||||
if let effectcraft_keyframe::Value::Str(src) = &o.value
|
||||
&& let Some(path) = effectcraft_effects::lut_file(src)
|
||||
{
|
||||
crate::reads::ReadFile::new(path, crate::reads::FileStamp::native(path).unwrap_or(crate::reads::FileStamp::Missing))
|
||||
.hash(self.h);
|
||||
if let effectcraft_keyframe::Value::Str(src) = &o.value {
|
||||
crate::reads::source_files(src).hash(self.h);
|
||||
}
|
||||
}
|
||||
let nested = EvalCtx::new(ctx.project, item, comp, time);
|
||||
|
||||
@@ -65,20 +65,31 @@ impl ReadFile {
|
||||
}
|
||||
}
|
||||
|
||||
/// The LUT files effect `g` of `layer` reads at the context time (Apply Color LUT, Lumetri's
|
||||
/// Input LUT and Look), each with its identity now. A layer's cache key holds them and a render
|
||||
/// The files effect `g` of `layer` reads at the context time (Apply Color LUT, Lumetri's Input
|
||||
/// LUT and Look, OCIO File Transform, a custom OCIO config and its LUTs: see
|
||||
/// [`effectcraft_effects::lut_params`]), each with its identity now. A layer's cache key holds them and a render
|
||||
/// notes them, so what was made with a file that changed since is not used (#3493).
|
||||
pub(crate) fn lut_files(ctx: &crate::EvalCtx, layer: &effectcraft_project::Layer, g: &effectcraft_project::PropGroup) -> Vec<ReadFile> {
|
||||
let effectcraft_project::GroupKind::Effect { effect } = &g.kind else { return Vec::new() };
|
||||
effectcraft_effects::lut_params(effect)
|
||||
.iter()
|
||||
.filter_map(|param| match ctx.value(layer, g.prop(param)?) {
|
||||
effectcraft_keyframe::Value::Str(src) => {
|
||||
let path = effectcraft_effects::lut_file(&src)?;
|
||||
Some(ReadFile::new(path, FileStamp::native(path).unwrap_or(FileStamp::Missing)))
|
||||
}
|
||||
effectcraft_keyframe::Value::Str(src) => Some(source_files(&src)),
|
||||
_ => None,
|
||||
})
|
||||
.flatten()
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// The files a file parameter set to `src` reads (an OCIO config's also the LUTs it names, #3538),
|
||||
/// each with its identity now.
|
||||
pub(crate) fn source_files(src: &str) -> Vec<ReadFile> {
|
||||
effectcraft_effects::lut_files(src)
|
||||
.into_iter()
|
||||
.map(|path| {
|
||||
let stamp = FileStamp::native(&path).unwrap_or(FileStamp::Missing);
|
||||
ReadFile::new(path, stamp)
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user