Commit Graph

124 Commits

Author SHA1 Message Date
92862f96dc code cleanup: use float sizes for function args. 2012-10-15 23:11:59 +00:00
40186a8c11 remove BLI_noise from BLI_blenlib.h, not that many files need this. 2012-10-12 00:18:32 +00:00
97d4fb4161 code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
aa49ca25d5 incorrect spelling in comments 2012-09-26 20:05:38 +00:00
25c96bc9f3 code cleanup: remove unused macros, commet some which may be useful later - or good to keep for completeness. quieted some warnings and add flags -Wmissing-include-dirs and -Wno-div-by-zero to cmake/gcc 2012-09-20 01:02:39 +00:00
7aeaeaf378 fix bug in mathutils.geometry.intersect_point_line() where 4D vectors were treated as 2D.
also change behavior to return a 2d vector when all args are 2D.
2012-08-28 11:27:46 +00:00
77f0be7fec support unary positive operators for vectors (same as numpy), so you can do 'vector_a = +vector_b', this makes a copy. 2012-08-27 13:40:19 +00:00
71d1b09708 minor code cleanup 2012-08-25 12:55:14 +00:00
41ee294618 don't pass the same value to axis_angle_to_quat() for axis & quat.
-/-This line, and those below, will be ignored--

M    mathutils_Quaternion.c
2012-07-25 16:46:46 +00:00
382ded688a Spellcheck: minkovsky -> minkowski! (Only in comments/UI messages :/ ). 2012-07-17 18:14:59 +00:00
32cf7fcdb1 code cleanup: spelling 2012-07-16 23:23:33 +00:00
84bf3e48c0 style cleanup: use c style comments in C code 2012-07-06 23:56:59 +00:00
81a509fa40 fix error in node template and quiet warning. 2012-07-03 21:03:39 +00:00
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