Commit Graph

1547 Commits

Author SHA1 Message Date
Campbell Barton d6e0d27816 Fix help message misc argument grouping
Correct reference to non-existent argument.
2020-03-30 21:47:07 +11:00
Campbell Barton aec9e0e1b6 Cleanup: spelling, comments 2020-03-29 17:11:41 +11:00
Sergey Sharybin 671b6d41c4 CMake: Fix Blender.app creation/modification time
It was failing on first run of CMake since the Blender.app is not yet
created.
2020-03-26 11:35:51 +01:00
Brecht Van Lommel d751491489 Fix error after recent change when WITH_INTERNATIONAL=OFF
Always need to install font files now.
2020-03-25 18:44:35 +01:00
Dalai Felinto 2d1cce8331 Cleanup: `make format` after SortedIncludes change 2020-03-19 09:33:58 +01:00
Brecht Van Lommel b0a1cf2c9a Objects: add Volume object type, and prototypes for Hair and PointCloud
Only the volume object is exposed in the user interface. It is based on OpenVDB
internally. Drawing and rendering code will follow in another commit.
https://wiki.blender.org/wiki/Source/Objects/Volume
https://wiki.blender.org/wiki/Reference/Release_Notes/2.83/Volumes

Hair and PointCloud object types are hidden behind a WITH_NEW_OBJECT_TYPES
build option. These are unfinished, and included only to make it easier to
cooperate on development in the future and avoid tricky merges.
https://wiki.blender.org/wiki/Source/Objects/New_Object_Types

Ref T73201, T68981

Differential Revision: https://developer.blender.org/D6945
2020-03-18 11:23:05 +01:00
Julian Eisel dc2df8307f VR: Initial Virtual Reality support - Milestone 1, Scene Inspection
NOTE: While most of the milestone 1 goals are there, a few smaller features and
improvements are still to be done.

Big picture of this milestone: Initial, OpenXR-based virtual reality support
for users and foundation for advanced use cases.
Maniphest Task: https://developer.blender.org/T71347
The tasks contains more information about this milestone.

To be clear: This is not a feature rich VR implementation, it's focused on the
initial scene inspection use case. We intentionally focused on that, further
features like controller support are part of the next milestone.

- How to use?
Instructions on how to use this are here:
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/How_to_Test
These will be updated and moved to a more official place (likely the manual) soon.

Currently Windows Mixed Reality and Oculus devices are usable. Valve/HTC
headsets don't support the OpenXR standard yet and hence, do not work with this
implementation.

---------------

This is the C-side implementation of the features added for initial VR
support as per milestone 1. A "VR Scene Inspection" Add-on will be
committed separately, to expose the VR functionality in the UI. It also
adds some further features for milestone 1, namely a landmarking system
(stored view locations in the VR space)

Main additions/features:
* Support for rendering viewports to an HMD, with good performance.
* Option to sync the VR view perspective with a fully interactive,
  regular 3D View (VR-Mirror).
* Option to disable positional tracking. Keeps the current position (calculated
  based on the VR eye center pose) when enabled while a VR session is running.
* Some regular viewport settings for the VR view
* RNA/Python-API to query and set VR session state information.
* WM-XR: Layer tying Ghost-XR to the Blender specific APIs/data
* wmSurface API: drawable, non-window container (manages Ghost-OpenGL and GPU
  context)
* DNA/RNA for management of VR session settings
* `--debug-xr` and `--debug-xr-time` commandline options
* Utility batch & config file for using the Oculus runtime on Windows.
* Most VR data is runtime only. The exception is user settings which are saved
  to files (`XrSessionSettings`).
* VR support can be disabled through the `WITH_XR_OPENXR` compiler flag.

For architecture and code documentation, see
https://wiki.blender.org/wiki/Source/Interface/XR.

---------------

A few thank you's:
* A huge shoutout to Ray Molenkamp for his help during the project - it would
  have not been that successful without him!
