Commit Graph

2125 Commits

Author SHA1 Message Date
Alaska
8a6d706d77 Utilities: Add batch files to help launch Blender with different GPU backends
With Vulkan now having general feature parity with OpenGL, but with
some stability issues, it has become more important to offer ways for
users to quickly launch Blender with the OpenGL or Vulkan backend
in case Blender is unable to open with one of them.

This commit adds three new batch files to help with this:
- `blender_factory_startup_vulkan.cmd`
  - Launches Blender with factory settings, but with Vulkan enabled.
    Useful for helping test if a Vulkan crash at startup is related to
    a addon.
- `blender_startup_opengl.cmd`
  - Simply launches Blender with the OpenGL backend. It does not change
    any other settings. Useful in case a user has complex user
    preferences, enabled Vulkan for testing, and now Blender crashes on
    startup. Now they want to switch back to OpenGL and they don't want
    to lose their complex user preferences by using
    `blender_factory_startup.cmd`
- `blender_startup_vulkan.cmd`
  - Simply launches Blender with the Vulkan backend. It does not change
    any other settings. Useful for people that encounter #127835 after
    a Windows update. This issue can be worked around by using Vulkan.
    But if you are experiencing the issue and are on the OpenGL
    backend, you can't use the Blender interface and so you can't
    easily switch to the Vulkan backend without the command line
    or a script like this.

Pull Request: https://projects.blender.org/blender/blender/pulls/142169
2025-07-24 09:15:52 +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
aa9eb3dfcb Merge branch 'blender-v4.5-release' 2025-07-10 22:29:24 +10:00
Campbell Barton
8c77f96446 Fix: crash passing in --gpu-backend without an argument 2025-07-10 22:27:04 +10:00
Campbell Barton
16e06a29f0 Cleanup: typo, spelling 2025-07-10 00:38:09 +00:00
Brecht Van Lommel
4653b65f7c Logging: Add DEBUG, TRACE severity, replace numeric levels
The numeric levels have no obvious meaning. This removes the distinction
between severity and levels, instead there is a single list of named levels
with defined meaning.

Debug means information that's mainly useful for developers, and trace is for
very verbose code execution tracing.

Pull Request: https://projects.blender.org/blender/blender/pulls/140244
2025-07-09 20:59:26 +02:00
Brecht Van Lommel
15d5f957ac Logging: Use CLOG for render progress
* Add render category, which is automatically enabled when using -f or -a
  command line flags for background rendering.
* Add extra logs to mention scene, view layer and frame ahead of time rather
  than including it in every line.
* Remaining time was removed from Cycles, this will be added back for animations
  at the render pipeline level.

Pull Request: https://projects.blender.org/blender/blender/pulls/140244
2025-07-09 20:59:26 +02:00
Brecht Van Lommel
d5f84d0016 Logging: Revamp default behavior and command line arguments
* Modify --log-level to accept error/warning/info/debug string values
* Add --log-show-source, now hidden by default
* Remove --log-show-basename, path is now on own line
* Add --log-show-memory
* Remove --log-show-timestamp, now always shown

Pull Request: https://projects.blender.org/blender/blender/pulls/140244
2025-07-09 20:59:26 +02:00
Brecht Van Lommel
8392ca915b Cycles: Remove glog dependency, redirect logs to CLOG
* Add own simple logging system to replace glog, which is no longer
  maintained by Google.
* When building in Blender, integrate with CLOG and print all messages
  through that system instead.
* --log cycles now replaces --debug-cycles. The latter still works but
  is no longer documented.

Pull Request: https://projects.blender.org/blender/blender/pulls/140244
2025-07-09 20:59:24 +02:00
Campbell Barton
517792ea5c Merge branch 'blender-v4.5-release' 2025-06-26 22:08:39 +10:00
Campbell Barton
0417719ae9 Help text: move Vulkan debugging option under "Debug Options" 2025-06-26 21:57:49 +10:00
Campbell Barton
eef3fc50f0 Cleanup: corrections to comments & typos 2025-06-14 12:28:18 +10:00
Clément Foucault
4fe75da973 EEVEE: Remove all remaining reference of EEVEE next
This changes the engine identifier back to `BLENDER_EEVEE`.

