126261 Commits

Author SHA1 Message Date
Campbell Barton
ad7150dcca Tools: improve code_clean's 'remove_struct' edit to avoid CPU overhead
Many struct removals were being tested which always failed.
Avoid testing removal of forward declarations & struct declarations.
2023-07-25 13:24:59 +10:00
Campbell Barton
481eaff790 Tools: improve code_clean's 'use_brief_types' edit to skip typedef's
`typedef unsigned int uint;` could be converted into
`typedef uint uint;`.

Resolve by skipping instances of unsigned that follow a typedef.
2023-07-25 13:24:59 +10:00
Campbell Barton
921d6dc3e2 Cleanup: typedef uchar, ushort, uint & ulong in freestyle
source/blender/freestyle wasn't fillowing Blender's own
conventions for integer types.

This had the down-side of making the code_clean.py utility attempt to
replace `unsigned int` types which always failed.
While this edit could have been manually ignored for all files in
freestyle, add the typedef's to `FreestyleConfig.h` and follow Blender's
convention instead.
2023-07-25 12:59:22 +10:00
Harley Acheson
4150152d0f Fix #109663: Allow Animation Keymap in Spreadsheet Editor
Allow starting and stopping animation, changing frames, etc while in
the Spreadsheet Editor.

Pull Request: https://projects.blender.org/blender/blender/pulls/110404
2023-07-25 00:35:06 +02:00
Harley Acheson
1dfeac246d UI: Only Show Spreadsheet Scroll Bars When Necessary
Hides Spreadsheet editor scroll bars when not needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/110403
2023-07-24 23:49:32 +02:00
Hans Goudey
f3f31054ba Cleanup: Make format 2023-07-24 16:32:08 -04:00
Hans Goudey
318f9b259b Cleanup: Use const pointers in PBVH draw arguments
Also remove two unused variables
2023-07-24 16:32:00 -04:00
Hans Goudey
5e9ea9243b Mesh: Rename "polys" to "faces"
Implements part of #101689.

The "poly" name was chosen to distinguish the `MLoop` + `MPoly`
combination from the `MFace` struct it replaced. Those two structures
persisted together for a long time, but nowadays `MPoly` is gone, and
`MFace` is only used in some legacy code like the particle system.

To avoid unnecessarily using a different term, increase consistency
with the UI and with BMesh, and generally make code a bit easier to
read, this commit replaces the `poly` term with `poly`. Most variables
that use the term are renamed too. `Mesh.totface` and `Mesh.fdata` now
have a `_legacy` suffix to reduce confusion. In a next step, `pdata`
can be renamed to `face_data` as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/109819
2023-07-24 22:06:55 +02:00
Damien Picard
13ec961c4a UI: fix and improve a few messages
- "Rename Channels": only one channel can be renamed at a time, use
  singular.
- "Copy Markers to Scene": rephrase erroneous operator description.
- "Axis tag names with": grammar.
- "Close or open the selected stroke adding an edge from last to first
  point": "segment" is preferred to "edge" elsewhere in the context of
  curves or Grease Pencil.
- "Number of subdivisions [points] by edge[s]": replace "by edge" with
  "per segment" for the same reason.
- "Compatibility mode for SL, OpenSim...": expand to explain that SL
  and OpenSim are respectively Second Life and OpenSimulator.
- "W/m^2" -> "W/m²". This symbol is widely supported and should be
  preferred for exponentiation outside of code.
- "Effect on tracks which are tracked less than specified amount of frames",
  "Effect on tracks which have a larger reprojection error":
  Use "Affect" and "number" instead of "amount".
- "Hull curve" -> "Envelope". This is a calque from German Hüllkurve
  meaning envelope.
- "Frquency Cutoff" -> "Frequency Cutoff" (typo)
- "Check if Select Left or Right": rephrase to "Based on Mouse
  Position" as it better explains the action of the operator.
- "Make cut event if strip is not selected ..." -> even (typo)
- "Shear selected items along the horizontal screen axis":
  Rephrase as this transform operator can act in many different axes.
- Tonemapping compositing node: the two algorithms "R/D Photoreceptor"
  and "Rh Simple" only had names, but no description. Add ones
  explaining at least the basic principle and where the names come
  from.
- In the "Matte dilate/erode side" description for the Keying node's
  Dilate/Erode socket, "side" was likely a typo for "size".
  Reformulate the description to make it clearer, inspired by similar
  ones.
