vengi icon indicating copy to clipboard operation
vengi copied to clipboard

VOXEDIT: refactor selection

Open mgerhardy opened this issue 11 months ago • 2 comments

In order to allow more than just an AABB based selection we need to get an own volume for the selection and move voxels between those volume. This would also allow us to move selections easier (see #288 ). It would allow us to highlight only those voxels in the selection volume and a lot of other benefits.

#130 a selection brush would also be cool.

Also see issue ##289 - the selection of a volume should move when the volume is shifted. So maybe we should align the SparseVolume always to 0,0,0 and move the voxels afterwards by the mins of the real volume.

~The only downside is the needed memory~ Selections should maybe be per volume and should also change if you change the active model node (selections are only available in edit mode anyway). So maybe selections should be stored per node/node id.

We need a Selection class that is not a region anymore, but maintains a SparseVolume with all selected voxels

Different selection algorithms should be implemented

  • [ ] Select by AABB (See existing code in Modifier class)
  • [ ] #379
  • [ ] Select plane

Script Execution

The script execution also depends on a region to operate on. This change would also make all existing lua scripts incompatible. Instead of the region we should hand over the Selection class. And the visitors should check if there is a selection and if the current voxel is part of the selection. Thus we need bindings for the Selection class for lua, too

mgerhardy avatar Aug 01 '23 07:08 mgerhardy