Commit Graph

67 Commits

Author SHA1 Message Date
89f5a09ab4 Cleanup: use 8 space indent for multi-line args 2015-04-25 20:15:20 +10:00
b7f5ab0cd3 ShapeKeys: Add BKE_keyblock_is_basis to check whether a given keyblock is used a basis by others.
Also fix stupid debug-only error in previous commit.
2014-11-17 11:19:54 +01:00
7d040d2a08 Cleanup: use BLI_listbase_*** prefix for count,sort,sort_r 2014-11-16 13:57:58 +01:00
b82e84f179 BMesh: we actually can set loop indices too while converting from Mesh to BMesh... 2014-06-23 16:21:53 +02:00
2108a61691 BMesh: minor optimizations for shapekey lookups on conversion 2014-04-23 00:49:28 +10:00
0b7f581397 Split Normals I (2/5): Add basic BMesh support of split normals.
* Merely a re-implementation of core split algorithm for BMesh, taking advantage of topological data available.
* This code needs valid loop indices, so added BM_LOOP support to BM_mesh_elem_index_ensure() & co.

Reviewers: campbellbarton

Reviewed By: campbellbarton

CC: brecht

Differential Revision: https://developer.blender.org/D366
2014-04-13 12:25:54 +02:00
747ba571a1 Fix T39550: polygons.active has bad default 2014-04-02 06:40:39 +11: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
cdac157f4c code cleanup: use iterator macros, and replace BM_LOOPS_OF_FACE with direct loop access when converting a bmesh to a mesh. 2013-07-24 18:38:55 +00:00
c0c9f5386b fix [#35507] BMesh module: Crash on to_mesh() if faces.layers.tex is used but no loops.layers.uv 2013-06-26 04:17:41 +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
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
eec0d2ee53 Removed ME_CDFLAG_FREESTYLE_EDGE and ME_CDFLAG_FREESTYLE_FACE from Mesh::cd_flag.
Suggested by Campbell Barton through a review comment of the Freestyle branch.
2013-04-01 18:32:19 +00:00
29b7b344fc svn merge ^/trunk/blender -r55357:55372 2013-03-18 21:45:29 +00:00
c1ceab1281 Merged changes in the trunk up to revision 55357.
Resolved conflicts:
release/datafiles/startup.blend
source/blender/editors/space_nla/nla_buttons.c

Also updated source/blender/blenkernel/intern/linestyle.c as a follow-up of
recent changes for the use of bool.
2013-03-18 00:48:59 +00:00
3dababa7ec code cleanup: name mesh functions more consistently, also use bools for mesh args. 2013-03-17 19:55:10 +00:00
894c240f9d New implementation of Freestyle edge/face marks
The previous implementation of Freestyle edge/face marks was refactored
based on suggestions from the latest code review by Campbell.  The new
implementation relies on mesh CustomData to store edge/face marks, instead
of introducing extra flags in the core Mesh and BMesh data structures.
The CustomData-based implementation will allow further additions of new
edge/face attributes because of the independence from Mesh/BMesh.

This revision is work in progress, mainly intended to address the review
comments and ask for further code review in view of the trunk merger in
the upcoming 2.67 release.
2013-03-13 06:44:43 +00:00
ddddb7bab1 code cleanup: favor braces when blocks have mixed brace use. 2013-03-09 03:46:30 +00:00
4e94fca896 fix for error in own recent change, sculpt triangulate was done on a bmesh with uninitialized faces normals,
add warning that BM_mesh_bm_from_me() dosn't calculate face normals.
2013-02-03 08:13:15 +00:00
38825f891e use openmp for building bmesh arrays, also replace calloc with malloc. 2013-01-19 02:21:53 +00:00
5ddc7d64a8 optimize bmesh operations that use triangle BMFace's (dyn-topo and mesh conversion). 2013-01-16 21:09:54 +00:00
b27854bd47 use booleans for bmesh api. 2013-01-14 16:42:43 +00:00
fae67b6fb3 fix own bug, edge crease and bevel weights lost on undo. 2013-01-14 12:14:08 +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
ca64979236 fix own mistake in recent commit - entering editmode with a shape key crashed. 2012-11-30 14:27:25 +00:00
ce3ea8942c remove unneeded mesh->bmesh conversion code that copied BMLoop data in a separate loop (since there is no longer pre-allocated loop data on the new BMLoops). 2012-11-29 16:36:16 +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
12ed0c64bc make use customdata typeoffset more, add an assert to ensure its to date. 2012-10-31 09:50:24 +00:00
c9c76a9a68 add compiler hints that failing to create a bmesh face is unlikely. 2012-10-01 11:12:49 +00:00
0d5d2146eb code cleanup: make shape key api names consistent with our new convention. 2012-09-19 10:12:07 +00:00
0dd42fd513 Fix #32387: some mesh modifications breaking other shape keys.
The vertex shapekey index is now no longer copied, and propagation of offsets
in the basis to other shapekeys is disabled if new vertices were added. The
reason being that the propagation will only be done for the old vertices leaving
the new ones behind, and so doing e.g. subdivide + translate on the basis would
create a mess on other shape keys.
2012-08-23 13:54:30 +00:00
74c9c24d27 style cleanyp 2012-06-23 23:22:19 +00:00
3289628610 fix [#31489] EdgeSplit modifier prevents All Edge to be work correctly since 2.63
bmesh regression where the edge-draw flag was cleared when bmesh modifiers were used.
2012-05-22 07:26:45 +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
03f451f2f1 fix own error with subdivision (broke icosphere), also noticed icosphere vanished at subd-5 which didnt happen before bmesh. 2012-04-23 23:01:03 +00:00
2e20d3dc96 fix for error using uninitialized variable with shape key conversion. 2012-04-20 18:34:58 +00:00
b26865ba99 code cleanup: prefer BM_face/edge/vert_select_set() over BM_elem_select_set() when the type is known (saves switch statement check on the type).
Add asserts so the correct types are ensured.
2012-04-20 16:55:47 +00:00
b40476455e code cleanup: remove unused BMesh args. 2012-04-19 14:38:09 +00:00
475ecbb0ce remove BM_ITER, BM_ITER_INDEX macros, use ELEM or MESH variants only (the maceros had unused args in both cases). 2012-04-19 13:47:58 +00:00
75b869e428 style cleanup: BM_ITER / BM_ITER_INDEX / BMO_ITER 2012-04-19 11:44:12 +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
405c9d9a95 code cleanup: remove unused KeyBlock.adrcode 2012-04-12 11:50:43 +00:00
ca8fd669a4 bmesh shape key conversion.
- remove print for impossible error.
- add NULL check incase bmesh and mesh get out of sync (would crash if Basis key-block couldn't be found).
2012-04-12 11:27:50 +00:00
115e762556 bmesh exit editmode: when a mesh shape-key customdata layer exists but the shape-key-block isnt found, creating a shape key was allocated and inline - it didnt set the name or uid, Now use add_keyblock() as every other function does. 2012-04-12 11:11:31 +00:00
30888ac25c doxygen docs explaining whats going on with shape-key conversion. 2012-04-12 06:52:50 +00:00
c8b19b7b7f fix [#30771] Shapekeys: Basis shapekey is not kept in sync with "RealMesh"
behave the same as in 2.4x.

- merge BMesh / Pre-BMesh code shape key conversion code, old code was called as a fallback but merge instead.
- fix possible crash - new bmesh code was clamping the vertex index for the oldverts array by the new total number of verts.
2012-04-11 15:59:50 +00:00
1f6369fd41 bmesh shape key conversion on exiting editmode.
there were 2 blocks of code (both calculating the offset array), now move the fallback method into the main key conversions block.
2012-04-11 15:24:13 +00:00