Commit Graph

3627 Commits

Author SHA1 Message Date
29831ca087 bmesh py api:
added per loop UV layer access
2012-03-17 06:40:44 +00:00
757c0af9c6 bmesh py api:
split up BMElemSeq into BMVertSeq, BMEdgeSeq, BMFaceSeq and BMLoopSeq

 Was becoming cumbersome since each needed their own new() function, and other methods only worked for some of these types.

Added BMesh.loops - since you cant iterate over loops this is for customdata access only.
2012-03-17 04:43:32 +00:00
70d3d1aca6 style cleanup: py/capi 2012-03-16 21:39:56 +00:00
f91407150a bmesh py api:
initial support for editing bmesh customdata per vert/edge/face/loop

shapes, crease, bevel weights working, missing UVs and Vertex Colors still.
2012-03-16 08:26:22 +00:00
ebec111618 bmesh py api:
Wrap customdata, so far you can access the data layers in a pythonic way but not manipulate the customdata yet.

provides dictionary like access to customdata layers, eg:
  texpoly = bm.faces.tex["UVMap"]
  print(bm.verts.shape.keys())  # un-intended pun, keys() works on all layers.
  print("MyInt" in bm.edges.int)  # __contains__
  layer = bm.faces.get("CheckForLayer")
2012-03-16 05:03:13 +00:00
c38e8e7a66 missed these last commit 2012-03-15 06:51:09 +00:00
6ed9c58a3d prepare for adding bmesh py api for customdata layer access - no functional changes. 2012-03-15 06:08:27 +00:00
c2d93e8d4a comment cleanup 2012-03-14 22:39:56 +00:00
ee9a00948b mathutils py api:
Vector.angle_signed(other)
  for 2D vectors to get the clockwise angle between them.

  in BLI math its called - angle_signed_v2v2()

shorthand for...

  atan2f((v1[1] * v2[0]) - (v1[0] * v2[1]), dot_v2v2(v1, v2))

also corrects compile error in last commit.
2012-03-14 06:14:15 +00:00
f15c15e992 bmesh py api: finished todo - editable select_history
eg:
  bm.select_history = vert, face, edge

  bm.select_history.add(edge)
2012-03-14 04:46:12 +00:00
f80fa54428 documentation edit to address bmesh py api bug [#30453]
warn when addons are not found when running cmake.
2012-03-14 00:30:20 +00:00
2fbb5ce833 bmesh py api: more comprehensive intro page, also fix some spelling errors. 2012-03-13 06:22:43 +00:00
a69585573e bmesh python api:
BMesh.select_history.remove/clear/validate functions.
2012-03-13 02:59:42 +00:00
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
178c2c32f2 [#30503] Callback for render job completion
from Jason van Gumster (thefallenweeble)

adds render_complete and render_cancel callbacks to bpy.app.handlers
2012-03-11 17:24:03 +00:00
7fa7e4ba1f bmesh python api additions:
- BMesh.is_wrapped
- BMesh.copy()
- BMesh.clear()
- BMesh.free()
- BMesh.from_object(obj, apply_modifiers=True)
- BMEdge.calc_length()
- BMLoop.calc_normal()
- BMLoop.calc_tangent()
2012-03-11 05:58:22 +00:00
050439fd9d bmesh py api - correct class references in docs and rename mesh conversion funcs to ne less confusing. 2012-03-11 04:07:22 +00:00
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