Commit Graph

213 Commits

Author SHA1 Message Date
5c89138684 style cleanup: comments 2012-04-22 11:54:53 +00:00
34814e4755 Port multires_topology_changed to new bmesh api
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.
2012-04-16 11:03:42 +00:00
69e6894b15 style cleanup: follow style guide for formatting of if/for/while loops, and else if's 2012-03-24 06:18:31 +00:00
a0ea68a584 Fix uninitialized variable in multires apply base.
Reported on BlenderArtists by Guffy, was causing ugly spikes in lower
levels.
2012-03-20 08:23:53 +00:00
e508c2d9e1 Add a multires function to delete MDisps.
The code was duplicated in various places, replaced with calls to
a new function, multires_customdata_delete().
2012-03-19 05:13:41 +00:00
3d87c23f4f Reduce poly map memory usage (used by sculpt smooth brush.)
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.
2012-03-17 04:41:36 +00:00
7081abf51f Remove unused parameter from multires_dm_create_from_derived. 2012-03-15 04:08:57 +00:00
521e724edd Skip hidden elements in PBVH iterator, raycast, and drawing. 2012-03-14 06:32:03 +00:00
99f72dfbfc Add 'level' field to struct MDisps, companion to 'totdisp'.
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.
2012-03-14 03:10:18 +00:00
dfc9a57b3e Code cleanup: replace multires update function pointer with direct call.
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.
2012-03-12 22:52:20 +00:00
2932ab8761 Fix an infinite loop in get_levels_from_disps().
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.
2012-03-10 12:26:32 +00:00
89a963fb7f style cleanup: comment blocks 2012-03-09 18:28:30 +00:00
bfc331dd75 BMesh: use MPoly rather than MFace in multiresModifier_base_apply 2012-02-28 03:54:31 +00:00
130668b12f minor bmesh api naming edits. 2012-02-27 14:07:19 +00:00
c5066df307 Code cleanup: clarify multiresModifier_disp_run modes.
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.
2012-02-26 04:40:56 +00:00
53fece44cf style cleanup for blenkernel, no functional changes. 2012-02-23 02:17:50 +00:00
9064978d0b Remove unused code left from old multires interpolation stuff
- 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.
2012-02-21 17:24:21 +00:00
a368e6771a - remove some unused editmesh functions.
- copy & rename EditMesh stricts for use with scanfill (remove unused members)
2012-02-19 22:17:30 +00:00
2ea8a3b8ca remove CDDM_copy second argument, added CDDM_copy_from_tessface instead.
this function caused too many conflicts and in most cases was zero anyway.
2012-01-29 21:59:47 +00:00
c7e8af13d4 remove cellalloc, from my tests jemalloc beats cellalloc, so we better just use a better malloc replacement.
See Details:

http://wiki.blender.org/index.php/User:Ideasman42/BMeshBranchReview#Update_43694
2012-01-25 20:18:12 +00:00
b3938cee63 minor warning/fixes 2012-01-20 15:22:20 +00:00
b308e61312 svn merge ^/trunk/blender -r43220:43278 --accept postpone 2012-01-11 14:14:04 +00:00
7eb3b37bec Fix #29835: joining meshes leads to crash 2012-01-09 15:17:09 +00:00
f07df7287e manual sync with trunk - pulling in changes where the issues are not bmesh spesific
- some merges added lines in multiple times
- removed some NULL checks that were only in bmesh
- enable cycles by default (was disabled because it used not to work)
- make formatting match
2011-12-04 23:13:28 +00:00
22a1ad61f9 svn merge ^/trunk/blender -r42372:42416 2011-12-04 18:39:19 +00:00
31ff21d735 add define for deprecated DNA struct members: DNA_DEPRECATED,
this means use of deprecated struct members gives a warning.