We keep the `BLENDER_EEVEE_NEXT` identifier around for
versioning reasons (have to detect when it is the active
engine of a older file).

This also rename a bunch of pannels that were using `next`
in their name.

This is a breaking change for Addons compatibility.

Pull Request: https://projects.blender.org/blender/blender/pulls/140282
2025-06-13 12:36:14 +02:00
Campbell Barton
1a479122eb Fix the animation player making multiple calls to free depsgraph nodes
More of a technicality as it didn't seem to cause problems.
2025-06-13 16:11:25 +10:00
Bastien Montagne
bc80ef136e Big Endian Support Removal.
This commit implements #125759.

It removes:
* Blender does not build on big endian systems anymore.
* Support for opening blendfiles written from a big endian system is
  removed.

It keeps:
* Support to generate thumbnails from big endian blendfiles.
* BE support in `extern` or `intern` libraries, including Cycles.
* Support to open big endian versions of third party file formats:
  - PLY files.
  - Some image files (cineon, ...).

Pull Request: https://projects.blender.org/blender/blender/pulls/140138
2025-06-12 10:37:47 +02:00
Campbell Barton
b6b80b2842 Cleanup: reorder initialization to simplify freeing on early exit 2025-06-11 13:39:22 +00:00
Campbell Barton
f8eec542f4 Core: always free memory on exit, always report leaks
Instead of allowing leaks when parsing arguments, always cleanup before
calling exit(). This impacts -a (animation player), --help & --version
arguments, as well as scripts executed via --python which meant tests
that ran scripts could leak memory without raising an error as intended.

Avoid having suppress warnings & rationalize in code-comments when
leaking memory is/isn't acceptable, any leaks from the animation-player
are now reported as well.

This change exposed leaks: !140182, !140116.

Ref !140098
2025-06-11 19:33:34 +10:00
Campbell Barton
07121d44ae Cleanup: use braces (follow own style guide) 2025-06-11 09:05:26 +00:00
Campbell Barton
8cdccb0154 Refactor: improve error handling for the animation player
- Pass the exit code back from WM_main_playanim instead of calling exit.
- Errors are printed to the stderr.
- Resolve some leaks on exit.

Note that this addresses noisy leaks reported by ASAN which were
flooding the output, but doesn't attempt to address all leaks.
2025-06-10 13:49:41 +10:00
Aras Pranckevicius
5ad6d42c83 IO: Remove Collada import/export
Removes Collada import/export (has been deprecated since 4.2).

Pull Request: https://projects.blender.org/blender/blender/pulls/139337
2025-06-06 08:38:57 +02:00
Campbell Barton
8cecf7a79c Fix failure to start with an unknown --gpu-backend
An unknown --gpu-backend argument would attempt to pass that argument
separately which then attempted to treat is as a blend file,
typically failing to start if the file wasn't found.
2025-06-06 12:24:50 +10:00
Campbell Barton
0b94df6b2a Docs: use single quotes instead of back-ticks
Minor tweaks so text is extracted into the user manual properly.
2025-06-05 17:32:42 +10:00
Campbell Barton
50f3240abd Cleanup: spelling & duplicate terms (check_spelling.py) 2025-05-30 11:03:56 +10:00
Hans Goudey
91803e130f Cleanup: Grammar: Fix uses of "for e.g."
e.g. stands for "exempli gratia" in Latin which means "for example".
The best way to make sure it makes sense when writing is to just expand
it to "for example". In these cases where the text was "for e.g.", that
leaves us with "for for example" which makes no sense. This commit fixes
all 110 cases, mostly just just replacing the words with "for example",
but also restructuring the text a bit more in a few cases, mostly by
moving "e.g." to the beginning of a list in parentheses.

Pull Request: https://projects.blender.org/blender/blender/pulls/139596
2025-05-29 21:21:18 +02:00
Clément Foucault
7245262de8 GPU: Metal: Add --profile-gpu support for CPU timing
The GPU implementation is a bit too complex
to implement for now.

As we are improving shader loading, having the
CPU timings is already helpful.

Note that `Map<size_t, int>` does not compile
on Clang.

This is exposing the `--profile-gpu` option on
all backends as the vulkan backend should follow
shortly.

