diff --git a/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler/document_node_types.rs b/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler/document_node_types.rs index 7c444e6f..d4022b9d 100644 --- a/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler/document_node_types.rs +++ b/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler/document_node_types.rs @@ -651,7 +651,6 @@ pub static IMAGINATE_NODE: Lazy = Lazy::new(|| DocumentNodeTyp identifier: NodeImplementation::proto("graphene_std::raster::ImaginateNode<_>"), inputs: vec![ DocumentInputType::value("Input Image", TaggedValue::ImageFrame(ImageFrame::empty()), true), - DocumentInputType::value("Transform", TaggedValue::DAffine2(DAffine2::IDENTITY), false), DocumentInputType::value("Seed", TaggedValue::F64(0.), false), // Remember to keep index used in `NodeGraphFrameImaginateRandom` updated with this entry's index DocumentInputType::value("Resolution", TaggedValue::OptionalDVec2(None), false), DocumentInputType::value("Samples", TaggedValue::F64(30.), false), diff --git a/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler/node_properties.rs b/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler/node_properties.rs index f17a703b..7ae4609c 100644 --- a/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler/node_properties.rs +++ b/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler/node_properties.rs @@ -454,7 +454,6 @@ pub fn imaginate_properties(document_node: &DocumentNode, node_id: NodeId, conte let layer_path = context.layer_path.to_vec(); let resolve_input = |name: &str| IMAGINATE_NODE.inputs.iter().position(|input| input.name == name).unwrap_or_else(|| panic!("Input {name} not found")); - let transform_index = resolve_input("Transform"); let seed_index = resolve_input("Seed"); let resolution_index = resolve_input("Resolution"); let samples_index = resolve_input("Samples"); @@ -523,7 +522,7 @@ pub fn imaginate_properties(document_node: &DocumentNode, node_id: NodeId, conte true }; - let transform_not_connected = matches!(document_node.inputs[transform_index], NodeInput::Value { .. }); + let transform_not_connected = false; let progress = { // Since we don't serialize the status, we need to derive from other state whether the Idle state is actually supposed to be the Terminated state diff --git a/editor/src/messages/tool/tool_messages/imaginate_tool.rs b/editor/src/messages/tool/tool_messages/imaginate_tool.rs index e600099a..ca7a8f2b 100644 --- a/editor/src/messages/tool/tool_messages/imaginate_tool.rs +++ b/editor/src/messages/tool/tool_messages/imaginate_tool.rs @@ -124,13 +124,12 @@ impl Fsm for ImaginateToolFsmState { let mut imaginate_inputs: Vec = imaginate_node_type.inputs.iter().map(|input| input.default.clone()).collect(); imaginate_inputs[0] = NodeInput::node(0, 0); - imaginate_inputs[1] = NodeInput::node(0, 1); let imaginate_node_id = 100; - let mut network = node_graph::new_image_network(32, imaginate_node_id); + let mut network = node_graph::new_image_network(16, imaginate_node_id); network.nodes.insert( imaginate_node_id, - imaginate_node_type.to_document_node(imaginate_inputs, graph_craft::document::DocumentNodeMetadata::position((20, 3))), + imaginate_node_type.to_document_node(imaginate_inputs, graph_craft::document::DocumentNodeMetadata::position((16, 4))), ); responses.push_back( diff --git a/editor/src/node_graph_executor.rs b/editor/src/node_graph_executor.rs index 9051b90c..314033d6 100644 --- a/editor/src/node_graph_executor.rs +++ b/editor/src/node_graph_executor.rs @@ -121,7 +121,9 @@ impl NodeGraphExecutor { let get = |name: &str| IMAGINATE_NODE.inputs.iter().position(|input| input.name == name).unwrap_or_else(|| panic!("Input {name} not found")); - let transform: DAffine2 = self.compute_input(&network, &imaginate_node, get("Transform"), Cow::Borrowed(&image_frame))?; + // Get the node graph layer + let layer = document.document_legacy.layer(&layer_path).map_err(|e| format!("No layer: {e:?}"))?; + let transform = layer.transform; let resolution: Option = self.compute_input(&network, &imaginate_node, get("Resolution"), Cow::Borrowed(&image_frame))?; let resolution = resolution.unwrap_or_else(|| { diff --git a/node-graph/interpreted-executor/src/node_registry.rs b/node-graph/interpreted-executor/src/node_registry.rs index 1e3e519d..ce1dbe8c 100644 --- a/node-graph/interpreted-executor/src/node_registry.rs +++ b/node-graph/interpreted-executor/src/node_registry.rs @@ -214,7 +214,7 @@ fn node_registry() -> HashMap"), |args| { - let cached = graphene_std::any::input_node::>>(args[16]); + let cached = graphene_std::any::input_node::>>(args[15]); let node = graphene_std::raster::ImaginateNode::new(cached); let any = DynAnyNode::new(ValueNode::new(node)); any.into_type_erased() @@ -223,7 +223,6 @@ fn node_registry() -> HashMap)), (concrete!(()), concrete!(f64)),