Commit Graph

32 Commits

Author SHA1 Message Date
Campbell Barton 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
Campbell Barton 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
Campbell Barton 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
Campbell Barton 1b74ec9564 fix for too small MATHUTILS_TOT_CB when the game engine runs. 2012-04-10 12:35:15 +00:00
Campbell Barton 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
Campbell Barton 11d12d945e style cleanup: python api 2012-03-26 06:55:09 +00:00
Campbell Barton 02f707e9da minor mathutils code cleanup - use mathutils callbacks as unsigned chars everywhere. 2012-03-17 10:46:02 +00:00
Campbell Barton 70d3d1aca6 style cleanup: py/capi 2012-03-16 21:39:56 +00:00
Campbell Barton 89a963fb7f style cleanup: comment blocks 2012-03-09 18:28:30 +00:00
Campbell Barton 3590076193 style cleanup - comment formatting 2012-03-03 20:36:09 +00:00
Campbell Barton c62a462997 use LIKELY/UNLIKELY macros for operations that run a lot. 2012-02-26 23:59:08 +00:00
Campbell Barton 1fbd91b8a1 typo cleanup, no functional changes. 2012-02-24 06:44:04 +00:00
Campbell Barton 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
Campbell Barton 67effc8aef use docstrings for mathutils getset's, also some formatting edits, no functional changes. 2011-12-25 11:36:26 +00:00
Campbell Barton f3ac865cc0 picky formatting of mathutils 2011-12-24 13:26:30 +00:00
Campbell Barton 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
Campbell Barton 28a5549ecf fix for error with matrix access and negative indices with recent row/col swap. 2011-12-24 06:13:58 +00:00
Campbell Barton b42497b460 mathutils get/set function rename + minor changes to matrix functions (no functional changes) 2011-12-24 04:58:01 +00:00
Campbell Barton 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
Campbell Barton 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
Campbell Barton 3d8ee28750 __str__ functions for other mathutils types 2011-12-20 03:37:55 +00:00
Campbell Barton 9c9099a805 formatting edits in py api, no functional changes 2011-12-18 08:50:06 +00:00
Campbell Barton 414370b8d4 Support for arbitrary sized vectors - (was limited by 2-4 previously)
patch http://codereview.appspot.com/5482043
from Andrew Hale

* Text from the submission *

This patch adds the ability to use arbitrary sized vectors from mathutils.
Currently vectors are only of size 2, 3 or 4 since they are generally restricted
to geometric applications. However, we can use arbitrary sized vectors for
efficient calculations and data manipulation.
2011-12-18 07:27:11 +00:00
Campbell Barton 083297fbf1 formatting edits (120 width max) and remove some redundant casts 2011-11-29 20:22:35 +00:00
Campbell Barton f95d7c9e66 patch [#29421] Python Noise Module Updates
from Andrew Hale (trumanblending)

Tracker description
*******************

The current python noise module included with Blender has yet to be updated to the new Py API. This patch does so, with the following major points:

- The noise module has now been moved to a submodule of mathutils, it can be accessed by mathutils.noise. It was moved from it's own module as it will now return mathutils types and also have greater visibility to the user.
- All functions which return vectors will now return mathutils.Vector types to be consistent with the rest of the API. Previously (x, y, z) tuples were returned.
- A different implementation of random_unit_vector is now used, this allows 2D, 3D and 4D vectors to be returned. Previously only 3D was possible.
- Some function names have been changed to remove ambiguities and make naming consistent within the module. noise.vector is now noise.noise_vector and noise.vl_vector is now noise.variable_lacunarity
- Doc strings have been updated to be compatible with auto docs.
- Code style and internal naming has been changed to match the conventions in other mathutils code.

Thanks,
Andrew
2011-11-29 10:28:52 +00:00
Campbell Barton 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
gsr b3d 82c84f4b58 Remove some more $Id$ that still were left after r41227 and r41228. 2011-10-23 19:01:59 +00:00
gsr b3d 6105199668 Remove the svn:keywords property. 2011-10-23 18:38:16 +00:00
Campbell Barton 276e5f7095 formatting edits & remove debug print. 2011-10-13 01:29:08 +00:00
Campbell Barton acac22f3f2 enable cmake building makesdna with ghash 2011-10-02 12:34:41 +00:00
Campbell Barton a1d647e92c remove some redundant checks and compiler warnings. 2011-10-02 12:21:24 +00:00
Campbell Barton 3a6158a8bf move mathutils into its own lib. 2011-07-15 04:01:47 +00:00