Commit Graph

3609 Commits

Author SHA1 Message Date
21fd09c028 bmesh py api: change .from_mesh() / .to_mesh() to be class methods of BMesh rather than functions in the module.
added example script which converts a mesh to a bmesh, edits and converts back again.
2012-03-11 02:45:27 +00:00
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
4dc35836ad code cleanup: remove unused variable assignents and added bmesh submodule links, doc correction reported by dfelinto. 2012-03-09 21:23:15 +00:00
89a963fb7f style cleanup: comment blocks 2012-03-09 18:28:30 +00:00
4f7bdc59d3 style cleanup: spelling.
also remove large, duplicate comments from sunsky.h
2012-03-09 00:41:09 +00:00
27d43f3fd3 added API function to C and python
* C:  BM_vert_separate(...)
* py: bmesh.utils.vert_separate(vert, edges)

This splits off regions around the vertex, splitting on connected edges passed in a sequence.

also made minor changes
- rename python api functions _rip to _separate
- fixed bmesh iterator being iterable its self (some parts of python expect this)
- fix memory leak in bmesh python api.
2012-03-09 00:01:38 +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
Nathan Letwory
41bed8e04c Add missing include. 2012-03-08 10:52:30 +00:00
79d97ca509 style cleanup - spelling. 2012-03-08 04:12:11 +00:00
1c91d62c7e use BLI_path_cmp() rather then strcmp() 2012-03-08 02:19:41 +00:00
d1937de1d2 fix for own error in edge-rotate keeping edge customdata - this was crashing when rotating multiple edges.
Now create the rotate edge in advance and copy its customdata (before joining the faces).

This commit also fixes an annoyance where tryangulating faces could create duplicate edges.
2012-03-06 19:29:05 +00:00
31d2ee9bf7 style cleanup, brackets in else/if, some indentation. 2012-03-06 18:40:15 +00:00
4b940364a1 edge rotate now keeps edge properties (like seam, crease, bevel weight.. etc) 2012-03-05 01:53:30 +00:00
4d84e869a0 Improvements to bmesh edge rotate
On a user level, edge rotate now works better with multiple edges selected, it wont make zero area faces or rotate edges into existing ones.

With a single edge selected - rotate is less strict and will allow ugly resulting faces but still checks on duplicate edges.

API:
* BM_edge_rotate now takes a flag, to optionally...
** check for existing edge
** splice edge (rotate and merge)
** check for degenerate resulting faces (overlapping geometry, zero area)
** beauty - only rotate to a better fit.
... this allows it to still be used as a low level API function since all checks can be skipped.

* BM_edge_rotate() now works a bit different, it find the new edge rotation before joining the faces - exposed by BM_edge_rotate_calc().

