Age | Commit message (Collapse) | Author |
|
|
|
|
|
is a multi-res modifier).
|
|
|
|
|
|
|
|
When OpenMP is enabled, memory allocation needs to be protected.
Fixes bug [#32111] Memory management regression from svn_46520
projects.blender.org/tracker/index.php?func=detail&aid=32111&group_id=9&atid=498
|
|
Problems were in the old multires loading system.
Actually, the sigsev itself was the easy part of the job (simply had to convert from tesselated data to polys/loops), but after that I was getting a horrible bunch of wild stray faces...
It finally turned out it was a mismatch in two different subsurf structs used while computing a mdisps layer from the multires DM, leading to getting complete random normals (null ones, NAN ones...), leading to complete dummy tangent space matrix, leading to absurds mdisps values...
Note: I also moved the copy of first layer's vertex and face data from old me->mr to mesh's v/fdata earlier in multire_load_old(), to be able to use general face_to_poly conversion function (later on we would have to do it by hand, the general function would erase our newly computed mdisps layer...).
Took me the whole week (something like 20h) to track this down: multires + subsurf = C nightmare!
|
|
When removing a skin or multires modifier, it skips deletion of the
associated CustomData layer if the object has any other modifiers of
that type. This check has been extended to all objects that use the
object's data.
Similarly, deleting higher multires levels and multires subdivision
will not update the maximum level of any other multires modifiers on
objects that link to the same mesh.
Note that modifier_apply_obdata() doesn't need any changes as it
does not allow applying to multi-user data.
Object joining has also been modified to synchronize multires levels
objects that share a mesh. This is needed because joining can
subdivide or delete levels in order to match the maximum level of the
join-from object to the join-to object.
Fixes bug [#31880] instance multiresolution modifier error.
http://projects.blender.org/tracker/index.php?func=detail&aid=31880&group_id=9&atid=498
Reviewed by Sergey:
http://codereview.appspot.com/6332047/
|
|
Bug [#31785] Applying a transform to an object with multires weird result
Was reading interleaved coord/mask data incorrectly since paint mask
merge. Fixed by using two separate CCGKeys.
Some additional code cleanup: deduplicate multires tangent matrix
calculation.
|
|
|
|
|
|
|
|
Fix overly aggressive check for creating GridPaintMasks, wasn't
creating them in the right place after adding new faces in editmode.
|
|
|
|
* Add new CCG function ccgSubSurf_setAllocMask(). Similar to to
ccgSubSurf_setCalcVertexNormals(), it sets whether the CCG elements
have a mask layer and what that layer's offset is. Unlike normals
however, it doesn't change any behavior during CCG calculation; it's
there only to give CCGKey information on the mask.
* Add a new flag to _getSubSurf(), CCG_ALLOC_MASK. If set, space for
an extra layer is allocated, but the number of CCG layers is not set
to include it. This is done because GridPaintMasks are absolute,
rather than being relative to the subdivided output (as MDisp
displacements are), so we skip subdividing paint masks here.
* Add a new flag to subsurf_make_derived_from_derived(),
SUBSURF_ALLOC_PAINT_MASK. This controls whether CCG_ALLOC_MASK is
set for _getSubSurf(). Related, masks are never loaded in during
ss_sync_from_derivedmesh(). After subdivision is finished, if the
alloc mask flag is set, the number of CCG layers is increase to 4
with ccgSubSurf_setNumLayers().
* Add a new flag to multires_make_from_derived(),
MULTIRES_ALLOC_PAINT_MASK. Not all multires functions need paint
mask data (e.g. multiresModifier_base_apply.) This flag is always
set in MOD_multires.c so that subdividing a mesh with a mask updates
properly even when not in sculpt mode.
* Update multiresModifier_disp_run() to apply, calculate, and add mask
elements. It's almost the same as the existing operations with xyz
coordinates, but treats masks as absolute rather than displacements
relative to subdivided values.
* Update multires_customdata_delete to free CD_GRID_PAINT_MASK in
addition to CD_MDISPS.
* Update multires_del_higher() to call the new function
multires_grid_paint_mask_downsample(), which allocates a
lower-resolution paint mask grid and copies values over from the
high-resolution grid.
|
|
* Changes to DerivedMesh interface: DMGridData has been removed,
getGridData() now returns an array of CCGElem pointers. Also added
getGridKey() to initialize a CCGKey (implemented only by
CCGDerivedMesh.)
* PBVH: added BLI_pbvh_get_grid_key().
* A lot of code is affected, but mainly is just replacing
DMGridData.co, DMGridData.no, and sizeof(DMGridData) with the
CCG_*_elem functions, removing the reliance on grid elements of
exactly six floats.
|
|
Changed name to multires_make_derived_from_derived() and parameter
order to be more similar to subsurf_make_derived_from_derived().
Added MultiresFlags enum with flag values to replace the local_mmd and
useRenderParams parameters.
|
|
This is the first commit of the sculpt masking merge. Documentation:
http://wiki.blender.org/index.php/User:Nicholasbishop/PaintMasks
Thanks to Brecht for reviewing!
Replaced four boolean parameters with a single flag and a new enum,
SubsurfFlags.
|
|
to pass options, instead of having one parameter per boolean flag (i.e. replaces current useRenderParams and isFinalCalc by a single ModifierApplyFlag flag. ModifierApplyFlag is an enum defined in BKE_modifier.h). This way we won't anymore have to edit all modifier files when e.g. adding a new control flag!
Should have no effect over modifier behavior.
|
|
|
|
|
|
|
|
also use ..._find_name(..., name) rather then ..._find_named(..., name) --- both were used.
|
|
|
|
|
|
bmesh grr!)
|
|
|
|
|
|
This call is still needed when loading editmesh because some operations
are not creating CD layer for new loops (like crating new face) and
to prevent loosing all sculpted data when running disps correct
displacement maps should be allocated on loading edit mesh.
|
|
else if's
|
|
Reported on BlenderArtists by Guffy, was causing ugly spikes in lower
levels.
|
|
The code was duplicated in various places, replaced with calls to
a new function, multires_customdata_delete().
|
|
Changed the create_vert_poly_map function to return a more compact
structure. Memory saved will vary depending on the mesh, but typically
it should be about one third of the old size.
|
|
|
|
|
|
Gets initialized when loading old files and updated at the same places
totdisp is updated. Saves having to do log+sqrt to extract level from
totdisp.
|
|
Renamed the multiresModifier_update() function to
multires_modifier_update_mdisps() and made it visible to subsurf_ccg.c
so it can be called directly. No functional change, just a bit simpler.
|
|
This is called when adding a multiries modifier. BMesh MDisps have
only one loop's displacements rather than a full face's, so don't
multiply by number of corners here.
|
|
|
|
|
|
|
|
Previously the function took 'invert' and 'add' parameters to indicate
what operation should be performed on the displacements, replaced
these with three named modes: APPLY_DISPLACEMENTS, CALC_DISPLACEMENTS,
and ADD_DISPLACEMENTS.
|
|
|
|
- Removed validate() callback for MDisps layer. It wouldn't actually work
correct from CustomData layer and all needed data might be validated from
BMesh interpolation level. Also this callback was never actually used in
BMesh, so can't see why we'll want to have it in structures.
- Removed layrInterp_mdisps callback. Interpolation now happens from
another level (bmesh_interp) and this callback isn't needed anymore.
- Removed all function from multires.c which were used by old interpolation
stuff and seems to be useless for other usages.
- multires_topology_changed is still marked as a TODO, Probably it's not
needed anymore, buy better to keep for now until it'll be 100% clear this
function isn't needed and all needed re-allocations happens in bmesh_interp.
Otherwise, it'll be needed to be ported to new system.
|
|
- copy & rename EditMesh stricts for use with scanfill (remove unused members)
|
|
this function caused too many conflicts and in most cases was zero anyway.
|
|
use a better malloc replacement.
See Details:
http://wiki.blender.org/index.php/User:Ideasman42/BMeshBranchReview#Update_43694
|
|
|
|
|