Pull Request: https://projects.blender.org/blender/blender/pulls/139551
2025-05-28 21:08:38 +02:00
Anthony Roberts
32f7665673 Deps: Add support for ARM64 assembly in x264 and update FFmpeg version
It appears that previously, assembly was straight up disabled for all ARM64 platforms in x264 - this re-enables it.

This also updates the version of FFmpeg to 7.1.1. I updated the patch files so that they would cleanly apply to 7.1.1.

For Windows ARM64, it also switches both of these libraries to use the copy of LLVM we build as part of the deps, instead of MSVC - this gives a small performance increase. To do this for x264, I added a small patch taken from VCPKG - this should be harmless to other platforms.

With all these changes, I was able to get a ~20-30% perf improvement in video transcoding in the sequence editor.

Pull Request: https://projects.blender.org/blender/blender/pulls/137670
2025-05-27 10:20:48 +02:00
Sergey Sharybin
7ceb4495c5 Refactor: OpenColorIO integration
Briefly about this change:
- OpenColorIO C-API is removed.
- The information about color spaces in ImBuf module is removed.
  It was stored in global ListBase in colormanagement.cc.
- Both OpenColorIO and fallback implementation supports GPU drawing.
- Fallback implementation supports white point, RGB curves, etc.
- Removed check for support of GPU drawing in IMB.

Historically it was implemented in a separate library with C-API, this
is because way back C++ code needed to stay in intern. This causes all
sort of overheads, and even calls that are strictly considered bad
level.

This change moves OpenColorIO integration into a module within imbuf,
next to movie, and next to IMB_colormanagement which is the main user
of it. This allows to avoid copy of color spaces, displays, views etc
in the ImBuf: they were used to help quickly querying information to
be shown on the interface. With this change it can be stored in the
same data structures as what is used by the OpenColorIO integration.
While it might not be fully avoiding duplication it is now less, and
there is no need in the user code to maintain the copies.

In a lot of cases this change also avoids allocations done per access
to the OpenColorIO. For example, it is not needed anymore to allocate
image descriptor in a heap.

The bigger user-visible change is that the fallback implementation now
supports GLSL drawing, with the whole list of supported features, such
as curve mapping and white point. This should help simplifying code
which relies on color space conversion on GPU: there is no need to
figure out fallback solution in such cases. The only case when drawing
will not work is when there is some actual bug, or driver issue, and
shader has failed to compile.

The change avoids having an opaque type for color space, and instead
uses forward declaration. It is a bit verbose on declaration, but helps
avoiding unsafe type-casts. There are ways to solve this in the future,
like having a header for forward declaration, or to flatten the name
space a bit.

There should be no user-level changes under normal operation.
When building without OpenColorIO or the configuration has a typo or
is missing a fuller set of color management tools is applies (such as the
white point correction).

Pull Request: https://projects.blender.org/blender/blender/pulls/138433
2025-05-09 14:01:43 +02:00
Ray Molenkamp
f2b9dd3462 CMake: Windows: Use release libs of shaderc for debug builds.
While shaderc is a c++ library that normally requires debug libs
for ABI reasons, shaderc only exports a C interface, so it will
link release mode libs just fine even for debug builds.

This drops the time required for GPU_shader_compile_static in a
debug build from 5 mins to 3 sec for @pragma37

no changes for release configurations.
2025-05-08 09:14:03 -06: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
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
Aras Pranckevicius
8528feb7ee Cleanup: replace some spinlocks with atomics or mutexes
- ImBuf reference counting: turn that into just an atomic integer
- Cachefile safety: turn into a mutex, since work under the spinlock
  was quite heavy (hashtable creation, other memory allocations)
- Movie clip editor: turn into a mutex, since work under the spinlock
  was very heavy (reading files from disk, etc.)
- Mesh intersect: remove the previously commented out spinlock path;
  replace BLI mutex with C++ mutex for shorter code

Pull Request: https://projects.blender.org/blender/blender/pulls/137989
2025-04-29 10:42:45 +02:00
Jeroen Bakker
a5a36b8e98 Vulkan: Remove from experimental
This changes removes Vulkan from experimental. It should be feature
parity with OpenGL with the exception of USD/Hydra.
Some backports to USD/Hydra developments are being made #133717
and should land soon.

