Commit Graph

89 Commits

Author SHA1 Message Date
fe8d8aa27e Fix Vector.project crash w/ >4 length vectors 2018-07-27 17:41:20 +10:00
a69f985f40 PyAPI: move deep-copy args check to py_capi_utils 2018-06-26 09:31:57 +02:00
0c82a6fec8 Cleanup: unused define 2017-09-22 07:23:03 +10:00
30d8829780 Docs: mathutils docstrings 2017-09-09 11:02:26 +10:00
90eb93791f Cleanup: mathutils vector comments
Use doxy markup & correct outdated info.
2017-09-09 10:50:40 +10:00
3930e46e37 Correct last commit 2017-09-09 10:15:16 +10:00
002cc6aef3 Cleanup: Simplify SWIZZLE macro
- Use indices instead of character args.
- Use numbered macros instead of variadic args.

Parsing using rtags used over 11gb of memory. While this should be
resolved upstream (report as #1053), the extra complexity didn't give
any real advantage.
2017-09-09 10:10:05 +10:00
46cf33bf01 PyAPI: Make use of PyC_LongAs... API
Avoids setting exceptions inline,
also use Matrix_ParseAny for bmesh.ops.

Some inline exceptions are kept because they show useful details.
2017-08-20 15:49:10 +10:00
81f4bc1665 Cleanup: reduce Vector_getseters size using macros 2016-07-31 20:43:52 +10:00
4e500101a7 Cleanup: quiet -Wcomma, cast to void where needed 2016-03-05 09:16:12 +11:00
de356415ae Correct comments & some explanation from last commit 2016-01-21 11:03:37 +11:00
a1164ce271 Remove errors for unsupported math operations 2016-01-21 10:30:17 +11:00
e5e73ccc90 Math Lib: rename fill_*, to copy_*
matching convention for fixed length api, eg: copy_v3_fl
2015-05-05 17:08:29 +10:00
f682129d62 PyAPI: clarify fallback docstring 2015-03-06 19:02:57 +11:00
c439d14a9a missed this second last commit 2015-02-15 14:11:05 +11:00
fa2f7c69ac mathutils: Implement __hash__() functions
- all mathutils types
- only works on frozen data (so vectors can be used in sets/dict keys)
- uses same method as CPython, (matches hashing a tuple)

D1104 by @juicyfruit with own modifications
2015-02-15 14:02:08 +11:00
a9d979c8ef mathutils: add freeze() method, is_frozen attr
This allows you to make any mathutils object immutable.
2015-02-15 14:01:59 +11:00
ce85aef0d9 mathutils: remove redundant read callback 2015-02-15 13:46:47 +11:00
4feb77cf03 mathutils: avoid extra alloc for Vector.lerp 2015-02-15 13:46:47 +11:00
baa8b63111 Documentation: updated mathutils documentation
Added descriptions of the constructors, and improved the module-level
documentation.
2015-02-01 18:16:12 +01:00
79ba5e52dd Revert "mathutils: let Vector.normalize() return the original length."
Please discuss changes to core mathutils functions first.

Changes like this should be considered and applied to all areas of the API (or not at all).
Missed quaternion, matrix normalize for eg.
2015-01-30 02:12:07 +11:00
6912fe132f mathutils: let Vector.normalize() return the original length.
The length has to be calculated for normalization anyway, and it is already
returned by normalize_vn(vec, size).
2015-01-29 15:29:01 +01: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
8d3bfef538 Extended mathutils.Vector.orthogonal() to accept a 2D vector.
Reviewer: Campbell Barton

Differential revision: https://developer.blender.org/D668
2014-07-23 23:10:03 +09:00
dc847607b6 Change Vector.slerp to accept nonunit vectors 2014-04-18 20:49:39 +10:00
55f83e36cc Py API: Vector.slerp(). also added interp_v3_v3v3_slerp(_safe) functions 2014-03-31 13:28:37 +11:00
6aa75d3b2c Fix for error in normalize_vn_vn(), add len_squared_vn 2014-03-31 11:19:32 +11:00
a47137a2db Python API: add Vector.orthogonal() method 2014-03-18 00:39:46 +11:00
06b6cd8345 PyAPI: mathutils.Vector.cross now works for 2d vectors (returns a float)
also fixed crash when running on large vectors (raises exception now)
2014-02-05 23:36:30 +11:00
bd697dd4d7 Fix T38402: invalid message for bad type assignments (Quat, Vector) 2014-01-30 16:45:20 +11:00
a5c35fb27f Code cleanup: use booleans where appropriate 2014-01-28 04:00:04 +11:00
da6bc87b57 Fix T38138: incorrect API docs 2014-01-09 21:49:11 +11:00
b6db417ee4 code cleanup: use const's for vector args. 2013-10-12 02:19:37 +00:00
1576565932 minor changes needed for building standalone mathutils. 2013-09-14 00:30:56 +00:00
f3654ce6b6 fix incorrect docs [#36518] Vector.rotate() does not return value as documented 2013-08-20 08:41:34 +00: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
858ff6b696 Fix for [#34898] Typo in error message of mathutils.Vector
* Also fixed some more cases of "more then" -> "more than".
2013-04-07 15:09:06 +00:00
adf7bfa8bb ifdef out dynstr so mathutils can be compiled as an external module again. 2012-12-08 01:16:59 +00:00
cf6994b910 code cleanup: spelling,
also initialize bmesh-bevel settings struct to zero to avoid possible uninitialized memory later.
2012-11-12 07:33:01 +00:00
004f8d78ed default to Python3.3 on Linux for SCons and CMake, warn when building with python 3.2x or older.
also remove casts to keep Python3.2 warning quiet.
2012-11-05 13:48:42 +00:00
fae6c35ca7 code cleanup: quiet -Wdouble-promotion, disabled this warnings for a few files since its done throughout the code in some places. 2012-11-04 07:18:29 +00:00
c56a911cd9 style cleanup: comments 2012-10-20 20:20:02 +00:00
aa49ca25d5 incorrect spelling in comments 2012-09-26 20:05:38 +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
32cf7fcdb1 code cleanup: spelling 2012-07-16 23:23:33 +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
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