Commit Graph

840 Commits

Author SHA1 Message Date
Campbell Barton
61cb302dd5 Cleanup: sort cmake file lists 2023-04-13 13:14:11 +10:00
Joseph Eagar
35071af465 Sculpt: Fix #104631: Tip Roundness on Paint brush causes jitering
I cleaned up the cube brush tip code quite a bit; more remains
to be done.  There is a new function to initialize cube
tip matrices, SCULPT_cube_tip_init.  It's currently only
used by the paint brush, I'll need to do a bit of testing
before using it for clay strips and multiplane scrape.

Note: SCULPT_cube_tip_init uses the brush local matrix code
to avoid code duplication (and to take advantage of the debouncing
that is done there).
2023-04-12 18:33:53 -07:00
Sergey Sharybin
a245e294a3 Fix missing assets in the source archive
The assets are required to build proper Blender release, so they can not be
skipped from packing.

The packing ignores the `working` directory as it seems to be big and sounds
that it is not needed for the release.

The assets are bundled under the `release/datafiles/assets` folder in the
blender sources. This is where they will reside after switch to the Git LFS.

Pull Request: https://projects.blender.org/blender/blender/pulls/106536
2023-04-05 09:27:42 +02:00
Ray molenkamp
17800e0c03 CMake/Win: use manifest for PLATFORM_BUNDLED_LIBRARIES
`PLATFORM_BUNDLED_LIBRARIES` was installing right next to the blender
executable rather than the `blender.shared` folder,
`PLATFORM_BUNDLED_LIBRARIES` wasn't used very much on windows, just
by the ONEAPI code which likely wasn't aware this plumbing was
still missing.

This diff adds support for using `PLATFORM_BUNDLED_LIBRARIES` on
windows in both debug and release configurations.

You can differentiate between a .dll being installed for debug/release
or all configurations, by prefixing the library with either `DEBUG`,
`RELEASE` or `All`, if no prefix is given `ALL` is assumed.

Pull Request: https://projects.blender.org/blender/blender/pulls/106348
2023-04-04 20:10:06 +02:00
Jeroen Bakker
fc46d6408f GPU: Use --debug-gpu-renderdoc For Renderdoc Integration.
The renderdoc integration used to be behind the `--debug-gpu`
command line option. When using `--debug-gpu` outside renderdoc
error messages where displayed that aren't relevant.

This PR adds a specific command line option for the renderdoc
integration. This option will also enable `--debug-gpu`.

Pull Request: https://projects.blender.org/blender/blender/pulls/106541
2023-04-04 12:46:47 +02:00
Sergey Sharybin
a12a8a71bb Remove "All Rights Reserved" from Blender Foundation copyright code
The goal is to solve confusion of the "All rights reserved" for licensing
code under an open-source license.

The phrase "All rights reserved" comes from a historical convention that
required this phrase for the copyright protection to apply. This convention
is no longer relevant.

However, even though the phrase has no meaning in establishing the copyright
it has not lost meaning in terms of licensing.

This change makes it so code under the Blender Foundation copyright does
not use "all rights reserved". This is also how the GPL license itself
states how to apply it to the source code:

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software ...

This change does not change copyright notice in cases when the copyright
is dual (BF and an author), or just an author of the code. It also does
mot change copyright which is inherited from NaN Holding BV as it needs
some further investigation about what is the proper way to handle it.
2023-03-30 10:51:59 +02:00
Brecht Van Lommel
8d16e8f726 Merge branch 'blender-v3.5-release' 2023-03-28 16:33:34 +02:00
Brecht Van Lommel
6e51f8d202 Fix Python Module build on Windows
Don't install libraries in blender.shared and don't generate manifest
as it's not working and not important to have a clean directory here.

Always detect MSVC_REDIST_DIR as it is used by oneAPI. The way
InstallRequiredSystemLibraries is called it already only sets some
variables and doesn't install anything by itself.

