Skip to content
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

Refactor the node macro and simply most of the node implementations #1942

Merged
merged 63 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
38a0529
Add support structure for new node macro to gcore
TrueDoctor Aug 19, 2024
ed4f915
Fix compile issues and code generation
TrueDoctor Aug 19, 2024
de79f4c
Implement new node_fn macro
TrueDoctor Aug 20, 2024
9775acb
Implement property translation
TrueDoctor Aug 20, 2024
309e66e
Fix NodeIO type generation
TrueDoctor Aug 20, 2024
d51da55
Start translating math nodes
TrueDoctor Aug 20, 2024
302c37d
Move node implementation to outer scope to allow usage of local imports
TrueDoctor Aug 20, 2024
f5f4f65
Add expose attribute to allow controlling the parameter exposure
TrueDoctor Aug 20, 2024
7a7d6bc
Add rust analyzer support for #[implementations] attribute
TrueDoctor Aug 21, 2024
d3dc74a
Migrate logic nodes
TrueDoctor Aug 21, 2024
b244a65
Handle where clause properly
TrueDoctor Aug 21, 2024
672459c
Implement argument ident pattern preservation
TrueDoctor Aug 22, 2024
6ed9a10
Implement adjustment layer mapping
TrueDoctor Aug 22, 2024
979da00
Fix node registry types
TrueDoctor Aug 22, 2024
6b7c3ff
Fix module paths
TrueDoctor Aug 22, 2024
49b0009
Improve demo artwork comptibility
TrueDoctor Aug 23, 2024
45e59af
Improve macro error reporting
TrueDoctor Aug 23, 2024
42ca7bd
Fix handling of impl node implementations
TrueDoctor Aug 23, 2024
c8e94a4
Fix nodeio type computation
TrueDoctor Aug 23, 2024
b864d9a
Fix opacity node and graph type resolution
TrueDoctor Aug 23, 2024
b5ca08d
Fix loading of demo artworks
TrueDoctor Aug 23, 2024
cd0dac5
Fix eslint
TrueDoctor Aug 23, 2024
afe93f4
Fix typo in macro test
TrueDoctor Aug 23, 2024
0e25830
Remove node definitions for Adjustment Nodes
TrueDoctor Aug 27, 2024
cd0db6a
Fix type alias property generation and make adjustments footprint aware
TrueDoctor Aug 27, 2024
273fff2
Convert vector nodes
TrueDoctor Aug 27, 2024
41fdac2
Implement path overrides
TrueDoctor Aug 27, 2024
54c9b1a
Fix stroke node
TrueDoctor Aug 27, 2024
b79229b
Fix painted dreams
TrueDoctor Aug 27, 2024
f7792da
Implement experimental type level specialization
TrueDoctor Aug 27, 2024
bf7fd77
Fix poisson disk sampling -> all demo artworks should work again
TrueDoctor Aug 27, 2024
d570929
Port text node + make node macro more robust by implementing lifetime…
TrueDoctor Aug 27, 2024
88ffa36
Fix vector node tests
TrueDoctor Aug 28, 2024
35aa42e
Fix red dress demo + ci
TrueDoctor Aug 28, 2024
3411469
Fix clippy warnings
TrueDoctor Aug 28, 2024
579a659
Code review
Keavon Sep 3, 2024
91905b8
Fix primary input issues
Keavon Sep 4, 2024
9426d7e
Improve math nodes and audit others
Keavon Sep 7, 2024
3aa6323
Set no_properties when no automatic properties are derived
TrueDoctor Sep 7, 2024
1a7ac9d
Port vector generator nodes (could not derive all definitions yet)
TrueDoctor Sep 7, 2024
a0de36e
Various QA changes and add min/max/mode_range to number parameters
Keavon Sep 8, 2024
f2a59b6
Add min and max for f64 and u32
TrueDoctor Sep 8, 2024
ba42b73
Convert gpu nodes and clean up unused nodes
TrueDoctor Sep 9, 2024
9a4e4f0
Partially port transform node
TrueDoctor Sep 9, 2024
6bb8254
Allow implementations on call arg
TrueDoctor Sep 9, 2024
cbc32cc
Port path modify node
TrueDoctor Sep 9, 2024
759499e
Start porting graphic element nodes
TrueDoctor Sep 9, 2024
a98694d
Transform nodes in graphic_element.rs
TrueDoctor Sep 10, 2024
e5d72ea
Port brush node
TrueDoctor Sep 10, 2024
5d7f51f
Port nodes in wasm_executior
TrueDoctor Sep 10, 2024
ca377a5
Rename node macro
TrueDoctor Sep 10, 2024
d4ae7b0
Fix formatting
TrueDoctor Sep 10, 2024
6eda88e
Fix Mandelbrot node
TrueDoctor Sep 11, 2024
ea5027a
Formatting
Keavon Sep 16, 2024
7ec153d
Merge branch 'master' into node_fn_rework
Keavon Sep 16, 2024
6d8c0a1
Fix Load Image and Load Resource nodes, add scope input to node macro
Keavon Sep 17, 2024
0578605
Remove unnecessary underscores
Keavon Sep 17, 2024
7a3a55a
Begin attemping to make nodes resolution-aware
Keavon Sep 17, 2024
264672f
Infer a generic manual compositon type on generic call arg
TrueDoctor Sep 18, 2024
02c31d9
Various fixes and work towards merging
Keavon Sep 19, 2024
9a38e02
Final changes for merge!
Keavon Sep 20, 2024
35338e1
Fix tests, probably
Keavon Sep 20, 2024
b844f00
More free line removals!
Keavon Sep 20, 2024
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
317 changes: 24 additions & 293 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ resolver = "2"

