Commit Graph

121754 Commits

Author SHA1 Message Date
Christoph Lendenfeld
2a68d9a9a8 Refactor: Remove TODO and use constexpr when converting edit bones
No functional changes.

This deals with the TODO
`/* TODO(sergey): How to ensure this is a constexpr? */`
by just making it a `constexpr`.
The line in question was `square_f(0.000001f)`
so the constexpr is just `0.000001f * 0.000001f`

Pull Request: https://projects.blender.org/blender/blender/pulls/142872
2025-07-22 17:38:27 +02:00
Hans Goudey
beb062949b Fix #142814: Incorrect object mode UV overlay with GPU subdivision
Same problem as d84f10f2a0
2025-07-22 10:55:29 -04:00
Bastien Montagne
1955edee15 Readfile: Optimization: Do not attempt to expand nullptr IDs.
These can be quite a significant part of processed ID pointers, no point
in calling the callback on them.
2025-07-22 16:48:01 +02:00
Clément Foucault
1f42ca9be3 Cleanup: GPU: Avoid warning in switch statement
Caused by 32d64d35bb.
2025-07-22 16:45:04 +02:00
Hans Goudey
fff0fd0172 Cleanup: Remove unused variable 2025-07-22 10:30:16 -04:00
Dawid Kurek
e50ced2e80 Hydra: Forward camera custom properties of type double to render delegate
Pull Request: https://projects.blender.org/blender/blender/pulls/142857
2025-07-22 16:28:19 +02:00
Brecht Van Lommel
902f1ebf89 Revert "Cleanup: Compiler warning about unused ntree with node socket tooltips"
This reverts commit f7ae14cd6a. The warning got
fixed another way before I pushed this change.
2025-07-22 16:22:26 +02:00
Brecht Van Lommel
f7ae14cd6a Cleanup: Compiler warning about unused ntree with node socket tooltips 2025-07-22 15:54:29 +02:00
Lukas Tönne
6c959745ee Fix #142325: Grease Pencil: Join Selection removes wrong points
The Join Selection operator can remove the original selected points, but
this often removes the wrong points. The reason is that the point ranges
are removed sequentially, and each removal changes the curve topology,
invalidating subsequent ranges. The solution is to combine the ranges
into a single index mask for each drawing before removing points, so
that each drawing is only modified in a single operation.

Pull Request: https://projects.blender.org/blender/blender/pulls/142834
2025-07-22 15:17:58 +02:00
Tenkai Raiko
4ee4cd8451 Fix: Link dragging Falloff Size doesn't work
Link dragging the Falloff Size input from the Dilate node doesn't work
due to a missing make_available callback, which this patch implements.

Pull Request: https://projects.blender.org/blender/blender/pulls/142829
2025-07-22 15:09:56 +02:00
Clément Foucault
32d64d35bb Refactor: GPU: Texture: Replace eGPUTextureFormat by TextureFormat
This offers better semantic and safety of the API.

Part of #130632

Pull Request: https://projects.blender.org/blender/blender/pulls/142818
2025-07-22 14:58:54 +02:00
Jonas Holzman
144696f7ee Cleanup: Allow ED_screen_temp_space_open() to take a null title argument
This suppreses -Wnonnull compiler warnings that would previously appear
when trying to pass a nullptr title to this function.

Internally, this function passes its `title` argument to `WM_window_open()`,
which in turn passes it to `WM_window_title()`, which can take a nullptr
as a title, in which case the title is computed dynamically from the
window area name.
2025-07-22 14:51:12 +02:00
Nathan Vegdahl
d7c6cbc6bf Core: Sanitize ID/struct names when used in path templates
In #139438 we added three path template variables that get their values
from user-specified names:

- `scene_name`
- `camera_name`
- `node_name`

These names can contain characters that are illegal in filenames on some
systems, and also characters like "/" that would be interpreted as path
separators in a filepath. This can lead to unexpected outcomes.

For example, if a node's name is "Hue/Saturation" and the `{node_name}`
variable is used in a path, it would result in a "Hue" directory which
in turn contains a "Saturation" file. This is almost certainly not what
the user intended, because the slash in that name is not semantically
supposed to be a path separator.

