Commit Graph

142 Commits

Author SHA1 Message Date
a173508f49 converting a mesh to an undo mesh now skips using bmesh operator. 2012-03-29 03:06:42 +00:00
09f29c0b70 style/name cleanup: have EDBM_* functions match our style guide and also match BM_ function naming conventions 2012-03-27 04:46:52 +00:00
7ff77ed4ea code cleanup: use zero_v3 2012-03-23 20:18:09 +00:00
303cecf139 spelling cleanup: tesselate -> tessellate (last of these found) 2012-03-20 22:56:26 +00:00
91580c0929 swap BMLoopCol r/b color, requires subversion bump.
old mesh MCol 'r' was blue, 'b' was red, but theres no reason to keep this for bmesh with MLoopCol.

Loading old files works, saving legacy format works too.

What wont work is loading a file after this revision and loading it in an older revision since the bmesh merge.
(it wont crash but the blue and red will be swapped on vertex color layers).
2012-03-17 20:39:28 +00:00
19400d418d fix for debug assignment left in from own commit r44778
also removed private face normal update functions - they were same as public.
2012-03-11 15:27:08 +00:00
4f7bdc59d3 style cleanup: spelling.
also remove large, duplicate comments from sunsky.h
2012-03-09 00:41:09 +00:00
640b0adb98 Code cleanup: use named values for options in DerivedMesh drawing.
The DMSetDrawOptions[Tex] callbacks return 0 (skip), 1 (draw), or 2
(either stipple or skip mcols.) In the CDDM, EDDM, and CCGDM draw
functions, as well as the callbacks in drawmesh/drawobject, replace
these numbers with values from an enum, DMDrawOptions.
2012-03-08 06:47:05 +00:00
52db32bb53 fix for 2 crashes from missing NULL checks. 2012-03-08 00:23:28 +00:00
925f213427 Code cleanup: simplify the DerivedMesh.drawMappedFaces interface.
This function pointer's 'setDrawOptions' parameter took a slightly
different type than the other drawing callbacks. In particular, it
could set a 'drawSmooth' value to indicate that smoothing should
always be enabled, overriding the face flag. However, all callbacks
either did not set this value, or set it unconditionally to
1. Replaced this by adding a new 'flag' parameter to drawFacesMapped,
which can be set to DM_DRAW_ALWAYS_SMOOTH where appropriate.

Also removed the 'useColors' parameter and replaced it with another
flag value, DM_DRAW_USE_COLORS.

Removed the 'wpaint__setSolidDrawOptions' callback, was only being
used to set the shading to smooth.
2012-03-07 12:48:52 +00:00
71e5edeb6a Code cleanup: use typedefs for DerivedMesh drawing callbacks.
There are still fairly bewildering set of callbacks being tossed
around, but it's at least a little less verbose now.
2012-03-07 04:41:14 +00:00
2fd7a56526 Fix textured-mode drawing in editmode.
It's currently not respecting the material color, probably since the
BMesh merge. There are a couple problems, both involving "dummy"
variables taking the place of actual MTFace/MCol data.

Code review: http://codereview.appspot.com/5753050/
2012-03-06 21:21:22 +00:00
12d0489b33 fix for building openjpeg image support on OpenSUSE 12.1, also quiet compile warning. 2012-03-04 11:58:55 +00:00
95670e03a0 style cleanup / comment formatting for bli/bke/bmesh 2012-03-03 20:19:11 +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
622ac0dd16 code cleanup:
replace casts: '((Mesh *)ob->data)->edit_btmesh' with 'BMEdit_FromObject(ob)'