- "Width of the blur edge" -> "Width of the blur for the transition";
  "Edge angle" -> "Angle of the transition";
  "Wipe direction" -> "Whether to fade in or out":
  Better explains the sequencer wipe transition (inspired by the manual).
- OSL shaders now supported on some GPU backends.
- "Add a new repeat input and output nodes " -> "Add new" (typo).

Pull Request: https://projects.blender.org/blender/blender/pulls/110321
2023-07-24 21:22:07 +02:00
Hans Goudey
189fc24f1a Cleanup: Simplify removing curves in GP erasor stroke mode
Avoid the initial copy, and avoid moving from a const reference.
2023-07-24 14:07:44 -04:00
Hans Goudey
78dba0bb17 Cleanup: Pass array references with spans in GP eraser 2023-07-24 13:49:27 -04:00
Bastien Montagne
79d6d4c4fe I18N: updated UI translations from svn trunk (r6647). 2023-07-24 18:03:00 +02:00
Amelie
4f56261f76 GPv3: Stroke mode for the Eraser tool
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
2023-07-24 17:04:39 +02:00
Damien Picard
39a94e370c I18n: restore unit messages after c++ migration broke extraction
The units defined in blenkernel/intern/unit.c were extracted using a
regex which contained `NULL`. Commit 129f78eee7 converted this file to
c++, and these `NULL` were replaced with `nullptr`, breaking the
regex.

This commit changes the regex to `nullptr` as well to restore the
translations.

Pull Request: https://projects.blender.org/blender/blender/pulls/110420
2023-07-24 17:01:41 +02:00
Lukas Stockner
b19011e2db Cycles: Fix build error due to missing svm_closure_weight 2023-07-24 16:56:52 +02:00
Jörg Müller
7c3a779bc2 Fix #110336 Regression: Speaker ignoring of the starting position in NLA track
Porting fix from upstream:

Bugfix for reading an animated property with a negative time value.

This can now happen in SequenceHandle::seek.
2023-07-24 16:44:05 +02:00
Sybren A. Stüvel
47cc5787a6 Fix compiler error when building without WITH_INPUT_NDOF
Some declarations were outside the `#ifdef WITH_INPUT_NDOF`, but still
referred to things inside that block. Now everything is inside the file.
2023-07-24 16:42:56 +02:00
Lukas Stockner
2c3b095995 Cycles: Don't store SVM closure weight in ShaderData
This is only used as temporary state while evaluating SVM nodes,
there's no point in storing it in the ShaderData for later.
Since ShaderData size is relevant for GPU performance, we should
save the space and only keep it where needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/110366
2023-07-24 16:09:46 +02:00
Lukas Stockner
8fd0551bfe Cleanup: format 2023-07-24 16:06:45 +02:00
Lukas Stockner
c7eb426eae Cleanup: Remove leftover code in versioning 2023-07-24 16:05:35 +02:00
Sybren A. Stüvel
00e5b2b6db Refactor: Anim, simplify Armature drawing code a little bit
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.
2023-07-24 15:53:59 +02:00
Germano Cavalcante
017d4912b2 Transform: Use alternative hotkeys for Transform Navigation
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
2023-07-24 15:51:58 +02:00
Germano Cavalcante
30b53c1005 Fix View Pan operation failing
Caused by 329cf07499a4eb3814e2cc3db123b393a330ec4c
2023-07-24 10:40:36 -03:00
Lukas Stockner
b220ec27d7 Cycles: Update Velvet BSDF to Sheen BSDF with new Microfiber sheen model
This patch extends the old Velvet BSDF node with a new shading model,
and renames it to Sheen BSDF accordingly.

The old model is still available, but new nodes now default to the
"Microfiber" model, which is an implementation of
https://tizianzeltner.com/projects/Zeltner2022Practical/.

Pull Request: https://projects.blender.org/blender/blender/pulls/108869
2023-07-24 15:36:36 +02:00
Damien Picard
6f1f2b9830 I18n: do not translate one message already translated with tip_()
The "Name Collisions:" UI message does not need to be translated as
part of the label, as it is already through an explicit call to
tip_().

