Review fixes for the landed batch
- Cryptomatte (#1183): planes shorter than the image read as empty instead of panicking. - layer.addMarker (#1180): a comp marker no longer replaces one at the same time. - Desktop (#1005): ignore macOS's -psn_ argument instead of refusing to launch. - Doc comments put back on their own items (#1153, #1037). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
900b921dbf
commit
3ac283eee4
@@ -386,7 +386,7 @@ type RankPlanes<'a> = [(&'a [f32], &'a [f32])];
|
||||
/// ranks (the Cryptomatte spec's matte), clamped to 0..1.
|
||||
#[inline]
|
||||
fn crypto_matte(planes: &RankPlanes, sel: &[u32], i: usize) -> f32 {
|
||||
planes.iter().map(|(id, c)| (id[i], c[i])).filter(|(id, c)| *c > 0.0 && sel.contains(&id.to_bits())).map(|(_, c)| c).sum::<f32>().clamp(0.0, 1.0)
|
||||
planes.iter().filter_map(|(id, c)| Some((*id.get(i)?, *c.get(i)?))).filter(|(id, c)| *c > 0.0 && sel.contains(&id.to_bits())).map(|(_, c)| c).sum::<f32>().clamp(0.0, 1.0)
|
||||
}
|
||||
|
||||
/// The coverage-weighted ID colours at aux pixel `i` (the spec's preview).
|
||||
@@ -394,7 +394,7 @@ fn crypto_matte(planes: &RankPlanes, sel: &[u32], i: usize) -> f32 {
|
||||
fn crypto_colors(planes: &RankPlanes, i: usize) -> [f32; 3] {
|
||||
let mut c = [0.0f32; 3];
|
||||
for (id, cov) in planes {
|
||||
let (id, cov) = (id[i], cov[i]);
|
||||
let (Some(&id), Some(&cov)) = (id.get(i), cov.get(i)) else { continue };
|
||||
let k = id_color(id);
|
||||
for j in 0..3 {
|
||||
c[j] += k[j] * cov;
|
||||
|
||||
@@ -557,7 +557,6 @@ fn add_marker(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
if ids.is_empty() {
|
||||
s.edit("Add Marker", None, |proj, _| {
|
||||
let c = proj.comp_mut(cid).ok_or(EngineError::NoComp)?;
|
||||
c.markers.retain(|m| m.time != t);
|
||||
c.markers.push(Marker { time: t, comment, ..Default::default() });
|
||||
c.markers.sort_by_key(|m| m.time);
|
||||
Ok(())
|
||||
|
||||
@@ -94,9 +94,6 @@ fn label_index(l: Label) -> usize {
|
||||
Label::ALL.iter().position(|x| *x == l).unwrap_or(0)
|
||||
}
|
||||
|
||||
/// A comp's selected properties as `[layer, uid]`: the selected ones, then those with selected
|
||||
/// keyframes (selecting a keyframe selects its property in After Effects, so scripts find
|
||||
/// selected keys through `selectedProperties`).
|
||||
/// Layer ids selected in `comp`, including a comp that is not the active one (#1001).
|
||||
fn selected_layer_ids(s: &Session, comp: effectcraft_project::ItemId) -> Vec<u64> {
|
||||
let layers = if s.active_comp_id() == Some(comp) {
|
||||
@@ -118,6 +115,9 @@ fn layer_selected(s: &Session, comp: effectcraft_project::ItemId, layer: effectc
|
||||
s.state.comp_selections.get(&comp).is_some_and(|sel| sel.layers.contains(&layer))
|
||||
}
|
||||
|
||||
/// A comp's selected properties as `[layer, uid]`: the selected ones, then those with selected
|
||||
/// keyframes (selecting a keyframe selects its property in After Effects, so scripts find
|
||||
/// selected keys through `selectedProperties`).
|
||||
fn selected_props(s: &Session, c: &effectcraft_project::Comp) -> Vec<J> {
|
||||
let mut v: Vec<(u64, u64)> = vec![];
|
||||
let keyed = s.state.selected_keys.iter().map(|k| (k.layer, k.prop));
|
||||
|
||||
Reference in New Issue
Block a user