Commit Graph

121892 Commits

Author SHA1 Message Date
Brecht Van Lommel
fa007002b1 Refactor: Logging: Move G.quiet to CLOG, replace some printfs
* Replace G.quiet by CLG_quiet_set/get
* CLOG_INFO_NOCHECK prints are now suppressed when quiet, these were
  typically inside a if (!G.quiet) conditional already.
* Change some prints for blend files, color management and rendering to
  use CLOG, that were previously using if (!G.quiet) printf().

Pull Request: https://projects.blender.org/blender/blender/pulls/143138
2025-07-28 13:36:13 +02:00
Bartosz Kosiorek
b1d5c35f3a Physics: Change default shape for Bubble and Foam particles, to increase visibility
Change default shape of Bubble and Foam, to be able to notice potential
artifacts in the Viewport. The shape for bubble was changed to circle, and
the shape for Foam was changed to cross.

It allows users to notice and fix artifacts in early stages for reports like:
#79995 #81011 #85533 #97063

Pull Request: https://projects.blender.org/blender/blender/pulls/138681
2025-07-28 13:33:04 +02:00
Bartosz Kosiorek
127d891f31 Fix #86512: Fire simulation without smoke not affected by force field
It was incorrectly skipping effectors in this case.

Fix #86512
Fix #129427

Pull Request: https://projects.blender.org/blender/blender/pulls/137679
2025-07-28 13:16:17 +02:00
Benjamin Beilharz
fa2062ee96 Refactor: Renames the zero extension mode to clip
This commit renames the `ExtensionMode`'s `Zero` case to `Clip`.

Pull Request: https://projects.blender.org/blender/blender/pulls/143354
2025-07-28 10:45:12 +02:00
Habib Gahbiche
cf5be88e7f Fix #143291: USD: World uses wrong output node
The problem was that the first output node was chosen instead of the
active one.

Pull Request: https://projects.blender.org/blender/blender/pulls/143292
2025-07-28 10:27:44 +02:00
Omar Emara
6f426f498a Refactor: Move pass name aliasing to context implementation
This patch moves the rules that alias Image to Combined for pass names
to the context implementations. This is because this only makes sense
for contexts that deal with passes, while it wouldn't make much sense
for other possible contexts like VSE modifiers.

Pull Request: https://projects.blender.org/blender/blender/pulls/143419
2025-07-28 10:00:20 +02:00
Benjamin Beilharz
4bffd43adc Cleanup: Adds missing static casts
This commit adds missing static casts for the interpolation and
extension mode lookups.

Pull Request: https://projects.blender.org/blender/blender/pulls/143418
2025-07-28 09:11:21 +02:00
Omar Emara
ed8c072933 Refactor: Add default implementation for render_data
This patch adds a default implementation for the render_data method of
the compositor context. It defaults to the scene render_data.

Pull Request: https://projects.blender.org/blender/blender/pulls/143205
2025-07-28 07:55:46 +02:00
Jesse Yurkovich
26c939849c Cleanup: USD: Various C++ cleanups for point instancing export support
- Use Blender C++ containers
- Use const in more places
- Remove unnecessary headers
- Style/guideline cleanups

Pull Request: https://projects.blender.org/blender/blender/pulls/143397
2025-07-28 07:16:26 +02:00
Jesse Yurkovich
f7210eabd8 USD: Enable the allow_unicode export operator property by default
All supported versions of Blender are capable of handling the Unicode
prim and property names now.

It's difficult to determine how much of the USD ecosystem is using
version 24.03 or greater so there is some risk of our files (when they
make use of Unicode names) not loading correctly for other DCC
applications.

Pull Request: https://projects.blender.org/blender/blender/pulls/142747
2025-07-28 07:15:50 +02:00
Campbell Barton
ca0e6e77ec UI: improve percentage display for wm.progress API
wm.progress displayed a percentage in a cryptic
2x2 grid of numbers, so:

```
75
23
```

Represents `75.23%`. This is now shown as `75.23%`
on systems that support RGBA cursors.
2025-07-27 21:26:26 +10:00
Campbell Barton
320975c842 Cleanup: don't pass an Array by value in mesh_intersect.cc 2025-07-27 20:32:55 +10:00
Andrej730
ddeddaecd6 PyDoc: improve mathutils python signatures and doc-strings
- Adding `/` to signatures to indicate that arguments are accepted only
  as positional.