also minor style edits.
2012-03-02 12:09:49 +00:00
0cec655b29 Fix #30328: Crash when using edge slide
Looks like it was missed BMesh element index for faces in emDM_drawMappedFacesMat.
There was already call of BM_mesh_elem_index_ensure to ensure there's element
index for vertices, added flag to ensure there's also index for faces.
2012-02-29 14:32:09 +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
bd0f7a290b svn merge ^/trunk/blender -r44213:44235 --- fixes bmesh shading bug [#30125] 2012-02-19 03:19:58 +00:00
4450039734 Change texface draw to always use glShadeModel(GL_SMOOTH), with texface draw.
without this each face would get a solid color, this is the same method used in object mode.

also copy BLI_array.h fix from bmesh branch.
2012-02-19 03:10:11 +00:00
22d326a663 skip per face texface poly lookup while drawing when the layer isnt found.
also remove some unused code.
2012-02-19 02:54:50 +00:00
4ca1d6f28f left print in by mistake 2012-02-19 01:52:59 +00:00
ece3418b4e edit-derived-mesh had a table for vert/edge/face lookups - that were never used.
removed these and replaced them with calls to BM_vert_at_index, BM_edge_at_index - which are not ideal but same as trunk does.
2012-02-19 01:51:36 +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
8b43813b69 rename BM_ flags for BMHeader->hflag to BM_ELEM_ to be more clear that these flags apply to bmesh elements. 2012-02-12 06:24:12 +00:00
76ccd3d5ed Code Cleanup:
macro for copying polygon settings
2012-02-08 09:02:10 +00:00
1fd6088729 Code Cleanup:
- use 'oflag' for operator flag arguments.
- use TRUE/FALSE for some bool args
2012-02-07 13:54:16 +00:00
3d01f13c43 fix for 3 issues when applying a deform modifier in editmode.
- drawing face normals was broken (using wrong index).
- drawing flat faces in solid mode would display ugly tesselation normals (as if the model was made of triangles).
- drawing smooth faces in solid mode would show vertex normals based on tesselation (heavily slant in 1 direction).

now the normals are calculated and stored per polygon (will save some memory too for non tri meshes).
2012-01-24 19:37:18 +00:00
b320e3ee5b remove redundant casts. 2012-01-24 18:24:19 +00:00
ab52d677bc simplify editmesh mapping lookups.
this really has no effect since they were not created or used, however if we want to use emDM_getEdge or emDM_getTessFace this will need to be called.
2012-01-24 18:20:33 +00:00
f4b9e83741 improve editmode triangulation by re-using the loop array when
possiblem, this has to guess when the size is too big so as to re-
well.

If this isnt done, then the number of faces is used to allocate the
initial array to at least avoid many small allocs.

added BLI_array_reserve() to reserve elements and avoid reallocing many
small arrays when the loop starts.
2012-01-23 13:25:06 +00:00
61a5cc28be disable re-tesselation for modifiers that use bmesh, array/bevel/edge split - were tesselating 2 times and didnt need to.
also comment array modifier from flushing selection flags.
2012-01-22 21:12:18 +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
705f23064e svn merge ^/trunk/blender -r43294:43338 2012-01-13 01:39:57 +00:00
8c521496dd save 4 bytes per BMLoop, added some comments on index use. 2011-12-13 05:20:02 +00:00
65f3b93f14 svn merge ^/trunk/blender -r42521:42550 2011-12-10 05:38:00 +00:00
9d807eb6dd Mesh drawing optimization and fixes:
- Pass MFace, MTface and OrigIndex arrays via userData to compareDrawParams callback
  rather than looking up for this layers for each face
- This allowed to avoid massing DM to compare callback which seems like a bad-level pass
- Fixed crashes on some video cards when assigning different materials to different
  faces in edit mode. Both of intel and nvidia cards in my laptop were affected by
  this error
2011-12-09 11:46:48 +00:00
2a35e8f9c1 remove BMEMSET define, use memset instead 2011-12-07 04:27:40 +00:00
2bdd4c570f changes to derived mesh editmode functions to be in closer sync with trunk. 2011-12-02 03:18:34 +00:00
0cff8e6c9c move editmesh derived mesh functions into their own file to match bmesh, without this all merges in this area have to be done manually. 2011-12-02 03:16:06 +00:00
583b118217 file rename, will do the same in trunk to make merges less of a hassle 2011-12-02 02:18:29 +00:00