Campbell Barton
9b89de2571
Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXX
...
Also use doxy style function reference `#` prefix chars when
referencing identifiers.
2021-07-04 00:43:40 +10:00
Campbell Barton
f1e4903854
Cleanup: full sentences in comments, improve comment formatting
2021-06-26 21:50:48 +10:00
Campbell Barton
4b9ff3cd42
Cleanup: comment blocks, trailing space in comments
2021-06-24 15:59:34 +10:00
Campbell Barton
dae445d94a
Fix T85573: Building with Python 3.10a5 fails
...
Replace deprecated _PyUnicode_AsString{AndSize} usage.
T83626 still needs to be resolved before 3.10 is usable.
2021-02-13 23:09:55 +11:00
Sybren A. Stüvel
fd88246d61
Fix error message prefix in Quaternion.to_euler()
...
Fix copy-paste error of error message prefix, so that the Quaternion
function no longer says it's a Matrix function error.
2020-11-19 11:26:54 +01:00
Sybren A. Stüvel
3d48d99647
Cleanup: Python, Clang-Tidy else-after-return fixes
...
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/python` module.
No functional changes.
2020-08-07 13:38:07 +02:00
Campbell Barton
fa7ace2215
PyAPI: support element multiplication for vector, matrix, quaternions
...
This was disabled during 2.8x for smooth porting of 2.7x scripts,
Now '@' is used for matrix multiplication,
support '*' to multiple vector elements.
See T56276.
2020-07-14 22:52:50 +10:00
Campbell Barton
56d0df51a3
Python: support building again version 3.9 (unreleased)
...
Resolves T78089, no functional changes.
2020-06-22 14:55:36 +10:00
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
9a9f39e466
Cleanup: remove redundant 'char *' casts
2019-12-20 10:42:57 +11:00
Campbell Barton
2dac0c9179
PyAPI: add Quaternion.make_compatible
2019-11-27 02:00:14 +11:00
Campbell Barton
f64064e4b1
Docs: correct indent for to_swing_twist docstring
2019-11-16 02:39:51 +11:00
Campbell Barton
36b6fb5cd6
Cleanup: warnings building with Python 3.8
2019-10-16 14:44:36 +11:00
Alexander Gavrilov
b3aa8f0fad
Mathutils: expose the swing + twist Quaternion decomposition to Python.
...
This decomposition is useful in rigging, and involves a math trick.
2019-09-22 13:19:33 +03:00
Campbell Barton
2790740813
Cleanup: spelling
2019-08-17 00:57:05 +10:00
Campbell Barton
2425401a59
Cleanup: spelling
2019-08-04 12:51:44 +10:00
Campbell Barton
6529d20d79
Cleanup: spelling in comments
2019-06-12 09:43:49 +10:00
Jacques Lucke
f3b7b7eb0c
Fix T63673: Wrong api documentation for Quaternion.dot(other)
2019-04-17 13:49:30 +02: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
25ec4b437f
Cleanup: style, use braces for the Python API
2019-03-30 07:14:28 +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
72369c638d
Cleanup: python doc-strings
...
Indentation & trailing space.
2018-11-14 09:05:07 +11:00
Campbell Barton
f35e9f047a
Merge branch 'master' into blender2.8
2018-09-19 12:14:36 +10:00
Campbell Barton
bb3ec3ebaf
BLI_utildefines: rename pointer conversion macros
...
Terms get/set don't make much sense when casting values.
Name macros so the conversion is obvious,
use common prefix for easier completion.
- GET_INT_FROM_POINTER -> POINTER_AS_INT
- SET_INT_IN_POINTER -> POINTER_FROM_INT
- GET_UINT_FROM_POINTER -> POINTER_AS_UINT
- SET_UINT_IN_POINTER -> POINTER_FROM_UINT
2018-09-19 12:12:21 +10: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
Philipp Oeser
96b4e43e8d
Fix T55527: creating a Quaternion without args should result in identity
...
quaternion
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D3487
2018-07-16 15:03:21 +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
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
Brecht Van Lommel
21fddf7d1c
C99/C++11: replace deprecated finite() by isfinite().
2016-05-17 21:39:16 +02: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
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
Sybren A. Stüvel
9fa628f35b
mathutils: added exponential map to Quaternion
...
Added conversion to and from exponential map representation. This
representation is useful for interpolation of > 2 quaternions, or in
PD controllers.
Implementation in C functions quat_to_expmap,
quat_normalized_to_expmap, and expmap_to_quat with Python API, unit
tests and documentation.
Added Quaternion.to_exponential_map() and Quaternion(3-vector) to
Python API.
Reviewers: campbellbarton
Projects: #bf_blender
Differential Revision: https://developer.blender.org/D1049
2015-02-01 13:06:00 +01:00
Sybren A. Stüvel
8c7e1b648b
Fix: correctly describing Quaternion.normalize()
...
The original comment seems to suggest that only the rotation vector
is normalized, leaving the rotation angle alone. This is not what happens,
though. The new comment matches the actual implementation, and the
implementation matches what is commonly understood as quaternion
normalization.
2015-02-01 10:34:49 +01:00
Campbell Barton
9fd569a654
PyAPI: add utilities PyTuple_SET_ITEMS, Py_INCREF_RET
...
Setting all values of a tuple is such a common operation that it deserves its own macro.
Also added Py_INCREF_RET to avoid confusing use of comma operator.
2015-01-06 19:09:11 +11:00
Campbell Barton
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
Tamito Kajiyama
27b58f0eb2
Fix mathutils docstring typos.
2014-12-19 00:43:41 +09:00
Bastien Montagne
9c81833430
Fix T42885: We still had a few wrong doc in mathutils about methods returning
...
instance of self while actually returning None...
2014-12-13 14:07:46 +01:00
Campbell Barton
3a40aed3d5
Cleanup: use float versions of functions when in/output are floats
2014-09-24 14:55:02 +10:00
Campbell Barton
bd697dd4d7
Fix T38402: invalid message for bad type assignments (Quat, Vector)
2014-01-30 16:45:20 +11:00
Campbell Barton
b6db417ee4
code cleanup: use const's for vector args.
2013-10-12 02:19:37 +00:00