Commit Graph

2156 Commits

Author SHA1 Message Date
Brecht Van Lommel
24ef6a3776 Cleanup: Improve formatting of command line argument in the user manual 2025-09-26 17:52:53 +02:00
Nick Alberelli
f7e7a5d09e Logging: Add argument to list all available categories
New `--log-list-categories` command line argument to list all available
logging categories. This improves documentation of logging, allowing
users to understand what logging categories are available for use. It is
also useful for developers to understand what logging categories already
exist before making a change.

Implemented using static initializers to register all logrefs on startup.

Ref  #141754

Pull Request: https://projects.blender.org/blender/blender/pulls/146456
2025-09-26 17:33:26 +02:00
Jonas Holzman
c08d42aebf macOS: Support Xcode Archiving for distributing application bundles
This is a port of iOS commit f3f8647 to main, for Xcode archiving to
also work for macOS bundles, allowing the bundle to be archived and
later distributed via Testflight, App Store Connect, etc...

Additonal Xcode property also had to be added to the extern draco shared
library target to prevent it from being included in the Xcode archive
(an implicit behavior for `SHARED` CMake libraries), without this,
the archive would get polluted, preventing it from being properly
recognized as a proper app bundle archive.

Pull Request: https://projects.blender.org/blender/blender/pulls/146027
2025-09-23 20:56:18 +02:00
Clément Foucault
680fec144c Cleanup: GPU: Remove prefix 'e' from enum types
_No response_

Pull Request: https://projects.blender.org/blender/blender/pulls/146034
2025-09-15 15:11:02 +02:00
Brecht Van Lommel
9a5ac6d5ec Color Management: Add BLENDER_OCIO environment variable
THis works the same as OCIO, but is Blender specific in case you want to
use a different one than other applications.

Pull Request: https://projects.blender.org/blender/blender/pulls/145882
2025-09-07 21:30:54 +02:00
Falk David
866fcd0a09 VSE: Update Strip Modifier UI
This PR updates the VSE strip modifiers interface.
It now uses the same design as the object modifiers.

Changes:

* Except for the "Mask Input" subpanel, the modifier UIs are unchanged.
* Modifiers can now be rearranged using drag & drop.
* Additionally, there is now an active strip modifier. This is exposed
   though python via `strip.modifiers.active`.

This is in part for !139634 which needs the concept of an active modifier.

Notes:

* The `modifier.cc` file included all the implementation of all modifiers.
   With the addition of a another new callback in this PR, this file was
   getting quite big so I split everything out into individual files for all
  modifiers. The modifiers are getting registered at launch.
* The modifier panels are getting added using a UI template
  (`template_strip_modifiers`) very similar to the object modifiers.

Pull Request: https://projects.blender.org/blender/blender/pulls/145367
2025-09-04 15:01:57 +02:00
Campbell Barton
8def618fd9 Cleanup: quiet unused argument warnings on macOS 2025-09-04 16:49:54 +10:00
Campbell Barton
623f3c2585 Docs: clarify intended use of build defines regarding --help 2025-09-03 10:52:27 +10:00
Campbell Barton
c129ea1b9a Revert "CLI: only show "--qos" on WIN32"
This reverts commit 30837eca7c.

