Commit Graph

55 Commits

Author SHA1 Message Date
Campbell Barton b7174c9320 Fix connect-vertices failing for concave ngons
Also add:
- generic callback for bmesh elements.
- ability to pass an existing array to a bmesh operator.
2014-11-02 00:09:14 +01:00
Campbell Barton 95be98dd43 Comments: clarify BMLoop 2014-09-27 16:31:40 +10:00
Campbell Barton e7a6efa2a7 Code Cleanup: move delete funcs out of bmesh_construct.c into own file 2014-01-17 09:21:30 +11:00
Campbell Barton 648f2102d8 update bmesh doxy docs, remove double-promotion warnings in remove-strict-flags cmake macro. 2013-09-08 06:55:58 +00:00
Campbell Barton f6b37f34ec code cleanup:
- add missing headers from cmake (own omission)
- quiet rna_test.c unused define warnings.
- minor style edits
- spelling corrections and ignore all uppercase words with spell checking script.
2013-09-05 19:56:49 +00:00
Campbell Barton 6cba2b8d73 move bmesh tools into their own include,
changes to tool args would rebuild far too many files and these are mainly by modifiers outside of bmesh.
2013-08-23 04:22:07 +00:00
Campbell Barton e97f979f73 new bmesh operator bisect_plane, cuts a mesh in half, takes a user defined plane as an argument, handles concave ngons which need multiple cuts. 2013-08-22 17:56:08 +00:00
Campbell Barton 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
Campbell Barton ef8ea14f45 rewrite edgenet fill bmesh operator.
previous code created faces with mixed face-flipping and could get very slow,
test with ~60,000 edges here hung my system for over 2min (didnt wait for it to finish), new code executes in about 1 second.

new code doesn't attempt to flip faces correctly, its quite involved to do so, especially when the new faces are not created adjacent to eachother.
so simpler to calculate normals afterwards.
2013-08-16 14:18:54 +00:00
Campbell Barton 5a9c012d86 fix for bug in rip tool, isolated verts would remain selected after ripping. 2013-08-13 01:52:36 +00:00
Campbell Barton 48fd740096 edit-mesh improvements to select shortest path
- Ctrl+RMB only worked for edges & faces
- Menu item 'Select Shortest Path' only worked for vertices.

