Commit graph

363 commits

Author SHA1 Message Date
Keavon Chambers
de366f9514 Add Brush tool warning; move font list loading to document creation time 2024-11-09 12:27:09 -08:00
Keavon Chambers
457619794b
Improve nudging when tilted and add Artboard tool nudge resizing; disable menu bar entries when no layer is selected (#2098)
* Make nudging follow a tilted viewport

* Add artboard nudge resizing
2024-11-08 16:16:20 -08:00
James Lindsay
320d030c08
Fix the spline node algorithm to be continuous across start/end points (#2092)
* Simplify spline node implementation using stroke_bezier_paths

* Improve closed splines

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-11-07 00:46:45 -08:00
James Lindsay
c3b526a46f
Fix Bevel node crash with zero-length segments (#2096)
Fix bevel with zero length segment
2024-11-07 00:08:09 -08:00
Dennis Kobert
35f7cfac80
Parse description from node doc comments (#2089)
* Parse description from node doc comments

* Add node description tooltips

* Code review

---------

Co-authored-by: Adam G <adamgerhant@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-11-03 14:57:20 -08:00
Keavon Chambers
7d86bf4abf New node: Jitter Points 2024-11-02 16:37:27 -07:00
Keavon Chambers
4c9ab2d50b
New nodes: "Clamp", "To U32", and "To U64" (#2087)
* New nodes: "Clamp", "To U32", and "To U64"

* Add name
2024-11-02 03:20:02 -07:00
Keavon Chambers
3f17e83e80
Improve Sample Points, Scatter Points, and Splines from Points to include segments and work with subpaths (#2085) 2024-11-01 12:44:05 -07:00
Daragh
018e9839f8
Add Path tool support for the Tab key swapping to dragging the opposite handle (#2058)
* feat: tab alternates between handles

* fix: handle hints, remove anchor to handle switch
Added specific handle hints,
Can no longer switch to handle if just anchor is selected
typo fix

* fix: no longer deselect on esc/rclick

* feat: hides cursor when switching
A pointerlock implementation would be ideal in the future to keep the screen from panning,

* fix: tidy up dynamic tool hints
switch colinear to V

* fix: can no longer hide cursor if anchor selected
remove debug statement

* fix: clippy

* Solve some issues and remap V to C to toggle colinear

* Cleanup + change equidistant key from Shift to Alt

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-10-30 02:48:20 -07:00
adamgerhant
ff8fec6eca
Allow the Path tool to edit an upstream path even if there's a type conversion midway (#2055)
Remove type check when iterating upstream

Convert to doc comment
2024-10-26 18:39:48 +00:00
Mohamed Osama
3c839ffd2b
Clean up old usages of NodeId(generate_uuid()) by replacing it with NodeId::new() (#2009)
Replace all `NodeId(generate_uuid())` with `NodeId::new()`
2024-10-25 19:43:46 -07:00
James Lindsay
dae6b2f239
New node: Bevel (#2067)
* Bevel node

* Fix clippy lints

* Prevent negative values

* Rename flipped() -> reversed()

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-10-25 19:25:41 -07:00
James Lindsay
7fc0a593c8
Fix gradient render transforms with Vello (#2059)
Fix vello gradient transform
2024-10-26 00:12:24 +00:00
Dennis Kobert
3e0178a032
Add switch node and fix log to console node (#2064)
* Add switch node and fix log to console node

* Formatting

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-10-25 16:30:02 -07:00
adamgerhant
6b1356fe13
Allow multiple top output wires to come from layers (#2049)
* Allow multiple outputs from layer

* Stable Ids for Flatten Vector Elements

* Clippy
2024-10-25 22:32:31 +00:00
Keavon Chambers
a395fbf063 Fix/suppress new Clippy warnings introduced in Rust 1.82 2024-10-25 11:14:51 -07:00
James Lindsay
c3a3c4c907
Allow the Fill and Stroke nodes to work on groups (#2046)
* Add the apply style trait for generalised application of styles

* Fix Clippy warn

* Use existing trait

* Remove unnecessary lifetimes

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-10-16 16:06:53 -07:00
adamgerhant
e09f5ecaec
Make Copy to Points and (Circular) Repeat and nodes output group data, and add flattening nodes (#2011)
* Output group from repeat, add flatten vector elements

* Fix tests

* Fix demo artwork

* Output group from copy to points, add repeat for graphic groups, fix editor freeze on render fail

* Restore painted dreams

* WIP: Fix demo artwork

* Fix demo artwork, add ungroup node

* Incorrect scaling

* fix test

* Fix demo art

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-10-14 12:39:28 -07:00
James Lindsay
d6f46f73da
Factor in artboard clipping to the click target x-ray function (#2028)
* Add clipping to the click xray function

* Clip area rays as well

* Code review nits

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-10-12 23:38:17 +00:00
James Lindsay
3b0e9587eb
Update Wasm dependencies to fix WebGPU spec change crash in Firefox with Vello (#2027)
* Update wasm deps

* Bump wasm-bindgen and fix the depricated methods
2024-10-12 14:28:39 -07:00
Keavon Chambers
f7d83d2632
New node: Offset Path (#2030)
* New node: Offset Path

* Fix CI
2024-10-11 14:50:54 -07:00
Dennis Kobert
d2f791cfb3
Make Upload Texture node resolution-aware (#2018)
* Make UploadTextureNode resolution aware

* Add TextureFrame implementations for MonitorNode

* Add TextureFrame implementation to TransformNode
2024-10-03 10:32:34 -07:00
Keavon Chambers
2d86fb24ab
Add line height and character spacing to the Text node (#2016) 2024-10-01 12:28:27 -07:00
Keavon Chambers
904cf09c79
Add drag-and-drop and copy-paste file importing/opening throughout the UI (#2012)
* Add file importing by dragging and dropping throughout the UI

* Disable comment-profiling-changes.yaml

* Fix CI
2024-09-28 00:19:43 -07:00
adamgerhant
20470b566b
Fix many regressions introduced mostly in #1946 (#1986)
* Fix text tool

* Implement buffering to fix freehand tool

* Fix tools

* Fix clippy lints

* Small fixes

* Move vector modify back to Monitor nodes

* Code review

* Fix abort

* Fix svg import

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-09-26 15:37:03 -07:00
Keavon Chambers
c738b4a1f9 Replace terminology "primary" with "call argument" and "parameter" with "secondary input" 2024-09-25 20:05:00 -07:00
Dennis Kobert
8a1089938e
Path Bool library code cleanup (#2000)
* Remove log statements

* Add feature gates to functions in path.rs

* Fix infinite parsing loop and add new test

* License tweaks

* Remove trailing zero in whole number floats

* Flatten visual-tests directory

* Code review

* Clean up printlines

* Add error handling to path parsing

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-09-23 12:16:31 +02:00
Keavon Chambers
3ddc052538
Improve type compatibility and clean up new node macro usages (#2002)
* Improve type compatibility

* More
2024-09-22 01:44:18 -07:00
Dennis Kobert
cd4124a596
Improve node macro and add more diagnostics (#1999)
* Improve node macro ergonomics

* Fix type error in stub import

* Fix wasm nodes

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-09-21 19:57:45 +00:00
James Lindsay
0d33a1ae3f
Use overlays to draw artboard names (#1981)
* Artboard label overlay

* Finish artboard overlays

* cargo fmt

* Update font styling

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-09-20 22:04:31 +00:00
Dennis Kobert
32da545a49
Fix blend modes and opacity on raster data (#1996)
* Apply alpha blending to images when using vello

* Fix bounds for image layer

* Fix rendering for non vello images
2024-09-20 20:42:39 +00:00
Dennis Kobert
768ca0c535
Box TaggedValue::VectorModification (#1995) 2024-09-20 12:39:35 -07:00
Dennis Kobert
e352c7fa71
Refactor the node macro and simply most of the node implementations (#1942)
* Add support structure for new node macro to gcore

* Fix compile issues and code generation

* Implement new node_fn macro

* Implement property translation

* Fix NodeIO type generation

* Start translating math nodes

* Move node implementation to outer scope to allow usage of local imports

* Add expose attribute to allow controlling the parameter exposure

* Add rust analyzer support for #[implementations] attribute

* Migrate logic nodes

* Handle where clause properly

* Implement argument ident pattern preservation

* Implement adjustment layer mapping

* Fix node registry types

* Fix module paths

* Improve demo artwork comptibility

* Improve macro error reporting

* Fix handling of impl node implementations

* Fix nodeio type computation

* Fix opacity node and graph type resolution

* Fix loading of demo artworks

* Fix eslint

* Fix typo in macro test

* Remove node definitions for Adjustment Nodes

* Fix type alias property generation and make adjustments footprint aware

* Convert vector nodes

* Implement path overrides

* Fix stroke node

* Fix painted dreams

* Implement experimental type level specialization

* Fix poisson disk sampling -> all demo artworks should work again

* Port text node + make node macro more robust by implementing lifetime substitution

* Fix vector node tests

* Fix red dress demo + ci

* Fix clippy warnings

* Code review

* Fix primary input issues

* Improve math nodes and audit others

* Set no_properties when no automatic properties are derived

* Port vector generator nodes (could not derive all definitions yet)

* Various QA changes and add min/max/mode_range to number parameters

* Add min and max for f64 and u32

* Convert gpu nodes and clean up unused nodes

* Partially port transform node

* Allow implementations on call arg

* Port path modify node

* Start porting graphic element nodes

* Transform nodes in graphic_element.rs

* Port brush node

* Port nodes in wasm_executior

* Rename node macro

* Fix formatting

* Fix Mandelbrot node

* Formatting

* Fix Load Image and Load Resource nodes, add scope input to node macro

* Remove unnecessary underscores

* Begin attemping to make nodes resolution-aware

* Infer a generic manual compositon type on generic call arg

* Various fixes and work towards merging

* Final changes for merge!

* Fix tests, probably

* More free line removals!

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-09-20 03:50:30 -07:00
adamgerhant
ca0d102296
Fix click targets (in, e.g., the boolean node) by resolving footprints from render output (#1946)
* add NodeId (u64) and Footprint to Graphic Group

* Render Output footprints

* Small bug fixes

* Commented out render output click targets/footprints

* Run graph when deleting

* Switch to node path

* Add upstream clicktargets for boolean operation

* Fix boolean operations

* Fix grouped layers

* Add click targets to vello render

* Add cache to artwork

* Fix demo artwork

* Improve recursion

* Code review

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-09-16 01:26:59 +00:00
James Lindsay
dd4a97b09f
Correctly apply transforms to vector data and strokes (#1977)
* Fix adding a layer to a transformed group

* Fix assorted transform issues

* Default stroke transform

* Fix bench

* Transform gradient

* Gradient fix

* Add gradient reversal buttons to Fill node in the Properties panel

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-09-15 22:26:11 +00:00
Bruce Mitchener
507210b961 Fix some typos in the node graph code (#1970) 2024-09-11 02:36:34 -07:00
James Lindsay
06e11b6f46
Fix invalid segment crash when disolving point loop (#1959)
* Fix invalid segment crash

* Further improve robustness
2024-09-05 11:45:14 -07:00
James Lindsay
9524835a30
Switch attribute-based vector data from referencing PointIds to indexes in the points table (#1949)
* Index for points

* Code review

* Add todo comment about a possible perf optimization

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-09-04 08:59:55 +00:00
James Lindsay
444929adbf
Fix crash from gradients with bounds of zero (#1950)
Fix zero bound gradient
2024-09-01 16:12:02 -07:00
Keavon Chambers
d7546fb183 New nodes: Blend Colors, Percentage Value 2024-08-17 07:42:09 -07:00
Keavon Chambers
c39032ab54 Add seed parameters to all nodes with RNG 2024-08-17 07:40:02 -07:00
Keavon Chambers
e647ca9f91 Recategorize the node catalog 2024-08-16 04:24:25 -07:00
Keavon Chambers
fa981a0897
New node: Assign Colors (#1938)
* New node: Assign Colors

* Simplify the Procedural String Lights demo artwork

* Add "Group" node to the node catalog

* Better comment styling in profiling action
2024-08-15 12:52:46 +00:00
Keavon Chambers
15d125d8e7
Fix all Clippy warnings (#1936)
* Fix all Clippy warnings

* More fixes

* Bump criterion version

---------

Co-authored-by: dennis@kobert.dev <dennis@kobert.dev>
2024-08-14 17:05:08 +00:00
Dennis Kobert
da13f21486
Add profiling metrics for, and speed up, Graphene graph compilation (#1924)
* Add compile time benchmark for the demo artwork

* Implement node input replacement batching

isometric-fountain      time:   [7.4307 ms 7.5072 ms 7.5974 ms]
                        change: [-19.302% -18.136% -16.903%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
  6 (6.00%) high mild
  4 (4.00%) high severe

painted-dreams          time:   [1.8108 ms 1.8223 ms 1.8350 ms]
                        change: [-12.422% -11.524% -10.650%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 13 outliers among 100 measurements (13.00%)
  5 (5.00%) high mild
  8 (8.00%) high severe

procedural-string-lights
                        time:   [551.65 µs 560.58 µs 571.13 µs]
                        change: [-5.7783% -2.5770% +1.3136%] (p = 0.20 > 0.05)
                        No change in performance detected.
Found 6 outliers among 100 measurements (6.00%)
  1 (1.00%) high mild
  5 (5.00%) high severe

red-dress               time:   [9.7951 ms 9.9006 ms 10.016 ms]
                        change: [-18.812% -17.558% -16.292%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
  5 (5.00%) high mild

valley-of-spires        time:   [4.7294 ms 4.7837 ms 4.8442 ms]
                        change: [-16.889% -15.712% -14.615%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 16 outliers among 100 measurements (16.00%)
  11 (11.00%) high mild
  5 (5.00%) high severe

* Implement node dependency tracking

isometric-fountain      time:   [6.5695 ms 6.6418 ms 6.7227 ms]
                        change: [-13.426% -12.112% -10.681%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
  5 (5.00%) high mild
  5 (5.00%) high severe

painted-dreams          time:   [1.7406 ms 1.7566 ms 1.7742 ms]
                        change: [-4.7386% -3.5484% -2.3707%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 11 outliers among 100 measurements (11.00%)
  10 (10.00%) high mild
  1 (1.00%) high severe

procedural-string-lights
                        time:   [585.40 µs 590.98 µs 596.82 µs]
                        change: [-3.7739% +0.7591% +4.6293%] (p = 0.76 > 0.05)
                        No change in performance detected.
Found 3 outliers among 100 measurements (3.00%)
  3 (3.00%) high mild

red-dress               time:   [8.4314 ms 8.5072 ms 8.5899 ms]
                        change: [-26.797% -25.374% -23.958%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 11 outliers among 100 measurements (11.00%)
  5 (5.00%) high mild
  6 (6.00%) high severe

valley-of-spires        time:   [4.3700 ms 4.4118 ms 4.4579 ms]
                        change: [-11.470% -10.198% -8.9826%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 12 outliers among 100 measurements (12.00%)
  7 (7.00%) high mild
  5 (5.00%) high severe

* Remove clone and use rustc hash for storing nodes

isometric-fountain      time:   [5.9220 ms 5.9854 ms 6.0570 ms]
                        change: [-11.974% -10.539% -9.2291%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 12 outliers among 100 measurements (12.00%)
  4 (4.00%) high mild
  8 (8.00%) high severe

painted-dreams          time:   [1.5337 ms 1.5470 ms 1.5618 ms]
                        change: [-11.901% -10.907% -9.9075%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
  5 (5.00%) high mild
  4 (4.00%) high severe

procedural-string-lights
                        time:   [496.44 µs 501.44 µs 506.33 µs]
                        change: [-20.002% -15.633% -12.213%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
  3 (3.00%) high mild
  1 (1.00%) high severe

red-dress               time:   [7.7037 ms 7.7871 ms 7.8774 ms]
                        change: [-11.906% -10.576% -9.2560%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 8 outliers among 100 measurements (8.00%)
  7 (7.00%) high mild
  1 (1.00%) high severe

valley-of-spires        time:   [3.9182 ms 3.9501 ms 3.9851 ms]
                        change: [-14.615% -13.075% -11.500%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high severe

* Fix test depending on stable node order

* Simplify flattening

* Remove unused dependant vec size safeguards

* Improve topological sort and make assert debug only

isometric-fountain      time:   [2.9515 ms 2.9971 ms 3.0459 ms]
                        change: [-61.270% -60.533% -59.747%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 11 outliers among 100 measurements (11.00%)
  7 (7.00%) high mild
  4 (4.00%) high severe

Benchmarking painted-dreams: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 8.1s, enable flat sampling, or reduce sample count to 50.
painted-dreams          time:   [1.1134 ms 1.1322 ms 1.1494 ms]
                        change: [-40.991% -37.660% -34.129%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high severe

procedural-string-lights
                        time:   [391.88 µs 397.80 µs 403.84 µs]
                        change: [-19.953% -17.762% -14.930%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
  3 (3.00%) high mild
  3 (3.00%) high severe

red-dress               time:   [3.0722 ms 3.1179 ms 3.1707 ms]
                        change: [-59.878% -59.168% -58.422%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 12 outliers among 100 measurements (12.00%)
  5 (5.00%) high mild
  7 (7.00%) high severe

valley-of-spires        time:   [2.0234 ms 2.0470 ms 2.0737 ms]
                        change: [-48.994% -47.910% -46.907%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
  2 (2.00%) high mild
  7 (7.00%) high severe

* Improve id remapping logic by reusing id mapping

isometric-fountain      time:   [2.2464 ms 2.2841 ms 2.3260 ms]
                        change: [-25.693% -23.790% -22.024%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
  5 (5.00%) high mild
  1 (1.00%) high severe

Benchmarking painted-dreams: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 7.3s, enable flat sampling, or reduce sample count to 50.
painted-dreams          time:   [869.96 µs 886.99 µs 902.36 µs]
                        change: [-26.928% -19.590% -8.0737%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high severe

procedural-string-lights
                        time:   [291.60 µs 296.60 µs 302.45 µs]
                        change: [-28.175% -25.168% -22.078%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 8 outliers among 100 measurements (8.00%)
  2 (2.00%) high mild
  6 (6.00%) high severe

red-dress               time:   [2.7946 ms 2.8356 ms 2.8800 ms]
                        change: [-10.991% -9.0546% -6.9757%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
  7 (7.00%) high mild

valley-of-spires        time:   [1.5583 ms 1.5801 ms 1.6039 ms]
                        change: [-24.165% -22.811% -21.213%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
  7 (7.00%) high mild

* Remove flame graph file
2024-08-12 03:07:36 -07:00
Utsav Singh
1b6d45ad30
Respect 'Clip' on Artboards when exporting "All Artworks". (#1916)
* Add constraint_bounds function to Quad implementation

* Respect Clip property when exporting All Artworks and centering document using the ctrl + 0 hotkey.
Calculate  artboard_clip_bounds  and then constraint the  all_layer_bounds  to respect the bounds of the Clipped Artboards.

* Use parent_artboard to find ancestor artboards of each layer and constrain bounds if artboard is clipped

* Remove redundant comments
2024-08-10 23:29:34 -07:00
adamgerhant
60707c0369
Add colors to all nodes in a graph, even if disconnected, and properly display hidden network imports (#1921)
* Get output/input types by iterating to proto node. Fix types when undoing/redoing

* Remove unused code

* Fix types not updating when modified

* Improve code quality

* Improve proto node type lookup

* Nits

* Fix crash when adding Extract

---------

Co-authored-by: dennis@kobert.dev <dennis@kobert.dev>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-08-10 15:27:15 -07:00
Keavon Chambers
501b562d0f Add 'Gradient Map' adjustment node 2024-08-09 23:19:22 -07:00
Dennis Kobert
c5dde18fd6
Make noise generation resolution aware (#1909)
* Make noise generation resolution aware

* Invert "Scale" so it's not "Frequency"; make "Clipping" 100x100 not 1x1

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-08-09 12:03:06 +02:00
Dennis Kobert
0dfddd529b
Refactor document node type lookup function to fix performance degradation over time (#1878)
* Refactor document_node_types function

* Fix node introspection

* Implement diff based type updates

* Fix missing monitor nodes

* Improve docs and fix warings

* Fix wrongful removal of node paths

* Remove code examples for non pub methodsü

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-08-08 17:37:28 -07:00