Pull Request: https://projects.blender.org/blender/blender/pulls/105999
2023-03-28 16:32:25 +02:00
Brecht Van Lommel
a36841af13 Merge branch 'blender-v3.5-release' into main 2023-03-22 14:21:28 +01:00
Shane Ambler
c21b534680 Build: skip installing .gitea files, deduplicate code
* With the move to gitea, .gitea doesn't need to be copied into installs.
* Add .github and .gitignore in more places for future proofing.
* Deduplicate ìnstall_dir macro.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/105980
2023-03-22 12:29:26 +01:00
Julian Eisel
48814c25fd Cleanup: Move blend file path utilities out of blenloader module
These are not really about reading or writing .blend files, they are
general utilities for file-names/paths. Having to link to the
blendloader library just for these utilities is annoying.
Moved them to `BKE_blendfile.h` now, in agreement with Bastien.

Pull Request: #105825
2023-03-16 15:07:27 +01:00
Ray Molenkamp
b7679addd2 cmake/win32: Fix building with WITH_VULKAN_BACKEND
The shader libraries were not hooked up yet in cmake for windows since
when the shaderc libs landed there was no code yet that used it.

It's required now, so this change adds the missing bits.
2023-03-09 08:41:17 -07:00
Sergey Sharybin
03806d0b67 Re-design of submodules used in blender.git
This commit implements described in the #104573.

The goal is to fix the confusion of the submodule hashes change, which are not
ideal for any of the supported git-module configuration (they are either always
visible causing confusion, or silently staged and committed, also causing
confusion).

This commit replaces submodules with a checkout of addons and addons_contrib,
covered by the .gitignore, and locale and developer tools are moved to the
main repository.

This also changes the paths:
- /release/scripts are moved to the /scripts
- /source/tools are moved to the /tools
- /release/datafiles/locale is moved to /locale

This is done to avoid conflicts when using bisect, and also allow buildbot to
automatically "recover" wgen building older or newer branches/patches.

Running `make update` will initialize the local checkout to the changed
repository configuration.

Another aspect of the change is that the make update will support Github style
of remote organization (origin remote pointing to thy fork, upstream remote
pointing to the upstream blender/blender.git).

Pull Request #104755
2023-02-21 16:39:58 +01:00
Jacques Lucke
b3fb73f325 Assets: bundle Essentials with Blender
This patch adds an "Essentials" asset library that is bundled with Blender.
Also see #103620. At build time, the `lib/assets/publish` folder is copied
to `datafiles/assets` in the build directory.

In the UI, the "Essentials" library can be accessed like other custom asset
libraries with the exception that assets from that library cannot be linked.

The immediate impact of this is that Blender now comes with some geometry
node groups for procedural hair grooming.

Pull Request #104474
2023-02-14 17:35:29 +01:00
Jeroen Bakker
a36c1cabce Vulkan: Changes to CMake config.
Paths to vulkan libraries, paths and related components were
hardcoded in the platform cmake file. This patch separates
this by using adding CMake modules for Vulkan and ShaderC.

This change has only been applied to the macOs configuration as
that is currently our main platform for development. Other platforms
will be added during the development of the Vulkan back-end.
2023-01-30 12:04:44 +01:00
Campbell Barton
bc502f3b19 CMake: add WITH_LIBS_PRECOMPILED option (UNIX only)
This makes it convenient to build blender without referencing
pre-compiled libraries which don't always work on newer Linux systems.

Previously I had to rename ../lib while creating the CMakeCache.txt
to ensure my systems libraries would be used.

This change ensures LIBDIR is undefined when WITH_LIBS_PRECOMPILED is
disabled, so any accidental use warns with CMake's `--warn-unused-vars`
argument is given.
2023-01-19 17:10:42 +11:00
Campbell Barton
9676dce317 Cleanup: CMake indentation 2023-01-19 17:10:42 +11:00
Brecht Van Lommel
eb7ac996cc Build: install all shared libraries regardless of build options
There are dependencies between shared libraries, and Python modules which are
always installed on Linux and macOS can use these also.

