1
1

Compare commits

...

67 Commits

Author SHA1 Message Date
e734491048 Merge branch 'master' into soc-2021-knife-tools 2021-09-22 15:09:31 +01:00
f21cd08819 Fix: Knife keymap failed unit test 2021-09-21 01:25:02 +01:00
06314f5f64 Knife: Replaced object bases array with object array
The Base structs were only ever used to retrieve the Object struct and so could be replaced.
2021-09-21 00:41:40 +01:00
5db0bb8701 Merge branch 'master' into soc-2021-knife-tools 2021-09-21 00:14:59 +01:00
e232de687e Fix: Warning caused by setting enum value to bool 2021-09-20 23:23:25 +01:00
704d49ebd7 Knife: Better multi-object edit mode
The knife tool can now make cuts in multi-object edit mode which cross over multiple objects and go from the geometry of one object to multiple others.

Previously, object switching functionality was implemented but this proved insufficient to achieve the functionality contained within this patch. Instead, the dependence on a singular Object and BMEditMesh stored in the KnifeTool_OpData struct needed to be entirely removed.

This has resulted in a lot of passing around of Object pointers which could potentially be simplified using a map of some kind in the future. For now it works well.
2021-09-20 21:40:47 +01:00
9d43507674 Knife: Moved code to world space
This patch migrates the knife tool code to use world space coordinates instead of object space.
This is required to implement the ability to cut across multiple objects at once and the ability to use the geometry of other objects as a cutting reference.

This introduces precision errors for objects with very large scale or location, however it may be possible to add a switch between world space and object space coordinates depending on whether the user is in multi-object edit mode or not.
2021-09-11 19:16:24 +01:00
7210b025aa Knife: Cut along edges to reposition cut start more easily
After receiving feedback on devtalk, users expressed they wished to be able to cut along an edge so they could make further cuts from a new position along the edge.
This also adds the potential to implement snapping to a given distance along an edge.
2021-09-05 16:45:57 +01:00
4b8ab16797 Fix: Knife cut vertex sometimes placed in space
When using relative constrained angle mode along an edge which has a face hidden from view, if a cut is added it can sometimes place the previous cut vertex in space, away from the edge.
This was caused by knife_snap_edge_constrained not working correctly when a cut is constrained along the edge it was started from.

Fixed by adding a quick check.
2021-09-05 13:09:22 +01:00
4aa3991979 Fix: Function parameters changed
The parameters to ED_transform_calc_orientation_from_type_ex needed to be changed after a merge from master.
This fixed axis constraint for the knife tool.
2021-09-04 14:52:48 +01:00
eb8e15ab95 Merge branch 'master' into soc-2021-knife-tools 2021-09-04 14:02:38 +01:00
4b0b016d06 Knife: Setting to toggle X-Ray
Knife tool xray (depth testing) was previously only toggle-able by the 'V' modal key.
This patch exposes an RNA boolean in the knife tool settings for toggling xray.
2021-09-04 13:58:52 +01:00
8f49f31c63 Merge branch 'master' into soc-2021-knife-tools 2021-08-23 11:42:39 +01:00
3a908e0ee9 Merge branch 'master' into soc-2021-knife-tools 2021-08-13 12:46:20 +01:00
f648191432 Knife: Enter angle snapping increment with numpad multiple times
Entering a value for angle snapping increment using the numpad was only allowed once.
To re-enter a value angle snapping had to be toggled off and back on.
Now you can repeatedly re-enter values, except values cannot have decimal points.
If a more precise angle is required, the knife tool settings exposes the angle snapping increment.
2021-08-13 12:38:52 +01:00
941cdceb22 Knife: Renamed depth check to x-ray
The name depth check was confusing some users. Renaming it to x-ray makes more sense.
2021-08-13 11:05:49 +01:00
7e0cafcba0 Knife: Rename local angle snapping to relative angle snapping 2021-08-13 10:54:00 +01:00
418e754f4a Fix: Knife relative edge for snapping drawn with object space coords
It should've been drawn with world space coords.
2021-08-13 10:39:20 +01:00
1939ab1998 Cleanup: Moved Knife axis colors into KnifeColors struct 2021-08-12 14:18:10 +01:00
aaf4c00f4a Cleanup: Cpp style comments to C style 2021-08-12 14:11:49 +01:00
4581ce55c9 Knife: Cycle through edges for local angle snapping
This patch adds the ability to press 'R' to cycle through edges to snap relative to when in local angle snapping mode.
The current edge is highlighted yellow and visible angle measurements are always drawn to that edge if enabled.
2021-08-12 14:08:30 +01:00
0d4cb03d1b Fix: Knife local angle snapping broken on rotated objects
World space calculations that were added for the Knife BVH support broke local angle snapping on rotated objects.
2021-08-12 12:09:47 +01:00
7d43550c72 Fix: Local angle snapping with cuts started from edge or vertex
Cuts that were started on an edge or vertex were not be able to use local angle snapping even though they should have been.
2021-08-11 16:51:13 +01:00
1d97fca6a8 Merge branch 'master' into soc-2021-knife-tools 2021-08-11 13:12:49 +01:00
61ae4b5f2c Knife: Enum for measurements and angle snapping mode in tool settings
Adds two new enums to the knife tool settings to select between angle snapping modes and measurement modes.
In the top bar these are displayed inside the popover.
2021-08-11 12:23:27 +01:00
aaf53a0512 Knife: Added show measurements RNA toggle
Adds an RNA setting to enable visible distance and angle measurements by default for the knife tool.
Fixes compiler warnings as well.
2021-08-10 20:18:25 +01:00
e3c8e879a9 Merge branch 'master' into soc-2021-knife-tools 2021-08-10 15:33:57 +01:00
cbbd1782e6 Knife: Custom Knife BVH for multiple BMesh
Adds a custom Knife BVH which works with multiple BMesh's to replace the old BMBVH.
Currently, the new BVH is used in a functionally equivalent way to the old BMBVH but avoids re-allocating BVH's in multi-object edit mode.

