Commit Graph

111 Commits

Author SHA1 Message Date
78ae6ac2a5 utility function to get the points inside a list of planes. 2012-06-27 09:51:22 +00:00
200584e5c6 fix for a handful of memory leaks relating to parsing and allocating arbitrary sized vectors from python args.
Vector.dot() was always leaking memory, and would crash if args sizes didnt match.

These errors were introduced with n-dimensional vector support.

also fixed an error with bmesh py api allocation.
2012-06-26 16:58:58 +00:00
e32c467713 mathutils.Vector(kw=value) wasn't raising an error as it should. 2012-06-26 14:49:49 +00:00
f5f25b81e8 style cleanup:
also fix for building ghost test and fix double free in one of the tests
2012-06-17 09:58:26 +00:00
cf0d350b51 Fixing first part of [#31760] Assignments not working properly for Object.dimensions
Problem was in fact that non-linear-contiguous axis assignement was broken (i.e. location.xy would work as expected, but location.xz would only affect .x part)... Now all possibilities should work fine.

Did not try to fix the problem specific to obj.dimension (when assigning multiple times to this array, only the last one is taken into account - in fact, a simple print() shows that assigning to dimension is not taken into account immediately), not sure whether this is normal behavior, or if we need a specific "update" of some kind for this prop?
2012-06-11 18:58:34 +00:00
5caeeec1fe Corrected documentation for intersect_point_quad_2d to match exactly how
it works in C side: only convex quads without singularities gives predictable
results.
2012-06-06 08:08:54 +00:00
63788b47d6 add vector versions of hsv_to_rgb, rgb_to_hsv & rgb_to_hsv_compat 2012-05-26 11:01:01 +00:00
2d2d36fe3b code cleanup:
- style - multi-line ifs move braces onto new lines.
- iterators - convert some to macros, other split up and move brace.
2012-05-20 19:49:27 +00:00
3ef11693f5 Style cleanup: displist module 2012-05-07 06:58:03 +00:00
4c5502bfd6 code cleanup: function naming for BLI functions. 2012-05-05 00:23:55 +00:00
112162e09e code cleanup: header cleanup 2012-04-30 14:24:11 +00:00
f88cfd9168 Code and style cleanup in own modules in BKE and also mball module
- Make sure functions are named in way BKE_<object>_<action> (same way as RNA callbacks)
- Make functions which are used by mball.c only static and remove their prototypes
  from public header file.

Further cleanup is coming.
2012-04-28 16:49:00 +00:00
49ff0eeec4 bmesh py api: expose BM_face_split_n() to the python api;
face_fill(..., coords=(v1, v2, ...))

This is the same function the knife tool uses. should be handy for dicing up geometry in py.
2012-04-22 10:19:24 +00:00
d5023f0e91 correction to py docs from mgschwan on IRC. 2012-04-22 08:36:39 +00:00
6520aa97a9 add 'idprop' module so we can document idprop.types.*, currently doc generator has no access to ID Property types. 2012-04-15 14:54:15 +00:00
1b74ec9564 fix for too small MATHUTILS_TOT_CB when the game engine runs. 2012-04-10 12:35:15 +00:00
b07f9446c7 Hopefully last change to matrix orthogonal check, touches Py API only
- is_orthogonal now checks matrix in the same way as it's defined
  by linear algebra, meaning that it'll use is_orhonormal C check
- Added is_orthogonal_axis_vectors to check if vectors which defines
  axises are orthogonal
2012-04-02 12:36:00 +00:00
26b0255049 Fix for is_orthogonal check which in fact was checking for orthonormal matrix.
Separated it into two functions so now it'll be clear if check happens for
orthonormal or just orthogonal.
2012-04-01 00:14:41 +00:00
89b83f0060 patch to add __deepcopy__ to mathutils types, this is no different to __copy__, except some py utilities expect __deepcopy__ to exist, so better have them. 2012-03-30 11:35:58 +00:00
7f1e9b8c41 bmesh py api:
added access to deform weights, access to weights acts like a python dict so you can do...

  print(group in dvert)
  dvert[group] = 0.5
  print(dvert[group])
  del dvert[group]
  print(dvert.items())
2012-03-27 10:30:10 +00:00
11d12d945e style cleanup: python api 2012-03-26 06:55:09 +00:00
5935ff3aaa fix for Quaternion.to_axis_angle() returning a zero axis vector. 2012-03-20 23:37:54 +00:00
303cecf139 spelling cleanup: tesselate -> tessellate (last of these found) 2012-03-20 22:56:26 +00:00
4f19c1a995 spelling cleanup 2012-03-18 07:38:51 +00:00
05612c0419 code cleanup: not all mathutils callback creation functions tool unsigned char for type & subtype args. 2012-03-17 22:31:57 +00:00
02f707e9da minor mathutils code cleanup - use mathutils callbacks as unsigned chars everywhere. 2012-03-17 10:46:02 +00:00
70d3d1aca6 style cleanup: py/capi 2012-03-16 21:39:56 +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
2fbb5ce833 bmesh py api: more comprehensive intro page, also fix some spelling errors. 2012-03-13 06:22:43 +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
89a963fb7f style cleanup: comment blocks 2012-03-09 18:28:30 +00:00
3590076193 style cleanup - comment formatting 2012-03-03 20:36:09 +00:00
c62a462997 use LIKELY/UNLIKELY macros for operations that run a lot. 2012-02-26 23:59:08 +00:00
6ca7d82932 code cleanup: white space, spelling & ';;' end of lines. 2012-02-25 16:04:03 +00:00
1fbd91b8a1 typo cleanup, no functional changes. 2012-02-24 06:44:04 +00:00
2b7ca2304a unify include guard defines, __$FILENAME__
without the underscores these clogged up the namespace for autocompleation which was annoying.
2012-02-17 18:59:41 +00:00
b81bfd86b4 use ValueError when vector/matrix multiplications sizes are not supported, was using TypeError for mat*vec and ValueError for vec*mat. 2012-02-11 14:27:36 +00:00
5a42ff381c correct 2 sphinx warnings. 2012-02-08 16:36:04 +00:00
1f74789d12 Correct mathutils documentation, also correct some python spelling errors and add makefile target check_spelling 2012-02-08 04:37:37 +00:00
5a221dd0de Fix for possible memory leak on creation of a vector using Vector.Range.
It was possible to allocate an array of size<2 which would then raise an error on vector creation without freeing.

Fix to ensure the behaviour of Vector.Range was the same as for builtin range() function. When specifying 3 arguments, the step argument wasn't being used to correctly calculate the vector size.

Minor formatting edits for error messages.
2012-02-02 01:07:04 +00:00
40f1686f47 Fixes to Python matrices str function.
1) The width of columns was incorrectly determined on windows, fixed by increasing the size of the dummy buf.
2) Added additional brackets to string for consistent formatting
2012-02-01 01:42:36 +00:00
54dc5f1654 apply back changes made since moving this file. 2012-01-31 05:02:24 +00:00
427cde6f16 svn cp \
https://svn.blender.org/svnroot/bf-blender/trunk/blender/source/blender/python/generic/noise_py_api.c@r42248 \
 https://svn.blender.org/svnroot/bf-blender/trunk/blender/source/blender/python/mathutils/mathutils_noise.c
2012-01-31 04:59:57 +00:00
b42feff554 previous move lost history on this file, restoring next commit. 2012-01-31 04:58:06 +00:00
e634cb2607 Add the .Identity() classmethod to mathutils matrices. This allows the user
to create an identity matrix of a specific size without having to specify
all the values in the matrix and then use the .identity() method.
2012-01-24 01:56:44 +00:00
3123ad12a3 middle mouse jump scrolling for text window. 2012-01-16 10:48:52 +00:00
3cad3521a9 Change function for nb_invert so that ~matrix returns the inverted matrix rather than inverting inplace. 2012-01-16 09:01:11 +00:00
f0e3c3c68f fixes to mathutils from Andew Hale
- docstring edits
- normalize ignores W axis as its supposed to.
2012-01-03 14:34:41 +00:00
9a37e2682d slice and iterator access for matrix.col/row so you can do...
a, b = mat.col[0:2]

  and...

  for a in mat.col: ...
2012-01-02 09:04:37 +00:00