Restore the previous behavior as this argument is handled on other
platforms (it's just not used).
2025-09-03 10:43:18 +10:00
Campbell Barton
30837eca7c CLI: only show "--qos" on WIN32 2025-09-02 11:06:31 +10:00
Campbell Barton
c0aa455389 Correct define check for command line file-type registration
Mistake in [0] caused extension registration to be deferred on all
platforms, instead of non WIN32/APPLE systems.

[0]: 9cb3a17352
2025-09-02 11:01:01 +10:00
Christoph Neuhauser
79ab23e063 Cleanup: Fix unused parameter warnings for Windows-only QoS functions
This PR fixes warnings on non-Windows systems for unused parameters of
QoS-related functions.

Pull Request: https://projects.blender.org/blender/blender/pulls/145503
2025-09-01 14:27:53 +02:00
Christoph Neuhauser
1e523e2f5d Fix #143653: Add use of Quality of Service (QoS) API on Windows
This PR adds code for setting the Quality of Service (QoS) level of the
process on Windows. This can, e.g., make sure that on hybrid systems
P-cores are utilized even when the app window is out of focus.

In the following cases, it is adjusted from the default behavior:
- In wm_jobs.cc the QoS level is raised while a priority job is running.
- The command line option `--qos [high|eco|default]` can be used to
  change the QoS level of the process.
- By default, the QoS level is raised for the EEVEE performance tests,
  as they check viewport rendering performance and would otherwise be
  reliant on never going out of focus to not get a downgraded QoS level.
  By default, they are created with an out of focus window at the time
  of landing this PR. This PR makes sure that they actually measure the
  animation replay performance attainable during real-world use.

Pull Request: https://projects.blender.org/blender/blender/pulls/144224
2025-09-01 11:19:17 +02:00
Harley Acheson
9e0ef26686 Fix #145186: Allow opening non-existing blend from command line
The PR restores the old behavior (after the changes in #139128) so that
specifying a path to a non-existing blend file will load Blender with
default blend default and with that name assigned. Paths to non-blend
files will load blender but then give the new warning message.

Pull Request: https://projects.blender.org/blender/blender/pulls/145274
2025-08-28 16:48:45 +02:00
Campbell Barton
ca754bc3b2 Help text: tweak for better extraction for the user manual & man page
Use single quotes which are converted to literal text.
2025-08-21 18:19:39 +10:00
Campbell Barton
08eea6b9d4 Help text: group all debug options together 2025-08-21 17:28:15 +10:00
Campbell Barton
af0002c242 Fix: don't attempt to load unknown arguments as a blend file
When `--gpu-vsync` & `--gpu-compilation-subprocesses` received invalid
arguments, they weren't skipped (typically an attempt to load them as
a bland file would be made).
2025-08-21 14:16:24 +10:00
Harley Acheson
35d84e3336 UI: Warning When Dragging Non-Blend File Onto Executable
Dragging a non-Blend file onto the Blender executable currently
silently fails with Blender just aborting. With this PR any files used
as file argument will load Blender and show a warning if the file does
not exist or is not a blend file. Blend files that cannot be read are
treated as they are now.

Pull Request: https://projects.blender.org/blender/blender/pulls/139128
2025-08-18 02:18:39 +02:00
Jeroen Bakker
1f1098c498 Vulkan: Remove MoltenVK
Blender had some support for using MoltenVK. However there are some key
issues why MotlenVK cannot be used. Bugs have been reported up-stream.
As it doesn't work and holds back regular developments it will be removed
from the main branch.

Any efforts on making Vulkan run on Apple (including KosmicKrisp)
is considered a community effort and can be done in a development
branch.

Pull Request: https://projects.blender.org/blender/blender/pulls/144602
2025-08-15 09:36:38 +02:00
Campbell Barton
5540b9440a CLI: move VSync from an environment variable to an argument
Add a command line argument --gpu-vsync on/off/auto.

Prefer command line arguments for GPU settings,
as it means the value is error checked and set when Blender starts.

Also refactor GHOST_Context to take a parameter argument which
includes the stereo-visual & debug arguments and includes the newly
added vsync setting. This makes it possible to add GPU context
parameters more easily in the future.

It also removes redundant parsing & setting the VSync setting for
off-screen contexts.

Changes to recent PR !143049.

Ref !144473
2025-08-14 05:16:12 +00:00
Christoph Neuhauser
1384bad2d2 GPU: Add flag for shader debug info generation
This PR proposes to add a new flag `--shader-debug-info` that enables the generation of shader debug information.

I created this PR as WIP due to the following reasons:
- Currently it only works for the Vulkan backend. I do not know if it makes sense for other backends. For example, OpenGL directly receives the GLSL code, so there no need for this might exist.
- So far `--debug-gpu-renderdoc` already turns on the following changes for GLSL shader compilation with shaderc:
```
options.SetOptimizationLevel(shaderc_optimization_level_zero);
options.SetGenerateDebugInfo();
```
- While combining optimization level zero with debug info is a sensible choice for frame debuggers like RenderDoc, my use case for creating this PR is shader profiling. In this case, one does not want compiler optimizations to be turned off. At the current point in time, the only information my profiler uses (which is unfortunately not public at this point in time) is the name of the shader. When turning on debug information, shaderc/glslang store this information in the generated SPIR-V data. Otherwise, it would be impossible for the profiler to tell the user what the name of the shader it is that is profiled.
- An alternative solution would be to rename the entry point `main` of a shader to the name of the shader. But this might be an even uglier hack, as it requires editing the source code (and the name of the shader then needs to be a valid GLSL function name).
- We should first clarify if there is interest in the Blender side in upstreaming an option like this. While I could just keep this in my local fork of Blender, there is merit in having the possibility to profile arbitrary Blender builds.

Pull Request: https://projects.blender.org/blender/blender/pulls/142986
2025-08-13 13:41:41 +02:00
Campbell Barton
0d1bece64b Help text: support extracting Vulkan & OpenGL args even when disabled
Support extracting arguments for all GPU backends irrespective
of the build argumetns.
2025-08-13 09:26:02 +10:00
Campbell Barton
ab1027c777 Cleanup: capitalization of the term "VSync"
Follow the convention widely used by AMD/Intel/Nvidia.
2025-08-12 10:03:28 +10:00
Brecht Van Lommel
5afe338287 GHOST: Rename GHOST_VSYNC to BLENDER_VSYNC, change description
* GHOST is an implementation detail, Blender environment variables should
  have the BLENDER_ prefix.
* Don't put links in command line help output. We don't do this for other
  arguments either, and it's trivial to search for this online.
* Make description more straightforward and line wrap.
* Use CLOG for logging.

Ref #143049

Pull Request: https://projects.blender.org/blender/blender/pulls/144349
2025-08-11 19:03:58 +02:00
Brecht Van Lommel
1ebefb8252 Refactor: Logging: Use CLOG for video and ffmpeg
The --debug-ffmpeg flag now is the same as --log video, and only exists for
backwards compatibility. The ffmpeg verbosity can now be controlled with
--log-level.

Pull Request: https://projects.blender.org/blender/blender/pulls/143447
2025-08-11 14:07:45 +02:00
Christoph Neuhauser
aafef977fb GHOST: Add environment variable for enabling or disabling vsync
This PR proposes to add an environment variable for forcing vsync to
be on or off. My primary use case was to disable vsync for forcing
viewport rendering performance tests not to be capped at the display
refresh rate when #142984 is used for removing animation frame rate
limits.

I initially added the environment variable "GHOST_VSYNC_OFF", but
found "GHOST_VSYNC=0/1" to be more easily understandable.

Usage:
- GHOST_VSYNC=0 => Vsync is forced off
- GHOST_VSYNC=1 => Vsync is forced on

Pull Request: https://projects.blender.org/blender/blender/pulls/143049
2025-08-11 12:09:21 +02:00
Omar Emara
a252ebb531 Cleanup: Remove deprecated movie formats code
This patch removes code handling the now-deprecated movie formats.

Pull Request: https://projects.blender.org/blender/blender/pulls/144188
2025-08-08 10:28:19 +02:00
Campbell Barton
b07a1adf04 Core: remove use of the environment variable TMP on Unix
This isn't a standard and seems only to be included for historic reasons.

Ref !144100
2025-08-07 10:17:51 +10:00
Campbell Barton
2c27d2be54 Cleanup: grammar corrections, minor improvements to wording 2025-08-01 21:41:24 +10:00
Sean Kim
e7378f1efd Fix: Avoid CLG_Level warning when -1 is used as CLI parameter
This commit prevents the UBSAN `-fsanitize=enum` warning from being
printed when `--log-level -1` is used on the command line.

Pull Request: https://projects.blender.org/blender/blender/pulls/143755
2025-07-31 22:23:16 +02:00
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
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