Page MenuHome

Fix T40993: snap active vertex/edge fallback to snap median broken
AbandonedPublic

Authored by Campbell Barton (campbellbarton) on Jul 10 2014, 11:17 PM.

Details

Summary

this fixes T40993.

snapping of active vertex/edge when there is none active (like it is the case after extruding) is obviously intended to fallback to snap median, as the functionality is implemented however it is bypassed by a questionable solution (the deleted lines) which just picks some face median instead (even when in edge/vertex selection). those lines were commented with /* no */ btw :)
with those lines deleted, snap active falls back to snap median as intended.

campbell: hope its ok if i ask you for review? its because you did a lot of fixes related to snap active a while ago (T36973)
btw this is my first bugfix, obviously not much of a fix, so i hope at least the formalities are ok as well? :) and i hope that it doesnt break anything else, but i cant see anything.

Diff Detail

Event Timeline

The lines removed here have been in Blender since way before 2.69. For instance it was in the Mar 23 2012 revision of editors/mesh/editmesh_utils.c in the EDBM_get_actSelection function. So I am worried that there is other code that depends on them. Will investigate further.

There appears to be some confusion as to how an active face is stored / retrieved, vs how active edges and vertices are stored / retrieved. The former sometimes involves looking at bm->act_face, while the latter always involves looking at the last element of the bm->selected list. Campbell, maybe you know the historical reason for this?

It makes it worrisome to make a change such as in this revision without knowing who is relying on the act_face method to set & retrieve the active face. Maybe this is OK, but I'm not sure. We don't have enough unit tests yet to feel safe about not breaking something else with this change. I propose an alternate fix to the problem in D664: Alternate Fix T40993: no active verts after extrusion.

Hi @mangostaniko

I checked the patch but there are times when you want to keep the active face, even if its unselected.

Committed an alternative fix for T40993, which involved maintaining selection history across extrude operations.

My bad for half finished comment, corrected: rB47ad1a97202683abab939d088793332d9f0cbd5c