Commit Graph

14 Commits

Author SHA1 Message Date
Campbell Barton
da9cfbdae9 Docs: add doc-string to mathutils.Vector swizzle attributes
Also refactor definitions into a macro as they were exceeding the
line-length and wrapping.

Ref: !124275

Co-authored-by: Nathan Burnham <nathan@nathanburnham.uk>
2024-07-09 13:45:07 +10:00
Nathan Burnham
1c92d26bfc PyAPI Doc: fix typos causing untyped parameters
The type for `bpy_struct.keyframe_insert()`'s `options` parameter was
instead applied to a non-existent `flag` parameter.

The description and type for `mathutils.Vector.Repeat()`'s `vector`
parameter was instead applied to a non-existent `tuple` parameter.

Also fix a reference to `BMElemeSeq` instead of `BMElemSeq`.

Ref: !122734
2024-06-05 16:25:05 +10:00
Campbell Barton
7436b578dd Cleanup: force wrapping all uses of PyDoc_STRVAR
Without this, minor edits can re-indent the whole doc-string at a
different level, causing diffs to be unnecessary noisy.
2024-01-25 10:22:16 +11:00
Hans Goudey
0618de49ad Cleanup: Replace MIN/MAX macros with C++ functions
Use `std::min` and `std::max` instead. Though keep MIN2 and MAX2
just for C code that hasn't been moved to C++ yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/117384
2024-01-22 15:58:18 +01:00
Aras Pranckevicius
13dbeac13c cleanup: remove "sa" acos/asin/sqrt functions and use "safe_" variants
Cleanup talked about in the previous semi-related PR, #114501

- saacos, saasin, sasqrt have been 100% identical to saacosf,
  saasinf, sasqrtf since 2012.
- For all the above, there exist more intuitively named safe_acosf,
  safe_asinf, safe_sqrtf that do the same thing, so switch all code to those.

Pull Request: https://projects.blender.org/blender/blender/pulls/114593
2023-11-07 19:49:01 +01:00
Campbell Barton
611930e5a8 Cleanup: use std::min/max instead of MIN2/MAX2 macros 2023-11-07 16:33:19 +11:00
Campbell Barton
e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Aras Pranckevicius
d973355b3a Cleanup: reduce amount of math-related includes
Using ClangBuildAnalyzer on the whole Blender build, it was pointing
out that BLI_math.h is the heaviest "header hub" (i.e. non tiny file
that is included a lot).

However, there's very little (actually zero) source files in Blender
that need "all the math" (base, colors, vectors, matrices,
quaternions, intersection, interpolation, statistics, solvers and
time). A common use case is source files needing just vectors, or
just vectors & matrices, or just colors etc. Actually, 181 files
were including the whole math thing without needing it at all.

This change removes BLI_math.h completely, and instead in all the
places that need it, includes BLI_math_vector.h or BLI_math_color.h
and so on.

Change from that:
- BLI_math_color.h was included 1399 times -> now 408 (took 114.0sec
  to parse -> now 36.3sec)
- BLI_simd.h 1403 -> 418 (109.7sec -> 34.9sec).

Full rebuild of Blender (Apple M1, Xcode, RelWithDebInfo) is not
affected much (342sec -> 334sec). Most of benefit would be when
someone's changing BLI_simd.h or BLI_math_color.h or similar files,
that now there's 3x fewer files result in a recompile.

Pull Request #110944
2023-08-10 14:51:40 +03:00
Campbell Barton
bbf073c4ed Cleanup: use POINTER_FROM_INT for PyGetSetDef definitions
This makes it clear '(void *)0' represents a zero index instead of
a value that's typically nullptr when ignored.
2023-08-03 20:04:04 +10:00
Campbell Barton
6d2326dabf Cleanup: use function style casts 2023-07-31 19:57:32 +10:00
Campbell Barton
32288bd200 Cleanup: correct struct member comments 2023-07-22 12:15:40 +10:00
Campbell Barton
0777c1861e Cleanup: ignore GCC cast-function-type warning for PyMethodDef's
While these warnings point to real errors in the code,
PyMethodDef are an exception where functions with different numbers
of arguments are all cast to the same function type.
2023-07-21 14:08:59 +10:00
Campbell Barton
b29a4cdcfc Cleanup: various non-functional changes for C++ (python, windowmanager)
- Remove redundant void, struct.
- Use function style casts.
2023-07-21 10:59:54 +10:00
Jacques Lucke
6fcecb7e46 BPY: move bpy and mathutils to C++
Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/110299
2023-07-21 02:18:59 +02:00