This makes the current code slightly more complex, but will be incredibly useful when converting the knife tool code from object to world space, something that will need to be done to implement a better multi-object edit mode and further improvements to the tool.
2021-08-10 13:11:05 +01:00
ab1b587119 Cleanup: Added clarifying comment 2021-08-03 14:23:22 +01:00
22d2a747fb Knife: Added new knife modal keymaps to industry compatible 2021-08-03 12:57:30 +01:00
f4cb1b7588 Knife: Moved 'D' modal key to 'S'
Currently D is used for visual distance and angle measurements but this may be more suited to distance snapping in the future.
Thefore, I am moving it to 'S' and freeing up 'D'.
2021-07-27 18:59:46 +01:00
411c9b9eb2 Fix: Knife Project crash in multi-object edit mode
The commit which added multi-object edit mode support for the knife tool (bd6587cb52) broke knife project in multi-object edit mode.
2021-07-26 11:09:07 +01:00
3403301f97 Merge branch 'master' into soc-2021-knife-tools 2021-07-24 21:18:36 +01:00
bd6587cb52 Knife: Added support for multi-object edit mode
Now you can create cuts on all objects in multi object edit mode.
 - If a cut is started on a given object it can interact with that same object.
 - The current object to be cut is switched based on the nearest edge to the mouse cursor, only when the tool mode is idle.
 - When a cut is started in empty space it will interact with the last object the mouse was nearest before the cut was started.

