Commit Graph

7124 Commits

Author SHA1 Message Date
Omar Emara
a4502f82c1 Compositor: Add Image Coordinates node
This patch adds a new Image Coordinates node for the compositor. The
Texture Coordinates and Pixel Coordinates outputs were removed from the
Image Info node and were added to the new node instead. Additionally, a
new Normalized Coordinates output was added.

The Pixel Coordinates output now no longer includes half pixel offsets.

Pull Request: https://projects.blender.org/blender/blender/pulls/138935
2025-05-26 08:25:06 +02:00
Bastien Montagne
4baf428e5b Fix (unreported) BLO: Missing some blendfile version info in some Library Mains.
Readfile code would not always properly set the main file version number
in 'split' Mains created for a library, and would also not detect
'future versions' blendfiles.

This info is currently not used by linking code, so this should be a
no-op change in current main.
2025-05-24 20:55:42 +02:00
Bastien Montagne
ebefbcaeb0 Cleanup: Fix incorrect comment about name size of BLODataBlockInfo. 2025-05-23 15:55:39 +02:00
Campbell Barton
8ab1a2bd13 Fix array size for NodeImageMultiFileSocket::layer
Regression from [0] this was meant to be `EXR_TOT_MAXNAME - 2`,
but wasn't updated when `EXR_TOT_MAXNAME` changed.

Also use UTF8 string copying since it's expected to be UTF8.

[0]: 2c8db87897
2025-05-23 13:49:40 +00:00
Omar Emara
6c62fb5ff6 Compositor: Turn Color Balance options to inputs
This patch turns the options of the Color Balance node into inputs.

In the process, each of the wheels were split into two inputs, a base
float and a color. For instance, Gain is controlled using both a Base
Gain and Color Gain, the former controls the gain for all channels while
the latter controls it per channel.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/138610
2025-05-23 15:42:54 +02:00
Jacques Lucke
0b24f15939 Spreadsheet: persistent table layouts
The main goal of this patch is that the column widths and ordering is not reset
every time one switches between different contexts.

It does that by keeping track of multiple `SpreadsheetTable`. There is one for
each table that is viewed (so e.g. the point and edge domain of the same mesh
are two different tables). Each table has an identifier and an array of columns.

There is some garbage collection in place so that the number of stored tables
does not increase unbounded.

This also comes with an updated Python API:
```python
import bpy
spreadsheet = bpy.context.screen.areas[...].spaces.active
active_table = spreadsheet.tables.active
print(active_table.id.type)
print(active_table.id.attribute_domain)
print(active_table.columns[0].id.name)
```

In the future, we might add some smarter logic to keep tables with different
identifiers more in sync. We don't have a great heuristic for that yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/139205
2025-05-23 06:07:04 +02:00
Campbell Barton
99a4c93081 Cleanup: inline array sizes in code-comments
Use a similar convention for struct member identifiers,
(the identifiers without surrounding spaces). This allows the values
to be scanned and validated.
2025-05-23 00:41:39 +10:00
Eqkoss / T1NT1N
a12bce039f Lights: Add temperature property
Similar to other renderers, this adds a temperature property to set the
light color using blackbody emission. This can be more convenient than
using nodes, and can improve interop with other software.

This is supported in Cycles, EEVEE, Hydra, USD, COLLADA and FBX.

Pull Request: https://projects.blender.org/blender/blender/pulls/134303
2025-05-22 16:32:44 +02:00
Christoph Lendenfeld
87a28fa117 Anim: Common Playhead snapping for all editors
This patch adds snapping options for the playhead to all animation editors.
The options can be modified through a new dropdown in the editor header.

All editors will show all those options, and they are shared,
so toggling the option in on editor will change it for all other editors too.
Some options are not working/relevant in some editors for example
Strips in the Dope Sheet. However for consistency the option is still shown.
This is a separate menu from the transform snapping menu because
you can toggle the snapping for transform and playhead separately.
Putting it in the existing snapping transform menu would imply that it can
be turned off with the magnet which is not the case.

Playhead snapping is explicitly disabled for the drivers editor
because there is no playhead to drag around.

Snapping to Frame/Second intervals takes the scene start as a starting point.
That means you can snap to the n-th second of the animation even though
it might not start at frame 1. The preview range is NOT taken into account
by design since the use case is working on a sub-section of the animation
in which case the snap target should not change.

Snapping is toggled by pressing CTRL as indicated by the status bar.