Instead of adding logic for dealing with dependencies and conditional Python
module installs, just always install everything when using precompiled
libraries. This does not affect compile time which would be the main reason to
turn off build options, and it does not affect the case where system libraries
are used.
2023-01-04 11:20:02 +01:00
Campbell Barton
2ac6e26c25 Cleanup: cmake formatting 2022-12-17 13:33:27 +11:00
Campbell Barton
599c0db3ff Cleanup: indentation in CMake files 2022-12-16 23:47:35 +11:00
Campbell Barton
5025a3833a CMake: fix build error on Linux where MAN page generation failed
Move man-page generation to an install step to ensure the shared
libraries have been copied before running Blender.
2022-12-14 14:13:38 +11:00
Thomas Dinges
e8c7866608 Add-ons: Exclude contrib for beta, rc and release builds.
* Make it clearer that contrib isn't shipped with releases, by already excluding it in beta.
* Improve the UI by hiding the "Testing" enum item in these case.

Differential Revision: https://developer.blender.org/D16729
2022-12-13 11:12:36 +01:00
Ray Molenkamp
388bbc3290 Build: library updates for Blender 3.5
This updates the libraries dependencies for VFX platform 2023, and adds various
new libraries. It also enables Python bindings and switches from static to
shared for various libraries.

The precompiled libraries for all platforms will be updated to these new
versions in the coming weeks.

New:

Fribidi 1.0.12
Harfbuzz 5.1.0
MaterialX 1.38.6 (shared lib with python bindings)
Minizipng 3.0.7
Pybind11 2.10.1
Shaderc 2022.3
Vulkan 1.2.198

Updated:

Boost 1.8.0 (shared lib)
Cython 0.29.30
Numpy 1.23.2
OpenColorIO 2.2.0 (shared lib with python bindings)
OpenImageIO 2.4.6.0 (shared lib with python bindings)
OpenSubdiv 3.5.0
OpenVDB 10.0.0 (shared lib with python bindings)
OSL 1.12.7.1 (enable nvptx backend)
TBB (shared lib)
USD 22.11 (shared lib with python bindings, enable hydra)
yaml-cpp 0.8.0

Includes contributions by Ray Molenkamp, Brecht Van Lommel, Georgiy Markelov
and Campbell Barton.

Ref T99618
2022-12-07 15:28:17 +01:00
Ray Molenkamp
6d27a2ff76 Windows: install shared libraries in blender.shared
Instead of the the same folder as the Blender executable, generate a manifest
that lets us move the libraries out of the way of users and into a separate
folder.

Ref T99618
2022-12-07 15:28:17 +01:00
Ray Molenkamp
70375c96d5 USD: prepare for building with Python support and shared libraries
Shared libraries and USD plugins will be placed in the same folder, where USD
already looks for plugins.

This means that specifying the path to the plugins will no longer be needed
once the new libraries are available for all platforms. For now the code was
refactored to support both cases.

Ref T99618
2022-12-07 15:28:17 +01:00
Jeroen Bakker
6dac345a64 GHOST: Vulkan Backend.
This adds a vulkan backend to GHOST. The code was extracted from the
tmp-vulkan branch. The main difference with the original code is that
GHOST isn't responsible for fallback. For Metal backend there is already
an idea that the GPU module is responsible for the fallback, not the system.

For Blender we target Vulkan 1.2 at the time of this patch.
MoltenVK (needed to convert Vulkan calls to Metal) has been added as
a separate package.

This patch isn't useful for end-users, currently when starting blender with
`--gpu-backend vulkan` it would crash as the `VBBackend` doesn't initialize
the expected global structs in the GPU module.

Validated to be working on Windows and Apple. Linux still needs to be tested.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D13155
2022-11-22 11:29:09 +01:00
Brecht Van Lommel
c082b088ab Fix bpy wheel on buildbot being incomplete on Windows
Need to explicitly install __init__.pyd for the case where the install
folder is different than the build folder.
2022-10-31 19:56:59 +01:00
Xavier Hallade
7eeeaec6da Cycles: use direct linking for oneAPI backend
This is a minimal set of changes, allowing a lot of cleanup that can
happen afterward as it allows sycl method and objects to be used outside
of kernel.cpp.

Reviewed By: brecht, sergey