* Sebastian Koenig and Simeon Conzendorf for testing and feedback!
* The reviewers, especially Brecht Van Lommel!
* Dalai Felinto for pushing and managing me to get this done ;)
* The OpenXR working group for providing an open standard. I think we're the
  first bigger application to adopt OpenXR. Congratulations to them and
  ourselves :)

This project started as a Google Summer of Code 2019 project - "Core Support of
Virtual Reality Headsets through OpenXR" (see
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/).
Some further information, including ideas for further improvements can be found
in the final GSoC report:
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/Final_Report

Differential Revisions: D6193, D7098

Reviewed by: Brecht Van Lommel, Jeroen Bakker
2020-03-17 21:42:44 +01:00
Brecht Van Lommel 54c8770692 Fix error using CUDA in plug-ins on Linux/macOS, hide our CUDA symbols
Better solution will be to hide all symbols by default, but this works for now.
2020-03-17 12:23:36 +01:00
Campbell Barton bc2343d5c3 Cleanup: comments in main()
Clarify references to functions.
2020-03-08 13:48:52 +11:00
Campbell Barton 0964865568 Cleanup: replace BLI_make_file_string with BLI_join_dirfile where possible
Use 'BLI_join_dirfile' for joining paths that don't need to expand '//'.
2020-03-07 13:26:23 +11:00
Bastien Montagne c328049535 Initial step for IDTypeInfo refactor 'cleanup' project.
Introduce new IDTypeInfo structure.

Each ID type will have its own, with some minimal basic common info,
and ID management callbacks.

This patch only does it for Object type, for demo/testing purpose.
Moving all existing IDs is a goal of next "cleanup Friday".

Note that BKE_idcode features should then be merged back into BKE_idtype -
but this will have to be done later, once all ID types have been properly
converted to the new system.

Another later TODO might be to try and add callbacks for file read/write,
and lib_query ID usages looper.

This is part of T73719.

Thanks to @brecht for initial idea, and reviewing the patch.

Differential Revision: https://developer.blender.org/D6966
2020-03-05 10:58:58 +01:00
Brecht Van Lommel 42ff69db25 Embree: avoid potential clashing symbols with external renderer add-ons 2020-02-17 18:44:54 +01:00
Bastien Montagne e75e29ee47 Cleanup: Rename `BKE_library_override_` functions to `BKE_lib_override_library_`
pqrt of T72604.
2020-02-10 18:05:19 +01:00
Sybren A. Stüvel ec116e3d49 USD: Install USD library via install_deps.sh
This commit adds the download, extract, patch, build, and install of the
Universal Scene Description (USD) library to the `install_deps.sh`
script.

Reviewed By: mont29, LazyDodo

Differential Revision: https://developer.blender.org/D6478
2020-02-10 15:07:56 +01:00
Bastien Montagne 56116bbdf4 Cleanup/refactor: Rename `BKE_library` files to `BKE_lib`.
Note that `BKE_library.h`/`library.c` were renamed to
`BKE_lib_id.h`/`lib_id.c` to avoid having a too generic name here.

