Commit Graph

2081 Commits

Author SHA1 Message Date
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
Campbell Barton
3f31edd4c0 Extensions: exclude development files from installation 2025-01-23 15:41:47 +11:00
Campbell Barton
90b03d2344 Cleanup: spelling in comments 2025-01-20 11:19:23 +11:00
Brecht Van Lommel
a6b293daac Python Module: Bundle VFX library python bindings
When calling bpy.utils.expose_bundled_modules(), these modules are
added to sys.path.

This provides a solution/workaround to two problems:
* Using bpy together with packages like usd-core is problematic. Besides
  crashing due to C++ symbol conflicts, it's just impossible to import
  different versions of the same module, or to have distinct environment
  variables for both. (#127132)
* Blender add-ons using these VFX modules do not currently work with
  the bpy module.

This adds about 15MB to the bpy package.

Pull Request: https://projects.blender.org/blender/blender/pulls/133082
2025-01-17 10:13:31 +01:00
jlalleve
2feadc623b Core: Environment variables for deployment
* BLENDER_SYSTEM_SCRIPTS support for multiple script paths, separated by
  ; on Windows and : on other platforms.
* New BLENDER_CUSTOM_SPLASH to replace the splash screen image.
* New BLENDER_CUSTOM_SPLASH_BANNER to overlay an image on the splash.

Contributed by Sony Interactive Entertainment: https://github.com/PlayStation-OpenSource
2025-01-14 20:57:31 +01:00
Jeroen Bakker
a4914b8972 Vulkan: Disable local read on non Qualcomm devices
Only enable by default dynamic rendering local read on Qualcomm devices. NVIDIA, AMD and Intel
performance is better when disabled (20%). On Qualcomm devices the improvement can be
substantial (16% on shader_balls.blend).

`--debug-gpu-vulkan-local-read` can be used to use dynamic rendering local read on any
supported platform.

Future: Check if bottleneck is during command building. If so we could fine-tune this after the
device command building landed (#T132682).

Pull Request: https://projects.blender.org/blender/blender/pulls/132981
2025-01-13 09:29:16 +01:00
Falk David
d413b0064f Cleanup: Move BKE_material.h to C++
The `BKE_material.h` is only renamed to `.hh` to preserve
the history of the file. Changes to the file are done in
the following commit.
2025-01-09 18:11:46 +01:00
Campbell Barton
5003253aca Cleanup: spelling & repeated terms 2025-01-07 13:20:19 +11:00
Aaron Carlisle
1bcc01519a Cleanup: Spelling: "Explicitly" 2025-01-03 22:35:05 -05:00
Campbell Barton
33e38c605f Cleanup: correct indentation for CMake files, strip trailing space 2025-01-03 13:23:38 +11:00
Ray Molenkamp
5783950ac5 Revert: 0dc484f9cc bf_rna modernisation
This caused build errors on the docs builder, I can't seem to reproduce
locally, so revert for now and have another look at some point in the
future.

Sadly as these changes usually go, this took 5c515e26bb and
2f0fc7fc9f with it as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/132559
2025-01-02 19:56:24 +01:00
Ray Molenkamp
0dc484f9cc Cleanup: CMake: Modernize bf_rna dependencies
Pretty straightforward

- Remove any bf_rna paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/132413
2024-12-31 18:23:25 +01:00
Ray Molenkamp
95c1a5e4fe Cleanup: CMake: Modernize bf_imbuf_movie dependencies
Not entirely straightforward, some manual edits were done since when
this library was created, some of the work was already done.

- Remove any bf_imbuf_movie paths from INC
- Add a dependency though LIB when missing
- Add public dependency to bf_imbuf in bf_imbuf_movie since it uses the
  imbuf headers in its public headers.
- Fix namespace not to have underscores

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/132407
2024-12-28 20:53:18 +01:00
Ray Molenkamp
16eb4430f5 Cleanup: CMake: Modernize bf_render dependencies
Pretty straightforward

- Remove any bf_render paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/132355
2024-12-26 18:50:53 +01:00
Ray Molenkamp
a0d9826b3c Cleanup: CMake: Modernize bf_imbuf dependencies
Pretty straightforward

- Remove any bf_imbuf paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/132336
2024-12-25 23:32:15 +01:00
Ray Molenkamp
54604efdfd Cleanup: CMake: Modernize bf_windowmanager dependencies
Pretty straightforward

- Remove any bf_windowmanager paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/132310
2024-12-24 22:40:38 +01:00
Ray Molenkamp
b7407aabb5 Cleanup: CMake: Modernize bf_gpu dependencies
Pretty straightforward

- Remove any bf_gpu paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/132286
2024-12-23 21:38:19 +01:00
Ray Molenkamp
a7c39896c6 Cleanup: CMake: Modernize bf_blenkernel dependencies
Pretty straightforward

- Remove any bf_blenkernel paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/132282
2024-12-23 20:08:37 +01:00
Ray Molenkamp
2992c63bc3 Cleanup: CMake: Modernize bf_bmesh dependencies
Pretty straightforward

- Remove any bf_bmesh paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/132203
2024-12-23 17:47:25 +01:00
Aras Pranckevicius
e99252d7fd Refactor: more cleanups and renamed to movie/ffmpeg related files
- All movie related public headers now have MOV_ prefix instead of
  IMB_movie_.
- All movie related public functions now have MOV_ prefix as well,
  instead of IMB_movie_ or IMB_anim_.
- IMB_anim.hh -> MOV_read.hh (also ImBufAnim -> MovieReader), and
  various utility functions not related to playback were split off
  into MOV_util.hh.
- Other function name tweaks for clarity, e.g. IMB_suffix_anim
  -> MOV_set_multiview_suffix and so on.
- All except one usages of MOV_get_fps (nee IMB_anim_get_fps) were
  ultimately just converting returned value into a float. So make
  MOV_get_fps just return that directly. For the (exactly just one)
  place that needs numerator and denominator, have
  MOV_get_fps_num_denom.
- Code comments on the public header functions.
- Removed never-used code paths inside movie timecode proxy building
  file.

It might be easier to review each commit separately.

Pull Request: https://projects.blender.org/blender/blender/pulls/132145
2024-12-20 13:23:08 +01:00
Aras Pranckevicius
974efe7d23 Refactor: move ffmpeg/video related code into one place
Previously, code related to reading/writing movie files via ffmpeg was
scattered around: some under blenkernel, some directly in generic
imbuf headers, some under intern/ffmpeg. Some of the files were named
with not exactly clear names. Some parts not directly related to movies
were including ffmpeg headers directly (rna_scene.cc).

What is in this PR:

Movie and ffmpeg related code is now under imbuf/movie:
- IMB_anim.hh: movie reading, proxy querying, various utility functions.
- IMB_movie_enums.hh: simple enum definitions,
- IMB_movie_write.hh: movie writing functions.
- intern: actual implementation and private headers.
    - ffmpeg_compat.h: various ffmpeg version difference handling
      utilities,
    - ffmpeg_swscale.hh/cc: scaling and format conversion utilities
      for ffmpeg libswscale,
    - ffmpeg_util.hh/cc: misc utilities related to ffmpeg,
    - movie_proxy_indexer.hh/cc: proxies and timecode indexing for movies,
    - movie_read.hh/cc: decoding of movies into images,
    - movie_write.cc: encoding of images into movies.
- tests: basic ffmpeg library unit tests that previously
  lived under intern/ffmpeg.

Interface changes (at C++ level, no Python API changes):
- Mostly just movie related functions that were BKE_ previously, are now IMB_.
- I did one large-ish change though, and that is to remove bMovieHandle
  struct that had pointers to several functions. Now that is
  IMB_movie_write_begin, IMB_movie_write_append, IMB_movie_write_end
  functions using a single opaque struct handle. As a result, usages
  of that in pipeline.cc and render_opengl.cc have changed.

Pull Request: https://projects.blender.org/blender/blender/pulls/132074
2024-12-19 12:34:30 +01:00
Bastien Montagne
ef0fcab8b7 Add command-line option to not do liboverride autoresync on fileload.
The new --disable-liboverride-auto-resync commandline option will prevent
running liboverride auto-resync immediately after loading a blendfile.

This is an alternative way to setting the User Preferences Debug option
`No Override Auto Resync`.

-------

Some quick performances tests:
Loading a Gold production file goes from 26.5s to 25.9s.

Combined with the recent `--disable-depsgraph-on-file-load` option, it
goes from 3.5s to 2.9s, so another nice extra 15% speedup when only
bare-metal blendfile loading is needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/132017
2024-12-17 18:59:49 +01:00
Bastien Montagne
84c8ce9b40 Add option to not build depsgraph on file load in background mode.
The new `--disable-depsgraph-on-file-load` commandline option, when used
together with the `--background` or `--command` ones, will prevent
building a depsgraph immediately after loading a blendfile.

The goal is to improve performances of batch-processing of blendfiles by
python scripts. It is intended to become the default behavior in Blender
5.0.

Scripts requiring evaluated data then need to explicitly ensure that
an evaluated depsgraph is available (e.g. by calling
`depsgraph = context.evaluated_depsgraph_get()`).

------

This disables the call to `wm_event_do_depsgraph` in `wm_file_read_post`.

Some quick performances tests:
* The whole `blendfile_versioning` tests gain about 2% speedup. These are
almost always small and simple blendfiles.
* Loading a Gold production file however goes from 26.5s to 3.5s (almost
90% faster) when this new option is specified.

Pull Request: https://projects.blender.org/blender/blender/pulls/131978
2024-12-16 19:05:29 +01:00
Bastien Montagne
2e93789ff1 Cleanup: Fix typo in documentation for background CLI option. 2024-12-06 17:50:31 +01:00
Alaska
afcad646bf Bug reporting: Install the Cycles debug script
cf8d31d41c added a debug script for
Cycles on Windows but didn't actually install it into the
Blender folder.

This commit fixes that by installing the script into the
Blender folder.

Pull Request: https://projects.blender.org/blender/blender/pulls/131348
2024-12-06 16:55:36 +01:00
Jonas Holzman
62b2bb48e8 macOS: CMake: Fix last CMP0177 policy warnings
This commit fixes the last few CMake CMP0177 policy warnings on macOS.

Follow-up to: #130602 and 536937b4d4

Pull Request: https://projects.blender.org/blender/blender/pulls/131219
2024-12-02 17:15:58 +01:00
Julien Duroure
faaa12a101 glTF: Install Draco lib in the same directory as the glTF2 addon
This changes the location of the Draco library installation path.
The new location is at the root of addons_core/io_scene_gltf2 addon, as the library is created for this addon only.

This will solve issues where the gltf addon couldn't find the library in case of global python installation or custom script/lib paths

Pull Request: https://projects.blender.org/blender/blender/pulls/131080
2024-12-02 12:50:15 +01:00
Campbell Barton
0de8ae8046 Cleanup: spelling in comments 2024-11-25 13:24:46 +11:00
Ray molenkamp
87a7cab146 CMake: Fix Policy CMP0175 warning
CMake 3.31 has begun emitting CMP0175 [1] when you call add_custom_command
with invalid keywords. While `MAIN_DEPENDENCY` is a valid keyword for
`add_custom_command(OUTPUT)` [2] it is not for `add_custom_command(TARGET)` [3]

proper fix is to remove the offending parameters.

[1] https://cmake.org/cmake/help/latest/policy/CMP0175.html
[2] https://cmake.org/cmake/help/latest/command/add_custom_command.html#generating-files
[3] https://cmake.org/cmake/help/latest/command/add_custom_command.html#build-events

Pull Request: https://projects.blender.org/blender/blender/pulls/130565
2024-11-23 01:55:00 +01:00
Sebastian Parborg
1d1811c54b CMake: Linux/Mac: Fix CMP0177 policy warnings
Follow up to: 536937b4d4

Pull Request: https://projects.blender.org/blender/blender/pulls/130602
2024-11-21 11:07:08 +01:00
Julien Duroure
dbc8b29519 glTF: Draco: Fix #130545 - Windows Draco dll was not in right directory
This is a regression by a0f653c002

Pull Request: https://projects.blender.org/blender/blender/pulls/130572
2024-11-21 10:29:20 +01:00
Jorn Visser
2bf7fac176 Creator: Ensure OpenMP runtime is initialized as soon as possible
This is to make sure duplicate libomp/libiomp5 runtime conflicts are
detected as soon as a second runtime is initialized. Otherwise, it may
not crash until Blender's OpenMP runtime is initialized by a feature
that uses it, making such issues possibly go unnoticed. Such a conflict
can happen when an add-on has a native module that uses OpenMP and links
to a different libomp runtime, as was the case in #125255.

Currently Blender only ships with libomp on MacOS.

---
When libomp detects such an issue it should abort and print the following message:
```
OMP: Error #15: Initializing libomp.a, but found libomp.dylib already initialized.
OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://openmp.llvm.org/
```

Pull Request: https://projects.blender.org/blender/blender/pulls/130407
2024-11-20 10:23:57 +01:00
Ray Molenkamp
536937b4d4 CMake: Windows: Fix CMP0177 policy warnings
CMake 3.31+ have begun emitting warnings when you feed install()
paths that are not normalized (ie have, '.' or '..' in them) easiest
fix is just not use them.

This cleans up the windows sections of the build system, the other
platform devs will have to take a look on their respective platforms.
2024-11-19 18:53:41 -07:00
Bastien Montagne
b325142d17 Merge branch 'blender-v4.3-release' 2024-11-12 16:55:40 +01:00
Bastien Montagne
0b3a7cbe69 Cleanup: Move BKE_image.h and related headers to C++.
NOTE: This also required some changes to Cycles code itself, who is now
directly including `BKE_image.hh` instead of declaring a few prototypes
of these functions in its `blender/utils.h` header (due to C++ functions
names mangling, this was not working anymore).

Pull Request: https://projects.blender.org/blender/blender/pulls/130174
2024-11-12 16:53:54 +01:00
Germano Cavalcante
7ce080cf72 Refactor: prevent storing dangling pointers
The `_EXCEPTION_POINTERS` structure is valid only within the context of
the `UnhandledExceptionFilter` function.

After the function exits, the memory referenced by the pointer might no
longer be valid or the exception information.

The solution for this was to create `BLI_system_backtrace_with_os_info`
and passing a system-specific data as the second argument.
`BLI_system_backtrace` calls `BLI_system_backtrace_with_os_info` with a
null second argument internally.

Pull Request: https://projects.blender.org/blender/blender/pulls/129999
2024-11-08 23:17:36 +01:00
Campbell Barton
99387c0749 Cleanup: spelling in comments, docs & error 2024-11-02 15:43:27 +11:00
Campbell Barton
381898b6dc Refactor: move BLI_path_util header to C++, rename to BLI_path_utils
Move to a C++ header to allow C++ features to be used there,
use the "utils" suffix as it's preferred for new files.

Ref !128147
2024-09-26 21:13:39 +10:00
Bastien Montagne
22477956e2 Refactor: Move BPY main/public extern headers to proper C++ ones.
Pull Request: https://projects.blender.org/blender/blender/pulls/128081
2024-09-25 18:04:33 +02:00
Sahar A. Kashi
26ed4d3892 Cycles: Linux Support for HIP-RT
This change switches Cycles to an opensource HIP-RT library which
implements hardware ray-tracing. This library is now used on
both Windows and Linux. While there should be no noticeable changes
on Windows, on Linux this adds support for hardware ray-tracing on
AMD GPUs.

The majority of the change is typical platform code to add new
library to the dependency builder, and a change in the way how
ahead-of-time (AoT) kernels are compiled. There are changes in
Cycles itself, but they are rather straightforward: some APIs
changed in the opensource version of the library.

There are a couple of extra files which are needed for this to
work: hiprt02003_6.1_amd.hipfb and oro_compiled_kernels.hipfb.
There are some assumptions in the HIP-RT library about how they
are available. Currently they follow the same rule as AoT
kernels for oneAPI:
- On Windows they are next to blender.exe
- On Linux they are in the lib/ folder

Performance comparison on Ubuntu 22.04.5:
```
GPU: AMD Radeon PRO W7800
Driver: amdgpu-install_6.1.60103-1_all.deb
                       main         hip-rt
attic                  0.1414s      0.0932s
barbershop_interior    0.1563s      0.1258s
bistro                 0.2134s      0.1597s
bmw27                  0.0119s      0.0099s
classroom              0.1006s      0.0803s
fishy_cat              0.0248s      0.0178s
junkshop               0.0916s      0.0713s
koro                   0.0589s      0.0720s
monster                0.0435s      0.0385s
pabellon               0.0543s      0.0391s
sponza                 0.0223s      0.0180s
spring                 0.1026s      1.5145s
victor                 0.1901s      0.1239s
wdas_cloud             0.1153s      0.1125s
```

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Co-authored-by: Ray Molenkamp <github@lazydodo.com>
Co-authored-by: Sergey Sharybin <sergey@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/121050
2024-09-24 14:35:24 +02:00
Campbell Barton
0fc27c8d81 Cleanup: spelling in comments 2024-09-20 13:14:57 +10:00
Bastien Montagne
5e4c76accc Fix warnings when building Blender with mold linker on linux.
Remove the three problematic entries:
- `aligned_free` is not a 'real' function and does not need to be
  handled here. There is no symetry with the `aligned_malloc` symbol
  here.
- `__end` and `_bss_start` seem to have been mis-typed from the
  beginning (actual symbols seem to be `_end` and `__bss_start`).
  Regardless, neither `gold` nor `mold` seem to take these directives
  from the LD version script into account (result is the same for them
  when removed for the `.map` file), so removing them.

Pull Request: https://projects.blender.org/blender/blender/pulls/127761
2024-09-19 10:52:45 +02:00
Lukas Tönne
d918c22fcc Revert "CMake: suppress warnings building with mold on Linux"
This reverts commit 0a0551cf26.

This commit broke building on linux with mold. It seems to never
generate the necessary file when something other than the `blender`
binary is the first thing being built.
2024-09-17 10:48:16 +02:00
Campbell Barton
0a0551cf26 CMake: suppress warnings building with mold on Linux
Support manipulating symbols_unix.map using symbols_unix.map.cmake
script.

Currently this removes symbols that generate noisy warnings with the
mold linker.
2024-09-17 14:42:31 +10:00
Campbell Barton
30bbd1583f Cleanup: replace the term "folder" with "directory" for CMake files
This was already more common an in keeping with cmake's own naming.
2024-09-14 12:35:02 +10:00