Further improvements could include starting a cut in empty space interacting with the current object the mouse is nearest and allocating BMBVH's for each object on tool init instead of every time an object switch occurs.
2021-07-24 21:09:15 +01:00
34c019dd3e Cleanup: Fixed compiler warnings 2021-07-21 13:33:19 +01:00
5be6a5cf71 Knife: Better vertex handling for visible measurements
Visual angle measurements for the knife tool did not work well with vertices.
There were lots of buggy cases which this patch solves.
It also cleans up some of the old visual distance and angle measurements code.
2021-07-19 14:42:05 +01:00
d682199555 Cleanup: Added comment to clarify limitation of undo implementation 2021-07-19 12:54:20 +01:00
f549e8b54d Merge branch 'master' into soc-2021-knife-tools 2021-07-18 13:55:47 +01:00
841beea201 Knife: Fixed undo when cut is on edge
Fixed undo with cut segments along mesh edges and cut segments not over a mesh.
Cut segments along a mesh edge also no longer show as they are redundant.
2021-07-18 13:53:23 +01:00
8f2f16a077 Knife: Moved midpoint snapping to SHIFT and ignore snapping to CTRL
Midpoint snapping was originally CTRL but when undo was added as CTRL-Z this caused some strange behaviour.
Therefore midpoint snapping was moved to ALT but this broke when alt-tabbing.
By moving midpoint snapping to SHIFT and ignore snapping to CTRL there are no more problems.
2021-07-18 11:06:59 +01:00
699821f49d Knife: New depth check toggle
Pressing 'V' will toggle depth testing on and off for the knife tool cut lines.
When a cut involves a lot of cut segments on an object it can be very helpful to hide cut segments which should be blocked from view by the object that is being cut.
2021-07-17 17:52:38 +01:00
5511dac74f Knife: Remove entire drag cut on undo
Previously when a knife cut was created by holding left click and dragging, undo would only undo each segment of the dragged cut individually.
This change makes it so the entire dragged cut is removed when undone.
Some refactors to the undo code were required to implement this.
2021-07-17 16:25:42 +01:00
5065010835 Knife: Fixed distance and angle measurements not working with undo
Moved data required for distance and angle measurements into new struct KnifeMeasureData.
Now this struct is saved on the undo stack which fixes distance and angle measurements when undo is used.
2021-07-17 11:52:30 +01:00
a86813bc79 Merge branch 'master' into soc-2021-knife-tools 2021-07-16 22:12:31 +01:00
eb3f7228ee Knife: Fixed undo not working with cut through
The number of new cuts recorded each undo frame was set based on linehits.
This broke when cut through was enabled.
Solution was to increment the new cuts count every time #knife_add_single_cut is ran.
2021-07-16 21:22:14 +01:00
1996456ae2 Knife: Fixed undo deleting last vertex every time
Undo was deleting the first vertex of the last cut segment every time.
Now it only deletes it if the vertex has no other edges touching it.
2021-07-11 19:26:24 +01:00
124359d5a6 Merge branch 'master' into soc-2021-knife-tools 2021-07-11 16:43:54 +01:00
219e0155c2 Knife: Added undo functionality
Pressing ctrl-z will now undo the most recent cut segment made.
When drag cutting undo reverts each segment of the cut individually.
Currently this breaks visible distance and angle measurements after using undo but a fix will be committed soon.
2021-07-11 16:33:24 +01:00
143ae4f800 Knife: Moved constrained angle mode to 'A' and moved cut through to 'C'
This change keeps the knife tool default modal key mappings more centered towards the left side of the keyboard, improving the workflow of the tool.
2021-07-03 15:24:43 +01:00
06eb046bd7 Knife: Removed 'E' knife cancel functionality and moved 'M' modal to 'D'
It is dangerous to have 'E' be able to cancel a user's entire cut as it is a key many could accidentally hit and there is no way to retrieve a lost cut. Removing it leaves 'Esc' as the key for cancelling a cut.

On many keyboards 'M' is far away from the other modal keys for the knife tool. 'D' allows for a better workflow by being closer.
2021-06-30 11:41:43 +01:00
86f15dbcdc Knife: Added local constrained angle mode
When using constrained angle mode, pressing C once will bring you to the current screen-space mode and pressing it again will now enter a new "local" mode.

This mode will snap along the plane of the current cut segment's face.
In the case where the cut was started on a edge or vertex it will snap along the plane of the current face the mouse is over, if this face is adjacent to that edge or vertex.

It made sense to implement a mode that works in this way after adding visible distance and angle measurements as now a user can snap the visible angle for the current cut.
2021-06-28 11:46:29 +01:00
8456cb9352 Knife: Swapped right click and E functionality
Now right clicking creates a new cut and E cancels the entire cut.
Esc still works as normal for cancelling the cut.
2021-06-23 16:47:23 +01:00
da6d760c06 Knife: Header/footer displays constrained angle and increment
This patch displays the current angle, relative to the positive X axis, in the header/footer when the knife tool is in constrained angle mode.
It also updates constrained angle mode to snap relative to the positive X axis in screen space (previously positive Y).
2021-06-23 16:39:38 +01:00
8c76da1f6b Knife: Change visible angle text precision
Now displays 3 digits instead of 2. This means one decimal place is almost always displayed,
except in the case where the cut was started on an edge.
2021-06-23 14:04:33 +01:00
a5e02263c9 Cleanup: Update comments to follow coding style
https://wiki.blender.org/wiki/Style_Guide/C_Cpp#Comments
2021-06-23 14:00:07 +01:00
6576802f7b Merge branch 'master' into soc-2021-knife-tools 2021-06-23 12:19:49 +01:00
bec317858d Knife: Added visible distance and angle measurements
Pressing M while using the knife tool will now cycle through showing various measurements related to the current cut.