This PR addresses this problem by splitting string variables into two
types: strings and filepaths. The contents of string variables are
sanitized to be valid filenames when substituted into a path template,
but the contents of filepath variables are left as-is.

Variables such as `blend_name`, `blend_dir`, etc. that actually
represent path components are then added as filepath variables, while
variables such as `scene_name` that represent plain strings without path
semantics are added as string variables.

Pull Request: https://projects.blender.org/blender/blender/pulls/142679
2025-07-22 14:47:56 +02:00
Habib Gahbiche
907d023b83 Fix #142811: UV edit cage no longer has corner scale points
The commit `b3a5d03bd0` introduced a new draw option for cage gizmos to
draw corners. This was turned off by default to prevent it being
visible in circular 2d gizmos.

This fix turns the corner draw option back on explicitly. Note: The
relevant 2D gizmo already sets  `ED_GIZMO_CAGE_XFORM_FLAG_SCALE`, so no
 changes in transform options are required.

Pull Request: https://projects.blender.org/blender/blender/pulls/142840
2025-07-22 13:48:55 +02:00
Lukas Tönne
238b845166 Fix #142630: Custom socket polling fails due to missing a "base" type
Adding a custom node socket in a node group fails, because the socket
type no longer passes the poll function.

Socket type polling for generated enum items was changed in #138824:
The socket type enum is based on the position in the socket types list,
but regular sockets generate many subtypes that should not appear in the
enum. Therefore only the "base type" of the socket is used for the enum
entry. Custom sockets, however, do not have a base type and are used
directly. This broke because now any socket type without a base type
is always rejected.

Fixed by handling a missing base type as indicator that the socket type
should be used directly.

Pull Request: https://projects.blender.org/blender/blender/pulls/142816
2025-07-22 11:07:30 +02:00
Clément Foucault
f0254c2dcf Refactor: GPU: Remove unnecessary C wrappers for textures
This is the first step into merging `DRW_gpu_wrapper.hh` into
the GPU module.

This is very similar to #119825.

Pull Request: https://projects.blender.org/blender/blender/pulls/142732
2025-07-22 09:48:10 +02:00
Christoph Lendenfeld
748958f084 Fix #141982: Screenshot drawing incorrect on Mac
The issue was the direct use of `window->size[x/y]`
for drawing. Using `WM_window_native_pixel_size` instead fixes the issue

Pull Request: https://projects.blender.org/blender/blender/pulls/142204
2025-07-22 09:48:02 +02:00
YimingWu
346464d491 Fix #142749: Geometry Nodes: Add float4x4 case in get_field_type_name
When hovering on a matrix field socket, `get_field_type_name` can fail
because of missing `float4x4` case. Now it will properly return a
"Matrix Field" name.

Pull Request: https://projects.blender.org/blender/blender/pulls/142794
2025-07-22 09:36:37 +02:00
Pratik Borhade
29b90af679 Shape Key: Delete selected keyblocks
Now that multi-select works with shape key, support deleting selected
keyblocks. New function `shape_key_is_selected` being introduced that
returns true for selected/active shape keys

Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/141881
2025-07-22 09:06:58 +02:00
Germano Cavalcante
66ef7f5621 Fix #142314: Crash popup blocks automation in background mode
Crash popups were being displayed even when Blender was running in
background mode, causing the process to hang and blocking automated
workflows (e.g., render farms).

Therefore, disable the crash popup when running in background mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/142518
2025-07-22 09:04:14 +02:00
Campbell Barton
c7ac5240d8 Core: use UTF8 string formatting for BKE_image (missed last commit) 2025-07-22 16:50:59 +10:00
Campbell Barton
4d4f518d80 Core: use UTF8 string formatting for BKE_image
Also use UTF8 string functions elsewhere for RenderSlot::name &
RenderView::name.
2025-07-22 16:41:13 +10:00
Campbell Barton
0501555dcc BLI_string: add UTF8 aware BLI_snprintf functions & macros
BLI_snprintf and related functions could truncate partial UTF8
code-points, which would then cause problems elsewhere -
Python raises an exception when accessing for example.