- Document default values and optional arguments in consistent way with
  other docs.
- Use `Literal` for strings to indicate set of allowed string values
  (later it can also be used in typing stubs).
- Document some undocumented arguments.

Ref !143278
2025-07-27 20:23:44 +10:00
Campbell Barton
37a2effab7 Cleanup: avoid casting away 'const'
Copy into a non-const variable before assignment to avoid casts that
remove `const`.
2025-07-27 17:06:06 +10:00
Campbell Barton
b8897d3f6e Cleanup: remove unnecessary name prefix in DrawCache::text_id 2025-07-27 16:59:11 +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
f6af0aae7c Cleanup: use UTF8 string functions for tracking members
Use UTF8 aware functions unless raw bytes are expected.
2025-07-27 16:39:57 +10:00
Campbell Barton
eef9509ff1 UI: respect UI_BUT_NO_UTF8 for text buttons
This was already handled by most accessors.
2025-07-27 14:58:42 +10:00
Campbell Barton
e93e9db6b7 Cleanup: UTF8 string functions for color-space & imbuf strings
Use UTF8 aware functions unless raw bytes are expected.
2025-07-27 04:34:04 +00:00
Andrej730
0d2b44e309 Fix: Vector.to_tuple didn't accept precision of -1
The to_tuple method defaulted to -1 but didn't accept -1 as an argument
(as documented).

Ref !143278
2025-07-27 13:47:13 +10:00
Campbell Barton
01436bfbf3 Build: unbreak WITH_INTERNATIONAL=ON 2025-07-27 13:27:27 +10:00
Campbell Barton
9f056204e5 Cleanup: use UTF8 string functions in source/blender/python
Use UTF8 aware functions unless raw bytes are expected.
2025-07-27 12:49:02 +10:00
Campbell Barton
83a489d9ac Cleanup: remove commented code
These errors are handled by exceptions.
2025-07-27 12:49:02 +10:00
Campbell Barton
71a19e04ff Cleanup: back-tick quote literal strings in code comments
Prevent doxygen attempting to interpret symbols withing the text.
The `make check_spelling_*` target also skips this text.
2025-07-27 12:49:02 +10:00
Campbell Barton
8c8c8d5014 Cleanup: replace *_max_length with _maxncpy for null inclusive size
The term "length" is too easily confused with the `strlen(..)`
length without the null byte. Most string functions that take a static
buffer size use the suffix `maxncpy` to avoid off by one errors.
2025-07-27 12:49:02 +10:00
Campbell Barton
2528a41965 Fix: off by one error escaping node names
Also replace allocation with with the more commonly used
2x static-buffer size.
2025-07-27 12:49:02 +10:00
Harley Acheson
c022d5908f BLF: Increase FreeType Cache Values
When we first enabled FreeType font caching we purposely constrained it
so that we could see it was working, dropping and loading font faces
and sizes as needed. But that was years ago now and it is still running
with no more than 4 faces, 8 sizes, and only 400KB of cache. At minimum
we run with 3 simultaneous faces (main UI font and two copies of the
mono font), so allowing it 4 max seems pretty small. This PR changes
the max_faces to 8, sizes to 16, and the cache size to 1MB. Note that
these changes will give NO noticable user change, good or bad, under
normal circumstances. FreeType will churn a bit less, but the time
taken to do these things is very little.

Pull Request: https://projects.blender.org/blender/blender/pulls/143240
2025-07-27 01:40:12 +02: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
Campbell Barton
e9ffd666d5 Cleanup: ensure the output of BLI_path_to_display_name is valid UTF8
While this didn't cause errors, the resulting text was often used in
situations where UTF8 is expected (data-block names & UI labels).
Ensure names are UTF8 to avoid encoding related errors in the future.
2025-07-26 12:08:45 +00:00
Campbell Barton
faed51f195 Cleanup: remove redundant calls to strlen 2025-07-26 12:08:15 +00:00
Campbell Barton
0531230a35 Fix: incorrect sizes of fixed size buffers, ensure valid UTF8
Correct code that was likely to truncate when copying strings and
correct the the size of fixed sized buffers.
2025-07-26 12:07:27 +00:00
Campbell Barton
24c965905e Fix: armature "Auto-Name by Axis" creating invalid UTF8 names
When auto-naming based on axis, the string concatenation didn't take
UTF8 encoding into account, adding the suffix could create names
which raised an exception when accessed from Python.

