From c2f7cffd56afffcceda11813a3dcc0a93d84673a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 26 Apr 2015 18:31:54 +1000 Subject: Add inverse-square falloff to bmesh, mask & compo. --- source/blender/bmesh/intern/bmesh_operators.h | 1 + source/blender/bmesh/intern/bmesh_queries.c | 3 +++ 2 files changed, 4 insertions(+) (limited to 'source/blender/bmesh/intern') diff --git a/source/blender/bmesh/intern/bmesh_operators.h b/source/blender/bmesh/intern/bmesh_operators.h index d2ce2faf09d..d9961e589da 100644 --- a/source/blender/bmesh/intern/bmesh_operators.h +++ b/source/blender/bmesh/intern/bmesh_operators.h @@ -46,6 +46,7 @@ enum { SUBD_FALLOFF_ROOT, SUBD_FALLOFF_SHARP, SUBD_FALLOFF_LIN, + SUBD_FALLOFF_INVSQUARE = 7, /* matching PROP_INVSQUARE */ }; enum { diff --git a/source/blender/bmesh/intern/bmesh_queries.c b/source/blender/bmesh/intern/bmesh_queries.c index 1e0b1f21381..61328a525f1 100644 --- a/source/blender/bmesh/intern/bmesh_queries.c +++ b/source/blender/bmesh/intern/bmesh_queries.c @@ -2419,6 +2419,9 @@ float bmesh_subd_falloff_calc(const int falloff, float val) break; case SUBD_FALLOFF_LIN: break; + case SUBD_FALLOFF_INVSQUARE: + val = val * (2.0f - val); + break; default: BLI_assert(0); break; -- cgit v1.2.3