* Added api call bmesh_radial_faceloop_find_vert() - Radial Find a Vertex Loop in Face
2012-03-05 00:50:18 +00:00
34db81a6dc fix for missing NULL check in bmesh.from_mesh(), bug [#30446] 2012-03-04 11:10:11 +00:00
4f2976941f fix for issue raise by patch [#30154] non utf8 buildinfo, fails to import 'bpy' module.
we cant ensure buildinfo to have utf8 encoding so access it as bytes via python - a different workaround then this patch made.

also use C style string formatting for sys_info.py
2012-03-04 03:14:38 +00:00
88e0bcfbe1 fix for crash in bmesh py api, was missing NULL checks for parsing sequences and had bad string formatting in exception. 2012-03-04 02:09:02 +00:00
1531e3677a bmesh py api
* add BLI_rfindlink for reverse index lookup (used so bm.select_history[-1] doesn't have to loop the entire list twice).
* add bm.select_history.active so you can get the last selected item or None without having to check seq length.
2012-03-03 22:07:58 +00:00
3590076193 style cleanup - comment formatting 2012-03-03 20:36:09 +00:00
9d49fa0e63 style cleanup - spelling corrections & update some incorrect comments. 2012-03-03 11:45:08 +00:00
95bba22af0 fix for error report in property registration, it wasnt printing the error. 2012-03-03 00:20:05 +00:00
e9c935caa0 fix bug [#30426] crash in bmesh python api.
if blender freed the BMesh before python was finished (on exit editmode for eg), python would attempt to access the bmesh to clear python pointers in it.
2012-03-02 18:23:08 +00:00
ea13ec1699 Spelling Cleanup 2012-03-01 12:20:18 +00:00
fc84402632 Mistake in previous commit test for API vert new: it failed for no-arg case. 2012-02-29 15:35:10 +00:00
7cc206ddca Code Cleanup: remove non existing function declarations.
added some missing functions too - which are not used yep but should be there for api completeness.
* CDDM_set_mloop
* CDDM_set_mpoly
* BLI_mempool_count
2012-02-29 15:00:37 +00:00
d330efa084 Fix 30401: Python API vert new((0,0,0)) crashes.
Thanks to Campbell for fix, adding an & to an arg.
Also needed to negate the sense of a later test.
2012-02-29 14:16:35 +00:00
17ee9f77c5 bmesh py api - initial support for selection history. 2012-02-29 14:05:03 +00:00
6dcbba943b bmesh py api - element hide_set() function which flushes hidden state. 2012-02-28 05:02:34 +00:00
96e0f18850 bmesh py api - loop vert/edge/face attributes. 2012-02-27 15:20:54 +00:00
47c373c7a9 style cleanup (mostly whitespace) 2012-02-27 10:35:39 +00:00
c62a462997 use LIKELY/UNLIKELY macros for operations that run a lot. 2012-02-26 23:59:08 +00:00
3ba37b65a3 style cleanup 2012-02-26 22:38:49 +00:00
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
74e9563b8a * bmesh py api BMEdge.verts was using 2 v1's
* bmesh pu api __repr__ functions for mesh data.
* correct py hash defines.
2012-02-26 17:20:36 +00:00
d82c768cc7 bmesh py api, add another interpolation function.
BMVert.copy_from_vert_interp(vert_pair, fac)
2012-02-26 07:16:50 +00:00
1004b03578 bmesh - remove faces with <3 sides after dissolve/collapse (most tools already did this). 2012-02-26 05:48:12 +00:00
76acda4417 bmesh python api
* BMLoop attributes link_loop_next/prev
* BMVert.copy_from_face_interp
2012-02-25 23:56:20 +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
3fc2fbc333 style cleanup, use { on newline after function definition.
spelling 'impliment' -> 'implement'
2012-02-25 16:49:59 +00:00
6ca7d82932 code cleanup: white space, spelling & ';;' end of lines. 2012-02-25 16:04:03 +00:00
05725e7b6e bmesh py api - add funcs
* BMFace.copy_from_face_interp(face)
* BMLoop.copy_from_face_interp(face, vert=True, multires=True)

These are important for rebuilding geometry from existing faces without loosing UV's, vcols etc.
2012-02-25 15:51:39 +00:00
69cf6adb84 fix for own regression in r44361 (broke BM_vert_in_face)
also fix py api: bmesh.utils.face_split(face, v1, v2)
2012-02-25 14:56:37 +00:00
aca448f0b6 bmesh py api - fix for error creating a new face 2012-02-24 13:50:36 +00:00
f7c9485605 bmesh python api:
bm.verts.get(verts) / bm.faces.get(verts)

 - use to find an edge or face from a vertex list passed.
2012-02-24 12:57:05 +00:00
c839ff3acb bmesh py api - bmesh.utils.face_flip 2012-02-24 11:04:09 +00:00
068566f985 bmesh py api - normal_update() functions for vert/edge/face. 2012-02-24 10:35:52 +00:00
c8d6b7759e bmesh py api, minor change - edges now take a seq of 2: bm.verts.new((v1, v2), example=None) 2012-02-24 10:17:30 +00:00
edb04d1461 bmesh docs now written in sphinx doc generator.
* http://www.blender.org/documentation/blender_python_api_2_62_0/bmesh.types.html
* http://www.blender.org/documentation/blender_python_api_2_62_0/bmesh.utils.html
2012-02-24 09:53:29 +00:00
1fbd91b8a1 typo cleanup, no functional changes. 2012-02-24 06:44:04 +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