Resolve using UTF8 string truncation.

Also resolve a logical error reading past the buffer bounds if the name
passed in was longer than MAXBONENAME.
2025-07-26 11:58:39 +00:00
Hans Goudey
ed372380c5 Cleanup: Follow style guide & conventions in mesh_tangent.cc
- Order class variables before functions
- Use this-> to access non-private members
- Remove unnecessary BKE prefix
- Remove useless comments
- Use standard "uv_map" name for variable
- Use consistent order for mesh span variables
- Use C++ vector types instead of raw pointers
- Use Span instead of raw pointers
- Pass Span-like variables by value
2025-07-25 18:12:08 -04:00
Hans Goudey
855113ab06 Refactor: Mesh: Slightly simplify tangents API
The RNA `Mesh.calc_tangents()` function used a mesh tangents API wrapper
function that existed at a different abstraction level than the other
functions. That wrapper was only used in this single place, so just
inline its logic into the RNA code. Also give the base tangents API
function a name that makes its limitations clear.
2025-07-25 18:01:00 -04:00
Hans Goudey
44e6822191 Cleanup: Remove debug code accidentally included in previous commit 2025-07-25 17:26:22 -04:00
Hans Goudey
33b430892c Fix #143218: Uninitialized VBO data using multiple UV tangents
Caused by b19696c0b8.

I misunderstood the meaning of the vertex buffer allocation size.
Even though the attributes aren't interleaved, the fact that there
are multiple attributes is still included in the "element size" that's
multiplied with the size argument to `GPU_vertbuf_data_alloc`.

Also switch to spans and indices rather than incrementing raw pointers,
which would have made this much faster to debug.
2025-07-25 17:00:47 -04:00
John Kiril Swenson
b4815957ab Fix: VSE: Strip label jumping when resizing vertically
Make sure `mask_size` is calculated correctly in
`UI_view2d_view_to_region_rcti_clip` since the rcti is inclusive and the
size functions do not take this into consideration. This function is
only used from NLA and VSE drawing code.
2025-07-25 14:09:41 -05:00
Miguel Pozo
33d9e00f4a Fix #142738, #136688: Workbench: Inconsistent matcap rendering
Use `bool32_t` to work around C++/GLSL bool differences.

Pull Request: https://projects.blender.org/blender/blender/pulls/143233
2025-07-25 19:45:28 +02:00
Guillermo Venegas
52403b686f UI: Move block layout methods to namespace
Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/143232
2025-07-25 19:33:15 +02:00
Sergey Sharybin
dcae48d1d3 Cycles: Add Portal Depth light pass information
It allows to implement tricks based on a knowledge whether the path
ever cam through a portal or not, and even something more advanced
based on the number of portals.

The main current objective is for strokes shading: stroke shader
uses Ray Portal BSDF to place ray to the center of the stroke and
point it in the direction of the surface it is generated for. This
gives stroke a single color which matches shading of the original
object. For this usecase to work the ray bounced from the original
surface should ignore the strokes, which is now possible by using
Portal Depth input and mixing with the Transparent BSDF. It also
helps to make shading look better when there are multiple stroke
layers.

A solution of using portal depth is chosen over a single flag due
to various factors:
- Last time we've looked into it it was a bit tricky to implement
	as a flag due to us running out of bits.
- It feels to be more flexible solution, even though it is a bit
	hard to come up with 100% compelling setup for it.
- It needs to be slightly different from the current "Is Foo"
	flags, and be more "Is Portal Descendant" or something.

An extra uint16 is added to the state to count the portal depth,
but it is only allocated for scenes that use Ray Portal BSDF.

Portal BSDF still increments Transparent bounce, as it is required
to have some "limiting" factor so that ray does not get infinitely
move to different place of the scene.

