Commit graph

518 commits

Author SHA1 Message Date
Oliver Davies
986759597b Added text as instances and contains nodes 2025-05-06 02:14:23 -07:00
Oliver Davies
914360551f Tweaks, crash fixes and a few new nodes 2025-04-28 18:46:22 -07:00
Keavon Chambers
471ef87801 Add reference point input to the Mirror node 2025-04-24 05:33:20 -07:00
0SlowPoke0
d39308c048
Add Path tool feature for angle locking upon pressing Ctrl while dragging handle over anchor (#2612)
* almost_fixed

* fix need to refactor

* fixed issed need to refactor

* refactor-done fixed issue

* move function to common_functionality

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-23 20:39:14 -07:00
Mateo
3d37ef79ac
Add shape fill overlays when closing a path (Pen tool) or filling it (Fill tool) (#2521)
* Make the Pen tool show a path being closed by drawing a filled overlay when hovering the endpoint

* Add to_css to color.rs

* Check before unwrapping layer

* Close if in the right place

* Fix typo

* Format code

* Support discontinuous paths for closing preview

* Code review

* Denser fill lines

* Fill tool preview with strip lines only and revert pen shape-closing opacity

* Small adjustments to fill preview

* Fix line width of fill preview

* Use a pattern to preview the fill tool and fix canvas clearing

* Update pattern

* Simplify code

* Format code

* Use secondary color to preview fill if shift is pressed

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-23 18:33:08 -07:00
Keavon Chambers
ac9fb2b02d
Improve instancing nodes (make them output group data, add 'Instance Repeat', fix Flatten Vector Elements click targets, and more) (#2610)
* Improve instancing nodes (make them output group data, add 'Instance Repeat', fix Flatten Vector Elements click targets, and more)

* Fix test?

* Fix more tests?

* Fix moar test??

* Clean up instance method naming
2025-04-22 17:55:57 -07:00
Priyanshu
a29802de36
Refactor the Solidify Stroke node implementation to use the Kurbo API (#2608)
* impl append_bezpath method to push a kurbo bezier path to vector data.

* refactor stroke_bezier_paths method and StrokePathIter iterator implementation

* refactor

* impl VectorData method to get strokes iterator of kurbo bezpath

* impl solidify stroke node

* refactor

* use StrokeOptLevel::Optimized for generation stroke fill

* add miter limit and dashes

* fix naming

---------

Co-authored-by: indierusty <priyaayadav@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-22 08:32:58 +00:00
James Lindsay
704dad4f76
Fix angle logic in the Grid node to allow slanted isometric grids (#2602)
* Fix angles

* Fix hardcoded index

* More information on monitor nodes
2025-04-20 14:16:27 -07:00
Priyanshu
dd1feee734
Replace Bezier-rs use in the 'Offset Path' node with a Kurbo algorithm (#2596)
* minimally replace bezier-rs use in Offset Path node implementation with kurbo's API

* fix kurbo import

* refactor

* Code review

---------

Co-authored-by: indierusty <priyaayadav@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-20 04:04:28 +00:00
Keavon Chambers
a376832480
Fix and improve robustness of node/parameter tooltip plumbing; simplify properties row widget boilerplate (#2600)
* WIP

* WIP2

* Further cleanup
2025-04-19 20:25:36 -07:00
ilya sheprut
adfcff7599
New node: Arc (#2470)
* init

* add closed and slice options

* Make it work beyond -360 to 360 degrees

* Switch "closed" and "slice" to ArcType enum

* Update default ranges

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-18 09:42:07 +00:00
Keavon Chambers
fa21385d2c
New nodes: 'Position on Path' and 'Tangent on Path' (#2588) 2025-04-16 22:50:50 -07:00
James Lindsay
435a6daf25
Add the first field-based nodes: 'Instance on Points', 'Instance Position', 'Instance Index', as well as 'Grid' (#2574)
* Basic fields

* Add 'Extract XY' and 'Split Vector2' nodes

* Add 'Instance Index' node

* Fix test again

* Improve grid generator to support rectangular as well

* Avoid crashing

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-16 11:58:59 +00:00
kythyria
a94354df04
New node: Dimensions (#2576)
* Add node for size of bounding box

* Keep rustfmt happy

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-16 01:07:34 +00:00
Dennis Kobert
9a62c1c089
Fix Poisson-disk sampling with negative space from nested subpaths (#2569)
* Fix poisson disk sampling with nested subpaths

Previously all subpaths were considered independently for the poisson disk sampling evaluation. We now check agains all subpaths which might contain the point to fix shapes with holes such as fonts with letters with holes in them

* Fix wasm demo

* Fix counting overlapping areas twice

* Rename shape variables to subpath variants
2025-04-15 13:37:20 +00:00
Dennis Kobert
9b23c7e2db
Update Tauri to v2 and execute only the node graph in native (#2362)
* Migrate tauri app to v2

* Move flake files to sub directory

* Remove unused plugins

* Backport some of the tauri code

* Implement async node graph execution

Only move node runtime to native code

* Always use gpu feature for tauri

* Fix serialization

* Add logging filters

* Enable native window rendering with vello

* Cleanup

* Remove unused editor instance

* Remove changes from vite config

* Remove warnings

* Remove unused files

* Fix most tests

* Cleanup

* Apply frontend lint

* Readd flake.nix

* Fix tests using --all-features

* Code review

* Enable all backends

* Fix monitor node downcast types

* Change debug log to a warning

* Disable shader passthrough

* Cleanup unused imports

* Remove warning

* Update project setup instructions

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-14 11:43:15 +00:00
mTvare
3e6021fb8f
Fix inability to drag axis-aligned lines (#2561)
* Fix 1 and 3

* Fix 2

* Shape tools refactor

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-13 03:51:40 -07:00
Keavon Chambers
e759e62291 Comment out all remaining active Imaginate code 2025-04-12 17:32:24 -07:00
Keavon Chambers
a8a5a1f3fd New node: Sample Gradient 2025-04-12 04:19:46 -07:00
Keavon Chambers
69069ef723
Fix the 'Repeat', 'Circular Repeat', and 'Mirror' nodes to work on point cloud vector data (#2553)
* Include points in bounding box calculations

* Fix unrelated crash from debug assert when reordering root-level folders

* Fix another unrelated crash from debug assert when GRS scaling to size 0

* Fix several vector nodes to respect and propagate local transform space
2025-04-12 02:18:31 -07:00
kythyria
c137e44b71
Fix the 'Bounding Box' node crashing on empty or single-point vector data input (#2529)
* Make Bounding Box have empty output on empty input

Fixes a crash when using the text tool and the Text node is connected to
a Bounding Box node.

* Use .map().unwrap_or_default()

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-10 02:48:44 -07:00
Utsav Singh
93f7004ece
Make the node catalog, originating from a wire dropped in the graph, filter for valid types (#2423)
* Add InputType based filtering capabilites to NodeCatalog.
Send InputTypes through SendUiMetadata under
odeTypes.
Update NodeCatalog.svelte component to support 	ype based filtering.
Update ContextMenuData to support compatibleType as an input to the searchTerm for the NodeCatalog.
Update Graph.svelte component to support new ContextMenuData enum types.
Send CompatibleType data from rust backend on wire drag and release to NodeCatalog to already show filtered data.

* Add InputType based filtering capabilites to NodeCatalog.
Send InputTypes through SendUiMetadata under
odeTypes.
Update NodeCatalog.svelte component to support 	ype based filtering.
Update ContextMenuData to support compatibleType as an input to the searchTerm for the NodeCatalog.
Update Graph.svelte component to support new ContextMenuData enum types.
Send CompatibleType data from rust backend on wire drag and release to NodeCatalog to already show filtered data.

* Open NodeCatalog on DoubleClick in empty node graph area

* Capture Node implementations and filter out uncatogrised nodes before sending metadata.
Update NodeCatalog Search filter to support single type search alongside name and category search

* Take union of DocumentNodeTypes and registered node implementations, Update missing categories and make sure to remove nodes with empty categories

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-09 01:07:35 -07:00
0SlowPoke0
6a8386d1e9
Improve Pen tool handle dragging with Tab swapping, Ctrl angle locking, and directly dragging the closing endpoint in handle (#2452)
* added handle_types and refactored the handle_adjustments

* anchor move refactor

* code-todo-fix

* removed-draw-mode

* kind of works need to figure out snapping

* some refactoring

* refactor+overlays..need to fix the snapping and dragging

* added docs

* got stuck in space move

* fixed all issues

* comments and small fixes

* completed last issue and refactor

* major fixes and improv

* fixed edge cases

* edge cases fixed

* fix edge cases and add docs

* Code review pass

* rename ,bug fixes

* Add terminology diagram

* Add Ctrl "Lock Angle" hint

* Rename other hint

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-07 23:26:51 -07:00
Ellen Gu
32aee1ebf9
Add Vello support for Outline view mode rendering; add non_scaling to strokes (SVG, not yet Vello) (#2455)
* fix noise pattern parameter issue

* removed the commented out line

* Fix outline mode stroke width not consistent

* add non scaling stroke option

* Fix backward compatibility

* Clean Debug Message

* clean code

* clean code 2

* Add vello outline support

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-07 00:02:11 +00:00
Oliver Davies
81db769737
Minor fixes for 'Round Corners' and 'Mirror' nodes (#2510)
* Fix round corners node not properly maintaing click targets, added keep_original bool to mirror node

* Fixed fix for the theta angle

* Add upgrade script for Mirror node

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-06 02:00:55 -07:00
kythyria
412dfc293a
Make the 'Tangent Inverse' node accept DVec2 in lieu of the separate atan2 node (#2516)
* Make the Tangent Inverse node accept DVec2

If given a DVec2 it will be atan2 instead of normal atan.

* Remove the now-redundant atan2 node

* Doc comment

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-06 01:32:02 -07:00
Dennis Kobert
8d8e2edc5f
Add 'Freeze Real Time' and 'Boundless Footprint' nodes as alternatives to using 'Memoize Impure' (#2509)
* WIP debugging

* Only create parent ref if var args are used in context + Cleanup

* Eval nodes with None instead of relying on MemoImpure

* Remove unused imports

* Show parent in debug output

* Remove TODO comment
2025-04-02 11:31:52 +00:00
Keavon Chambers
cdf896bf79 New demo artwork: "Parametric Dunescape" 2025-04-01 23:20:34 -07:00
Keavon Chambers
158f18df0d Work around unwrap crash 2025-03-29 15:43:40 -07:00
Dennis Kobert
41288d7642
Fix the Into nodes, which were broken but unused except in GPU nodes (#2480)
* Prototype document network level into node insertion

* Fix generic type resolution

* Cleanup

* Remove network nesting
2025-03-27 02:11:11 -07:00
bradrn
92132919d1
Remove subtyping for () from node graph type system (#2418)
* Remove subtyping for () from node graph type system

* Remove special-case in DynAnyNode for downcasting to ()

* Correct input type for CreateGpuSurfaceNode

* Remove unncessary imports

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: hypercube <0hypercube@gmail.com>
2025-03-26 21:26:07 +00:00
Oliver Davies
fff0a53799
New nodes: Mirror, Round Corners, Box Warp, Remove/Generate Handles, Spatial Merge by Distance (#2448)
* Add Mirror and Round Corner nodes

* Removed perspective warp ride along node

* Fixed naming, added back Box Warp

* Add Soften, Sharpen and Subdivide

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-19 20:06:01 +00:00
Dennis Kobert
44694ff8d6
Experimental animation support (#2443)
* Implement experimental time routing to the node graph

* Allow toggling live preview with SHIFT + SPACE

* Add animation message handler

* Fix hotkeys

* Fix milisecond node

* Adevertize set frame index action

* Fix frame index

* Fix year calculation

* Add comment for why month and day are not exposed

* Combine animation nodes and fix animation time implementation

* Fix animation time interaction with playback

* Add set animation time mode message

* Captalize UTC

* Fix compiling

* Fix crash and add text nodes

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-19 01:19:49 -07:00
mTvare
b98711dbdb
Improve Text tool resize/drag behavior (#2428)
* Have red be below quads

* Code review pt 1

* Skip rendering of pivot

* Code review pt 2

* Code review pt 3

* Cancel resize and its hints

* Remove the redundant placing message

* Dragging state for text tool fsm

* Cleanup

* Fix line tool undo and abort problems

* Code review

* 3px textbox overflow bottom

* Some more cleanup

* Fix reversed match arms that had been converted to if-else

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-19 06:49:49 +00:00
James Lindsay
43275b7a1e
Add the Spreadsheet panel to inspect node output data (#2442)
* Inspect node ouput stub

* Fix compile error in tests

* Create a table

* Clickable tables

* Add vector data support

* Checkbox to enable the panel

* Remove Instances table ID column; style the spreadsheet

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-18 23:06:05 -07:00
Keavon Chambers
6292dea103
Refactor many usages of Color to natively store linear not gamma (#2457) 2025-03-18 05:37:20 -07:00
Richard Dodd
0570edc463
New node: Merge by Distance (#2307)
* add `merge_by_distance` node

* remove unneeded features of petgraph

Also re-arrange module slightly since because functions are no longer
async, there was name shadowning with the old arrangement.

* remove region if start or end segment is removed

* remove stuff I ended up not using

* "algos" -> "algorithms"

* Code review pass

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-12 20:40:44 -07:00
Dennis Kobert
beb1c6ae64
Upgrade to the Rust 2024 edition (#2367)
* Update to rust 2024 edition

* Fixes

* Clean up imports

* Cargo fmt again

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-12 17:29:12 -07:00
Nitish Choudhary
c0d3eb8072
Add sizing gizmos to the Text tool's text area (#2176)
* Fix abortion while dragging

* Create function for text bounding box

* Reorder arms of text tool FSM

* add transform cage to textbox pt.1

* add transform cage pt.2

* Fix minor issue after merge

* Get bounding box working in place without action keys

* Add max_height and disable pivot drag

* Cleanup code and write doco for new utility function

* Minor change due to merge

* Add bottom overlay

* Get modifier keys to work pt.1

* Code cleanup

* cleanup

* Fix transform

* Minor improvements

* Undo debug statement!

* Add comments and keep original layer transformation

* Alt from centre

* Fix merge conflict

* Minor code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: hypercube <0hypercube@gmail.com>
Co-authored-by: James Lindsay <78500760+0HyperCube@users.noreply.github.com>
2025-03-12 10:07:10 +00:00
Keavon Chambers
a696aae044
Instance tables refactor part 5: unwrap GraphicGroup as multi-row Instance<GraphicElement> tables and move up transforms (#2363)
* Just group

* Partly working but without transforms

* Remove Transform/TransformMut from GraphicElement and GraphicGroupTable

* Fix layers and flattening

* Fix transform group handling on the remaining nodes

* Change collect metadata

* Add transform on vector data. TODO: Remove duplicate transform

* Small code tidying-up

* Add concatenate node?

* Remove ignore_modifications which is always false

* Improve transforms

* Mostly fix the nested transform cage angle (except leaf layers and skew)

* WIP attempt to integrate skew

* Fix nesting bounding box

* Avoid setting the transform

* Fix stroke transforms

* Renderer cleanup

* Fix tests for repeated elements not given unique point IDs

* Suppress cargo-deny warning

* Fix upgrade code for graphic group data

* Work around rendering issue in Isometric Fountain

---------

Co-authored-by: Adam <adamgerhant@gmail.com>
Co-authored-by: hypercube <0hypercube@gmail.com>
2025-03-12 01:38:36 -07:00
Ellen Gu
7a3bb999a9
Fix inconsistent stroke width in 'Outline' view mode (#2417)
* fix noise pattern parameter issue

* removed the commented out line

* Fix outline mode stroke width not consistent
2025-03-10 03:29:53 -07:00
Ellen Gu
74b6abbb97
Fix fill tool on raster image temporarily breaking the graph (#2398)
* Fix fill tool on raster image temporarily breaks the graph

* Avoid vector filling raster layer via checking node category

* check raster image using input type instead

* Add additional check for TextureFrameTable

* Enable the ignore raster test

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
2025-03-09 19:18:42 +00:00
Brad Neimann
85fac63bb2
Allow printing proto graph in graphite-cli (#2388)
Allow disabling running of node network in graphite-cli

It seems that graphite-cli currently crashes on some GPUs which do not
support Vulkan. This commit improves the CLI, adding an option to
disable running the node network, which prevents the crash (but also
prevents any output from being shown).

Change default log levels

Restructure argument parsing
2025-03-08 14:12:46 +01:00
Keavon Chambers
381dcbf17f
Update dependencies throughout the project (#2401)
* Update dependencies

* Update stable node ID hashes again, for some reason?
2025-03-07 21:32:52 -08:00
Keavon Chambers
22a900b35e Fix regresion from #2265 causing an extra default artboard to show up 2025-03-06 22:56:09 -08:00
James Lindsay
b171eeba84
Add tests to the Ellipse, Artboard, and Fill tools (#2181)
* Add ellipse tests

* Add tests for fill tool and re-enable some other tests

* Code review

* Fix Rust crate advisory

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-07 02:13:15 +00:00
Keavon Chambers
19a140682e Instance tables refactor part 4: replace ArtboardGroups with multi-row Instances<Artboard> (#2265)
* Clean up dyn_any usages

* Migrate ArtboardGroup to ArtboardGroupTable (not yet flattened)

* Reorder graphical data imports

* Flatten and remove ArtboardGroup in favor of ArtboardGroupTable

* Fix test
2025-03-06 05:36:26 -08:00
Keavon Chambers
2f6c6e28f0 Instance tables refactor part 3: flatten ImageFrame<P> in lieu of Image<P> (#2256)
* Remove ImageFrame<T> by flattening it into Image<T>

* Rename TextureFrame to ImageTexture

* Fix tests
2025-03-06 05:36:17 -08:00
Keavon Chambers
f1160e1ca6 Instance tables refactor part 2: move the transform and alpha_blending fields up a level (#2249)
* Fix domain data structure field plural naming

* Rename method one_item to one_instance

Rename method one_item to one_instance

* Move the Instance<T> methods over to providing an Instance<T>/InstanceMut<T>

Move the Instance<T> methods over to providing an Instance<T>/InstanceMut<T>

* Add transform and alpha_blending fields to Instances<T>

* Finish the refactor (Brush tool is broken though)

* Add test for brush node

* Fix brush node

* Fix default empty images being 1x1 instead of 0x0 as they should be

* Fix tests

* Fix path transform

* Add correct upgrading to move the transform/blending up a level

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
2025-03-06 05:36:09 -08:00
Dennis Kobert
4ff2bdb04f Replace Footprint/() call arguments with dynamically-bound Contexts (#2232)
* Implement experimental Context struct and traits

* Add Ctx super trait

* Checkpoint

* Return Any instead of DynAny

* Fix send implementation for inputs with lifetimes

* Port more nodes

* Uncomment nodes

* Port more nodes

* Port vector nodes

* Partial progress (the stuff I'm more sure about)

* Partial progress (the stuff that's not compiling and I'm not sure about)

* Fix more errors

* First pass of fixing errors introduced by rebase

* Port wasm application io

* Fix brush node types

* Add type annotation

* Fix warnings and wasm compilation

* Change types for Document Node definitions

* Improve debugging for footprint not found errors

* Forward context in append artboard node

* Fix thumbnails

* Fix loading most demo artwork

* Wrap output type of all nodes in future

* Encode futures as part of the type

* Fix document node definitions for future types

* Remove Clippy warnings

* Fix more things

* Fix opening demo art with manual composition upgrading

* Set correct type for manual composition

* Fix brush

* Fix tests

* Update docs for deps

* Fix up some node signature issues

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: hypercube <0hypercube@gmail.com>
2025-03-06 05:35:56 -08:00