Commit graph

147 commits

Author SHA1 Message Date
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
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
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
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
Keavon Chambers
0d8b25d37f
Update most Rust dependencies (#2259) 2025-02-04 02:41:13 -08:00
James Lindsay
93880abc4c
Experimental vector meshes (#2223)
* Experimental vector meshes

* Clarify limitations in label and tooltip

* Restore old traversal direction

* Fix Bezier-rs crashes

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-25 17:13:35 -08:00
Keavon Chambers
1e62af88cd Remove trailing zeros in rendered SVG path output 2025-01-13 02:56:33 -08:00
Priyanshu
bf6ffbddeb Bezier-rs: Add method to check subpath insideness (#2183)
* add function to calculate if a subpath is inside polygon

* make is_subpath_inside_polygon() flexible

* obtimize is_subpath_inside_polygon function

* move is_inside_subpath function to Subpath struct method

* add interactive demo for subpath insideness

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-10 00:37:40 -08:00
Keavon Chambers
07601a5c6c Improve snapping with better snap target names, tooltips, cleaner overlay labels, code cleanup 2025-01-09 19:03:14 -08:00
Keavon Chambers
b81f48385a Fix several bugged vector-related nodes 2024-12-26 16:36:45 -08:00
Jacin Yan
3423c8ec13
New node: Math (#2121)
* 2115 IP

* Initial implementation of Expression node

* Register Expression Node

* Add Expression DocumentNode Definition

* DocumentNodeImplementation::Expresssion in guess_type_from_node

* Move expression.rs to graphene-core

* WIP: Investigating 'exposed' & 'value_source' params for Expression property

* Node graph render debug IP

* Single input can change node properties; complex debug IP

* Fix epsilon in test

* Handle invalid expressions in expression_node by returning 0.0

* Run cargo fmt

* Set the default expression to "1 + 1"

* Hardcode the A and B inputs at Keavon's request

* Rename and clean up UX

* Move into ops.rs

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-12-17 07:08:14 +00:00
James Lindsay
fc0cf604df
Update some dependencies (#2134)
* Update some dependencies

* Update to action v2

* Fix for v2
2024-12-12 18:28:49 +00:00
James Lindsay
e3bb11ec1b
Fix clippy lints (#2119) 2024-11-29 22:58:49 +00:00
urisinger
9fb494764c
Add math-parser library (#2033)
* start of parser

* ops forgot

* reorder files and work on executer

* start of parser

* ops forgot

* reorder files and work on executer

* Cleanup and fix tests

* Integrate into the editor

* added unit checking at parse time

* fix tests

* fix issues

* fix editor intergration

* update pest grammer to support units

* units should be working, need to set up tests to know

* make unit type store exponants as i32

* remove scale, insted just multiply the literal by the scale

* unit now contains empty unit,remove options

* add more tests and implement almost all unary operators

* add evaluation context and variables

* function calling, api might be refined later

* add constants, change function call to not be as built into the parser
and add tests

* add function definitions

* remove meval

* remove raw-rs from workspace

* add support for numberless units

* fix unit handleing logic, add some "unit" tests(haha)

* make it so units cant do implcit mul with idents

* add bench and better tests

* fix editor api

* remove old test

* change hashmap context to use deref

* change constants to use hashmap instad of function

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-11-21 10:24:01 -08:00
Sidharth-Singh10
3b503ccde2
Bezier-rs: Make rectangle constructor produce linear segments (#2109)
* fix(bezier-rs): new_rect constructor create linear segments

* refactor
2024-11-18 21:10:08 +00:00
Keavon Chambers
d649052255 Upgrade and document the math operation nodes 2024-11-09 23:23:25 -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
Elbert Ronnie
8fdecaa487
Rename Raw-rs to Rawkit (#2088)
* Rename within files

* Rename in CI

* Rename the folder and file names

* Rename raw_rs to rawkit

* Add example to README

* Add initial documentation

* Small API changes and extra documentation

* Bump versions and stuff

* Readme improvements

* Merge proc-macro crates into one

* Add README to rawkit-proc-macros

* Remove keywords and categories

* Add licenses to rawkit-proc-macros

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-11-03 08:10:39 +00:00
Elbert Ronnie
b7ba2c3637
Raw-rs: Remove fortuples dependency (#2082)
Remove fortuples from Raw-rs
2024-10-28 16:23:22 +00: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
Elbert Ronnie
9d13a8f73b
Raw-rs: Remove from workspace (#2066)
* Remove raw-rs from workspace

* Add feature blocking to reqwest

* Use release build to run the tests

* Split Raw-rs CI into a seperate workflow

* Fix cargo-deny check for Raw-rs

* Only run the CI if Raw-rs changes

* Enable clippy check for Raw-rs

* Add newline in clippy check

* Fixups

* Use ubuntu-latest

* Remove mold

* Install sccache

* Attempt 2

* Attempt 3

* Add emoji for consistency

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-10-25 14:44:45 -07:00
Elbert Ronnie
36fe9bf31b
Raw-rs: Fix naming convention of matrices (#2071)
Fix naming convention of matrices
2024-10-25 19:09:07 +00:00
Elbert Ronnie
442937c13f
Raw-rs: Refactor to run multiple steps in a single loop (#1972)
* Prevent extra allocation in convert to RGB step

* Run preprocessing steps in a single loop

* Create new API to call steps in pipeline

* Include transform and gamma correction step

* cargo fmt

* Split scale colors into two steps

* Code relocations

* cargo fmt

* Implement transform traits for all tuples

* Replace Captures trick with the new `use` keyword
2024-10-25 11:52:35 -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
b26dfbcd7c
Always close subpaths before applying boolean ops (#2014)
* Always close subpaths before applying boolean ops

* Roundtrip boolean path through svg string

* Reverse closing path segment

* Sort result of boolean ops

* Make face visiting order deterministic

* Remove debugging code

* Remove unused post processing

* Clippy lint

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-10-03 11:20:04 -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
Dennis Kobert
3eb98c6d6d
Add path-bool library (#1952)
* Add path-bool library

* Cleanup code

* Cargo format

* Integrate boolean ops into graphite

* Add test for editor crash

* Fix edge sort floating point instability

* Add unit test for red-dress failure

* Backport tests and aux functions

* Use curvature based sorting

* Convert linear cubic splines to line segments

* Deduplicate reversed path segments

* Fix epsilon for empty segments

* Remove parameter based intersection pruning

* Add support for reversed paths

* Add benchmark infrastructure

* Add intersection benchmark

* Add recursion bound

* Implement support for overlapping path segments

* Remove rouge prinln

* Fix sorting for bezier segments with one control point at the start of the segment

* Cleanup log statements

* Directly translate graphite paths to Path segments

* Round data before passing it to path_bool

* Fix flag_faces traversal order

* Add test for white dots in bottom right of painted dreams

* Make rounding configurable

* Update demo artwork to remove manual path modifications

* Convert from path segments to manipulator groups directly

* Remove dead code

* Fix clippy lints

* Replace functions in path segment with methods and add documentation

* Add more documentation

* Close subpaths

* Reorganize files and add README.md

* Add license information

* Code review

* Fix license info

* Adopt new node macro and fix demo artwork

* Close subpaths with Z

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-09-21 02:06:43 -07:00
Elbert Ronnie
d68f91ccca
Raw-rs: run tests in parallel (#1968)
* Run raw-rs tests in parallel

* cargo fmt

* Fix clippy warnings

* Use Fast CompressionType to speed up the tests

* Fix benches

* Use cfg_attr instead of cfg.

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-09-20 11:09:58 +00: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
Elbert Ronnie
d9ae01bf90
Raw-rs: Flip and rotate image based on camera orientation (#1954)
* add Orientation tag

* fix errors

* Apply the transformation to the image

* Fix BASE_PATH in raw-rs tests

* Create output folder if it doesn't exist

* Nit

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-09-05 15:18:58 -07:00
James Lindsay
bf5019db7b Bezier-rs: Fix crash when outlining a small bézier (#1958)
Fix crash when outlining small bézier
2024-09-05 10:48:12 -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
Elbert Ronnie
82ef5c83ae
Raw-rs: use camera white balance when available (#1941)
* add new White Balance Tag

* merge raw_to_image step with demosiacing

* Use white balance from camera in scale colors step

* Nit

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-09-02 18:39:01 +05:30
Elbert Ronnie
a7840b252d
Raw-rs: add post-processing steps (#1923)
* add convert_to_rgb step

* add code to generate gamma correction curve

* add gamma correction step

* fix clippy warnings and cargo fmt

* remove unnecessary dependencies

* Code review 1

* Code review 2

* fix the order of operations

* Code review 3

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-08-21 18:34:27 -07: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
Elbert Ronnie
a9cfeeb219
Raw-rs: Add preprocessing and demosaicing steps (#1796)
* add subtract black step

* add scale colors step

* add raw to image step

* implement linear demosiacing and fix errors in previous code

* fix missing variable

* make dependencies of tests optional

* fix error in raw-rs tests

* fix typo in "demosiacing"

* use camera data from ADC and remove downloader

* cargo fmt

* use file_stem instead of file_name

* remove old camera data

* use equality instead of subtring to find model

* store camera_to_xyz in decimal form

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-08-11 01:36:50 -07: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
adamgerhant
8041b1237c
Fix regressions from network interface PR (#1906)
* Fix regressions

* Remove unnecessary graph render in box selection

* Improve stack positioning

* Store layer stacks as absolute position

* Improve automatically creating chains

* Improve group selection

* Increase horizontal layer spacing by 1

* Fix export crash and demo artwork

* Improve inserting node onto wire, fix spline crash

* Remove comment
2024-08-07 01:03:12 -07:00
James Lindsay
ea44d1440a
Use a coarse bounding box to avoid a detailed check for intersection when clicking artwork (#1887)
* Add bounding box check for intersection

* Cache the bounding box

* private subpath
2024-08-03 15:10:04 +01:00
James Lindsay
fa1535d0bb
Update dependencies and lock files (#1841)
* Bump lock files

* Fix glam mismatch version

* Add tokio feature

* Update all deps

* Fix gpu-compiler not able to reference the root workspace

* Bump a few more deps

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-07-22 02:56:29 -07:00
Dennis Kobert
ab71d26d84
Integrate Vello for vector rendering (#1802)
* Start integrating vello into render pipeline

Cache vello render creation

Implement viewport navigation

Close vello path

Add transform parameter to vello render pass

* Fix render node types

* Fix a bunch of bugs in the path translation

* Avoid panic on empty document

* Fix rendering of holes

* Implement image rendering

* Implement graph recompilation afer editor api change

* Implement preferences toggle for using vello as the renderer

* Make surface creation optional

* Feature gate vello usages

* Implement skeleton for radial gradient

* Rename vello preference

* Fix some gradients

* Only update monitor nodes on graph recompile

* Fix warnings + remove dead code

* Update everything except for thumbnails after a node graph evaluation

* Fix missing click targets for Image frames

* Improve perfamance by removing unecessary widget updates

* Fix node graph paning

* Fix thumbnail loading

* Implement proper hash for vector modification

* Fix test and warnings

* Code review

* Fix dep

* Remove warning

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-07-22 01:56:29 -07:00
Dennis Kobert
212f08c6c8
Restore functionality of GPU infrastructure (#1797)
* Update gpu nodes to compile again

Restructure `gpu-executor` and `wgpu-executor`

And libssl to nix shell

Fix graphene-cli and add half percision color format

Fix texture scaling

Remove vulkan executor

Fix compile errors

Improve execution request deduplication

* Fix warnings

* Fix graph compile issues

* Code review

* Remove test file

* Fix lint

* Wip make node futures send

* Make futures Send on non wasm targets

* Fix warnings

* Fix nested use of block_on

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-07-15 13:14:48 +00:00
Raminder Singh
62f73df048
Fix a lot of Clippy warnings (#1808)
* fix a lot of clippy warnings

* fix more clippy warnings

* fix yet more clippy warnings

* bump msrv to 1.70.0 to silence warnings

* fix a lot of clippy warnings

* fix more clippy warnings

* fix yet more clippy warnings

* fix a few more warnings

* fix a clippy warning

* remove a commented out line

* silense too many arguments error

* fix more clippy warnings

* prefix underscore to unused vars/functions to fix warnings

* use filter instead of map

* move raw-rs-tests feature flat to module level to fix unused imports warnings

* fix a couple of unused result warnings

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-07-09 05:02:52 -07:00
Keavon Chambers
f7ada701e5
Reorganize cargo dependencies and upgrade most of them (#1815)
* Reorganize cargo dependencies and upgrade most

* cargo update

* Attempt 2

* Polishing changes

* Comment out specta typescript flag-dependent code

* Fix test
2024-07-09 04:08:28 -07:00
James Lindsay
1652c713a6
Add nondestructive vector editing (#1676)
* Initial vector modify node

* Initial extraction of data from monitor nodes

* Migrate to point id

* Start converting to modify node

* Non destructive spline tool (tout le reste est cassé)

* Fix unconnected modify node

* Fix freehand tool

* Pen tool

* Migrate demo art

* Select points

* Fix the demo artwork

* Fix the X and Y inputs for path tool

* G1 continous toggle

* Delete points

* Fix test

* Insert point

* Improve robustness of handles

* Fix GRS shortcuts on path

* Dragging points

* Fix build

* Preserve opposing handle lengths

* Update demo art and snapping

* Fix polygon tool

* Double click end anchor

* Improve dragging

* Fix text shifting

* Select only connected verts

* Colinear alt

* Cleanup

* Fix imports

* Improve pen tool avoiding handle placement

* Improve disolve

* Remove pivot widget from Transform node properties

* Fix demo art

* Fix bugs

* Re-save demo artwork

* Code review

* Serialize hashmap as tuple vec to enable deserialize_inputs

* Fix migrate

* Add document upgrade function to editor_api.rs

* Finalize document upgrading

* Rename to the Path node

* Remove smoothing from Freehand tool

* Upgrade demo artwork

* Propertly disable raw-rs tests

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: Adam <adamgerhant@gmail.com>
Co-authored-by: Dennis Kobert <dennis@kobert.dev>
2024-07-05 13:42:40 -07:00
Elbert Ronnie
fd3613018a
Raw-rs: make decoder for ARW1 and ARW2 formats (#1775)
* convert Tag into a trait

* Create ARW 1 decoder

* add decoder for sony tone curve table

* create decoder for arw 2.1 format

* add windsock.arw to the tests

* create derive macro for Tag and use it in decoders

* add license to tag-derive

* add code to identify model

* impl Display for Ifd

* Code review

* Fix type variable name

* Fix compilation

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-06-28 03:23:05 -07:00
0hypercube
cf01f522a8 Fix bug with Path tool point insertion often not working 2024-06-13 03:08:03 -07:00
Elbert Ronnie
52d2047ca6
Run Raw-rs tests only on CI (#1776)
run raw-rs tests only on CI
2024-06-11 01:26:54 -07:00