Commit graph

19 commits

Author SHA1 Message Date
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
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
Keavon Chambers
c738b4a1f9 Replace terminology "primary" with "call argument" and "parameter" with "secondary input" 2024-09-25 20:05:00 -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
Bruce Mitchener
507210b961 Fix some typos in the node graph code (#1970) 2024-09-11 02:36:34 -07:00
Keavon Chambers
27f9e3f00e
Move node visibility flag from NodeNetwork to DocumentNode (#1708)
* protonode -> proto node

* Move node visibility flag from NodeNetwork to DocumentNode

* Add serde default for new field

* Logic improvements
2024-03-27 05:17:08 -07:00
Keavon Chambers
a02b162e30
Consolidate and rename Graphene data types, and add many comments (#1620)
* Document ProtoNodeInput

* More comments

* Comment improvements

* Comment and split ProtoNodeInput::NodeLambda from ProtoNodeInput::Node

* Combine NodeImplementation into DocumentNodeImplementation

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
2024-02-20 17:53:04 -08:00
Keavon Chambers
1cc23320a5
Hide the Cull node by integrating it into all generator nodes (#1538)
* Hide the Cull node by integrating it into all generator nodes

* Remove internal Cull node from Mandelbrot
2023-12-30 12:28:06 -08:00
Keavon Chambers
c5ed54cbd2 Rename several node graph structs/fields 2023-12-08 15:30:00 -08:00
Keavon Chambers
60a9c27bf1
Add viewing/editing layer names, add Blend Mode node, and clean up Layer node (#1489) 2023-12-07 15:10:47 -08:00
Iago-lito
6d9dd5fc27
Fix 404 in node-graph README. (#1480)
(defaulting to `master` instead of this dead branch?)
2023-11-26 18:01:42 +00:00
Keavon Chambers
09743dcdc4 Rename DocumentNodeType to DocumentNodeBlueprint for clarity 2023-11-05 01:24:53 -08:00
0HyperCube
e0ac073805
Improve previewing node data (#1446)
* Improve preview

* Improve contrast

* Restructure in order to duplicate code

* Code review nits

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-11-04 02:52:26 -07:00
0HyperCube
ceb2f4c13f
Add more details to Graphene concept documentation (#1437)
* Start improving node system docs

* Add note on debugging

* Explain testing protonodes

* Code review comments

* Review pass

* Further improve explanation of manual_compostion

* Fix explanation of ComposeNode graph rewriting

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-10-27 19:21:15 -07:00
0HyperCube
a1c70c4d90 Update node guide (#1305) 2023-06-08 18:19:10 +01:00
Dennis Kobert
02d4565b0c Update node graph guide readme with new syntax (#1061) 2023-03-01 15:13:51 +01:00
0HyperCube
951c49a979 Node code cleanup for vector data, and add node creation guide (#895)
* Cleanup Vector Nodes

* Add the creating nodes guide

* Rename guide as readme so GitHub shows it by default

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-12-21 19:50:40 +00:00
Dennis
c44e9d22e3 Integrate dyn-any into the main graphite repo 2022-08-04 08:52:24 +02:00
TrueDoctor
a807a54c80 Initial implementation of node graph based on structs 2021-07-07 13:05:52 +02:00