-
Notifications
You must be signed in to change notification settings - Fork 137
Added vertex snapping in the translation mode. Resolves #32 #33
Conversation
Henry00IS
commented
Feb 2, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tried this PR (on a Mac) and there seems to be a few issues with usability.
It isn't particularly clear how to use this feature, if you press V when not hovering over a vertex you get an error sound. If you press V while doing a translation using the normal pivoted handles you'll start getting error sounds and weird behaviour (it should probably not do anything in this case).
It's a fantastic feature that I can see is going to improve my workflow a lot, there's also lots of interesting ways to extend it (such as supporting edge or face midpoints as both grab source positions and targets). If we can just iron out the usability edge cases it'll be ready to go in
Scripts/Tools/ResizeEditor.cs
Outdated
// check for vertex snapping in translate mode. | ||
if (e.keyCode == KeyCode.V) | ||
{ | ||
vertexSnapping = e.type == EventType.KeyDown; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this is just personal preference but this kind of line reads more easily with brackets, i.e.
vertexSnapping = (e.type == EventType.KeyDown);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will keep that in mind, you are right. :)
I have been using this feature for a while now modeling a house and it works perfectly, on Windows, no error sounds. Time to switch to Windows again to have the good features Barnaby. ;) I would just fix it but I don't have mac and can't reproduce the problem... you are right that it would be great to have a whole workbench of similar features, especially for the clipping tool, I sometimes trial&error for over 20 minutes trying to align it to an existing edge or face... But I have to be honest, these tools are already a big spaghetti code mess. A lot of bools and ints that try to keep track of what's going on and a lot of copy pasted stuff. If we start adding more and more to the same C# file it will be a nightmare to maintain. Especially because I have come up with several cool widget ideas like "pinning" a vertex and rotating around it, but I can't possibly cram any more code into it... Since this is a bit of a hack relying on Unity's vertex snapping and you are right, with enough effort it's possible to grab a pivot handle instead, perhaps we should spend a little bit of time cleaning up all of the existing tools and properly document all of the source code and CSG routines... and re-create this feature in a future PR with our own logic. I recently saw another CSG add-on on the market, I think they stole a lot of our UI design- but they made it look 20x better and AFAIK no T-Junctions. It makes me very sad so now we have to make a comeback and remain the best project in the world! |
I very much doubt these issues are Mac related, I developed SabreCSG using a mixture of a PC and Mac and I only ever encountered one platform specific issue during that time (which was related to DirectX). This is a video showing the issues I mention: |
… until they release the left mouse button.
…me reason Unity doesn't reset the vertex snapping mode on the translate gizmo until you press V again (only if the left mouse button is still being held) unless that gizmo is still visible on the screen.
There, it's perfectly stable now on Windows. If you still have error sounds on Mac please let me know. But I can't think of anything that's wrong which is causing that to happen and I can't reproduce it here. |
…identical, to the default vertex snapping tool. Shoutouts to Sabresaurus for providing these fixes.