691ed21842
PyAPI: replace PyC_FromArray with typed functions
...
This was meant to be generic but introduced possible type errors
and unnecessary complication.
Replace with typed PyC_Tuple_PackArray_* functions.
Also add PyC_Tuple_Pack_* macro which replaces some uses of
Py_BuildValue, with the advantage of not having to parse a string.
2017-08-22 18:10:57 +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
1cc4033df8
PyAPI: expose matrix parsing function
2017-08-19 21:36:50 +10:00
c034193821
Cleanup: remove useless DM_ensure_looptri().
...
That one was doing exactly same thing as `dm->getLoopTriArray()`, no
point in having twice the same code here...
2017-08-11 17:08:41 +02:00
df7c609fda
PYAPI: Fix mathutils doc structure
2017-06-14 16:47:43 -04:00
98df7d778f
Fix T51287: Matrix.lerp fails w/ shear
...
Use interp_m4_m4m4 (wraps Eigen),
`MATH_STANDALONE` will need to be updated to support this.
2017-05-26 17:02:27 +10:00
81e584ed17
CMake: Use GCC7's -Wimplicit-fallthrough=5
...
Use to avoid accidental missing break statements,
use ATTR_FALLTHROUGH to suppress.
2017-05-20 14:01:03 +10:00
349cafac52
Matrix.decompose(): changed terminology, "location" → "translation"
...
Matrix.decompose() should either return "location, orientation, size" or
"translation, rotation, scale". Since there are constructors for the former,
I've replaced "location" in the documentation with "translation".
The code is still the same, I just changed the documentation.
2017-04-21 15:51:35 +02:00
c7a4f96f88
Pydoc: Change Wikipedia links and grammar in mathutils matrix code
2017-03-22 14:54:22 -04:00
3b467b35a8
Fix T50029: BVHTree.FromPolygons memory leak
2016-11-29 19:32:41 +11:00
cf9a6b416c
API: Fix Links
...
Self-explanatory. to find broken links run `sphinx-build -b linkcheck sphinx-in sphinx-out`
Reviewers: mont29
Tags: #bf_blender, #python, #infrastructure:_websites
Differential Revision: https://developer.blender.org/D2297
2016-10-25 17:34:01 +02:00
81f4bc1665
Cleanup: reduce Vector_getseters size using macros
2016-07-31 20:43:52 +10:00
cca57bf04c
PyAPI: Use module names on initializaton
...
No need to re-convert from C strings to PyUnicode.
2016-07-14 15:51:56 +10:00
3df30c1a6e
Cleanup: parenthesize defines
2016-06-01 00:19:01 +10:00
21fddf7d1c
C99/C++11: replace deprecated finite() by isfinite().
2016-05-17 21:39:16 +02:00
722d586257
Fix T47993: noise_vector ignores random seed
...
Replace hard coded values with offsets derived from the random seed.
2016-03-30 20:43:43 +11:00
26f2fe9528
mathutils.bvhtree: Add find_nearest_range API call
...
Returns all elements within a radius.
Similar to kdtree.find_range
2016-03-19 18:31:56 +11:00
4e500101a7
Cleanup: quiet -Wcomma, cast to void where needed
2016-03-05 09:16:12 +11:00
b285394acc
PyAPI: correct function name w/ arg parsing
2016-02-29 09:00:21 +11:00
9c21015c26
Fix crash in bvhtree.FromPolygons
2016-02-12 19:12:58 +11:00
c7608ef359
Fix T47337: BVHTree.find_nearest missing
...
Method wasn't named as documented.
2016-02-08 08:29:46 +11:00
a1d7f67d81
cleanup: spelling / typos
...
no functional changes
2016-01-28 00:30:50 -05:00
4f8b7f4420
Docs: quiet warnings in reference doc syntax
2016-01-25 20:26:39 +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
f5604af464
Cleanup: use BM_mesh_* prefix for BMesh functions
2016-01-14 13:00:11 +11:00
9964eed9ac
PyAPI: add optional filter argument to KDTree.find
2015-12-06 21:35:32 +11:00
ee719e8816
Cleanup: formatting (PyArg_ParseTuple)
2015-12-06 16:19:45 +11:00
aed5347b4c
Using term 'origin' for mathutils.bvhtree docs
...
Matches rna ray-cast API
2015-12-02 19:25:08 +11:00
4ff0126e89
C99 is now the C standard for all our C code.
...
The main new feature is mixed variable declarations and code, which can help
reduce uninitialized variables or accidental variable reuse.
Due to incomplete C99 support in VS 2013, variable length arrays are not
supported, BLI_array_alloca must still be used. The header <tgmath.h> is also
not supported.
Differential Revision: https://developer.blender.org/D1631
2015-11-22 22:31:22 +01:00
c5945ebb2c
Cleanup: use quat to eul w/ mathutils API
2015-10-24 17:50:20 +11:00
fbca69c69a
BLI_math: add mat3_normalized_to_* functions
...
Many uses of matrices for rotation keep them normalized,
so no need to normalize each time.
2015-10-24 07:02:51 +11:00
5551948b31
Fix T46520: mathutils.bvhtree crashes with distance input.
...
Should be backported to 'a' release.
2015-10-18 12:09:42 +02:00
e1b67c9bc0
Fix T46002: mathutils.geometry.intersect_line_line_2d doesn't operate on lines, but on line segments.
...
Ugly issue really, but at least doc now matches behavior of the function. :|
2015-10-13 09:59:42 +02:00
09e40a4956
Cleanup: spelling
2015-09-14 02:22:22 +10:00
1d71ad2eaa
Math Lib: Use plane intersect from graphics-gems
2015-09-04 22:13:20 +10:00
Julian Eisel
ef629e0d50
Quiet warnings
...
We had too many warnings lately... was awaiting that someone would kill them - didn't happen -> goes to my commit ratio! :P
2015-09-04 01:04:37 +02:00
1080a7d5e1
Cleanup: style
2015-08-25 08:50:53 +10:00
231ee60ab5
mathutils.BVHTree: support overlap self-intersect
...
Use same logic as BKE_bmbvh_overlap
2015-08-24 08:23:24 +10:00
8a623b066e
BVHTree.FromBMesh() missed epsilon arg
2015-08-24 08:23:24 +10:00
58c9a0b11a
Cleanup: spelling
2015-08-22 21:17:32 +10:00
3ec9ff16f8
Resolve MSVC/OpenMP compat issue
2015-08-20 19:37:14 +10:00
176b806626
BVH-overlap: add callback to BLI_bvhtree_overlap
...
The callback checks if 2 nodes intersect (not just their AABB).
Advantages:
- theres no need to allocate overlaps which are later ignored.
- expensive intersection tests will run multi-threaded.
Currently only used for Python API.
2015-08-20 17:52:26 +10:00
cff288cf3a
Use PyC_ParseBool to parse bools
...
This could cause problems since they could be any int,
then passed directly to internal functions that assume bools.
2015-08-04 18:49:42 +10:00
42d65ef5cc
Add bool parser for PyArg_ParseTuple
...
Use for mathutils.bvhtree
2015-08-03 20:00:16 +10:00
a4f55617d1
Cleanup: quiet int overflow warnings
2015-08-02 12:53:12 +10:00
18af73e461
Add mathutils.bvhtree API
...
Originally D966 by @lukastoenne, with own additions
- trees can be initialized from Object's, BMesh,
or passed in as vert+polygon arrays.
- original indices of ngons/faces are used. (instead of tessellated indices).
- ray_cast, find_nearest methods
- find overlapping faces between 2 trees
2015-07-29 21:24:12 +10:00
339915a962
Optimize PySequence_Fast usage
...
Access arrays directly, avoiding type-check every time.
2015-07-29 10:49:35 +10:00
96f08bf9a8
Fix leaks in mathutils PySequence_Fast usage
2015-07-29 10:49:35 +10:00
31cb14f5de
Cleanup: check exact error w/ mathutils functions
2015-07-29 10:49:34 +10:00