Commit Graph

236 Commits

Author SHA1 Message Date
8646bb4464 workaround [#30480] Knife tool flicker
the problem was numeric precision when in ortho mode the start/end points for the view vector would be 2000 apart which caused trouble for the intersection test.
2012-03-13 01:11:08 +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
7f34653f59 style cleanup: + some warning fixes, also remove unused metaelem extern. 2012-03-10 22:00:55 +00:00
4251746382 some code cleanup for rip tool. 2012-03-09 04:10:19 +00:00
78d73eb155 BMesh: rewrite edge split code (used by edge split modifier and rip tool)
this fixes but [#30461] where the same vertex was added to some faces twice.

Previous code rebuilt all faces around the split edges, replace this with much simpler code that uses existing bmesh API for splitting.

This also gives a performance boost to the modifier (over 30x faster in the bug-report file).
2012-03-09 03:16:39 +00:00
4f7bdc59d3 style cleanup: spelling.
also remove large, duplicate comments from sunsky.h
2012-03-09 00:41:09 +00:00
c82c456247 bmesh py api, new functions:
* bmesh.utils.face_vert_rip(f, v)
* bmesh.utils.loop_rip(l)
2012-03-08 20:00:37 +00:00
081aa382ed fix
- access to a meshs editmesh before the pointer was checked to be a mesh.
- uninitialized memory use in transform (not a problem practically but nice to quiet the error in valgrind).
2012-03-08 01:22:49 +00:00
52db32bb53 fix for 2 crashes from missing NULL checks. 2012-03-08 00:23:28 +00:00
bdf731f03d Patch [#30476] small 3 line patch to add the option 'NOT EQUAL TO' to the select faces by number of vertices operator
"This patch adds "Not Equal To" to the list of options for selecting faces based on the number of vertices. While the equivalent can indeed be achieved by using "Equal To" and invert selection, having this option allows for a smoother work-flow when adjusting the number of vertices to be compared."
2012-03-07 07:32:15 +00:00
b563870fd9 use a better method if picking the rip vertex to use, rather then finding the edge closest to the mouse, find the face corner attached to the vert - thats closest to the mouse, this way ripping gives predictable outcome. 2012-03-07 04:20:30 +00:00
4fe4cfdb88 revert own commit r44684 it broke edges with one vertex on a boundry 2012-03-07 03:46:30 +00:00
04beeea9c9 single vertex rip wasn't finishing with the best vertex selected. 2012-03-07 02:46:58 +00:00
6eb6877cdd minor improvement to Rip tool side calculation, measure distance to the edge line segment rather then midpoint. 2012-03-07 01:14:20 +00:00
f11d7a426f fix for bug in ED_view3d_project_float that only effected the 'Rip' tool.
when the source and destination vectors were the same pointer, the X value would get overwritten.

now the rip tool uses the best side to grab as in trunk.
2012-03-07 01:06:18 +00:00
400a0297b0 - simplify rip code not to expand/contract selection.
- disable BVH edge visibility test (ifdef'd out. dont think its really needed)
2012-03-07 00:08:00 +00:00
7b7214c722 code cleanup - give edge split more helpful var names and replace edgetag macros with static functions. 2012-03-06 17:23:26 +00:00
a0ab2eefb9 * rename BM_face_other_loop --> BM_face_other_edge_loop
* optimize BM_face_other_edge_loop to do about half as many iterations for quad heavy meshes, with ngons the gain is much more since searching around the entire ngon when the edge already stores its loop is silly.
 ... also nicer in cases where edge has no face users it avoids a loop on all face corners.
2012-03-04 16:36:31 +00:00
76e9f91d1c switch arg order for BM_face_other_* funcs (make face come first), and add nice ascii art for BM_face_other_vert_loop since this stuff is hard to grasp as text. 2012-03-04 16:01:02 +00:00
d99888d786 bmesh: add back feature from 2.4x Ctrl+Shift+T subdivides quads in the alternate direction. 2012-03-04 02:18:17 +00:00
a2c182e923 style cleanup - use aligned * prefixed blocks for descriptive comments (was already used a lot and part of proposed style guide). 2012-03-03 16:31:46 +00:00
cbc07986b5 bmesh support for rotating multiple edges at once. 2012-03-03 12:49:03 +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
cf927d3fd1 bmesh minor changes
* dont check selection and hiddent state (select + hide isnt allowed and api ensures this)
* MESH_OT_noise had incorrect check for texture (checked if slot [0] was filled but then used active texture)
2012-03-02 10:49:15 +00:00
921a7556fb bmesh - changes to mempool allocations
* double default edge allocation size (double the number of verts/faces).
* CustomData_bmesh_init_pool was using allocsize & chunksize as the same variable. Now use type specific chunk size.
* bmesh copy and editmode conversion now allocate the BMesh mempool size needed for the entire vert/edge/loop/face arrays since its known already.
2012-03-01 22:17:04 +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
522b73a635 bmesh api:
* name bmesh operator func's BMO_slot_buffer_* rather then BMO_slot_* since it wasnt obvious some only dealt with buffer, some both.
* more typechecks and asserts of BMO_ functions (I lost some time calling a map with a buffer function that failed silently).
* small speedup for extrude check - test if the edge is wire _before_ doign a hash lookup.
2012-03-01 17:38:04 +00:00
64007f5625 bmesh regression with extrude.
Extruding an edge where both verts were clipped would not create a face for this edge.

This is ok when a connected face is also extruded but not when the edge is selected on its own.
2012-03-01 16:12:11 +00:00
4a5078d6c9 style cleanup
* add extra argument to BMO_slot_map_to_flag() to filter by vert/edge/face
* made BMO_slot_map_* / BMO_slot_buffer_* functions stricter with type checking.
2012-03-01 16:04:37 +00:00
df0f0c63d3 bmesh: re-arrange headers 2012-02-28 16:47:12 +00:00
b0a09bfab3 code cleanup:
use bmo_* prefix for operator defs, was confusing with bmesh_* api functions.
2012-02-28 09:48:00 +00:00
49adbe3ab8 Various fixes to UI messages (among other things, all messages needed it should now be capitalized). 2012-02-27 18:14:56 +00:00
4c3e3e93a9 bmesh minor api edits to be a little more typesafe. 2012-02-27 14:57:09 +00:00
130668b12f minor bmesh api naming edits. 2012-02-27 14:07:19 +00:00
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
47c373c7a9 style cleanup (mostly whitespace) 2012-02-27 10:35:39 +00:00
3ba37b65a3 style cleanup 2012-02-26 22:38:49 +00:00
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
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
6ca7d82932 code cleanup: white space, spelling & ';;' end of lines. 2012-02-25 16:04:03 +00:00
6b85b96952 bmesh py api (some api changes and doc additions)
* remove 'select' and 'hide' from BMLoop
* remove BMesh.update
* add BMesh.normal_update(skip_hidden=False)
* add BMElemSet.index_update(), eg: bm.verts.index_update()


bmesh api
* BM_mesh_normals_update() now takes skip_hidden as an argument
(previously this was default behavior), however this isnt good when
using BMesh modifiers, where you want all normals to be recalculated.
* add bm_iter_itype_htype_map[], to get the iter type from a BMesh
iterator.
2012-02-24 05:56:06 +00:00
107795af49 bmesh split tool (Ykey), was only splitting off faces, unlike EditMesh which could also split edges.
make this behavior optional and default to off (match EditMesh).
2012-02-23 16:00:53 +00:00
c6f340e6b0 previous fix wasnt working in edge mode, now selection +/- works in vert/edge/face modes. 2012-02-23 15:47:18 +00:00
df83ce61bc fix 2 small bugs
* Ctrl+Click extrude wasnt normalizing the quaternion (was printing warnings)
* bmesh bevel was supposed to add a float layer and remove, but removing passed the mask define of the customdata layer.
2012-02-22 14:55:12 +00:00
ccfcc70c8c add slice access to bmesh sequences.
eg:
 verts = bm.verts[1:-7]
2012-02-22 12:54:53 +00:00
5123238f7d BMesh-py attributes (readonly):
* is_valid (all types)
* is_wire (verts/edges)
* is_boundry (edge only)
* is_manifold (verts/edges)

also corrected own error, missed updating BMesh operator formatting char (broke erase only-faces)
2012-02-22 12:28:32 +00:00
3bcca01c24 Another fix for using boolean slot as integer. This time in dissolve operator. 2012-02-20 15:58:01 +00:00
1953f042e6 added boolean type for bmesh operators, will make python wrapping clearer and also makes existing calls more obvious.
also corrected some error reports.
2012-02-20 01:52:35 +00:00
818e19713a fix [#30266] B-Mesh: Issue with Weight Painting
thanks to Nicholas Bishop for finding the cause of the problem.


don't tesselate on load, this means me->mface will be NULL by default.

we may need to have this set if existing uses of this array are not resolved before release - so add a define USE_TESSFACE_DEFAULT, to change this easily.


this is a rather indirect fix - need to take care here.
2012-02-20 00:18:35 +00:00