setzer22 / blackjack

A procedural, node-based modelling tool, made in rust 🦀
Mozilla Public License 2.0
1.41k stars 59 forks source link

Bring in the gizmos! #62

Closed setzer22 closed 1 year ago

setzer22 commented 1 year ago

This PR adds an initial implementation of gizmos :tada: gizmos_pr

Gizmos are a new powerful feature in Blackjack, allowing to edit a node's parameters right from the 3d viewport. Tweaking a gizmo is an equivalent, but sometimes more comfortable way of editing a node's parameters parameters manually, meaning the procedural workflow remains exactly the same.

This PR only includes one gizmo, but lays down the foundations so that many more gizmo types can be added. Still, even a single gizmo type, powered by egui-gizmo, is versatile enough so that many different nodes can benefit from it!

You can edit a line's endpoints 🔛 edit_line_endpoints

Position your primitives 📍 position_primitives

Or edit groups of polygons in a mesh, blender-style 🟠 edit_geometry

Another cool feature of gizmos are their time-travel capabilities :running_man: :dash:. You can enable past nodes' gizmos and tweak them to see thir results on the final mesh. time_travel

If you have a custom node, making your node gizmo-ready can be as simple as writing a single line of declarative code:

gizmos = { Gz.tweak_point("point") }

But if you need fine-grained control, scroll down for details! Gizmos are defined as a very rich API allowing you to craft very specific behaviors: Each node can define as many gizmos as it wants, each affecting a subset of its parameters.

Last but not least, this PR also brings in several miscellaneous but very important bugfixes and improvements: