Commit Graph

1857 Commits

Author SHA1 Message Date
Campbell Barton
9b97123bf9 Cleanup: spelling in comments, odd comment block spacing 2023-06-02 10:16:16 +10:00
Sergey Sharybin
c1bc70b711 Cleanup: Add a copyright notice to files and use SPDX format
A lot of files were missing copyright field in the header and
the Blender Foundation contributed to them in a sense of bug
fixing and general maintenance.

This change makes it explicit that those files are at least
partially copyrighted by the Blender Foundation.

Note that this does not make it so the Blender Foundation is
the only holder of the copyright in those files, and developers
who do not have a signed contract with the foundation still
hold the copyright as well.

Another aspect of this change is using SPDX format for the
header. We already used it for the license specification,
and now we state it for the copyright as well, following the
FAQ:

    https://reuse.software/faq/
2023-05-31 16:19:06 +02:00
Campbell Barton
bdc79caf0e Cleanup: use EXIT_SUCCESS/FAILURE from calls to exit()
Missed from 4408fea092.
2023-05-31 15:30:19 +10:00
Campbell Barton
aa679b3e35 Merge branch 'blender-v3.6-release' 2023-05-31 12:42:01 +10:00
Campbell Barton
19cd473518 Fix failure to cleanup temporary files with '--python-exit-code'
Note that handlers for the `ARG_PASS_FINAL` pass must always use WM_exit
instead of calling exit directly.
2023-05-31 12:35:22 +10:00
Campbell Barton
b2950b2ad7 Fix saving a quit.blend on exit when a file failed to load
When a file passed in from the command line failed to load,
blender would exit & save the quit.blend.

Resolve by adding a `do_user_exit_actions` to WM_exit_ex which is
false in backgrounds mode or when an error has occurred.

---

Back-ported [0] & [1] from main with fix [2] included.

[0]: c803ddab29
[1]: d7d1c524e3
[2]: d3d91b79e0
2023-05-31 12:35:22 +10:00
Campbell Barton
c803ddab29 Fix saving a quit.blend on exit when a file failed to load
When a file passed in from the command line failed to load,
blender would exit & save the quit.blend.

Resolve by adding a `do_user_exit_actions` to WM_exit_ex which is
false in backgrounds mode or when an error has occurred.
2023-05-30 13:37:02 +10:00
Campbell Barton
d7d1c524e3 Cleanup: pass the exit-code to WM_exit
Callers to WM_exit needed to set G.is_break for a predictable exit-code.
This is error prone as G.is_break may be set based on the user having
pressed escape during event handling.

Instead, pass the exit code as an argument.
2023-05-30 12:55:10 +10:00
Campbell Barton
1f3a0fbad8 Command line argument --open-last exists if the file isn't found
Don't create a new empty file when --open-last is used.
2023-05-29 12:54:36 +10:00
Campbell Barton
d958a5dd24 Refactor: split file loading into its own function
Function naming made it seem main_args_setup might need to call
main_args_setup_post, when this was in fact only needed for handing
final arguments.

Call BLI_args_parse directly and expose main_args_handle_load_file
as a public function. Move handle_load_file into a separate function
which is called by --open-last.
2023-05-29 12:49:35 +10:00
Campbell Barton
260eabba8f Merge branch 'blender-v3.6-release' 2023-05-29 12:29:01 +10:00
Campbell Barton
2d81e65703 Fix failure to load a blend file behaving as if a new file is loaded
When a blend file failed to load from the command line,
blender would load a blend file with the path set to the location
that could not be loaded.

Now the command line argument is only treated as a new file
if the file does not already exist. Failure to load a file that
is found always exists with an error.
2023-05-29 11:52:23 +10:00
Campbell Barton
ab73a8abba Help text: corrections & minor changes for the user manual
- BLENDER_STARTUP_FILE was included as a literal instead of expanding
  into 'startup.blend' as intended.
- Single quote cycles device (matching image formats).
- Include all GPU back-ends from bpy.app.help_text(all=True)
- Minor changes to simplify conversion to RST.
2023-05-28 15:08:07 +10:00
Campbell Barton
f39d1f940f Merge branch 'blender-v3.6-release' 2023-05-28 15:07:44 +10:00
Campbell Barton
379ff4befd Fix incorrect help text for the default for script auto-execution
The default changed in [0] but the help text wasn't updated.

[0]: 412c043474
2023-05-28 14:59:59 +10:00
Campbell Barton
4a0f2b576c CMake: don't suppress stderr with manpage generation
Quiet ASAN leak reports so this isn't an issue.
2023-05-27 21:48:41 +10:00
Campbell Barton
ba29fb9717 Fix building WITH_PYTHON=OFF
Missed when adding bpy.app.help_text()
2023-05-27 21:21:22 +10:00
Campbell Barton
61d99d450e manpage: use bpy.app.help_text() for manual text extraction
Call Blender directly to generate the man-page,
instead of relying on the systems Python which called Blender twice and
processed it's output.
2023-05-27 17:55:57 +10:00
Campbell Barton
28b8ceea7c ByAPI: add "all" argument to bpy.app.help_text, to show all help text
Optionally extract all help text, even for options not available
on the current platform or with the current build options.

Useful so it's possible to extract help text for the user-manual
which doesn't depend on the blender build used for extraction.
2023-05-27 17:37:49 +10:00
Campbell Barton
3a5ba15c79 PyAPI: add bpy.app.help_text() for accessing output from --help
Simplify help text extraction which may be used by the manual &
man-page generation.
2023-05-27 16:36:52 +10:00
Campbell Barton
93d313ba20 Help text: move "Cycles Render" options below "Render" options
Keep "Misc" options last.
2023-05-27 14:19:57 +10:00
Campbell Barton
dd12952cdd Cleanup: remove RST literal quotes from recent cycles docs inclusion 2023-05-27 14:17:52 +10:00
Campbell Barton
f2e83f1ad1 Cleanup: avoid multiple newlines in --help printing
A minor change that makes text a little easier to follow for developers.
2023-05-27 14:17:52 +10:00
Campbell Barton
a5fe656c84 Build: add WITH_CYCLES define for creator
Recently added cycles options weren't included in the help message.

Also quiet extra token warning.
2023-05-27 14:17:52 +10:00
Raimund Klink
082766bfa4 Docs: Make Cycles Args visible in --help
The Cycles-specific command line arguments are currently hidden
on this page [1]. To make the command visible in the manual [2] and
in `blender --help`, I added this patch.

[1] https://docs.blender.org/manual/en/3.6/advanced/command_line/render.html#cycles
[2] https://docs.blender.org/manual/en/3.6/advanced/command_line/arguments.html#argument-order

If this gets merged, please merge https://projects.blender.org/blender/blender-manual/pulls/104455 as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/108232
2023-05-27 00:53:05 +02:00
Raimund Klink
d044b9f80c Docs: Move --debug-freestyle to the correct place
It bothered me that in the Blender manual the `--debug-freestyle` was in the `Other Options` category.
Now it should appear correctly in `Debug Options`.
https://docs.blender.org/manual/en/3.6/advanced/command_line/arguments.html#other-options

Pull Request: https://projects.blender.org/blender/blender/pulls/108179
2023-05-27 00:45:18 +02:00
Harley Acheson
9cf77efaa0 UI: Updated Windows File Registration
Windows file associations using ProgID, needed because of the launcher.
This fixes "pin to taskbar" and Recent Documents lists, allow per-
version jump lists and an "Open with" list with multiple versions.

Pull Request: https://projects.blender.org/blender/blender/pulls/107013
2023-05-24 21:19:56 +02:00
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