-
-
Notifications
You must be signed in to change notification settings - Fork 955
GSoC 2025: Marquee Selection Masking #2655
-
About:
I'm Austin, a statistics student in IITK and I will be working on my project titled marquee selection masking to implement various features related to masking and clipping into Graphite.
Synopsis
The goal of this project is to supplant the Mask node with a mask input to every graphical node, which takes in a general graphic input. This lays the foundation to build further nodes and operations such as one sided stroke alignment, gradient across strokes. Further a new "mask mode" will be introduced, which works at tooling level to enable a way to implement marquee selection masking, which unlike traditional mask tools(clipping) also supports gradient based operations(masking) and supporting much more than simple lasso, freeform or rectangle type selection present in other tools. Further, a system to show the types of nodes merged through the merge node will be implemented, along with their mask information.
Deliverables
- Add a mask input to most graphical node which uses the mask in some form and remove the old mask node, which is then equivalent to merge with mask.
- Implement the infrastructure to render the output of the mask node with SVGs and vello.
- Add the MaskMode to the DocumentMode, with the live masking ants shader running then, which as expected for a DocumentMode affects tooling behaviour.
- Add the system required to propagate nodes merged through the Merge node in the layer panel, along with masks of nodes if present.
- Flood fill node which takes in a point, tolerance and color.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 9 comments
-
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 2
-
Week 2I started off this week by fixing new bugs and my old PR which didn't work over time.
Then into writing a system so that clipPath can be alternatively used instead of mask when possible, as it is faster and has lesser artifacts.
Then, along with the help of @Keavon who wrote the frontend part, and assets, I implemented a indicator for clipped layers in Layer panel. And finally I ended the week by fixing the logic used in clip and mask usage, to ignored layers with stroke.
|
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1
-
Week 3I started off this week by working on part 6 of instance table refactor. It mostly involved rewriting method to work with many rows across the table instead of the first, and a followup to an old PR It allows And I ended up implementing masking in vello, which looks exactly the same and also makes inverted masking a breeze compared to doing so with SVGs: 8xU5.mp4
Then, I worked on stroke alignment, by using the same technique used for masking, as neither vello nor svg have built-ins. I had also implemented paint-order for strokes and fills, which was now straight forward in svg and implemented in vello by changing the order of calling
Paint Order:
|
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 2
-
Week 4
I started off this week by working on the following bug fixes, which were mostly minor UX fixes
https://discord.com/channels/731730685944922173/881073965047636018/1358697354936713297
https://discord.com/channels/731730685944922173/881073965047636018/1362322748524986519
https://discord.com/channels/731730685944922173/881073965047636018/1360813352376598598
- Improve the click targets for the skew triangles of the transform cage #2703
- Fix grid overlay values getting wiped when switching between isometric/rectangular and back #2702
- Fix inability to deselect nodes, and nodes not being selected when pasted #2691
Then I finished off the week by
- Fixing https://discord.com/channels/731730685944922173/881073965047636018/1362323140784689254, mostly trying to rework the logic in
delete_nodes
but it keeps breaking in certain edge cases from expected behaviour of previous code - Changed the bounding box of skew triangles to be rects instead of triangles in Improve the click targets for the skew triangles of the transform cage #2703
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1
-
Week 5
- Fixed bug where
Outside
stroke alignment would ignore fill due to masking by instead using stroke order to get similiar behaviour if there is fill (otherwise continue with masking) - Fixed bug with edge case allowing gradients work messing with path's stroke alignment transform
- Rewrote the mask node so that masks no longer rely on raster content but instead work with any content, and render the same with svg or vello, which will eventually allow some nodes to consume the mask and modify data in place if required, or is otherwise sent straight to renderer
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1
-
Week 6
This week I focused on implementing the separate visualization of pivot and origin points as described in issue #2225.
The PR adds origin data to each layer, which establishes a foundational concept that was missing in Graphite. Origin is the (0,0) coordinate of a layer's internal space, separate from the temporary pivot used during transformations.
I implemented:
- Added origin visualization (a dowel pin symbol)
- Implemented three center of transformation modes similar to Blender's transform pivot point system, 2 pivot based and 2 origin,
- Draft Pivot: a pivot which can be moved around or set using reference pivot
- Average of Origins: Mean position of origins of selected layer
- Active Object Origin: centered about last selected layer
- Default: center of bounds covering the layers
Active Object Origin
active.mp4
Average of Origins
avg.mp4
Draft Pivot
pivot.mp4
Default
a.mp4
I also improved the pivot system by:
- Removing the persistent per-layer storage of pivot positions to avoid user confusion
- Making pivot positions reset when switching layers unless explicitly pinned
- Revert to a
ReferencePoint
when switching layers
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1
-
Week 7
This week I continued working on #2225
- Added pin widget for pinning pivot reference input widget
- Refactored pivots and "Dot" to work with path tool (and have all features in select_tool work for path_tool)
- Added active origin, working pivot and average of origin types to path tool
- Some final fixes to PivotGizmo before merging
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1
-
Week 8
- Got Add pivot type selection with Custom Pivot, Origin (Average Point), and Origin (Active Object) to the Select tool #2730 finally merged with some bug fixes
- Added hash function which gives new hash to each BrushCacheImpl which prevents shared bbox (Fix brush bounding boxes by making BrushCacheImpl's hash not shared between different instances #2845 )
Before:
capture_61_.mp4
After:
8G0e.mp4
- Fixed the range acting as soft_(min|max) unless when using hard_(min|max) Fix #[range] to act as a soft min/max #2678
- Working on rewriting Add masking #2808 to use grayscale values over alpha for masking and started working on luminance based clipping from vello side in a fork
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1
-
Week 7
This week started with updating Vello and wgpu to the latest version. This was a necessary step to allow forking the repositories and submitting our changes upstream.
With the update complete, I added luminance based clipping to Vello for use in #2808
Finally, I worked on optimising raster data rendering by moving image data to DOM by using js Reflect API, instead of base64 representation of png in SVG, with the intended goal of reducing data transferred.
Beta Was this translation helpful? Give feedback.