Commit Graph

81 Commits

Author SHA1 Message Date
4ca67869cc Code cleanup: remove unused includes
Opted to keep includes if they are used indirectly (even if removing is possible).
2014-05-01 04:47:51 +10:00
e4c2a3c31c Various fixes/improvements regarding BMesh's elem_index_dirty and BM_LOOP handling.
Most notably, BM_LOOP and BM_FACE index recompute should now be fully decoupled.
2014-04-15 16:20:07 +02:00
9b60174e75 BMesh: DM_to_bmesh_ex, no need to calloc 2014-04-10 11:35:17 +10:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
5342d57a5e allocate bmesh data from known sizes where possible (was still using defaults in places),
add macros for initializing BMAllocTemplate's, also add assert on invalid use of bmesh_sfme()
2013-09-24 03:31:00 +00:00
9470754fd3 bmesh api cleanup, face creation args now accept an example face (as with vertex and edge),
also replace BM_face_create_quad_tri_v with BM_face_create_verts
2013-08-21 07:51:47 +00:00
4982f200fa move alloca define into its own header since its not related to BLI_array 2013-07-28 10:38:25 +00:00
e50c37d90f code cleanup: remove deprecated bevel code (unused since 2.64) 2013-07-23 14:28:19 +00:00
dfad9b0c09 fix [#35555] Collada: export destroys mesh in some cases
add arguments to calculate normals when converting to bmesh:
  BM_mesh_bm_from_me, DM_to_bmesh

This gives some speedup to undo (which didnt need to re-calculate vertex normals), and array modifier which doesnt need to calculate face normals at all
2013-06-02 23:20:49 +00:00
09e11ad6ef modifier stack: lazy initialize normals
many modifiers were calculating normals, when those normals were ignored by the next modifier.
now flag normals as dirty and recalculate for modifiers that set use `dependsOnNormals()` callback.

Quick test on mesh with 12 modifiers (mostly build type), calculated normals 6 times, now it only runs once - so this will give some speedup too.
2013-05-30 17:36:43 +00:00
2e0f741d01 can't use alloca in inline functions (fills up stack - I thought compiler would be smart here).
also reserve the exact number of vert/face/edge/loops when creating a bmesh during undo.
2013-05-09 11:42:24 +00:00
278240f4b0 bmesh: avoid using BLI_array macros for every face when converting to bmesh, replace with alloca 2013-05-09 10:44:38 +00:00
37e73aa368 code cleanup: use BKE naming conventions for functions in BKE_editmesh.h and BKE_editmesh_bvh.h 2013-04-16 05:59:48 +00:00
6da961775f code cleanup: rename BKE_tessmesh -> BKE_editmesh, rename EditDerivedBMesh.tc -> em. ('tc' is odd name which isn't used elsewhere). 2013-04-13 20:31:52 +00:00
91d4fb5d6c speedup for DM_to_bmesh_ex(), no need to check vertex order when converting faces since the loops are already in order, will speedup modifiers that use bmesh. 2013-01-10 18:34:09 +00:00
de6fe1294c minor speedup for DM_to_bmesh_ex(), only duplicate the edge array when the derivedMesh type isn't a CDDM. 2013-01-10 18:31:14 +00:00
ceb9701507 don't store bevel weights or edge crease customdata layers in editmode unless they are needed.
configurable in 'Geometry Data' panel, will be added when running crease edges transform for example.
2013-01-10 04:43:31 +00:00
e62bc29a9b fix [#33792] Accessing a bmesh object created by from_object crashes blender
Issue was customdata wasnt being initialized for layers in the destination BMesh but not in the source data.
2013-01-08 14:25:17 +00:00
f1cc922ccd dont copy the mvert array in DM_to_bmesh_ex() 2013-01-07 15:43:28 +00:00
bc0e1211de fix [#33551] End Caps on a curve array with subsurf crashes blender when entering Edit Mode
DM_to_bmesh_ex could merge a 'dm' into an existing BMesh, in that case CD_ORIGINDEX values needed to be set to ORIGINDEX_NONE.
2012-12-17 00:39:03 +00:00
07ccd3ee3f fix [#33029] Applying modifier leaks memory
Thanks for Sergey for finding the bug & patching, This fix works a bit differently.
Theres no need to allocate the customdata in the first place - since its written into. So add a flag for vert/edge/face/loop creation functions so they can skip customdata creation.
2012-11-29 16:26:39 +00:00
9f8070d047 code cleanup:
- define array sizes for functions that take vectors.
- quiet some -Wshadow warnings.
- some copy/paste error in readfile.c made it set the same particle recalc flag twice.
2012-10-20 08:02:18 +00:00
03164c3152 DM_to_bmesh_ex() now initializes index values when running in empty meshes. saves running extra loop on vert/edge/face data if these values are needed after. 2012-10-19 03:28:41 +00:00
c9c76a9a68 add compiler hints that failing to create a bmesh face is unlikely. 2012-10-01 11:12:49 +00:00
b6bf0e4952 fix [#32713] Crash with modifiers + GLSL mode
crash caused by own commit r50969, the fix exposed a crash in an area of code that must have never been used before.
2012-10-01 11:05:09 +00:00
32478997ec style cleanup 2012-06-27 18:29:47 +00:00
ef054e165c style cleanup: format 'for' loop macros the same as for loops, some renaming to BLI_array macros. 2012-04-28 15:14:16 +00:00
6408813f6f Fix [#30832] Weight on Bevel modifier has no effect for edges with weight.
Added missing CD_BWEIGHT layer for the modifier's DerivedMesh.
2012-04-06 11:24:42 +00:00
f71f09d714 Partial fix for bug 30695, "Array broke crease, weird visibility and slowdown"
* Array modifier creates BMesh from DM; add missing CD_CREASE layer
  for edge creases.

* With a modifier stack like mirror+subsurf+array, face normals were
  wrong. Fix by removing CD_NORMAL layer from CCGDM output. Previously
  the elements in this layer were simply copied, so they did not
  reflect subdivision correctly.

* Minor style fixes in bmo_dupe.c.

Issues not yet addressed:

* Subsurf's optimal draw setting for hiding subdivision edges is not
  respected by the array output.

* Slowdown issue; array modifier is much slower than in 2.62.
2012-03-27 12:34:00 +00:00
303cecf139 spelling cleanup: tesselate -> tessellate (last of these found) 2012-03-20 22:56:26 +00:00
b330abc290 remove Object member from BMesh struct - was only used for undo and BMEditMesh already stores an object pointer.
also fix for own mistake with mesh conversion refactor, shape key index was off by 1 when switching editmode.
2012-03-11 19:58:56 +00:00
702e85ef84 picky changes to mouse cursor text selection behavior, previously as soon as the mouse was before a character it would select the previous, even if the cursor was closer to the space between the next 2 chars.
now find the closest point inbetween both chars.
2012-03-09 23:10:07 +00:00
7edb514945 Actual fix for mango files crashes on load
Was caused by recent code cleanup.
2012-03-06 14:46:45 +00:00
3882f7cde7 quiet some warnings and fix build error with strict casting rules. 2012-03-06 12:51:17 +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
9aafe32147 bmmesh api - use struct rather than int[4] to initialize mesh sizes.
also correct bad assert() in previous commit.
2012-03-01 20:09:17 +00:00
fa38c3dbac bmesh code cleanup - remove most of BKE_bmesh and remove BKE_bmeshCustomData.h. 2012-02-27 21:33:30 +00:00
9a92cd8008 bmesh minor refactor
* add DM_to_bmesh_ex, DM_to_bmesh for converting a derived mesh to a BMesh (rather than a BMEditMesh)
* have a generic variable for allocsize: bm_mesh_allocsize_default, rather than copying the values about.
2012-02-12 17:44:10 +00:00
7c2715a7ad rename CDDM_To_BMesh to DM_to_editbmesh, since theres no requirement for
the input to be a CDDM.

remove conversions to CDDM for edge split and bevel (will give some
speedup).
2012-02-12 15:02:33 +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
1dc3536268 mode bmesh include cleanup, remove unused file too. 2012-02-11 10:15:11 +00:00
acd568d751 include cleanup 2012-02-11 08:46:56 +00:00
91390b712a GPL Header Cleanup 2012-02-11 04:16:17 +00:00
c1070b863b Style Cleanup 2012-02-10 18:09:19 +00:00
051cf6abf8 Style Cleanup:
replace 0/1 with TRUE/FALSE define.
2012-02-07 17:42:46 +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
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
b3938cee63 minor warning/fixes 2012-01-20 15:22:20 +00:00
fc401fd343 error in recent commit 2011-12-01 07:41:45 +00:00
f06bbaed92 split BMFlags_To_MEFlags & MEFlags_To_BMFlags into type specific calls, since we always know the types with these functions theres not much point in having generic calls with a type switch. 2011-12-01 01:41:56 +00:00