ousnius / BodySlide-and-Outfit-Studio

BodySlide and Outfit Studio, a tool to convert, create, and customize outfits and bodies for Bethesda games.
GNU General Public License v3.0
290 stars 64 forks source link

Some vertice manipulation requests #380

Closed themilkdrinker0 closed 2 years ago

themilkdrinker0 commented 2 years ago

I have 2 requests:

This not isn't very important, but it would be awesome, as you can see the move preserves the volume, it's perfect to move vertices without screwing up the shape, I believe the vertices slide across the edges.

ezgif com-gif-maker (8)

This is just a snap, you could do it like in the gif or a tool that just copy the translation and weights from one vertex to another, this would be good for fine tuning, fixing weights that cause seams and fixing mesh seams.

ezgif com-gif-maker (7)

sts1skj commented 2 years ago

@themilkdrinker0 For your second idea, the move-snap tool, we've already discussed something very similar in feature request #302 . In that thread, my favorite idea was a "weld and then merge" tool: if you clicked on a non-welded vertex, it would weld it (snap it) to the nearest reasonable vertex (updating position, slider diffs, and weights); if you clicked on a welded vertex, it would merge it (updating UV and eliminating the vertex).

But perhaps your idea is better: instead of making a separate tool, make a "snap" mode on a move tool. Unfortunately, the current move tool is a move brush, typically moving many vertices at once. With a snap mode, you'd want to be moving exactly one vertex, not a bunch of them.

Idea 1: Make a new move tool that moves exactly one vertex (or two if x-mirror is on). Have a "snap" option (default off) that would do welding for non-welded vertices and merging for welded vertices. Have a "move welded too" option (default on) that would move all welded vertices along with the selected vertex if on, and would unweld the vertex and move just it if off.

Idea 2: Make a "move exactly one" option for the existing move brush that would make it move exactly one vertex (or two if x-mirror is on). Have "snap" and "move welded too" options.

Idea 3: Make a separate "weld and then merge" tool, as proposed in #302 .

Any other ideas?

One challenge with ideas 1 and 2 is determining a reasonable snap distance. I propose using half the shortest edge length of any triangle attached to the vertex. (Of course, the tool wouldn't snap to any of those triangles' other vertices; that would collapse a triangle. Zero-area triangles are not okay.)

I really like the idea of having a move tool, or a mode for the existing move brush, that moves exactly one vertex (or two if x-mirror is on). I'd say, at least 50% of the time in Outfit Studio when I use the move brush, I want to move exactly one vertex, not a bunch of them, and I have to fiddle with the brush size so that it's small enough that only one vertex is within the brush radius.

One advantage of having a separate weld-and-then-merge tool is that it's precise. There's no snap distance; you just mouse-over the vertex, and the preview or highlighting shows you exactly what will happen if you click.

No matter which idea we do, a basic question is how to preview the edit. Should the final snapped result be shown, like in the video? Should the snap target merely be highlighted instead? Should a little arrow be drawn from the moving vertex to the snap target vertex?

For idea 2 (a single-vertex option for the move brush), would it be desirable to instead have a slider that specifies a maximum number of vertices to move (before x-mirroring)? Moving a single vertex would be done by setting the slider to 1. Maybe this toggle or slider would be useful for the other brushes too.

Should merging vertices be a separate option from snapping?

Is unmerging vertices (or splitting a vertex into separate vertices for separate triangles) a desirable option?

Right now, I'm leaning towards idea 2 (a single-vertex option for the existing move brush) as my favorite. But idea 1 is a close second, and idea 3 is very appealing too. I would pick a preview that shows the final result. I would have a separate option to split a vertex. I would not have a separate merge option (so merging would happen automatically when appropriate). I would have a maximum-moved-vertex slider instead of a toggle, and have it affect all the brushes.

@ousnius @themilkdrinker0 @MrManMain @rcodegrove What does everyone think?

sts1skj commented 2 years ago

@themilkdrinker0 Your first idea (moving vertices along a surface) was also proposed as request 3 in #253 .

themilkdrinker0 commented 2 years ago

Well, the way it works on Softimage for preview is that it snaps but doesn't keep the snap/merge until you release the click of the mouse, so you can move it around to other vertices while you are holding the click, the area it uses to know what to snap/merge to is the small square the appears around the mouse when you move it, it tries to snap to vertices on faces facing the view, so it doesn't pick the ones in the back, you can control it's size with the scroll.