Now Ctrl+RMB works for vertices and the menu item works for verts/edges/faces (depending on the current selection).
2013-06-04 01:23:51 +00:00
Campbell Barton 55f929ab3d - add generic edge-loop utility functions for bmesh.
- rewrite bridge tool to use the new functions (using edge & vertex arrays was quite cumbersome).
2013-05-11 14:40:03 +00:00
Thomas Dinges 858ff6b696 Fix for [#34898] Typo in error message of mathutils.Vector
* Also fixed some more cases of "more then" -> "more than".
2013-04-07 15:09:06 +00:00
Campbell Barton 37489d71c7 Triangulate modifier no longer uses bmesh operator api call, instead add a BM_mesh_triangulate() function. Gives ~2x speedup in my tests on an optimized build. 2013-01-29 10:31:05 +00:00
Campbell Barton e0388a881b fix for own error with unwrap selection checking uvedit_have_selection() failed with no UV layer.
also add some safety checks for BM_ELEM_CD_GET_* macros.
2013-01-14 08:02:06 +00:00
Nicholas Bishop 2e9cb31c02 Add BMLog for efficiently storing changes to vertices and faces
The BMLog is an interface for storing undo/redo steps as a BMesh is
modified. It only stores changes to the BMesh, not full copies.

Currently it supports the following types of changes:
- Adding and removing vertices
- Adding and removing faces
- Moving vertices
- Setting vertex paint-mask values
- Setting vertex hflags
2012-12-30 18:24:08 +00:00
Campbell Barton 4401ac8c9e finish moving bevel code out of the operator dir (it works again) 2012-11-18 08:35:27 +00:00
Campbell Barton 916039f520 move decimator into tools/ dir 2012-11-18 08:16:09 +00:00
Campbell Barton e648542872 decimate modifier rewrite to use bmesh (#ifdef-disabled by default for now).
- maintains quads & ngons
- supports some customdata (weight paint for example works fine).

TODO
- add suppory for loop data (UV's / VCol's).
- outputs invalid geometry when heavily reducing some meshes, needs to be made stable in these cases.
2012-10-19 07:31:51 +00:00
Campbell Barton 47ec91e8d3 code clenup: comments and some style edits on ghost/osx (odd indentation) 2012-09-06 02:10:09 +00:00
Campbell Barton 3896ad4cbb code cleanup: spelling 2012-05-20 21:23:26 +00:00
Campbell Barton 2118d3c19c code cleanup: bmesh comments/todos, no functional changes. 2012-04-26 08:27:50 +00:00
Campbell Barton 384f87cd1c rip tool wasnt working on a single edge selection in some cases (own error in recent fix). 2012-04-19 23:16:57 +00:00
Campbell Barton 3c11379e26 code cleanup: move bmesh inline funcs to headers (avoids compiling the C files). 2012-03-24 01:24:58 +00:00
Campbell Barton 675628d24d bmesh: debugging function to help resolve issues with corrupt mesh data - BM_mesh_validate() 2012-03-22 05:13:43 +00:00
Campbell Barton b56d2f9766 fix [#30623] user-defined render presets bug
this report exposed multiple bugs in blender when using a non utf8 compatible home directory.

- bpy.utils.script_paths() would crash when homedir wasn't utf8 (reported bug)
- PyC_DefaultNameSpace() - would raise an error when running when __file__ was non utf8.
- preset filepath property was not set to accept non utf8.
- bpy.paths.display_name would raise an error on non utf8 paths, (used for preset draw)
2012-03-21 22:29:49 +00:00
Campbell Barton b15255e820 move some bmesh headers into intern/ since they are not used externally. 2012-03-21 12:08:16 +00:00
Campbell Barton 9dd0c4c232 rename define BM_INLINE -> BLI_INLINE to avoid confusion with bmesh defines. 2012-03-20 08:42:26 +00:00
Campbell Barton 4f19c1a995 spelling cleanup 2012-03-18 07:38:51 +00:00
Campbell Barton e09ab8883c bmesh:
- moved mesh conversion functions into their own file.

bmesh py api:
- can now create a new empty bmesh without first creating mesh data.
- added function to copy bmesh data back to a mesh.
- bmesh.from_mesh() can now get a mesh which isnt in editmode.
2012-03-10 20:41:19 +00:00
Campbell Barton 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
Campbell Barton ea13ec1699 Spelling Cleanup 2012-03-01 12:20:18 +00:00
Campbell Barton 2a7f1af61e Code Cleanup:
- apply some rules for function naming conventions, added to main bmesh doc in bmesh.h.
- remove unused function BM_loops_to_corners().
2012-02-28 19:10:53 +00:00
Campbell Barton d1d11bbe9b more header re-arranging.
Some function comments were in headers, some in the C files, some in both.
Moved function comments from headers into the C files.
2012-02-28 18:28:30 +00:00
Campbell Barton df0f0c63d3 bmesh: re-arrange headers 2012-02-28 16:47:12 +00:00
Campbell Barton c48a5fd821 code cleanup,
- bmesh_newcore.c -> bmesh_core.c.
- add bmesh_interp header.
2012-02-28 16:29:48 +00:00
Campbell Barton 7536bcbe70 Code Cleanup: bmesh
* remove unneeded struct's from headers.
* give argument names for return ** pointers r_ prefix.
2012-02-28 07:42:48 +00:00
Campbell Barton d2cab3e8b0 move bmesh wiki docs into bmesh header and update doxygen.
also have doxygen ignore *.py files and fix some warnings.
2012-02-27 20:27:19 +00:00
Campbell Barton 4c3e3e93a9 bmesh minor api edits to be a little more typesafe. 2012-02-27 14:57:09 +00:00
Campbell Barton 130668b12f minor bmesh api naming edits. 2012-02-27 14:07:19 +00:00
Campbell Barton e17bf02c2d Code Cleanup:
* made bmesh_structure.h function names more consistant.
* remove unused code in bmesh_structure.c
* removed 'Edge Flip' operator (missing from bmesh but looked into trunk feature and dont think its worth keeping).
* tagged  some BMESH_TODO's
2012-02-27 13:47:53 +00:00
Campbell Barton 3ba37b65a3 style cleanup 2012-02-26 22:38:49 +00:00
Campbell Barton 7068fee2dd fix for a bmesh glitch when making a face (Fkey).
On a place, Ctrl+T, Fkey would create a quad overlapping the 2 Tris.

Now this case is checked for in a general way - if the bounds of the face are already filled in with faces (that _only_ use these edges-verts), then dont create the face.

This is an option for the 'edgenet_fill' operator, since creating the face isnt incorrect, just not-what-you-want mostly.

added functions
* BM_edge_share_vert - returns shared vert between 2 edges.
* BM_face_exists_multi, BM_face_exists_multi_edge - check if existing faces fill the edge bounds.
* also add BM_ELEM_INTERNAL_TAG so low level functions can tag without conflicting with higher level functions that also rely on tagging elements.
2012-02-26 21:32:20 +00:00
Campbell Barton 03f5758b48 replace BMESH_ERROR with BMESH_ASSERT, most areas it was used are better suited to an assert anyway.
also tag all error cases as UNLIKELY() for better branch prediction.
2012-02-26 16:39:21 +00:00
Campbell Barton 62f9959a8e replace bmesh_error with macro that gives the file/line/func the error happens on. 2012-02-26 14:57:41 +00:00
Campbell Barton 1004b03578 bmesh - remove faces with <3 sides after dissolve/collapse (most tools already did this). 2012-02-26 05:48:12 +00:00
Campbell Barton b4b7d809f1 bmesh code cleanup
* minor edits to header
* make BM_vert_dissolve() easier to read.
2012-02-25 23:41:31 +00:00
Campbell Barton c65b3b73fd bmesh api cleanup
* better type safety for BM_elem_flag_* and BM_elem_index_* functions.
* add BMElem type to be used where BMFace/Edge/Vert/Loop can be interchanged.
* fix bug in select manifold, found when making functions more strict.
2012-02-25 22:23:40 +00:00
Campbell Barton 55e68985e7 bmesh api:
* added BM_elem_flag_set, BMO_elem_flag_set. to avoid 'if(...) enable(); else disable();' all over the place.
* added bmesh_operator_api_inline.c, the header file was getting messy.
2012-02-25 19:43:51 +00:00
Campbell Barton 1fbd91b8a1 typo cleanup, no functional changes. 2012-02-24 06:44:04 +00:00