Snapping to Frames/Seconds is absolute, meaning no matter
how far away your cursor it will snap to the closest snap point.
All others only snap to things if they are close to the cursor in pixel values.
When mixing those two behaviors, it prefers relative snapping.
If no point is close enough to snap relative,
it will fall back to absolute snapping.

Based on the prototype #135913
Part of #135794

Pull Request: https://projects.blender.org/blender/blender/pulls/137278
2025-05-22 10:17:19 +02:00
Campbell Barton
0bd62779e8 Cleanup: various non-functional changes for C++ 2025-05-22 01:01:08 +00:00
Omar Emara
14f7faf283 Compositor: Turn Crop node options to inputs
This patch turns the options of the Crop node into inputs.

Instead of specifying the bounds of the crop, the inputs now specify the
Width and Height of the crop region. The Crop Image Size option was
renamed to Alpha Crop and inverted, so it now defaults to actual
cropping. The Relative option was removed, as it is now superseded by
the Relative To Pixel node, and removal was done to facilitate the
options to inputs project.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/139163
2025-05-21 11:01:25 +02:00
Omar Emara
aa6a0638ff Compositor: Remove Relative option from Translate node
This patch removes the Relative option from the Translate node. This is
now superseded by the Relative To Pixel node, and removal was done to
facilitate the options to inputs project.

Pull Request: https://projects.blender.org/blender/blender/pulls/139147
2025-05-20 16:05:07 +02:00
Campbell Barton
7883412cde Cleanup: rename Curve::type -> ob_type, remove BKE_curve_type_get
It's not common for object data to reference it's object type
so name the struct member to make this clear.

Also remove BKE_curve_type_get which is no longer needed.
2025-05-20 10:11:56 +00:00
Campbell Barton
8fea423e00 Fix #139133: Crash entering edit mode for curve/text objects
- Make Curve::type the source of truth for the curve type,
  instead of Curve::vfont, since it's possible for this to be
  set to null from RNA which effectively changed it's type.
  See #138730.

- Update objects to match the curve type on file read.

  Without this, an object may link to a curve in another file which
  can be replaced by a curve data-block of a different type.

  Note that updating the object type was already being done
  when reloading library data and setting object data,
  just not on file load.

Ref !139137
2025-05-20 19:28:49 +10:00
Campbell Barton
cd2be77610 Cleanup: remove unnecessary curve type check
Calculating the curve type isn't needed for data which is only written
for text curves.

Note that this complicates a fix for #139133 which changes how curve
type data is accessed, where a version of BKE_curve_type_get that used
old behavior would have had to be kept for version patching.
2025-05-20 15:43:22 +10:00
Aras Pranckevicius
e2b43a4dba Cleanup: armature bone display type naming
- User visible rename: "Use Armature Setting" -> "Armature Defined"
  (just added in 8bf73386f2)
- Internal code only: rename eArmature_Drawtype enum items to have
  ARM_DRAW_TYPE_ prefix, instead of just ARM_ (just ARM_ is used in
  several unrelated enums, leading to confusion)

This is re-apply of PR !138982 was backed out in cef7cb4534 due to
Win x64 buildbot failure. The error was:
```
view3d_navigate_view_all.cc(321): error C2672: 'blender::bounds::transform_bounds': no matching overloaded function found
view3d_navigate_view_all.cc(322): error C2784: 'blender::Bounds<blender::VecBase<T,3>> blender::bounds::transform_bounds(const blender::MatBase<T,Size,Size,NumCol*NumRow%4==0?4:1*sizeof(T)> &,const blender::Bounds<blender::VecBase<T,3>> &)': could not deduce template argument for 'const blender::MatBase<T,Size,Size,NumCol*NumRow%4==0?4:1*sizeof(T)> &' from 'const blender::float4x4'
```
which has nothing whatsoever to do with the PR. But something
in the PR (i.e. rename of a completely unrelated enum entries)
presumably makes this specific VS2019 compiler version not be
able to resolve template argument type. Again, in completely
unrelated file with completely unrelated types.

So "the fix" is to help VS2019 compiler in that place by explicitly
specifying the template types. What exactly in the original
change triggers the issue, remains a mystery. "It is known" that
VS2019 is quite funky in template argument deduction, maybe this
is one of these cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/138995
2025-05-17 08:36:33 +02:00
Campbell Barton
eaedc88c48 Cleanup: remove unnecessary system headers 2025-05-17 01:59:21 +00: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
Thomas Dinges
cef7cb4534 Revert "Cleanup: armature bone display type naming"
This reverts commit 2149f462d4 (broke Windows x64 compilation on CI).

