1281 Commits

Author SHA1 Message Date
Hans Goudey
1d372bdc8b Refactor: Split CustomData attribute and newer attribute headers
Avoid including DNA_customdata_types.h everywhere we include the
attributes header. Over time the older attribute header should be
used less and less.

Part of #122398

Pull Request: https://projects.blender.org/blender/blender/pulls/147980
2025-10-13 15:38:26 +02:00
Damien Picard
78db22fd27 I18n: Translate reports for fluid baking
A few reports for fluid baking were not completely translated because
they used the baking job's name, matching the operator name. That
needs to be translated manually in the report.

Reported by Ye Gui in #43295.
2025-10-09 12:09:56 +02:00
Hans Goudey
a68d39e9d9 Cleanup: Formatting
Run `make format` after the library update in the previous commit.
2025-10-02 12:55:42 -04:00
Campbell Barton
cccc2c77c5 Cleanup: consistent for C-style comment blocks 2025-08-08 07:37:33 +10:00
Damien Picard
5998795aa6 UI: Replace contractions with long-form text
Avoid using contractions for can't, aren't, doesn't, and shouldn't.
Following the writing style guide in the Human Interface Guidelines.

Pull Request: https://projects.blender.org/blender/blender/pulls/143852
2025-08-05 11:16:22 +02:00
Damien Picard
f6771d8e21 UI: Improve running jobs labels
Use the form "Processing something..." (gerund, sentence case,
ellipsis) for running jobs progress label, according to Blender's
Human Interface Guidelines.

Pull Request: https://projects.blender.org/blender/blender/pulls/141573
2025-07-31 16:32:41 +02:00
Campbell Barton
d13540fe7d Cleanup: rename locked interface setting functions
Follow the convention of using terms such as get/set as a suffix.
2025-07-30 13:01:43 +10:00
Campbell Barton
e8f9e2d1d1 Cleanup: use UTF8 string functions in editors & related logic
Use UTF8 aware functions unless raw bytes are expected.
2025-07-27 16:41:19 +10:00
Campbell Barton
649b89781e Cleanup: ensure UTF8 string copy for DNA & screen data
Use `BLI_strncpy_utf8` & `BLI_snprintf_utf8` for fixed size buffers in
DNA and screen data structures such as panels, menus & operators.

This could be considered a fix as copying a UTF8 string into a smaller
buffer without proper truncation can create an invalid UTF8 sequence.
However identifying which of these users are likely to run into would
be time consuming and not especially useful.
2025-07-26 12:33:15 +00:00
Jacques Lucke
00c81f5113 Merge branch 'blender-v4.5-release' 2025-07-14 16:30:38 +02:00
YimingWu
4096309753 Fix #141819: Interface Use a flag for WM_set_locked_interface
Different operations may need to lock different part of the interface,
e.g. for rendering, the image editor may still need refreshing while the
interface is locked, but when baking data into a scene, the image editor
needs to be locked because it is not thread safe to get data from a
partially evaluated depsgraph.

This is a better fix on top of 7c8b8b2457
that addresses the root cause with more flexibility for future
operations that requires different interface locking strategy as
well.

Pull Request: https://projects.blender.org/blender/blender/pulls/141866
2025-07-14 16:17:46 +02:00
Hans Goudey
1f1d2f4252 Cleanup: Use mesh helper function to access edge data 2025-07-10 22:18:06 +02:00
Brecht Van Lommel
8d8e61fefd Logging: Change various categories and log levels
* Remove bke, ed and wm prefixes
* Add prefixes like: geom, object, blend, lib.
* Shorten some category names
* A few log level changes to improve --log-level info output

Pull Request: https://projects.blender.org/blender/blender/pulls/140244
2025-07-09 20:59:26 +02:00
Bastien Montagne
3bb53a27bb Merge branch 'blender-v4.5-release' 2025-06-30 11:21:59 +02:00
Bastien Montagne
b4eeddd113 Doc: Comment about using default i18n context for some mirror operators. 2025-06-30 11:21:04 +02:00
Damien Picard
afa51a5d54 I18n: Disambiguate "Mirror"
"Mirror" can mean:
- To symmetrize something (i.e. generate a new mirrored copy of it or
  edit it in a symmetric fashion).
- To flip something (i.e. invert its values along X, Y or Z axes).
- To repeat a texture in a mirrored fashion outside its bounds.

Reported by Gabriel Gazzán in #43295.
2025-06-30 11:07:39 +02:00
Eitan Traurig
64d3a92530 Fix: "Remove All Particle Systems" is not greyed out when there are no particles
Fix the polling of the operator. The operator is now greyed
out when there are no particle systems on the object.

See images in PR description

Pull Request: https://projects.blender.org/blender/blender/pulls/140166
2025-06-11 07:18:56 +02:00
Clément Foucault
e57359726f GPU: VertexFormat: Use new data types
This prevents the use of unaligned data types in
vertex formats. These formats are not supported on many
platform.

This simplify the `GPUVertexFormat` class a lot as
we do not need packing shenanigans anymore and just
compute the vertex stride.