The different modes are:
Just Distance - Shows the length of the current cut segment
Just Angles - If the cut segment is touching any edges the corresponding angle is displayed
Both - Shows both distance and angles
2021-06-23 12:12:48 +01:00
980a2c305b Cleanup: Moved knife data init code into correct function 2021-06-16 14:34:07 +01:00
d54c9fd490 Knife: Updated header/footer for constrained axis
Now the header/footer shows X,Y,Z when constrained globally in the respective axis and x,y,z when constrained locally.
2021-06-16 14:27:43 +01:00
257908c11b Knife: Snapping increment changes are shown immediately
Currently, when a user uses the number keys to input a new snapping angle increment in constrained angle mode it does not visually update until the mouse is jiggled.
This patch solves this problem so it now updates as each number is typed.
2021-06-15 12:37:22 +01:00
c046b3debe Merge branch 'master' into soc-2021-knife-tools 2021-06-15 12:05:49 +01:00
67d2d175eb Cleanup: Unecessary comments 2021-06-15 12:04:12 +01:00
4b11312335 Knife: Added orientation locking to knife tool
- Pressing X, Y or Z will lock current cut to corresponding axis.
- Pressing the same key twice will lock to local object axis.
- Scene orientation setting takes priority over this when set to anything other than global. This provides support for custom orientations.
2021-06-11 13:04:32 +01:00
fb18bd674d Merge remote-tracking branch 'origin/master' into soc-2021-knife-tools 2021-06-08 14:31:03 +01:00
9d3ee99dd0 Cleanup: Return function parameters missing r_ 2021-06-08 14:29:04 +01:00
355faeb473 Knife: New default snapping angle + code refactor
Set the default snapping angle to 30 degrees and refactored number input for angle snapping code.
2021-06-07 18:16:43 +01:00
1f3607a8f7 Knife: Implemented D10853 - Constrained angle mode improvements
This is the first commit for the GSOC 2021 Knife Tool Improvements project. It implements D10853 which adds more control over constrained angle mode through new UI elements and number key input.
2021-06-05 14:21:01 +01:00
7 changed files with 2291 additions and 564 deletions

View File