Ref #125213

Pull Request: https://projects.blender.org/blender/blender/pulls/143107
2025-07-25 18:09:38 +02:00
Harley Acheson
efe14ff166 UI: Fix VSE Channel Label Jiggling
In the video below you will see how VSE labels can jiggle vertically
while the area is resized. This is caused by the incorrect calculation
of rect height in UI_view2d_view_to_region_y. Our BLI_rcti_size_y does
not return the correct size, but max-min, which one unit too small for
our inclusive integer rects like v2d->mask or region->winrct. This PR
corrects the calculation in UI_view2d_region_to_view_y, and also in
UI_view2d_region_to_view_x because these are so similar.

Pull Request: https://projects.blender.org/blender/blender/pulls/143095
2025-07-25 18:09:02 +02:00
Omar Emara
2582630702 Refactor: Use Bounds for compositing region
This patch uses the new C++ Bounds structure for the composition region
returned by the compositor context.

Pull Request: https://projects.blender.org/blender/blender/pulls/143199
2025-07-25 15:40:45 +02:00
Hans Goudey
8b883a3922 Fix #143142: Displace modifier Custom Normal direction broken
Caused by cf6ee877a0
2025-07-25 09:27:57 -04:00
Brecht Van Lommel
ae5152866e Fix #142724: Mesh used by boolean modifier missing subdivision in edit mode
The code path for non-editmesh has ensure subdivision in it, the editmesh one
was missing it.

Pull Request: https://projects.blender.org/blender/blender/pulls/143135
2025-07-25 15:03:45 +02:00
Omar Emara
8cb7aafae2 Refactor: Use generic name for compositor context IO methods
This patch renames some IO methods in the compositor context to be more
generic. This is in preparation for more generic use of the compositor.

Pull Request: https://projects.blender.org/blender/blender/pulls/143193
2025-07-25 14:40:17 +02:00
Pratik Borhade
df75d3e664 Fix: Delete basis removes all shape key
Caused by 29b90af679
When deleting the first/basis shape key, all successive keys are
deleted. `shapenr` remains 1 during entire iteration and `BLI_findindex`
returns 1 for every keyblock as first element is deleted. This
eventually clears the entire list. To fix this, change `shapenr` value to 0
when deleting the first element.

Pull Request: https://projects.blender.org/blender/blender/pulls/142946
2025-07-25 12:49:05 +02:00
Pratik Borhade
832fc7af2a Fix #142982: Grease Pencil: Assert when overriding keyframes in dopesheet
Assert when overlapping keys are removed. This is due to drawing count
mismatch, more specifically when drawing is not removed/overwritten but
early check validation caused it. Remove `validate_drawing_user_counts`
from `remove_drawings_with_no_users`. If Drawing is actually removed
(`drawings_to_remove` non empty), validation function will be called at
the end.

Pull Request: https://projects.blender.org/blender/blender/pulls/143057
2025-07-25 12:47:19 +02:00
Sybren A. Stüvel
edc4136c79 Cleanup: fix compiler warning about memset on C++ type
Instead of zeroing out a C++ wrapper for a DNA struct, zero out just the
DNA struct itself.

The C++ wrapper adds no extra fields, and also no virtual functions, so
the old code was already safe. Now it's also semantically correct :)

No functional changes.

Reviewed by Omar, by locally applying my diff.

Pull Request: https://projects.blender.org/blender/blender/pulls/143184
2025-07-25 12:36:05 +02:00
W_Cloud
d15750a059 Geometry Nodes: add inline socket for missing nodes
Add missing inline socket for Set Spline Type,Join Strings,Pack UV Islands and Vector Rotate.

Pull Request: https://projects.blender.org/blender/blender/pulls/142299
2025-07-25 12:27:44 +02:00
Habib Gahbiche
c7421e197a Fix #143156: "RGB to BW" node not found in link drag search
The node is stil specific to the compositor and is not shared with its
Shader counterpart yet, so `ntype.gather_link_search_ops;` should not
be `nullptr`.

Pull Request: https://projects.blender.org/blender/blender/pulls/143174
2025-07-25 12:25:18 +02:00