This change only updates UI text that mentions the state of the
backend.

Thanks for the community so far for testing and reporting issues!

Pull Request: https://projects.blender.org/blender/blender/pulls/138086
2025-04-28 14:51:32 +02:00
Campbell Barton
dbf6902a19 Fix #137314: Excluded directories ignored when opening from the splash
Regression in [0] which incorrectly swapped the check for the
`use_scripts` property being set with the value it was set to.

Resolve this error as well as the "Recover Last" operator
which never worked.

[0]: 8c688a052c
2025-04-13 12:25:44 +00:00
Jacques Lucke
86341ae826 Fix: ASAN build does not link
When building an ASAN build, I get this link error currently:
```
ld.lld: error: version script assignment of 'global' to symbol '__progname' failed: symbol not defined
ld.lld: error: version script assignment of 'global' to symbol 'environ' failed: symbol not defined
```

The solution (as proposed by Brecht) is to change the symbol names into patterns with a wildcard.
That way the linker does not fail when the symbols are not found.

Pull Request: https://projects.blender.org/blender/blender/pulls/137153
2025-04-08 17:13:59 +02:00
Alaska
612f6697c5 Fix #137100: Extra version when reporting a bug from the crash window
This fixes a issue where the word "version" would be listed twice in
bug reports made from the new crash window feature.

Pull Request: https://projects.blender.org/blender/blender/pulls/137119
2025-04-08 04:05:18 +02:00
Germano Cavalcante
3ab65cff04 Windows: show popup after crash
Implements a crash dialog for Windows.

The crash popup provides the following actions:
- Restart: reopen Blender from the last saved or auto-saved time
- Report a Bug: forward to Blender bug tracker
- View Crash Log: open the .txt file with the crash log
- Close: Closes without any further action

Pull Request: https://projects.blender.org/blender/blender/pulls/129974
2025-04-04 18:38:53 +02:00
Campbell Barton
83135f2849 Cleanup: quiet warning for undefined variable use in CMake 2025-04-04 09:46:03 +11:00
Brecht Van Lommel
1ea89c82d4 Build: Remove OpenMP
It's better for performance to use a single thread pool for all areas of
Blender, and this gets us closer to that.

Bullet, Quadriflow, Mantaflow and Ceres still contain OpenMP code, but it
was already disabled.

On macOS, our OpenMP libraries are no longer compatible with the latest
Xcode 16.3. By removing OpenMP we no longer have to solve that problem.

OpenMP was disabled for bpy module builds on Windows ARM64, which also no
longer needs to be solved.

Pull Request: https://projects.blender.org/blender/blender/pulls/136865
2025-04-02 16:50:50 +02:00
Ray Molenkamp
9a2597aae6 Fix #126782: Win: Install python3.dll into python bin folder
python3.dll was installed for blender, but not next to the
python binary, leading to issues with subprocesses. Given
it's only a small dll the duplication isn't that big of a deal.
2025-03-27 09:32:57 -06:00
Jorn Visser
3561b11851 Fix #136310: Crash when using both viewport and normal compositor with fog glow
The issue is caused by the fact that when both compositors are used,
`fftwf_plan_dft_r2c_2d` can end up being called in parallel, which is
only thread-safe if `fftwf_make_planner_thread_safe` is called before.
This is done by `fftw::initialize_float`, but only if the FFTW threading
support library is available. Said library was not detected correctly on
Windows because of a typo, which this change addresses. This should also
make the fog glow faster on Windows because it'll now use multithreaded
FFT as intended.

This change also moves the call to `initialize_float` to the main
function because the FFTW functions it calls are not thread-safe and
because FFTW is also used by Audaspace, which cannot call it.

Pull Request: https://projects.blender.org/blender/blender/pulls/136557
2025-03-27 10:20:15 +01:00
Bastien Montagne
09221e4db2 Cleanup: Creator: Replace 'void' MEM_[cm]allocN with templated, type-safe MEM_[cm]allocN<T>.
The main issue of 'type-less' standard C allocations is that there is no check on
allocated type possible.

