Commit Graph

101381 Commits

Author SHA1 Message Date
Campbell Barton
3a3de9b674 Cleanup: spelling in comments 2023-07-22 11:46:41 +10:00
Campbell Barton
302887c619 Cleanup: use boolean literals in source/
Apply clang-tidy modernize-use-bool-literals to source/.
2023-07-22 11:43:01 +10:00
Campbell Barton
d1aac3b08c Cleanup: various non-functional changes for C++ (python, makesrna)
- Remove redundant void, struct.
- Use function style casts.
2023-07-22 11:33:36 +10:00
Campbell Barton
81ee130063 Cleanup: use C++ system headers
Apply clang-tidy modernize-deprecated-headers to source/
2023-07-22 11:27:25 +10:00
Campbell Barton
c81fffaa30 Fix function signatures for PyGetSetDef callbacks
While in practice this didn't cause problems on supported platforms,
omitting the closure argument is incorrect.
2023-07-22 11:16:04 +10:00
Campbell Barton
056a7bbb5c Cleanup: ignore GCC cast-function-type warning for PyMethodDef's
PyMethodDef::ml_flags define the function signature making the warning
meaningless.
2023-07-22 11:13:55 +10:00
Ray molenkamp
19422044ed Cleanup: CMake: Modernize bf_bmesh dependencies
Pretty straightforward

- Remove any bmesh paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/110363
2023-07-22 02:05:21 +02:00
Germano Cavalcante
8165b70e58 Fix #110337: 'Target Selection' options modified after transform
Caused by 3a2f5fb9db

`ENUM_OPERATORS` was incorrectly set causing problems for C++ code.
2023-07-21 18:50:37 -03:00
Jacques Lucke
febe38743c RNA: move remaining rna files to C++
Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/110354
2023-07-21 21:08:05 +02:00
Jacques Lucke
5b2accd26f Cleanup: fix debug build 2023-07-21 19:49:27 +02:00
Jacques Lucke
ec05e5a3fc Python: move remaining python files to C++
Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/110352
2023-07-21 19:41:03 +02:00
Ray Molenkamp
a670b53abe Cleanup: CMake: Modernize bf_blenfont dependencies
Pretty straightforward

- Remove any blenfont paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/110351
2023-07-21 19:13:37 +02:00
Ray Molenkamp
0f541db97c Cleanup: CMake: Modernize bf_intern_clog dependencies
Pretty straightforward

- Remove any clog paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/110350
2023-07-21 18:37:30 +02:00
Ray molenkamp
be516e8c81 Cleanup: CMake: Modernize bf_blentranslation dependencies
Pretty straightforward:

- Remove any blentranslation paths from INC
- Add a dependency though LIB when needed

Slightly different than usual:

blentranslation still had a dependency on imbuf, from a time long
gone, cleaned that up since I was in the area

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/110324
2023-07-21 16:22:10 +02:00
Sybren A. Stüvel
f645130465 Anim: Refactor the armature drawing code
Introduces a strategy pattern for the implementation of the various
armature drawing modes. Instead of having to `switch (arm->drawtype)`
(or `if`/`else if`/`else` chains) everywhere, one function is used to
select the appropriate `ArmatureBoneDrawStrategy` subclass.

In the future this class could be expanded even further. Currently there
are still places where there are explict checks for the draw type,
making it cumbersome to add new types. For now I feel it's already a
good enough move forward; future extensions can be done in later PRs.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/106232
2023-07-21 15:03:50 +02:00
Philipp Oeser
126fd4a181 Fix #110341: Appended text looses user after reload
Even if a text datablock was "used" by in the Text Editor, it would be
lost after save/reload if no fake user is set.

This is not in line with other datablocks if they are used by an editor
(e.g. images, clips, masks etc.).

Now handle this with `IDWALK_CB_USER_ONE` (instead of `IDWALK_CB_NOP`)
in `id_refcount_recompute_callback` >
`BKE_screen_foreach_id_screen_area` which re-ensures a user is set.

(Bit on shaky ground here, but this seems like this is how this is
handled for other editors "consuming" a datablock).

Pull Request: https://projects.blender.org/blender/blender/pulls/110344
2023-07-21 14:41:45 +02:00
Nate Rupsis
9ec018e1df Fix: Bump BLENDER_FILE_SUBVERSION to 11 used in #108286 2023-07-21 08:40:56 -04:00
Dalai Felinto
a51b38dec5 Cleanup: make format 2023-07-21 14:23:49 +02:00
Falk David
8dd0faec54 GPv3: Refactor: ramer_douglas_peucker_simplify
This refactors the `ramer_douglas_peucker_simplify` function to be more generic.

No functional changes expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/110338
2023-07-21 12:44:36 +02:00
Sybren A. Stüvel
4833dd931b Makesdna: more verbose Align struct error
Change the `makesdna` error message from:

```
Align struct error: Bone color
```

to:

```
Align struct error: Bone::color (starts at 180 on the native platform;  180 % 8 = 4 bytes)
```

This has a few advantages:

- The colon notation (`Bone::color`) makes it easier to recognise that this is about a specific struct field.
- It makes it clear that this is about the start/offset of the inner struct.
- It includes the math the check is actually doing, providing concrete information on how to change the code to fix the issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/110291
2023-07-21 12:24:35 +02:00
Campbell Barton
495a198393 Cleanup: use C++ system headers 2023-07-21 16:07:33 +10:00
Campbell Barton
530e1ac151 Fix building drawing test WITH_OPENGL_BACKEND=OFF 2023-07-21 14:09:04 +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
1153e9f69c Fix PyAPI getter callbacks missing closure arguments
Another instance where a function signature mismatch could theoretically
cause problems but in practice didn't.
2023-07-21 13:50:33 +10:00
Aaron Carlisle
ac764d2498 Fix: missing type casts after recent c++ conversion
Fixes mistakes from 6fcecb7e46
2023-07-20 23:12:04 -04:00
Campbell Barton
3844ac227d Fix incorrect integer type for MatrixAccess length access
In practice this worked for x64 however it could theoretically return
an invalid length.
2023-07-21 12:50:02 +10:00
Campbell Barton
62deac09c3 Fix incorrect integer type for Matrix row assignment
In practice this worked for x64 however it might cause invalid memory
access on systems with different argument alignment.
2023-07-21 12:10:49 +10:00
YimingWu
742ada97e2 Fix #106139: Curvemapping clipping range variable error
Clipping should use `clipr`instead of `curr`.

