Commit Graph

1631 Commits

Author SHA1 Message Date
Campbell Barton 392a8e2907 Cleanup: sort cmake file lists 2020-12-11 15:32:14 +11:00
Campbell Barton 9c5d67411a creator: remove reference to SDL_AUDIODRIVER from --help text
This was added when Linux's audio support
often needed to be manually configured.

Further 3rd party libraries have their own environment variables & docs
these need not be part of Blender's help message unless they're likely
to be needed to properly run Blender.
2020-12-09 14:15:24 +11:00
Brecht Van Lommel 880b0f981d Cleanup: more renaming in the render/ module for consistency 2020-11-09 16:19:49 +01:00
Ankit Meel 7be47dadea Cleanup: Clang-tidy, readability-else-after-return 2020-11-07 21:52:53 +05:30
Ankit Meel ae342ed451 Cleanup: Clang-tidy else-after-return 2020-11-07 18:48:13 +05:30
Aaron Carlisle e15076b22f Cleanup: Render Module: move header files to main directory
Move headers files from `render/extern/` to `render/`

Part of T73586
2020-11-06 10:10:41 -05:00
Campbell Barton 9762a0992b CMake: configue_file() to pass strings for build-info
Using configue_file(..) would have avoided the breakage from
1daa3c3f0a, caused by buildinfo not properly escaping quotes.

Rely on CMake to escaping strings instead using configure_file().
2020-11-06 17:26:29 +11:00
Campbell Barton d9e7a42640 Cleanup: use 'BKE_' prefix for initialization functions 2020-11-06 16:43:09 +11:00
Campbell Barton f38ad4c66b Cleanup: replace STREQLEN with STRPREFIX for constant strings 2020-11-06 15:56:03 +11:00
Campbell Barton aa3a4973a3 Cleanup: use ELEM macro 2020-11-06 12:32:54 +11:00
Campbell Barton 548b351647 Cleanup: use snake case for BLI_args API 2020-11-06 12:32:54 +11:00
Campbell Barton 819a9622e9 CMake: remove -fmacro-prefix-map from build-info
Quotes caused build-info to fail,
remove these flags since they're not necessary.
2020-11-04 18:41:40 +11:00
Campbell Barton b018582cd3 Cleanup: parse '--thread' as part of ARG_PASS_ENVIRONMENT
While this isn't needed at the moment, it's possible
the animation player uses the scheduler in the future.
2020-10-30 13:30:16 +11:00
Campbell Barton 1be819ea66 Cleanup: update comments
Some references to argument levels were still in comments.
2020-10-28 16:00:26 +11:00
Campbell Barton 58fc155976 Cleanup: move WM_init & arg parsing out of if/else branch 2020-10-28 14:04:44 +11:00
Campbell Barton 6445caa9b5 BLI_args: disallow zero to be used as a pass value
Introduced recently in 09139e41ed.
While this worked in the cases it was used, '--threads' for example
was failing to parse the number when it's pass was set to 0.

Increase the enum values to start at 1 &
add asserts so this wont happen again.
2020-10-28 14:04:44 +11:00
Campbell Barton c518cd73cd Cleanup: use enum for command line argument passes 2020-10-28 14:04:44 +11:00
Campbell Barton 6ac46c9708 BLI_args: refactor argument passes
Avoid passing the pass argument to BLI_argsAdd, instead set this
once for each group of passes.

This means we can add new passes without having to bump the arguments
to BLI_argsAdd.
2020-10-28 14:04:41 +11:00
Campbell Barton 09139e41ed Cleanup: simplify order of initialization with argument parsing
Sub-systems that use directories from BKE_appdir needed to be
initialized after parsing '--env-system-datafiles'.

This meant the animation player needed to call IMB_init it's self.

Avoid this complication by having a pass that can be used to setup
the environment before Blender's resources are accessed.

This reverts the workaround from 9ea345d1cf
2020-10-27 18:45:42 +11:00
Campbell Barton 9ea345d1cf Fix animation player initialization
Updates from 9d30fade3e weren't applied to the animation player
causing an assert and missing call to IMB_init.
2020-10-22 17:07:56 +11:00
Hans Goudey a509e79a4c Cleanup: Comment formatting, grammar 2020-10-14 15:04:49 -05:00
Ankit Meel 1f6b7387ad CMake/macOS: Remove _LIBPATH, avoid link_directories.
After tests were bundled in a single executable and cycles and libmv
created their own tests, the warnings on macOS have gone over 800.
The reason is setting `*_LIBRARIES` to names of the libraries
and later using `link_directories` to link them properly.

https://cmake.org/cmake/help/latest/command/link_directories.html

> Note This command is rarely necessary and should be avoided where
> there are other choices. Prefer to pass full absolute paths to
> libraries where possible, since this ensures the correct library
> will always be linked. The find_library() command provides the
> full path, which can generally be used directly in calls to
> target_link_libraries().

Warnings like the following popup for every target/executable,
for every library it links to.
```
ld: warning: directory not found for option
'-L/Users/me/blender-build/blender/../lib/darwin/jpeg/lib/Debug'
```

The patch completes a step towards removing `link_directories` as
mentioned in TODO at several places.
The patch uses absolute paths to link libraries and removes
all `*_LIBPATH`s except `PYTHON_LIBPATH` from
`platform_apple.cmake` file. (The corner case where it's used seems
like dead code. Python is no longer shipped with that file structure.)

Also, unused code for LLVM-3.4 has been removed.
Also, guards to avoid searching libraries in system directories have
been added.

`APPLE` platform now no longer needs `setup_libdirs`,
`cycles_link_directories`, and `link_directories`.
The number of warnings now is less than 100, most of them being
deprecation ones in dependencies.

This patch depended on {rBb746179d0add}, {rB2fdbe4d05011},
{rB402a4cadba49} and {rBd7f482f88ecb}.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8855
2020-10-09 19:41:58 +05:30
Campbell Barton 1fa6881037 Cleanup: remove outdated comment
Should have been removed in b36a05bb7e,
when Python was started after reading the preferences.
2020-10-05 01:56:29 +11:00
Campbell Barton 270fb4d82b Preferences: use the users temp directory in background mode
This choice was made when preferences were not read in background mode,
so the temp dir needed to be initialized with something.
See bc9848f7e6.

Now preferences are always read there is no reason to ignore this
particular preference in background mode.

Anyone wanting to do background renders that ignore their preferences
can run with factory startup.
2020-10-05 01:29:08 +11:00
Campbell Barton 9d30fade3e Fix color-management ignoring the data-path command line value
Initialize ImBuf (and color-management) after passing arguments
that set environment variables such as `--env-system-datapath`

This also fixes a bug where BKE_appdir logging failed since it was
called before the `--log` argument was passed.

Add asserts so this doesn't happen again.
2020-10-04 22:15:07 +11:00
Dalai Felinto 0434efa09d Move license files to license subfolder
For the final builds instead of leaving all the license files in the main
folder, we move them to a "license" folder.

Also, adding more licenses here (MIT, Apache, ...).

Differential Revision: https://developer.blender.org/D8999
2020-09-24 12:49:36 +02:00
Brecht Van Lommel f9fcb25d52 CMake: clean up setting of platform specific linker flags
Set flags directly on the target, and use common function for all cases.
This refactoring helps with the next commit for test executables.

Ref D8714
2020-09-17 12:29:19 +02:00
Campbell Barton dd25d47e8a Cleanup: add missing headers to CMake, formatting 2020-09-15 22:53:44 +10:00
Campbell Barton 971cc0ae03 Cleanup: make it clear WM_main isn't called in background-mode 2020-09-15 13:33:34 +10:00
Campbell Barton 62f2925e43 Fix T80774: (correction) keep MEM_init_memleak_detection call early 2020-09-15 13:32:00 +10:00
Campbell Barton 2120acb73e Fix T80774: Leaks reported using '--version' command line argument
Caused by 236ca8fbe8.
2020-09-15 12:46:29 +10:00
Clément Foucault 6432fa488a Cleanup: Remove GLEW dependencies outside of GL module 2020-09-12 15:51:21 +02:00
Aaron Carlisle f9bd3329e6 Docs: Fix typo in creator args formatting
This was pointed out in D8799
2020-09-03 20:41:25 -04:00
Sybren A. Stüvel fef1a6c54e USD: move library initialisation from `main()` to USD module
Initialize the USD library when used (instead of at startup), so that
this can happen inside the IO/USD module. This makes calls to the USD
library local to Blender's USD code.

Note that failure to find the USD JSON files will now only be reported
when the USD exporter is used, and not on every startup of Blender.

This is the first step in cleaning up the way Blender patches and
initialises the USD library.