Pull Request: https://projects.blender.org/blender/blender/pulls/138994
2025-05-16 21:01:41 +02:00
Aras Pranckevicius
2149f462d4 Cleanup: armature bone display type naming
- User visible rename: "Use Armature Setting" -> "Armature Defined"
  (just added in 8bf73386f2)
- Internal code only: rename eArmature_Drawtype enum items to have
  ARM_DRAW_TYPE_ prefix, instead of just ARM_ (just ARM_ is used in
  several unrelated enums, leading to confusion)

Pull Request: https://projects.blender.org/blender/blender/pulls/138982
2025-05-16 15:35:56 +02:00
Aras Pranckevicius
8bf73386f2 Anim: support per-bone "Display As" overrides
Armature bone display mode (Octahedral, Stick, Envelope, B-Bone,
Wire) could only be set on the whole armature. This adds ability to
override the display mode per-bone (by default bones use the
same display mode as the armature).

Images in the PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/138445
2025-05-16 15:06:36 +02:00
John Kiril Swenson
41781df1a6 Cleanup: VSE: Rename seq1 and seq2 references
This patch renames `seq1` and `seq2` to `input1` and `input2` in `Strip`
and `StripSelection` structs to consist with recent refactors in
#132179.  It also renames other instances of `seq1` and `seq2` (e.g.
local variables) to `strip1` and `strip2` instead.

There is only one small breaking change to the Python API with
`strips.new_effect()` taking in the new names now. There should be
no other functional changes involved.

Pull Request: https://projects.blender.org/blender/blender/pulls/138296
2025-05-15 05:01:39 +02:00
Campbell Barton
e97e9c2904 Cleanup: various non functional changes for C++ 2025-05-15 10:26:47 +10:00
Aras Pranckevicius
9e4c26574a VSE: new cache implementation
Rework internals of how VSE caching is done. Primarily to make all the
caching logic more understandable from development point of view, but
also has several user visible implications (more details in the PR):
- Simpler and fewer caching UI options,
- Disk cache is gone (primary reason: proxies are kinda the same thing),
- VSE cache size set in preferences is actual size used for VSE caches
  now (previously caching stopped as soon as whole Blender used that
  much memory, even if some memory usage was not about VSE at all),
- Certain scenarios of cache invalidation are faster now.

Pull Request: https://projects.blender.org/blender/blender/pulls/137926
2025-05-14 12:59:46 +02:00
Omar Emara
17db65dfd0 Compositor: Remove Gamma from Blur and Defocus nodes
This patch removes the Gamma option from the Defocus and Blur nodes. The
reasoning is as follows.

- The option was originally added when the compositor wasn't working on
  a strictly linear workflow. So this is rarely needed now.
- It is easy to insert a Gamma node around Blur nodes to perform any
  gamma correction if really needed.
- Since we are moving options to inputs, it doesn't seem worth it to
  provide this option as an input in the process.

Pull Request: https://projects.blender.org/blender/blender/pulls/138673
2025-05-12 13:18:46 +02:00
Jacques Lucke
9fd7a093c9 DNA: support getting sdna id for static DNA type
This adds a new `DNA_sdna_type_ids.hh` header:
```cpp
namespace blender::dna {

/**
 * Each DNA struct has an integer identifier which is unique within a specific
 * Blender build, but not necessarily across different builds. The identifier
 * can be used to index into `SDNA.structs`.
 */
template<typename T> int sdna_struct_id_get();

/**
 * The maximum identifier that will be returned by #sdna_struct_id_get in this
 * Blender build.
 */
int sdna_struct_id_get_max();

}  // namespace blender::dna
```

The `sdna_struct_id_get` function is used as replacement of
`SDNA_TYPE_FROM_STRUCT` in all places except the DNA defaults system. The
defaults system is C code and therefore can't use the template. There is ongoing
work to replace the defaults system as well though: #134531.

Using this templated function has some benefits over the old approach:
* No need to rely on macros.
* Can use type inferencing in functions like `BLO_write_struct` which avoids
  redundancy on the call site. E.g. `BLO_write_struct(writer, ActionStrip,
  strip);` can become `BLO_write_struct(writer, strip);` which could even become
  `writer.write_struct(strip);`. None of that is implemented as part of this
  patch though.