@@ -5626,21 +5626,24 @@ def km_knife_tool_modal_map(_params):
("PANNING", {"type": 'MIDDLEMOUSE', "value": 'ANY', "any": True}, None), ("PANNING", {"type": 'MIDDLEMOUSE', "value": 'ANY', "any": True}, None),
("ADD_CUT_CLOSED", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK', "any": True}, None), ("ADD_CUT_CLOSED", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK', "any": True}, None),
("ADD_CUT", {"type": 'LEFTMOUSE', "value": 'ANY', "any": True}, None), ("ADD_CUT", {"type": 'LEFTMOUSE', "value": 'ANY', "any": True}, None),
("CANCEL", {"type": 'RIGHTMOUSE', "value": 'PRESS', "any": True}, None), ("UNDO", {"type": 'Z', "value": 'PRESS', "ctrl": True}, None),
("CONFIRM", {"type": 'RET', "value": 'PRESS', "any": True}, None), ("CONFIRM", {"type": 'RET', "value": 'PRESS', "any": True}, None),
("CONFIRM", {"type": 'NUMPAD_ENTER', "value": 'PRESS', "any": True}, None), ("CONFIRM", {"type": 'NUMPAD_ENTER', "value": 'PRESS', "any": True}, None),
("CONFIRM", {"type": 'SPACE', "value": 'PRESS', "any": True}, None), ("CONFIRM", {"type": 'SPACE', "value": 'PRESS', "any": True}, None),
("NEW_CUT", {"type": 'E', "value": 'PRESS'}, None), ("NEW_CUT", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, None),
("SNAP_MIDPOINTS_ON", {"type": 'LEFT_CTRL', "value": 'PRESS', "any": True}, None), ("SNAP_MIDPOINTS_ON", {"type": 'LEFT_SHIFT', "value": 'PRESS', "any": True}, None),
("SNAP_MIDPOINTS_OFF", {"type": 'LEFT_CTRL', "value": 'RELEASE', "any": True}, None), ("SNAP_MIDPOINTS_OFF", {"type": 'LEFT_SHIFT', "value": 'RELEASE', "any": True}, None),
("SNAP_MIDPOINTS_ON", {"type": 'RIGHT_CTRL', "value": 'PRESS', "any": True}, None), ("SNAP_MIDPOINTS_ON", {"type": 'RIGHT_SHIFT', "value": 'PRESS', "any": True}, None),
("SNAP_MIDPOINTS_OFF", {"type": 'RIGHT_CTRL', "value": 'RELEASE', "any": True}, None), ("SNAP_MIDPOINTS_OFF", {"type": 'RIGHT_SHIFT', "value": 'RELEASE', "any": True}, None),
("IGNORE_SNAP_ON", {"type": 'LEFT_SHIFT', "value": 'PRESS', "any": True}, None), ("IGNORE_SNAP_ON", {"type": 'LEFT_CTRL', "value": 'PRESS', "any": True}, None),
("IGNORE_SNAP_OFF", {"type": 'LEFT_SHIFT', "value": 'RELEASE', "any": True}, None), ("IGNORE_SNAP_OFF", {"type": 'LEFT_CTRL', "value": 'RELEASE', "any": True}, None),
("IGNORE_SNAP_ON", {"type": 'RIGHT_SHIFT', "value": 'PRESS', "any": True}, None), ("IGNORE_SNAP_ON", {"type": 'RIGHT_CTRL', "value": 'PRESS', "any": True}, None),
("IGNORE_SNAP_OFF", {"type": 'RIGHT_SHIFT', "value": 'RELEASE', "any": True}, None), ("IGNORE_SNAP_OFF", {"type": 'RIGHT_CTRL', "value": 'RELEASE', "any": True}, None),
("ANGLE_SNAP_TOGGLE", {"type": 'C', "value": 'PRESS'}, None), ("ANGLE_SNAP_TOGGLE", {"type": 'A', "value": 'PRESS'}, None),
("CUT_THROUGH_TOGGLE", {"type": 'Z', "value": 'PRESS'}, None), ("CYCLE_ANGLE_SNAP_EDGE", {"type": 'R', "value": 'PRESS'}, None),
("CUT_THROUGH_TOGGLE", {"type": 'C', "value": 'PRESS'}, None),
("SHOW_DISTANCE_ANGLE_TOGGLE", {"type": 'S', "value": 'PRESS'}, None),
("DEPTH_TEST_TOGGLE", {"type": 'V', "value": 'PRESS'}, None),
]) ])
return keymap return keymap

View File

@@ -3866,7 +3866,8 @@ def km_knife_tool_modal_map(_params):
("CONFIRM", {"type": 'NUMPAD_ENTER', "value": 'PRESS', "any": True}, None), ("CONFIRM", {"type": 'NUMPAD_ENTER', "value": 'PRESS', "any": True}, None),
("ADD_CUT_CLOSED", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK', "any": True}, None), ("ADD_CUT_CLOSED", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK', "any": True}, None),
("ADD_CUT", {"type": 'LEFTMOUSE', "value": 'ANY', "any": True}, None), ("ADD_CUT", {"type": 'LEFTMOUSE', "value": 'ANY', "any": True}, None),
("NEW_CUT", {"type": 'E', "value": 'PRESS'}, None), ("UNDO", {"type": 'Z', "value": 'PRESS', "ctrl": True}, None),
("NEW_CUT", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, None),
("SNAP_MIDPOINTS_ON", {"type": 'LEFT_CTRL', "value": 'PRESS'}, None), ("SNAP_MIDPOINTS_ON", {"type": 'LEFT_CTRL', "value": 'PRESS'}, None),
("SNAP_MIDPOINTS_OFF", {"type": 'LEFT_CTRL', "value": 'RELEASE'}, None), ("SNAP_MIDPOINTS_OFF", {"type": 'LEFT_CTRL', "value": 'RELEASE'}, None),
("SNAP_MIDPOINTS_ON", {"type": 'RIGHT_CTRL', "value": 'PRESS'}, None), ("SNAP_MIDPOINTS_ON", {"type": 'RIGHT_CTRL', "value": 'PRESS'}, None),
@@ -3875,11 +3876,13 @@ def km_knife_tool_modal_map(_params):
("IGNORE_SNAP_OFF", {"type": 'LEFT_SHIFT', "value": 'RELEASE', "any": True}, None), ("IGNORE_SNAP_OFF", {"type": 'LEFT_SHIFT', "value": 'RELEASE', "any": True}, None),
("IGNORE_SNAP_ON", {"type": 'RIGHT_SHIFT', "value": 'PRESS', "any": True}, None), ("IGNORE_SNAP_ON", {"type": 'RIGHT_SHIFT', "value": 'PRESS', "any": True}, None),
("IGNORE_SNAP_OFF", {"type": 'RIGHT_SHIFT', "value": 'RELEASE', "any": True}, None), ("IGNORE_SNAP_OFF", {"type": 'RIGHT_SHIFT', "value": 'RELEASE', "any": True}, None),
("ANGLE_SNAP_TOGGLE", {"type": 'C', "value": 'PRESS'}, None), ("ANGLE_SNAP_TOGGLE", {"type": 'A', "value": 'PRESS'}, None),
("CUT_THROUGH_TOGGLE", {"type": 'X', "value": 'PRESS'}, None), ("CYCLE_ANGLE_SNAP_EDGE", {"type": 'R', "value": 'PRESS'}, None),
("CUT_THROUGH_TOGGLE", {"type": 'C', "value": 'PRESS'}, None),
("PANNING", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "alt": True}, None), ("PANNING", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "alt": True}, None),
("PANNING", {"type": 'RIGHTMOUSE', "value": 'PRESS', "alt": True}, None), ("PANNING", {"type": 'RIGHTMOUSE', "value": 'PRESS', "alt": True}, None),
("CONFIRM", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, None), ("SHOW_DISTANCE_ANGLE_TOGGLE", {"type": 'D', "value": 'PRESS'}, None),
("DEPTH_TEST_TOGGLE", {"type": 'V', "value": 'PRESS'}, None),
]) ])
return keymap return keymap