Manifest Task: https://developer.blender.org/T80320
2020-09-01 17:28:05 +02:00
Howard Trickey 9e09b5c418 Merge newboolean branch into master.
This is for design task T67744, Boolean Redesign.
It adds a choice of solver to the Boolean modifier and the
Intersect (Boolean) and Intersect (Knife) tools.
The 'Fast' choice is the current Bmesh boolean.
The new 'Exact' choice is a more advanced algorithm that supports
overlapping geometry and uses more robust calculations, but is
slower than the Fast choice.
The default with this commit is set to 'Exact'. We can decide before
the 2.91 release whether or not this is the right choice, but this
choice now will get us more testing and feedback on the new code.
2020-08-28 11:01:06 -04:00
Ray Molenkamp 8a984ddd0f Cleanup: Fix build warning on windows
MSBuild on windows currently spews a warning about
buildinfo.h_fake not being generated.

For build info we use a non existing file to trigger a
custom_command on every build, which has worked well for
years now, however in recent versions of MSBuild it has
started issuing warnings about files that should be
generated but are not.

CMake is actually aware of this being a problem and states
in the documentation that "If the output of the custom command
is not actually created as a file on disk it should be marked
with the SYMBOLIC source file property."

This change fixes the build warning by properly marking the
buildinfo.h_fake as symbolic resolving the warning.
2020-08-27 08:10:37 -06:00
Jacques Lucke 8a9912eaf8 Tests: fail automated tests on memory leaks and other internal errors
This adds a new `--debug-exit-on-error` flag. When it is set, Blender
will abort with a non-zero exit code when there are internal errors.
Currently, "internal errors" includes memory leaks detected by
guardedalloc and error/fatal log entries in clog.

The new flag is passed to Blender in various places where automated
tests are run. Furthermore, the `--debug-memory` flag is used in tests,
because that makes the verbose output more useful, when dealing
with memory leaks.

Reviewers: brecht, sergey

Differential Revision: https://developer.blender.org/D8665
2020-08-26 22:02:02 +02:00
Brecht Van Lommel f699ba3d30 Cleanup: better naming and no bad level access in BLI_winstuff 2020-08-26 19:26:38 +02:00
Campbell Barton 0967935b42 Cleanup: split BPY_run_string_ex into two functions
Using a boolean to select between eval/exec behavior wasn't very
readable.
2020-08-17 18:32:20 +10:00
Campbell Barton 7341ceb674 Cleanup: move Python script execution into BPY_extern_run.h
This commit renames 'execute' to 'run' because:

- This follows Python's "PyRun" which these functions wrap.
- Execution functions can use either exec/eval modes,
  making naming awkward (for future API refactoring).
2020-08-17 18:32:20 +10:00
Campbell Barton f8c0d63cdb Cleanup: split BPY_extern_python into it's own header
Currently BPY_extern.h includes too much mixed functionality.
2020-08-17 17:20:12 +10:00
Ray Molenkamp e691a3a9b7 Deps_builder: Update openvdb to a dynamic library
This patch changes openvdb from a static to a dynamic library.
this is in preparation for enabling pyopenvdb at some point
in the future.

Differential Revision: https://developer.blender.org/D8282

Reviewed by: brecht
2020-08-13 11:42:05 -06:00
Jacques Lucke 7283e6fb73 Merge branch 'blender-v2.90-release' into master 2020-08-07 10:04:57 +02:00
Jacques Lucke 91694b9b58 Code Style: use "#pragma once" in source directory
This replaces header include guards with `#pragma once`.
A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`),
because they are used in other places.

This patch has been generated by P1561 followed by `make format`.

Differential Revision: https://developer.blender.org/D8466
2020-08-07 09:50:34 +02:00
Campbell Barton 14dc1aecf0 Merge branch 'blender-v2.90-release' into master 2020-08-06 15:48:42 +10:00
Daniel Bailey e9c4325515 Python: include Python stack trace in the crash log
This helps Python developers troubleshoot errors when
Python causes a crash.
2020-08-06 15:44:00 +10:00
Campbell Barton 8305dd9499 Cleanup: localize creator.c definitions
As creator.c is used for the 'main' function,
avoid obscure declarations being placed so prominently.

- Move Blender as a Python module declarations into it's own section.
- Move USD declaration to an 'extern' just before it's called.
2020-08-02 13:11:30 +10:00
Campbell Barton 6141549fee Fix error in recent rename
This function is defined outside of Blender.
2020-08-01 20:04:22 +10:00
Campbell Barton 901ee66ea1 Cleanup: use term init instead of initialize/initialise
The abbreviation 'init' is brief, unambiguous and already used
in thousands of places, also initialize is often accidentally
written with British spelling.
2020-08-01 13:51:05 +10:00
Ray Molenkamp 83f8223543 Deps builder: Add support for building GMP
Required for the new boolean code, disabled by default
until all platforms have landed the libs and the boolean
code actually lands in master.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8384
2020-07-31 09:34:26 -06:00