Implementation of the stroke mode of the eraser tool for grease pencil.
In this mode, the eraser removes each stroke that it touches, meaning each stroke that either intersects the eraser or that has all points inside of it.
Pull Request: https://projects.blender.org/blender/blender/pulls/110304
Reduce indentation in two armature drawing functions, by flipping
conditions and using `continue` (instead of having the entire `for`-body
inside two nested conditions).
No functional changes.
In order to avoid navigation hotkey conflicts during transform
operations, this commit implements the "Transform Navigation with Alt"
option.
This option is enabled by default and makes navigation hotkeys require
the `Alt` key during a transforming in the 3D View.
Pull Request: https://projects.blender.org/blender/blender/pulls/109754
Adopt the use of structs to enclose and organize operator-specific
navigation data.
With this, we create well-defined boundaries for the navigation data of
individual operators.
This makes the code more flexible and easier to maintain and avoid
errors.
Caused by 0b7d8a20bf
Above commit broke the operation because of this change: `if (do_extrude != 0)`
Earlier True/False/2 were used to determine the point of extrude.
Use enum to fix this and to improve the code readability.
Pull Request: https://projects.blender.org/blender/blender/pulls/110256
This commit refactors the code by converting the data manipulation
functions of 'ViewOpsData' into methods.
This change adopts a more object-oriented approach, resulting in
improved code organization and enhanced reusability.
Pull Request: https://projects.blender.org/blender/blender/pulls/110209
- A `_size` suffixed argument was modified to be come the length,
store in a variable with a `_len` suffix to avoid confusion.
- The enum type for masking characters read like a number
(used Set suffix), add `e` prefix to make it clear it's an enum.
This was caused by 89218b66c2
The removal of the transmission roughness socket messed
with the hardcoded socket indices used to for auto socket
values and optimization detection.
Use defines inbetween sockets declarations to make it more
obvious that it they needs to be updated on socket changes.
This also makes the code a bit more meaningful.
The normals were inverted because they use
geometric normals. These are computed using
partial derivatives (`dFdx` & `dFdy`) and are
dependent on the view orientation. But the
baking views were not all captured from the
same side, which flipped sufels normals in
2 out of the 3 views.
This was already unsupported in combination with Multiscattering GGX,
prevented the Principled BSDF from using microfaced-based Fresnel for
Glass materials, and would have made future improvements even trickier.
Pull Request: https://projects.blender.org/blender/blender/pulls/109950
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
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
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