Comment out all remaining active Imaginate code
This commit is contained in:
parent
a11f9b36c3
commit
e759e62291
|
|
@ -56,52 +56,52 @@ pub fn commit_info_localized(localized_commit_date: &str) -> String {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
// #[cfg(test)]
|
||||||
mod test {
|
// mod test {
|
||||||
use crate::messages::input_mapper::utility_types::input_mouse::ViewportBounds;
|
// use crate::messages::input_mapper::utility_types::input_mouse::ViewportBounds;
|
||||||
use crate::messages::prelude::*;
|
// use crate::messages::prelude::*;
|
||||||
|
|
||||||
// TODO: Fix and reenable
|
// // TODO: Fix and reenable
|
||||||
#[ignore]
|
// #[ignore]
|
||||||
#[test]
|
// #[test]
|
||||||
fn debug_ub() {
|
// fn debug_ub() {
|
||||||
use super::Message;
|
// use super::Message;
|
||||||
|
|
||||||
let mut editor = super::Editor::new();
|
// let mut editor = super::Editor::new();
|
||||||
let mut responses = Vec::new();
|
// let mut responses = Vec::new();
|
||||||
|
|
||||||
let messages: Vec<Message> = vec![
|
// let messages: Vec<Message> = vec![
|
||||||
Message::Init,
|
// Message::Init,
|
||||||
Message::Preferences(PreferencesMessage::Load {
|
// Message::Preferences(PreferencesMessage::Load {
|
||||||
preferences: r#"{ "imaginate_server_hostname": "http://localhost:7860/", "imaginate_refresh_frequency": 1, "zoom_with_scroll": false }"#.to_string(),
|
// preferences: r#"{ "imaginate_server_hostname": "http://localhost:7860/", "imaginate_refresh_frequency": 1, "zoom_with_scroll": false }"#.to_string(),
|
||||||
}),
|
// }),
|
||||||
PortfolioMessage::OpenDocumentFileWithId {
|
// PortfolioMessage::OpenDocumentFileWithId {
|
||||||
document_id: DocumentId(0),
|
// document_id: DocumentId(0),
|
||||||
document_name: "".into(),
|
// document_name: "".into(),
|
||||||
document_is_auto_saved: true,
|
// document_is_auto_saved: true,
|
||||||
document_is_saved: true,
|
// document_is_saved: true,
|
||||||
document_serialized_content: r#" [removed until test is reenabled] "#.into(),
|
// document_serialized_content: r#" [removed until test is reenabled] "#.into(),
|
||||||
to_front: false,
|
// to_front: false,
|
||||||
}
|
// }
|
||||||
.into(),
|
// .into(),
|
||||||
InputPreprocessorMessage::BoundsOfViewports {
|
// InputPreprocessorMessage::BoundsOfViewports {
|
||||||
bounds_of_viewports: vec![ViewportBounds::from_slice(&[0., 0., 1920., 1080.])],
|
// bounds_of_viewports: vec![ViewportBounds::from_slice(&[0., 0., 1920., 1080.])],
|
||||||
}
|
// }
|
||||||
.into(),
|
// .into(),
|
||||||
];
|
// ];
|
||||||
|
|
||||||
use futures::executor::block_on;
|
// use futures::executor::block_on;
|
||||||
for message in messages {
|
// for message in messages {
|
||||||
block_on(crate::node_graph_executor::run_node_graph());
|
// block_on(crate::node_graph_executor::run_node_graph());
|
||||||
let mut res = VecDeque::new();
|
// let mut res = VecDeque::new();
|
||||||
editor.poll_node_graph_evaluation(&mut res).expect("poll_node_graph_evaluation failed");
|
// editor.poll_node_graph_evaluation(&mut res).expect("poll_node_graph_evaluation failed");
|
||||||
|
|
||||||
let res = editor.handle_message(message);
|
// let res = editor.handle_message(message);
|
||||||
responses.push(res);
|
// responses.push(res);
|
||||||
}
|
// }
|
||||||
let responses = responses.pop().unwrap();
|
// let responses = responses.pop().unwrap();
|
||||||
// let trigger_message = responses[responses.len() - 2].clone();
|
// // let trigger_message = responses[responses.len() - 2].clone();
|
||||||
|
|
||||||
println!("responses: {responses:#?}");
|
// println!("responses: {responses:#?}");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
|
||||||
|
|
@ -179,11 +179,11 @@ pub fn input_mappings() -> Mapping {
|
||||||
entry!(PointerMove; refresh_keys=[Alt, Shift], action_dispatch=RectangleToolMessage::PointerMove { center: Alt, lock_ratio: Shift }),
|
entry!(PointerMove; refresh_keys=[Alt, Shift], action_dispatch=RectangleToolMessage::PointerMove { center: Alt, lock_ratio: Shift }),
|
||||||
//
|
//
|
||||||
// ImaginateToolMessage
|
// ImaginateToolMessage
|
||||||
entry!(KeyDown(MouseLeft); action_dispatch=ImaginateToolMessage::DragStart),
|
// entry!(KeyDown(MouseLeft); action_dispatch=ImaginateToolMessage::DragStart),
|
||||||
entry!(KeyUp(MouseLeft); action_dispatch=ImaginateToolMessage::DragStop),
|
// entry!(KeyUp(MouseLeft); action_dispatch=ImaginateToolMessage::DragStop),
|
||||||
entry!(KeyDown(MouseRight); action_dispatch=ImaginateToolMessage::Abort),
|
// entry!(KeyDown(MouseRight); action_dispatch=ImaginateToolMessage::Abort),
|
||||||
entry!(KeyDown(Escape); action_dispatch=ImaginateToolMessage::Abort),
|
// entry!(KeyDown(Escape); action_dispatch=ImaginateToolMessage::Abort),
|
||||||
entry!(PointerMove; refresh_keys=[Alt, Shift], action_dispatch=ImaginateToolMessage::Resize { center: Alt, lock_ratio: Shift }),
|
// entry!(PointerMove; refresh_keys=[Alt, Shift], action_dispatch=ImaginateToolMessage::Resize { center: Alt, lock_ratio: Shift }),
|
||||||
//
|
//
|
||||||
// EllipseToolMessage
|
// EllipseToolMessage
|
||||||
entry!(KeyDown(MouseLeft); action_dispatch=EllipseToolMessage::DragStart),
|
entry!(KeyDown(MouseLeft); action_dispatch=EllipseToolMessage::DragStart),
|
||||||
|
|
|
||||||
|
|
@ -71,13 +71,13 @@ pub enum DocumentMessage {
|
||||||
GroupSelectedLayers {
|
GroupSelectedLayers {
|
||||||
group_folder_type: GroupFolderType,
|
group_folder_type: GroupFolderType,
|
||||||
},
|
},
|
||||||
ImaginateGenerate {
|
// ImaginateGenerate {
|
||||||
imaginate_node: Vec<NodeId>,
|
// imaginate_node: Vec<NodeId>,
|
||||||
},
|
// },
|
||||||
ImaginateRandom {
|
// ImaginateRandom {
|
||||||
imaginate_node: Vec<NodeId>,
|
// imaginate_node: Vec<NodeId>,
|
||||||
then_generate: bool,
|
// then_generate: bool,
|
||||||
},
|
// },
|
||||||
MoveSelectedLayersTo {
|
MoveSelectedLayersTo {
|
||||||
parent: LayerNodeIdentifier,
|
parent: LayerNodeIdentifier,
|
||||||
insert_index: usize,
|
insert_index: usize,
|
||||||
|
|
|
||||||
|
|
@ -579,37 +579,37 @@ impl MessageHandler<DocumentMessage, DocumentMessageData<'_>> for DocumentMessag
|
||||||
responses.add(NodeGraphMessage::SelectedNodesSet { nodes: new_folders });
|
responses.add(NodeGraphMessage::SelectedNodesSet { nodes: new_folders });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DocumentMessage::ImaginateGenerate { imaginate_node } => {
|
// DocumentMessage::ImaginateGenerate { imaginate_node } => {
|
||||||
let random_value = generate_uuid();
|
// let random_value = generate_uuid();
|
||||||
responses.add(NodeGraphMessage::SetInputValue {
|
// responses.add(NodeGraphMessage::SetInputValue {
|
||||||
node_id: *imaginate_node.last().unwrap(),
|
// node_id: *imaginate_node.last().unwrap(),
|
||||||
// Needs to match the index of the seed parameter in `pub const IMAGINATE_NODE: DocumentNodeDefinition` in `document_node_type.rs`
|
// // Needs to match the index of the seed parameter in `pub const IMAGINATE_NODE: DocumentNodeDefinition` in `document_node_type.rs`
|
||||||
input_index: 17,
|
// input_index: 17,
|
||||||
value: graph_craft::document::value::TaggedValue::U64(random_value),
|
// value: graph_craft::document::value::TaggedValue::U64(random_value),
|
||||||
});
|
// });
|
||||||
|
|
||||||
responses.add(PortfolioMessage::SubmitGraphRender { document_id, ignore_hash: false });
|
// responses.add(PortfolioMessage::SubmitGraphRender { document_id, ignore_hash: false });
|
||||||
}
|
// }
|
||||||
DocumentMessage::ImaginateRandom { imaginate_node, then_generate } => {
|
// DocumentMessage::ImaginateRandom { imaginate_node, then_generate } => {
|
||||||
// Generate a random seed. We only want values between -2^53 and 2^53, because integer values
|
// // Generate a random seed. We only want values between -2^53 and 2^53, because integer values
|
||||||
// outside of this range can get rounded in f64
|
// // outside of this range can get rounded in f64
|
||||||
let random_bits = generate_uuid();
|
// let random_bits = generate_uuid();
|
||||||
let random_value = ((random_bits >> 11) as f64).copysign(f64::from_bits(random_bits & (1 << 63)));
|
// let random_value = ((random_bits >> 11) as f64).copysign(f64::from_bits(random_bits & (1 << 63)));
|
||||||
|
|
||||||
responses.add(DocumentMessage::AddTransaction);
|
// responses.add(DocumentMessage::AddTransaction);
|
||||||
// Set a random seed input
|
// // Set a random seed input
|
||||||
responses.add(NodeGraphMessage::SetInputValue {
|
// responses.add(NodeGraphMessage::SetInputValue {
|
||||||
node_id: *imaginate_node.last().unwrap(),
|
// node_id: *imaginate_node.last().unwrap(),
|
||||||
// Needs to match the index of the seed parameter in `pub const IMAGINATE_NODE: DocumentNodeDefinition` in `document_node_type.rs`
|
// // Needs to match the index of the seed parameter in `pub const IMAGINATE_NODE: DocumentNodeDefinition` in `document_node_type.rs`
|
||||||
input_index: 3,
|
// input_index: 3,
|
||||||
value: graph_craft::document::value::TaggedValue::F64(random_value),
|
// value: graph_craft::document::value::TaggedValue::F64(random_value),
|
||||||
});
|
// });
|
||||||
|
|
||||||
// Generate the image
|
// // Generate the image
|
||||||
if then_generate {
|
// if then_generate {
|
||||||
responses.add(DocumentMessage::ImaginateGenerate { imaginate_node });
|
// responses.add(DocumentMessage::ImaginateGenerate { imaginate_node });
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
DocumentMessage::MoveSelectedLayersTo { parent, insert_index } => {
|
DocumentMessage::MoveSelectedLayersTo { parent, insert_index } => {
|
||||||
if !self.selection_network_path.is_empty() {
|
if !self.selection_network_path.is_empty() {
|
||||||
log::error!("Moving selected layers is only supported for the Document Network");
|
log::error!("Moving selected layers is only supported for the Document Network");
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ use graph_craft::ProtoNodeIdentifier;
|
||||||
use graph_craft::concrete;
|
use graph_craft::concrete;
|
||||||
use graph_craft::document::value::*;
|
use graph_craft::document::value::*;
|
||||||
use graph_craft::document::*;
|
use graph_craft::document::*;
|
||||||
use graph_craft::imaginate_input::ImaginateSamplingMethod;
|
|
||||||
use graphene_core::raster::brush_cache::BrushCache;
|
use graphene_core::raster::brush_cache::BrushCache;
|
||||||
use graphene_core::raster::image::ImageFrameTable;
|
use graphene_core::raster::image::ImageFrameTable;
|
||||||
use graphene_core::raster::{Color, RedGreenBlue, RedGreenBlueAlpha};
|
use graphene_core::raster::{Color, RedGreenBlue, RedGreenBlueAlpha};
|
||||||
|
|
@ -21,8 +20,6 @@ use graphene_core::text::{Font, TypesettingConfig};
|
||||||
use graphene_core::transform::Footprint;
|
use graphene_core::transform::Footprint;
|
||||||
use graphene_core::vector::VectorDataTable;
|
use graphene_core::vector::VectorDataTable;
|
||||||
use graphene_core::*;
|
use graphene_core::*;
|
||||||
use graphene_std::wasm_application_io::WasmEditorApi;
|
|
||||||
use once_cell::sync::Lazy;
|
|
||||||
use std::collections::{HashMap, HashSet, VecDeque};
|
use std::collections::{HashMap, HashSet, VecDeque};
|
||||||
#[cfg(feature = "gpu")]
|
#[cfg(feature = "gpu")]
|
||||||
use wgpu_executor::{Bindgroup, CommandBuffer, PipelineLayout, ShaderHandle, ShaderInputFrame, WgpuShaderInput};
|
use wgpu_executor::{Bindgroup, CommandBuffer, PipelineLayout, ShaderHandle, ShaderInputFrame, WgpuShaderInput};
|
||||||
|
|
@ -2713,127 +2710,127 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||||
custom
|
custom
|
||||||
}
|
}
|
||||||
|
|
||||||
pub static IMAGINATE_NODE: Lazy<DocumentNodeDefinition> = Lazy::new(|| DocumentNodeDefinition {
|
// pub static IMAGINATE_NODE: Lazy<DocumentNodeDefinition> = Lazy::new(|| DocumentNodeDefinition {
|
||||||
identifier: "Imaginate",
|
// identifier: "Imaginate",
|
||||||
category: "Raster",
|
// category: "Raster",
|
||||||
node_template: NodeTemplate {
|
// node_template: NodeTemplate {
|
||||||
document_node: DocumentNode {
|
// document_node: DocumentNode {
|
||||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
// implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||||
exports: vec![NodeInput::node(NodeId(1), 0)],
|
// exports: vec![NodeInput::node(NodeId(1), 0)],
|
||||||
nodes: [
|
// nodes: [
|
||||||
DocumentNode {
|
// DocumentNode {
|
||||||
inputs: vec![NodeInput::network(concrete!(ImageFrameTable<Color>), 0)],
|
// inputs: vec![NodeInput::network(concrete!(ImageFrameTable<Color>), 0)],
|
||||||
implementation: DocumentNodeImplementation::proto("graphene_core::memo::MonitorNode"),
|
// implementation: DocumentNodeImplementation::proto("graphene_core::memo::MonitorNode"),
|
||||||
manual_composition: Some(concrete!(Context)),
|
// manual_composition: Some(concrete!(Context)),
|
||||||
skip_deduplication: true,
|
// skip_deduplication: true,
|
||||||
..Default::default()
|
// ..Default::default()
|
||||||
},
|
// },
|
||||||
DocumentNode {
|
// DocumentNode {
|
||||||
inputs: vec![
|
// inputs: vec![
|
||||||
NodeInput::node(NodeId(0), 0),
|
// NodeInput::node(NodeId(0), 0),
|
||||||
NodeInput::network(concrete!(&WasmEditorApi), 1),
|
// NodeInput::network(concrete!(&WasmEditorApi), 1),
|
||||||
NodeInput::network(concrete!(ImaginateController), 2),
|
// NodeInput::network(concrete!(ImaginateController), 2),
|
||||||
NodeInput::network(concrete!(f64), 3),
|
// NodeInput::network(concrete!(f64), 3),
|
||||||
NodeInput::network(concrete!(Option<DVec2>), 4),
|
// NodeInput::network(concrete!(Option<DVec2>), 4),
|
||||||
NodeInput::network(concrete!(u32), 5),
|
// NodeInput::network(concrete!(u32), 5),
|
||||||
NodeInput::network(concrete!(ImaginateSamplingMethod), 6),
|
// NodeInput::network(concrete!(ImaginateSamplingMethod), 6),
|
||||||
NodeInput::network(concrete!(f64), 7),
|
// NodeInput::network(concrete!(f64), 7),
|
||||||
NodeInput::network(concrete!(String), 8),
|
// NodeInput::network(concrete!(String), 8),
|
||||||
NodeInput::network(concrete!(String), 9),
|
// NodeInput::network(concrete!(String), 9),
|
||||||
NodeInput::network(concrete!(bool), 10),
|
// NodeInput::network(concrete!(bool), 10),
|
||||||
NodeInput::network(concrete!(f64), 11),
|
// NodeInput::network(concrete!(f64), 11),
|
||||||
NodeInput::network(concrete!(bool), 12),
|
// NodeInput::network(concrete!(bool), 12),
|
||||||
NodeInput::network(concrete!(f64), 13),
|
// NodeInput::network(concrete!(f64), 13),
|
||||||
NodeInput::network(concrete!(ImaginateMaskStartingFill), 14),
|
// NodeInput::network(concrete!(ImaginateMaskStartingFill), 14),
|
||||||
NodeInput::network(concrete!(bool), 15),
|
// NodeInput::network(concrete!(bool), 15),
|
||||||
NodeInput::network(concrete!(bool), 16),
|
// NodeInput::network(concrete!(bool), 16),
|
||||||
NodeInput::network(concrete!(u64), 17),
|
// NodeInput::network(concrete!(u64), 17),
|
||||||
],
|
// ],
|
||||||
implementation: DocumentNodeImplementation::proto("graphene_std::raster::ImaginateNode"),
|
// implementation: DocumentNodeImplementation::proto("graphene_std::raster::ImaginateNode"),
|
||||||
..Default::default()
|
// ..Default::default()
|
||||||
},
|
// },
|
||||||
]
|
// ]
|
||||||
.into_iter()
|
// .into_iter()
|
||||||
.enumerate()
|
// .enumerate()
|
||||||
.map(|(id, node)| (NodeId(id as u64), node))
|
// .map(|(id, node)| (NodeId(id as u64), node))
|
||||||
.collect(),
|
// .collect(),
|
||||||
..Default::default()
|
// ..Default::default()
|
||||||
}),
|
// }),
|
||||||
inputs: vec![
|
// inputs: vec![
|
||||||
NodeInput::value(TaggedValue::ImageFrame(ImageFrameTable::one_empty_image()), true),
|
// NodeInput::value(TaggedValue::ImageFrame(ImageFrameTable::one_empty_image()), true),
|
||||||
NodeInput::scope("editor-api"),
|
// NodeInput::scope("editor-api"),
|
||||||
NodeInput::value(TaggedValue::ImaginateController(Default::default()), false),
|
// NodeInput::value(TaggedValue::ImaginateController(Default::default()), false),
|
||||||
NodeInput::value(TaggedValue::F64(0.), false), // Remember to keep index used in `ImaginateRandom` updated with this entry's index
|
// NodeInput::value(TaggedValue::F64(0.), false), // Remember to keep index used in `ImaginateRandom` updated with this entry's index
|
||||||
NodeInput::value(TaggedValue::OptionalDVec2(None), false),
|
// NodeInput::value(TaggedValue::OptionalDVec2(None), false),
|
||||||
NodeInput::value(TaggedValue::U32(30), false),
|
// NodeInput::value(TaggedValue::U32(30), false),
|
||||||
NodeInput::value(TaggedValue::ImaginateSamplingMethod(ImaginateSamplingMethod::EulerA), false),
|
// NodeInput::value(TaggedValue::ImaginateSamplingMethod(ImaginateSamplingMethod::EulerA), false),
|
||||||
NodeInput::value(TaggedValue::F64(7.5), false),
|
// NodeInput::value(TaggedValue::F64(7.5), false),
|
||||||
NodeInput::value(TaggedValue::String(String::new()), false),
|
// NodeInput::value(TaggedValue::String(String::new()), false),
|
||||||
NodeInput::value(TaggedValue::String(String::new()), false),
|
// NodeInput::value(TaggedValue::String(String::new()), false),
|
||||||
NodeInput::value(TaggedValue::Bool(false), false),
|
// NodeInput::value(TaggedValue::Bool(false), false),
|
||||||
NodeInput::value(TaggedValue::F64(66.), false),
|
// NodeInput::value(TaggedValue::F64(66.), false),
|
||||||
NodeInput::value(TaggedValue::Bool(true), false),
|
// NodeInput::value(TaggedValue::Bool(true), false),
|
||||||
NodeInput::value(TaggedValue::F64(4.), false),
|
// NodeInput::value(TaggedValue::F64(4.), false),
|
||||||
NodeInput::value(TaggedValue::ImaginateMaskStartingFill(ImaginateMaskStartingFill::Fill), false),
|
// NodeInput::value(TaggedValue::ImaginateMaskStartingFill(ImaginateMaskStartingFill::Fill), false),
|
||||||
NodeInput::value(TaggedValue::Bool(false), false),
|
// NodeInput::value(TaggedValue::Bool(false), false),
|
||||||
NodeInput::value(TaggedValue::Bool(false), false),
|
// NodeInput::value(TaggedValue::Bool(false), false),
|
||||||
NodeInput::value(TaggedValue::U64(0), false),
|
// NodeInput::value(TaggedValue::U64(0), false),
|
||||||
],
|
// ],
|
||||||
..Default::default()
|
// ..Default::default()
|
||||||
},
|
// },
|
||||||
persistent_node_metadata: DocumentNodePersistentMetadata {
|
// persistent_node_metadata: DocumentNodePersistentMetadata {
|
||||||
network_metadata: Some(NodeNetworkMetadata {
|
// network_metadata: Some(NodeNetworkMetadata {
|
||||||
persistent_metadata: NodeNetworkPersistentMetadata {
|
// persistent_metadata: NodeNetworkPersistentMetadata {
|
||||||
node_metadata: [
|
// node_metadata: [
|
||||||
DocumentNodeMetadata {
|
// DocumentNodeMetadata {
|
||||||
persistent_metadata: DocumentNodePersistentMetadata {
|
// persistent_metadata: DocumentNodePersistentMetadata {
|
||||||
display_name: "Monitor".to_string(),
|
// display_name: "Monitor".to_string(),
|
||||||
..Default::default()
|
// ..Default::default()
|
||||||
},
|
// },
|
||||||
..Default::default()
|
// ..Default::default()
|
||||||
},
|
// },
|
||||||
DocumentNodeMetadata {
|
// DocumentNodeMetadata {
|
||||||
persistent_metadata: DocumentNodePersistentMetadata {
|
// persistent_metadata: DocumentNodePersistentMetadata {
|
||||||
display_name: "Imaginate".to_string(),
|
// display_name: "Imaginate".to_string(),
|
||||||
..Default::default()
|
// ..Default::default()
|
||||||
},
|
// },
|
||||||
..Default::default()
|
// ..Default::default()
|
||||||
},
|
// },
|
||||||
]
|
// ]
|
||||||
.into_iter()
|
// .into_iter()
|
||||||
.enumerate()
|
// .enumerate()
|
||||||
.map(|(id, node)| (NodeId(id as u64), node))
|
// .map(|(id, node)| (NodeId(id as u64), node))
|
||||||
.collect(),
|
// .collect(),
|
||||||
..Default::default()
|
// ..Default::default()
|
||||||
},
|
// },
|
||||||
..Default::default()
|
// ..Default::default()
|
||||||
}),
|
// }),
|
||||||
input_properties: vec![
|
// input_properties: vec![
|
||||||
"Input Image".into(),
|
// "Input Image".into(),
|
||||||
"Editor Api".into(),
|
// "Editor Api".into(),
|
||||||
"Controller".into(),
|
// "Controller".into(),
|
||||||
"Seed".into(),
|
// "Seed".into(),
|
||||||
"Resolution".into(),
|
// "Resolution".into(),
|
||||||
"Samples".into(),
|
// "Samples".into(),
|
||||||
"Sampling Method".into(),
|
// "Sampling Method".into(),
|
||||||
"Prompt Guidance".into(),
|
// "Prompt Guidance".into(),
|
||||||
"Prompt".into(),
|
// "Prompt".into(),
|
||||||
"Negative Prompt".into(),
|
// "Negative Prompt".into(),
|
||||||
"Adapt Input Image".into(),
|
// "Adapt Input Image".into(),
|
||||||
"Image Creativity".into(),
|
// "Image Creativity".into(),
|
||||||
"Inpaint".into(),
|
// "Inpaint".into(),
|
||||||
"Mask Blur".into(),
|
// "Mask Blur".into(),
|
||||||
"Mask Starting Fill".into(),
|
// "Mask Starting Fill".into(),
|
||||||
"Improve Faces".into(),
|
// "Improve Faces".into(),
|
||||||
"Tiling".into(),
|
// "Tiling".into(),
|
||||||
],
|
// ],
|
||||||
output_names: vec!["Image".to_string()],
|
// output_names: vec!["Image".to_string()],
|
||||||
..Default::default()
|
// ..Default::default()
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
description: Cow::Borrowed("TODO"),
|
// description: Cow::Borrowed("TODO"),
|
||||||
properties: None, // Some(&node_properties::imaginate_properties),
|
// properties: None, // Some(&node_properties::imaginate_properties),
|
||||||
});
|
// });
|
||||||
|
|
||||||
type NodeProperties = HashMap<String, Box<dyn Fn(NodeId, &mut NodePropertiesContext) -> Vec<LayoutGroup> + Send + Sync>>;
|
type NodeProperties = HashMap<String, Box<dyn Fn(NodeId, &mut NodePropertiesContext) -> Vec<LayoutGroup> + Send + Sync>>;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1354,7 +1354,7 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphHandlerData<'a>> for NodeGrap
|
||||||
responses.add(PropertiesPanelMessage::Refresh);
|
responses.add(PropertiesPanelMessage::Refresh);
|
||||||
if (network_interface
|
if (network_interface
|
||||||
.reference(&node_id, selection_network_path)
|
.reference(&node_id, selection_network_path)
|
||||||
.is_none_or(|reference| *reference != Some("Imaginate".to_string()))
|
.is_none_or(|reference| *reference != Some("Imaginate".to_string())) // TODO: Potentially remove the reference to Imaginate
|
||||||
|| input_index == 0)
|
|| input_index == 0)
|
||||||
&& network_interface.connected_to_output(&node_id, selection_network_path)
|
&& network_interface.connected_to_output(&node_id, selection_network_path)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ use glam::{DAffine2, DVec2, IVec2, UVec2};
|
||||||
use graph_craft::Type;
|
use graph_craft::Type;
|
||||||
use graph_craft::document::value::TaggedValue;
|
use graph_craft::document::value::TaggedValue;
|
||||||
use graph_craft::document::{DocumentNode, DocumentNodeImplementation, NodeId, NodeInput};
|
use graph_craft::document::{DocumentNode, DocumentNodeImplementation, NodeId, NodeInput};
|
||||||
use graph_craft::imaginate_input::{ImaginateMaskStartingFill, ImaginateSamplingMethod};
|
|
||||||
use graphene_core::raster::curve::Curve;
|
use graphene_core::raster::curve::Curve;
|
||||||
use graphene_core::raster::image::ImageFrameTable;
|
use graphene_core::raster::image::ImageFrameTable;
|
||||||
use graphene_core::raster::{
|
use graphene_core::raster::{
|
||||||
|
|
@ -215,38 +214,38 @@ pub(crate) fn property_from_type(
|
||||||
Some(x) if x == TypeId::of::<BooleanOperation>() => boolean_operation_radio_buttons(document_node, node_id, index, name, true),
|
Some(x) if x == TypeId::of::<BooleanOperation>() => boolean_operation_radio_buttons(document_node, node_id, index, name, true),
|
||||||
Some(x) if x == TypeId::of::<CentroidType>() => centroid_widget(document_node, node_id, index),
|
Some(x) if x == TypeId::of::<CentroidType>() => centroid_widget(document_node, node_id, index),
|
||||||
Some(x) if x == TypeId::of::<LuminanceCalculation>() => luminance_calculation(document_node, node_id, index, name, true),
|
Some(x) if x == TypeId::of::<LuminanceCalculation>() => luminance_calculation(document_node, node_id, index, name, true),
|
||||||
Some(x) if x == TypeId::of::<ImaginateSamplingMethod>() => vec![
|
// Some(x) if x == TypeId::of::<ImaginateSamplingMethod>() => vec![
|
||||||
DropdownInput::new(
|
// DropdownInput::new(
|
||||||
ImaginateSamplingMethod::list()
|
// ImaginateSamplingMethod::list()
|
||||||
.into_iter()
|
// .into_iter()
|
||||||
.map(|method| {
|
// .map(|method| {
|
||||||
vec![MenuListEntry::new(format!("{:?}", method)).label(method.to_string()).on_update(update_value(
|
// vec![MenuListEntry::new(format!("{:?}", method)).label(method.to_string()).on_update(update_value(
|
||||||
move |_| TaggedValue::ImaginateSamplingMethod(method),
|
// move |_| TaggedValue::ImaginateSamplingMethod(method),
|
||||||
node_id,
|
// node_id,
|
||||||
index,
|
// index,
|
||||||
))]
|
// ))]
|
||||||
})
|
// })
|
||||||
.collect(),
|
// .collect(),
|
||||||
)
|
// )
|
||||||
.widget_holder(),
|
// .widget_holder(),
|
||||||
]
|
// ]
|
||||||
.into(),
|
// .into(),
|
||||||
Some(x) if x == TypeId::of::<ImaginateMaskStartingFill>() => vec![
|
// Some(x) if x == TypeId::of::<ImaginateMaskStartingFill>() => vec![
|
||||||
DropdownInput::new(
|
// DropdownInput::new(
|
||||||
ImaginateMaskStartingFill::list()
|
// ImaginateMaskStartingFill::list()
|
||||||
.into_iter()
|
// .into_iter()
|
||||||
.map(|fill| {
|
// .map(|fill| {
|
||||||
vec![MenuListEntry::new(format!("{:?}", fill)).label(fill.to_string()).on_update(update_value(
|
// vec![MenuListEntry::new(format!("{:?}", fill)).label(fill.to_string()).on_update(update_value(
|
||||||
move |_| TaggedValue::ImaginateMaskStartingFill(fill),
|
// move |_| TaggedValue::ImaginateMaskStartingFill(fill),
|
||||||
node_id,
|
// node_id,
|
||||||
index,
|
// index,
|
||||||
))]
|
// ))]
|
||||||
})
|
// })
|
||||||
.collect(),
|
// .collect(),
|
||||||
)
|
// )
|
||||||
.widget_holder(),
|
// .widget_holder(),
|
||||||
]
|
// ]
|
||||||
.into(),
|
// .into(),
|
||||||
_ => {
|
_ => {
|
||||||
let mut widgets = start_widgets(document_node, node_id, index, name, FrontendGraphDataType::General, true);
|
let mut widgets = start_widgets(document_node, node_id, index, name, FrontendGraphDataType::General, true);
|
||||||
widgets.extend_from_slice(&[
|
widgets.extend_from_slice(&[
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
use graphene_std::imaginate::ImaginatePersistentData;
|
|
||||||
use graphene_std::text::FontCache;
|
use graphene_std::text::FontCache;
|
||||||
|
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
pub struct PersistentData {
|
pub struct PersistentData {
|
||||||
pub font_cache: FontCache,
|
pub font_cache: FontCache,
|
||||||
pub imaginate: ImaginatePersistentData,
|
|
||||||
pub use_vello: bool,
|
pub use_vello: bool,
|
||||||
|
// pub imaginate: ImaginatePersistentData,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, Clone, Copy, Default, Debug, serde::Serialize, serde::Deserialize)]
|
#[derive(PartialEq, Eq, Clone, Copy, Default, Debug, serde::Serialize, serde::Deserialize)]
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ use graph_craft::wasm_application_io::EditorPreferences;
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize, specta::Type)]
|
#[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize, specta::Type)]
|
||||||
pub struct PreferencesMessageHandler {
|
pub struct PreferencesMessageHandler {
|
||||||
pub imaginate_server_hostname: String,
|
// pub imaginate_server_hostname: String,
|
||||||
pub imaginate_refresh_frequency: f64,
|
// pub imaginate_refresh_frequency: f64,
|
||||||
pub selection_mode: SelectionMode,
|
pub selection_mode: SelectionMode,
|
||||||
pub zoom_with_scroll: bool,
|
pub zoom_with_scroll: bool,
|
||||||
pub use_vello: bool,
|
pub use_vello: bool,
|
||||||
|
|
@ -24,7 +24,7 @@ impl PreferencesMessageHandler {
|
||||||
|
|
||||||
pub fn editor_preferences(&self) -> EditorPreferences {
|
pub fn editor_preferences(&self) -> EditorPreferences {
|
||||||
EditorPreferences {
|
EditorPreferences {
|
||||||
imaginate_hostname: self.imaginate_server_hostname.clone(),
|
// imaginate_hostname: self.imaginate_server_hostname.clone(),
|
||||||
use_vello: self.use_vello && self.supports_wgpu(),
|
use_vello: self.use_vello && self.supports_wgpu(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -36,17 +36,12 @@ impl PreferencesMessageHandler {
|
||||||
|
|
||||||
impl Default for PreferencesMessageHandler {
|
impl Default for PreferencesMessageHandler {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
let EditorPreferences {
|
|
||||||
imaginate_hostname: host_name,
|
|
||||||
use_vello,
|
|
||||||
} = Default::default();
|
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
imaginate_server_hostname: host_name,
|
// imaginate_server_hostname: EditorPreferences::default().imaginate_hostname,
|
||||||
imaginate_refresh_frequency: 1.,
|
// imaginate_refresh_frequency: 1.,
|
||||||
selection_mode: SelectionMode::Touched,
|
selection_mode: SelectionMode::Touched,
|
||||||
zoom_with_scroll: matches!(MappingVariant::default(), MappingVariant::ZoomWithScroll),
|
zoom_with_scroll: matches!(MappingVariant::default(), MappingVariant::ZoomWithScroll),
|
||||||
use_vello,
|
use_vello: EditorPreferences::default().use_vello,
|
||||||
vector_meshes: false,
|
vector_meshes: false,
|
||||||
graph_wire_style: GraphWireStyle::default(),
|
graph_wire_style: GraphWireStyle::default(),
|
||||||
viewport_zoom_wheel_rate: VIEWPORT_ZOOM_WHEEL_RATE,
|
viewport_zoom_wheel_rate: VIEWPORT_ZOOM_WHEEL_RATE,
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ pub use crate::messages::tool::tool_messages::eyedropper_tool::{EyedropperToolMe
|
||||||
pub use crate::messages::tool::tool_messages::fill_tool::{FillToolMessage, FillToolMessageDiscriminant};
|
pub use crate::messages::tool::tool_messages::fill_tool::{FillToolMessage, FillToolMessageDiscriminant};
|
||||||
pub use crate::messages::tool::tool_messages::freehand_tool::{FreehandToolMessage, FreehandToolMessageDiscriminant};
|
pub use crate::messages::tool::tool_messages::freehand_tool::{FreehandToolMessage, FreehandToolMessageDiscriminant};
|
||||||
pub use crate::messages::tool::tool_messages::gradient_tool::{GradientToolMessage, GradientToolMessageDiscriminant};
|
pub use crate::messages::tool::tool_messages::gradient_tool::{GradientToolMessage, GradientToolMessageDiscriminant};
|
||||||
pub use crate::messages::tool::tool_messages::imaginate_tool::{ImaginateToolMessage, ImaginateToolMessageDiscriminant};
|
// pub use crate::messages::tool::tool_messages::imaginate_tool::{ImaginateToolMessage, ImaginateToolMessageDiscriminant};
|
||||||
pub use crate::messages::tool::tool_messages::line_tool::{LineToolMessage, LineToolMessageDiscriminant};
|
pub use crate::messages::tool::tool_messages::line_tool::{LineToolMessage, LineToolMessageDiscriminant};
|
||||||
pub use crate::messages::tool::tool_messages::navigate_tool::{NavigateToolMessage, NavigateToolMessageDiscriminant};
|
pub use crate::messages::tool::tool_messages::navigate_tool::{NavigateToolMessage, NavigateToolMessageDiscriminant};
|
||||||
pub use crate::messages::tool::tool_messages::path_tool::{PathToolMessage, PathToolMessageDiscriminant};
|
pub use crate::messages::tool::tool_messages::path_tool::{PathToolMessage, PathToolMessageDiscriminant};
|
||||||
|
|
|
||||||
|
|
@ -54,8 +54,8 @@ pub enum ToolMessage {
|
||||||
// Relight(RelightToolMessage),
|
// Relight(RelightToolMessage),
|
||||||
// // #[child]
|
// // #[child]
|
||||||
// Detail(DetailToolMessage),
|
// Detail(DetailToolMessage),
|
||||||
#[child]
|
// #[child]
|
||||||
Imaginate(ImaginateToolMessage),
|
// Imaginate(ImaginateToolMessage),
|
||||||
|
|
||||||
// Messages
|
// Messages
|
||||||
ActivateToolSelect,
|
ActivateToolSelect,
|
||||||
|
|
@ -76,8 +76,8 @@ pub enum ToolMessage {
|
||||||
ActivateToolPolygon,
|
ActivateToolPolygon,
|
||||||
|
|
||||||
ActivateToolBrush,
|
ActivateToolBrush,
|
||||||
ActivateToolImaginate,
|
// ActivateToolImaginate,
|
||||||
|
//
|
||||||
ActivateTool {
|
ActivateTool {
|
||||||
tool_type: ToolType,
|
tool_type: ToolType,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -64,8 +64,7 @@ impl MessageHandler<ToolMessage, ToolMessageData<'_>> for ToolMessageHandler {
|
||||||
ToolMessage::ActivateToolPolygon => responses.add_front(ToolMessage::ActivateTool { tool_type: ToolType::Polygon }),
|
ToolMessage::ActivateToolPolygon => responses.add_front(ToolMessage::ActivateTool { tool_type: ToolType::Polygon }),
|
||||||
|
|
||||||
ToolMessage::ActivateToolBrush => responses.add_front(ToolMessage::ActivateTool { tool_type: ToolType::Brush }),
|
ToolMessage::ActivateToolBrush => responses.add_front(ToolMessage::ActivateTool { tool_type: ToolType::Brush }),
|
||||||
ToolMessage::ActivateToolImaginate => responses.add_front(ToolMessage::ActivateTool { tool_type: ToolType::Imaginate }),
|
// ToolMessage::ActivateToolImaginate => responses.add_front(ToolMessage::ActivateTool { tool_type: ToolType::Imaginate }),
|
||||||
|
|
||||||
ToolMessage::ActivateTool { tool_type } => {
|
ToolMessage::ActivateTool { tool_type } => {
|
||||||
let tool_data = &mut self.tool_state.tool_data;
|
let tool_data = &mut self.tool_state.tool_data;
|
||||||
let old_tool = tool_data.active_tool_type;
|
let old_tool = tool_data.active_tool_type;
|
||||||
|
|
@ -314,7 +313,7 @@ impl MessageHandler<ToolMessage, ToolMessageData<'_>> for ToolMessageHandler {
|
||||||
ActivateToolPolygon,
|
ActivateToolPolygon,
|
||||||
|
|
||||||
ActivateToolBrush,
|
ActivateToolBrush,
|
||||||
ActivateToolImaginate,
|
// ActivateToolImaginate,
|
||||||
|
|
||||||
SelectRandomPrimaryColor,
|
SelectRandomPrimaryColor,
|
||||||
ResetColors,
|
ResetColors,
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ pub mod eyedropper_tool;
|
||||||
pub mod fill_tool;
|
pub mod fill_tool;
|
||||||
pub mod freehand_tool;
|
pub mod freehand_tool;
|
||||||
pub mod gradient_tool;
|
pub mod gradient_tool;
|
||||||
pub mod imaginate_tool;
|
// pub mod imaginate_tool;
|
||||||
pub mod line_tool;
|
pub mod line_tool;
|
||||||
pub mod navigate_tool;
|
pub mod navigate_tool;
|
||||||
pub mod path_tool;
|
pub mod path_tool;
|
||||||
|
|
|
||||||
|
|
@ -381,7 +381,8 @@ fn list_tools_in_groups() -> Vec<Vec<ToolAvailability>> {
|
||||||
ToolAvailability::ComingSoon(ToolEntry::new(ToolType::Patch, "RasterPatchTool").tooltip("Coming Soon: Patch Tool")),
|
ToolAvailability::ComingSoon(ToolEntry::new(ToolType::Patch, "RasterPatchTool").tooltip("Coming Soon: Patch Tool")),
|
||||||
ToolAvailability::ComingSoon(ToolEntry::new(ToolType::Detail, "RasterDetailTool").tooltip("Coming Soon: Detail Tool (D)")),
|
ToolAvailability::ComingSoon(ToolEntry::new(ToolType::Detail, "RasterDetailTool").tooltip("Coming Soon: Detail Tool (D)")),
|
||||||
ToolAvailability::ComingSoon(ToolEntry::new(ToolType::Relight, "RasterRelightTool").tooltip("Coming Soon: Relight Tool (O)")),
|
ToolAvailability::ComingSoon(ToolEntry::new(ToolType::Relight, "RasterRelightTool").tooltip("Coming Soon: Relight Tool (O)")),
|
||||||
// ToolAvailability::Available(Box::<imaginate_tool::ImaginateTool>::default()), // TODO: Fix and reenable
|
// TODO: Fix and reenable Imaginate tool
|
||||||
|
// ToolAvailability::Available(Box::<imaginate_tool::ImaginateTool>::default()),
|
||||||
ToolAvailability::ComingSoon(ToolEntry::new(ToolType::Heal, "RasterImaginateTool").tooltip("Coming Soon: Imaginate Tool")),
|
ToolAvailability::ComingSoon(ToolEntry::new(ToolType::Heal, "RasterImaginateTool").tooltip("Coming Soon: Imaginate Tool")),
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
|
|
@ -415,7 +416,7 @@ pub fn tool_message_to_tool_type(tool_message: &ToolMessage) -> ToolType {
|
||||||
// ToolMessage::Patch(_) => ToolType::Patch,
|
// ToolMessage::Patch(_) => ToolType::Patch,
|
||||||
// ToolMessage::Detail(_) => ToolType::Detail,
|
// ToolMessage::Detail(_) => ToolType::Detail,
|
||||||
// ToolMessage::Relight(_) => ToolType::Relight,
|
// ToolMessage::Relight(_) => ToolType::Relight,
|
||||||
ToolMessage::Imaginate(_) => ToolType::Imaginate,
|
// ToolMessage::Imaginate(_) => ToolType::Imaginate,
|
||||||
_ => panic!("Conversion from ToolMessage to ToolType impossible because the given ToolMessage does not have a matching ToolType. Got: {tool_message:?}"),
|
_ => panic!("Conversion from ToolMessage to ToolType impossible because the given ToolMessage does not have a matching ToolType. Got: {tool_message:?}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -448,7 +449,7 @@ pub fn tool_type_to_activate_tool_message(tool_type: ToolType) -> ToolMessageDis
|
||||||
// ToolType::Patch => ToolMessageDiscriminant::ActivateToolPatch,
|
// ToolType::Patch => ToolMessageDiscriminant::ActivateToolPatch,
|
||||||
// ToolType::Detail => ToolMessageDiscriminant::ActivateToolDetail,
|
// ToolType::Detail => ToolMessageDiscriminant::ActivateToolDetail,
|
||||||
// ToolType::Relight => ToolMessageDiscriminant::ActivateToolRelight,
|
// ToolType::Relight => ToolMessageDiscriminant::ActivateToolRelight,
|
||||||
ToolType::Imaginate => ToolMessageDiscriminant::ActivateToolImaginate,
|
// ToolType::Imaginate => ToolMessageDiscriminant::ActivateToolImaginate,
|
||||||
_ => panic!("Conversion from ToolType to ToolMessage impossible because the given ToolType does not have a matching ToolMessage. Got: {tool_type:?}"),
|
_ => panic!("Conversion from ToolType to ToolMessage impossible because the given ToolType does not have a matching ToolMessage. Got: {tool_type:?}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -731,6 +731,9 @@ impl NodeGraphExecutor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// NodeGraphUpdate::NodeGraphUpdateMessage(NodeGraphUpdateMessage::ImaginateStatusUpdate) => {
|
||||||
|
// responses.add(DocumentMessage::PropertiesPanel(PropertiesPanelMessage::Refresh));
|
||||||
|
// }
|
||||||
NodeGraphUpdate::CompilationResponse(execution_response) => {
|
NodeGraphUpdate::CompilationResponse(execution_response) => {
|
||||||
let CompilationResponse { node_graph_errors, result } = execution_response;
|
let CompilationResponse { node_graph_errors, result } = execution_response;
|
||||||
let type_delta = match result {
|
let type_delta = match result {
|
||||||
|
|
@ -759,9 +762,6 @@ impl NodeGraphExecutor {
|
||||||
});
|
});
|
||||||
responses.add(NodeGraphMessage::SendGraph);
|
responses.add(NodeGraphMessage::SendGraph);
|
||||||
}
|
}
|
||||||
NodeGraphUpdate::NodeGraphUpdateMessage(NodeGraphUpdateMessage::ImaginateStatusUpdate) => {
|
|
||||||
responses.add(DocumentMessage::PropertiesPanel(PropertiesPanelMessage::Refresh));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
|
|
@ -222,7 +222,7 @@ pub enum ApplicationError {
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub enum NodeGraphUpdateMessage {
|
pub enum NodeGraphUpdateMessage {
|
||||||
ImaginateStatusUpdate,
|
// ImaginateStatusUpdate,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait NodeGraphUpdateSender {
|
pub trait NodeGraphUpdateSender {
|
||||||
|
|
@ -236,7 +236,7 @@ impl<T: NodeGraphUpdateSender> NodeGraphUpdateSender for std::sync::Mutex<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait GetEditorPreferences {
|
pub trait GetEditorPreferences {
|
||||||
fn hostname(&self) -> &str;
|
// fn hostname(&self) -> &str;
|
||||||
fn use_vello(&self) -> bool;
|
fn use_vello(&self) -> bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -278,9 +278,9 @@ impl NodeGraphUpdateSender for Logger {
|
||||||
struct DummyPreferences;
|
struct DummyPreferences;
|
||||||
|
|
||||||
impl GetEditorPreferences for DummyPreferences {
|
impl GetEditorPreferences for DummyPreferences {
|
||||||
fn hostname(&self) -> &str {
|
// fn hostname(&self) -> &str {
|
||||||
"dummy_endpoint"
|
// "dummy_endpoint"
|
||||||
}
|
// }
|
||||||
|
|
||||||
fn use_vello(&self) -> bool {
|
fn use_vello(&self) -> bool {
|
||||||
false
|
false
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
use super::DocumentNode;
|
use super::DocumentNode;
|
||||||
pub use crate::imaginate_input::{ImaginateCache, ImaginateController, ImaginateMaskStartingFill, ImaginateSamplingMethod};
|
|
||||||
use crate::proto::{Any as DAny, FutureAny};
|
use crate::proto::{Any as DAny, FutureAny};
|
||||||
use crate::wasm_application_io::WasmEditorApi;
|
use crate::wasm_application_io::WasmEditorApi;
|
||||||
use dyn_any::DynAny;
|
use dyn_any::DynAny;
|
||||||
|
|
@ -163,15 +162,15 @@ tagged_value! {
|
||||||
OptionalDVec2(Option<DVec2>),
|
OptionalDVec2(Option<DVec2>),
|
||||||
DAffine2(DAffine2),
|
DAffine2(DAffine2),
|
||||||
Image(graphene_core::raster::Image<Color>),
|
Image(graphene_core::raster::Image<Color>),
|
||||||
ImaginateCache(ImaginateCache),
|
|
||||||
Color(graphene_core::raster::color::Color),
|
Color(graphene_core::raster::color::Color),
|
||||||
OptionalColor(Option<graphene_core::raster::color::Color>),
|
OptionalColor(Option<graphene_core::raster::color::Color>),
|
||||||
Subpaths(Vec<bezier_rs::Subpath<graphene_core::vector::PointId>>),
|
Subpaths(Vec<bezier_rs::Subpath<graphene_core::vector::PointId>>),
|
||||||
BlendMode(BlendMode),
|
BlendMode(BlendMode),
|
||||||
LuminanceCalculation(LuminanceCalculation),
|
LuminanceCalculation(LuminanceCalculation),
|
||||||
ImaginateSamplingMethod(ImaginateSamplingMethod),
|
// ImaginateCache(ImaginateCache),
|
||||||
ImaginateMaskStartingFill(ImaginateMaskStartingFill),
|
// ImaginateSamplingMethod(ImaginateSamplingMethod),
|
||||||
ImaginateController(ImaginateController),
|
// ImaginateMaskStartingFill(ImaginateMaskStartingFill),
|
||||||
|
// ImaginateController(ImaginateController),
|
||||||
Fill(graphene_core::vector::style::Fill),
|
Fill(graphene_core::vector::style::Fill),
|
||||||
Stroke(graphene_core::vector::style::Stroke),
|
Stroke(graphene_core::vector::style::Stroke),
|
||||||
F64Array4([f64; 4]),
|
F64Array4([f64; 4]),
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,13 @@
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate log;
|
extern crate log;
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate graphene_core;
|
extern crate graphene_core;
|
||||||
|
|
||||||
pub use graphene_core::{ProtoNodeIdentifier, Type, TypeDescriptor, concrete, generic};
|
pub use graphene_core::{ProtoNodeIdentifier, Type, TypeDescriptor, concrete, generic};
|
||||||
|
|
||||||
pub mod document;
|
pub mod document;
|
||||||
pub mod proto;
|
|
||||||
|
|
||||||
pub mod graphene_compiler;
|
pub mod graphene_compiler;
|
||||||
pub mod imaginate_input;
|
pub mod proto;
|
||||||
|
|
||||||
pub mod wasm_application_io;
|
|
||||||
|
|
||||||
#[cfg(feature = "loading")]
|
#[cfg(feature = "loading")]
|
||||||
pub mod util;
|
pub mod util;
|
||||||
|
pub mod wasm_application_io;
|
||||||
|
|
|
||||||
|
|
@ -271,31 +271,22 @@ impl ApplicationIo for WasmApplicationIo {
|
||||||
pub type WasmSurfaceHandle = SurfaceHandle<wgpu_executor::Window>;
|
pub type WasmSurfaceHandle = SurfaceHandle<wgpu_executor::Window>;
|
||||||
pub type WasmSurfaceHandleFrame = SurfaceHandleFrame<wgpu_executor::Window>;
|
pub type WasmSurfaceHandleFrame = SurfaceHandleFrame<wgpu_executor::Window>;
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Hash, specta::Type)]
|
#[derive(Clone, Debug, Default, PartialEq, Hash, specta::Type)]
|
||||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||||
pub struct EditorPreferences {
|
pub struct EditorPreferences {
|
||||||
pub imaginate_hostname: String,
|
// pub imaginate_hostname: String,
|
||||||
pub use_vello: bool,
|
pub use_vello: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl graphene_core::application_io::GetEditorPreferences for EditorPreferences {
|
impl graphene_core::application_io::GetEditorPreferences for EditorPreferences {
|
||||||
fn hostname(&self) -> &str {
|
// fn hostname(&self) -> &str {
|
||||||
&self.imaginate_hostname
|
// &self.imaginate_hostname
|
||||||
}
|
// }
|
||||||
fn use_vello(&self) -> bool {
|
fn use_vello(&self) -> bool {
|
||||||
self.use_vello
|
self.use_vello
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for EditorPreferences {
|
|
||||||
fn default() -> Self {
|
|
||||||
Self {
|
|
||||||
imaginate_hostname: "http://localhost:7860/".into(),
|
|
||||||
use_vello: false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unsafe impl dyn_any::StaticType for EditorPreferences {
|
unsafe impl dyn_any::StaticType for EditorPreferences {
|
||||||
type Static = EditorPreferences;
|
type Static = EditorPreferences;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,32 +1,13 @@
|
||||||
// `macro_use` puts the log macros (`error!`, `warn!`, `debug!`, `info!` and `trace!`) in scope for the crate
|
|
||||||
#[macro_use]
|
|
||||||
extern crate log;
|
|
||||||
|
|
||||||
// pub mod value;
|
|
||||||
// #![feature(const_type_name)]
|
|
||||||
|
|
||||||
pub mod raster;
|
|
||||||
|
|
||||||
pub mod text;
|
|
||||||
|
|
||||||
pub mod vector;
|
|
||||||
|
|
||||||
pub mod http;
|
|
||||||
|
|
||||||
pub mod any;
|
pub mod any;
|
||||||
|
|
||||||
#[cfg(feature = "gpu")]
|
#[cfg(feature = "gpu")]
|
||||||
pub mod gpu_nodes;
|
pub mod gpu_nodes;
|
||||||
|
pub mod http;
|
||||||
|
pub mod raster;
|
||||||
|
pub mod text;
|
||||||
|
pub mod vector;
|
||||||
pub use graphene_core::*;
|
pub use graphene_core::*;
|
||||||
|
|
||||||
pub mod image_color_palette;
|
|
||||||
|
|
||||||
pub mod brush;
|
pub mod brush;
|
||||||
|
pub mod dehaze;
|
||||||
|
pub mod image_color_palette;
|
||||||
#[cfg(feature = "wasm")]
|
#[cfg(feature = "wasm")]
|
||||||
pub mod wasm_application_io;
|
pub mod wasm_application_io;
|
||||||
|
|
||||||
pub mod dehaze;
|
|
||||||
|
|
||||||
pub mod imaginate;
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue