Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ mod structure;
mod types;
#[cfg(test)]
mod validation;
mod view;

pub use types::*;
pub use view::{NetworkError, NetworkView};
Comment thread
Keavon marked this conversation as resolved.

use super::document_metadata::{DocumentMetadata, LayerNodeIdentifier, NodeRelations};
use super::misc::PTZ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,7 @@ impl NodeNetworkInterface {
}

pub fn is_eligible_to_be_layer(&self, node_id: &NodeId, network_path: &[NodeId]) -> bool {
let Some(node) = self.document_node(node_id, network_path) else {
log::error!("Could not get node {node_id} in is_eligible_to_be_layer");
return false;
};
let input_count = node.inputs.iter().take(2).filter(|input| input.is_exposed()).count();
let parameters_hidden = node.inputs.iter().skip(2).all(|input| !input.is_exposed());
let output_count = self.number_of_outputs(node_id, network_path);

!self.hidden_primary_output(node_id, network_path) && output_count == 1 && (input_count <= 2) && parameters_hidden
self.query(network_path, "is_eligible_to_be_layer", |view| view.is_eligible_to_be_layer(node_id)).unwrap_or_default()
}

pub fn node_graph_ptz(&self, network_path: &[NodeId]) -> Option<&PTZ> {
Expand Down
Loading
Loading