Page MenuHome

Add option to exclude back facing geometry from snapping
ClosedPublic

Authored by Germano Cavalcante (mano-wii) on Oct 30 2019, 4:59 PM.
Tags
None
Tokens
"Yellow Medal" token, awarded by franMarz."Yellow Medal" token, awarded by amonpaike."Love" token, awarded by xorrito."Yellow Medal" token, awarded by kioku.

Details

Diff Detail

Repository
rB Blender
Branch
master
Build Status
Buildable 5508
Build 5508: arc lint + arc unit

Event Timeline

I just tested it and it doesn't seem to work for me. If I have "Project Individual Elements" enabled it also causes Blender to crash.

  • Fix crash when snap in edit mode (error in choosing callback)
  • Support BackFace Culling for project individual elments

@Julien Kaspar (JulienKaspar), should already be fixed, thanks for testing.

Could this also be added for vertex snapping? It will then for vertices check the vertex normal.

Generally LGTM, minor suggestions only.

source/blender/editors/transform/transform_snap_object.c
408

a sqrtf can be avoided since you're only checking the sign of the dot product, cross_tri_v3 can be used instead. (applies above too).

911

should use use_ prefix here too, variable above does.

source/blender/makesrna/intern/rna_scene.c
3038

Use use_ prefix.

This revision is now accepted and ready to land.Oct 30 2019, 7:35 PM
Germano Cavalcante (mano-wii) marked 3 inline comments as done.
  • Support test of backface culling for snap to edges and verts (object mode only)
  • Add use_ prefix and avoid sqrtf

Isn't it possible to just check the vertex normal in edit mode to get culling of back facing vertices there as well?

Isn't it possible to just check the vertex normal in edit mode to get culling of back facing vertices there as well?

It would not be fully reliable and since callbacks used for snapping vertices and edges are also used for Mesh objects, this would add unnecessary overhead in object mode.
A solution would be to redo the same scheme used for Mesh objects in EditMeshs, but this would result in a lot of changes that could change the initial focus of the patch.

It is best to think of a solution in another patch as it would need more precautions (performance testing and others).

I see. Thanks for the explanation!

  • Cleanup: rename functions