Differential Revision: https://developer.blender.org/D15397
2022-10-07 09:50:05 +02:00
Campbell Barton
0c282c068f Cleanup: cmake indentation 2022-09-29 13:32:16 +10:00
Brecht Van Lommel
0ffd288fab Build: fix gtest build flags affecting actual library
Switch to target_ functions to avoid this.
2022-09-18 11:26:34 +02:00
Brecht Van Lommel
f70fac6382 Python: fix failing bpy build with full release config on Windows
* Fix issue with different build and install paths.
* Fix issue with oneAPI kernel build.

Ref D15957
2022-09-15 18:27:02 +02:00
Campbell Barton
5cd08e373b CMake: exclude '.github' from addons in the install target
This file is only used for the github mirror
and doesn't need to be installed.
2022-09-15 09:48:32 +10:00
Brecht Van Lommel
038a19ce6c Fix macOS incomplete Python install after recent changes
After 2c23b4e0bff0 the meaning of PYTHON_LIBPATH changed.
2022-09-12 15:48:09 +02:00
Brecht Van Lommel
2c23b4e0bf Python: on macOS, stop requiring framework for building bpy module
Build against Python from precompiled libraries by default, instead of
requiring framework from python.org package install. The resulting bpy module
can still be used with any Python install of the same version.

Use the same CMake find module as Linux. This simplifies code, and makes it
possible to manually set PYTHON_* variables in CMake configuration.

Remove WITH_PYTHON_FRAMEWORK option for regular Blender build, as this doesn't
work well due to missing required Python packages. Advanced users can still
set PYTHON_ROOT_DIR=/Library/Frameworks/Python.framework/Versions/3.10 for
the same result.
2022-09-10 13:47:48 +02:00
Campbell Barton
3a01c23a84 Cleanup: cmake line length, wrapping 2022-09-09 11:52:14 +10:00
Campbell Barton
9e0c2f6867 CMake: exclude Python libs & batch scripts WITH_PYTHON_MODULE for WIN32 2022-09-09 11:33:43 +10:00
Campbell Barton
fad7a30de3 Cleanup: comments, spelling, line length for creator's CMake file 2022-09-09 11:10:37 +10:00
Campbell Barton
81558783e4 Python: install "bpy" as a package WITH_PYTHON_MODULE
Building WITH_PYTHON_MODULE was creating a "bpy" module that required
Blenders data-files to be located in the module search path too.

This mean that a typical installation on Linux would create:

- `/usr/lib/python3.10/site-packages/bpy.so`
- `/usr/lib/python3.10/site-packages/3.4`
  (containing `scripts` & `datafiles`).

The new behavior creates:

- `/usr/lib/python3.10/site-packages/bpy/__init__.so`
- `/usr/lib/python3.10/site-packages/bpy/3.4`

With the advantage that the "bpy" directory is the self contained Python
module.

No changes are needed for the module loading logic as the mechanism to
swap in blend internal Python "bpy" module
(defined in `release/scripts/modules/bpy/__init__.py`)
works the same in both instances.

Thanks to Brecht for macOS support.

Reviewed by brecht

Ref D15911
2022-09-09 10:25:35 +10:00
Brecht Van Lommel
a87d3edb98 Build: add system for shipping with dynamic libraries on Linux and macOS
PLATFORM_BUNDLED_LIBRARIES gathers shared libraries that will be installed
to the lib/ folder. The Blender executable gets a relative rpath pointing to
this folder as part of the install step.

The build rpath is different and uses absolute paths, so that it works for
executables like tests that are in different locations, and to support the
case where the build and install folders are different.

The system is already used for the OpenMP library on macOS. But on Linux it
will only kick in once we start using shared libraries for dependencies.

This also removes Mesa libraries from the old location, as these would cause
Blender to start with software OpenGL.

Ref T99618
2022-08-23 15:27:16 +02:00
Brecht Van Lommel
afb74149c1 Cleanup: consistent variable names for install target directories 2022-08-23 15:27:16 +02:00
listout
f197b1a1f1 CMake: support building with musl libc
Instead of using macros like GLIBC we can use the CMake build
systems internal functions to check if some header or functions are
present on the running system's libc.