The old enums are kept for progressive porting of the
backends and user code.

This will break compatibility with python addons.

TODO:
- [x] Deprecation warning for PyGPU (4.5)
  - [x] Deprecate matrix attributes
- [x] Error handling for PyGPU (5.0)
- [x] Backends
  - [x] Metal
  - [x] OpenGL
  - [x] Vulkan

Pull Request: https://projects.blender.org/blender/blender/pulls/138846
2025-06-10 17:20:45 +02:00
Eitan Traurig
e859df1126 UI: Add "Remove All Particle Systems" operator to particle systems context menu
Adds an operator that clears entire list of particle system. Operator is located
in particle system context menu.

Pull Request: https://projects.blender.org/blender/blender/pulls/138464
2025-06-08 12:46:38 +02:00
Campbell Barton
50f3240abd Cleanup: spelling & duplicate terms (check_spelling.py) 2025-05-30 11:03:56 +10:00
Campbell Barton
b3dfde88f3 Cleanup: spelling in comments (check_spelling_* target)
Also uppercase acronyms: API, UTF & ASCII.
2025-05-17 10:17:37 +10:00
Campbell Barton
63cdb7eae4 Cleanup: pass SelectPick_Params by reference instead of pointer
Also use a return value from ED_select_pick_params_from_operator.
2025-05-08 13:50:14 +10:00
Campbell Barton
7d97ba4c5f Cleanup: use float2, int2 types for cursor drawing callbacks
Ref !138172
2025-05-02 23:01:29 +00:00
Jacques Lucke
e8d1491e62 Refactor: Depsgraph: simplify query API further
* Remove `DEG_get_evaluated_object` in favor of `DEG_get_evaluated`.
* Remove `DEG_is_original_object` in favor of `DEG_is_original`.
* Remove `DEG_is_evaluated_object` in favor of `DEG_is_evaluated`.

Pull Request: https://projects.blender.org/blender/blender/pulls/138317
2025-05-02 15:08:29 +02:00
Bartosz Kosiorek
9bee273649 Physics: Improve fluid baking messages
- Added unit (seconds) to baking process
- Added information at which frame the baking was interrupted

See images in PR description

Pull Request: https://projects.blender.org/blender/blender/pulls/137933
2025-04-27 09:52:29 +02:00
Brecht Van Lommel
fb2ba20b67 Refactor: Use more typed MEM_calloc<> and MEM_malloc<>
Pull Request: https://projects.blender.org/blender/blender/pulls/137822
2025-04-22 11:22:18 +02:00
Brecht Van Lommel
388a21e260 Refactor: Eliminate various void pointers passed to MEM_freeN
It's safer to pass a type so that it can be checked if delete should be
used instead. Also changes a few void pointer casts to const_cast so that
if the data becomes typed it's an error.

Pull Request: https://projects.blender.org/blender/blender/pulls/137404
2025-04-21 17:59:41 +02:00
Brecht Van Lommel
637c6497e9 Refactor: Use more typed MEM_calloc<>, avoid unnecessary size_t cast
Handle some cases that were missed in previous refactor. And eliminate
unnecessary size_t casts as these could hide issues.

Pull Request: https://projects.blender.org/blender/blender/pulls/137404
2025-04-21 17:59:41 +02:00
Hans Goudey
3b9c2c810d Fix #137392: Hair Particle "Shape Cut" operator crash after Mesh BVH caching
Mistake in bcfe4c34da
2025-04-14 11:53:30 -04:00
Hans Goudey
c6d938fa72 Cleanup: Remove unnecessary mesh positions write access 2025-04-14 11:53:30 -04:00
Sean Kim
5a5db5ea88 WM: Pass tablet tilt data to paint cursor draw callback
Part of #82877

When drawing specialized cursors for the different paint modes via the
`wmPaintCursor` draw callback, tablet tilt direction is unavailable to
use to customize the drawing for the user.

To enable this functionality, this commit adds the `x_tilt` and `y_tilt`
data read while processing MOUSEMOVE events to the `eventstate` variable
so it can be used by consuming functions.

Pull Request: https://projects.blender.org/blender/blender/pulls/137189
2025-04-09 23:07:03 +02:00
Campbell Barton
bcdcc3dbde Refactor: use enum types for event modifiers & types
Use enum types for event modifier and types,
`wmEventModifierFlag` & `wmEventType` respectively.

This helps with readability and avoids unintended mixing with other
types. To quiet GCC's `-Wswitch` warnings many `default` cases needed
to be added to switch statements on event types.

Ref !136759
2025-03-31 23:48:29 +00:00
Hans Goudey
ef86d9fe86 Cleanup: Remove ED_ prefix from private functions 2025-03-31 11:21:24 -04:00
Campbell Barton
be4028f93f Cleanup: remove redundant null checks 2025-03-29 19:41:08 +11:00
Campbell Barton
10233e95dd Cleanup: use a typed enum for operator & gizmo callbacks
Callbacks: exec invoke & modal now use a typed enum wmOperatorStatus.

This helps avoid mistakes returning incompatible booleans or other
values which don't make sense for operators to return.