- makesdna.c preprocessor skips this.
- DNA_DEPRECATED_ALLOW is used so readfile.c can do versioning without warnings.
- this exposes some use of deprecated struct members, will deal with this after.
2011-12-04 06:05:48 +00:00
e59ab6486f svn merge -r41751:41779 ^/trunk/blender 2011-11-15 02:05:32 +00:00
e84c0980a3 correct indentation and some whitespace edits (no functional changes) 2011-11-11 13:09:14 +00:00
15e6d6cd75 svn merge ^/trunk/blender -r41226:41227 . 2011-10-24 12:43:08 +00:00
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
8695bedda2 svn merge ^/trunk/blender -r40644:40720 2011-10-06 16:59:58 +00:00
f65c72afaf Commented and tagged some unused vars, added some var init (gcc warnings...).
Won’t go further, most other warnings are from GE or intern/extern lib code...
2011-09-29 15:28:22 +00:00
9494340dae svn merge ^/trunk/blender -r40432:40491 2011-09-23 13:04:01 +00:00
86d528afa7 comment some unused vars / assignments. 2011-09-22 03:14:50 +00:00
ff7bde2a2f brought back some unused variables removed from previous commit, commented out, in case need their values later 2011-08-28 21:20:10 +00:00
fe98769877 Cleaned up unused variables 2011-08-25 16:47:47 +00:00
fd4575b2e3 svn merge -r39493:39664 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2011-08-24 02:29:45 +00:00
ba4fd78fac fix [#28344] for this file, the multires smiley has 2 materials, but only 1 loads 2011-08-23 11:46:16 +00:00
de92597967 fix for last merge 2011-07-29 02:15:01 +00:00
73dde4e26f svn merge -r38718:38804 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2011-07-29 02:03:53 +00:00
2dc826f083 New option for multires modifier: Subdivide UVs
Enabled by default and also enabled for older filesm so
there should be no regressions.

In some cases it's useful to not use subdivided uvs for multires.
2011-07-28 11:16:10 +00:00
97d0846d2c svn merge -r37335:37500 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2011-07-24 13:03:48 +00:00
73a545b0d5 =bmesh=
Removed the DerivedMesh face iterators (they sucked).
This should make subsurf faster.  Also sped up multires
a bit (not sure if it's strictly correct, need to look
at it later).
2011-06-14 03:16:08 +00:00
f122a74b1e svn merge -r37078:37335 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2011-06-09 15:20:29 +00:00
15d0d3f41e replace log() calls with constants 2011-06-09 14:27:51 +00:00
a1c22262fe Bake from multires mesh
=======================

Added option to baked named "Bake From Multires" which is avaliable for
normals baking and displacement baking.

If this option is enabled, then no additional hi-res meshes and render
structures would be created . This saves plenty of memory and meshes
with millions of faces could be successfully baked in few minutes.

Baking happens from highest level against viewport subdivision level,
so workflow is following:
  - Set viewport level to level at which texture would be applied
    during final rendering.
  - Choose Displacement/Normals baking.
  - Enable "Bake From Multires" option.
  - You're ready to bake.

Displacement baker had aditional option named "Low Resolution Mesh".
This option is used to set if you want texture for realtime (games)
usage.

Internally it does the following:
  - If it's disabled, displacement is calculated from subdivided
    viewport level, so texture looks "smooth" (it's how default
    baked works).
  - If it's enabled, dispalcement is calculated against unsubdivided
    viewport levels. This leads to "scales". This isn;t useful for
    offline renders much, but very useful for creating game textures.

Special thanks to Morten Mikkelsen (aka sparky) for all mathematics
and other work he've done fr this patch!
2011-06-05 20:54:04 +00:00
211cd99cbc Fix #27539: Sculpt data is lost after editing base mesh
Face's totdisp was set to correct value, but memory hasn't been
allocated for disps. Handle this in multires_topology_changed(),
so the whole MDISPS layer wouldn't be totally re-allocated when
applying displacement.
2011-06-02 04:58:27 +00:00
88f4087a57 svn merge -r36725:36801 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2011-05-20 16:52:10 +00:00
ae0c552bd1 Fix crash when accessing mesh from python while a mesh with a subsurf modifier
is in editmode.
2011-05-19 11:24:56 +00:00
068c627013 remove unused vars 2011-05-13 13:17:30 +00:00