Fix crash when using Imaginate tool (#1064)

Fix crash when using imaginate tool
This commit is contained in:
0HyperCube
2023-03-02 21:14:12 +00:00
committed by Keavon Chambers
parent 66ec85a3c9
commit 7e37fb41a4
5 changed files with 7 additions and 9 deletions
@@ -651,7 +651,6 @@ pub static IMAGINATE_NODE: Lazy<DocumentNodeType> = 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),
@@ -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