View File

@@ -1087,11 +1087,29 @@ class _defs_edit_mesh:
@ToolDef.from_fn @ToolDef.from_fn
def knife(): def knife():
def draw_settings(_context, layout, tool): def draw_settings(_context, layout, tool, *, extra=False):
show_extra = False
props = tool.operator_properties("mesh.knife_tool") props = tool.operator_properties("mesh.knife_tool")
layout.prop(props, "use_occlude_geometry") if not extra:
layout.prop(props, "only_selected") row = layout.row()
layout.prop(props, "use_occlude_geometry")
row = layout.row()
layout.prop(props, "only_selected")
row = layout.row()
layout.prop(props, "xray")
region_is_header = bpy.context.region.type == 'TOOL_HEADER'
if region_is_header:
show_extra = True
else:
extra = True
if extra:
layout.use_property_split = True
layout.prop(props, "visible_measurements")
layout.prop(props, "angle_snapping")
layout.label(text="Angle Snapping Increment")
layout.row().prop(props, "angle_snapping_increment", text="", expand=True)
if show_extra:
layout.popover("TOPBAR_PT_tool_settings_extra", text="...")
return dict( return dict(
idname="builtin.knife", idname="builtin.knife",
label="Knife", label="Knife",

View File

@@ -18,6 +18,7 @@
set(INC set(INC
../include ../include
../uvedit ../uvedit
../../blenfont
../../blenkernel ../../blenkernel
../../blenlib ../../blenlib
../../blentranslation ../../blentranslation

File diff suppressed because it is too large Load Diff

View File

@@ -158,7 +158,7 @@ static int knifeproject_exec(bContext *C, wmOperator *op)
ED_view3d_viewcontext_init_object(&vc, obedit); ED_view3d_viewcontext_init_object(&vc, obedit);
BMEditMesh *em = BKE_editmesh_from_object(obedit); BMEditMesh *em = BKE_editmesh_from_object(obedit);
EDBM_mesh_knife(&vc, polys, true, cut_through); EDBM_mesh_knife(C, &vc, polys, true, cut_through);
/* select only tagged faces */ /* select only tagged faces */
BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, false); BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, false);

View File

@@ -150,7 +150,8 @@ void MESH_OT_face_split_by_edges(struct wmOperatorType *ot);
/* *** editmesh_knife.c *** */ /* *** editmesh_knife.c *** */
void MESH_OT_knife_tool(struct wmOperatorType *ot); void MESH_OT_knife_tool(struct wmOperatorType *ot);
void MESH_OT_knife_project(struct wmOperatorType *ot); void MESH_OT_knife_project(struct wmOperatorType *ot);
void EDBM_mesh_knife(struct ViewContext *vc, void EDBM_mesh_knife(struct bContext *C,
struct ViewContext *vc,
struct LinkNode *polys, struct LinkNode *polys,
bool use_tag, bool use_tag,
bool cut_through); bool cut_through);