`clipr` is for value clipping while `curr` is for curve view clipping,
misuse of these two can lead to output value being clipped by
viewing range. Now fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/106164
2023-07-21 03:26:26 +02: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
Campbell Barton
ae5682fa10 Fix errors with built options disabled PyAPI C++ refactor
Resolve issues from 6fcecb7e46
2023-07-21 10:53:30 +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
Ray molenkamp
3e88a2f44c Cleanup: CMake: Modernize bf_depsgraph dependencies
Pretty straightforward

- Remove any depsgraph paths from INC
- Add a dependency though LIB when needed

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/110317
2023-07-20 22:13:00 +02:00
Jacques Lucke
f07a112cb5 WM: move to C++
Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/110292
2023-07-20 22:12:29 +02:00
Clément Foucault
7158844424 EEVEE-Next: Irradiance Cache: Add manual trilinear weights
This replaces the trilinear interpolation with manually
placed samples to avoid most light leak.

Add two new parameters to bias the sampling position:
- Normal bias
- View bias

Move the irradiance smoothing parameter per grid.

Pull Request: https://projects.blender.org/blender/blender/pulls/110312
2023-07-20 19:03:08 +02:00
Ray molenkamp
4e64b772f5 Cleanup: CMake: Modernize bf_windowmanager dependencies
Pretty straightforward

- Remove any windowmanager paths from INC
- Add a dependency though LIB when needed

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/109984
2023-07-20 18:52:52 +02:00
Ray Molenkamp
f10fdcd0e8 Fix: Build issue with MSVC
MSVC couldn't decide between two templates and needed a little help
2023-07-20 09:10:31 -06:00
Campbell Barton
537c585aa6 Cleanup: pass const screen argument to screen_area_spacelink_add 2023-07-21 00:13:13 +10:00
Campbell Barton
d86e2b63a6 Cleanup: remove TIMERF define (set a define _TIMER_MAX) 2023-07-21 00:13:13 +10:00
Falk David
7cd5e25743 GPv3: Stroke Simplify operator
This adds the `stroke_simplify` operator.
Implements a version of the Ramer Douglas Peucker algorithm for marking the points to delete.

Pull Request: https://projects.blender.org/blender/blender/pulls/110266
2023-07-20 15:31:51 +02:00
Falk David
64513e8e2f Fix: RNA description ending in '.' warning
The description of `use_active_layer_only` was ending in a dot,
causing a warning.
2023-07-20 14:06:33 +02:00
Amelie
924aa0ef07 GPv3: Hard Eraser tool
Implementation of the hard eraser for grease pencil.
The tool "cuts" the strokes, meaning it removes points that are inside the eraser's radius, while adding points at intersections between the eraser and the strokes.

Note that this does not implement the "Stroke" and "Dissolve" mode of the eraser yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/110063
2023-07-20 13:56:23 +02:00
Pratik Borhade
b08b6984d0 Animation: Fcurve Channel color band alignment
Colorband alignment of Fcurve channels broke after additional offset
value, which is added in d9f5ce2546

Pull Request: https://projects.blender.org/blender/blender/pulls/109775
2023-07-20 13:54:35 +02:00
Falk David
71837fcb04 GPv3: Add get_editable_drawing_at function
This function returns an editable drawing for a given layer at a specific scene time.

Pull Request: https://projects.blender.org/blender/blender/pulls/110295
2023-07-20 12:53:38 +02:00
Campbell Barton
549848a0d8 Cleanup: various non-functional changes for C++
- Remove redundant void, struct.
- Use function style casts.
2023-07-20 20:35:49 +10:00
Iliya Katueshenock
557cb0dce8 Fix #110283: crash when loading curve simulation cache
The array of curve types must be updated eagerly.

Pull Request: https://projects.blender.org/blender/blender/pulls/110284
2023-07-20 12:26:24 +02:00
Bastien Montagne
9e5793dbbb Cleanup: Add _FILE_ to MAIN_VERSION_ATLEAST/_OLDER macros.
As noted in review of PR #110109, original names were confusing, as it
was not clear which version (file or blender) was checked here.
2023-07-20 11:31:33 +02:00
Jacques Lucke
269579e79b Cleanup: move ikplugin and simulation to C++
Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/110270
2023-07-20 11:18:40 +02:00
Sybren A. Stüvel
211c28589c Refactor: document RNA_define_verify_sdna()
Add documentation for `RNA_define_verify_sdna()`. Based on an
explanation by @mont29.

No functional changes.
2023-07-20 11:01:29 +02:00
Omar Emara
a939f46350 Compositor: Use average color variance in Kuwahara node
This patch uses the average variance of individual color channel as the
condition for choosing the appropriate quadrant. This will produce
different visual results, but ones that are consistent with the
intention of the Kuwahara filter.

This is done to be compatible with the GPU implementation, which uses
that method due to superior performance and memory saving.
2023-07-20 11:42:20 +03:00
Jacques Lucke
38fe6d1dec BLF: move to C++
Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/110268
2023-07-20 10:41:36 +02:00