* No need to include the generated `dna_type_offsets.h` file which contains a
  huge enum.

Implementation wise, this is done using explicit template instantiations in a
new file generated by `makesdna.cc`: `dna_struct_ids.cc`. The generated file
looks like so:
```cpp
namespace blender::dna {

template<typename T> int sdna_struct_id_get();

int sdna_struct_id_get_max();
int sdna_struct_id_get_max() { return 951; }

}
struct IDPropertyUIData;
template<> int blender:🧬:sdna_struct_id_get<IDPropertyUIData>() { return 1; }
struct IDPropertyUIDataEnumItem;
template<> int blender:🧬:sdna_struct_id_get<IDPropertyUIDataEnumItem>() { return 2; }
```

I tried using static variables instead of separate functions, but I didn't
manage to link it properly. Not quite sure yet if that's an actual limitation or
if I was just missing something.

Pull Request: https://projects.blender.org/blender/blender/pulls/138706
2025-05-12 11:16:26 +02:00
Campbell Barton
5e75a9c1e8 Cleanup: spelling in comments 2025-05-11 17:00:47 +10:00
Jacques Lucke
d9b91c73e3 Core: use template for BKE_id_new
This is the same change as e09ccc9b35 but for `BKE_id_new`.

Pull Request: https://projects.blender.org/blender/blender/pulls/138667
2025-05-09 16:13:25 +02:00
Omar Emara
a84de8067b Compositor: Remove Offset from Scale node
This patch removes the translation Offset from the Scale node. The
reasoning is that it is easy to insert a Translate node afterwards to
perform any necessary translation. And since we are moving options to
inputs, it doesn't seem worth it to provide those offsets as inputs in
the process.

Pull Request: https://projects.blender.org/blender/blender/pulls/138668
2025-05-09 15:46:41 +02:00
Omar Emara
fd3ca68b5e Compositor: Turn Bokeh Blur options to inputs
This patch turns the options of the Bokeh Blur node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/138664
2025-05-09 14:15:14 +02:00
Sean Kim
631c329d19 Fix: Incorrect versioning of brush tip_scale_x
The old versioning code was not guarded in a `MAIN_VERSION_FILE_ATLEAST`
check and the RNA hard minimum was not updated to prevent setting this
to an invalid value.

Pull Request: https://projects.blender.org/blender/blender/pulls/138572
2025-05-08 22:35:48 +02:00
Nathan Vegdahl
e0beb7afe6 Templates for render output paths
This adds basic templating support to render output paths. By putting
"{variable_name}" in the path string, it will be replaced by the named
variable's value when generating the actual output path. This is similar
to how "//" is already substituted with the path to the blend file's
current directory.

This templating system is implemented for both the primary render output
path as well as the File Output node in the compositing nodes. Support
for using templates in other places can be implemented in future PRs.

In addition to the "{variable_name}" syntax, some additional syntax is
also supported:

- Since "{" and "}" now have special meaning, "{{" and "}}" are now
  escape sequences for literal "{" and "}".
- "{variable_name:format_specifier}", where "format_specifier" is a
  special syntax using "#", which allows the user to specify how numeric
  variables should be formatted:
  - "{variable_name:###}" will format the number as an integer with at
    least 3 characters (padding with zeros as needed).
  - "{variable_name:.##}" will format the number as a float with
    precisely 2 fractional digits.
  - "{variable_name:###.##}" will format the number as a float with at
    least 3 characters for the integer part and precisely 2 for the
    fractional part.

For the primary render output path: if there is a template syntax error,
a variable doesn't exist, or a format specifier isn't valid (e.g. trying
to format a string with "##"), the render that needs to write to the
output path fails with a descriptive error message.

For both the primary and File Output node paths: if there are template
syntax errors the field is highlighted in red in the UI, and a tooltip
describes the offending syntax errors. Note that these do *not* yet
reflect errors due to missing variables. That will be for a follow-up
PR.

In addition to the general system, this PR also implements a limited set
of variables for use in templates, but more can be implemented in future
PRs. The variables added in this PR are:

- `blend_name`: the name of the current blend file without the file
  extension.
- `fps`: the frames per second of the current scene.
- `resolution_x` and `resolution_y`: the render output resolution.