Existing uses of BLI_snprintf should use the UTF8 versions in most
cases, except for file paths which are not required to be UTF8.
2025-07-22 16:25:51 +10:00
Campbell Barton
53136a0b53 Cleanup: format 2025-07-22 16:00:11 +10:00
Campbell Barton
5f6a07240f Cleanup: avoid redundant string formatting 2025-07-22 15:53:14 +10:00
Campbell Barton
dd49c50ccf Cleanup: remove redundant calls to strlen, don't cast "const" away 2025-07-22 15:18:45 +10:00
Campbell Barton
13dc1ba1d3 Fix: incorrect string size writing to RenderStats::scene_name
Bytes for the ID-code were subtracted twice when initalizing
render status scene_name for baking.
2025-07-22 14:45:12 +10:00
Campbell Barton
7b83c7d761 Cleanup: declare variables when assigned 2025-07-22 12:08:00 +10:00
Campbell Barton
c045ce324b Cleanup: remove redundant checks in BLI_snprintf functions
Checking for -1 only makes sense for signed types.
2025-07-22 11:59:43 +10:00
Campbell Barton
996210999b Cleanup: use C style comments for descriptive text, doxygen doc-strings
Also replace add-hoc groups in BKE_collision.h with doxy groups.
2025-07-22 11:59:43 +10:00
Campbell Barton
81e4558ab6 Cleanup: reduce right-shift in Python scripts 2025-07-22 11:59:43 +10:00
Campbell Barton
2b0764222f Cleanup: clarify the purpose of full-screen areas
It wasn't obvious why a full-screen area should also disable gizmos.
Also move screen check last to avoid context member access.
2025-07-22 11:59:43 +10:00
Charles S
36e52ba853 Fix #142006: Color Jitter produces black points in Material mode
This fixes a bug caused by 96e549c092. Before the change, the
`randomize_color` function passed through the `color.a` value in the
returned rgba color. The alpha is `1` when the color mode is Color
Attribute and `0` when it's Material. After the patch, it was hard
coded to `1`. This fixes it by passing the `color.a` back through
again.

Pull Request: https://projects.blender.org/blender/blender/pulls/142642
2025-07-22 02:42:42 +02:00
Campbell Barton
f6cacb14da Build: unbreak building WITH_FFMPEG=OFF 2025-07-22 09:56:54 +10:00
Harley Acheson
2ae08d3cbe Fix #141550: Pad Editor Outline to Avoid Blurriness
At low scale and on regular DPI displays the editor outline, being just
a single pixel can sometimes look blurry. Padding by half a pixel (that
is not increased with scale, DPI, or line size) avoids this blurriness.

Pull Request: https://projects.blender.org/blender/blender/pulls/142777
2025-07-22 01:31:41 +02:00
Sean Kim
b0bf71cadf Fix #142557: UV Editor 'Show Faces' toggle doesn't work
Caused by 490ab44e47

The `show_face_overlay_` private property needs to be set correctly when
an object is in Edit Mode and the Space is the UV editor.

Pull Request: https://projects.blender.org/blender/blender/pulls/142739
2025-07-22 00:31:37 +02:00
Sean Kim
063917b929 Cleanup: Replace index calculation with helper function
Pull Request: https://projects.blender.org/blender/blender/pulls/142424
2025-07-21 23:38:47 +02:00
Jacques Lucke
c20b67a6c0 Cleanup: quiet unused variable warning 2025-07-21 22:37:55 +02:00
Harley Acheson
551cb3b939 Fix #142669: Show AZONE_FULLSCREEN for Sequencer RGN_TYPE_PREVIEW
Switching to full screen mode with panel hiding normally shows a button
at the top-right to switch back. But only for RGN_TYPE_WINDOW regions.
This PR just adds RGN_TYPE_PREVIEW to the regions that show this.

Pull Request: https://projects.blender.org/blender/blender/pulls/142754
2025-07-21 21:34:48 +02:00
Hans Goudey
d84f10f2a0 Fix #142583: Uninitialized data in edit UV lines index buffer
Caused by a slightly weird API, that has no good way to recieve
the final size of a partially used index buffer. Until this is refactored
more, just assign this data manually.

Pull Request: https://projects.blender.org/blender/blender/pulls/142748
2025-07-21 21:06:49 +02:00
Aras Pranckevicius
d89c9c5155 Video: HDR video input/output support
HDR video files are properly read into Blender, and can be rendered out
of Blender.

