Commit Graph

655 Commits

Author SHA1 Message Date
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
9751653410 Renaming CD_WEIGHT_MCOL/MLOOPCOL and their masks from WEIGHT to PREVIEW, as this layer is now also used for various preview tasks in Object mode.
“Cleanup” commit, no functional changes.
2012-03-22 08:41:50 +00:00
303cecf139 spelling cleanup: tesselate -> tessellate (last of these found) 2012-03-20 22:56:26 +00:00
9dd0c4c232 rename define BM_INLINE -> BLI_INLINE to avoid confusion with bmesh defines. 2012-03-20 08:42:26 +00:00
9beef61199 Fix format string warnings (gcc) by using string literals.
gcc 4.6 was giving warnings like this:
"warning: format not a string literal and no format arguments [-Wformat-security]"
2012-03-19 21:38:35 +00:00
53b7078343 Fix [#30234] Various problems with CD layers and tesselation, related to modifiers stack.
Should also fix [#30266], [#29451], and partly [#30316].

Here are the changes made by this commit:
* It adds a "dirty" flag to DerivedMesh struct (for now, only DM_DIRTY_TESS_CDLAYERS, but more might be added as needed).
* It adds a new func, DM_update_tessface_data, which assumes tessfaces themselves are valid, but updates tessellated customdata from their poly/loop counter parts.
* At end of modstack, when valid tessellated faces are present in finaldm , but the cdlayers dirty flag is set, call that function (instead of recomputing the whole tessellation).
* Edits to the codes concerned (UVProject, DynamicPaint, and Subsurf modifiers).
* Also add to subsurf dm generation code the creation of a CD_POLYINDEX layer (mandatory for DM_update_tessface_data to work well, and imho all tessellated dm should have one).

Note: some pieces of old code are just #if 0’ed, will clean them later.
2012-03-18 22:06:57 +00:00
4f19c1a995 spelling cleanup 2012-03-18 07:38:51 +00:00
e56f714000 ngons draw with uniform normals in object mode now, I had this code disabled for speed (it was being called when it didnt need to), but for CDDM meshes without face normal layers this should still be called. 2012-03-18 06:49:32 +00:00
3633858fdb code cleanup:
* replace 2D vector copy with copy_v2_v2().
* use puts rather then printf for single strings.
* style cleanup for drawobject.c indentation.
2012-03-18 06:01:33 +00:00
b786d0d47c better not to use rgb_float_to_uchar() from last commit (comment as to why) 2012-03-17 23:37:14 +00:00
b0c0626cb0 fix for weightpaint color with recent loopcolor abgr --> rgba conversion. 2012-03-17 23:26:25 +00:00
1f6ae5e4fb Minor UI messages fixes, and enabling i18n for all modifier_setError() error messages. 2012-03-17 14:27:46 +00:00
930f43bd96 Fix crash on edge extrude from textured view
Issue was caused by MFACE layer adding for even DM without tessellated faces
which lead to adding new layer but with NULL data. This causes issues when layer
with faces (after extrude) was attempting to add because currently CD only checks
if layer type exists but does not check for size of the layer.

Solved by not adding MFACE layer if there's no tessellated faces.
2012-03-14 14:09:56 +00:00
38d4848020 Don't wait for sculpt stroke to create PBVH.
This idea is borrowed from the multires modifier, which already
checked if the object was in sculpt mode and, if so, created the
PBVH. That check is now moved higher up the chain into
mesh_build_data(), so that it occurs for CDDerivedMesh too.

This also replaces an assert in cdDM_getPBVH for tesselated mesh faces
with a call to create them if missing.
2012-03-14 06:30:55 +00:00
c21c58f44c style cleanup, also remove unused externs. 2012-03-11 19:09:01 +00:00
89a963fb7f style cleanup: comment blocks 2012-03-09 18:28:30 +00:00
4a02307236 Another fix due to recent DM refactoring, for compilation of navmesh... 2012-03-08 09:14:10 +00:00
46045fbb09 style cleanup - braces & else / if's 2012-03-07 04:53:43 +00:00
31d2ee9bf7 style cleanup, brackets in else/if, some indentation. 2012-03-06 18:40:15 +00:00
7bbf4b7831 style cleanup
- spelling - turns out we had tessellation spelt wrong all over.
- use \directive for doxy (not @directive)
- remove BLI_sparsemap.h - was from bmesh merge IIRC but entire file commented and not used.
2012-03-02 16:05:54 +00:00
ea13ec1699 Spelling Cleanup 2012-03-01 12:20:18 +00:00
0d66b57bc2 fix for issue reported in bug [#30381], though it doesn't deal with the crash.
calling DM_ensure_tessface() on an DM_TYPE_EDITBMESH does nothing, which is OK but was printing a warning.
2012-02-28 10:22:21 +00:00
47c373c7a9 style cleanup (mostly whitespace) 2012-02-27 10:35:39 +00:00
53fece44cf style cleanup for blenkernel, no functional changes. 2012-02-23 02:17:50 +00:00
d47b018f8d Fix #30270, #30265: cycles not displaying textured objects, and not rendering
text/curve objects after the bmesh merge. Also removed a debug print.
2012-02-21 14:39:59 +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
cf0aeddfc9 marked navmesh as BMESH_TODO, mixed mface/mpoly functions were being used for navmesh too, now editing funcs use polygons only. 2012-02-13 04:52:41 +00:00
59d45d0ea6 * remove the MFace parts of join (we only need polygon data)
* other minor cleanups
2012-02-12 19:11:09 +00:00
b6dcdb065d code refactor, function renaming for bmesh.
These changes are to make the bmesh api more consistent and easier to learn, grouping similar functions which is convenient for autocomplete.
This uses similar convention to RNA. 

* use face/loop/edge/vert as a prefix for functions.
* use 'elem' as a prefix too for functions that can take any type with a BMHeader.
* changed from camel case to underscore separated (like RNA).
2012-02-12 10:51:45 +00:00
63c4c18269 dont recalc normals after applying modifiers, this is already checked in previous code. 2012-02-09 14:28:59 +00:00
191c160d50 fix [#30083] Sculpt not redrawing with plain mesh 2012-02-06 06:56:54 +00:00
543fb27fd0 support for 'origspace' data layer - used for hair on subsurf mesh.
currently only works for 3/4 sided faces.
2012-02-05 11:30:26 +00:00
1d21e2386e ensure tessface's are available while sculpting. 2012-02-05 07:12:46 +00:00
35678eaae5 simplify some of the shape key code. no functional changes. 2012-01-30 03:54:24 +00:00
035607e26c more efficient array copying for add_shapekey_layers 2012-01-30 01:18:49 +00:00
fac771beca missed these last commit 2012-01-29 22:32:00 +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
92aa15805d BMesh: Fix for previous own fix (re-enable DynamicPaint previews in Object mode).
In fact, we have to add a CD_WEIGHT_MCOL layer (if not yet present) when updating CD_WEIGHT_MLOOPCOL, else with modifiers modifying the topology (like subsurf), it will sigsev.

That step should probably be done at tesselation time, though…
2012-01-23 17:17:08 +00:00
6c9438ea8a BMesh: Fix (re-enable) DynamicPaint previews in Object mode.
Also simplifies DM_update_weight_mcol: no need to update CD_WEIGHT_MCOL here, as it is anyway recreated from CD_WEIGHT_MLOOPCOL at tesselation time. Only commented out code for now.
2012-01-23 16:32:11 +00:00
41c0f0c733 replace BLI_array_growone() with BLI_array_growitems() when the size of the increase is known ahead of time, will reduce reallocs and give some speedup. 2012-01-23 13:51:44 +00:00
6eb0ca9385 Merged with trunk (-r43609:43611): updated modifier preview.
Noted preview code for DynamicPaint is currently disabled, will see if I can re-enable it…
2012-01-22 20:05:26 +00:00
1a93d88343 Add weight preview to WeightVG modifiers, and first, simple/basic refactor of how modifiers can generate preview.
User side:
* Preview for DynamicPaint should keep the same behavior (for now). Weight preview should be somawhat quicker, though.
* Preview for WeightVG modifiers is only active in WeightPaint mode, and if the affected vgroup is the active one.
* Last active preview modifier in stack wins!

Note: that modifier preview topic is yet to be further refined, quite raw/incomplete for now.

Dev side:
* In draw code, renamed DRAW_DYNAMIC_PAINT_PREVIEW flag to DRAW_MODIFIERS_PREVIEW
* Removed use of MOD_DPAINT_PREVIEW_READY in DynamicPaint code (seems unecessary, and if it was, should be of more general scope).
* Added eModifierTypeFlag_UsesPreview to ModifierTypeFlag, for modifiers that can generate some preview data.
* Added three new modifier funcs, to handle preview modifiers in draw code / mod stack.
* For weights preview: added the generic DM_update_weight_mcol func, which can update WEIGHT_MCOL layer with either a given array of weights (currently used by DynamicPaint only), or from current active vgroup(s).

So now, draw code is fully generic (i.e. no more modifier-type checking in it). Mod stack code is generic to some extent, but will need more work.
2012-01-22 17:54:23 +00:00
4de28741c8 - disable re-tesselating derived meshes in BMEdit_RecalcTesselation() have modifier stack do this.
- made editbmesh_calc_modifiers() ensure tessfaces, this has the advantage that if the tessfaces are already created they wont get re-made as was happening before.
2012-01-20 13:53:47 +00:00
444613cdba after all modifier are applied calculate normals, then tessfaces, this works so tesselating copies normals into the the newly creates tesselated faces. 2012-01-20 13:14:14 +00:00
a928a610e7 for CDDM's dmcalcNormals now call CDDM_calc_normals(), not CDDM_calc_normals_mapping(), this means calculating normals will calculate MPoly and MVert normals but not tesselate the mesh (which is overkill for normal calculation anyway).
use CDDM_calc_normals over CDDM_calc_normals_mapping for editmode and ensure the final dm has tessfaces.
2012-01-19 23:34:53 +00:00
bc745a32d3 argument to mesh_recalcTesselation to skip copying normals from polygons. 2012-01-19 17:51:52 +00:00
7b2101ace9 svn merge ^/trunk/blender -r43482:43524 2012-01-19 11:31:31 +00:00
6afac2d345 Couple minor fixes for DM_debug_print().
Fix a gcc warning by not using the DM_debug_info string as the format
string, also free the string after printing.
2012-01-19 04:00:27 +00:00
b748d4f0cf debug function DM_debug_info / DM_debug_print, with access from python
through Object.dm_info('SOURCE/DEFORM/FINAL')

this is to help tracking down issues with modifiers where loosing data
layers between modifiers can cause bugs, also to helo with comparing
bmesh/trunk's modifier stack.
2012-01-19 00:18:25 +00:00
787ea5feb4 replace CDDM_calc_normals_mapping with CDDM_calc_normals(), this version of the function wont create tessfaces (and should speedup the modifier stack in some cases). 2012-01-18 15:47:56 +00:00