Commit graph

248 commits

Author SHA1 Message Date
Firestar99
a182a7347e
Extract gbrush (#2784)
Some checks failed
Editor: Dev & CI / build (push) Has been cancelled
Editor: Dev & CI / cargo-deny (push) Has been cancelled
2025-07-01 18:38:47 +00:00
Firestar99
602d7e8bd1
Extract graster-nodes (#2783) 2025-07-01 18:12:12 +00:00
Firestar99
8e2c206a01
node macro: copy visibility from node function (#2782) 2025-07-01 15:29:00 +00:00
Keavon Chambers
8c5accc069
Clean up node catalog by adding missing units, more tooltips; fix 'Line' node missing parameters (#2813)
* Fix unit usages

* Add node and parameter doc comments

* Fix the parameters panel for the 'Line' node when added from the graph

* Clean up nodes

* Fix tests

* Update the demo artwork
2025-07-01 07:47:54 -07:00
Salman Abuhaimed
83773baa00
Replace Rustybuzz with Parley for text layout, and add text tilt parameter (#2739)
* replace rustybuzz with parley for text layout handling

change text input direction based on text direction

* Code review

* change default character spacing to 0

* add shear to text node

this also adds migration code for documents that don't have shear

* shear migration for text node

- add shear property
- set character spacing to 0

* use old max_width and max_height in text migration if available

* Final code review pass

* Add units to the parameters

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-07-01 02:23:17 -07:00
Firestar99
ecd7999ca7
Extract gmath_nodes from gcore::ops, create mods debug and extract_xy (#2764) 2025-06-28 00:04:24 +02:00
Firestar99
9c4ab34a58
Extract gsvg_renderer from gcore, remove gcore/vello feature (#2760)
Extract `gsvg_renderer` from `gcore`, remove `gcore/vello` feature
2025-06-27 13:47:46 +00:00
Firestar99
ffc6c5532b
Extract gpath_bool from mod gstd::ops path_bool-related nodes (#2762)
* cargo shear

* Extract `gpath_bool` from `mod gstd::ops` path_bool-related nodes
2025-06-27 13:12:08 +00:00
Firestar99
d581319ee8
Prep gcore splitup 2: Vector extension traits (#2759)
* extension trait for `MergeByDistance::merge_by_distance_*`

* extension trait for `VectorData::append_bezpath`

* extension trait for `HandleId::set_relative_position`

* remove unreferenced rust files
2025-06-27 12:30:12 +02:00
Firestar99
2ddae98bcf
Prep gcore splitup: move various symbols into their own modules (#2746)
* move `trait AsU32` from `gcore::vector::misc` to `gcore`

* move blending and gradient to their own modules

* fix unused warnings

* move `Quad`, `Rect` and `BBox` to `gcore::math`

* extract `ReferencePoint` and transform nodes from `transform`

* move color-related code to `mod color`

* fix unused warning in test code

* move blending-related nodes and code to `mod blending_nodes`

* move ClickTarget code to `mod vector::click_target`
2025-06-27 09:54:34 +00:00
Keavon Chambers
1875779b0a Remove dead code for Imaginate 2025-06-26 18:46:46 -07:00
Keavon Chambers
4a65ad290c Fix 'Boolean Operation' node merge-by-distance post-processing
Fixes #2750
2025-06-24 18:23:09 -07:00
Keavon Chambers
fdb09e334b Improve the categorization across many nodes 2025-06-23 18:52:05 -07:00
Firestar99
0e8eb481bf
Extract gapplication_io from gcore (#2742)
move `gcore::application_io` into the new crate `gapplication-io`, remove features `wasm` and `wgpu` from `gcore`
2025-06-23 11:35:14 +02:00
Keavon Chambers
b5975e92b2 Combine 'Merge by Distance' nodes with a choice of algorithm; clean up 'Boolean Operation' node result with merge-by-distance 2025-06-22 04:22:39 -07:00
Firestar99
e520c21b66
Remove the serde feature and instead just always require it (#2737)
workspace: remove feature `serde`, always require it instead
2025-06-21 16:52:47 -07:00
Firestar99
ca5ca863cc
Unify feature dependencies with workspace dependencies (#2736)
* graph-craft: fix direct wasm build

* graph-craft: fix no serde feature failing to compile

* graph-craft: make wgpu-executor properly optional

* workspace: unify `image` formats in workspace

* workspace: turn most dependencies into workspace deps, no actual changes

* workspace: unify dependency features in workspace dep
2025-06-21 16:26:25 -07:00
Firestar99
990d5b37cf
Bulk gcore cleanup, replace core and alloc with std (#2735)
* gcore: replace `core` and `alloc` paths with `std`

* node-graph: remove unnecessary path prefix

* gcore: remove most `#[cfg(target_arch = "spirv")]`, keep some potentially useful ones

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-21 23:08:33 +00:00
Firestar99
34dced38ba Make gcore a std library and remove std, alloc, and more unused features (#2724)
* gcore: remove features `std`, `alloc`, `gpu` and `reflections`, now always available

* gcore: remove non-working features `kurbo` and `log`
2025-06-19 20:28:17 -07:00
Firestar99
13226f7049 Re-export all of gcore in gstd and rename 'Image' node to 'Image Value' (#2733)
* rename `image` node to `image_value`

* reexport the entirety of `gcore` in `gstd`
2025-06-19 20:28:17 -07:00
Firestar99
14d90195ad Remove unused dependencies from the Cargo.toml files via cargo shear (#2723)
* cargo shear ignore rules

* cargo shear

* cargo shear manual dependency removal

* cargo shear: ignore editor in proc-macros
2025-06-19 20:28:17 -07:00
Firestar99
3489f9ddb1 Bulk remove old code for legacy GPU node implementations (#2722)
* fix warning in node-macro

* remove crates `gpu-executor`, `gpu-compiler`, `compilation-client` and `compilation-server`

* remove `wgpu-executor::executor`

* .gitignore .idea/
2025-06-19 20:28:17 -07:00
mTvare
e238753a35 Implement clipping masks, stroke align, and stroke paint order (#2644)
* refactor: opacity + blend_mode -> blend_style

* Add code for clipping

* Add alt-click masking

* Clip to all colors. Fill option

* Fix undo not working. Fix strokes not being white

* Allow clipped to be grouped or raster

* Switch to alpha mode in mask-type

* add plumbing to know if clipped in frontend and add fill slider

* Attempt at document upgrade code

* Fix fill slider

* Add clipped styling and Alt-click layer border

* Use mask attr judiciously by using clip when possible

* Fix breaking documents and upgrade code

* Fix fixes

* No-op toggle if last child of parent and don't show clip UI if last element

* Fix mouse styles by plumbing clippable to frontend

* Fix Clip detection by disallowed groups as clipPath according to SVG spec doesn't allow <g>

* Add opacity to clippers can_use_clip check

* Fix issue with clipping not working nicely with strokes by using masks

* Add vello code

* cleanup

* Add stroke alignment hacks to SVG renderer

* svg: Fix mask bounds in vector data

* vello: Implement mask hacks to support stroke alignment

* Move around alignment and doc upgrade code

* rename Line X -> X

* An attempt at fixing names not updating

* svg: add stroke order with svg

* vello: add stroke order with by calling one before the other explicitly

* fix merge

* fix svg renderer messing up transform det

* Code review; reorder and rename parameters (TODO: fix tools)

* Fixes to previous

* Formatting

* fix bug 3

* some moving around (not fixed)

* fix issue 1

* fix vello

* Final code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-19 19:11:01 -07:00
Keavon Chambers
eda858b6e2 Add support for the 'Boolean Operation' node to accept vector tables, not just groups 2025-06-19 18:58:19 -07:00
Keavon Chambers
6111440afd Instance tables refactor part 7: Remove RasterDataType and add Raster<CPU>/Raster<GPU> 2025-06-19 18:37:13 -07:00
Keavon Chambers
5cacab2e39 Instance tables refactor part 7: Rename "ImageFrame" -> "RasterData", "ImageFrameTable" -> "RasterDataType", and "RasterFrame" -> "RasterDataType" 2025-06-19 18:23:53 -07:00
Keavon Chambers
2696abc6b3
Replace Instances<T>::empty() with Instances<T>::default() and make it return an empty table for vector data instead of one empty row (#2689)
Make Instances<T>::default() return an empty table for everything, even vector, and replace ::empty() with ::default()
2025-06-04 21:00:21 -07:00
Keavon Chambers
cb4289169d
Instance tables refactor part 6: unwrap VectorData and ImageFrame from single-row to multi-row tables (#2684)
* Start refactoring the boolean operations code

* Switch to iterators in the boolean operations code

* Make boolean operations work on rows of a table, not Vecs of single-row tables

* Remove more .transform()

* Simplify brush code

* Attempt to remove .transform() by using Instance<Image<Color>> in brush code, but a regression is introduced

* Improve blend_image_closure

* Simplify

* Remove leading underscore from type arguments

* Remove .transform() from ImageFrameTable<P> and fix Mask node behavior on stencils not fully overlapping its target image

* Remove more .one_instance_ref()

* Fully remove .one_instance_ref() and improve the 'Combine Channels' node robustness

* Fully remove .once_instance_mut()

* Fix tests

* Remove .one_empty_image()

* Make Instances<T>::default() return an empty table for images, but still not yet vector

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
2025-06-04 20:40:15 -07:00
mTvare
4d2e1d57fd
Instance table refactor part 6: remove usage of one_instance_* functions (#2672)
* Refactor the spline node

* Refactor the jitter_points node

* Refactor the morph node

* Refactor the merge_by_distance node

* Refactor the area node

* Refactor the centroid node

* Refactor the bevel node

* Refactor the tests

* Code review

* Refactor the morph node

* Refactor the extend_image_to_bounds and sample_image node

* Refactor the dehaze node

* Refactor the blur node

* Refactor the vector_points node

* Refactor the blit node

* Refactor the blend_gpu_image node

* Refactor the path_modify node

* Refactor the image_color_palette

* Fix copy_to_points

* Code review

* Partially make progress toward fixing the Draw Canvas node

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-05-29 03:08:16 -07:00
Keavon Chambers
2cee9e24cd Refactor some more vector nodes to use loops instead of one_instance, as a start to #1834 part 6 2025-05-24 21:33:58 -07:00
Keavon Chambers
a8e209e44c
Remove the old node macro and fix/clean up several raster nodes (#2650)
* Fix several broken raster nodes and clean up leftover old node system code

* Migrate Brightness/Contrast to the new node macro, and fix it

* Remove last usages of old_node_fn

* Remove old_node_fn
2025-05-17 21:24:32 -07:00
Keavon Chambers
d3b5dc5712
Clean up 'Image' node by removing old 'Cull' node in sub-network (#2643)
* Clean up 'Image' node by removing old 'Cull' node in sub-network

* Fix gamma correction on Decode Image node
2025-05-12 18:40:48 -07:00
kythyria
9ef9b205d9
Auto-generate enum type widget boilerplate for radio buttons and dropdown menus (#2589)
* First draft of factoring out the dropdown boilerplate

* Add proc macro for enum boilerplate

* Detect whether to say `crate` or the name

* Clean up the input and naming of the enum macro

* Rename a file

* Do the rename of code too

* Use the attribute-driven selection of radio vs dropdown

* Add a metadata struct and tooltips

* Move the new traits to a better place.

* Use ChoiceType, part 1

* Use ChoiceType, part 2

* Introduce a builder API for choice widgets

* Start using the new new API

* DomainWarpType should be a dropdown still

* Handle the case where a node property can never have a socket

* Rustfmt

* Code review

* Update stable node IDs in test

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-05-01 04:14:26 -07:00
mTvare
9303953cf8
Update #[min/max] node macro attributes to #[soft/hard]_[min/max] and make them clamp their input data (#2464)
* Fix min and max macro not enforcing limits when data flows

* Use trait based clamping

* Remove min/max from testing

* cargo fmt

* Resolve into min, and hard_min

* cargo fmt

* fix traits

* cargo fmt

* fix tests

* rename as soft_x

* Add validation code

* Clean up (not compiling because of DVec2 clamping)

* Avoid needing to add trait bounds to node definitions

* Code review

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-30 23:52:27 -07:00
Calvin
23b2c5bdf2
New node: Blur (#2477)
* Implementation of gaussian blur and box blur with linear/nonlinear colorspace in raster category

* styling/formatting

* Partial code review

* remove image crate, use conversion functions from color.rs

* fix box blur checkmark, fix linear/gamma conversion

* mult/unmult alpha before/after blur

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-30 02:47:46 +00: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
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
Keavon Chambers
e759e62291 Comment out all remaining active Imaginate code 2025-04-12 17:32:24 -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
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
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
Keavon Chambers
6292dea103
Refactor many usages of Color to natively store linear not gamma (#2457) 2025-03-18 05:37:20 -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
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
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
Dennis Kobert
6becaef980
Fix Vello rendering the infinite canvas without a white background color (#2361)
Fix infinite canvas for vello

Remove debugging fill

Remove debug log
2025-03-06 11:37:00 +00:00
Keavon Chambers
0d8b25d37f
Update most Rust dependencies (#2259) 2025-02-04 02:41:13 -08:00