This is a serious source of annoyance (and crashes) when making some
low-level structs non-trivial, as tracking down all usages of these
structs in higher-level other structs and their allocation is... really
painful.

`MEM_[cm]allocN<T>` templates on the other hand do check that the
given type is trivial, at build time (static assert), which makes such issue...
trivial to catch.

NOTE: New code should strive to use `MEM_new` (i.e. allocation and
construction) as much as possible, even for trivial PoD types.

Pull Request: https://projects.blender.org/blender/blender/pulls/135620
2025-03-07 11:52:12 +01:00
Miguel Pozo
d6682af786 Fix: Compiler warnings on Mac
Caused by #133557

Pull Request: https://projects.blender.org/blender/blender/pulls/134776
2025-02-19 17:08:38 +01:00
Miguel Pozo
f5d56a3124 GPU: Add --profile-gpu
Add a `--profile-gpu` launch argument.

When set, it generates a profile in the Trace Event Format with CPU and
GPU metrics based on GPU debug scopes.
https://profilerpedia.markhansen.co.nz/formats/trace-event-format/

The profiles are best viewed at https://ui.perfetto.dev/

Notes:
- The profiler captures everything form app start to exit.
- Being JSON based the profiles can become relatively large, but they
  compress very well.
- Only OpenGL profiling is supported for now, but the report formatting
  code can be shared across backends.

Pull Request: https://projects.blender.org/blender/blender/pulls/133557
2025-02-18 15:36:50 +01:00
Campbell Barton
3b11f5dc44 Cleanup: use a const argv in main() for WIN32 matching other systems
Avoid casting `argv` to a `const char **` when passed to functions.
2025-02-16 18:39:31 +11:00
Campbell Barton
f1e8dd366b CMake: support using LIBDIR while building against an external Python
Support a standard Blender build referencing Python outside of LIBDIR,
useful to build against Python with debugging options enabled.
2025-02-12 13:17:04 +11:00
Ray Molenkamp
1540817576 For VFX platform 2025 and more.
Boost (removed!)
Cython 3.0.11
Expat 2.6.4
GMP 6.3.0
MaterialX 1.39.2
Nanobind 2.1.0 (new, for OpenVDB)
NumPy 1.26.4
OpenColorIO 2.4.1
OpenEXR 3.3.2
OpenImageIO 3.0.3.1
OpenVDB 12.0.0
OSL 1.14.3-beta
Python 3.11.11
Robinmap 1.3.0
TBB 2021.13.0
TIFF 4.7.0
USD 25.02
libxml2 2.13.5
zlib 1.3.1

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Co-authored-by: Jonas Holzman <jonas@holzman.fr>
Co-authored-by: Sebastian Parborg <sebastian@blender.org>

Ref #128577

Pull Request: https://projects.blender.org/blender/blender/pulls/134178
2025-02-06 14:57:02 +01:00
Campbell Barton
7f57f5c6d6 Unbreak build WITH_PYTHON=OFF
Also correct argument handling when Python arguments were passed in,
which were attempting to handle the following parameters as arguments
instead of skipping them.
2025-02-02 14:39:34 +11:00
Brecht Van Lommel
7802dcf7ac Cleanup: Various clang-tidy warnings in creator
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:18 +01:00
Brecht Van Lommel
7584ccc28d Fix #125711: Crash saving stereo EXR image from command line
* Ensure valid bit depth is set along with file type
* Guard against invalid inputs in stereo imbuf creation
* Remove some unused code

Thanks Yiming Wu for finding the cause.

Pull Request: https://projects.blender.org/blender/blender/pulls/133499
2025-01-23 19:15:17 +01:00
Ankit Meel
b858319dd3 macOS/QuickLook: support rich thumbnail in Finder
Support thumbnail that shows the file contents instead
of the default blend file icon for all files in Finder.
Some files may still have the usual blender icon as thumbnail
depending on their contents.

blender-thumbnailer process is kept alive by the system
in the background and is invoked by QuickLook when needed.

The checkbox to disable the extension is present in
the Settings app.

It will NOT be an interactive "Preview" that allows richer
interactions like Panning viewport, or rotating 3D objects.
2025-01-23 17:00:19 +01:00