Commit Graph

1830 Commits

Author SHA1 Message Date
Sergey Sharybin 3bc189a62e Add option to install copyright.txt
The file is specific for the builds created by the Blender Foundation
and strictly speaking should only be used by builds created on our
release environment.

This change introduces a CMake option which is disabled by default and
which will be enabled on our buildbot.

Ref #107295

Pull Request: https://projects.blender.org/blender/blender/pulls/108191
2023-05-24 10:07:19 +02:00
Campbell Barton e27cb91442 BLI_path: add native path canonicalize function
This function handles cleaning valid system paths that are functional
when passed to `open(..)` but may be relative to the current working
directory or have redundant slashers that can be normalized.
2023-05-17 13:42:51 +10:00
Campbell Barton 5285cd9a7b BLI_path: use native normalize (avoids // prefix on UNIX) 2023-05-15 19:58:39 +10:00
Campbell Barton b1a426eac7 Cleanup: use string copy & printf macros 2023-05-13 17:34:21 +10:00
Ray Molenkamp 53bccfe34a CMake/Win: fftw adjust for filename changes in 3.6
Preparation for the the 3.6 library update landing.

The filenames for these libs will change a little bit and 3.6 will add
new library for the fp32 version of fftw.
2023-05-11 08:36:33 -06:00
Ray Molenkamp 2158c92d9b CMake/Windows: Install FFMpeg 6.0 dlls when available
Needed for the 3.6 library update.
2023-05-10 12:18:54 -06:00
Campbell Barton ed5dee857e Fix blender failing to link WITH_USD when building for the first time
Blender would fail to link to USD before MaterialX files were
copied to the install targets lib/ directory.
Resolve by including ${LIBDIR}/materialx/lib in link_directories.
2023-05-10 16:25:17 +10:00
Ray Molenkamp d65d9f4b97 CMake/Windows: Install materialX render dll's when available
This is in preparation for the 3.6 library update landing on windows.
2023-05-09 10:21:32 -06:00
Campbell Barton 3958ae7241 Cleanup: use STRNCPY, SNPRINTF macros 2023-05-09 14:08:19 +10:00
Campbell Barton 464a40c1a5 Cleanup: use the name of the CMake WITH_STRSIZE_DEBUG for the define
Prefer matching names so there is no reason to confuse the identifiers.
2023-05-07 13:55:19 +10:00
Campbell Barton 7f8495c44b CMake: add WITH_STRSIZE_DEBUG option, RNA support
Support string size debug so it can be used for regular development.

It works be writing values into strings, ensuring the buffer size
given is actually available. Developers can use this with memory
checking tools such as ASAN/valgrind to force an error when
the value used for the size of a buffer is larger than the buffer.

Resolve remaining issue with RNA using BLI_strncpy* in generated
callback functions where the size argument didn't represent the
size of the destination buffer.

This is automatically enabled along with ASAN for the
blender_developer.cmake configuration.

Ref PR !107602.
2023-05-07 13:52:49 +10:00
Campbell Barton 6b9a500a3a Cleanup: disambiguate terms "name", "file" & "str" / "string"
- Rename name/filename/path to filepath when it's used for full paths.
- Rename name/path to dirpath when it refers to a directory.
- Rename file to filepath or path (when it may be a file or dir).
- Rename ImBuf::name & anim::name to filepath.
2023-05-03 15:26:14 +10:00
Campbell Barton 6859bb6e67 Cleanup: format (with BraceWrapping::AfterControlStatement "MultiLine") 2023-05-02 09:37:49 +10:00
Campbell Barton f6931a9ead CMake: only generate & install the man-page when it may be outdated
Check if the man-page is missing or older than files that generate it
before re-running the generator.

Previously the install target would re-run the man-page generator
every time, even when no other changes to the build were detected.
2023-04-26 23:01:02 +10:00
Campbell Barton 10fc2d6d96 Cleanup: remove basepath argument from BLI_path_normalize{_dir}
Keep these operations separate to simplify path handling logic & docs.
Many callers passed NULL and there were times paths were passed in which
didn't make any sense (where the paths had already been made absolute).
2023-04-24 12:23:04 +10:00
Campbell Barton c615ccde68 Fix splash preference overriding Read Home File's use_splash property
- Split out WM_init_splash_on_startup(..) which performs startup checks.
- WM_init_splash(..) now shows the splash (ignoring preferences).
- Avoid calling BLI_exists on an empty string (in some cases).
2023-04-18 12:59:13 +10:00
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
Harley Acheson 302e858273 Fix #104507: Show Splash if New Version
Show Splash screen if there are no Preferences found even if we are
launched with a filename, so that users can migrate old settings.

Pull Request: https://projects.blender.org/blender/blender/pulls/105863
2023-04-05 22:35:05 +02: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
Campbell Barton d2ad00d0f5 Cleanup: remove unused RenderData::stereomode 2023-04-04 17:26:37 +10: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 0e6cc4f86a Build: changes needed to build on FreeBSD
* Fix SDL not finding Xlib.h
* Link to clangSupport library for newer LLVM versions
* Add FreeBSD essential symbols to symbols_unix.map

Pull Request: https://projects.blender.org/blender/blender/pulls/105892
2023-03-22 14:15:46 +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
Campbell Barton e853a67efc Cleanup: use BKE_blendfile_* for functions defined in BKE_blendfile.h 2023-03-17 16:45:42 +11: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
Falk David df0c2693b6 Refactor: Rename grease pencil files to legacy
This renames the `BKE_gpencil_*` as well as the `DNA_gpencil_types.h`
files to indicate that it's the legacy grease pencil.

Pull Request: https://projects.blender.org/blender/blender/pulls/105597
2023-03-13 10:42:51 +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
Germano Cavalcante 7fcb262dfd Cleanup: resolve some unreferenced parameter warnings in MSVC
When the warning level is set to 4, some unreferenced parameter
warnings can appear

This commit resolves some of those warnings.
2023-03-07 21:39:44 -03: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
Germano Cavalcante a755e6e63f Revert "MSVC: lower C4100 warning level from 4 to 3"
This reverts commit db4e7616f3.

Caused many issues when compiling mantaflow.
2023-02-14 15:36:35 -03:00
Germano Cavalcante db4e7616f3 MSVC: lower C4100 warning level from 4 to 3
This better aligns with OSX/Linux warnings.

Although `__pragma(warning(suppress:4100))` is not the same as
`__attribute__((__unused__))` in gcc (which only affects the attribute
instead of the line), it still seems to be better to use it than to
hide the warning entirely.
2023-02-14 14:38:18 -03: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
Campbell Barton 91346755ce Cleanup: use '#' prefix for issues instead of 'T'
Match the convention from Gitea instead of Phabricator's T for tasks.
2023-02-12 14:56:05 +11:00
Campbell Barton 48d9363fa7 Cleanup: quiet clang compiler warnings
- undeclared variable warning.
- unreachable-code-return warnings.
- array-parameter, mismatch bound.
- 'requires' is a keyword in C++20, (rename to requires_flag).
2023-02-10 11:27:30 +11: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 7416021bf7 Command Line Arguments: all errors now print to the stderr
This was done by some callbacks but not all.
Only use the stdout for status & information.
2023-01-25 12:20:48 +11:00
Campbell Barton 6c310acccc help now includes a GPU section & improve --gpu-backend error
- Include available GPU backends in the GPU backend error.
- Use stderr for the error message.
2023-01-25 12:20:00 +11: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
Jeroen Bakker f4b03031e8 GPU: Select GPU Backend from Preferences.
(MacOS) only: In the System tab of the user preferences the user has the
ability to select a GPU backend that Blender will use. After changing
the GPU backend setting, the user has to restart Blender before the
setting is used.

It was added to start collecting feedback on the Metal backend without
using the command lines.

By default Blender will select OpenGL as backend. When Metal is selected
(via `--gpu-backend metal` or via user preferences) OpenGL will be used as
fallback when the platform isn't capable of running Metal.
2022-12-21 20:54:36 +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