Part of T72604.
2020-02-10 13:00:42 +01:00
Antonio Vazquez 1bc2a98a9d T73589: Code Quality: Renaming on BKE_material.h
Old Name                             New Name
=========                            =========
init_def_material                    BKE_materials_init
BKE_material_gpencil_default_free    BKE_materials_exit
test_object_materials                BKE_object_materials_test
test_all_objects_materials           BKE_objects_materials_test_all
give_matarar                         BKE_object_material_array
give_totcolp                         BKE_object_material_num
give_current_material_p              BKE_object_material_get_p
give_current_material                BKE_object_material_get
assign_material                      BKE_object_material_assign
assign_matarar                       BKE_object_material_array_assign
give_matarar_id                      BKE_id_material_array
give_totcolp_id                      BKE_id_material_num
assign_material_id                   BKE_id_material_assign
clear_matcopybuf                     BKE_material_copybuf_clear
free_matcopybuf                      BKE_material_copybuf_free
copy_matcopybuf                      BKE_material_copybuf_copy
paste_matcopybuf                     BKE_material_copybuf_paste
BKE_material_init_gpencil_settings   BKE_gpencil_material_attr_init
BKE_material_add_gpencil             BKE_gpencil_material_add
BKE_material_gpencil_get             BKE_gpencil_material
BKE_material_gpencil_default_get     BKE_gpencil_material_default
BKE_material_gpencil_settings_get    BKE_gpencil_material_settings
2020-02-05 15:56:50 +01:00
Brecht Van Lommel 53d805abcb Merge branch 'blender-v2.82-release' 2020-01-31 13:03:15 +01:00
Brecht Van Lommel c82b8c5944 Fix tests failing on AMD Ryzen, due TBB initialization order issue
Similar fix as the one we did for the blender executable, see T72015.
2020-01-31 12:56:20 +01:00
Campbell Barton cb83cf1b71 Cleanup: spelling 2020-01-25 20:15:38 +11:00
Sergey Sharybin 11df5443e5 Merge branch 'blender-v2.82-release' 2020-01-24 12:49:49 +01:00
Sergey Sharybin 18343c230d Fix/workaround initialization order of static TBB/MKL
Was caused by recent refactor of dependencies in 517870a4a1.

While there is no fully reliable solution to this issue other than
making TBB a dynamic library dependency (as documentation tells us
to do), there seems to be simple workaround which doesn't require
deeper changed in build process and packaging.

Tested on Brecht's computer who managed to reproduce the issue on
Linux (T72015#857423).
2020-01-24 12:47:35 +01:00
Ray Molenkamp 2272f380bd Merge remote-tracking branch 'origin/blender-v2.82-release' 2020-01-18 11:59:18 -07:00
Ray Molenkamp 3e11c4e63b Fix: T71159 missing python3.dll
File got forgotten during the last repack of python.
2020-01-18 11:58:38 -07:00
Philipp Oeser 9ebd64ec7e Merge branch 'blender-v2.82-release' 2020-01-16 20:34:44 +01:00
Campbell Barton 7c2f0074f3 Python: disable environment variables by default
This avoids the problem where Blender doesn't start because
the PYTHONPATH points to an incompatible Python version,
see T72807.

Previously we chose to assume people who set the PYTHONPATH know what
they're doing, however users may have set this for non Blender projects.
So it's not obvious that this is the cause of Blender not to launch
on their system.

To use Python's environment vars, pass the argument:
--python-use-system-env

Note that this only impacts Python run-time environment variables
documented in `python --help`, Access from `os.environ` remains.
2020-01-17 03:36:29 +11:00
Julian Eisel eca8bae671 Fix T51054: NULL-dereferences in crash-handler callback 2020-01-15 18:08:34 +01:00
Campbell Barton 7d2d2ffa76 Cleanup: spelling 2019-12-17 16:30:39 +11:00
Campbell Barton 5a97a74c69 Cleanup: whitespace 2019-12-16 13:49:11 +11:00
Sybren A. Stüvel ec62413f80 USD: Introducing a simple USD Exporter
This commit introduces the first version of an exporter to Pixar's
Universal Scene Description (USD) format.

Reviewed By: sergey, LazyDodo

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

- The USD libraries are built by `make deps`, but not yet built by
  install_deps.sh.
- Only experimental support for instancing; by default all duplicated
  objects are made real in the USD file. This is fine for exporting a
  linked-in posed character, not so much for thousands of pebbles etc.
- The way materials and UV coordinates and Normals are exported is going
  to change soon.
- This patch contains LazyDodo's fixes for building on Windows in D5359.

== Meshes ==

USD seems to support neither per-material nor per-face-group
double-sidedness, so we just use the flag from the first non-empty
material slot. If there is no material we default to double-sidedness.

Each UV map is stored on the mesh in a separate primvar. Materials can
refer to these UV maps, but this is not yet exported by Blender. The
primvar name is the same as the UV Map name. This is to allow the
standard name "st" for texture coordinates by naming the UV Map as such,
without having to guess which UV Map is the "standard" one.

Face-varying mesh normals are written to USD. When the mesh has custom
loop normals those are written. Otherwise the poly flag `ME_SMOOTH` is
inspected to determine the normals.

The UV maps and mesh normals take up a significant amount of space, so
exporting them is optional. They're still enabled by default, though.
For comparison: a shot of Spring (03_035_A) is 1.2 GiB when exported
with UVs and normals, and 262 MiB without. We probably have room for
optimisation of written UVs and normals.

The mesh subdivision scheme isn't using the default value 'Catmull
Clark', but uses 'None', indicating we're exporting a polygonal mesh.
This is necessary for USD to understand our normals; otherwise the mesh
is always rendered smooth. In the future we may want to expose this
choice of subdivision scheme to the user, or auto-detect it when we
actually support exporting pre-subdivision meshes.

A possible optimisation could be to inspect whether all polygons are
smooth or flat, and mark the USD mesh as such. This can be added when
needed.

== Animation ==

Mesh and transform animation are now written when passing
`animation=True` to the export operator. There is no inspection of
whether an object is actually animated or not; USD can handle
deduplication of static values for us.

The administration of which timecode to use for the export is left to
the file-format-specific concrete subclasses of
`AbstractHierarchyIterator`; the abstract iterator itself doesn't know
anything about the passage of time. This will allow subclasses for the
frame-based USD format and time-based Alembic format.

== Support for simple preview materials ==

Very simple versions of the materials are now exported, using only the
viewport diffuse RGB, metallic, and roughness.

When there are multiple materials, the mesh faces are stored as geometry
subset and each material is assigned to the appropriate subset. If there
is only one material this is skipped.

The first material if any) is always applied to the mesh itself
(regardless of the existence of geometry subsets), because the Hydra
viewport doesn't support materials on subsets. See
https://github.com/PixarAnimationStudios/USD/issues/542 for more info.