Add ./build_files/cmake/have_features.cmake to add checks for
platform features which can be used to set defines for source
files that require them.

Reviewed By: campbellbarton

Ref D15696
2022-08-18 08:12:56 +10:00
Sebastian Parborg
8ffc11dbcb Cleanup OpenGL linking and related code after libepoxy merge
This cleans up the OpenGL build flags and linking.
It additionally also removes some dead code.

One of these dead code paths is WITH_X11_ALPHA which actually never was
active even with the build flag on. The call to use this was never
called because the default initializer for GHOST was set to have it off
per default. Nothing called this function with a boolean value to enable it.

These cleanups are needed to support true headless OpenGL rendering.
Without these cleanups libepoxy will fail to load the correct OpenGL
Libraries as we have already linked them to the blender binary.

Reviewed By: Brecht, Campbell, Jeroen

Differential Revision: http://developer.blender.org/D15554
2022-08-15 16:47:20 +02:00
Christian Rauch
a296b8f694 GPU: replace GLEW with libepoxy
With libepoxy we can choose between EGL and GLX at runtime, as well as
dynamically open EGL and GLX libraries without linking to them.

This will make it possible to build with Wayland, EGL, GLVND support while
still running on systems that only have X11, GLX and libGL. It also paves
the way for headless rendering through EGL.

libepoxy is a new library dependency, and is included in the precompiled
libraries. GLEW is no longer a dependency, and WITH_SYSTEM_GLEW was removed.

Includes contributions by Brecht Van Lommel, Ray Molenkamp, Campbell Barton
and Sergey Sharybin.

Ref T76428

Differential Revision: https://developer.blender.org/D15291
2022-08-15 16:10:29 +02:00
Campbell Barton
dfbba7c0eb Cleanup: CMake file indentation 2022-08-09 13:37:29 +10:00
Brecht Van Lommel
cfd16c04f8 Build: hide all symbols except a few required ones on Linux
Instead of specifying which symbols to hide, we hide all and make a few
visible. Some users may be relying on calling internal Blender functions,
but Windows is already hiding all of them and this is just not supported.

Fixes T99900: crash with some third-party Python libraries since OneAPI

Ref T76442

Differential Revision: https://developer.blender.org/D14971
2022-07-29 17:54:32 +02:00
Sergey Sharybin
f391e8f316 Linux: Move Mesa software OpenGL libraries to sub-directory
Allows to put libraries which are always needed by Blender into the
lib/ folder and not worry about OpenGL libraries picked up from there.

Currently no functional changes as we do not yet have dynamic libraries
which we load at startup. It allows to use direct linking of oneAPI
Cycles device (see D15397), also it is something which would need to
happen to support USD/Hydra/TBB compiler as dynamic libraries in the
future.

Differential Revision: https://developer.blender.org/D15403
2022-07-08 15:44:06 +02:00
Brecht Van Lommel
604c33e694 Build: updates for Blender to build against new 3.2 libraries
Building against the existing 3.1 libraries should continue to work, until
the precompiled libraries are committed for all platforms.

* Enable WebP by default.
* Update Windows for new library file names.
* Automatically clear outdated CMake cache variables when upgrading to new
  libraries.
* Fix static library linking order issues on Linux for OpenEXR and OpenVDB.

Implemented by Ray Molenkamp, Sybren Stüvel and Brecht Van Lommel.

Ref T95206
2022-04-20 16:42:16 +02:00
Aaron Carlisle
e03b9f555c Cmake: Re-enable Amaranth add-on
This add-on now conforms to the distribution requirements, see: T95442.
2022-03-01 17:45:45 -05:00
Aaron Carlisle
89bf5d8ba9 Cmake: Re-enable tiny cad add-on
This add-on now conforms to the distribution requirements, see: T95442.
2022-03-01 11:57:13 -05:00
Aaron Carlisle
9b114d6214 Merge branch 'blender-v3.1-release' 2022-02-28 23:47:43 -05:00