Pull Request: https://projects.blender.org/blender/blender/pulls/134860
2025-05-08 15:37:28 +02:00
Aras Pranckevicius
9c8a7b8d11 Cleanup: factor out 4.4 versioning code into versioning_440.cc
Pull Request: https://projects.blender.org/blender/blender/pulls/138549
2025-05-08 14:52:21 +02:00
Aras Pranckevicius
bb79b4920f Cleanup: factor out 4.3 versioning code into versioning_430.cc 2025-05-08 14:52:20 +02:00
Aras Pranckevicius
9cc97dd42b Cleanup: factor out 4.2 versioning code into versioning_420.cc 2025-05-08 14:52:20 +02:00
Aras Pranckevicius
767cf78dda Cleanup: factor out 4.1 versioning code into versioning_410.cc 2025-05-08 14:52:20 +02:00
Aras Pranckevicius
c8e2dc4fc0 Cleanup: factor out 4.0 versioning code into versioning_400.cc 2025-05-08 14:52:20 +02:00
Aras Pranckevicius
b440b588ac Cleanup: Rename versioning_400.cc -> versioning_450.cc 2025-05-08 14:52:20 +02:00
Sergey Sharybin
18110744a2 Sequencer: Support HDR in Sequencer Preview
The title is pretty self-explanatory: this change brings support of
displaying HDR content in the sequencer preview. Before this change
it was clamped to the 0..1 range, now it is unclamped sRGB, similar
to how image editor, viewport, and nodes backdrop works.

The general idea is to draw the sequencer content on a non-overlay
frame-buffer and tag viewport as having non-standard input color
space as the sequencer operates in a different space.

The way it is done mimics what happens from the draw manager side
for the nodes backdrop, but bypassing the image engine. Partially
because the image engine expects the Image data-block to be displayed,
but also because of performance: there are a lot of things going on
like float buffer creation, clamping etc. Overall the image engine is
not fast enough for the sequencer needs.

Code-side changes that worth mentioning to highlight the overall
direction for the possible future refactors in the area:

- Decouple arguments from the scene: editing, render data, color
  management etc are now passed as individual arguments.

  This is an anticipation of story tools project where this data
  might be coming from a different place.

- Move the entire preview region drawing to sequencer_preview_draw.cc

  Previously logic was split across sequencer_preview_draw.cc and
  space_sequencer.cc which was quite tricky to know what should go
  where.

- Split functions which had boolean argument to define their behavior
  into individual functions.

  Generally if a function has boolean argument used in a way

    if(foo) { do_something_(); } else { do_something_else() }

  it is a good indication that the function is to be split.

Pull Request: https://projects.blender.org/blender/blender/pulls/138094
2025-05-07 16:21:07 +02:00
Sergey Sharybin
d7aa98d07f Sequencer: Remove backdrop drawing in timeline
It always was functionality which got committed without proper review
by the module or UI/UX team. It has all sort of UX problems, but it is
also something that will be tricky to support for HDR drawing.

To brings things to a more manageable state the functionality is now
removed.
2025-05-07 16:21:06 +02:00
Campbell Barton
8069bf801b Cleanup: use toolsettings variable in scene defaults versioning 2025-05-07 17:40:54 +10:00
Jacques Lucke
ed29ab303c Blenloader: extract blenloader core library for use in blendthumb
We recently started using blenloader code in blendthumb to avoid having to
reimplement some parts of .blend file parsing. While this works, it has the side
effect that on Windows referencing blenloader code increased the binary size of
blendthumb from < 1MB to ~75 MB. That happens because this dependency drags
along lots of other code which effectively is unused, but the compiler is unable
to remove it.

There didn't seem to be a simple solution to make msvc optimize the unused code
away. This patch solves the issue by extracting the shared code into a separate
`blenloader_core` module which does not depend on the rest of Blender (except
blenlib). Therefore, using this new module in blendthumb does not drag along all
the other dependencies, bring its file size back down.

In the future, more code may be moved from blenloader to blenloader_core, but
for now I extracted these two headers:
* `BLO_core_bhead.hh`: Various `BHead` types and related parsing functions.
* `BLO_core_blend_header.hh`: Parsing of the header at the beginning of .blend
  files.

Pull Request: https://projects.blender.org/blender/blender/pulls/138371
2025-05-07 04:51:50 +02:00
John Kiril Swenson
28b1a33e16 Fix #138180: VSE zoom left-aligned for old files
Patch #137802 made VSE zoom levels constant when resizing the area,
choosing to also align the V2D to the left when horizontally resizing.
This had the added side-effect of causing zooming to be left-aligned. The
fix was attempted in #138041 (and subsequent commit 385a8a4d6a).