sts1skj commented 2 years ago

It sounds like, in Softimage, the snap distance is calculated in screen space, indicated by a box around the pointer. When I wrote my earlier long message, I was thinking of calculating the snap distance in model space, not screen space. Which is better, 2d screen space or 3d model space? I think I would pick model space; snapping to things in the background or foreground could be quite annoying, I would think.

sts1skj commented 2 years ago

I've broken out the "only one vertex" idea into a separate feature request: #415 . I think that feature should be implemented separately before implementing the vertex-snap idea.

sts1skj commented 2 years ago

In feature request #415 , GrafPanzer pointed out that you can restrict any existing brush to just one vertex by just masking everything but that vertex. So the "only one vertex" idea is far less useful than I thought. In light of this new insight, I now prefer idea 3: making a separate "weld and then merge" tool, just as was originally proposed in feature request #302 .

Please speak up if you prefer doing vertex-snap in a different way.

themilkdrinker0 commented 2 years ago

That's a solution, but think as an artist, the more organic the process the better, we don't like to make steps for simple and repetitive actions and menus, we like to deal with the model and not with the software, if I need to fix a slider and for that I have to move 50 vertices, it would be pretty taxing to use masking when I could just click and move, click and move, etc. for the snap, I'm fine with any solution, either using the mouse and drag or select the vertex to be moved and then select the target vertex.

sts1skj commented 2 years ago

@themilkdrinker0 Are you saying that you want a tool in Outfit Studio that lets you move any single vertex with one mouse press?

themilkdrinker0 commented 2 years ago

That would be great, yeah, if you guys can add the snap/merge to this tool too, it would be cool, but I'm fine if you guys prefer to go for another solution for the snap/merging vertices, but doing the way it's shown in the gif would be the best way in my opinion, you can easily optimize polycount by moving the vertices and merging them just by a click and drag, use it a lot when I create outfits in Softimage. In Zbrush merging is a double click action, like I explained above, select the vertex to be merged and then select the target vertex.

sts1skj commented 2 years ago

@themilkdrinker0 Some tool/option for doing snap/weld/merge will be implemented soon (by me). The only argument is about what the best user interface is.

If you want me to implement a single-vertex-move tool, please say so in feature request #415 . GrafPanzer has said he sees no use for this feature. Ousnius (who is in charge) is uncertain, leaning towards no. The person you need to convince is Ousnius. Do so by writing a message in support of feature request #415 .

themilkdrinker0 commented 2 years ago

The best user interface for a 3D artist is the least one, the more you can do with shortcuts and the mouse the better.

themilkdrinker0 commented 2 years ago

image The way it works in Softimage, you press "M" for the Move tool, you can move faces, edges and vertices with it, those buttons pop up at the bottom of the screen when you are using the tool and disappear when you are not using it, the magnet there enables snapping without merging, the small dot enables merging, the merging already snaps to the vertices in the square around the mouse as you saw before. Just throwing how it works there to give you some more ideas, in this case for the interface.

sts1skj commented 2 years ago

@themilkdrinker0 Pull request #419 implements a move-vertex tool with five tool options, including merge and weld options, which should satisfy your second feature request (snapping to a vertex), and a restrict-to-surface option, which should partially satisfy your first feature request. (It only provides partial satisfaction because it only does one vertex at a time.)

I plan on eventually implementing the restrict-to-plane and restrict-to-normal tool options for the existing move and smooth brushes. But restrict-to-surface could be quite complicated to implement for the move brush.

Do you want me to implement the restrict-to-surface tool option for the move brush, so that you can do what your first video shows? Or is restrict-to-surface for moving a single vertex at a time enough?

themilkdrinker0 commented 2 years ago

Sounds great!

Might want to improve the move brush first tho, I opened a new request: https://github.com/ousnius/BodySlide-and-Outfit-Studio/issues/420

sts1skj commented 2 years ago

@themilkdrinker0 Pull request #423 gives a rough solution to your first feature request: the new restrict-plane option for the move brush. But to truly replicate your video of points moving over the surface of the sphere, I'd have to implement the restrict-surface option for the move brush. That could be quite complicated.

When you have time (once the updated Outfit Studio becomes available to you), could you check if the restrict-plane option for the move brush is good enough for your needs? (If not, I'll have to implement restrict-surface for the move brush, which could take a lot of work.)