Note that the geometry subsets are not yet time-sampled, so it may break
when an animated mesh changes topology.

Materials are exported as a flat list under a top-level '/_materials'
namespace. This inhibits instancing of the objects using those
materials, so this is subject to change.

== Hair ==

Only the parent strands are exported, and only with a constant colour.
No UV coordinates, no information about the normals.

== Camera ==

Only perspective cameras are supported for now.

== Particles ==

Particles are only written when they are alive, which means that they
are always visible (there is currently no code that deals with marking
them as invisible outside their lifespan).

Particle-system-instanced objects are exported by suffixing the object
name with the particle's persistent ID, giving each particle XForm a
unique name.

== Instancing/referencing ==

This exporter has experimental support for instancing/referencing.

Dupli-object meshes are now written to USD as references to the original
mesh. This is still very limited in correctness, as there are issues
referencing to materials from a referenced mesh.

I am still committing this, as it gives us a place to start when
continuing the quest for proper instancing in USD.

== Lights ==

USD does not directly support spot lights, so those aren't exported yet.
It's possible to add this in the future via the UsdLuxShapingAPI. The
units used for the light intensity are also still a bit of a mystery.

== Fluid vertex velocities ==

Currently only fluid simulations (not meshes in general) have explicit
vertex velocities. This is the most important case for exporting
velocities, though, as the baked mesh changes topology all the time, and
thus computing the velocities at import time in a post-processing step
is hard.

== The Building Process ==

- USD is built as monolithic library, instead of 25 smaller libraries.
  We were linking all of them as 'whole archive' anyway, so this doesn't
  affect the final file size. It does, however, make life easier with
  respect to linking order, and handling upstream changes.