However, the versioning code to add the fix (`V2D_ZOOM_IGNORE_KEEPOFS` flag)
was included in the original versioning block instead of a new one. This
meant that newly saved files during the bug did not get the fix applied.

Fix by moving that flag application to a new versioning block.

Pull Request: https://projects.blender.org/blender/blender/pulls/138424
2025-05-06 19:54:14 +02:00
YimingWu
3cd15d70b2 Fix #138398: Physics: Re-init rbw->shared->runtime loading old files
`RigidBodyWorld_Shared::runtime` is always expected to be valid. This
fix does this versioning for old files.

Pull Request: https://projects.blender.org/blender/blender/pulls/138418
2025-05-05 19:18:32 +02:00
Sergey Sharybin
bbfc97ad6f Move tests/data and assets to the main repository
This change moves the tests data files and publish folder of assets
repository to the main blender.git repository as LFS files.

The goal of this change is to eliminate toil of modifying tests,
cherry-picking changes to LFS branches, adding tests as part of a
PR which brings new features or fixes.

More detailed explanation and conversation can be found in the
design task.

Ref #137215

Pull Request: https://projects.blender.org/blender/blender/pulls/137219
2025-05-05 15:10:22 +02:00
Omar Emara
1f51172692 Compositor: Turn Alpha Over options to inputs
This patch turns the options of the Alpha Over node into inputs.

In the process, Convert Premultiplied option was renamed to Straight
Alpha.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/138441
2025-05-05 14:16:27 +02:00
Omar Emara
ebe67e5ca0 Compositor: Remove Premultiplied option from Alpha Over node
This patch removes the Premultiplied option from the Alpha Over node.
The reasoning is as follows:

- The option mixed between alpha being straight and premultiplied, a
  state which doesn't happen in practice.
- The option conflicts with the Convert Premultiplied option, if it is
  not zero, then Convert Premultiplied does nothing.
- The option is implemented in a lossy way. It premultiplies the alpha
  assuming it is straight, then converts the result to straight again,
  then mixed between both results. This is as opposed to mixing the
  original straight input with the premultiplied input. The successive
  alpha conversion causes data loss in transparent regions.

Pull Request: https://projects.blender.org/blender/blender/pulls/138428
2025-05-05 10:51:34 +02:00
Omar Emara
92ac9f3b25 Compositor: Remove Premultiplied option from Brightness node
This patch removes the Convert Premultiplied option from the Brightness
and Contrast node. The reasoning is that it is the only node that has
the option to operate on straight alpha, while not being particularly
different. Adding alpha conversion nodes around it is also very easy.
Furthermore, alpha conversion is a lossy operation, so the option looses
data in emissive pixels, and since it is enabled by default, users not
familiar with the exact mechanism of the option wouldn't know how to fix
this.

Pull Request: https://projects.blender.org/blender/blender/pulls/138318
2025-05-05 08:33:29 +02:00
Bastien Montagne
276fac2294 Harden blendfile reading against fully corrupted input data.
'Fixes' the "curveprofile" case of #137870, by immediately crashing
on nullptr access instead of allowing readfile code to further access
memory detected as invalid (which would most likely lead to a crash
later anyway).

I don't think we can expect readfile code to gracefully abort at such a
low-level error detection, not without using some form of exception
handling at least? Otherwise the whole readfile code would have to
constantly check for invalid flag in the Mains.

Pull Request: https://projects.blender.org/blender/blender/pulls/138145
2025-05-02 14:29:11 +02:00
Omar Emara
4cb69dafb0 Compositor: Remove Use Alpha option from Composite and Viewer node
This patch removes the Use Alpha option from Composite and Viewer nodes.
The reasoning for the removal is as follows:

- It has an unintuitive complicated design at the moment.
  - If the Alpha Input is unlinked, the output alpha is not adjusted
    even if Use Alpha is enabled, leaving users wondering why their
    adjustments have no effect.
  - Disabled Use Alpha means output an opaque image, that is, it
    actually means Ignore Alpha. Which is confusing because users might
    think that it controls alpha adjustments based on input.
- It always does alpha replacement without premultiplication, which is
  not clear to the user and is not what the user wants in most cases.
- Adding a Set Alpha node before the output is pretty easy and clear, so
  the option seems redundant considering the above.

Pull Request: https://projects.blender.org/blender/blender/pulls/138309
2025-05-02 12:50:58 +02:00