[workspace.dependencies]
# Local dependencies
dyn-any = { path = "libraries/dyn-any", features = ["derive", "glam"] }
dyn-any = { path = "libraries/dyn-any", features = ["derive", "glam", "reqwest"] }
graphene-core = { path = "node-graph/gcore" }
graph-craft = { path = "node-graph/graph-craft", features = ["serde"] }
wgpu-executor = { path = "node-graph/wgpu-executor" }
Expand All @@ -46,6 +46,8 @@ futures = "0.3"
env_logger = "0.11"
log = "0.4"
bitflags = { version = "2.4", features = ["serde"] }
ctor = "0.2"
convert_case = "0.6"
derivative = "2.2"
tempfile = "3.6"
thiserror = "1.0"
Expand Down Expand Up @@ -105,7 +107,6 @@ graphene-core = { opt-level = 1 }
graphene-std = { opt-level = 1 }
interpreted-executor = { opt-level = 1 } # This is a mitigation for https://github.com/rustwasm/wasm-pack/issues/981 which is needed because the node_registry function is too large
graphite-proc-macros = { opt-level = 1 }
autoquant = { opt-level = 3 }
image = { opt-level = 2 }
rustc-hash = { opt-level = 3 }
serde_derive = { opt-level = 1 }
Expand Down
2 changes: 1 addition & 1 deletion demo-artwork/isometric-fountain.graphite

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo-artwork/painted-dreams.graphite

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo-artwork/procedural-string-lights.graphite

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo-artwork/red-dress.graphite

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo-artwork/valley-of-spires.graphite

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions editor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ gpu = [
]
resvg = ["graphene-std/resvg"]
vello = ["graphene-std/vello", "resvg", "graphene-core/vello"]
quantization = [
"graphene-std/quantization",
"interpreted-executor/quantization",
]

[dependencies]
# Local dependencies
Expand All @@ -39,6 +35,7 @@ graphene-std = { path = "../node-graph/gstd", features = ["serde"] }
js-sys = { workspace = true }
log = { workspace = true }
bitflags = { workspace = true }
convert_case = { workspace = true }
thiserror = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
Expand Down
5 changes: 5 additions & 0 deletions editor/src/messages/layout/utility_types/layout_widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,11 @@ impl Default for LayoutGroup {
Self::Row { widgets: Vec::new() }
}
}
impl From<Vec<WidgetHolder>> for LayoutGroup {
fn from(widgets: Vec<WidgetHolder>) -> LayoutGroup {
LayoutGroup::Row { widgets }
}
}

impl LayoutGroup {
/// Applies a tooltip to all widgets in this row or column without a tooltip.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ pub struct NumberInput {
#[derivative(Default(value = "1."))]
pub step: f64,

// TODO: Make this (and range_max) apply to both Range and Increment modes when dragging with the mouse
#[serde(rename = "rangeMin")]
pub range_min: Option<f64>,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ use crate::node_graph_executor::NodeGraphExecutor;

use graph_craft::document::value::TaggedValue;
use graph_craft::document::{NodeId, NodeNetwork, OldNodeNetwork};
use graphene_core::raster::BlendMode;
use graphene_core::raster::ImageFrame;
use graphene_core::raster::{BlendMode, ImageFrame};
use graphene_core::vector::style::ViewMode;

use glam::{DAffine2, DVec2};

pub struct DocumentMessageData<'a> {
pub document_id: DocumentId,
pub ipp: &'a InputPreprocessorMessageHandler,
Expand Down Expand Up @@ -726,9 +726,6 @@ impl MessageHandler<DocumentMessage, DocumentMessageData<'_>> for DocumentMessag
let center_in_viewport = DAffine2::from_translation(document_to_viewport.inverse().transform_point2(viewport_location - ipp.viewport_bounds.top_left));
let center_in_viewport_layerspace = center_in_viewport;

// Scale the image to fit into a 512x512 box
let image_size = image_size / DVec2::splat((image_size.max_element() / 512.).max(1.));

// Make layer the size of the image
let fit_image_size = DAffine2::from_scale_angle_translation(image_size, 0., image_size / -2.);

Expand Down
Loading
Loading