Commit Graph

299 Commits

Author SHA1 Message Date
Campbell Barton
bd935b5aed Merge branch 'master' into blender2.8 2017-08-22 18:21:05 +10:00
Campbell Barton
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
Campbell Barton
7497488149 Merge branch 'master' into blender2.8 2017-08-20 15:50:15 +10:00
Campbell Barton
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
Campbell Barton
2332051419 Merge branch 'master' into blender2.8 2017-08-19 21:54:05 +10:00
Campbell Barton
1cc4033df8 PyAPI: expose matrix parsing function 2017-08-19 21:36:50 +10:00
Campbell Barton
a60727080f Merge branch 'master' into blender2.8 2017-08-12 14:06:29 +10:00
Bastien Montagne
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
Sergey Sharybin
5605c26fcd Fix function declaration of some modifiers
Those functions did not use evaluation context.

Also fixed lots of unused variables warnings caused by commented out code which
needs to be ported away from DerivedMesh and to evaluation context.
2017-07-21 15:54:42 +02:00
Luca Rood
1c4c288727 Pass EvaluationContext argument everywhere
Note that some little parts of code have been dissabled because eval_ctx
was not available there. This should be resolved once DerivedMesh is
replaced.
2017-07-21 14:47:26 +02:00
Aaron Carlisle
df7c609fda PYAPI: Fix mathutils doc structure 2017-06-14 16:47:43 -04:00
Brecht Van Lommel
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
Campbell Barton
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
Sybren A. Stüvel
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
Aaron Carlisle
c7a4f96f88 Pydoc: Change Wikipedia links and grammar in mathutils matrix code 2017-03-22 14:54:22 -04:00
Campbell Barton
3b467b35a8 Fix T50029: BVHTree.FromPolygons memory leak 2016-11-29 19:32:41 +11:00
Aaron Carlisle
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
Campbell Barton
81f4bc1665 Cleanup: reduce Vector_getseters size using macros 2016-07-31 20:43:52 +10:00
Campbell Barton
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
Campbell Barton
3df30c1a6e Cleanup: parenthesize defines 2016-06-01 00:19:01 +10:00
Brecht Van Lommel
21fddf7d1c C99/C++11: replace deprecated finite() by isfinite(). 2016-05-17 21:39:16 +02:00
Campbell Barton
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
Campbell Barton
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
Campbell Barton
4e500101a7 Cleanup: quiet -Wcomma, cast to void where needed 2016-03-05 09:16:12 +11:00
Campbell Barton
b285394acc PyAPI: correct function name w/ arg parsing 2016-02-29 09:00:21 +11:00
Campbell Barton
9c21015c26 Fix crash in bvhtree.FromPolygons 2016-02-12 19:12:58 +11:00
Campbell Barton
c7608ef359 Fix T47337: BVHTree.find_nearest missing
Method wasn't named as documented.
2016-02-08 08:29:46 +11:00
Mike Erwin
a1d7f67d81 cleanup: spelling / typos
no functional changes
2016-01-28 00:30:50 -05:00
Campbell Barton
4f8b7f4420 Docs: quiet warnings in reference doc syntax 2016-01-25 20:26:39 +11:00
Campbell Barton
de356415ae Correct comments & some explanation from last commit 2016-01-21 11:03:37 +11:00
Campbell Barton
a1164ce271 Remove errors for unsupported math operations 2016-01-21 10:30:17 +11:00
Campbell Barton
f5604af464 Cleanup: use BM_mesh_* prefix for BMesh functions 2016-01-14 13:00:11 +11:00
Campbell Barton
9964eed9ac PyAPI: add optional filter argument to KDTree.find 2015-12-06 21:35:32 +11:00
Campbell Barton
ee719e8816 Cleanup: formatting (PyArg_ParseTuple) 2015-12-06 16:19:45 +11:00
Campbell Barton
aed5347b4c Using term 'origin' for mathutils.bvhtree docs
Matches rna ray-cast API
2015-12-02 19:25:08 +11:00
Brecht Van Lommel
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
Campbell Barton
c5945ebb2c Cleanup: use quat to eul w/ mathutils API 2015-10-24 17:50:20 +11:00
Campbell Barton
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
Bastien Montagne
5551948b31 Fix T46520: mathutils.bvhtree crashes with distance input.
Should be backported to 'a' release.
2015-10-18 12:09:42 +02:00
Bastien Montagne
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
Campbell Barton
09e40a4956 Cleanup: spelling 2015-09-14 02:22:22 +10:00
Campbell Barton
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
Campbell Barton
1080a7d5e1 Cleanup: style 2015-08-25 08:50:53 +10:00
Campbell Barton
231ee60ab5 mathutils.BVHTree: support overlap self-intersect
Use same logic as BKE_bmbvh_overlap
2015-08-24 08:23:24 +10:00
Campbell Barton
8a623b066e BVHTree.FromBMesh() missed epsilon arg 2015-08-24 08:23:24 +10:00
Campbell Barton
58c9a0b11a Cleanup: spelling 2015-08-22 21:17:32 +10:00
Campbell Barton
3ec9ff16f8 Resolve MSVC/OpenMP compat issue 2015-08-20 19:37:14 +10:00
Campbell Barton
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
Campbell Barton
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