- The JSON files required by USD are installed into datafiles/usd; they
  are required on every platform. Set the `PXR_PATH_DEBUG` to any value
  to have the USD library print the paths it uses to find those files.
- USD is patched so that it finds the aforementioned JSON files in a path
  that we pass to it from Blender.
- USD is patched to have a `PXR_BUILD_USD_TOOLS` CMake option to disable
  building the tools in its `bin` directory. This is sent as a pull
  request at https://github.com/PixarAnimationStudios/USD/pull/1048
2019-12-13 10:27:40 +01:00
Campbell Barton 57d2d8ac05 CMake: recent removal of linked libs gave errors in some cases
While I can't redo the error, it looks to be related to tbb & mkldnn.

Adding back in this case for now.
2019-12-11 20:36:57 +11:00
Campbell Barton daf290dcc8 CMake: fix linking Blender as a Python module
Remove direct links to Blender binary,
only link to the window manager and rely on indirect links
for everything else.
2019-12-10 23:14:56 +11:00
Ray Molenkamp 6df2ede341 Cleanup/Windows: Separate out the MS-CRT into a subfolder
In older versions the ms crt was only a few dlls, in recent versions
this jumped to over 40 leading to quite a bit of clutter in our
bin folder.

This change moves the CRT into its own folder.

For developers that generally already have the runtime globaly
available on their machine, there is a new cmake option
(WITH_WINDOWS_BUNDLE_CRT, default ON) that you can use to toggle
installing the runtime to the blender bin folder, and save some
time during the initial build, this option is off by default for
only the developer profile.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D6132
2019-12-06 10:12:03 -07:00
Ray Molenkamp 61a02a7aa1 Cleanup: Windows Manifest usage.
We had a manifest file, but it was seemingly not used, some
settings were done using linker pragmas, some of them visual
studio would set by default for us, others where not set at all.

This patch changes:

- Single manifest file where we can maintain all settings in
a single location, removal of any linker pragmas related to
the manifest.

- Compatibly settings for win vista - win10, without this any
call to any of the GetVersion and related functions (GetVersionEx,
VerifyVersionInfo, IsWindowsXxxx) will by default say we are
on vista and OS specific optimizations in external libraries may
be missed.

-Rather than having it in the .RC file in an #ifdef which may
or may not trigger depending on the build tool used, we tell
cmake to treat it as a source file and it will do the right
thing for both the ninja and visual studio generators.

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

Reviewers: brecht
2019-12-05 12:15:04 -07:00
Ray Molenkamp b213d82c19 Cleanup/CMake: Remove dormant windows codesign code
This was added years ago to prepare for code-signing the executable
but was never used, buildbots use a different mechanism now to sign
so no need to keep this around.
2019-11-26 15:13:22 -07:00
Campbell Barton bb0708a483 CMake: support building without Python
Resolve linking issues, warnings.
2019-11-25 15:45:49 +11:00
Ray Molenkamp 44f18ce0a6 Windows: Disable tbbmalloc for debug builds.
TBBMalloc seems to have a race condition somewhere on shutdown
that seems to show up in debug builds only, ideally we find the
issue and send a patch upstream but due to its racy nature it
has eluded capture so far. This patch disables TBBMalloc for
debug builds so that developers that actually need to get some
work done can work without being bothered by this misbehaviour.
2019-11-23 09:21:34 -07:00
Sergey Sharybin 8d4460b6c4 GHOST: Only spam about X11 errors when using --debug-ghost
This commit adds a new command line argument --debug-ghost and
makes it so X11 errors happening during context initialization
are only printed when this new flag is sued.

There is no need to flood users with errors when their GPU is
not supporting latest OpenGL version. Or, at a very minimum,
the error must be more meaning full.