Pull Request: https://projects.blender.org/blender/blender/pulls/110319
2023-07-24 15:13:30 +02:00
Germano Cavalcante
0b3d2a4f47 View3D Refactor: rename view operator files
Use the `view` prefix to better identify the hierarchy of these files.
2023-07-24 09:50:39 -03:00
Germano Cavalcante
329cf07499 View3D Refactor: compute 'ViewOpsData::zfac' only when needed 2023-07-24 09:50:39 -03:00
Germano Cavalcante
e8289c0aff View3D Refactor: support 'ViewOpsType' for Roll
This deduplicates the code and will make it easier to integrate this
operator into the overall navigation utility.
2023-07-24 09:50:39 -03:00
Germano Cavalcante
b4e6c02709 View3D Refactor: support 'ViewOpsType' for Orbit
This deduplicates the code and will make it easier to integrate this
operator into the overall navigation utility.
2023-07-24 09:50:29 -03:00
Germano Cavalcante
384c2e1f36 View3D Refactor: use structs to confine the Operator's navigation data
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.
2023-07-24 09:46:32 -03:00
Germano Cavalcante
10835154eb Cleanup: split 'view3d_navigate.cc' operators into their own files
This reorganization makes the code more modular and makes it easier to
identify and fix possible errors in the future.
2023-07-24 09:37:05 -03:00
Germano Cavalcante
6faa39edb7 Cleanup: split 'ViewOpsData::init_navigation' into specific functions
The logic of `ViewOpsData::dyn_ofs` was scattered and confusing.

Confining it to a function makes initialization and usage clearer.
2023-07-24 08:49:57 -03:00
Pratik Borhade
7cdb9814c5 Fix #110253: Regression: Extruding bone from root fails
Caused by 0b7d8a20bfdf6e510c2fe77382a0d32a75bb5fc3
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
2023-07-24 13:45:39 +02:00
Germano Cavalcante
15a4609ece Cleanup: Convert 'ViewOpsData' functions into methods
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
2023-07-24 13:41:47 +02:00
Sybren A. Stüvel
546892bdbc Cleanup: fix compiler warning in makesdna
No functional changes.
2023-07-24 12:50:36 +02:00
Chris Blackbourn
8ace65e3c6 Cleanup: simplify uv parametrizer state information
Just use RAII, no need to track extra initializer state.
2023-07-24 17:50:59 +08:00
Campbell Barton
50edca5306 Cleanup: minor readability changes to escape_uri_string
- 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.
2023-07-24 12:44:46 +10:00
Campbell Barton
5107fb6625 Cleanup: quiet ASAN warning initializing eWM_CapabilitiesFlag to -1
ASAN warns about this since moving wm_window.c to C++,
add an initialized flag instead of using an invalid value to
represent an uninitialized state.
2023-07-24 12:41:09 +10:00
Campbell Barton
a82836b6c2 Cleanup: replace typdef with 'using'
Apply modernize-use-using with edits (as it strips out useful info).
2023-07-24 11:04:19 +10:00
Campbell Barton
b8ea968929 Cleanup: simplify struct & enum declarations for C++ 2023-07-24 10:13:31 +10:00
Clément Foucault
2ed108cb84 Fix EEVEE: Broken Normals and Transparency
This was caused by 89218b66c2192f6d517776211855f0306c3d5f57
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.
2023-07-23 13:50:25 +02:00
Clément Foucault
9bf37be99c EEVEE-Next: Fix invalid surfel normals
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.
2023-07-22 10:43:49 +02:00
Lukas Stockner
56bc24aa9b Cycles: Merge OSL Clearcoat closure into microfacet()
There's no reason why this would need to be its own closure, it was
just a slightly different microfacet distribution with a hardcoded
IOR and intensity multiplier internally.

No functional change, just cleaning up the mess of custom OSL closures.

Pull Request: https://projects.blender.org/blender/blender/pulls/109951
2023-07-22 05:07:11 +02:00
Lukas Stockner
89218b66c2 Cycles: Remove Transmission Roughness from Principled BSDF
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
2023-07-22 04:16:49 +02:00
Campbell Barton
32288bd200 Cleanup: correct struct member comments 2023-07-22 12:15:40 +10:00
Lukas Stockner
8639bf013c Cycles: Fix MNEE not accounting for closure Fresnel
Previously Glass Fresnel used to get baked into the closure weight,
so the MNEE code could just ignore it.
However, now that it's part of the closure implementation, we need
to account for it in the MNEE throughput calculation as well.
2023-07-22 04:02:14 +02:00
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