Commit Graph

20 Commits

Author SHA1 Message Date
Bastien Montagne
3235a3081c Fix T57858: Add validation callback to CustomData layers.
Our mesh validation was only checking cd layout so far, not their actual
data. While this might only be needed for a few types, this is a
required addition for things like imported UVs, else we have no way to
avoid nasty things like NANs & co.

Note that more layer types may need that callback, time will say. For
now added it to some obvious missing cases...
2018-12-03 16:22:27 +01:00
Alexander Gavrilov
f600b4bc67 Shrinkwrap: new mode that projects along the target normal.
The Nearest Surface Point shrink method, while fast, is neither
smooth nor continuous: as the source point moves, the projected
point can both stop and jump. This causes distortions in the
deformation of the shrinkwrap modifier, and the motion of an
animated object with a shrinkwrap constraint.

This patch implements a new mode, which, instead of using the simple
nearest point search, iteratively solves an equation for each triangle
to find a point which has its interpolated normal point to or from the
original vertex. Non-manifold boundary edges are treated as infinitely
thin cylinders that cast normals in all perpendicular directions.

Since this is useful for the constraint, and having multiple
objects with constraints targeting the same guide mesh is a quite
reasonable use case, rather than calculating the mesh boundary edge
data over and over again, it is precomputed and cached in the mesh.

Reviewers: mont29

Differential Revision: https://developer.blender.org/D3836
2018-11-06 21:20:17 +03:00
Campbell Barton
2deeca4fb0 Cleanup: remove references to DerivedMesh 2018-10-15 16:06:42 +11:00
Sergey Sharybin
15792eb728 Cleanup: Variable name in mesh runtime
Matches type better, avoiding possible confusion.
2018-09-25 10:32:34 +02:00
Brecht Van Lommel
342e73f90f Spelling fixes in comments and descriptions (2.8 changes), patch by luzpaz.
Differential Revision: https://developer.blender.org/D3719
2018-09-24 18:48:29 +02:00
Sergey Sharybin
3fbdcefa17 Subdiv: Initial implementation of CCG
Attempts to substitude CCGDM with an OpenSubdiv based structure
which has less abstraction levels. The missing part in this
substitude is a face pointers which old CCGDM/multires code was
using to stitch faces (averaging boundaries).

Another curial bit missing: "reshaping" of multires CD_MDISPS
to the state of new PBVH grids.

The new code is only available when OpenSubdiv modifier is
enabled (WITH_OPENSUBDIV_MODIFIER=ON) and with debug value of
128. This is so this WIP code is not interfering with current
production machines in the studio.

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D3685
2018-09-11 16:37:02 +02:00
Dalai Felinto
613523d5f5 Rename: *_batch_cache_dirty > *_batch_cache_dirty_tag 2018-08-23 10:20:16 -03:00
Campbell Barton
a855a763c2 Merge branch 'master' into blender2.8 2018-07-13 08:40:17 +02:00
Bastien Montagne
9c7a561883 Cleanup: remove some more DM usages... 2018-06-27 10:37:57 +02:00
Bastien Montagne
122e0105e2 Port DM_debug stuf to BKE_mesh_runtime. 2018-06-22 17:55:48 +02:00
Campbell Barton
ab375079df Cleanup: rename WITH -> USE for internal defines 2018-06-06 09:29:54 +02:00
Sybren A. Stüvel
ce6db959c7 Moved function declarations from BKE_DerivedMesh.h to BKE_mesh_runtime.h
The function definitions still reside in DerivedMesh.c. Once we're done
porting all the DerivedMesh use to Mesh, we'll move the still-relevant
functions to mesh_runtime.c. This move is now cumbersome due to shared
statically-declared utility functions in DerivedMesh.c
2018-06-05 16:59:25 +02:00
Sybren A. Stüvel
a9ed50514c Moved function declarations from BKE_mesh.h → BKE_mesh_runtime.h 2018-06-05 16:59:18 +02:00
Campbell Barton
d94df18550 Cleanup: doxy grouping for mesh runtime API 2018-06-05 15:55:16 +02:00
Sybren A. Stüvel
a2438373b3 Modifiers: ported Collision DerivedMesh → Mesh 2018-05-17 15:28:51 +02:00
Germano
5503e2565b Bmesh: Clear possible geometry saved at runtime when converting bmesh to mesh. 2018-05-11 15:48:14 -03:00
Dalai Felinto
828a3d89b3 Fix T55015: Crash on selection after recent BVH changes
Runtime data should always be initialized to NULL on read-time.
2018-05-09 15:53:16 +02:00
Campbell Barton
4f213c1495 Cleanup: naming (prefer len over num for new code) 2018-05-08 19:36:02 +02:00
Campbell Barton
305c455ffe Cleanup: mesh_runtime naming
- BKE_mesh_get_looptri_num        -> BKE_mesh_runtime_looptri_len
- BKE_mesh_runtime_recalc_looptri -> BKE_mesh_runtime_looptri_recalc
- BKE_mesh_get_looptri_array      -> BKE_mesh_runtime_looptri_ensure
2018-05-08 19:26:36 +02:00
Sybren A. Stüvel
abb58eec53 looptri + bvhtree support for Mesh 2018-05-08 11:36:48 +02:00