Differential Revision: https://developer.blender.org/D6057
2019-11-18 09:28:17 +01:00
Ray Molenkamp 6d9d24e3d4 msvc: Use debug versions of tbb malloc for debug builds
Using the release versions gave unpredictable results when
the msvc debugger was attached for some developers.
2019-11-17 14:26:29 -07:00
Sergey Sharybin 97d79ca844 Merge branch 'blender-v2.81-release' 2019-11-13 11:49:09 +01:00
Sergey Sharybin c73a99ef90 Initial implementation of code signing routines
This changes integrates code signing steps into a buildbot worker
process.

The configuration requires having a separate machine running with
a shared folder access between the signing machine and worker machine.

Actual signing is happening as a "POST-INSTALL" script run by CMake,
which allows to sign any binary which ends up in the final bundle.
Additionally, such way allows to avoid signing binaries in the build
folder (if we were signing as a built process, which iwas another
alternative).
Such complexity is needed on platforms which are using CPack to
generate final bundle: CPack runs INSTALL target into its own location,
so it is useless to run signing on a folder which is considered INSTALL
by the buildbot worker.

There is a signing script which can be used as a standalone tool,
making it possible to hook up signing for macOS's bundler.

There is a dummy Linux signer implementation, which can be activated
by returning True from mock_codesign in linux_code_signer.py.
Main purpose of this signer is to give an ability to develop the
scripts on Linux environment, without going to Windows VM.

The code is based on D6036 from Nathan Letwory.

Differential Revision: https://developer.blender.org/D6216
2019-11-13 09:24:41 +01:00
Ray Molenkamp d60a60f0cb Add support for the TBB allocator on windows.
The heap on windows is single threaded causing it to lag behind linux in performance in allocation heavy multithreaded scenarios, BVH building is a prime example.

See https://developer.blender.org/D6218 for benchmark results

for testing with the allocator enabled/disabled you can set the environment variable TBB_MALLOC_DISABLE_REPLACEMENT=1 to disable the TBB allocator.

Reviewed By: @sergey

Differential Revision: https://developer.blender.org/D6218
2019-11-12 20:55:39 -07:00
Campbell Barton 41ec25d27b Cleanup: style 2019-10-21 15:05:56 +11:00
Campbell Barton 3ceff8b7bc CMake: fix building as a Python module on macOS
Caused by c553b790fc
2019-10-21 14:48:17 +11:00
Sergey Sharybin 26b1216629 CMake: Move software-gl to generic install procedure
Removes custom logic from buildbot's packing step.

This also removes icons/ folder, but CMake was already copying the
icons to the root of the install folder.
2019-10-09 13:07:40 +02:00
Ray Molenkamp d2e4b13b9c CMake: Add support for building with OpenMP support for clang on windows.
mostly minor c/cxx/linker flags, only tested with clang 9.0.0

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

Reviewers: brecht, jesterking
2019-10-07 10:24:13 -06:00
Harley Acheson 3a3e5fb365 Fix T69935: Silence Win32 OS Error Dialogs
Call SetErrorMode() at startup to prevent error mode dialogs.

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

Reviewed by Brecht Van Lommel
2019-09-29 11:43:24 -07:00
Gaia Clary 8ac21cb40a fix:wrong python pdb copied for Windows-VS when building for pydebug 2019-09-27 22:59:08 +02:00
Laurent Noel ae755c0167 Windows: Fill ProductVersion of blender executable
On windows, the ProductVersion field of the blender executable was empty,
see [1] for more information. This field might be required by windows
tools such as SCCM agent to track usage statistics.

It seems that it was due to the BLEN_VER_RC_STR macro used in
winblender.rc not being a string.

[1] https://docs.microsoft.com/en-us/windows/win32/menurc/versioninfo-resource

Differential Revision: https://developer.blender.org/D5896
2019-09-25 12:06:20 -06:00
Campbell Barton d8a7e5ee32 Cleanup: spelling 2019-09-19 13:19:53 +10:00
Campbell Barton 0ec6564668 Cleanup: unused headers (GPU) 2019-09-14 00:22:24 +10:00