HDR video reading / decoding:

- Two flavors of HDR are recognized, based on color related video
  metadata: "PQ" (Rec.2100 Perceptual Quantizer, aka SMPTE 2084) and
  "HLG" (Rec.2100 Hybrid-Log-Gamma, aka ARIB STD B67). Both are read
  effectively into floating point images, and their color space
  transformations are done through OpenColorIO.
- The OCIO config shipped in Blender has been extended to contain
  Rec.2100-PQ and Rec.2100-HLG color spaces.
- Note that if you already had a HDR video in sequencer or movie clip,
  it would have looked "incorrect" previously, and it will continue to
  look incorrect, since it already has "wrong" color space assigned to
  it. Either re-add it (which should assign the correct color space),
  or manually change the color space to PQ or HLG one as needed.

HDR video writing / encoding"

- For H.265 and AV1 the video encoding options now display the HDR mode.
  Similar to reading, there are PQ and HLG HDR mode options.
- Reference white is assumed to be 100 nits.
- YUV uses "full" ("PC/jpeg") color range.
- No mastering display metadata is written into the video file, since
  generally that information is not known inside Blender.

More details and screenshots in the PR.

Co-authored-by: Sergey Sharybin <sergey@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/120033
2025-07-21 19:26:07 +02:00
Bastien Montagne
7c7c68fd7a Refactor: Cleanup Library FileData handling.
Add an explicit 'is owning' tag for libraries' FileData pointer, and
factorize code cleaning it up into a small util function.

Also allows to get rid of the weird ugly exception case in `link_end`
code for the 'root' library filedata, which is usually owned by caller
code and should not be freed here.

Pull Request: https://projects.blender.org/blender/blender/pulls/142723
2025-07-21 17:59:17 +02:00
Lukas Tönne
828bd83734 Fix #142163: Instance attributes can be invalid on curves
The "curve_type" attribute in curves geometry is built-in and only valid with
a `int8` type on the `Curves` attribute domain. Adding it with a different type
on instance geometry is fine though, but causes invalid attribute writer access
when realizing the instances.

Pull Request: https://projects.blender.org/blender/blender/pulls/142218
2025-07-21 16:15:45 +02:00
Hans Goudey
1d4acb809a Mesh: Slightly simplify BKE_mesh_uv_vert_map_create code
The UV values for a face are contiguous anyway, there's no need
to put them into a temporary vector. Also compute them the UV
map windings in parallel, and avoid unnecessarily adding up the
size of every face.

Pull Request: https://projects.blender.org/blender/blender/pulls/142415
2025-07-21 16:11:37 +02:00
Hans Goudey
dfeb425e51 Cleanup: Improve BKE_mesh_uv_vert_map_create arguments
Use Span and modern naming for mesh data.
2025-07-21 16:11:37 +02:00
Hans Goudey
a9865f5119 Cleanup: Remove unused arguments to BKE_mesh_uv_vert_map_create 2025-07-21 16:11:37 +02:00
Miguel Pozo
ee39f43bf0 Fix #142255: Unbound resource for point clouds
Same fix as #142265, but for point clouds.

Pull Request: https://projects.blender.org/blender/blender/pulls/142396
2025-07-21 15:14:58 +02:00
Miguel Pozo
a8975bf651 Fix #142097: Vulkan: Crash with unbound textures
On the Vulkan side, ensure that unbound textures don't result in
accessing uninitialized or out of bounds memory.
On the Draw side, ensure all Hair and Curves attributes have, at least,
a dummy attribute bound.

Pull Request: https://projects.blender.org/blender/blender/pulls/142265
2025-07-21 15:14:10 +02:00
Guillermo Venegas
230813f2ab Cleanup: UI: Remove redundant namespace prefixes
A follow-up from recent UI refactors.

Pull Request: https://projects.blender.org/blender/blender/pulls/141920
2025-07-21 15:08:12 +02:00
Richard Antalik
40b2cd92ee Fix #142195: Crash when adding stereo 3D image
Caused by assigning pointer to address which is eventually freed.

Use `MEM_mallocN()` with copy assignment instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/142361
2025-07-21 14:05:31 +02:00