Commit Graph

142 Commits

Author SHA1 Message Date
Dalai Felinto
2d1cce8331 Cleanup: make format after SortedIncludes change 2020-03-19 09:33:58 +01:00
Campbell Barton
2a6df7dfe5 Cleanup: use named unsigned types in the Python API 2020-02-20 15:40:05 +11:00
Campbell Barton
1e3ffd1f87 mathutils: support for to_2x2 as well as non-square matrices 2020-02-20 15:17:22 +11:00
Tiago Chaves
bc86eb1780 mathutils: support Vector.rotate for 2D vectors 2020-02-20 13:58:46 +11:00
Campbell Barton
9a9f39e466 Cleanup: remove redundant 'char *' casts 2019-12-20 10:42:57 +11:00
Campbell Barton
36b6fb5cd6 Cleanup: warnings building with Python 3.8 2019-10-16 14:44:36 +11:00
Campbell Barton
2425401a59 Cleanup: spelling 2019-08-04 12:51:44 +10:00
Alexander Gavrilov
ec1c9e3258 Python API: add a Matrix.Diagonal constructor to mathutils.
For some reason there seems to be no way to do the very simple and
obvious task of converting a scale vector to a matrix via mathutils.
The Matrix.Scale constructor does something complicated instead.

Reviewers: brecht, campbellbarton

Differential Revision: https://developer.blender.org/D4893
2019-05-19 15:03:27 +03:00
Campbell Barton
778542fd8f Cleanup: comments (long lines) in python 2019-04-29 20:01:10 +10:00
Campbell Barton
e12c08e8d1 ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.

For details on usage and instructions for migrating branches
without conflicts, see:

https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00
Campbell Barton
dbc058301b Cleanup: trailing commas 2019-04-16 16:40:47 +02:00
Campbell Barton
25ec4b437f Cleanup: style, use braces for the Python API 2019-03-30 07:14:28 +11:00
Campbell Barton
a38313c3bd Cleanup: style, array wrapping
Add trailing comma for clang-format.
2019-03-25 09:02:04 +11:00
Campbell Barton
35b78d9807 Cleanup: indentation, wrapping
Mostly functions wrapping args, not confirming to our style guide.
2019-03-15 09:54:30 +11:00
Campbell Barton
de13d0a80c doxygen: add newline after \file
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +11:00
Campbell Barton
eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
Campbell Barton
744f633986 Cleanup: trailing commas
Needed for clan-format not to wrap onto one line.
2019-02-03 14:59:11 +11:00
Campbell Barton
65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
Campbell Barton
8a61ea7296 Cleanup: add trailing commas
Prevents clang-format merging into a single line.
2019-01-19 13:58:35 +11:00
Campbell Barton
d46d8e831c Merge branch 'master' into blender2.8 2018-12-19 10:28:26 +11:00
Campbell Barton
5c3953010d Cleanup: spelling 2018-12-19 10:18:15 +11:00
Campbell Barton
4b545d1bbf Fix T58975: "@=" operator silently fails
D4083 by @artfunkel
2018-12-16 09:49:00 +11:00
Campbell Barton
49490e5cfb Merge branch 'master' into blender2.8 2018-12-12 13:02:09 +11:00
Campbell Barton
e757c4a3be Cleanup: use colon separator after parameter
Helps separate variable names from descriptive text.
Was already used in some parts of the code,
double space and dashes were used elsewhere.
2018-12-12 12:50:58 +11:00
Bastien Montagne
a43ebc63fa Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/intern/collision.c
2018-09-03 17:44:36 +02:00
Brecht Van Lommel
4da2acae3a Spelling fixes in comments and descriptions, patch by luzpaz.
Differential Revision: https://developer.blender.org/D3668
2018-09-03 16:55:01 +02:00
Campbell Barton
7eaf00bfb0 Cleanup: style 2018-08-22 10:10:12 +10:00
Andrew Hale
aa5a96430e Python: Add support for @ infix operator matrix multiplication
This differential revision implements the code for T56276

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D3587
2018-08-10 15:18:00 +02:00
Campbell Barton
a69f985f40 PyAPI: move deep-copy args check to py_capi_utils 2018-06-26 09:31:57 +02:00
Campbell Barton
2aa0bde3dc mathutils: replace interp w/ blend when standalone 2018-03-18 05:08:12 +01:00
Sybren A. Stüvel
7b3e441bcf Improved docstring of mathutils.Matrix.lerp() 2018-01-18 09:58:14 +01:00
Sybren A. Stüvel
9811150952 Improve docstring for mathutils.Matrix.decompose() 2018-01-18 09:38:01 +01:00
Campbell Barton
1cc4033df8 PyAPI: expose matrix parsing function 2017-08-19 21:36:50 +10: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
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
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
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
Campbell Barton
339915a962 Optimize PySequence_Fast usage
Access arrays directly, avoiding type-check every time.
2015-07-29 10:49:35 +10:00
Campbell Barton
96f08bf9a8 Fix leaks in mathutils PySequence_Fast usage 2015-07-29 10:49:35 +10:00
Campbell Barton
31cb14f5de Cleanup: check exact error w/ mathutils functions 2015-07-29 10:49:34 +10:00
Campbell Barton
f727df6076 Doc: correct rst syntax
also remove some API docs from example
2015-05-12 18:23:29 +10:00
Campbell Barton
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
Campbell Barton
f682129d62 PyAPI: clarify fallback docstring 2015-03-06 19:02:57 +11:00
Campbell Barton
c439d14a9a missed this second last commit 2015-02-15 14:11:05 +11:00
Campbell Barton
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
Campbell Barton
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
Sybren A. Stüvel
baa8b63111 Documentation: updated mathutils documentation
Added descriptions of the constructors, and improved the module-level
documentation.
2015-02-01 18:16:12 +01:00