It also makes it more obvious functions in the WM API are intended
to be used to calculate return values for operator callbacks.

Operator enums have been moved into DNA_windowmanager_enums.h
so this can be used in other headers without loading other includes
indirectly.

No functional changes expected.

Ref !136227
2025-03-20 21:11:06 +00:00
Sybren A. Stüvel
4e33abdafe Merge remote-tracking branch 'origin/blender-v4.4-release' 2025-03-17 11:29:24 +01:00
Campbell Barton
3285da11a9 Fix #136067: Crash with dynamic paint output toggle in some contexts
Resolve the crash by using the active-object to match the operators
poll functions.

Ref !136068
2025-03-17 21:17:48 +11:00
Campbell Barton
bd06baf6e6 WM: rename WM_report* to WM_global_report*, note it's often bad practice
WM_report was originally added for special cases however new code
has been using this in operators for example, where reports should be
sent to the operator via BKE_report, so the caller can handle,
and so Python can catch the errors.

Rename the functions to make them less easily confused with BKE_report
and add a code-comment on why their use should be avoided.
2025-03-11 12:36:17 +11:00
Brecht Van Lommel
66e150b5f4 Merge branch 'blender-v4.4-release' 2025-02-21 18:50:21 +01:00
Brecht Van Lommel
c988a04802 Fix #134120: Crash evaluating rigid body in animation render
This shared state between original data and depsgraphs was added in
98a0bcd425. Other physics systems also share
the pointcache, but not the simulation state to this extent, which leads
to this kind of crash.

The mutex lock is not a great solution, you don't really want both                                                                                                                                                                                                                                                                                   render and viewport to be filling the same cache in parallel. However
this kind of problem also exists in other physics systems, and solving
that is certainly beyond the scope of 4.4, and probably needs to wait
for a bigger physics rewrite. In general the recommendation is to bake
everything before rendering.

Pull Request: https://projects.blender.org/blender/blender/pulls/134779
2025-02-21 18:48:54 +01:00
Brecht Van Lommel
c7a33a62a2 Cleanup: Directly include DNA_userdef_types.h and BLI_listbase.h
Instead of relying on them being included indirectly.

Pull Request: https://projects.blender.org/blender/blender/pulls/134406
2025-02-12 23:01:08 +01:00
Bastien Montagne
87a4c0d3a8 Refactor: Make Library.runtime an allocated pointer.
Move `Library.runtime` to be a pointer, move the related
`LibraryRuntime` struct to `BKE_library.hh`. Similar to e.g.
Mesh.runtime, that pointer is expected to always be valid, and is
allocated at readtime or when creating a new Library ID.

Related smaller changes:
* Write code now uses standard ID writing codepath for Library IDs too.
  * Runtime pointer is reset to nullptr before writing.
* Looking up a library by its absolute path is now handled through a
  dedicated utils, `search_filepath_abs`, instead of using
  `BLI_findstring`.

Pull Request: https://projects.blender.org/blender/blender/pulls/134188
2025-02-07 17:47:16 +01:00
Campbell Barton
007d46ef6d Cleanup: rename "opengl" to "gpu" for 3D viewport utilities 2025-02-04 21:19:28 +11:00
Brecht Van Lommel
3725fad82f Cleanup: Various clang-tidy warnings in editors
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:17 +01:00
Bastien Montagne
9c237af041 Refactor: RNA: add discrete suffix to RNA_pointer_create.
This is a noisy preliminary step to the 'RNA ancestors' change. The
rename helps clearly tell what each `pointer_create` function does.

Pull Request: https://projects.blender.org/blender/blender/pulls/133475
2025-01-24 16:45:32 +01:00
Brecht Van Lommel
dea067fb4d Fix: Particle brush effect can't be inverted with shift key
Regression from 6df437b.

Pull Request: https://projects.blender.org/blender/blender/pulls/133468
2025-01-23 10:16:47 +01:00
Brecht Van Lommel
6a67c90f64 Fix #133458: Particle add brush doesn't work
This was another case similar to #132918. Tweak asserts to properly catch
using min/max on (implicitly cast) pointers.

Pull Request: https://projects.blender.org/blender/blender/pulls/133468
2025-01-23 10:16:45 +01:00
Ray Molenkamp
5783950ac5 Revert: 0dc484f9cc bf_rna modernisation
This caused build errors on the docs builder, I can't seem to reproduce
locally, so revert for now and have another look at some point in the
future.

Sadly as these changes usually go, this took 5c515e26bb and
2f0fc7fc9f with it as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/132559
2025-01-02 19:56:24 +01:00
Campbell Barton
5c515e26bb Cleanup: remove trailing space, ensure a newline at EOF 2025-01-02 15:11:18 +11:00
Pratik Borhade
ae90d0defd Fix #108987: Remove exclamation from bake fluid message
Exclamation looks unnecessary for info message that is generated after
completing the bake job. This PR removes the exclamation points.

Pull Request: https://projects.blender.org/blender/blender/pulls/132009
2025-01-01 19:39:26 +01:00