Coded a new modifier, "Precision UV Interpolation",
that triangulates, subdivides, then uses brecht's mean
value interpolation to interpolate face data.
Textures on ngon faces get interpolated a bit nicer, in
other words (though concave cases, e.g. 'N', don't work very well).
Fixed view selected code. Made MDisps->disps use the
special allocation library I wrote as a
temporary fix to MDeformGroup->dw problems.
Why was the vgroup solution reused? It's really slow,
and its hard to tie in something like mempool or memarena.
The hackish allocator I wrote really needs to go, eventually,
or be folded into guardedalloc.
Also fixed a customdata bug with modifiers.
Mirror modifier no longer uses bmesh, but is now
100% CDDM. This is faster; the sluggishness was
driving me crazy. Still need to deal with UVs,
but that shouldn't be hard.
Fixed join meshes, and an annoying modifier bug (making modifiers
not work in editmode). Also fixed a tesselation bug.
Also got edge slide to work right, yay! Dunno why I couldn't get
it working right before; took me twenty minutes to fix.
most local modifier,GPU,ImBuf and Interface functions are now static.
also fixed an error were the fluid modifier definition and the header didnt have the same number of args.
Used a crazyspace approach (like in edit mode), but only modifiers with
deformMatricies are allowed atm (currently shapekeys and armature modifiers only).
All the rest modifiers had an warning message that they aren't applied because
of sculpt mode. Deformation of multires is also unsupported.
With all this restictions users will always see the actual "layer" (or maybe
mesh state would be more correct word) they are sculpting on.
Internal changes:
- All modifiers could have deformMatricies callback (the same as deformMatriciesEM but
for non-edit mode usage)
- Added function to build crazyspace for sculpting (sculpt_get_deform_matrices), but it
could be generalized for usage in other painting modes (particle edit mode, i.e)
Todo:
- Implement crazyspace correction to support all kinds of deformation modifiers
- Maybe deformation of multires isn't so difficult?
- And maybe we could avoid extra bad-level-stub for ED_sculpt_modifiers_changed
without code duplicating?
When there are 2+ consecutive deform modifiers, the second modifier was getting incorrect normals, this only showed up for the displace modifier since its the only deform modifier that uses vertex normals.
It would have been easy to fix this by always calculating normals on deform modifiers, but slow.
To fix this I added a function to check if a deform modifier needs normals, so the normal calculation function only runs if there are 2 modifiers in a row and the second uses normals.
patch by Ben Batt (artificer)
Updated patch for 6 or so modifiers added since the patch was written.
- tested with CMake and SCons
- fixed one error were flags were being added to the fluids type.
- remove BKE_simple_deform.h, simple_deform.c, move functions into MOD_simpledeform.c since there were problems with circular deps.
- moved some fluid and boolean functions used by modifiers too.