Commit Graph

24 Commits

Author SHA1 Message Date
c17c6557b4 PyAPI: add function to check any mathutils type
Also add CheckExact versions of type checking macros.
2017-11-29 16:13:26 +11:00
1cc4033df8 PyAPI: expose matrix parsing function 2017-08-19 21:36:50 +10:00
3df30c1a6e Cleanup: parenthesize defines 2016-06-01 00:19:01 +10:00
8106a6b75d mathutils: refactor instantiation
remove 'type' argument, very few mathutils objects are wrapped,
add new function for creating wrapped objects.

also fixes unlikely memory leak if the data-array can't be allocated.
2015-01-04 17:43:57 +11:00
e44c49d89d Py Mathutils: add invert_safe() and inverted_safe() to Matrix.
Those two mimic our BLI invert_m4_m4_safe - they add a small offset to diagonal values,
in case org matrix is degenerated, and if still non-invertible, return identity matrix.

Org patch by me, final enhanced version by ideasman42, many thanks!
2014-09-06 14:58:38 +02:00
418011907c remove nan copyrights from code added since blender become opensource (copy paste errors), also remove BKE_script.h 2013-07-02 10:14:59 +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
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
986e62f3b6 fix for a bug in mathutils when a vector was accessing a matrix and the matrix size increased, future access too the vector would write past the allocated bounds. now raise an exception. 2011-12-26 00:05:41 +00:00
2a80368005 mathtils, convenience attributes added 'row' and 'col', this makes the row/col swap a lot easier to deal with, since
now you can still use column access

previously...
  mat[2] = 1, 2, 3

needed to be converted into...
  mat[0][2] = 1
  mat[1][2] = 2
  mat[2][2] = 3

but with column access you can do...
  mat.col[2] = 1, 2, 3


Having 'row' attribute is a bit redundant since direct indexing on a matrix uses row but included for completeness.
2011-12-24 07:03:19 +00:00
28a5549ecf fix for error with matrix access and negative indices with recent row/col swap. 2011-12-24 06:13:58 +00:00
b42497b460 mathutils get/set function rename + minor changes to matrix functions (no functional changes) 2011-12-24 04:58:01 +00:00
26f69488ca Matrix.translation wrapper vector, continent accessing to matrix[3][0:3].
this is a part of patch 29534, being applied separately

from patch [#29534] Change Matrix Representation and Access in Python to Conform with Standard Notation
by Andrew Hale (trumanblending)
2011-12-21 23:12:16 +00:00
436295026a patch [#29662] Modifications to Mathutils Vectors for Consistency with Commit 42752
from Andrew Hale
2011-12-20 05:48:35 +00:00
a8ed803b66 rename internal matrix struct member vars to avoid confusion
Matrix.contigPtr --> matrix
Matrix.row_size --> num_col
Matrix.col_size --> num_row
2011-12-20 04:11:23 +00:00
53f88b231a corrections to some comments 2011-12-19 05:23:52 +00:00
c3675c0e90 remove mathutils internal variable for storing pointers to each matrix row, instead use macros to access row/column's.
also add an assert so invalid index access will raise an error in debug mode, without this it was quite easy to access invalid memory without meaning to.

no functional change.
2011-12-19 03:12:10 +00:00
083297fbf1 formatting edits (120 width max) and remove some redundant casts 2011-11-29 20:22:35 +00:00
3b9b6051d9 rename mathutils constructors to match other parts of the bpy/api (no functional changes) 2011-11-24 04:45:36 +00:00
057bf2a02b misc doc edits
- remove recently added sphinx reference workaround.
- tested doxygen, correct some warnings, set tab width and added pymathutils group.
- added convenience target 'make doc_doxy'
2011-11-05 01:48:10 +00:00
82c84f4b58 Remove some more $Id$ that still were left after r41227 and r41228. 2011-10-23 19:01:59 +00:00
6105199668 Remove the svn:keywords property. 2011-10-23 18:38:16 +00:00
3a6158a8bf move mathutils into its own lib. 2011-07-15 04:01:47 +00:00