I like the idea of having configurable snapping increments along an edge as you show. However, I am not sure if there is enough free time in my project schedule to add this feature. If you submit it as a feature request to rightclickselect maybe I or someone else in the future will be willing to spend some time to implement it.
This week I almost solely worked on multi-object edit mode support for the knife tool. It proved more challenging than I initially expected and I spent a lot of time trying various ideas for implementing it. In the end, I found a solution I was happy with and have committed it to the soc-2021-knife-tools branch.
Notes
Multi-Object Edit Mode
Added support to the Knife Tool
Cuts can be made on all object’s while using the knife tool in multi-object edit mode
A cut which starts on a given object can only cut/interact with that object’s mesh
A cut which starts in space can only cut/interact with the object that was last hovered by the mouse before starting the cut
I feel it would be better to be based on the nearest object to the mouse while cutting, but a short attempt at implementing this showed it would take large changes to make work
Next week I am going to add multi-object edit mode support to the knife project tool and an edge removal mode for the knife tool.
Media
Cuts starting in space work on last object hovered:
When two objects intersect the object to cut is based on the nearest mesh edge to the cut start:
I realise it would be miles better to be able to cut on multiple selected objects with one cut and I am unhappy that it does not. I should have clarified why it only works on each object seperately in the report, so I will do here.
Mainly, it is a limitation of the way the knife tool is already designed. Without going into too much technical details (unless that is preferred?), to have a semi working version of the knife tool in multi-object edit mode completed within a week I had to implement it this way. I believe the way the knife tool currently works would have to be massively changed to allow cutting of all objects with each cut (a similar problem is this) and I am not familar with the areas of blender’s codebase that would make this work.
I am sorry I could not deliver a better version where all objects could be cut simultaneously. I hope at least I was able to lay a foundation for someone with more experience and more time than me to come in and rework the necessary things to make the knife tool work in such a way.
After receiving feedback on last week’s report and discussing further with my mentor we have decided to make some changes to the plan for the remaining two weeks of the GSOC coding period.
Test Build
I will now be releasing a build of my branch soc-2021-knife-tools each week for everyone to help test by searching for bugs and provide feedback on the features I have implemented.
Please share any feedback you may have on my feedback thread. I will work on fixing any bugs found or making any suggested improvements over the next few weeks, alongside the plan discussed below.
New Plan
Based on feedback from last week, I am going to spend the rest of the GSOC period focusing on re-implementing a better version of multi-object edit mode support. The goal is to allow cutting across multiple objects in the scene and making cuts from one object to another. This will require a complex re-write of large parts of the Knife Tool code but should make it possible to implement much more useful features in the future as well.
The plan to implement edge removal mode has been abandoned as it seemed a rather niche feature now that undo is implemented. It also became clear that multi-object edit mode support for the knife project tool already exists in that you can use multiple objects for projection. There is no way to differentiate between objects being projected onto and being used for projection and so this feature is not necessary.
The GSOC coding period has officially come to an end as of this week and I have posted my final report over on the wiki. I apologise for the lack of a report last week, I spent the entire week working on a foundation for better multi-object edit mode and decided it was best to wait for more feedback about the build that I posted before making a report.
This report contains a list of various bug fixes and additions I have made as a result of feedback about last week’s build as well as a new build for testing. I will also discuss the plan going forward.
End of Coding Period
Now that the official coding period has come to an end I will no longer be implementing any new features. My plan now is to spend some more time fixing any further bugs / minor improvements given as feedback about the latest build. I am going away on holidays this upcoming week and so will be slow to respond until after I return.
I will also discuss further with my mentor about continuing work on a better multi-object edit mode as well as beginning the process of merging my changes into master.
Patch notes since the previous build are outlined below and once again I would appreciate it if you shared any feedback you may have about this latest build on my feedback thread.
Notes
Angle Snapping Improvements
“Local Angle Snapping” renamed to “Relative Angle Snapping”
Relative Angle Snapping now works with existing mesh edges
Fixed bug where it did not work with rotated objects
Caused by custom knife BVH code
Input snapping increment multiple times via number keys
Cannot input numbers with decimal point, this can be done with the value exposed in knife tool settings
Use alternate edges for Relative Angle Snapping
Current edge is highlighted in yellow
Press ‘R’ to cycle between edges
Angle measurement’s are always drawn to currently selected edge
New Knife Tool Settings
Select between default angle snapping modes of None, Screen or Relative
Select between default measurement modes of None, Both, Distance or Angle
General Improvements
Depth checking mode renamed to “X-ray”
Press ‘V’ to activate
ON/OFF make more sense now
Better Multi-Object Edit Mode
New custom Knife BVH is in use
Lays the foundation for cutting across multiple objects in multi-object edit mode
Not yet implemented
Media
Alternate edges for relative angle snapping (cycling through edges using ‘R’)
Over the coming weeks I will be focusing on responding to and fixing various bug reports that come in. If you find a bug with any of the changes detailed within this thread then please submit a ticket on developer.blender.org and tag me as a reviewer (otherwise tag the project as modelling). The latest build of master can be downloaded under “Alpha” on Blender Builds - blender.org.
Better Multi-Object Edit Mode
A variety of changes and bug fixes have been made ahead of merging into master. The largest change has been the addition of a better multi-object edit mode. It was clear from user feedback that my previous implementation was unsatisfactory and so I set out to make it work as expected.
Demonstration
Orientation Snapping w/ Multi-Object Edit Mode
Takes the local orientation of the object the cut segment was started on:
Complex Meshes
Notes
The one change I did not manage to complete is in regards to relative angle snapping. As it is in master, relative angle snapping is still limited to the existence of an adjacent face to the relative edge which is being used. This is not the greatest implementation and will need to be updated in the future, but as it is it does still allow for making more precise cuts.
There are also still some minor visual bugs with orientation snapping which will be fixed soon.
Wrap Up
Lastly, I just wanted to say I have had an amazing time working on Blender and thank everyone for their support. Seeing the things people create with Blender is one of the best parts and I intend to continue doing what I can for Blender when I find time!
Thanks for all of your amazing work, let’s also not forget undo improvements, that is a long-awaited lifesaver! Kudos to you for managing to implement everything in time for 3.0!!!
It would be nice if the axes for the knife tool could be changed in the keymap section in preferences.
I usually change my Y axis to “C”, so overall it is “ZXC”, as they are all beside each other. Just a small preference of mine, and I would love to be able to do that for the knife tool as well. Would this be possible?
As well, I would like to add that snapping to an axis on my computer seems to be quite sluggish, there is a palpable lag when switching between them. Is this operation running on the CPU or GPU? I am running an AMD Ryzen 7 2700x 3.70GHz, but a very old terrible Radeon card atm moment.
XYZ axis locking is now exposed in the knife modal keymap.
With regards to axis locking feeling sluggish, I have no such problems on my computer, would you be able to share a video/gif showing what you mean? I will try see if I can use a low power computer to test it out soon.