-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Simple gpu airbrush #4469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple gpu airbrush #4469
Changes from all commits
a77b9b7
fed5551
f5afc33
2fbce4d
e8d0146
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,6 @@ use graph_craft::document::value::TaggedValue; | |
| use graph_craft::document::{DocumentNode, DocumentNodeImplementation, NodeId, NodeInput}; | ||
| use graph_craft::{Type, concrete}; | ||
| use graphene_std::animation::RealTimeMode; | ||
| use graphene_std::brush::brush_stroke::BrushTrace; | ||
| use graphene_std::color::SRGBA8; | ||
| use graphene_std::extract_xy::XY; | ||
| use graphene_std::raster::{ | ||
|
|
@@ -286,7 +285,6 @@ pub(crate) fn property_from_type( | |
| Some(x) if id_is::<DAffine2>(x) => transform_widget(default_info, &mut extra_widgets), | ||
| Some(x) if id_is::<Color>(x) => color_widget(default_info, ColorInput::default().allow_none(false)), | ||
| Some(x) if id_is::<Gradient>(x) => color_widget(default_info, ColorInput::default().allow_none(false)), | ||
| Some(x) if id_is::<BrushTrace>(x) => brush_strokes_widget(default_info).into(), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: When the brush-strokes node is selected, its Prompt for AI agents |
||
| // ============ | ||
| // STRUCT TYPES | ||
| // ============ | ||
|
|
@@ -460,33 +458,6 @@ pub fn vector_modification_widget(parameter_widgets_info: ParameterWidgetsInfo) | |
| widgets | ||
| } | ||
|
|
||
| pub fn brush_strokes_widget(parameter_widgets_info: ParameterWidgetsInfo) -> Vec<WidgetInstance> { | ||
| let ParameterWidgetsInfo { document_node, node_id: _, index, .. } = parameter_widgets_info; | ||
|
|
||
| let mut widgets = start_widgets(¶meter_widgets_info); | ||
|
|
||
| let Some(document_node) = document_node else { return widgets }; | ||
| let Some(input) = document_node.inputs.get(index) else { return widgets }; | ||
|
|
||
| if let Some(TaggedValue::BrushStrokes(strokes)) = input.as_non_exposed_value() { | ||
| let stroke_count = strokes.len(); | ||
| let sample_count: usize = strokes.iter().map(|s| s.trace.len()).sum(); | ||
| let label = if stroke_count == 0 { | ||
| "Empty".to_string() | ||
| } else { | ||
| format!( | ||
| "{stroke_count} {} / {sample_count} {}", | ||
| if stroke_count == 1 { "Stroke" } else { "Strokes" }, | ||
| if sample_count == 1 { "Sample" } else { "Samples" } | ||
| ) | ||
| }; | ||
|
|
||
| widgets.extend_from_slice(&[Separator::new(SeparatorStyle::Unrelated).widget_instance(), TextLabel::new(label).widget_instance()]); | ||
| } | ||
|
|
||
| widgets | ||
| } | ||
|
|
||
| pub fn image_data_widget(parameter_widgets_info: ParameterWidgetsInfo) -> Vec<WidgetInstance> { | ||
| let ParameterWidgetsInfo { document_node, node_id: _, index, .. } = parameter_widgets_info; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -93,6 +93,7 @@ impl MessageHandler<PreferencesMessage, PreferencesMessageContext<'_>> for Prefe | |||||||||||
| zoom_with_scroll: self.zoom_with_scroll, | ||||||||||||
| }); | ||||||||||||
| responses.add(FrontendMessage::UpdateUIScale { scale: self.ui_scale }); | ||||||||||||
| responses.add(ToolMessage::RefreshToolShelf); | ||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: When loading preferences disables the brush tool while Brush is active, this refresh hides Brush in the shelf but keeps Brush active. Mirror the Prompt for AI agents
Suggested change
|
||||||||||||
| } | ||||||||||||
| PreferencesMessage::ResetToDefaults => { | ||||||||||||
| responses.add(PreferencesMessage::Load { preferences: Self::default() }); | ||||||||||||
|
|
||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: When
.gddsaving is enabled, this drops the document's undo/redo history on every save. Reopening then bootstraps a flat registry instead of restoring the saved history; keep history enabled for normal document saves.Prompt for AI agents