Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is (experimental) ongoing implementation of the new Circle Carve tool. The new circle tool replaces the old one, which was just the Box Carve tool except with the ability to set the number of vertices. Box Carve tool will now inherit this ability, making it able to draw shapes with any number of vertices (where 4 is a rectangle, anything more is a circle).
The New Circle tool is similar to sculpt brushes, it has a circle around the cursor (with an adjustable radius) with a shape inside it. When clicked, it executes an operator that carves the shape out of an active object (It doesn't support carving multiple objects like Box and Polyline tools; it only works on active object). This is meant to be used for cutting precisely sized holes in meshes (which is difficult when drawing with a cursor), because the size of the shape is tied to the tool, and can be reused for an infinite number of cuts.
Using the tool:
F
starts changing the radius of the circle & shape, just like sculpt brushes.Implementation details:
Initial code for the tool (drawing of a circle, storing Runtime data, raycasting, and etc.) is from 3D Hair Brush by VFX Grace, which is licensed under GPL. Modifications have been made to simplify the code and fit the purpose of the tool better, but nevertheless credit goes to VFX Grace.
draw_cursor
staticmethod property, which callsraycast_under_cursor
(new function inselect.py
) and gets the active object data under the cursor. Data is stored in runtimeToolRuntimeData()
(stored inproperties.py
) and passed to new drawing functioncarver_brush
.carver_brush
function uses data to manipulate GPU matrix insidewith gpu.matrix.push_pop()
loop to align GPU projection to mesh normals, calculates circle and shape inside it, and draws them withdraw_shader
function.