1
1

Compare commits

..

1335 Commits

Author SHA1 Message Date
0b41497c3c remove "Access" from name 2020-05-04 12:36:11 +02:00
dc1c562f63 Merge branch 'master' into simulation-access-modifier 2020-05-04 12:29:39 +02:00
10fad7c88d add ifdefs 2020-05-04 12:28:58 +02:00
9adb81f584 Modifiers: Rename Simulate category to Physics
While the name "Simulate" might be more accurate, there is
a naming collision with the new modifier added in D7549.
Therefore, we decided to rename the category for now.
2020-05-04 12:24:12 +02:00
9eb46d6c29 Cleanup: rename mcords to mcoords
- 'coords' is an abbreviation for coordinates, not 'cords'.
- Rename 'moves' to 'coords_len'.
2020-05-04 19:50:06 +10:00
2addc868de Cleanup: pass ARegion, View2D as const 2020-05-04 19:32:59 +10:00
411c5238a2 UV: support edge-selection for box/circle/lasso select 2020-05-04 19:20:08 +10:00
88b9505b84 BLI: simplify memory management in OpenAddressingArray 2020-05-04 11:11:46 +02:00
fdebdfa320 Cleanup: rename uv_sel_co_from_eve, pass in UV layer offset 2020-05-04 17:08:57 +10:00
a9ef6d5ad7 Cleanup: replace UV_SELECT_ISLAND_LIMIT macro with a function
Also make return argument last for uvedit_pixel_to_float.
2020-05-04 17:00:11 +10:00
b048272825 Cleanup: split selection operations into uvedit_select.c 2020-05-04 16:59:35 +10:00
b84c380aaa Merge branch 'blender-v2.83-release' 2020-05-04 08:24:08 +02:00
000fdd8a6e GPencil: Fix Chisel Brush pressure
In previous commit the pressure was disabled by error.
2020-05-04 08:23:27 +02:00
7b9d6ef2b6 Cleanup: use ELEM macro 2020-05-04 14:03:41 +10:00
33bdd91fb8 Windows: Move tbb to being dynamic library
Static tbb has always been frowned upon [1] sofar it has worked for us but
given our reliance on tbb is about to increase (D7475), I'd like to move the library
to more supported configuration. Which means moving it to be a dynamic library

The libs part of this change is in rBL62416

Reviewed By: Brecht

Differential Revision: https://developer.blender.org/D7570
2020-05-03 16:25:56 -06:00
70fe988dc4 Fluid: Cleanup use of std in MANTA wrapper
Moved std namespace to beginning of class.
2020-05-03 21:10:52 +02:00
82f9ed9305 Fluid: Cleanup in main MANTA wrapper
Use shorter variable names.
2020-05-03 21:10:52 +02:00
99ee1de094 Fluid: Refactored 'Modifier Data to Python' value transfer function
This function needed a bigger cleanup, especially after the problem from T76276.
2020-05-03 21:10:51 +02:00
57cfa8e2d0 Merge branch 'blender-v2.83-release' 2020-05-03 20:42:37 +02:00
331bf04fad GPencil: Hide Canvas Grid when Surface or Stroke mode is enabled
This was introduced by error during refactor. The grid must not be visible in these modes.
2020-05-03 20:42:18 +02:00
bbfae8f184 Merge branch 'blender-v2.83-release' 2020-05-03 20:35:30 +02:00
a577291b03 Fix T76364: GPencil grid is not located in the right place
During the refactor, the location of the grid was broken. Now, the grid is in Object origin or 3D cursor origin as it was in 2.82.
2020-05-03 20:34:48 +02:00
ff8288ad1e Windows: Replace BLI_File* calls with system calls in system_win32.c
Using BLI calls in this file triggered a condition where
poorly modelled dependencies in cmake (ie bf_blenlib using
zlib headers but not linking the libraries) leading to
linker error in debug builds of some of the tests.

This diff sidesteps the dependencies issue by using native
calls rather than BLI calls to check if a file exists and
what its size is. Effectively sweeping the issue right back
under the rug where I found it.

The best solution would be to audit all libraries and ensure
they have proper link requirements set, but that requires
significantly more time than I have available right now.
(zlib in blenlib was one of them and would have been easy
to fix, but there were others that required more work)

The alternative is tests that fail to build which worse.

I'll revisit this and fix it properly but for now this will
have to do.
2020-05-03 12:07:22 -06:00
fe891d581d Audaspace: update from upstream
- Changing API for time values from float to double for better precision.
- Fixing minor mistakes in the documentation.
- Fixing minor unnecessary large memory allocation.
2020-05-03 15:30:35 +02:00
2b7d5caae8 Merge branch 'blender-v2.83-release' 2020-05-03 13:34:55 +02:00
1a6119c8e4 GPencil: More changes to improve Chisel brush
More small tweaks to get the right "feeling" when drawing.

The defaults has been tested by @pepeland.
2020-05-03 13:34:35 +02:00
6a0cb48149 GHOST: cleanup platform checks, fix Wayland + X11
- Building with Wayland + X11 missed an exception include.
- Move HEADLESS check first, since it's the same on all platforms.
2020-05-03 20:24:24 +10:00
a6380d063f Cleanup: store BLF buffer size in a variable 2020-05-03 18:10:25 +10:00
ccaab72685 BLF: use 'int' for internal glyph x,y bearing
These were stored as float but were originally cast from an int
and were often cast back to int.

Also use int pairs for dimensions values.
2020-05-03 18:01:20 +10:00
Harley Acheson
5366eb89c6 UI: improve widget text cursor position
Use BLF_boundbox_foreach_glyph for more accurate cursor placement.
2020-05-03 17:08:05 +10:00
0d65520f05 BLF: add new arguments to BLF_GlyphBoundsFn
- glyph_bounds: to get the character width.
- glyph_bearing: lower left character starting point.

These values are needed for more precise glyph calculations.
2020-05-03 16:51:34 +10:00
d388c1c524 Cleanup: sort file lists 2020-05-03 13:45:40 +10:00
76be35efb2 Cleanup: clang-format 2020-05-03 13:42:49 +10:00
b64fdbfb98 Cleanup: remove unused alpha argument 2020-05-03 13:40:56 +10:00
6408cd00c5 Annotations: Remove old unused code
This code was part of the old grease pencil when annotations was not a separated module.
2020-05-02 18:01:58 +02:00
7df51ca11a Possible fix for T76113: Use GL_STATIC_DRAW in immBegin
This fixes a freeze when closing temporary windows with `AMD Radeon HD 7570M`
The performance is practically the same between calls (with a micro advantage for `GL_STATIC_DRAW`)
I couldn't check the difference in memory usage.
The ideal would be profile in different setups.
But due to the seriousness of the bug, these tests were postponed.
2020-05-02 10:21:38 -03:00
5ef94c9c41 Merge branch 'blender-v2.83-release' 2020-05-02 13:35:19 +02:00
1623fdb3bc Cleanup: Fix return NULL from bool type function 2020-05-02 13:33:23 +02:00
719cff1414 Merge branch 'blender-v2.83-release' 2020-05-02 10:48:15 +02:00
cfdff4fb63 GPencil: Improve Market Chisel angle algorithm
With the previous commit, the angle effect was too subtle. Now the effect is more visible,
2020-05-02 10:47:45 +02:00
03b911dd87 Merge branch 'blender-v2.83-release' 2020-05-01 22:12:47 -06:00
e590199949 Revert "Outliner: Fix selection sync for various operators"
This reverts commit 92d62148be.

When merging in from blender-v2.83-release the merge was somehow rebased
after viewing the log.
2020-05-01 22:10:46 -06:00
92d62148be Outliner: Fix selection sync for various operators
Add missing outliner selection sync tagging for various non-outliner
operators.
* Curve separate
* Grease Pencil separate
* Mesh separate
* Make instances real
* 3D view paste
* Sequencer paste
* Armature delete, dissolve, separate, duplicate, subdivide, extrude,
  click extrude, primitive add
* Pose Group select, delete

Resolves T71404
2020-05-01 21:42:56 -06:00
c06a40006d Outliner: Fix selection sync for various operators
Add missing outliner selection sync tagging for various non-outliner
operators.
* Curve separate
* Grease Pencil separate
* Mesh separate
* Make instances real
* 3D view paste
* Sequencer paste
* Armature delete, dissolve, separate, duplicate, subdivide, extrude,
  click extrude, primitive add
* Pose Group select, delete

Resolves T71404
2020-05-01 21:13:19 -06:00
83304e4c22 Merge branch 'blender-v2.83-release' 2020-05-01 23:55:13 +02:00
7212dbd7be Fix T76062: Interpolate Radius in Curve Subdivide Special Case
Differential Revision: https://developer.blender.org/D7523
2020-05-01 16:49:36 -05:00
bba11c68c4 Fix T75995: Cycles render artifacts with overlapping volumes
This is a workaround, but a proper solution requires significant changes to
ray intersection in the kernel.
2020-05-01 23:42:42 +02:00
447a7f510e Fix T76309: changing AOV type does not update compositor socket 2020-05-01 23:10:45 +02:00
433eaffd55 Fix some LLVM symbols outside of the llvm namespace being public on Linux
This may help with T68052, crashes with Intel NEO OpenCL driver.
2020-05-01 22:59:01 +02:00
805a78e396 Cleanup: compiler warning with clang 10 2020-05-01 22:58:57 +02:00
06839379c5 Transform: Allow orientation change with custom matrix in modal 2020-05-01 17:41:06 -03:00
Nikhil Shringarpurey
51aa0ea58f Fx build error with MSBuild on Windows
Differential Revision: https://developer.blender.org/D7587
2020-05-01 22:03:26 +02:00
87602d886f Merge branch 'blender-v2.83-release' 2020-05-01 21:28:55 +02:00
Richard Antalik
98990f6ba4 Fix T76033: VSE crash with prefetch, disk cache and meta strips
`BKE_sequencer_prefetch_get_original_sequence()` didn't look in metas
and returned NULL. This caused crash in disk cache that was trying to
read seq->name.

Add function that will look in meta strips recursively and condition
that seq must not be NULL.

Reviewed By: brecht

Maniphest Tasks: T76033

Differential Revision: https://developer.blender.org/D7597
2020-05-01 21:22:04 +02:00
b52b5e15af Outliner: Fix selection extend not toggling
An unintentional side-effect of rBfe7528ee919b was that when
extend-selecting a selected element in the outliner, it would be
deselected and activated rather than selected and activated.

This commit restores the expected toggling behavior. Consistent behavior
for extend-selecting child datablocks is not resolvable without a much
larger cleanup of the outliner select functions.
2020-05-01 13:01:31 -06:00
9ca78c9bcc Fix for T76281: Engine Info Overlay Formatting
Allow render engine info to display correctly among other text overlays and scene statistics.

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

Reviewed by Brecht Van Lommel
2020-05-01 10:30:38 -07:00
eddddceb8e Merge branch 'blender-v2.83-release' 2020-05-01 19:17:29 +02:00
716638458d GPencil: Fix unreported noise using Market Chisel pen
The interpolated points recalculated the angle again and this added noise. The angle must not be calculated and must use the previous thickness.
2020-05-01 19:17:04 +02:00
57d1db27c7 Cleanup: Animation, refactored FCurve interpolation
Early returns are used to heavily reduce code indentation and clean up
some code flow.

No functional changes.
2020-05-01 17:37:28 +02:00
5b6ee80351 Cleanup: Animation, split FCurve interpolation into separate function 2020-05-01 17:37:28 +02:00
9c2c697011 Tracking: Cleanup, localize variable
Also avoid possible accumulation of floating point error.
2020-05-01 16:13:10 +02:00
b22abd112d Tracking: Cleanup, localize iterator variables 2020-05-01 16:13:10 +02:00
60741cfe18 Fix: Fix build error on windows
Headers and implementation had slightly different signatures
2020-05-01 08:06:34 -06:00
b83a8d6fc4 Cleanup: Animation, unify FCurve extrapolation
Previously there were two functions for FCurve extrapolation, one for
before the first keyframe, and the other for after the last. After the
previous cleanup made the variable names consistent, it was clear that
the code was almost identical. The biggest difference was in the sign of
many of the calculations, which was cancelled out by swapping `B-A` to
`A-B`. This showed that the computations are actually the same, and the
only remaining difference was which neighbouring handle to use in case
of Bézier curves.

No functional changes.

# Conflicts:
#	source/blender/blenkernel/intern/fcurve.c
2020-05-01 15:38:45 +02:00
f651548c2e Cleanup: Animation, refactored FCurve extrapolation
Variables have been renamed so that they refer to the endpoint and its
neighbor (rather than `bezt`, `prevbezt`, or `lastbezt`), and
unnecessary variables have been removed. By returning early the code
flow is also easier to understand.

No functional changes.
2020-05-01 15:38:45 +02:00
75370684fa Cleanup: Animation, split FCurve extrapolation into separate functions
The `fcurve_eval_keyframes` consists of three parts:
- Before the first keyframe
- After the last keyframe
- Between the keyframes

This commit splits the first two parts into separate functions. This is
the first of a series of refactors, which will be committed into smaller
parts so that each is easier to follow & validate.

No functional changes.
2020-05-01 15:38:45 +02:00
b523911e86 Windows: Support backtraces on release builds.
This diff add supports for crash logs on windows for
release builds. This can be toggled on/off with the
`WITH_WINDOWS_PDB` cmake option. by default it is on.

Things to take into consideration:

Release builds are hightly optimized and the resulting
backtraces can be wrong/misleading, take the backtrace
as a general area where the problem resides rather than
an exact location.

By default we ship a minimized symbol file that can only
resolve the function names. This was chosen to strike
a balance between growth in size of the download vs
functionality gained. If more detailed information is
required such as source file + line number information
a full pdb can be shipped by setting `WITH_WINDOWS_STRIPPED_PDB`
to off.

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

Reviewed by: brecht
2020-05-01 07:37:48 -06:00
4cc8123377 UI: Use property split layout and decorators for material properties
Use the automatic property split layout (hence, change to the new 40/60% split
ratio) and add decorator buttons for animatable properties.
This actually applies to all node input buttons in the properties, e.g. world shading,
light shading, texture nodes.

Doing this makes the layout more consistent with other layouts in the
properties. But the decorators are also a useful hint for users that these
options can be animated. Previously using decorators and the automatic split
layout wasn't possible, I've done a number of changes now to have it supported.
Before I moved the socket icons to the left side, the decorators also looked
weird (two circle icons next to each other).

{F8497704} With nested items: {F8497708}

Reviewed By: William Reynish, Pablo Vazquez

Differential Revision: https://developer.blender.org/D7544
2020-05-01 15:21:41 +02:00
2188175891 Transform: Invert shear direction aligned to view
Issue introduced in rBc57e4418bb85.
2020-05-01 10:00:13 -03:00
d49b148459 Revert "Improve proportional edit drawing"
Accident!

This reverts commit ae049a6c6a.
2020-05-01 09:35:29 -03:00
185e1d5395 Fix T76254: 'Normal' Transformation Orientation using Global
Issue introduced in rBc57e4418bb85.
2020-05-01 09:32:22 -03:00
ae049a6c6a Improve proportional edit drawing
(This is a simplified version of D4786)

The advantage of highlighting the points would be to indicate more
clearly what is affected by the proportional edit.

The default circle is not so informative and sometimes it is even off
screen so the user loses the quick identification of the influence.
(See T75482)

The disadvantage of this design is that the points could end up hiding
the mesh.

The original patch added the option `draw_proportional_gradient`, but I
prefer to avoid adding more options and more information to the
interface.

I'm not sure if the advantages outweigh the disadvantages.

{F8504097}

Reviewers: #user_interface, #modeling

Subscribers:
2020-05-01 09:32:22 -03:00
aa72e3abf9 Cleanup: moved drivers to BKE_fcurve_driver.h / fcurve_driver.c
All the driver-specific code in `fcurve.c` has been moved into a new file
`fcurve_driver.c`. The corresponding declarations have been moved from
`BKE_fcurve.h` to `BKE_fcurve_driver.h`.

All the `#include "BKE_fcurve.h"` statements have been investigated and
replaced with `BKE_fcurve_driver.h` where necessary.

No functional changes.
2020-05-01 13:08:22 +02:00
28bdf669a9 Fix: added missing buildinfo to BKE_fcurve test 2020-05-01 12:45:53 +02:00
d7d140ec7f CMake: add WITH_GHOST_X11 option
- Support building only with Wayland.
- In this case, show useful error messages
  when Wayland fails to load.
2020-05-01 20:07:01 +10:00
9a4844cfdb Tests: Animation, added unittests for FCurve evaluation
This introduces unittests for FCurve evaluation.

No functional changes to actual Blender code.

Differential Revision: https://developer.blender.org/D6778
2020-05-01 11:56:59 +02:00
d1c0d77e18 Merge branch 'blender-v2.83-release' 2020-05-01 11:47:55 +02:00
Demeter Dzadik
b2d850efc0 Cleanup: Solidify modifier: Remove unneccessary error message.
For any modifier, the expected output when the input mesh is empty, is an
empty mesh. So this error message was useless, and could spam the
console in some usecases of the modifier stack...

Reviewed By: weasel, mont29

Differential Revision: https://developer.blender.org/D7571
2020-05-01 11:41:38 +02:00
e28d2e5184 Cleanup: duplicate include, define from Wayland patch 2020-05-01 19:28:43 +10:00
7ded7610ce Cleanup: rename WITH_X11 to WITH_GHOST_X11
Matches WITH_GHOST_{SDL|WAYLAND}
2020-05-01 19:14:50 +10:00
47fea20dc8 GHOST: set the window state on wayland startup 2020-05-01 18:43:11 +10:00
d602af73d3 WM: remove X11 hard coded window size workaround
Causes issues with Wayland and is no longer required for Gnome/KDE.
2020-05-01 18:43:00 +10:00
aff5e18adb Cleanup: replace inline dot-product with dot_v4v4 2020-05-01 15:05:39 +10:00
ff1174e52c Cleanup: improve readability for color assignment 2020-05-01 15:05:25 +10:00
a6fbd4c9c8 Cleanup: pass const arguments to texture functions 2020-05-01 14:40:35 +10:00
b7117b5728 Cleanup: avoid returning a bit-flag as a float
Texture functions were returning a float which was cast back to an int
to use as a flag.
2020-05-01 14:19:04 +10:00
f7d98d3582 Cleanup: rename externtex to RE_texture_evaluate
- Pass in return arguments last.
- Pass in RGBA as a vector.
- Use boolean return argument.
2020-05-01 14:03:12 +10:00
635754a876 Cleanup: use sections for outliner sources 2020-05-01 13:27:20 +10:00
5ee1c7f695 Cleanup: spelling, comments 2020-05-01 12:36:19 +10:00
0cb53d4740 Cleanup: warnings 2020-05-01 12:34:43 +10:00
7a809a7504 Curve: Force pretesselate modifier to output a Mesh output
This is to improve the case of T71055 where curves share the same batch
cache when they shouldn't.

This however, does not help to fix edit mode display.

The real fix would be to have a similar handling to what the mesh modifiers
do and duplicate the whole Curve data. But this is too much work/change for
the 2.83 release.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D7569
2020-05-01 00:07:38 +02:00
4d790516fb Curve: Force pretesselate modifier to output a Mesh output
This is to improve the case of T71055 where curves share the same batch
cache when they shouldn't.

This however, does not help to fix edit mode display.

The real fix would be to have a similar handling to what the mesh modifiers
do and duplicate the whole Curve data. But this is too much work/change for
the 2.83 release.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D7569
2020-05-01 00:03:28 +02:00
03f4d20bcf Revert "Windows: Support backtraces on release builds."
Issues with older cmake.
2020-04-30 14:00:11 -06:00
Israel Medina
99cb6dbe65 VSE: Add frame interpolation option to speed effect
Do cross transition from current to next frame instead of displaying
one image for n frames.

Reviewed By: ISS, sergey, campbellbarton

Differential Revision: https://developer.blender.org/D7417
2020-04-30 21:51:22 +02:00
1d63db2044 Fix: Windows build bot script error
Partial revert of D7520
2020-04-30 13:34:11 -06:00
1960b8a361 UI: Fix animating panels after drag changing region size
The previous commit for this issue, 8e08d80e52, missed the case
where the panel animates to its aligned position when the mouse is
released.
2020-04-30 14:21:14 -05:00
713ad9d971 Fix T76276: Compiler Error C1061 due to too many nested if/else in MANTA_main.cpp
The compiler error should be fixed by removing the 'else if' blocks. However, this function should still be refactored in the future.
2020-04-30 20:54:53 +02:00
d8abef6d7c clean-up: Remove left over debug print. 2020-04-30 12:54:32 -06:00
f90a716e68 Windows: Support backtraces on release builds.
This diff add supports for crash logs on windows for
release builds. This can be toggled on/off with the
`WITH_WINDOWS_PDB` cmake option. by default it is on.

Things to take into consideration:

Release builds are hightly optimized and the resulting
backtraces can be wrong/misleading, take the backtrace
as a general area where the problem resides rather than
an exact location.

By default we ship a minimized symbol file that can only
resolve the function names. This was chosen to strike
a balance between growth in size of the download vs
functionality gained. If more detailed information is
required such as source file + line number information
a full pdb can be shipped by setting `WITH_WINDOWS_STRIPPED_PDB`
to off.

The Release in the title of this diff refers to the
release build type, not the official blender releases.

Initially this will only be enabled for nightly build
bot versions of blender, official releases as of now
will not ship with symbols.

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

Reviewed by: brecht
2020-04-30 12:41:16 -06:00
Julian Eisel
8e08d80e52 Fix dragging panels changing region size
While dragging panels, the region size would change which would feel glitchy.

See D7462 for a demo of the issue.
2020-04-30 19:20:01 +02:00
d44f323df5 Fix crash when switching subdivision level in Multires
When using multires_reshape_context_create_from_ccg to create the
context mmd is null, so the subdivision smooth mode can't be checked
there.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D7579
2020-04-30 18:43:59 +02:00
38456d3e82 Cleanup: Fix compiler warning 2020-04-30 18:10:23 +02:00
31d3f034ab Fix T76097: Simulations don't take animated gravity into account
Together with 21485e94aa this commit should fix the issue with animated gravity values.
2020-04-30 18:09:05 +02:00
4612ca3ede Cleanup: simplify a bit libquery code. 2020-04-30 18:01:47 +02:00
f4b020eec3 Merge branch 'blender-v2.83-release' 2020-04-30 17:57:46 +02:00
f5237f7704 Fix long OptiX BVH build times in Cycles with many objects
Looping over all primitives for every object is really slow, so this patch avoids that by moving
the necessary assignments inline with the primitive merging done for every geometry.
2020-04-30 17:57:01 +02:00
21485e94aa Fluid: Refactored fluid gravity settings
Refactored setup that converts from Blender to Mantaflow units.
2020-04-30 17:33:22 +02:00
c4a850b7c2 Updated Mantaflow source files 2020-04-30 17:33:22 +02:00
e7e6b02ed9 Fluid: Minor cleanup and sanity checks 2020-04-30 17:33:22 +02:00
713b4c10a6 UI: Statistics Visual Changes
Improving scene statistics readability, and showing objects count while in Edit mode.

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

Reviewed by Campbell Barton
2020-04-30 08:16:33 -07:00
134619fabb Multires: Subdivide Simple and Subdivide Linear
This introduces two alternative subdivision modes that generates
displacement on the grids that look as Simple subdivisions but while
using the Catmull-Clark subdivision type in the modifier. This way,
Simple and Catmull-Clark subdivision can be combined when creating new
levels if needed, for example, to sculpt hard surface objects.

Subdivide simple smooths the sculpted data when creating a new
subdivision level. Subdivide linear also preserves the sharpness
in the sculpted data.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D7415
2020-04-30 16:57:29 +02:00
f28875a998 Multires: Unsubdivide and Rebuild Subdivisions
This implements the main unsubdivide algorithm which rebuilds a base mesh and extracts the grid's data from a high resolution mesh.
It includes the Rebuild Subdivisions operator, which generates all subdivision levels down to the level 0 base mesh.

It supports:
- Rebuilding an arbitrary number of levels (Unsubdivide) or as many levels as possible down to level 0 in a single step (Rebuild Subdivisions).
- Rebuilding with already existing grids.
- Meshes with n-gons and triangles
- Meshes with more than 2 faces per edge
- Base mesh made completely out of triangles
- Meshes without poles
- Meshes with multiple disconnected elements at the same subdivision level

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D7372
2020-04-30 16:49:56 +02:00
d4c547b7bd Multires: Enable sculpting in all subdivision levels
Return the correct sculpt level in BKE_multires_sculpt_level_get and
enable the property in the UI

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D7575
2020-04-30 16:45:01 +02:00
6a7e9f2b76 GPencil: Add material selector to context menus
Now it's possible to select the material in context menu and new menu to select material.

The patch and workflow  has been tested in greasepencil-object branch.

* New Material selector in Draw mode Context menu:

{F8499259}

* Pressing `U`key in Draw mode display material menu.

{F8503224}

Reviewed By: mendio, pepeland

Differential Revision: https://developer.blender.org/D7554
2020-04-30 16:13:23 +02:00
dc0a564c06 Merge branch 'blender-v2.83-release' 2020-04-30 15:55:35 +02:00
9ee7fc15af Fluid: Removed domain size option from diffusion panel
Domain size parameter no longer needed (unsed right now). Domain size is directly taken from object.
2020-04-30 15:42:44 +02:00
4d63dfca4c Fluid: Reset noise emission value at the beginning of an adaptive frame
Emission values should not accumulate beyond one frame, only during the adaptive steps of one frame.
2020-04-30 15:42:44 +02:00
6121c28501 Fix T75895: Unable to Compile Cycles on NAVI/Linux
This patch will add some compiler hints to break unrolling in the
nestled for loops of the voronoi node.

Reviewed by: Brecht van Lommel

Differential Revision: https://developer.blender.org/D7574
2020-04-30 15:04:40 +02:00
7163e159c5 UI: add all operators to search menu when developer extras is enabled
This allows developers to easily access operators they're working on,
without having to add them to the interface first.
2020-04-30 21:54:50 +10:00
ea77584d36 Fix orientation change in Redo
Some transform redo operations require contraint to be enabled.
Issue introduced in rBc57e4418bb85.
2020-04-30 08:52:38 -03:00
41b45d9159 Fix T76260: Inverted rotation in non-3d views
Issue introduced in rBc57e4418bb85.
2020-04-30 08:38:18 -03:00
ae98a033c8 Outliner: Add new delete operator
In the industry standard keymap, both deleting objects and collections
were mapped to the same keys causing confusion when only collections
could be deleted through the keymap.

This adds a new delete operator to delete all selected objects and
collections, accessible from both the keymap and context menu. Now any
selected objects and collections are deleted when Delete is chosen from
the keymap. This also updates the tooltip description which was
previously undocumented.

Resolves T67462
2020-04-30 19:53:36 +10:00
79269e4237 Merge branch 'blender-v2.83-release' 2020-04-30 10:48:09 +02:00
36bf067ddc Fix T76236: GPencil drrawing resetting posed positions with armature after layer renaming
The datablock was not tagged for updating.
2020-04-30 10:47:39 +02:00
7f4c4011ce Cleanup: replace unordered_map with switch statement
Was performing 2x look-ups, checking keys doesn't benefit noticeably
from hash look-ups.
2020-04-30 17:56:51 +10:00
328da12598 Merge branch 'blender-v2.83-release' 2020-04-30 09:55:31 +02:00
2b094be949 Fix T75985: Texture paint brush gradients results in wrong color
A Colorband's CBData color **is not** considered `PROP_COLOR_GAMMA`.
A Brushes color **is** considered `PROP_COLOR_GAMMA`.
(PROP_COLOR_GAMMA is used for colors which would be color managed before
display, could be renamed to something better once...)

This leads to different rgb values in ColorBand.CBData of br->gradient
and brush->rgb for seemingly identical colors. (this is because color
pickers do differently in case block->is_color_gamma_picker/
ui_but_is_color_gamma)

Now it looks like `paint_brush_color_get` is expected to return a color
in sRGB (according to @jbakker this is for legacy reasons) so we need to
run the colorband colors through linear -> sRGB.

It might very well be the case that a much deeper cleanup in this area
is needed, this is just a fix to get gradient brush colors
consistent again...

Maniphest Tasks: T75985

Differential Revision: https://developer.blender.org/D7501
2020-04-30 09:54:09 +02:00
02c77e4e5c Fix animation player checkerboard drawing with alpha channels
Was using uninitialized theme values.
2020-04-30 17:45:02 +10:00
070bf01d37 GHOST: fix WITH_GHOST_DEBUG option
Changing the order of include changes broke GHOST_DEBUG,
however it was using defines in a fragile way.

Fix by removing 'GHOST_DEBUG' and use 'WITH_GHOST_DEBUG' which
was already defined by CMake.
2020-04-30 17:28:28 +10:00
52186a39af Cleanup: printf warning 2020-04-30 17:28:28 +10:00
e1d4c3bc36 Cleanup: clang-format 2020-04-30 17:28:28 +10:00
040e98dfc9 Cleanup: unused variable warnings 2020-04-30 17:28:28 +10:00
d8a3f3595a Task: Use TBB as Task Scheduler
This patch enables TBB as the default task scheduler. TBB stands for Threading Building Blocks and is developed by Intel. The library contains several threading patters. This patch maps blenders BLI_task_* function to their counterpart. After this patch we can add more patterns. A promising one is TBB:graph that can be used for depsgraph, draw manager and compositor.

Performance changes depends on the actual hardware. It was tested on different hardwares from laptops to workstations and we didn't detected any downgrade of the performance.
* Linux Xeon E5-2699 v4 got FPS boost from 12 to 17 using Spring's 04_010_A.anim.blend.
* AMD Ryzen Threadripper 2990WX 32-Core Animation playback goes from 9.5-10.5 FPS to 13.0-14.0 FPS on Agent 327 , 10_03_B.anim.blend.

Reviewed By: brecht, sergey

Differential Revision: https://developer.blender.org/D7475
2020-04-30 08:09:21 +02:00
a18ad3c3b6 CMake: use system include for generated headers 2020-04-30 16:01:41 +10:00
66e70fe299 GHOST: initial Wayland support
Usable with the CMake option 'WITH_GHOST_WAYLAND'

The following functionality is working:

- Building with X11 and Wayland at the same time,
  wayland is used when available.
- Keyboard, pointer handling.
- Cursor handling.
- Dedicated off-screen windows.
- Drag & drop.
- Copy & paste.
- Pointer grabbing.

See D6567 for further details.
2020-04-30 14:21:50 +10:00
00e0034b13 Merge branch 'blender-v2.83-release' 2020-04-29 21:38:18 +02:00
cd833d8879 Readfile: debug check all IDs are properly linked at the end.
Should prevent issue fixed by previous commit to happen again (since
read code, especially in undo case, is not really straight forward to
follow anymore).
2020-04-29 21:35:13 +02:00
d07dab0d61 Fix T76225: Cycles View layer filters are grayed out while still working
Mistake in rB7fc60bff14a6.

Maniphest Tasks: T76225

Differential Revision: https://developer.blender.org/D7566
2020-04-29 19:25:17 +02:00
a54c1f1e77 Fix T76155: 'Object lost data' on copy-pasting with new undo code. 2020-04-29 18:11:33 +02:00
7f5367eaae Windows: Fix RelWithDebInfo missing symbol information
issue introduced in rB55a2682348df94d0ff2f57d786b7a557312d0345
2020-04-29 09:17:34 -06:00
080732ae5c Fix crash with Orbit Around Selection
Missing check of `NULL` `op` introduced in rBc57e4418bb85.
2020-04-29 12:12:28 -03:00
b7bcd0a87c Tracking: Implement Nuke/Natron distortion model
Neither Nuke nor Natron support OpenCV's radial distortion model
which makes it impossible to have any kind of interoperability.

The new model is available under the distortion model menu in Lens
settings.

Differential Revision: https://developer.blender.org/D7484
2020-04-29 16:39:30 +02:00
0ddf5860f5 Fix Python bz2 module failing to import on older macOS versions
Found by failing bundled modules test. The bz2 library was compiled without
proper minimum SDK version flags.
2020-04-29 16:25:46 +02:00
6c4ef6159c Fix T71334: top part of render window disappears on repeated renders 2020-04-29 14:56:17 +02:00
0cfd2d6f4b VR: Reset pose offsets when changing base pose
The offsets are applied after toggling positional tracking off, so that
the view does not jump at that moment. But when changing the base pose,
keeping that offset doesn't make sense. Especially with landmarks, which
are supposed to give precise positions/rotations to jump to. For that
part the VR Scene Inspection Add-on will need a little adjustment
though.

Also exposes an explicit function to the Python API to reset the
offsets, to be used by the Add-on.

This is mostly untested since I don't have access to an HMD currently.
2020-04-29 13:53:25 +02:00
c57e4418bb Transform Orientation Refactor
- Use `t->spacemtx` as the orientation matrix instead `t->orient_matrix`.
- Unify constraint behavior between modal and non-modal.
- Simplify code to remove old workarounds and rearrange struct members.

This fix T66142 since the actual `orient_type` (in the case
`V3D_ORIENT_NORMAL`) is used during Redo instead of always using
`V3D_ORIENT_CUSTOM_MATRIX`).

Differential Revision: https://developer.blender.org/D7469
2020-04-29 08:07:25 -03:00
980cebc459 Merge branch 'blender-v2.83-release' 2020-04-29 11:44:56 +02:00
157f836493 Depsgraph: use native BLI data structures in registry
Reviewers: sergey

Differential Revision: https://developer.blender.org/D7559
2020-04-29 11:37:19 +02:00
2845b232a7 Fix T75522: Math node truncate operator tooltip provides no explanation 2020-04-29 11:36:20 +02:00
657188c1a2 Merge branch 'blender-v2.83-release' 2020-04-29 11:25:08 +02:00
08048f7cce Fix T75810: Child bone frozen when both Auto IK and X-Axis mirror are
used

Caused by {rBa6a9a12e8f32}

Other relevant commits:
rBb8ca806b7798e2f8dd6effca8f0d081b3cd8c23f
rBde530a95dc7b482dc22c933b9b8b2a98c79b5663

The issue is caused by some leftover BONE_TRANSFORM_MIRROR flags on a
bone from previous runs (file in the report had the flag still on
forearm.R).

With these false leftover flags still set, `pose_grab_with_ik()` cannot
work correctly. Culprit commit above removed the early clearing of this
flag on all bones, this should be restored [this happened in
`count_set_pose_transflags()`].

This should only be done in the beginning of the transform process, so
now still clear the flags early in 'createTransPose()' [but dont restore
this in 'count_set_pose_transflags()' -- this will be called from
special_aftertrans_update again, so placing the clearance here only
complicates things (autokeyframe_pose() still needs to work as well)...]

Maniphest Tasks: T75810

Differential Revision: https://developer.blender.org/D7527
2020-04-29 11:18:38 +02:00
fed5e0ca04 Merge branch 'blender-v2.83-release' 2020-04-29 11:10:24 +02:00
e07b245fe1 Armature posemode: add mouse independent "Select Linked" operator
The current "Select Linked" operator works based on mouse position and
makes no sense to call from the menus and was removed in rB536055e1ee0b.

This patch adds an operator independent from mouse position that just
selects all bones in relation to selected bones (and adds back menu
entries, adds keymap entry CTRL+L).

The original operator is renamed to 'select_linked_pick' internally
(this is now more in line to how "Select Linked" works for meshes,
curves etc)

ref T76071

Maniphest Tasks: T76071

Differential Revision: https://developer.blender.org/D7542
2020-04-29 11:06:41 +02:00
cedf9f5cb7 Fix/cleanup: lib_query: missing case handling of new ID_SIM type.
Also update comments.
2020-04-29 11:05:45 +02:00
9a9ecad65f Merge branch 'blender-v2.83-release'
Conflicts:
	source/blender/blenkernel/intern/lib_query.c
2020-04-29 10:57:47 +02:00
afeddd42e6 Cleanup: use LISTBASE_FOREACH iterator everywhere possible in libquery.
Done also in 2.83 release branch to avoid too much conflicts on merging
(some of those were already done for nodes in master, and gave me
conflicts yesterday...).
2020-04-29 10:53:34 +02:00
3af52c6ec3 Merge branch 'blender-v2.83-release' 2020-04-29 10:27:42 +02:00
839fe335d2 Fix crash after 475bd6b occuring on each render end, we need another nullcheck here
(cherry picked from commit 3ea67e08fe)
2020-04-29 10:26:32 +02:00
1e58255c40 Merge branch 'blender-v2.83-release' 2020-04-29 10:16:42 +02:00
Anthony Edlin
b3ac6d1348 nstall_deps: USD: Add root usd library directory to build args.
Add root usd library directory to build arguments, same as other libraries.
Also fix error/typo in compile_USD regarding _is_building.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D7563
2020-04-29 10:15:55 +02:00
770605312f Merge branch 'blender-v2.83-release' 2020-04-29 10:14:55 +02:00
601a1a3fda Fix T76185: GPencil from Curve ignores Cyclic when curve has only 2 points
Also changed default thickness to 10 because after draw engine refactor the final line was too thin.
2020-04-29 10:14:20 +02:00
21ef8c4d44 Cleanup: use const args for depsgraph functions 2020-04-29 12:36:33 +10:00
af835ee6f8 Cleanup: use doxy sections for multires & subdiv sources 2020-04-29 12:21:12 +10:00
3ea67e08fe Fix crash after 475bd6b occuring on each render end, we need another nullcheck here 2020-04-28 23:49:52 +02:00
cec9dbc997 Merge branch 'blender-v2.83-release' 2020-04-28 22:42:15 +02:00
05274ca829 Fix T75432: Cycles progressive refine render slow with denoising data
Only perform denoising prefilter for the last sample, not every sample.
2020-04-28 22:40:44 +02:00
d66aa52528 Cleanup: Use more descriptive names for functions
count_set_pose_transflags --> transform_convert_pose_transflags_update
count_bone_select --> armature_bone_transflags_update_recursive

Also don't mix `BONE_TRANSFORM_MIRROR` with `BONE_TRANSFORM` in
transflag. (This was a mess introduced in rBde530a95dc7b).
2020-04-28 17:32:05 -03:00
b443e1b7d4 UI: Improve DataTransfer Modifier Error Message
Differential Revision: https://developer.blender.org/D7546
2020-04-28 15:15:36 -05:00
4d06c1c25b BLI: add VectorSet.is_empty method 2020-04-28 19:18:12 +02:00
44ac789a3a GPencil: Remove redundant UVs text
It's clear you change the UVs
2020-04-28 18:42:26 +02:00
cdd980cd56 GPencil: Rename modifier Texture to Texture Mapping 2020-04-28 18:40:18 +02:00
d366658d2d GPencil: Remove redundant Control word from UI 2020-04-28 18:35:49 +02:00
c1e6865ee3 Cleanup: remove unnecessary includes 2020-04-28 18:08:00 +02:00
67bd6bbcdd Depsgraph: use BLI::Vector for Relations
Reviewers: sergey

Differential Revision: https://developer.blender.org/D7556
2020-04-28 17:53:09 +02:00
05283f8c96 Depsgraph: Use BLI::Map for constraint_to_pchan_map_
Reviewers: sergey

Differential Revision: https://developer.blender.org/D7553
2020-04-28 17:44:36 +02:00
7dfa1b18c1 Depsgraph: use BLI::Set for entry_tags
Reviewers: sergey

Differential Revision: https://developer.blender.org/D7555
2020-04-28 17:40:23 +02:00
7bc4a436a0 Merge branch 'blender-v2.83-release' 2020-04-28 17:18:01 +02:00
475bd6b829 Fix T76179: Unable to select render passes when a render has fewer
passes than one in another slot

If a particular pass is not available in a slot we are switching to,
still show the menu, but with a blank name for the currently selected
item so that the user can change it to a valid value.

thx @brecht for providing the standard way Blender deals with these
kinds of situations.

Maniphest Tasks: T76179

Differential Revision: https://developer.blender.org/D7552
2020-04-28 17:06:53 +02:00
a72eed7dd5 BLI: rename Vector.empty to Vector.is_empty 2020-04-28 17:04:07 +02:00
c05ef1459c BLI: add Set.clear method 2020-04-28 16:41:37 +02:00
d575b72c16 BLI: add Set.is_empty method 2020-04-28 16:35:49 +02:00
69e8de434f Depsgraph: use BLI::Map in RootPChanMap
Reviewers: sergey, sybren

Differential Revision: https://developer.blender.org/D7521
2020-04-28 15:56:53 +02:00
6278b48ea1 Merge branch 'blender-v2.83-release'
Conflicts:
	source/blender/blenkernel/intern/lib_query.c
	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
2020-04-28 15:40:12 +02:00
37e08e526c Depsgraph: Add IDProperties handling.
Fix T75279: BLI_assert failed when deleting object in debug build
(only).

And all general cases of ID pointer idproperties that would use a
data-block not referenced anywhere else in the depsgraph.

This includes idproperties from:
* All ID types;
* Bones and pose bones;
* Sequences;
* Nodes and sockets.

Differential Revision: https://developer.blender.org/D7551
2020-04-28 15:31:08 +02:00
9f090bac5c IDProperties: add a foreach looper and use it in libquery code.
Note: part of fix for T75279.

Differential Revision: https://developer.blender.org/D7550
2020-04-28 15:25:19 +02:00
1c7317a6da BLI: add library to simplify writing dot graph exporters
See D6799 for some examples on how to use the library.

Reviewers: sergey

Differential Revision: https://developer.blender.org/D6799
2020-04-28 14:05:24 +02:00
9c65ac7311 BLI: add Map.lookup_or_add_default method 2020-04-28 13:55:36 +02:00
7d85b6431f Fix T76044: update Cycles to build with OSL 1.11 master 2020-04-28 13:50:31 +02:00
2c60221080 Cleanup: Missing include directories after recent cleanup 2020-04-28 13:33:18 +02:00
20100009f6 Fix armature roll test failing on macOS 2020-04-28 13:31:59 +02:00
7d1bb2edfd Cleanup: Strict compiler warning in release mode 2020-04-28 13:31:01 +02:00
8da80e7771 Merge branch 'blender-v2.83-release' 2020-04-28 13:02:06 +02:00
2db4a5bb9f Cleanup: remove unused string module
This is legacy code that can simply be replaced by std::string.
2020-04-28 12:57:39 +02:00
2580fa1602 Cleanup: remove STR_String usage from GHOST 2020-04-28 12:57:39 +02:00
6cab53eaaa Tests: fix some tests passing even if there are Python errors
Blender was not configured to exit with non-zero return code on Python errors.
A bunch of tests worked around this but not all. This removes the need for such
workarounds.
2020-04-28 12:50:16 +02:00
b21a3e7702 Depsgraph: Use BLI::Map in more places
Reviewers: sergey

Differential Revision: https://developer.blender.org/D7519
2020-04-28 12:49:52 +02:00
a7bd835644 Fix Python bundled module test error
We don't bundle cffi, rather the ffi library is used for ctypes. This test is
currently passing even when there are errors, that will be fixed next.
2020-04-28 12:48:29 +02:00
Himanshi Kalra
b9f422c4be Tests: add physics tests cloth and softybody
This uses the same framework as automated modifier tests. It adds a physics
modifier, bakes and compares vertex coordinates on the end frame.

Differential Revision: https://developer.blender.org/D7017
2020-04-28 12:29:46 +02:00
18e9626e41 Strengthen modifiers test validation, from D7397.
Submitting on behalf of Jesse Y (deadpin).
In test harness for modifier testing, now run mesh validation
on output mesh. Also, fix printing so it interleaves properly.
2020-04-28 12:27:33 +02:00
4adc68bdf8 Fix T75973: don't show raw Python errors to users for invalid shortcut paths
There are cases when a user can accidentally assign an operator to toggle an
invalid property to e.g. left click, which shows Python errors to the users.
Rather than throw an error and e.g. break 3D viewport selection for the user,
just print an error to the console.

The root cause of such bugs should be fixed as well, but a working Blender
is most important here.
2020-04-28 12:27:33 +02:00
9c2715ffda BLI: add Map.is_empty() method 2020-04-28 11:44:10 +02:00
7acc8a5a92 Depsgraph: Use BLI::Map for RNANodeQuery.id_data_map_
Reviewers: sergey

Differential Revision: https://developer.blender.org/D7512
2020-04-28 11:39:49 +02:00
0372121e17 UI: Title case for 'Prefetch Frames' in VSE 2020-04-28 11:27:05 +02:00
7b0676f102 remove prints 2020-04-28 11:18:48 +02:00
11ffa05354 remove unnecessary branch 2020-04-28 11:17:54 +02:00
c413a150bc Merge branch 'master' into simulation-access-modifier 2020-04-28 11:11:54 +02:00
a66162e1f6 Cleanup: trailing whitespace 2020-04-28 11:11:35 +02:00
8ec2fde411 Merge branch 'master' into simulation-access-modifier 2020-04-28 11:05:39 +02:00
3afa2e94ba Merge branch 'blender-v2.83-release' 2020-04-28 18:38:15 +10:00
90f01d5048 Fix select linked in pose mode
Only one of child bones would be selected when the bone under the
cursor had multiple children.
2020-04-28 18:35:52 +10:00
c7144d780d Merge branch 'blender-v2.83-release' 2020-04-28 16:17:12 +10:00
64e242244d Fix T75993: Mark Seam from UV editor operates on unselected faces 2020-04-28 16:14:09 +10:00
4f639b893b Merge branch 'blender-v2.83-release' 2020-04-28 15:48:44 +10:00
612757b524 Fix T76098: Dragging text selection with offset resets select start 2020-04-28 15:47:09 +10:00
a8d684d87f Merge branch 'blender-v2.83-release' 2020-04-28 13:49:25 +10:00
ef1187387b Fix T76152: Shortcut underline under wrong letter
Use glyph bounds to calculate a better underline position.
2020-04-28 13:48:15 +10:00
e78470d954 BLF: add utility function to loop over glyph bounds 2020-04-28 13:34:56 +10:00
33017e9529 Cleanup: unused variable 2020-04-28 13:05:18 +10:00
fd0cb58122 Merge branch 'blender-v2.83-release' 2020-04-27 21:15:11 +02:00
133bf05b18 Fix T75736 Viewport update problem when switching between view layers
The problem comes from the fact by no data being modified when switching
viewlayers.

To follow what the external render engines do, we completely reset the
viewport by freeing the GPUViewport to avoid any cached data from being
kept.
2020-04-27 21:14:10 +02:00
84e40ee846 Fix T75910 Overlay: Face Orientation not working for "In Front" objects 2020-04-27 21:14:10 +02:00
6830307b94 Merge remote-tracking branch 'origin/blender-v2.83-release' 2020-04-27 13:05:22 -06:00
ad01bab6c3 cleanup: Remove unused variable 2020-04-27 13:04:44 -06:00
15081cf6df Merge remote-tracking branch 'origin/blender-v2.83-release' 2020-04-27 13:01:24 -06:00
7951ec2641 Cleanup: Fix warning about initialization order with MSVC 2020-04-27 13:00:53 -06:00
ea75701529 Merge branch 'blender-v2.83-release' 2020-04-27 20:06:10 +02:00
a1b1f2acd4 Workbench: Fix weight paint overlay and wireframe for infront object
This fix case where you have wireframe on top of infront objects but
workbench AA conflicts and they appear to not be occluded.

Also T74923 is still fixed but we extend the fix to not mess the case when
using a mode that does not support infront.
2020-04-27 20:05:42 +02:00
94c514cf34 Merge branch 'blender-v2.83-release' 2020-04-27 18:32:32 +02:00
yves
af876b12f1 Fix T75519: Graph editor tooltips give false impression of the toggle state
It is just a quick fix for the tooltips in the graph editor, it replaces:
-  "F-curve modifiers are disabled" with "Enable F-Curve modifiers"
-  "F-curve is visible in graph editor for editing" with "F-Curve visibility in Graph Editor".

Reviewed By: billreynish

Maniphest Tasks: T75519

Differential Revision: https://developer.blender.org/D7387
2020-04-27 18:27:48 +02:00
5f3990d69a Merge branch 'blender-v2.83-release' 2020-04-27 18:15:47 +02:00
fbae4c5ba3 Fix T74700: "Convert Text to Curve" disregards "Text on Curve"
There was an assert here as well since using the original object to read
from was having an empty runtime curve cache.

Now use BKE_vfont_to_curve_ex instead of BKE_vfont_to_curve, so we can
read from the evaluated object and write to the original curves in order
to have the modified data taken into account on next object evaluation.
(BKE_vfont_to_curve would read and write to/from the same object)

Final solution provided by @sergey in that report, thx!
2020-04-27 18:04:19 +02:00
0a7dd1ec49 Merge branch 'blender-v2.83-release' 2020-04-27 12:09:17 -03:00
a4df7f78a8 Fix T75398: Redo with Shift R always uses the previous pivot center
Overwriting the pivot center was an attempt to fix T71455.
The solution now is to save the direction in the "mirror" property.
2020-04-27 12:07:29 -03:00
61f0941321 Cleanup: Use common utility to get direction for TIME_EXTEND 2020-04-27 12:07:29 -03:00
b0f207db15 UI: (Internal) utility for more controllable property split layout
Adds a wrapper-struct to create and return the three layouts required
for the propery split layout (i.e. `UILayout.use_property_split`). This
gives more flexibility for special treatment.
E.g. needed for adding the arrow icon buttons when there is a hierarchy
of nodes to be represented in the material properties (needs inserting
in the text column to not offset the split layout).

This commit also makes use of the utility for
`uiItemL_respect_property_split()`.
2020-04-27 17:01:40 +02:00
5559edf3c7 Merge branch 'blender-v2.83-release' 2020-04-27 16:57:58 +02:00
995611640e Cleanup: clang format
missed in rB4fd005fefb01.
2020-04-27 16:55:59 +02:00
4119e9c60b Merge branch 'blender-v2.83-release' 2020-04-27 16:46:17 +02:00
4fd005fefb Fix T76131: Crash combing Hair using Python
Caused by rBe82827bf6ed5.

DRW_draw_depth_object calls DRW_mesh_batch_cache_create_requested with
NULL scene, but that is accessed later on...

Scene is actually available, so pass that around.

Maniphest Tasks: T76131

Differential Revision: https://developer.blender.org/D7540
2020-04-27 16:40:45 +02:00
6842958c9b UI: Add (internal) option to use property splitting for label-less items
Usually items without labels don't use the property split layout and
just use the full layout width. In some cases that is not wanted because
it looks odd if single items within the split layout use the full width.
The option is unused but would be needed for adding decorators to the
material properties.
2020-04-27 16:38:27 +02:00
b6592c83b5 Merge branch 'blender-v2.83-release' 2020-04-27 16:26:59 +02:00
8f289196cf Fix T76111: UV editor's View Selected not working in multiobject editing
Seems like this was left out when UV operators were converted to multi-
object-editing, ref T54645.

Maniphest Tasks: T76111, T54645

Differential Revision: https://developer.blender.org/D7537
2020-04-27 16:18:09 +02:00
7c782b8f27 Merge branch 'blender-v2.83-release' 2020-04-27 16:13:44 +02:00
536055e1ee remove "Select Linked" from the posemode select menu
The operator in its current state is based on mouse position and doesnt
make sense to be called from a menu.
(In fact it should be called 'select_linked_pick' internally and a
separate 'select_linked' should be implemented similar to how "Select
Linked" works for meshes, curves etc -- see D7542 for this)

Note: We had the same thing for particles recently:
rBdd9dfadaac9b: remove "Select Linked" from the particle select and
context menu
rB5ca7c85e105d: Particle editmode: add mouse independent "Select Linked"
operator

Fixes T76071

Maniphest Tasks: T76071

Differential Revision: https://developer.blender.org/D7543
2020-04-27 16:10:31 +02:00
3d7ac7feba Merge branch 'blender-v2.83-release' 2020-04-27 23:24:49 +10:00
b1037aa88f Fix T76148: Grid fill crashes with multiple connected loops 2020-04-27 23:22:58 +10:00
3c858246cd UI: Support array properties for UILayout.prop_decorator()
Previously `UILayout.prop_decorator()` (or `uiItemDecoratorR()` in C)
only worked for single items, not for arrays. The decorators are added
vertically, like `UILayout.prop()` adds them.
This will be needed for adding decorators to material properties, but
will likely have other use-cases as well.

Also, `None` (or `NULL`) can be passed for the data-pointer and property
now to create blank decorators (as already possible for
`uiItemDecoratorR_prop` in C).
2020-04-27 14:57:29 +02:00
9973f752b4 quiet warning 2020-04-27 13:35:15 +02:00
1cb2f3a1c1 add BKE_simulation_data_update function 2020-04-27 13:34:48 +02:00
2341ed9d72 Merge branch 'master' into simulation-access-modifier 2020-04-27 13:23:04 +02:00
f346fd3212 Merge branch 'blender-v2.83-release' 2020-04-27 10:49:56 +02:00
7300e8a9fe GPencil: Change defaults for Gradient materials
The old values did not display a valid gradient by default.
2020-04-27 10:49:33 +02:00
fc1ea38c63 Merge branch 'blender-v2.83-release' 2020-04-27 16:50:24 +10:00
Robert Guetzkow
bb1e794d58 Fix T72476: Crash when drag & drop Color in the Image Editor 2020-04-27 16:44:47 +10:00
Christian Rauch
0da05720de GPU: add assert for immBegin buffer size & context 2020-04-27 15:27:53 +10:00
Christian Rauch
54eb701978 Cleanup: add newline to ghost warning print 2020-04-27 15:27:18 +10:00
490c32c425 CMake: add WITH_LINKER_LLD option for unix platforms
Can give considerably faster linking, especially for debug builds.

This may be enabled by default but needs to be more thoroughly tested.
2020-04-27 14:14:00 +10:00
13abd3784a Merge branch 'blender-v2.83-release' 2020-04-27 00:57:17 +02:00
d0d16eb7d3 Fix T74346 VSE: Prefetching doesn't work properly with property animations
Make sure depsgraph was updated before evaluating the animation.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D7467
2020-04-27 00:51:44 +02:00
Peter Fog
8a94903c09 VSE: Remove decorate from Expand and Mute in Modifiers
Remove decorate from Expand and Mute in VSE Modifiers,
since these elements aren't using decorate elsewhere.

Reviewed By: billreynish

Differential Revision: https://developer.blender.org/D7420
2020-04-27 00:14:04 +02:00
0edf3f5680 Merge branch 'blender-v2.83-release' 2020-04-27 00:06:00 +02:00
c13ad410a6 Fix T74603: Tweaking offsets causes strips to "reverse"
Add range function to RNA properties.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7285
2020-04-27 00:04:23 +02:00
576ecbd694 Merge branch 'blender-v2.83-release' 2020-04-26 23:44:12 +02:00
dea1c1b9eb Fix T75495: Blender crashes opening a VSE .blend file
During scene copy modifier mask strips are relinked to point to strips in
new scene. If strip used as mask is in different seqbase, this can fail,
if seqbase is not copied yet.

Add SEQ_DUPE_IS_RECURSIVE_CALL flag to avoid relinking modifiers during recursive call.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7412
2020-04-26 23:40:18 +02:00
a2de3d86de Fix utterly wrong decorator button logic
This was in fact completely messed up, but it worked by accident for all
current cases. That is, we always inserted the decorator buttons
immediately after the button they applied to. So the first button
comparision in ui_but_anim_decorate_find_attached_button() would
succeed, because it just compared a few values that all happened to be
NULL and thus the comparison returned true.

Further, avoid NULL-pointer dereferences and incorrect printing.
2020-04-26 17:39:12 +02:00
066b0248df Merge branch 'blender-v2.83-release' 2020-04-26 12:26:26 +02:00
05b94c9c54 GPU: Add better support for texture copy fallback
Depth texture copy using glCopyTexSubImage2D is undefined behavior since
you cannot bind GL_DEPTH_ATTACHMENT to glReadBuffer.

Using glBlitFramebuffer as a fallback.
2020-04-26 12:25:52 +02:00
8d8414cd21 Merge branch 'blender-v2.83-release' 2020-04-25 19:42:52 +02:00
f418eddf8e GPencil: Fix unreported small offset when use Stroke mode
When using the Stroke mode, the reprojection function add a small offset of 0.5 to +X and +Y. Now this effect is removed subtracting this value before doing the conversion.
2020-04-25 19:40:12 +02:00
e54a206e15 GPencil: Fix unreported jagged lines when using Stroke mode
When use the Stroke reproject mode, the precission of the conversion makes the line produce a very small noise effect.

Now, if the stroke mode is enabled, a small smooth is done using a factor depending of the input samples.

The values of the smooth effect were provided by @pepeland after several testing.
2020-04-25 19:37:06 +02:00
78887318e2 Merge branch 'blender-v2.83-release' 2020-04-25 10:41:44 +02:00
53106934f9 Fix T76078: GPencil: frames interpolation erase strokes
In some situations the stroke could be tagged and this tag was used to delete the interpolated strokes.

Now, the frames used as interpolated range are untagged before creating the interpolated strokes.
2020-04-25 10:40:09 +02:00
2b95f2439e Merge branch 'blender-v2.83-release' 2020-04-24 20:53:34 -06:00
4ab85a3380 Cleanup: Select sync from outliner
Move the condition to check if selection syncing is enabled to inside
the syncing function rather than before each time it is called.
2020-04-24 20:22:46 -06:00
5d14463e1a Fix: Selection syncing for outliner operators
A few outliner operators that modify selection were not tagging for a
selection sync which led to selection inconsistencies. This adds syncing
for the following operators:
* Duplicating and deleting collections
* Selecting/deselecting collection contents
* Drag and drop
* Object select, deselect, delete, and delete hierarchy
2020-04-24 20:18:39 -06:00
c5f4d5e448 BLI: add LinearAllocator
This allocator is useful when it is necessary to allocate many small elements.
2020-04-24 23:52:55 +02:00
1f2b1d520f BLI: improve StringRef.copy 2020-04-24 23:35:17 +02:00
ebe0d7ca5e BLI: add DefaultHash specializations for StringRef and StringRefNull 2020-04-24 23:14:33 +02:00
62f6255b47 BLI: Implement StringMap.add and StringMap.add_or_modify 2020-04-24 22:33:48 +02:00
fd10ac9aca UI: Move Scene Statistics to the 3D Viewport
Removes statistics from footer and to an (optional) overlay in 3DView.

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

Reviewed by Campbell Barton
2020-04-24 11:05:40 -07:00
a8441fc900 Fix T69753 Instanced Metaballs not rendering but showing up in Viewport
This hides the original metaballs when they are used in
duplifaces/-verts instancing, and still shows the instanced metaballs.

The visibility of the original metaballs is now determined by the
visibility of the instancer. I'm not too thrilled about this, but at
least it gives users the ability to show/hide the metaballs for
viewport/render.

Differential Revision: https://developer.blender.org/D7478
2020-04-24 17:23:44 +02:00
be5c9d45bd Tests: use explicit Python to run unit tests
CentOS on the buildbot still runs Python 3.6, which is also used for the
unit tests. This means that the tests can't use language features that
are available to Blender itself. And testing with a different version of
Python than will be used by the actual code seems like a bad idea to me.

This commit adds `TEST_PYTHON_EXECUTABLE` as advanced CMake option. This
will allow us to set a specific Python executable when we need it. When
not set, a platform-specific default will be used:

- On Windows, the `python….exe` from the installation directory. This is
  just like before this patch, except that this patch adds the
  overridability.
- On macOS/Linux, the `${PYTHON_EXECUTABLE}` as found by CMake.

Every platform should now have a value (configured by the user or
detected by CMake) for `TEST_PYTHON_EXE`, so there is no need to allow
running without. This also removes the need to have some Python files
marked as executable.

If `TEST_PYTHON_EXE` is not user-configured, and thus the above default
is used, a status message is logged by CMake. I've seen this a lot in
other projects, and I like that it shows which values are auto-detected.
However, it's not common in Blender, so if we want we can either remove
it now, or remove it after the buildbot has been set up correctly.

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

Reviewed by: campbellbarton, mont29, sergey
2020-04-24 17:10:22 +02:00
be00902082 Defaults: Change default axes for Track To constraint
The main use-case for the Track To constraint is camera tracking, so
this sets up a better default for this. That is, track to -Z with Y up.

Agreed on internally with Pablo Vazquez and William Reynish. Should
there be a reason to revert this, that would be fine compatibility-wise.
2020-04-24 16:17:47 +02:00
246d59ff0f Defaults: Reduce near-clipping in factory settings
For newly opened 3D Views, the default would actually be 0.01m. But the
code to update the default for all existing 3D Views in the
startup.blend was missing. So the defaults were out-of-sync.

0.01m is the more reasonable default as agreed on by the UI team.
2020-04-24 16:17:47 +02:00
47ae0affc8 Depsgraph: Use BLI::Map instead of GHash for operations_map
Reviewers: sergey

Differential Revision: https://developer.blender.org/D7509
2020-04-24 11:34:04 +02:00
69b6c89842 Depsgraph: Use BLI::Set instead of std::unordered_set
Reviewers: sergey

Differential Revision: https://developer.blender.org/D7506
2020-04-24 10:48:25 +02:00
ed32afd962 Merge branch 'blender-v2.83-release' 2020-04-24 10:40:42 +02:00
4542b50afc T75631: New multires shrinkage problem
The old Subdivide button was behaving as if subdivision modifier was
applied on top of the multires. This was the source of shrinkage since
the behavior of the limit surface: limit surface of a sparse point
from another limit surface makes final result appear smaller.

The new behavior is based on propagating delta against base mesh's
limit surface to the top level. Effectively, this is as if we've
sculpted on old top level and then propagated to the new top level.

Differential Revision: https://developer.blender.org/D7505
2020-04-24 10:29:26 +02:00
0de591ac39 Merge branch 'blender-v2.83-release' 2020-04-24 18:14:18 +10:00
1625b7c37c Fix T75749: UI button text selecting is broken by text offset 2020-04-24 18:13:43 +10:00
c2bf0c1d54 Merge branch 'blender-v2.83-release' 2020-04-24 17:41:34 +10:00
e8d3996e67 Fix edit-mesh selection mode switching causing two undo pushes 2020-04-24 17:39:11 +10:00
b0b6fb8a93 Fix edit-mesh moving from edge to face mode with Ctrl held
Faces could be selected without any of their edges or vertices selected.
2020-04-24 17:28:46 +10:00
a8e89db291 Merge branch 'blender-v2.83-release' 2020-04-24 17:07:23 +10:00
9b56b2b2b9 UI: add mesh skin-resize to menu
Resolves T75925
2020-04-24 17:06:55 +10:00
d4ffd1d91f Cleanup: declare values for enum types
Avoids accidents when adding/removing items from an enum.
2020-04-24 15:52:01 +10:00
c1e4b369b0 Merge branch 'blender-v2.83-release' 2020-04-24 13:28:11 +10:00
001629a362 Fix T75946: Intersect (knife) doesn't cut all intersections 2020-04-24 13:26:17 +10:00
d2aa4ada50 Merge branch 'blender-v2.83-release' 2020-04-24 12:27:12 +10:00
d428cca124 Fix T63787: Knife intersect crashes 2020-04-24 12:18:29 +10:00
9667f89e82 Cleanup: correct printf warnings for bmesh interesect debugging 2020-04-24 11:47:41 +10:00
af0a042da7 Cleanup: remove unused arg, clang-format 2020-04-24 11:43:30 +10:00
826f6dd9ee Merge branch 'blender-v2.83-release' 2020-04-23 23:08:20 +02:00
d712f1f83a GPU: Add Polyline shader (wide line emulation)
This new shader is able to emulate smooth wide lines drawing using a
geometry shader.

This shader needs viewportSize and lineWidth uniforms to be set.

There is multiple variants to replace the usage of wide lines for most
shaders.

This patch only fix the gizmo_types files and the navigation gizmo.
Other areas could be fixed afterward, I just limited the patch size.

Fix T57570.

Reviewed By: billreynish

Differential Revision: https://developer.blender.org/D7487
2020-04-23 23:07:48 +02:00
d0ff3434cf Fix T73741 Grid Floor render on top of Wireframe objects
Go for a bias towards background to avoid loosing wireframe objects.
2020-04-23 22:21:22 +02:00
54e1b63567 Fix T74173 Assert when scaling camera in viewport to zero 2020-04-23 21:50:32 +02:00
ed4f33a7bd Cleanup: silence unused parameter warning 2020-04-23 20:49:42 +02:00
8f5a4a4da3 BLI: various data structure improvements
* Rename template parameter N to InlineBufferCapacity
* Expose InlineBufferCapacity parameter for Set and Map
* Add some comments
* Fixed an error that I introduced recently
2020-04-23 20:05:53 +02:00
7d98dfd6bb Merge branch 'blender-v2.83-release' 2020-04-23 18:26:22 +02:00
0fbcb824d0 Fix T76014: correct description of COLLECTION_OT_objects_remove_all
before rB17bd5c9d4b1e it was "Remove selected objects from all groups"

- `BKE_object_groups_clear` is not checking if a collection is linked
to the current scene...
- rB713010bd7795 did not change that either

So this indeed removes selection from _all_ collections, so account for
that in the operator description/idname.

Reviewers: brecht

https://developer.blender.org/D7500
2020-04-23 18:20:26 +02:00
c03b6f6f0b Fix T73195: stereo camera view does not show background image 2020-04-23 18:01:33 +02:00
40f2c92460 Fix T72506 EEVEE: Collection Holdout propagates accross material instances
This fix the issue by introducing a default material only for collection
holdouts. This avoids hash colision when the same material is used in
collections without holdout enabled.
2020-04-23 17:41:21 +02:00
2467f4df79 Fix T75607: crash trying to sculpt while remesh is in progress
The interface is already locked, but the paint brush drawing could stll be
reading the mesh that was being edited in another thread.
2020-04-23 17:10:23 +02:00
53de2c3e4f Cleanup: Add assert to crash earlier
This makes T75096 crash earlier.
2020-04-23 15:47:38 +02:00
5e04548500 Merge branch 'blender-v2.83-release' 2020-04-23 15:45:46 +02:00
869472b3f0 Fix T75611: slow transform of many objects at the same time
Solve O(n^2) time complexity problem where a dependency graph iterator loops
over all nodes to clear flags, which happened for every object at the start
of transform.

Differential Revision: https://developer.blender.org/D7503
2020-04-23 15:41:57 +02:00
3b47f335c6 BLI: remove TaskParallelRangePool
This is not currently used and will take some work to support with TBB, so
remove it until we have a new implementation based on TBB.

Fixes T76005, parallel range pool tests failing.

Ref D7475
2020-04-23 15:39:34 +02:00
1fce2ea743 Merge branch 'blender-v2.83-release' 2020-04-23 15:15:04 +02:00
694c0547c2 Fix T73680: Scene and fluid modifier gravity are scaled differently
Reviewers: sebbas

Differential Revision: https://developer.blender.org/D7483
2020-04-23 15:10:20 +02:00
6524aaf685 Fix T76008: Fluid inflow with negative initial velocity is not working
This is a regression introduced in rBa0fe22095e6d9b8b194c2cf6f9a7c7b419d7e61c.

I changed it so that the velocity with the highest magnitude is considered and
not the highest value per coordinate.

Reviewers: sebbas

Differential Revision: https://developer.blender.org/D7502
2020-04-23 15:00:48 +02:00
5afba30c69 Fix T75987: crash entering edit mode with keyed particles 2020-04-23 14:51:41 +02:00
1c84cd8198 Merge branch 'blender-v2.83-release' 2020-04-23 14:49:38 +02:00
a0652430d0 Array modifier: limit maximum amount of generated geometry.
Fixes T75278: Crash when modifier "Array-Fit Curve-Relative Offset"
nears zero.
2020-04-23 14:48:48 +02:00
35ecfefaec Made pose push/relax to breakdown behave smooth on rotations
A follow up to T67212. I missed that the rotation interpolation had its
own code path.

The previous rotation push code was actually wrong (but smooth).

Now all of the actions behave correctly and is smoothly interpolated.
2020-04-23 14:15:31 +02:00
8f51f60948 Fix T76005: BLI_task test failing after recent changes
This was an error in changes made to this test to accomodate the new reduce
callback.
2020-04-23 14:04:29 +02:00
3a0af215b9 Fix headless build failure on macOS 2020-04-23 13:19:54 +02:00
614621747e BLI: optimize VectorSet implementation
Instead of building on top of `BLI::Vector`, just use a raw array
and handle the growing in `BLI::VectorSet`.

After this change, the existing `EdgeSet` can be reimplemented using
`BLI::VectorSet` without performance regressions.
2020-04-23 12:02:06 +02:00
68cfce1519 Merge branch 'blender-v2.83-release' 2020-04-23 18:38:41 +10:00
8dedbb1747 Fix T75836: Light target misses updates while dragging 2020-04-23 18:25:29 +10:00
6c0ddf1110 Merge branch 'blender-v2.83-release' 2020-04-23 16:15:55 +10:00
b900a5e452 Fix T74172: Mirror with bisect results in holes
Enable snap-to-center when bisecting.
2020-04-23 16:14:07 +10:00
6489f5a8ec Merge branch 'blender-v2.83-release' 2020-04-23 15:09:54 +10:00
83d9ba341e Fix T75965: Scale to Fit Text Box fails with a single word 2020-04-23 15:03:47 +10:00
b785feb3d7 Merge branch 'blender-v2.83-release' 2020-04-23 12:12:34 +10:00
e812512e1d Cleanup: clang-format, unused warning 2020-04-23 12:10:41 +10:00
5491c045af Cleanup: add explicit enum values in DNA_rigidbody_types.h 2020-04-23 12:06:35 +10:00
101ec2f3b8 Merge branch 'blender-v2.83-release' 2020-04-23 12:02:25 +10:00
c3accabef9 Fix invalid rigid body constraint values during 2.83 development
Own error in cleanup from 5dcb6fb22f unintentionally
changed enum values. Although this code violated our own
rules to use explicit values to avoid this happening.
2020-04-23 11:46:52 +10:00
c632396733 Fix T75991: crash when rigidbody encounters unknown constraint type
This just adds a check to prevent the crash,
Versioning invalid types still needed.
2020-04-23 11:31:47 +10:00
f6f4ab3ebf Merge branch 'blender-v2.83-release' 2020-04-22 21:42:09 +02:00
a68bd94d11 Workbench: Use GPU_texture_copy instead of GPU_framebuffer_blit for TAA
This fixes T75477 which seems to be a driver but caused by framebuffer
blitting.
2020-04-22 21:41:10 +02:00
f7753bf97f GPU: Add GPU_texture_copy
This allow to copy entire texture in a faster way than using framebuffer
blitting.

This uses ARB_copy_image extension if available and fallback to
glCopyTexSubImage2D for older gl version.

Both method should be as fast if not faster than the framebuffer blitting.
2020-04-22 21:41:10 +02:00
6f8d5eaa28 Merge branch 'blender-v2.83-release' 2020-04-22 21:04:58 +02:00
d17b371a83 UI: Always check if IME Supported After Changing Language
Changing from IME-enabled language to English did not turn off IME.

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

Reviewed by Campbell Barton
2020-04-22 21:03:13 +02:00
c3d8fa1301 UI: Always check if IME Supported After Changing Language
Changing from IME-enabled language to English did not turn off IME.

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

Reviewed by Campbell Barton
2020-04-22 11:28:15 -07:00
821316b034 Reset submodule to the right place in master
Accidently changed on rB0dfe30502a02.
2020-04-22 20:20:48 +02:00
22cf2572d9 Merge branch 'blender-v2.83-release' 2020-04-22 19:20:11 +02:00
0dfe30502a Fix T75938: Workbench normal direction for matcaps
Set useMatcap to ensure correct normal direction when using matcaps
in the workbench engine.
2020-04-22 19:13:38 +02:00
f9649e2bf1 Fix T75994: Crash with 'Split Edges and Faces' | Auto-Merge
It occurred when an edge was collapsed into a vert that was not part of it.
This is common when the distance for merging is relatively large.
2020-04-22 12:53:19 -03:00
f5b540593c Fix T75994: Crash with 'Split Edges and Faces' | Auto-Merge
It occurred when an edge was collapsed into a vert that was not part of it.
This is common when the distance for merging is relatively large.
2020-04-22 12:48:16 -03:00
de168b4115 Merge branch 'blender-v2.83-release' 2020-04-22 17:13:21 +02:00
878cd0e124 Silence annoying error message in writefile on undo step storage.
Fix T75318: Error spam in console when opening file from 2.7x.
2020-04-22 17:12:49 +02:00
cdc399a055 Merge branch 'blender-v2.83-release' 2020-04-22 17:05:04 +02:00
45f8d1783b Cleanup: Fix strict compiler warning 2020-04-22 16:56:43 +02:00
cf5147f69f Fix T74423: Cycles rendering artifacts with CUDA 10.2
Work around what appears to be a compiler bug, just changing the code a bit
without any functional changes.
2020-04-22 16:40:52 +02:00
138b0c970e GPencil: Change Thickness Profile icon 2020-04-22 16:40:26 +02:00
0fe3e38b57 Cleanup: Spelling in function name
Should be no functional changes.
2020-04-22 16:32:45 +02:00
20f935ab5c separate node type 2020-04-22 16:25:40 +02:00
07ed64aae6 Fluid: Use maximum for initial velocity grid application
Using MAX2 when writing intial velocities into the grid prevents overriding initial velocities when using multiple flow objects that are close to each other.
2020-04-22 16:19:19 +02:00
f148bd3795 Fluid: Fixes for cache 'Replay' mode
General fixes and improvements for the cache. Previous commits on fluids broke the 'Replay' cache a bit.
2020-04-22 16:19:19 +02:00
6485d8b78a Fluid: Fix for caches being released when file is loaded 2020-04-22 16:18:13 +02:00
fdea3dd7e7 Fluid: Fix for inconsistent behavior with flow and effector objects
Fixes issue with flow and effector objects which were not being used after resuming a bake job.
This issue has been reported in T75729 and T75758.
2020-04-22 16:18:13 +02:00
d19277c72f Fluid: Added missing outflow object type to enable / disable flow flag
There is no reason to not include outflow objects here too.
2020-04-22 16:18:13 +02:00
650f9cfe93 Fluid: Improved cache 'Replay' option
When using the 'Replay' cache mode the cache needs to be invalidated whenever simulation variables have been changed.
The invalidation will always only affect the according subcaches, e.g. when changing a mesh paramter only the mesh cache will be invalidated, the base cache will remain intact.
Before this change Blender always invalidated the entire cache.
2020-04-22 16:16:23 +02:00
abdd4117b1 Fluid: Cleanup in MANTA main class
More concise return types for cache import functions and general cleanup.
2020-04-22 16:16:23 +02:00
40e9dc638b Fluid: Remove noise bake call from Python
Saving noise cache files is handled in fluid.c.
2020-04-22 16:16:23 +02:00
06e3df4ce4 Fix T75681: Mantaflow crash when trying to bake a cupcake: The CG solver diverged, residual norm > 1e30
Ensures that there are no enclosed holes between an obstacle and the domain walls.
2020-04-22 16:16:23 +02:00
5cae44ef6d Fluid: Minor UI fix for diffusion panel
Was missing active option.
2020-04-22 16:16:23 +02:00
6b47b22a33 proper operation type 2020-04-22 16:04:30 +02:00
912ac457a6 Merge branch 'blender-v2.83-release' 2020-04-22 16:01:17 +02:00
9000ec3013 Cleanup: clarify and update some flags descriptions in libquery code. 2020-04-22 15:58:55 +02:00
6a1056c6a8 Merge branch 'blender-v2.83-release' 2020-04-22 15:54:04 +02:00
28f7c80c46 Fix invalid RNA path for transform orientations.
Fix T75861: Impossible to set Shortcut (hotkey) on Transform Orientation
or Pivot Point.
2020-04-22 15:53:33 +02:00
0ba4bf7ec5 initial simulation access modifier 2020-04-22 15:52:15 +02:00
6c9bebd827 Tests: Fix build error in BKE_armature test
Test does not link due to missing symbols, needs
buildinfoobj to link against when WITH_BUILDINFO is on
2020-04-22 07:47:32 -06:00
a0fe22095e Fluid: Use maximum for initial velocity grid application
Using MAX2 when writing intial velocities into the grid prevents overriding initial velocities when using multiple flow objects that are close to each other.
2020-04-22 15:30:06 +02:00
8d5ae15040 Fluid: Fixes for cache 'Replay' mode
General fixes and improvements for the cache. Previous commits on fluids broke the 'Replay' cache a bit.
2020-04-22 15:26:51 +02:00
a47a975a55 Merge branch 'blender-v2.83-release' 2020-04-22 14:38:59 +02:00
6c9a882340 Fix T75964: changing object's viewport display color does not update
cycles

Caused by rB00466e756e33.

While that commit sounds logical, Cycles uses is_updated_transform() to
detect updates.

Now introduce is_updated_shading() and use that on top.

Maniphest Tasks: T75964

Differential Revision: https://developer.blender.org/D7493
2020-04-22 14:31:32 +02:00
e5052e8bde Merge branch 'blender-v2.83-release' 2020-04-22 14:28:10 +02:00
9aeb475e99 Subdiv: Fix wrong non-manifold subdivision in certain cases
Was happening when only partial subset of callbacks was specified.

The reason was that there was a callback to specify edges sharpness
but no callback to specify vertex sharpness, so the special case for
non-manifold edges was not run.

Fixes T75697: Multires in simple mode doesn't work correct on a plane
2020-04-22 14:26:12 +02:00
c69a047b90 Merge branch 'blender-v2.83-release' 2020-04-22 14:23:00 +02:00
Brecht Van Lommel
aa09a46fd7 Objects: add infrastructure for hair, pointcloud, volume modifiers
There is no user visible difference in standard builds, as there are no
volume modifiers yet. When using WITH_NEW_OBJECT_TYPES some deform only
modifiers are now available for hair and pointcloud objects.

Differential Revision: https://developer.blender.org/D7141
2020-04-22 14:20:31 +02:00
dfe22c2900 Cleanup: comment and semicolons 2020-04-22 14:17:19 +02:00
470f17f21c Fix T75974: Multiobject editing UV hiding/unhiding does not work
Seems like this was left out when UV operators were converted to multi-
object-editing, ref T54645.

Maniphest Tasks: T75974

Differential Revision: https://developer.blender.org/D7492
2020-04-22 14:07:43 +02:00
bc83fc9c04 Fix T75981: crash in sculpt mode with mesh that used to have multiple materials
The material indices in a mesh can exceed the number of available materials
slots in the object or mesh, sculpt drawing was not taking that into account.
2020-04-22 13:59:14 +02:00
b2cc2dda9c Fix 3D viewport select using grease pencil engine when not needed
Other draw loops also avoid the overhead of grease pencil drawing when there
are no grease pencil objects in the scene. It's a little faster to skip those
shaders and buffer when not needed.
2020-04-22 13:44:06 +02:00
aba78caa11 Fix T75625: crash on exit in macOS after selecting objects
This code to free shaders by casting a struct to a pointer array is not valid
in general, and particularly when compiling with Clang (on Linux and macOS) it
fails and can read invalid/uninitialized memory .
2020-04-22 13:44:06 +02:00
8eeae02cb0 Merge branch 'blender-v2.83-release' 2020-04-22 21:41:28 +10:00
c7991bcefc BLI: add ScopedTimer
This adds a simple timer that can be used for performance measurements in C++.
More sophisticated timers are possible (e.g. one that takes averages, logs the results, ...).
However, I found that this simple timer is good enough for 99% of my use cases.

To use it just write `SCOPED_TIMER("my timer name");` or more commonly `SCOPED_TIMER(__func__);`
into some scope.

Reviewers: sergey

Differential Revision: https://developer.blender.org/D7491
2020-04-22 12:53:47 +02:00
3542c5eb72 Fix T75971: 3D Text invisible when fill set to None 2020-04-22 19:46:53 +10:00
21f811cb6d Merge branch 'blender-v2.83-release' 2020-04-22 11:37:36 +02:00
1998154ff4 Undo: Minor optimization: do not write Scene's 3DCursor.
Probably not much gained here, but that's one thing less potentially
making the scene seen as changed in undo steps...
2020-04-22 11:37:09 +02:00
0faeca806c Fix T75719: Undo system: Debug assert while undoing several operations.
Caused by some pointer collision when re-allocating data-blocks during
undo (due to creation/deletion of those).

Patch by @brecht, many thanks.
2020-04-22 11:37:09 +02:00
f7374737ef Fix T75909: icons memory leak in headless build 2020-04-21 21:44:44 +02:00
13e3a1c532 Fix T75969: view layer add with Copy Settings does not copy all data 2020-04-21 19:59:35 +02:00
8845b27dce Merge branch 'blender-v2.83-release' 2020-04-21 18:29:25 +02:00
bc3aab3fa5 Fix T75893: Undo causes crash with "Load UI" disabled.
We need to re-generate a new session uuid for the UI-related data-blocks
that are kept across file reading, when load UI is disabled. Otherwise
there will be several IDs with same uuid, which is an ensured way to
crash in new undo code.
2020-04-21 18:26:32 +02:00
93e193399d Tests: added unit test for mat3_vec_to_roll() function
This was used to investigate T73840. Since the armature math is far from
simple, I thought it would be a good idea to start writing some unit
tests for it.

No functional changes in Blender itself.
2020-04-21 17:58:27 +02:00
38f4b95635 Cleanup: added missing header to BKE_armature.h
No functional changes.
2020-04-21 17:58:27 +02:00
29e9506a7f BLI: simplify naming of listbase wrapper 2020-04-21 17:38:19 +02:00
3059353b38 BLI: Use .hh extension for C++ headers in blenlib 2020-04-21 17:31:56 +02:00
0e52b91f97 BLI: add float2, float3, float4x4, Color4f and Color4b
Reviewers: brecht, campbellbarton, sergey

Differential Revision: https://developer.blender.org/D7450
2020-04-21 16:57:00 +02:00
805c52b1fd Libmv: Cleanup, naming
Initial bundle adjustment only supported OpenCV's radial distortion
model, so the cost functor was called after it.

Nowadays it supports more than this single model, so naming was a bit
wrong and misleading.
2020-04-21 16:41:23 +02:00
b08e18ff36 CleanUp: Remove thread_id from TaskFreeFunction
It isn't used; cleanup related to {D7475}
2020-04-21 15:57:51 +02:00
2d6ad88466 CleanUp: Renamed BLI_task_pool_userdata to BLI_task_pool_user_data
In preparation for {D7475}
2020-04-21 15:37:36 +02:00
23919d2275 Fix T75845: some dependencies update missing when painting textures.
issue: Painting a texture that is set as a particle system influencer, doesn't
update particles. An external trigger (such as changing influence slider)
is required to update particles.

fix: The root cause is a missing relationship from image to texture in the
dependency graph.

test: Once fixed, image texture painting updates expected dependencies
such as particle system influence or displacement modifier.

Reviewed By: sergey

Maniphest Tasks: T75845

Differential Revision: https://developer.blender.org/D7472
2020-04-21 15:27:21 +02:00
6505dd1985 UI: Use heading for File Browser column toggles in popover 2020-04-21 15:13:58 +02:00
ec14bee20d Cleanup: remove unused includes 2020-04-21 14:57:19 +02:00
2de0cc5adc Merge branch 'blender-v2.83-release' 2020-04-21 14:34:22 +02:00
b4993a9032 Fix: Incorrect f-string in previews.py
Contributed by @deadpin

Differential Revision: https://developer.blender.org/D7458
2020-04-21 14:33:37 +02:00
f4ee9643ad Fix Linux/GCC build error after recent changes 2020-04-21 14:28:26 +02:00
Miguel Porces
ad23b1e91d UV: add Reset operator to menu in uv editor
Differential Revision: https://developer.blender.org/D7482
2020-04-21 14:20:42 +02:00
a93ed3bcb7 Strengthen modifiers test validation, from D7397.
Submitting on behalf of Jesse Y (deadpin).
In test harness for modifier testing, now run mesh validation
on output mesh. Also, fix printing so it interleaves properly.
2020-04-21 08:15:26 -04:00
9528fa2c46 Merge remote-tracking branch 'origin/blender-v2.83-release' 2020-04-21 13:24:47 +02:00
6f598ecc1a Fix T75472 Crash on "Remove Empty Animation Data" in NLA editor
The `ANIMFILTER_NODUPLIS` option, to prevent duplicates in the list of
animation data to be freed, was missing. This caused a use-after-free.
2020-04-21 13:24:20 +02:00
81d29a9f61 Merge branch 'blender-v2.83-release' 2020-04-21 13:17:39 +02:00
5fed9ac9b5 Fix clang-format differences between version 6 and 9
Version 6 does not appear to respect clang-format off for header sorting.
2020-04-21 13:16:59 +02:00
1c86912068 Cleanup: clang-format 2020-04-21 13:16:34 +02:00
06a2ae281b Merge branch 'blender-v2.83-release' 2020-04-21 12:55:40 +02:00
c73d6162be Fix T75920: Add object - Align to 3D cursor not working.
3DCursor is UI data (hence not expected to be affected by undo) that is
stored in actual data (Scene)... So it needs some special care during
undo.

New undo code now re-reads data into existing memory, which means
copying of 3DCursor data has to happen earlier in that case, when we
still have both old and newly read data available.
2020-04-21 12:52:18 +02:00
49a29c9c76 Cleanup: Fix strict compiler warning 2020-04-21 12:49:12 +02:00
a02da85b55 Libmv: Cleanup, spelling and naming in bundle adjustment
Just more things which were discovered to be annoying on unclear when
adding more features to this code.
2020-04-21 12:25:45 +02:00
55a2682348 Windows: Add sccache support.
sccache [1] is one of the few ccache like solutions that will
work on windows.

sccache support can be enabled with the `WITH_WINDOWS_SCCACHE`
cmake option however it will only will work with ninja as the
build system, msbuild is not supported currently.

Advanced option, developes are expected to obtain and configure
sccache on their own.

```
Full build no cache 1428.90s (100.00%)
Full build cached    434.34s ( 30.40%)
```

[1] https://github.com/mozilla/sccache

Reviewed By: nicholas_rishel, Brecht

Differential Revision: https://developer.blender.org/D7466
2020-04-20 12:51:43 -06:00
9618bd9202 Merge branch 'blender-v2.83-release' 2020-04-20 18:55:08 +02:00
be7c51d076 Fix T75885: Mesh deform modifier not updating on own transforms
Added the missing relation.

Maniphest Tasks: T75885

Differential Revision: https://developer.blender.org/D7473
2020-04-20 18:50:18 +02:00
749181ff4d Libmv: Cleanup, spelling in comment 2020-04-20 17:26:45 +02:00
e9c9e1c2c7 Libmv: De-duplicate creation of residual block
Allows to centralize logic which is needed to check which cost functor
to use for the specific intrinsics.
2020-04-20 16:26:39 +02:00
f0e8965090 Libmv: Cleanup reprojection cost function
Make it smaller and more clear how and what it operates on.
2020-04-20 16:26:32 +02:00
ce82e9e64a Libmv: Pass entire camera intrinsics to reprojection error functor
Currently no functional changes, but allows to have access to some
invariant settings of camera intrinsics such as image dimensions.
2020-04-20 16:26:32 +02:00
c334020d8f Libmv: Cleanup, rephrase comment 2020-04-20 16:26:32 +02:00
838d452843 Libmv: Cleanup, fix indentation 2020-04-20 16:26:31 +02:00
584f112548 Libmv: Cleanup, spelling in comments 2020-04-20 16:26:31 +02:00
3135791395 Tracking: Specify image image for (un)distortion model
Allows to support distortion models which needs to know actual
image dimensions to apply or inverse camera intrinsics.
2020-04-20 16:26:31 +02:00
Henrik Dick
7865185d98 Fix T75840: Add check for not generated edges
The value of `new_edge` is `SOLIDIFY_EMPTY_TAG=2^32-1` if the edge is not generated.
The code from D7334 was missing this check.

Reviewed By: mont29

Maniphest Tasks: T75840

Differential Revision: https://developer.blender.org/D7463
2020-04-20 16:16:04 +02:00
665bf41f3c Cleanup: rename "nested" to "embedded"
Reviewers: mont29

Differential Revision: https://developer.blender.org/D7476
2020-04-20 16:14:45 +02:00
d1da2f0b9e Fix: Add extern "C" to RNA_enum_types.h 2020-04-20 15:58:59 +02:00
7ff0f896e8 UI: Use different icon to remove user-created shortcuts in Preferences
There was no way for users to visually tell appart shortcut items
they've added themselves and the default ones. Both used the same 'x'
icon to remove the item.
Modified items already showed a back-arrow icon; this commit makes
user-created shortcuts use an icon that has both, a back-arrow and a
'x'.

The icon is in fact from the Movie Clip Editor, but William Reynish and
I concluded that it's not worth creating and adding a new one just to
short-term fix this small annoyance. And the icon actually fits the
purpose surprisingly well :) {F8485176}
2020-04-20 15:56:57 +02:00
8dbbac43bb Simulations: Add Boolean Math, Switch and Float Compare node UI
Reviewers: brecht

Differential Revision: https://developer.blender.org/D7424
2020-04-20 15:27:58 +02:00
dcb45992bf Merge branch 'blender-v2.83-release' 2020-04-20 15:27:27 +02:00
aa2544793d Various typos fixes in UI messages. 2020-04-20 15:27:01 +02:00
b78f2675d7 Simulations: Use some shader nodes in simulation node trees
Reviewers: brecht

Differential Revision: https://developer.blender.org/D7422
2020-04-20 15:17:36 +02:00
915866f0d9 Fix T75914: Assert Knife Tool
Actually the assert was incorrect. It tested for an active buffer, but
an batch would also be ok.
2020-04-20 15:10:21 +02:00
9f7bea6e83 Simulations: UI for core particle nodes
This commit adds the initial set of particles nodes. These are fairly
low level and are expected to be put into groups that we ship with Blender.

See D7384 for a description of the individual nodes.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D7384
2020-04-20 14:47:13 +02:00
e7acf17b74 Nodes: Add emitters, events, forces and control flow socket types
These socket types will be necessary for particle nodes.
The way these sockets are drawn can be changed separately.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D7349
2020-04-20 13:41:21 +02:00
8759813abd Nodes: New Object and Image socket types
Those new socket types will be necessary for particle nodes.

The main difficulty with adding these socket types is that they
are the first that reference ID data in their `value`.
Therefore, user counting code had to be added in a couple new places.

Reviewers: brecht, mont29

Differential Revision: https://developer.blender.org/D7347
2020-04-20 13:27:45 +02:00
2b2d3c14fe Simulations: Embed simulation node tree in simulation data block
This adds an embedded node tree to the simulation data block dna.
The UI in the `Simulation Editor` has been updated to show a list
of simulation data blocks, instead of individual node trees.

The new `SpaceNodeEditor.simulation` property wraps the existing
`SpaceNodeEditor.id` property. It allows scripts to get and set
the simulation data block that is being edited.

Reviewers: brecht, mont29

Differential Revision: https://developer.blender.org/D7301
2020-04-20 12:56:16 +02:00
8d53e59e32 Cleanup: Remove unnecessary callbacks where default behavior is fine
See comments in D7225.
2020-04-20 11:22:55 +02:00
1b01d10998 Cleanup: typo 2020-04-20 11:22:55 +02:00
67593a41dd Merge branch 'blender-v2.83-release' 2020-04-20 11:20:38 +02:00
25e774422c Cleanup: ID management: Light ID type.
Keep IDType code at head of each ID file, instead of mixing it with more
specific API. Also do not define callbacks when defautl generic handling
is fine.
2020-04-20 11:20:05 +02:00
bc71074d0a Fix T75922: Removing custom orientation doesn't update gizmo 2020-04-20 19:12:46 +10:00
0247ee5f53 Simulations: Add simulation node tree type
This implements a new builtin node tree type called `SimulationNodeTree`.
It is not yet embedded in the `Simulation` data block.

The node tree will initially be used for the new particle nodes system.

When the cmake option `WITH_NEW_SIMULATION_TYPE` is enabled, a new
`Simulation Editor` is shown in the editors menu (which is just a node editor).

This patch does not add entries to the Add Node menu, so it is empty.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D7287
2020-04-20 10:58:43 +02:00
eb4e3bbe68 Simulations: Add new simulation data block
This data block will be the container for simulation node trees.
It will be used for the new particle node system (T73324).

The new data block has the type `ID_SIM`.
It is not visible to users and other developers by default yet.
To enable it, activate the cmake option `WITH_NEW_SIMULATION_TYPE`.

New simulation data blocks can be created by running `bpy.data.simulations.new("name")`.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D7225
2020-04-20 10:45:18 +02:00
5f5ec7b0ed Merge branch 'blender-v2.83-release' 2020-04-20 18:36:48 +10:00
005bba2a81 Keymap: Add sequencer scrub with box-select & RMB select
Also support selecting by dragging a box over the strips which
previously did nothing.
2020-04-20 18:35:41 +10:00
0e7871f9c3 Merge branch 'blender-v2.83-release' 2020-04-20 17:40:39 +10:00
0e6c56760c Fix T74600: Sequencer blade tool inaccessible with RMB select
Declare `anim.change_frame` explicitly for each editor.

In sequencer, scrubbing in editor area is possible only with
select/tweak tool.

This change is to resolve conflict between scrubbing and tool actions.
2020-04-20 17:15:47 +10:00
2a96e8be39 Cleanup: redundant parenthesis, NULL checks 2020-04-20 12:15:49 +10:00
9d3b1d361d Merge branch 'blender-v2.83-release' 2020-04-20 12:15:03 +10:00
23bb42a06e Cleanup: accidental value declaration with struct type 2020-04-20 12:11:12 +10:00
b293517d7b Merge branch 'blender-v2.83-release' 2020-04-20 11:58:15 +10:00
30bfa991f8 Fix invalid comparison checking button unit type
Checking button unit type was length for proportional
multi-button adjustment wasn't working.
2020-04-20 11:54:47 +10:00
9776b8a05e Merge branch 'blender-v2.83-release' 2020-04-20 02:19:42 +02:00
Pablo Dobarro
28f667c7c4 Fix T75778: Missing ME_VERT_PBVH_UPDATE in Surface Smooth
Without this flag the PBVH won't update taking the modified vertices
into account.

Reviewed By: brecht

Maniphest Tasks: T75778

Differential Revision: https://developer.blender.org/D7453
2020-04-20 02:18:28 +02:00
7e72b74713 Fix T75766: Smooth mask using mesh vert indices direclty
In the vertex iterator vd.index should always be used. I probably
introduced this in a refactor.

Reviewed By: jbakker

Maniphest Tasks: T75766

Differential Revision: https://developer.blender.org/D7446
2020-04-20 02:14:11 +02:00
44a386b88c Fix T75329: Missing show_face_sets checks for Multires
These values were hardcoded before Face Sets were enabled for Multires,
so enable the show_face_sets checks now.

Reviewed By: jbakker

Maniphest Tasks: T75329

Differential Revision: https://developer.blender.org/D7444
2020-04-20 02:12:28 +02:00
65aaa13a00 Fix T75662: Surface Smooth filter not checking face sets
In the main mesh filter loop vertex that do not have the active face set
are skipped, so in the following surface smooth displacement loop these
vertices were deformed using an uninitialized laplacian_disp value.
Now the main loop initializes the laplacian_disp for all vertices and
the deformation based on face sets is skipped in the second loop.

Reviewed By: jbakker

Maniphest Tasks: T75662

Differential Revision: https://developer.blender.org/D7443
2020-04-20 02:10:42 +02:00
Pablo Dobarro
35cbf3b5dc Fix crash on Multires Face Set visibility sync
Multires uses the data of the Face Sets stored in the base mesh to
manage the grid's visibility, so these pointers can no longer be set to
NULL when editing Multires objects as they are requried for some operations.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D7431
2020-04-20 02:07:49 +02:00
251234ad43 Merge branch 'blender-v2.83-release' 2020-04-20 01:06:49 +02:00
d290bdd42a Fix missing Outliner selection syncing on "Select Hierarchy"
Adds syncing to a few operations that change selection, to avoid some
annoyances (like drag and drop of hierarchy to a different collection
only linking the parent to the collection).

Note that there's further refinement work for selection syncing in
D5572, but is awaiting some code design decisions. Meanwhile such quite
annoying issues should be fixed.

Addresses T75610.
2020-04-20 01:00:02 +02:00
a331d79900 Fluid: Fix for caches being released when file is loaded 2020-04-19 21:15:40 +02:00
76c1a91cfa Fluid: Fix for inconsistent behavior with flow and effector objects
Fixes issue with flow and effector objects which were not being used after resuming a bake job.
This issue has been reported in T75729 and T75758.
2020-04-19 21:15:40 +02:00
6c4a7e0ac3 Fluid: Added missing outflow object type to enable / disable flow flag
There is no reason to not include outflow objects here too.
2020-04-19 21:15:40 +02:00
c1c97c3d4a Merge branch 'blender-v2.83-release' 2020-04-19 21:07:59 +02:00
2816b22b38 Fix T75902 Workbench: render crash 2020-04-19 21:07:47 +02:00
1760b8c59f Fix T75878: Modifiers disappearing from UI
Typo in 4f9a56cbc4.
2020-04-19 19:06:11 +02:00
d7f05fd445 Fix T74809: Use after free when merging specific areas
Was incorrectly triggering animation for panels which would be free'd
before the animation ended.
2020-04-19 19:05:49 +02:00
5cc7e2ae16 Cleanup: Remove extra line 2020-04-19 17:29:35 +02:00
Cody Winchester
a39a6517af GPencil: Add Texture modifier
This patch aims to add a new modifier for grease pencil objects that gives more control over the strokes texture UVs.

There are 3 modes.
1 Control the stroke texture UVs alone
2 Control the fill texture UVs alone
3 Control both the fill and stroke texture UVs

For the stroke texture UVs there are 2 options for fitting the texture to the stroke.
1 The texture uvs are kept a consistent length how it currently is set by default.
2 The uvs are normalized to fit the length of the stroke regardless of how long or short it gets allowing the texture to fit the length of the stroke.

 There are then 2 controls to scale up and down the uvs and an offset value that allows moving the texture along the stroke.

For the fill texture UVs it includes all of the transformational controls. Location offset, scale, and rotation.

Reviewed By: antoniov, mendio

Differential Revision: https://developer.blender.org/D7439
2020-04-19 17:29:35 +02:00
a0a59972e7 Fix T75878: Modifiers disappearing from UI
Typo in 4f9a56cbc4.
2020-04-19 15:03:44 +02:00
3cd147b49f Fix T74809: Use after free when merging specific areas
Was incorrectly triggering animation for panels which would be free'd
before the animation ended.
2020-04-19 14:36:22 +02:00
1f1520a045 Merge branch 'blender-v2.83-release' 2020-04-18 18:48:40 +02:00
89d49ae218 GPencil: Disable animation for Onion Custom Colors
This was forgotten by error. All Onion props must be disabled.
2020-04-18 18:48:17 +02:00
221a7002a9 GPencil: Make properties animatable
Make use lights and mask properties animatable.
2020-04-18 16:23:58 +02:00
bfdcb6bed6 GPencil: Add header to Use Lights
This use the new header column
2020-04-18 16:18:17 +02:00
1c62ba80b1 Merge branch 'blender-v2.83-release' 2020-04-18 16:09:48 +02:00
101f00e696 GPencil: Fix missing patch of default Material names 2020-04-18 16:09:22 +02:00
a444c7e0e2 Merge branch 'blender-v2.83-release' 2020-04-18 13:16:20 +02:00
d809a0260e GPencil: Fix duplicated default brushes and change settings
Removed old duplicated brushes and change the settings of some brushes.
2020-04-18 13:15:51 +02:00
fda754145a Annotations: Add Onion Skin support in VSE
This was removed in previous versions, but can be useful in some situations.
2020-04-18 10:49:42 +02:00
62103e7d42 Industry Compat keymap: Add keys for Remesh 2020-04-18 08:33:38 +02:00
746684519b UI: Use new layout features for the NLA sidebar
Improves alignment.
2020-04-18 08:32:21 +02:00
f96a689b3b Merge remote-tracking branch 'origin/blender-v2.83-release' 2020-04-17 18:20:16 -06:00
Gary Oberbrunner
8fd9516a71 Fix: Build error on headless build
This simple patch removes an "UNUSED_VARS" macro referencing
a variable which doesn't exist (r_unit_size).

It only affects the headless build

Differential Revision: https://developer.blender.org/D7464
Reviewed By: harley
2020-04-17 18:19:56 -06:00
0fe8239470 UI: Make headings fit within regular Properties width
Before recent changes, we used Min/Max here too.
2020-04-17 22:06:06 +02:00
a6c14faa06 Merge branch 'blender-v2.83-release' 2020-04-17 22:04:10 +02:00
76b3aac802 Fix T75842: GPencil Edit mode of unselected object is visible
The overlay must be enabled only for the active object.
2020-04-17 22:03:46 +02:00
59d7fbb052 Merge branch 'blender-v2.83-release' 2020-04-17 21:54:26 +02:00
156319d2b3 Fix T74199 Overlay: Turning off overlays also hides edges 2020-04-17 21:53:38 +02:00
842e817bf7 Fix T73815 Overlay: Z axis line doesn't show alone on the workspace 2020-04-17 21:08:34 +02:00
c3994aa443 Fix typo causing compilation to fail
Sorry guys I thought I had compile before testing.
2020-04-17 20:57:25 +02:00
f2acfb460f UI: Add separator after Local Camera row 2020-04-17 20:43:12 +02:00
b7d603b41c Fix T75832 DRW Hair: Crash caused by shader compilation
This also fix it the volume velocity needles.
2020-04-17 20:43:05 +02:00
cad1ddc1e8 GPU: Fix typo making RG16F use 16 bytes instead of 4 2020-04-17 20:28:55 +02:00
2fc8daff10 GPU: Fix missing SRGB8_ALPHA8 debug string 2020-04-17 20:27:58 +02:00
a2f075b996 Merge branch 'blender-v2.83-release' 2020-04-17 19:42:53 +02:00
75ded99ff9 Fix T75811: GPencil Sculpt not working when use Subdivide
When use the subdivide modifier the number of points was not correct and can produce segment faults.

Also, the points were selected by default and this was wrong.
2020-04-17 19:41:57 +02:00
23c52d9584 Merge branch 'blender-v2.83-release' 2020-04-17 18:41:25 +02:00
e491573060 Fix poor video sequencer preferences UI layout
Sequencer related properties were not grouped together, and it wasn't
clear that the disk cache settings were about the sequencer. Now moved
sequencer settings into own panel.
2020-04-17 17:59:14 +02:00
1f232e9ae9 Merge branch 'blender-v2.83-release' 2020-04-17 17:53:37 +02:00
f915549ee7 Fix T75786: GPencil Modifiers were not overridable... 2020-04-17 17:49:12 +02:00
4ffa5e5703 Fix (unreported) bda locking of whole GP modifiers whem GP obdata is linked.
Only applys to obdata feature is supposed to be locked in that case, not
the whole modifier.
2020-04-17 17:49:12 +02:00
398d0bf57e Fix python registration error in previous commit 2020-04-17 17:08:37 +02:00
7fc60bff14 UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.

Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.

We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.

* Changes the property split percentage from 50/50% to 40/60%. This is
  needed to give enough space for the checkboxes. But in most cases this
  looks better anyway - see Transform panel. In some cases it simply
  fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
  When we did this, the alignment was never quite right, and the layout
  code was a mess.
* Adds column headings to many places where a list of checkboxes all
  share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
  only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
  poorly with column headings, and also they would mess alignment up
  badly. The grid flow layouts also often made buttons and controls jump
  around on the screen if you would just resize editors slightly,
  causing visual confusion, making users lose their place. The logic for
  at what time the list of items would re-flow was often flawed, jumping
  to multiple columns too fast or too late - and frankly, the grid flow
  layouts would often just look bad.

Maniphest Task: https://developer.blender.org/T65965

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

Reviewed by: Brecht Van Lommel, Pablo Vazquez.

Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 17:00:57 +02:00
219049bb3b UI: Better split layout support for checkboxes
Makes the following layout changes possible:
{F8473498} {F8473499} {F8473502}

The next commit will contain many layout changes to make good use of
these new possibilities. The result should be more consistent, easier to
read and should give a more organized impression. Additionally, it
should be possible to replace many sub-panels with compacter layouts.

Main changes:
* Checkboxes now respect the property split layouts
* Add support for row and column headers (i.e.
  `uiLayout.column(heading="Foo")`, `uiLayout.row(heading="Bar")`). If the
  first property added to this layout doesn't insert anything into the label
  split column, the heading is inserted there. Otherwise, it's inserted as own
  item.
* Add support for manually inserting decorators for an existing item
  (`uiLayout.prop_decorator()`). That way layout creators can manually insert
  this, which was the only way I saw to support property split layouts with a
  checkbox before the actual property. {F8471883}
* Autogenerated layouts for operator properties look bad if there are only
  checkboxes (which only use half the region width). So before creating the
  layout, we iterate over visible properties and disable split layout if all
  are booleans. I think this is fine, if needed we could also add layout hints
  to operators.
* `uiTemplateOperatorPropertyButs()` now handles macros itself, the caller
  used to be responsible for this. Code that didn't handle these so far never
  used macros I think, so this change should be invisible.
* Remove manual property split layout from autogenerated operator properties
  layout.
* Padding of checkboxes is tweaked to make their label visually more connected
  to the checkboxes.
* Support split layout for menus (should work for `uiLayout.menu()`,
  `.operator_menu_enum()`, `.prop_menu_enum()`, maybe more)

Maniphest Task: https://developer.blender.org/T65965

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

Reviewed by: Brecht Van Lommel, William Reynish, Pablo Vazques
2020-04-17 17:00:57 +02:00
20614d331d Merge remote-tracking branch 'origin/blender-v2.83-release' 2020-04-17 16:39:40 +02:00
6adb254bb0 Fix T75686: Animating scene audio volume doesn't work
Scene audio volume changes require the scene to be tagged with
`ID_RECALC_AUDIO_VOLUME` (see `BKE_scene_update_sound()`). Tagging
happens in the RNA update function `rna_Scene_volume_update()`, but that
function is not called by the animation system. As a result, animated
volume changes are not sent to the audio system.

This commit adds a new depsgraph operation node that sets this tag when
necessary, so that the animated values are used in the rest of the
depsgraph evaluation.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D7429
2020-04-17 16:33:05 +02:00
d923fb784f Task: Separate Finalize into Reduce And Free
In preparation of TBB we need to split the finalize function into reduce
and free. Reduce is used to combine results and free for freeing any
allocated memory.

The reduce function is called to join user data chunk into another, to reduce the
result to the original userdata_chunk memory. These functions should have no side
effects so that they can be run on any thread.
The free functions should free data created during execution (TaskParallelRangeFunc).

Original patch by Brecht van Lommel
{rB61f49db843cf5095203112226ae386f301be1e1a}.

Reviewed By: Brecht van Lommel, Bastien Montagne

Differential Revision: https://developer.blender.org/D7394
2020-04-17 16:06:54 +02:00
74fcb531de Merge remote-tracking branch 'origin/blender-v2.83-release' 2020-04-17 08:05:13 -06:00
27941b027b Windows: Fix working directory issue in debug batch files
Batch files did not work when you ran them from a
different working directory.
2020-04-17 08:04:49 -06:00
795a874d0b Merge branch 'blender-v2.83-release'
Conflicts:
	source/blender/makesdna/DNA_userdef_types.h
	source/blender/makesrna/intern/rna_userdef.c
2020-04-17 15:16:16 +02:00
c565d0764f Enable new undo code by default.
Note that given how experimental is working currently, I had to rename
and inverse the effect of the experimental undo flag, which will now
instead activate legacy code when set.
2020-04-17 15:13:25 +02:00
a250be980a Fix T74805 Workbench: Back faces flicker with Auto Depth is enabled 2020-04-17 14:57:36 +02:00
96825403a6 Overlay: Fix unreported bug: Edit mode overlays drawing during auto depth
This would double draw the edit cage on top of the other overlays.
2020-04-17 14:57:35 +02:00
95a018aa32 Workbench: Fix unreported bug: garbage viewport when changing AA settings
Was caused by uninitialized buffer.
2020-04-17 14:57:35 +02:00
c87dd76937 Fix T75774: rename Musgrave texture output from Fac to Height
To make it clear that's not in the 0..1, but more of a terrain height value
without a strict range.
2020-04-17 14:28:24 +02:00
493c623b13 Merge branch 'blender-v2.83-release' 2020-04-17 20:24:03 +10:00
adc6659de5 Fix T75820: Child bone head vanishes when connected parent is hidden 2020-04-17 20:21:25 +10:00
40d90456ea Fix logical error in BLI_hash_pointer_to_color
'hash_b' was always zero as it's range was bit-shifted away.
2020-04-17 19:30:14 +10:00
f8ca1da138 Merge branch 'blender-v2.83-release' 2020-04-17 19:19:22 +10:00
1b7ceb0aff Fix normal smoothing for light positioning gizmo 2020-04-17 19:18:08 +10:00
53ff71725a Merge branch 'blender-v2.83-release' 2020-04-17 18:52:27 +10:00
b6279b7415 Fix T75794: Light point gizmo translate jumps
Holding Ctrl while dragging the light point gizmo would use
uninitialized stack memory if the normal had not been
initialized by a surface.

Now holding Ctrl can be used to drag,
even when there is no surface to orient to.
2020-04-17 18:51:09 +10:00
e77821eeca Merge branch 'blender-v2.83-release' 2020-04-17 18:17:23 +10:00
774b61189c Fix T75796: Misaligned quit dialog keymap 2020-04-17 18:09:05 +10:00
841b0c2bf5 Merge branch 'blender-v2.83-release' 2020-04-17 08:25:10 +02:00
42224bf623 GPencil: Add always empty frame when add new layer
The dopesheet needs to have a frame to display the channel, so an empty frame is created in the current frame.

See T66505 for details of why an empty channel cannot be displayed.
2020-04-17 08:24:22 +02:00
03faffa10b UI: support A-Z accelerator keys for pie menus
Converting menus to PIE's was removing convenient key accelerators.
2020-04-17 15:50:47 +10:00
f1f68b3f9a Fix toggling quad-view loosing 3D view clipping 2020-04-17 15:30:18 +10:00
19c7ef3067 UV: minor adjustments to opacity adjustment
- Allow 0.0..1.0 range, as even at 0.0 the selection is still visible.
- Correct versioning code, not to overwrite the value for new files.
2020-04-17 13:53:15 +10:00
cbd6c5735d GNUmakefile: remove style checking targets
This has been removed since clang-format now enforces code-style.
2020-04-17 12:33:40 +10:00
0f0436c15e Cleanup: comments for ui_draw_menu_item & correct argument name 2020-04-17 11:16:48 +10:00
ab93e568eb Cleanup: use colon after doxygen parameters, spelling 2020-04-17 11:15:00 +10:00
0733bd0d64 UI: Fix bad flow layout
The layout of the new sequencer disk cache were not handled well with 
large preference windows.
2020-04-16 20:00:14 -04:00
27e39cc533 GPencil: Add always empty frame when add new layer
The dopesheet needs to have a frame to display the channel, so an empty frame is created in the current frame.

See T66505 for details of why an empty channel cannot be displayed.
2020-04-16 22:43:41 +02:00
9029690a5d UI: Remove old hacks for dynamic scrollbar hiding
Although we still dynamically hide scrollbars, they don't change the
region size anymore. They are simply drawn on top of the region content.
Because of this, some hacks introduced by fa28e50ac2 are no longer
necessary.
Without these hacks, the scrollbar visibility is evaluated much more
often (cheap operation) which should be more reliable and possibly solve
some glitches.

Also replaces integers passed as booleans.

Fixes T75782.
2020-04-16 20:50:51 +02:00
b374fcc98f Merge branch 'blender-v2.83-release' 2020-04-16 17:45:07 +02:00
8cb10c124e Fix T75675: Unlinking [with setting users to zero] not clearing
LIB_TAG_EXTRAUSER_SET flag

For example in the Image Editor, an assert would be triggered after
unlinking an image [with setting users to zero] and then setting the
image for the Image Editor again.

Whenever we set an Image for Image Editor, the Image ID is flagged
LIB_TAG_EXTRAUSER_SET, when we unlink [with setting users to zero] this
flag was not cleared.

quote @mont29: "a proper fix would be to move this to modern code, and
actually delete the ID..." but that is for later.

Maniphest Tasks: T75675

Differential Revision: https://developer.blender.org/D7452
2020-04-16 17:38:05 +02:00
67ddf68dd9 Merge branch 'blender-v2.83-release' 2020-04-16 17:09:01 +02:00
e9bf624a49 Fix T75680: Nodegroup user count increased when file saved in edit group mode.
This editor's code was a bit schizophrenic, some parts considering its
nodetree usages as real refcounted ones, others, as shallow 'user one'
ones...

Editors should not be real ID users anyway, unless there are *very* good
reasons for it, so swich it to fully 'shallow' usage now.
2020-04-16 17:08:46 +02:00
db600fd639 Fix Memory Leak in Shader Interface 2020-04-16 16:55:46 +02:00
2a68b41b7d Fix T74964 Stereo 3D anaglyph and interlace not working
Caused by framebuffer initialized in the wrong context.
2020-04-16 16:24:22 +02:00
e22e766cf8 Merge branch 'blender-v2.83-release' 2020-04-16 16:22:08 +02:00
81bb2a143c Fix T75730: Properly remove unused override properties/operations.
While code is supposed to handle gracefully invalid override operations,
it is much cleaner to avoid those completely.
2020-04-16 16:21:11 +02:00
dac6091207 Fix (unreported) crash on use-after-free in liboverride deletion code. 2020-04-16 16:21:11 +02:00
0438944b34 Refactor/strengthen a bit invalid operands checks when applying an override operation. 2020-04-16 16:21:11 +02:00
e3d575b376 Fix T75730: Crash on read of liboverride data when missing source modifier.
While this should not happen, we still want to handle those errors
gracefully from user perspective (i.e. assert for devs, no crash for
users).

Actual fix of root cause of the issue will come later.
2020-04-16 16:21:11 +02:00
d34c5eec19 GPU: Fix Negative Shift
glAttributes also include `gl_` names. These don't have a location and
should be ignored during shader interface creation. Those internal names
received a location of -1 and therefore the bitmasking was undefined.

Users wouldn't notice this, but ASAN warned developers of this situation.
ASAN could quit making ASAN un-usable as most shaders have this issue.

Reviewed By: Clément Foucault`

Differential Revision: https://developer.blender.org/D7448
2020-04-16 16:20:40 +02:00
Brecht Van Lommel
79a58eef05 Fix T73977, T73825: ignore Python user site-packages directory by default
This goes along with the existing changes to ignore PYTHONPATH by default.
--python-use-system-env now controls both.

Differential Revision: https://developer.blender.org/D6962
2020-04-16 15:58:31 +02:00
a1420da027 Merge branch 'blender-v2.83-release' 2020-04-16 15:57:37 +02:00
a9dd6d004b Fix T75780: Gpencil Sculpt brushes not working with old files
The patching of brushes was not done.
2020-04-16 15:53:58 +02:00
816597d6da Fix T75785: "Extrude Faces Along Normals" throws error 2020-04-16 10:44:48 -03:00
8a506b9660 Merge branch 'blender-v2.83-release' 2020-04-16 10:32:46 -03:00
dcb443416e Fix memcpy overlapping buffers
This crashes with ASAN enabled.
```
==39366==ERROR: AddressSanitizer: memcpy-param-overlap: memory ranges [0x6230000ae848,0x6230000ae85a) and [0x6230000ae851, 0x6230000ae863) overlap
```
2020-04-16 10:31:51 -03:00
7ef2dd8424 UI: Move node socket icons to the left of node input buttons
Node input buttons (e.g. in the material properties) used to draw their
icons on the right of the buttons. However since they represent inputs,
it makes more sense conceptually to have them on the left.
Further, we might want to add the usual decorator buttons (to control
keyframes or display other states) to the material properties as well.
Having two circle icons next to each other would be confusing.

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

Reviewed by: Brecht Van Lommel, William Reynish
2020-04-16 15:29:19 +02:00
675d42dfc3 UI: Draw real node sockets for node input buttons
For buttons representing node inputs (e.g. in the material properties)
rather than drawing some generic socket icon, the actual sockets are
drawn now. That includes color, shape and the selection outline.

This should make it easier to understand what these buttons relate to.

Screenshots: {F8469252}, {F8469248} (The left alignment will be done in
a follow-up commit.)

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

Reviewed by: Brecht Van Lommel, Clément Foucault, William Reynish
2020-04-16 15:29:19 +02:00
737a4309e8 Cleanup: typo in comment 2020-04-16 15:22:15 +02:00
cdd406f4bd Cleanup: unused variable warning
Not needed since rB1685f5824d91.
2020-04-16 14:34:14 +02:00
13876d50ce Merge branch 'blender-v2.83-release' 2020-04-16 14:12:09 +02:00
3ea4d3dc07 Fix (unreported) Image Editor UI drawing too dark
Caused by rBf0221ff6674f.

Only draw the Image buffer itself in display space.

Differential Revision: https://developer.blender.org/D7449
2020-04-16 14:04:30 +02:00
70a6c737ec Cleanup: Deduplicate getting node tree from id
Differential Revision: https://developer.blender.org/D7438

Reviewers: mont29
2020-04-16 12:06:01 +02:00
3468434b6b Theme: adjust active UV face color in the theme
This color had it's alpha reduced in the drawing code,
as the active face is no longer stippled.

Now the color is used from the theme without adjusting the alpha.
2020-04-16 18:46:32 +10:00
90d3fe1e4d UV: support changing the opacity of the UV overlay
Add this option as it's useful to adjust how much UV's
cover the image when UV mapping.

D5348 by @EitanSomething with edits
2020-04-16 18:26:07 +10:00
ec263547b5 Merge branch 'blender-v2.83-release' 2020-04-16 08:58:25 +02:00
Jeroen Bakker
5d9d246851 GPUImmediate: Use 2 Buffers For (Un)Strict
We used to have a single buffer that was shared between strict and
unstrict draw calls. This leads to many recreation events for the draw
buffers. This patch separates the Unstrict draw buffer from the strict
draw buffer.

This improves performance on Windows Intel 10th gen platform.
On a reference platfor before the patch I got 10 FPS, after this patch
it became 34fps. Note that the same test normally on a low end GPU can
get to 60fps so this does not solve all teh bottlenecks yet.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D7421
2020-04-16 08:46:31 +02:00
Jeroen Bakker
502b8e0f08 GPUViewport: Use GPUBatch for viewport drawing
When drawing the viewport to the screen the draw calls were not batched.
This resulted in measurable slowdown on Windows Intel 10th gen
platforms.

This patch would cache the last draw calls per viewport. Our API does
support partial redrawing of the viewport, but that isn't used anywhere.

This patch does not include stereoscopy rendering. This still uses the
imm approach and would still be slow on certain hardware.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D7357
2020-04-16 08:41:53 +02:00
a703bbb4d7 Fix T75567: Paint Mode Wireframe Incorrect
The loop normal VBO is used in two manners. In edit mode to draw the
edge normals. And in paint mode to draw the wireframe. This commit
checks which VBO is needed and build the correct one.

This allows show the wireframe correct in paint mode, when the object is
subdivided.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D7419
2020-04-16 08:34:55 +02:00
ef19cd395f Fix T75455: High World Space Cavity Samples Crash
When setting the number of cavity samples to a high number blender could
write out of bounds.

This patch will harmonize the number of iterations in the same way how
it is done during execution.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D7425
2020-04-16 08:32:34 +02:00
0301aff285 Fix T75620: Lamp gizmo flips direction for negative scaled objects 2020-04-16 15:55:04 +10:00
e322f7a3a2 UI: disable shade flat/smooth in sculpt mode 2020-04-16 12:06:50 +10:00
002752f021 Object: only apply smooth/flat to the active object in paint modes
Also some minor improvements:

- Only run once per object data instance.
- Correction for mesh smooth flag being used on curves.
- Move curve operation into utility function.
2020-04-16 11:47:48 +10:00
1685f5824d Cleanup: remove unused scene argument 2020-04-16 11:05:52 +10:00
bc0ed16537 Cleanup: use sections for object_edit.c 2020-04-16 10:59:41 +10:00
d409ce1593 Logging: log warnings which had been disabled since 2.4x 2020-04-16 10:59:41 +10:00
32cd853294 Merge branch 'blender-v2.83-release' 2020-04-16 00:31:33 +02:00
f0221ff667 Fix T75750 Image Editor: Rendered result is much brighter than in viewport 2020-04-15 23:34:19 +02:00
e0d7b6c78d Fix T75751 Overlay: Clipping Region crashes Blender 2020-04-15 22:30:55 +02:00
e08ac50a5c Fix T75443 Color Management: Use after free crash when using curve mapping
The root cause is that viewport can draw cached version of themself but
the scene can have been updated and the pointed curvemapping could have
been freed.

To workaround this we just keep a copy of the curvemap at the viewport
level.
2020-04-15 22:30:55 +02:00
851baa40a1 Operator: Add 'dissolve_and_intersect' option for 'Extrude and Move on Normals'
This allows easy choice of operators when editing keymaps
2020-04-15 16:02:28 -03:00
03a931a876 Cleanup: Remove unused operator 2020-04-15 16:02:28 -03:00
ed8184cff0 UI theme: Make Properties panels opaque
The resulting colors are unchanged, but panels now appear opaque when dragging over other panels
2020-04-15 20:12:43 +02:00
3b0d86d8b1 UI: Draw subpanels on top while dragging
Currently the background of a panel is drawn on top of its subpanels
when it is dragged. The solution is to also "select" the subpanels so they
are drawn on top in UI_panels_draw.

Differential Revision: https://developer.blender.org/D7440
2020-04-15 13:11:48 -05:00
e9a3a1afd1 Mantaflow: Change Defaults to Improve Instantaneous Playback
- Change the default cache method to replay
- Change the default resolution to 32 (The same as old smoke)
  which have a speedup of about 4x (~4 FPS vs. ~16 FPS on initial 
playback)

Peformance was tested with 3700x and RTX 2070

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

Fixes T73799
2020-04-15 13:54:08 -04:00
f49ffd7f1c Update RNA Manual References 2020-04-15 13:48:59 -04:00
11a6d840da Merge branch 'blender-v2.83-release' 2020-04-15 18:50:17 +02:00
Vincent Blankfield
eb46b55e56 Fix T75613: "In Front" setting did not override image empty "Depth"
Differential Revision: https://developer.blender.org/D7418

Reviewers: campbellbarton, brecht
2020-04-15 18:49:32 +02:00
4dc534aa04 Merge branch 'blender-v2.83-release' 2020-04-15 17:46:09 +02:00
f250b1f5a0 Fix assert for Image Editor invert/resize operators
Caused by rB2bf4c74130ff.

For undo, the ImageUser's scene should be NULL (see D7022 for
discussion).

PaintTiles were already doing it beforehand in ED_image_paint_tile_push,
but Image ops [scale/invert] are calling
ED_image_undo_push_begin_with_image directly.

Now actually set the UndoImageHandle iuser.scene to NULL (rather than
asserting)

ref T75675

Maniphest Tasks: T75675

Differential Revision: https://developer.blender.org/D7435
2020-04-15 17:20:59 +02:00
ec574b5b09 Cleanup: remove (unused) RNA update cache
Introduced in 2011 in rB6a392e8cb505, it was disabled again soon after
in rBb062056c05a3 and traces to it partly removed in rB21744217cea9.

Now remove completely.

quote @sergey:
We shouldn't be having partially working unused code.
If we ever need some sort of update cache it would need to have clear
design first, and the code could be resurrected from history if needed.

Differential Revision: https://developer.blender.org/D7432
2020-04-15 17:05:33 +02:00
b79a5bdd5a View3D: New tool 'Extrude, Dissolve and Intersect'
Basically this new tool constitutes a macro that uses the parameters of
the Extrude and Translate operators that were recently implemented.

Thanks to @CandleComet for initial implementation.

Differential Revision: https://developer.blender.org/D7222
2020-04-15 12:01:54 -03:00
8f86da71fe Operator: Add 'use_automerge_and_split' option for Translate 2020-04-15 12:01:54 -03:00
fe513a5b61 Operator: Add 'use_dissolve_ortho_edges' option for Extrude 2020-04-15 12:01:54 -03:00
7af84255c7 Cleanup: typo 2020-04-15 16:57:28 +02:00
debd8aab4a UI: default to searching menus instead of operators
Menus from the top-bar, space-header and key bindings are used
to gather menus to populate the search popup.

Giving better context and default options for operators.

Part of T74157

Enabling "Developer Extras" exposes operator search in the Edit menu,
as this can be useful for developers to run operators
without first exposing them in the interface.
2020-04-16 00:32:30 +10:00
f83ccbc673 Cleanup: unused variable, spelling 2020-04-16 00:12:39 +10:00
549b854187 Fix: Replace ID_HA with ID_PT in pointcloud.c 2020-04-15 15:57:25 +02:00
7d1c7a6485 Fix splash screen not showing button to load config from 2.83 into 2.90 2020-04-15 15:54:42 +02:00
Nathan Letwory
5fb4ff7711 Ensure 2.90 is still alpha for bcon1 2020-04-15 16:02:24 +03:00
Nathan Letwory
69a2af7e84 Merge branch 'blender-v2.83-release' 2020-04-15 16:01:49 +03:00
Nathan Letwory
b9ec9afce1 Bump master to 2.90 alpha for bcon1 2020-04-15 16:01:35 +03:00
7de86ad61f Fluid: Improved cache 'Replay' option
When using the 'Replay' cache mode the cache needs to be invalidated whenever simulation variables have been changed.
The invalidation will always only affect the according subcaches, e.g. when changing a mesh paramter only the mesh cache will be invalidated, the base cache will remain intact.
Before this change Blender always invalidated the entire cache.
2020-04-15 14:22:47 +02:00
0f6044610f Fluid: Cleanup in MANTA main class
More concise return types for cache import functions and general cleanup.
2020-04-15 14:22:47 +02:00
d9db8f8b7c Fluid: Remove noise bake call from Python
Saving noise cache files is handled in fluid.c.
2020-04-15 14:18:00 +02:00
e21fdfc8e4 Fix T75681: Mantaflow crash when trying to bake a cupcake: The CG solver diverged, residual norm > 1e30
Ensures that there are no enclosed holes between an obstacle and the domain walls.
2020-04-15 14:18:00 +02:00
d6de81eed6 Fluid: Minor UI fix for diffusion panel
Was missing active option.
2020-04-15 14:18:00 +02:00
Nathan Letwory
54736d5058 Bump release cycle to beta for 2.83 2020-04-15 15:03:05 +03:00
Nathan Letwory
9ca1b721b4 Ensure master points at latest submodule heads 2020-04-15 14:41:47 +03:00
8fcbbcf2e6 Fix unreported Auto IK crash when using targetless IK.
Needed to use a temporary pchan iterator to make sure that we keep track
of the selected bone.
2020-04-15 13:25:44 +02:00
6547d9d3e2 Fix T75649: Using "Auto IK" on FK controls with Rigify will crash Blender.
Fixed a coding mistake when adding temp IK chains with Auto-IK.
We need to use the data from the new temporary constraint.
2020-04-15 12:36:14 +02:00
Henrik Dick
c1edbe7917 Fix mistake from last commit to solidify.
While review the behaviour was changed accidentally.
Now Solidify just crashes everytime.

This is the fix for that.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D7434
2020-04-15 12:07:58 +02:00
Yevgeny Makarov
bdf260a1b8 UI: Avoid manual right-alignment of text in splash screen
Can use existing layout features for right-alignment instead.

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

Reviewed by: William Reynish, Julian Eisel
2020-04-15 11:49:25 +02:00
Yevgeny Makarov
04828b7d99 UI: Round splash image corners according to theme preferences
Round the corners of the splash screen image according to the theme's
User Interface > Menu Back > Roundness preference.

Previously the rounding was added to the image itself, which was fiddly
to do. The rounded corners of the popup background would not match
the one of the image if the preference was changed.

The current splash image will likely be updated to not include rounded
corners in a separate commit.

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

Reviewed by: Julian Eisel (with some changes)
2020-04-15 11:49:25 +02:00
69419b5f00 Resources: Remove small splash screen image variant
After the previous commit by Harley Acheson, scaling can be handled at
runtime so we don't need to have two splash screen image variants
anymore.
Also removes the `splash_scale.sh` script used to create the down-scaled
variant.
Always nice to get rid of some binary files from the repository :)
2020-04-15 11:49:25 +02:00
ad3bcee081 UI: Automatically scale splash screen image
Previously, there had to be two splash images to deal with different
DPI settings and hiDPI screens. The larger version was simply downscaled
in an external program for the small one. When up-scaled, the images
would look rather badly.
We now handle scaling completely at runtime. The results should look
pretty much identical for most cases. When up-scaled it should look
better though.
New bundled splash images should have a width of 1000px or more (used to
be 1002px).

More details with screenshots and comparisons in D6999.

Reviewed By: William Reynish, Julian Eisel

Differential Revision: https://developer.blender.org/D6999
2020-04-15 11:49:25 +02:00
Henrik Dick
51e73e9956 Fix crash whith Simple Solidify and Bevel Convex.
After recent changes, simple solidify modifier would crash with Fill Rim
turned off and Bevel Convex emabled.

Also fixes that simple solidify would not set the bevel weight flag so the
next modifier could use the bevel weights.

Simple cleanup with do_rim is also included.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D7428
2020-04-15 11:09:20 +02:00
530008df1d Fix incorrect UI_SEP_CHAR checks
- Menu drawing function used first instance instead of last.
- Menu hash function checked for the character without first
  checking UI_BUT_HAS_SEP_CHAR was enabled.
2020-04-15 17:36:34 +10:00
e17bee5b7f Cleanup: missing-prototypes warning 2020-04-15 17:36:30 +10:00
44b9f6a888 Fix T74881: Plane-track corner drag fails with LMB select
Fix from 8a5a306a83 caused tweaking to fail in the clip editor,
as it wasn't using same convention of other selection operators that
returned the pass-through flag to allow tweaking too.
2020-04-15 15:21:46 +10:00
5e05db3419 Fix shader error sRGB gizmo drawing workaround
Issue in 21c658b718 with function being defined twice.
2020-04-15 14:49:01 +10:00
0d4eefd231 Fix T75712: Sequencer text strip doesn't scale to render size 2020-04-15 14:20:14 +10:00
1bb241437c Fix menu search using exec instead of invoke by default
Caused edit preferences not to open.
2020-04-15 13:36:04 +10:00
92113e2da7 Fix menu search omitting the outliner context menu
Use a regular context menu as a fallback for the outliner.

If there are no specific actions for the item under the cursor,
fall through to opening a regular menu.

This lets menu search find the context menu items which were previously
unavailable as menu search wont run operators.
2020-04-15 13:04:13 +10:00
af91bbc221 UI: expand names of collection menu 2020-04-15 13:04:13 +10:00
e74535df08 Cleanup: shadow warning 2020-04-15 13:04:13 +10:00
04f006ea9e Fix T75733: Curve extrusion does not include endpoints
This error only occurs when the end points are part of
a sequence of selected points.
2020-04-14 17:14:16 -03:00
47f46637be Sculpt: New Layer Brush
The Layer brush was in Blender before 2.81, when the sculpt API was
introduced. It had a huge amount of bugs and glitches which made it
almost unusable for anything but the most trivial cases. Also, it needed
some hacks in the code just to support the persistent base.

The brush was completely rewritten using the Sculpt API. It fulfills the
same use case as the old one, but it has:
- All previous artifacts fixed
- Simpler code
- Persistent base now works with multires thanks to the sculpt API
- Small cursor widget to preview the layer height
- More controllable and smoother strength and deformation
- More correct masking support
- More predictable invert support. When using persistent base, the brush invert mode resets to layer height 0, instead of jumping from +1 to -1. The brush can still be inverted in the brush direction property.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D7147
2020-04-14 21:07:29 +02:00
7dd8c889f1 Sculpt: Sharpen Mesh Filter
This mesh filter sharpens and smooths the mesh based on its curvature,
resulting in pinching hard edges and polishing flat surfaces. It fixes
most of the artifacts of the voxel remesher and those produced when
sculpting hard surfaces and stylized models with creasing and flattening
brushes.

It needs and accumulate_displacement step before each filter iteration which
can't be multithreaded in an easy way (it would need something to sync the
threads when modifying the data of neighbors in a different node), but this
does not affect performance in a significant way.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7335
2020-04-14 21:00:14 +02:00
f881ff129f Fix Shift-Smooth mode using wrong parameters
When using the shift-smooth mode, sculpt_update_cache_invariants is
changing the brush datablock of the paint session if it finds a brush
named "Smooth" (which is a huge hack the brush management project should
try to solve). This is done after the PaintStroke data in the modal
operator is created, which holds a reference to the active brush in the
paint session that was active when the operator started. Because of
this, the StrokeCache was getting the correct smooth brush values but
the paint modal operator was applying the wrong ones from the previous
brush. This was causing the smooth brush behaves unpredictably depending
on the current active brush.

This patch updates the brush in PaintStroke on each modal callback, so
it always gets the values from the current active brush in the Paint
Session.

The way brush switching works and a way to make it more flexible needs
to be discussed in the future as part of the brush management project.

The default smooth brush parameters and curves will probably need to
be updated after this change, as previously they were set using an
incorrect behavior.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D7354
2020-04-14 20:55:38 +02:00
f12589d335 Fix automasking using the wrong active face set
All tools should now use the API function to get the active face set
directly from the face under the cursor.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D7362
2020-04-14 20:53:42 +02:00
bb9a282c7e Fix Randomize Face Sets Colors not working in Multires
The operator was disabled when it was added because Face Sets were not
supported in Multires.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D7312
2020-04-14 20:52:10 +02:00
21c658b718 GPUShader: Implement workaround for gizmo drawing on sRGB framebuffer
This solution involves adding a uniform to each fragment shader that is
used by gizmo drawing and use the framebuffer state to set this uniform
accordingly.

This solution can also be carried to external shaders (addons).
A single line of code would then be enough to fix the issue.

The only trickery here is the dummy define:
`#define srgb_to_framebuffer_space(a)`
This is in order to avoid breaking other DRW shaders that use the same
fragment shader code but do not need the tranformation.

Related to T74139

Reviewed By: brecht, campbellbarton

Differential Revision: https://developer.blender.org/D7261
2020-04-14 20:44:56 +02:00
bf49bb354f Fix T75104: Update Face Sets visibility when entering Sculpt Mode
Geometry that was just added to sculpt mode has the SCULPT_FACE_SET_NONE
assigned, so it was hidden by default. By doing this when entering
sculpt mode a new visible face set is created for it, making it easier
to isolate it again if you want to do further tweaking with the sculpt
tools.

Also, this also fixes the issue that may happen when changing the mesh
visibility in edit mode. Now visibility changes done outside sculpt mode
are stored in the face sets when entering sculpt mode, so mesh
visibility should stay the same.

Reviewed By: jbakker

Maniphest Tasks: T75104

Differential Revision: https://developer.blender.org/D7249
2020-04-14 19:24:44 +02:00
7fbd9b67af Fix Windows build error introduced in Wintab commit revert 2020-04-14 17:14:56 +02:00
e90d8422d0 Revert "Windows: support high resolution tablet pen events for Wintab"
This reverts commit 1a3928f33c and 1a3928f3. This is not working stable
with some Wintab implementations, so reverting for now. This leaves only
the Windows Ink changes for 2.83.
2020-04-14 18:58:37 +02:00
65f674b570 Fix T75535: Compositor backdrop gizmo dragging interrupts with node
mouse over

Caused by rB5929dd7129f6.

Above commit would reset the gizmo highlight on node mouseover.
This would also assert in gizmo_rect_pivot_from_scale_part() and stop
the drag.

So now, only reset the gizmo when we are not in EVT_GIZMO_UPDATE,
allowing for starting the tweak outside a node and then travelling
'inside' while still preventing to use it over a node when starting a
tweak there.

Maniphest Tasks: T75535

Differential Revision: https://developer.blender.org/D7383
2020-04-14 18:32:30 +02:00
dc66fa5c9c Fix T75589: Image Sequences have no data on file load.
Issue was with setting of frame to load from an image sequence,
synchronization was not done properly at some point, leading to
generation of an invalid final filepath to be read.
2020-04-14 18:12:59 +02:00
d4ead6e639 Cleanup: Remove unused defines 2020-04-14 16:17:46 +02:00
00466e756e RNA: Fixed incorrect depsgraph tagging for Object.color and pass_index
These options do not influence the transform, but do (potentiall) influence
the shading.
2020-04-14 16:09:01 +02:00
7bfb7450a2 Fix showing check-boxes in menu-search 2020-04-14 23:50:00 +10:00
de47bf69da Cleanup: remove text editor 'select' option that did nothing 2020-04-14 23:33:57 +10:00
b800a05c55 Revert "Cleanup: remove unused text.selection_set select option"
This reverts commit 9af0cdcd93.

Removed this feature because of confusion
caused by incorrect description.
2020-04-14 23:33:57 +10:00
Vincent Blankfield
50dd876fbf Fix T75629: Disallow dragging collection instance into itself
Differential Revision: https://developer.blender.org/D7408
2020-04-14 15:12:26 +02:00
2ed2dd7b13 GPencil: Add missing 2.82 Random Layer color removed in refactor
Use a single color by object in grease pencil is not practical because is necessary to see all layers.

To tint by layer, the layer tint parameter is used and not the material color as is done in other modes.

This function has been backported from 2.82 because was removed in the 2.83 refactor.
2020-04-14 12:48:11 +02:00
Henrik Dick
cc9bee9162 Add Complex Solidify option for thickness per face
Add an option to solidify complex which will make faces which have thickness
controlled by vertex weights flat/even, and parallel to their original face.

For each face it uses the minimal weight assigned to its vertices to control
the thickness.

This will help users for example in architecture or basic CAD design by finally
making solidify work there at all if altering thickness is needed.

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

Reviewed and minor cleanups by Batien Montagne (@mont29).
2020-04-14 12:36:21 +02:00
Henrik Dick
35b1cc806f Improve Solidify/Bevel Modifier cooperation
Adds a slider to solidify which allows the user to add bevel weight on the outside
or remove bevel weight from the inside.

Also includes a very small improvment for working with subsurface modifier where
the rim edge in complex solidify will now also have a chance to get a crease if
there is only two adjacent edges.

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

Reviewing and minor cleanups: Bastien Montagne (@mont29).
2020-04-14 12:18:22 +02:00
b07e8a24f5 Cleanup: remove unnecessary branch when lib linking constraints
Differential Revision: https://developer.blender.org/D7386

Reviewers: mont29
2020-04-14 11:50:36 +02:00
6e272b9ba4 BLI_math: add min/max utils for chars. 2020-04-14 11:29:46 +02:00
Brecht Van Lommel
47084bac9f Fix T75542: toggling modifier visibility not working correct with undo speedup
The problem was that in direct_link_id_restore_recalc, recalc_undo_accumulated
should contain the changes from the target state to the current state. However
it had already been cleared at that point, to start accumulating changes up to
the next undo push.

Delaying the clear of this flag seems like the obvious solution, but it's hard
to find the right place for that (if there is one). Instead this splits up the
flag into two separate variables.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D7402
2020-04-14 11:07:56 +02:00
e6d9d5dcc1 UI: improve menu search with dimmed menu prefix
- Show dimmed text for the menu entries leading up to the menu item.
- Show icons between the menu text and menu item.
- Use unicode right pointing triangle instead of arrow.
2020-04-14 18:50:28 +10:00
571646ebc1 Cleanup: pass font drawing x/y offset arguments as int's
Internally these values are ints.
2020-04-14 18:41:23 +10:00
3bef5d15d8 UI: add spin to extrude menu
This tool wasn't accessible anywhere in the interface
(besides the interactive tool).

Add to extrude since it's a kind of extrusion.
2020-04-14 18:34:07 +10:00
0fa7e1efbe UI: correct menu used for dope-sheet 2020-04-14 18:30:27 +10:00
b2c2d7b7f1 Sculpt: Implement undo of Apply Base during sculpt session
The idea is to push both base mesh geometry and PBVH coordinates
so it is possible to undo everything without loosing data which was
not flushed from sculpt session to base mesh.

It is possible do memory optimization to avoid push custom data
layers which are not touched by operator, but before doing that
better to ensure this is a correct and working approach.

Differential Revision: https://developer.blender.org/D7381
2020-04-14 09:46:17 +02:00
9e0b44aae9 Cleanup: ed_util_imbuf sections 2020-04-14 10:49:31 +10:00
5f059c8751 Cleanup: spelling 2020-04-14 10:49:31 +10:00
9ce83acba4 Cleanup: remove redundant include, clang-format 2020-04-14 10:49:23 +10:00
ad317a5ffd Fix T75676: Inconsistent "Only selected" GP layers in Dope Sheet
The selection was not checking all modes.
2020-04-13 19:13:04 +02:00
Henrik Dick
5cf7283342 Fix T75032: New complex solidify algorithm handles poorly merging threshold of small geometry details.
* Implemented the algortihm that would merge vertices to the weighted
  center between them.
* Exposed the merge threshold to the user.

The new default tolerance is 0.0001 (versionning code ensures that
previous default value remains in use to avoid any change in existing
files).

Review and minor changes/cleanups from Bastien Montagne (@mont29).
2020-04-13 17:15:16 +02:00
c19f37764d UI: Fix wrong icon used for Unified Color toggle 2020-04-13 15:47:41 +02:00
2e75172c45 Fix T75677: Annotation in compositor/shading tabs loose AA after drawing stroke
The drawing of annotations in 2D was using a very old code created in 2.6x versions. Now it's using a standard shader as it's done while drawing.
2020-04-13 15:15:47 +02:00
2ec6eca518 Cleanup: unused parameter... 2020-04-13 10:07:12 +02:00
e63d5f40ee Fix T75667: Use of incorrect terminology in the brush_colors_flip operator
- The word 'Flip' is incorrect. 'Swap' or 'Switch' is correct.
  - In Blender, we use 'primary' & 'secondary' color swatches, not 'foreground' and 'background'
2020-04-13 07:49:21 +02:00
71a333f56e Fix T75592: Correctly calculate length of curve verts
Previous commit to fix T75405 needed a small change to increase the
length of the front section of the curve when only the front is built.
2020-04-12 18:17:59 -05:00
68ba6378b5 VSE: Add sample tool
This tool is set as default tool, so default action on click doesn't have pernament effect.

Reviewed By: campbellbarton

Differential Revision: D7064
2020-04-13 00:28:27 +02:00
c456671b53 Refactor sample operator
Move sample operator functions to `ed_util_imbuf.c` and change common functions,
so they can be used in image editor and sequencer.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D7315
2020-04-12 23:56:03 +02:00
0c9e47705d Fix T75421: Wipe clock and Iris transition not working.
Use enum items in RNA enum definition instead of hard-coded values.

Broken by 5dcb6fb22f Cleanup: unused enums

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7342
2020-04-12 23:00:55 +02:00
bbf1c83370 Fix T74875: Preview shows previously cached frame after Hard Cut
Add method to invalidate strip cache in range of non-overlapping strip.
Invalidate original strip in range of new strip created by cutting.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7313
2020-04-12 22:42:31 +02:00
5081556bb5 Fix T75415: Changing text strip "start" leads to flickering image
Cache must be invalidated before and after transformation,
so all frames are properly invalidated.

This also fixes wrong invalidated type, composite is enough here.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7341
2020-04-12 22:27:28 +02:00
5cabf1301a Fix T75382: VSE Strip Adjustments Not Immediately Visible
Cache of effects wasn't invalidated on correct level.

Add invalidation "rule" for invalidating downstream effects.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7343
2020-04-12 22:24:20 +02:00
Richard Antalik
77ca5ab6b0 Fix T74897: VSE animation doesn't work
`seq_free_animdata()` removes fcurve pointers belonging to strips from
`Scene` CoW datablock's `AnimData` during `BKE_scene_graph_update_for_newframe`.
This causes problems with updating animation.

This worked before rBbe2e41c397ba, because `AnimData` was freed by `BKE_animdata_free()`
before `seq_free_animdata()` was executed, so it had no data to operate on and returned
on precondition `if (scene->adt == NULL || scene->adt->action == NULL)`

Reviewed By: mont29, brecht

Maniphest Tasks: T74897

Differential Revision: https://developer.blender.org/D7264
2020-04-12 22:10:13 +02:00
5b79e0b80e Fix volume object not rendering correct frame right after loading 2020-04-12 15:44:28 +02:00
e2003d9212 UI: reorder adaptive sampling settings in order of importance 2020-04-12 15:44:28 +02:00
f16fcb5bd5 Fix volume object not loading frame sequences correct in some cases
Ensure we use the first frame as filepath so we can compute the number of
leading zeros. For file validation, always test the first frame rather than
the current scene frame.
2020-04-12 14:48:23 +02:00
0a747cd4e3 Cleanup: clang-format 2020-04-11 13:01:19 -06:00
aeb42cf8ab Cycles/Optix: Support building the optix kernels on demand.
CMake: `WITH_CYCLES_DEVICE_OPTIX` did not respect `WITH_CYCLES_CUDA_BINARIES` causing the optix kernel to be always build at build time.

Code: `device_optix.cpp` did not count on the optix kernel not existing in the default location.

For this to work, one should have before starting blender

1) working nvcc environment
2) Optix SDK installed and the OPTIX_ROOT_DIR environment variable pointing to it which is not set by default

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

Reviewed By: Brecht
2020-04-11 12:59:21 -06:00
ddfec08514 GPencil: Fix unreported missing update after removing stroke from python 2020-04-11 19:04:05 +02:00
85de07e64c Sanitize and cleanup a bit depsgraph relations building in some modifiers.
This commit mainly:
* Removes some uneeded dependencies to geometry of other objects (since
  we only use positions of those objects...).
* Ensures `DEG_add_modifier_to_transform_relation` is only called once
  per modifier (in one case at least it could be called twice).
* For modifiers using texture mask, only add dependencies to object used
  to generate texture coordinates when there is actually a texture set.

No behavior change expected from this commit...
2020-04-11 17:16:58 +02:00
5cc7036aa3 Factorize some common modifiers depsgraph relation update code.
Add a utility to deal with common 'object or posebone transform' case.
2020-04-11 17:16:58 +02:00
b0350d8310 Revert "GPUViewport: Use GPUBatch for viewport drawing"
This reverts commit 862ec82942. It causes crashes
on some systems, see T75584.
2020-04-11 16:42:01 +02:00
a8d139ca20 Fix for T75595: File Browser and Windows Unicode Paths
Fix for incorrect conversion to utf16 in BLI_file_attributes().

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

Reviewed by Brecht Van Lommel
2020-04-10 14:07:15 -07:00
Cody Winchester
4f9a56cbc4 Modifiers: Add Bone option for Texture Mask Object
This patch adds the option to use an armature bone in place of an object for texture mask coordinates.

This affects the 3 vertex weight modifiers, the displace modifier, the warp modifier, and the wave modifier.

With minor changes from Bastien Montagne (@mont29).

Differential Revision: https://developer.blender.org/D7348
2020-04-10 21:28:59 +02:00
d6cefef98f UI: Better support for linked data-blocks in search buttons
In RNA pointer search buttons (i.e. the ones with an eyedropper),
data-blocks were handled badly. It was not possible to select a linked
data-block that had the same name as a local one, which is especially
common with library overrides. Neither was there a hint to tell appart
linked data-blocks and which .blend file they come from.
These issues are addressed now, we show an "L" prefix and the .blend
file name in the search box (like in ID-templates).

Changes here are quite simple, since the heavy lifting was already done
through c20c203b82.

Addresses T73156.
2020-04-10 20:25:17 +02:00
d216a0b505 Fix T75489: Crash on deleting current workspace from the outliner
It should not be possible to delete the current workspace from the
outliner. Show an error message instead.
2020-04-10 17:30:43 +02:00
475d7d073a Fix T74800 Bevel modifier generates vertex group weight > 1.0.
Due to floating point approximations, the weights for interpolating
the mdeformvert layer could add up to a tiny bit more than 1.0.
This was not a problem in practice, but the mesh validation routine
used in regression tests was testing for this and therefore failing.
Just changed interpolation of mdeformverts to clamp max to 1.0f.
2020-04-10 11:03:27 -04:00
ab8e7ffc64 Fix T75378: Crash on clicking in the ghost icon of an appended proxy object 2020-04-10 11:21:55 -03:00
9a7f5f1bb4 Fix T67232: Multiples targetless IKs in a chain gives weird behaviour (known as FakeIK for FK posing)
The issue was that the deps graph relation builder assumed that all
bones that had a IK constraint on them would be evaluated.  However for
targetless IK bones, only the active bone would receive updates and the
others would be skipped (as those would be treated as if the IK
constraint was disabled).

I didn't see an easy way to solve this from the depsgraph side of
things.

Instead I came up with a solution that I feel is quite strait forward
and reflects what is actually supposed to happen under the hood.

Now all targetless IK constraints are treated as disabled and will not
be added to any relations in the depsgraph.

Instead, a temporary IK constraint will be created when the bone in
question is transformed.  This is basically activating "Auto IK" for the
bone while transforming.

Reviewed By: Sergey, Brecht

Differential Revision: http://developer.blender.org/D7378
2020-04-10 14:01:02 +02:00
9c5b054206 Fix T71546: VSE stereoscopic strips issues with mismatched dimensions
The issue is that the cachiing was adding the right view without the
proper pre-processed buffer.

D7389
2020-04-10 12:44:59 +02:00
0b86943641 Fix T74901: Smoke Simulation crashes on eevee and is not persistent on Cycles
Issue was introduced in 5260aaf3b1 (fix for T73921).
2020-04-10 12:10:23 +02:00
03dda57678 Fix T75141: Default template versioning error for grease pencil
The versioning was done only for template because the code was after a return and never was executed for default scene.
2020-04-10 10:54:46 +02:00
da48a8ef50 Fix T74815: Shapekeys animation is blocked after second append of the same object.
Logic to handle shepkeys datablocks in helper in 'make local' code that
checks which ID should be copied, and which can be directly made local,
was wrong.
2020-04-10 10:52:18 +02:00
d3cda49d14 Fix T74657: Grease Pencil Proportional Editing does not work for
'Individual Origins'

Note gpencil doesnt do anything fancy like meshes in
editmesh_islands_info_calc(), but it looks like there is actually no
harm in allowing proportional editing with individual origins & gpencil
editmode.

Maniphest Tasks: T74657

Differential Revision: https://developer.blender.org/D7351
2020-04-10 08:38:34 +02:00
337a7ed292 Pointclouds: fix point drawing
The radius component is only one float. This resulted in only a third of
intended points to draw and could lead to glitches.

Pointcloud drawing will still change a lot in the future, this is just
to be able to work on some simple tools.

Differential Revision: https://developer.blender.org/D7390
2020-04-10 08:34:07 +02:00
Nicholas Rishel
1a3928f33c Fix T75546: Solve possible endless loop in wintab initialisation
Some Wintab drivers report a zero length queue, this causes an unplanned never ending loop.

Differential Revision: https://developer.blender.org/D7392
Reviewed by: Ray Molenkamp
2020-04-09 16:43:09 -06:00
5ebbd8f672 Cleanup: comment bone cycling & simplify logic 2020-04-10 08:35:55 +10:00
d85e2beb67 Fix T75526: Color Management Look saved in 2.82a resets in 2.83
Missing versioning after `rB9f4b090eec39`.

Differential Revision: https://developer.blender.org/D7388
2020-04-09 17:56:36 -03:00
d7273f087d Fix T75405: Crash when increasing text object bevel depth
One fewer coordinate needs to be calculated when extrusion is zero to
avoid corrupting the end of the memory chunk.

Differential Revision: https://developer.blender.org/D7368
2020-04-09 15:29:49 -05:00
Bartosz Moniewski
054950def9 Shading: add Roughness input to Noise and Wave texture nodes
Currently in fractal_noise functions, each subsequent octave doubles the
frequency and reduces the amplitude by half. This patch introduces Roughness
input to Noise and Wave nodes. This multiplier determines how quickly the
amplitudes of the subsequent octaves decrease.

Value of 0.5 will be the default, generating identical noise we had before.
Values above 0.5 will increase influence of each octave resulting in more
"rough" noise, most interesting pattern changes happen there. Values below
0.5 will result in more "smooth" noise.

Differential Revision: https://developer.blender.org/D7065
2020-04-09 21:48:03 +02:00
Szymon Ulatowski
f3433fcd3b Collections: preserve exclude flag of child collections when unexcluding
Excluding a collection also changes the exclude setting on all child collections
so that it is possible to selectively enable some children without the parent
being enabled.

This change makes it so that if you unexclude the parent, the exclude setting
of children are restored again instead of being permanently lost.

Original patch by Szymon with modifications by Brecht.

Differential Revision: https://developer.blender.org/D7016
2020-04-09 21:46:22 +02:00
07bb7206c2 Cleanup: VSE rename i to view_id for stereo 3d code 2020-04-09 21:01:49 +02:00
78f56d5582 TaskScheduler: Minor Preparations for TBB
Tasks: move priority from task to task pool {rBf7c18df4f599fe39ffc914e645e504fcdbee8636}
Tasks: split task.c into task_pool.cc and task_iterator.c {rB4ada1d267749931ca934a74b14a82479bcaa92e0}

Differential Revision: https://developer.blender.org/D7385
2020-04-09 19:18:14 +02:00
Jeroen Bakker
862ec82942 GPUViewport: Use GPUBatch for viewport drawing
When drawing the viewport to the screen the draw calls were not batched.
This resulted in measurable slowdown on Windows Intel 10th gen
platforms.

This patch would cache the last draw calls per viewport. Our API does
support partial redrawing of the viewport, but that isn't used anywhere.

This patch does not include stereoscopy rendering. This still uses the
imm approach and would still be slow on certain hardware.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D7357
2020-04-09 19:12:51 +02:00
bf68e1a547 Cleanup: Remove unused var
This was not removed in previous fix.
2020-04-09 16:25:46 +02:00
464752876f Fix T75490: Child Of - difference between 2.82 and 2.83
rB10162d68e385 introduced a difference in computing the matrix, as well
as a better way to compute the inverse matrix. This commit reverts the
former, while keeping the latter and some other improvements.
2020-04-09 15:04:48 +02:00
a7df9d6cdd Fix menu search referencing image menu
In this case it was called mask which wasn't correct since it's
used for image & UV's, so rename the menu instead.
2020-04-09 22:55:47 +10:00
98abcfdb9d Cleanup: unused variable 2020-04-09 22:55:36 +10:00
a6d8f6c0f3 Fluid: Fix unused variables
Unsed variables for fluid caching.
2020-04-09 12:35:22 +02:00
a8bd385a5d Fix T75491: ctest: usd_test fails in a debug configuration
There was a bug in the `connect_loose_objects()` function, which caused
some objects to be exported twice (once for real, and once
transform-only). This is now resolved.
2020-04-09 12:18:45 +02:00
17da3b5d82 USD: ensure test does not depend on BLI_assert()
The test failure in T75491 only showed up in debug builds because
`BLI_assert()` is a no-op in release builds. This is now replaced by a
proper GTests call to `ADD_FAILURE()`, ensuring that the test fails
regardless of build mode.
2020-04-09 12:14:51 +02:00
80255e67e3 Silence assert on ID usercount for deprecated IPO.
We do not really care about those, so just avoid the noise when loading
very old files...

Re T75389.
2020-04-09 11:21:02 +02:00
36746474fd Tracking: Forward compatibility code for distortion models
Allows to open newer files in older Blender after new distortion model
has been added.

It will behave as if this is a polynomial model with all 0 coefficients
which are then being refined and assigned explicitly after solving the
motion.
2020-04-09 10:59:31 +02:00
b5e277ed05 Cleanup: Fix typo error 2020-04-09 10:58:42 +02:00
ee5cec4a50 Fix T75122: Annotations: Only visible scene annotations in dopesheet
The loop of datablocks was using the scene datablock (3D View) only, but all others datablocks were ignored.

Now the loop consider any annotation datablock.
2020-04-09 10:56:59 +02:00
bd59781c66 Fix T75425: Bone selection cycling not working
Edit-mode bone selection now cycles on successive clicks.
This now cycles through multiple edit-objects & bones.
2020-04-09 18:46:47 +10:00
19352bca16 Cleanup: spelling 2020-04-05 22:22:21 +10:00
7df787b2c1 UI: English as Default Language
Set language setting for new profiles to English.

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

Reviewed by Brecht Van Lommel
2020-04-08 16:10:48 -07:00
1239cab11f Fix T75203: Crash when changing active keying set
When updating the active button, the search data wasn't updated, so it
kept using the old pointers. A check in `ui_rna_collection_search_cb()`
relied on this incorrect behavior so I had to fix that too. Note that
the previous commit was also needed for the second fix to work.

Caused by c46dcdf887.
2020-04-08 23:23:44 +02:00
74fa8787d8 Fix error in UI_butstore_ API
If the `uiButStore` data was freed after the buttons/blocks were updated
from previous instances (see `UI_block_update_from_old()`), e.g. by
delaying that to the "afterfuncs" (`ui_apply_but_funcs_after()`), the
data would get lost. As result, the button pointers that the API is
supposed to keep valid would point to freed memory.

This wasn't an issue so far since the API didn't happen to be used this
way. That changes with the next commit.
2020-04-08 23:22:33 +02:00
c13aa95eda Fix T75288: crash in Cycles image loading with multithreaded shader compilation 2020-04-08 22:01:04 +02:00
cc53c9e476 Fix T75290: Cycles crash with out of bounds memory access in volume mesh build 2020-04-08 21:58:17 +02:00
8360bfb75c Cleanup: clang-format 2020-04-08 21:58:17 +02:00
f405934fe3 Fix T75445: Filmic transform not working when using Turkish locale
This is a bug in OpenColorIO that we work around (see "Turkish I" problem),
a proper fix will be submitted upstream.
2020-04-08 20:50:50 +02:00
d41d4d0593 GPencil: Small changes to brush defaults 2020-04-08 19:03:17 +02:00
4a6f715421 Fix T73552: Mantaflow - liquid particles show up in organized unrealistic structure
Issue was being caused by a particle offset which was random but the same for every particle.
2020-04-08 18:29:26 +02:00
2328599e97 NewUndo: Fix (studio-reported) discrepency in proxies when undoing.
Took me an unreasonable amount of time to understand what was happening
here... Our beloved proxies, as usual, need some specific careful
handling.
2020-04-08 17:43:40 +02:00
b0f229dd27 Tracking: Fix missing distortion update on focal length change 2020-04-08 17:19:21 +02:00
020d1e23ae Fluid: Fix issue with mesh not being loaded
Fixed an issue that was likely introduced in a past cleanup.
2020-04-08 16:26:20 +02:00
34b28850bf Fix wrong material indicated in the error message when baking
The material displayed in the error message due to the lack of active
texture was that of the previous slot.
2020-04-08 09:44:43 -03:00
91d7f5d246 Fix T74572: adaptive sampling still not working correct with shader AOVs 2020-04-08 14:09:10 +02:00
fd487b1f4e Fix build error with WITH_X11_XINPUT=OFF after recent changes 2020-04-08 14:03:54 +02:00
ff2c67d7e8 Fluid: Disable subframes when using adaptive time-steps in the first frame
First frame should only produce inflow once and not compute the emission for the frame before the first frame. Problem became evident in T74062.
2020-04-08 13:42:40 +02:00
c2cb87f897 Fluid: Fix problem with inconsistent noise when using multiple adaptive time-steps
Problem was mentioned in T74062.
2020-04-08 13:27:12 +02:00
a1ddb63329 Fluid: Update Mantaflow source files
Update includes new grid helper functions and some cleanups.
2020-04-08 13:25:16 +02:00
7cafdc57e0 Fluid: Manta clang-format update
Do not use sort-includes in Manta source files for now when applying clang-format. Too many conflicts.
2020-04-08 13:20:18 +02:00
ea5a2efb57 Fix manual reference error after removal of use_international_fonts 2020-04-08 12:43:49 +02:00
Nicholas Rishel
ea3e0b3e8c Windows: support high resolution tablet pen events for Wintab
Together with Windows Ink support, this should fully resolve T70765.

Differential Revision: https://developer.blender.org/D6675
2020-04-08 12:25:40 +02:00
Nicholas Rishel
d571d615a5 Windows: support high resolution tablet pen events for Windows Ink
Rather than using the last state of the tablet, we now query the history of
pointer events so strokes can follow the pen even if Blender does not handle
events at the same rate.

Differential Revision: https://developer.blender.org/D6675
2020-04-08 12:25:40 +02:00
Nicholas Rishel
3d8c57f4da Cleanup: minor refactoring of pointer event handling
Ref D6675
2020-04-08 12:25:40 +02:00
Nicholas Rishel
4e4bf241c8 Cleanup: add utility functions for milliseconds conversion
Ref D6675
2020-04-08 12:25:40 +02:00
c43473e884 Cleanup: remove GHOST API to query tablet state from Window
It's not used by Blender anymore and it's unreliable since this state really
only makes sense associated with events in a particular order.

Ref D6675
2020-04-08 12:25:40 +02:00
Miguel Pozo
d478cc71dd Fix Windows Tablet API preference not being used
It was sometimes set before reading preferences, now it's passed to GHOST every
time preferences are read.

Differential Revision: https://developer.blender.org/D5641
2020-04-08 12:25:40 +02:00
a3c1605581 Cleanup: rename to BLI_path_cwd to BLI_path_abs_from_cwd
This is now more clearly a function that makes the path absolute
using the current working directory.
2020-04-08 16:46:16 +10:00
57468ae37e Cleanup: missed renaming BLI_cleanup_unc_16 in recent refactor
Missed from d14e768069
2020-04-08 16:29:46 +10:00
b0d565e5b6 Cleanup: reduce scope of variables in custom data copying 2020-04-08 16:27:59 +10:00
35861a49ee Fix T67098: Inset causes shape keys to reset exiting edit-mode
Edit-mesh interactive redo reset the meshes shape-key index.

Also copy the selection mode when copying meshes.
2020-04-08 16:26:54 +10:00
bd45ec0b06 Cleanup: disable clang-format for character table 2020-04-08 13:29:51 +10:00
1c58311440 Fix status bar message showing saved when saving failed
Resolves the following issues:

- For the first time you save a .blend file, there was no feedback.
- If the file fails to save (eg "No space left on device") the status
  bar message replaces the error with an invalid "Saved" message.

  While there is a popup, the user may cancel it with mouse motion
  and be left with the status bar message saying the file saved.

D7371 by @XDroid with edits.
2020-04-08 13:22:00 +10:00
056ebb56b1 Cleanup: clang-format 2020-04-08 10:34:39 +10:00
1ec2f8d1f2 Cleanup: spelling 2020-04-08 10:33:56 +10:00
161c13e12b Fix building without translations enabled 2020-04-08 10:24:33 +10:00
1ee3def5d3 UI: Splash Screen Language Selection
Quick Setup splash now includes language selection.

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

Reviewed by Brecht Van Lommel
2020-04-07 16:33:52 -07:00
9d0f452076 Fix missed depsgraph update after undo in some cases
Forgot to take into account legacy DEG_id_tag_update with zero flag.
2020-04-07 23:56:07 +02:00
a2243f1b51 Debugging: change Undo/Redo redraw timer to include dependency graph update
This is often the slowest part and was not counted before.
2020-04-07 23:43:55 +02:00
968619d036 UI: Language Selection Changes
Removal of 'Translation' checkbox. Enable translation options when selecting non-English languages.

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

Reviewed by Brecht Van Lommel
2020-04-07 13:25:49 -07:00
53981c7fb6 Cleanup: refactor adaptive sampling to more easily change some parameters
No functional changes yet, this is work towards making CPU and GPU results
match more closely.
2020-04-07 20:29:48 +02:00
7b4b07a7dd GPencil: Fix unreported problems with Chisel brush
With the new sampling, the arc points were not using the angle of the brush and the line was with the same thickness in all orientations.
2020-04-07 20:07:58 +02:00
6b58571813 UI: Don't collapse all panels for subpanels
The behavior for subpanels was incorrect, and the ideal behavior isn't even clear.

This disables the "collapse all" ctrl click feature for panels that have parents.

Differential Revision: https://developer.blender.org/D7355
2020-04-07 11:51:08 -05:00
c5ed2eb95e Undo: change depsgraph recalc flags handling to improve performance
These changes only have an effect when the experimental Undo Speedup preference
is enabled.

* For DEG_id_tag_update, accumulate recalc flags immediately before the undo
  push happens instead of afterwards. Otherwise the undo state does not
  contain enough flags, and the current state may contain too many flags.

  This also means we call DEG_id_tag_update after undo with the accumulated
  flags to ensure they are flushed to other datablocks.

* For undo, accumulate recalc flags in id->recalc and clear accumulated flags
  immediately. Not clearing would cause circular behavior where accumulated
  flags may never end up being cleared.

  This matches what happens after an undo push where these are also cleared,
  indicating that the undo state and current in-memory state match exactly.

* Don't change id->recalc of identical datablocks, it should not be needed.
  There is one exception for armatures where pointers across datablocks
  exist which otherwise would cause problems. There may be a better solution
  to this but it seems to work in agent 327 production files.

* This contains a change in undofile.c to avoid detecting all datablocks as
  changed for the first of the two undo steps, where we restore to the state
  of the last undo push before going to the one before.

  Without this the whole system is much less efficient. However this is unsafe
  in the sense that if an app handler or operators edits a datablock after an
  undo push, that change will not be undone.

  It can be argued that this is acceptable behavior, since a following undo push
  will include that change and this may already have unexpected side effects.

Ref T60695

Differential Revision: https://developer.blender.org/D7339
2020-04-07 17:14:19 +02:00
02598e629e Fix T73566: Mesh analysis, error showing intersecting faces 2020-04-08 00:43:47 +10:00
3a5c16f1c9 Fix T74720: bmesh.ops.delete default context argument does nothing 2020-04-07 23:23:17 +10:00
1de5cb6a31 Cleanup: use doxy sections 2020-04-07 23:23:17 +10:00
3a65397473 Fix T75471: Outliner: crash selecting modifier objects/targets that are in a excluded collection
There is no garuantee 'outliner_find_id()' can find those corresponding
TreeElements, safeguard against failure now.

note: not sure why this was no problem in Release builds? (could only
reproduce crashes in Debug builds...)

Maniphest Tasks: T75471

Differential Revision: https://developer.blender.org/D7365
2020-04-07 15:08:50 +02:00
5e0465e4ec Fix T75343: Wireframe overylay is not working properly with multiple modifiers
Since rBcf258b02f449, only wires and edges that are mapped to the
original mesh were drawn if the mesh was modified by modifiers.
Above commit was only meant for showing orig wires for paint mask
overlays [where final wireframe is not desired], so now only use
MR_EXTRACT_MAPPED when we are in a paint mode.

Maniphest Tasks: T75343

Differential Revision: https://developer.blender.org/D7333
2020-04-07 14:47:06 +02:00
4a83832120 Fix T74828: Fluid: Crash with Fire/Smoke Noise
Issue was that the noise simulation was trying to bake with a minimized domain size (adaptive domain initializes domain with size (1,1,1)). Similarly to the base resolution bake, there should be no noise baking happening at those domain sizes - a domain at this size is considered empty.
2020-04-07 14:31:33 +02:00
ea78f9922e Fluid: Fixed assertion error
Fix for new assertion statements that were introduced in bfdc42d990.
2020-04-07 14:31:33 +02:00
5892622d68 Revert "Fix memory leak in recent panel drag widget cache"
This reverts commit 58e20b432a.

Was calling discard twice, tsk.
Although for some reason it did quiet the leak.

Reverting because this is causing a crash.
2020-04-07 22:09:37 +10:00
ee43cf5722 Fix T66751: Symmetrizing armature does not symmetrize constraints.
The symmetrize operator now tries to make sure that the armature
constraints are correctly mirrored.

Before it would only mirror the subtargets for the constraints (and that
failed too in some cases).

Reviewed By: Sybren

Differential Revision: http://developer.blender.org/D6009
2020-04-07 13:54:22 +02:00
6feeede47f Fix Blender not rebuilding when changing linker script 2020-04-07 13:44:18 +02:00
58e20b432a Fix memory leak in recent panel drag widget cache
Memory leak from 60d873bd22.
2020-04-07 21:34:25 +10:00
aaaa0a43af Build: use -no-pie for portable builds on Linux
Otherwise file browsers do not recognize the Blender executable. This is
already done for official releases.

We leave it off for non-portable builds, since that's how Linux distribution
packages will typically build Blender and we can continue to follow the OS
default there. Using a file browser to launch executables from e.g. /usr/bin
would be rare as wel.

Differential Revision: https://developer.blender.org/D7363
2020-04-07 13:32:42 +02:00
e953ada0bb Cleanup: avoid memory allocation for unchanged datablocks in undo
Differential Revision: https://developer.blender.org/D7336
2020-04-07 13:19:52 +02:00
c786f95871 Cleanup: split partial undo code off into functions, tweak debug prints
Differential Revision: https://developer.blender.org/D7331
2020-04-07 13:19:52 +02:00
7bc99fdb32 Cleanup: simplify logic for partial undo in ID read
Differential Revision: https://developer.blender.org/D7330
2020-04-07 13:19:52 +02:00
826e4ba99c Cleanup: skip reading UI datablocks entirely for undo
Other types of datablocks pointing to UI datablocks is unsupported, so
there is no need to store them in fd->libmap. With the experimental undo
speedup enabled preserving such pointers was done. But it didn't work in
2.82 and such pointers are easily lost in cases other than undo.

Differential Revision: https://developer.blender.org/D7329
2020-04-07 13:19:52 +02:00
d2a07c7b78 Cleanup: delay creating datamap until it's actually needed
Differential Revision: https://developer.blender.org/D7328
2020-04-07 13:19:52 +02:00
44e5f7a8cf Cleanup: don't use global variable for test if IDs are identical
Differential Revision: https://developer.blender.org/D7327
2020-04-07 13:19:52 +02:00
c75aaf5329 Cleanup: split off library and linked datablock undo restore
Differential Revision: https://developer.blender.org/D7326
2020-04-07 13:19:52 +02:00
624b231ec4 Cleanup: early out on invalid ID data to simplify control flow
Differential Revision: https://developer.blender.org/D7325
2020-04-07 13:19:52 +02:00
0aac74f18f Cleanup: split off direct_link_id() function
Differential Revision: https://developer.blender.org/D7324
2020-04-07 13:19:52 +02:00
c4def7992b Fix T73598: Pose options - Auto IK. Bones move on release
The issue was that the code tried to use the bones transformation matrix
as a rotation matrix. This works fine as long as the scale is 1.

Now we simply make sure that we only get a pure rotation matrix when
extracting it for the bone's transformation matrix.
2020-04-07 13:15:43 +02:00
9fca9b9953 Fix crash using object.to_mesh() when in edit mode
The root of the issue was caused by mesh which was a result of to_mesh()
had the same edit_mesh pointer as the input object, causing double-free
error.

This fix makes it so result mesh does not have edit mesh pointer.
Motivation part behind this is to make the result of to_mesh() to be
somewhat independent from the input.

Differential Revision: https://developer.blender.org/D7361
2020-04-07 12:50:45 +02:00
49deda4ca2 GPUBatch: Correctly Free Panel Widget Batch
The GPU Batch for the panel drag widget wasn't freed anywhere. This
patch will free the GPUBatch.
2020-04-07 10:46:44 +02:00
cdbb61704d Fix T75128: Select Linked fails when the selection is a delimiter
Starting select linked failed when the selected vertex or edge
was it's self delimiting.

Support using these elements for linked select
as long as they're part of an isolated selection.
2020-04-07 17:43:27 +10:00
ffe599b4bd Fix T68159: Normals point target crashes when exiting edit-mode
When the modal operator passes events, free the internal state of
the operator as we can't be sure those events don't cause the mesh data
to be re-allocated or removed.

Longer term it might be best to make this into a tool since
the main purpose of this operator is to run other actions.
2020-04-07 16:28:29 +10:00
284d28acbc Cleanup: remove unused BM_total_loop_select function 2020-04-07 15:32:09 +10:00
17193f6c76 UI: rename 'smoothen' to 'smooth'
Other smooth operators use term 'smooth'.
2020-04-07 15:12:18 +10:00
a1eb5ec81c Cleanup: doxy sections, move utility function to editmesh_utils.c 2020-04-07 14:46:13 +10:00
7c4391e6aa Fix T60069: repeated extrusion uses wrong axis 2020-04-07 13:42:50 +10:00
d14e768069 Cleanup: BLI_path.h function renaming
Use BLI_path_ prefix, more consistent names:

  BLI_parent_dir              -> BLI_path_parent_dir
  BLI_parent_dir_until_exists -> BLI_path_parent_dir_until_exists
  BLI_ensure_filename         -> BLI_path_filename_ensure
  BLI_first_slash             -> BLI_path_slash_find
  BLI_last_slash              -> BLI_path_slash_rfind
  BLI_add_slash               -> BLI_path_slash_ensure
  BLI_del_slash               -> BLI_path_slash_rstrip
  BLI_path_native_slash       -> BLI_path_slash_native

Rename 'cleanup' to 'normalize', similar to Python's `os.path.normpath`.

  BLI_cleanup_path  -> BLI_path_normalize
  BLI_cleanup_dir   -> BLI_path_normalize_dir
  BLI_cleanup_unc   -> BLI_path_normalize_unc
  BLI_cleanup_unc16 -> BLI_path_normalize_unc16

Clarify naming for extracting, creating numbered paths:

  BLI_stringenc -> BLI_path_sequence_encode
  BLI_stringdec -> BLI_path_sequence_decode

Part of T74506 proposal.
2020-04-07 12:10:36 +10:00
d54757e389 Cleanup: clang-format 2020-04-07 11:57:36 +10:00
4e7c65035b UI: Use Consitent Menu Layout for Bone Names 2020-04-06 21:45:41 -04:00
e9b4d2ca68 UI: Use Consistent Operator Name
Was called "Subdivide Multi" in Bone Edit and "Subdivide" in Mesh Edit
2020-04-06 21:05:53 -04:00
10f0e003a9 Fix T74572: adaptive sampling not scaling AOVs correctly 2020-04-06 23:23:48 +02:00
e05552f7c4 Revert "Fix T74572: adaptive sampling not scaling render passes correctly"
This reverts commit 82a8da0ec3. It was completely
wrong. Fixes T75388.
2020-04-06 23:23:48 +02:00
29b87b5615 Fix T75357: USD export broken on windows
Path to the jsons was wrong so they were not copied
2020-04-06 14:38:52 -06:00
71a52bbe2a Fluid: Ensure correct velocities for noise bake
Make sure that noise uses the unaltered velocity grid. This is particularly important once external velocities get added to the velocity grid.
2020-04-06 17:48:32 +02:00
60d873bd22 GPU: Panel Drag Widget Drawing Performance
The 10g Intel/Win driver doesn't work well with our emulated
intermediate mode. This patch alters the drawing of the drag widget of
the panels to reduce unneeded drawing.

The previous method would draw 16 boxes per widget. This new way would
cache this drawing in a GPU batch and just move the matrix around.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D7345
2020-04-06 16:51:48 +02:00
71b1ee940b Don't take into account time remapping when scrubbing with AV sync.
It would cause the playhead to be remapped to an other frame than the
one you clicked on.
2020-04-06 16:34:15 +02:00
Maxim Vasiliev
c544df997e Fix user counting when ungrouping a node group.
Existing code for ungrouping did not correctly handle user counters:

- counter for the group was not decremented
- counters for containing nodes were not incremented

The latter resulted in losing some nodes after orphan cleaning or several save/reload cycles.

The bug did not have destructive consequences until recently,
because it was compensated by another bug (fixed in rBe993667a46c2).

Maniphest Tasks: T74665, T74682

Differential Revision: https://developer.blender.org/D7332
2020-04-06 16:27:52 +02:00
Roman Kornev
95f51bb01d Keymap: sort exported key-maps
This makes the resulting key-maps easier to compare.
2020-04-06 23:37:54 +10:00
3d439aa29b Cleanup: keep parameter docs above the function body 2020-04-06 23:22:11 +10:00
5dde5dd44e Libmv: Use static scheduler for threading
For a real-world distortion the payload is quite uniformly
distributed across scanlines. Surely, in the corners more
iterations of minimizer is needed, but that happens in threads
without scheduling overhead.
2020-04-06 15:18:32 +02:00
7e93d4eea3 Tracking: Fix (un)distortion happen in single thread
Need to communicate available number of threads to the camera
intrinsics implementation, otherwise default value of 1 is used.

Must have been single-threaded for a very long time.
2020-04-06 15:18:32 +02:00
2903fb6929 Fix T75444: typo in tooltip 2020-04-06 15:13:16 +02:00
9ddbb03861 Fix T74111: Animation Playback Delayed With Time Remapping And AV-Sync
When setting the current playback time in BKE_sound_play_scene we didn't
account for the frame length. So the current frame/time would be wrong
when we asked the audio playback what time it was.

This would lead to playback being offset when using time remapping and
AV sync.

Reviewed By: Richard Antalik and Sybren A. Stüvel

Differential Revision: http://developer.blender.org/D7248
2020-04-06 13:57:03 +02:00
ded7af53b4 Fix T74889 Baking to current action doesn't work properly
Before this commit, baking an action would only insert keys that are
necessary (i.e. using `INSERTKEY_NEEDED`). When baking to the current
Action, if there are no constraints that influence the final animation,
there are no additional keys necessary. This makes it appear as if
nothing happened. However, when baking to a new Action every additional
frame is necessary and thus a key is added for every frame.

@mont29 and I agreed that this behaviour is confusing, so this commit
changes the behaviour such that baking to the current action and to a
new action result in the same baked animation (that is, keyed on every
frame).
2020-04-06 13:39:46 +02:00
c03e5e7830 Fix T75418: Outliner Blender File view has UNKNOWN category for armatures
Typo in rB57daecc2cf88.

Maniphest Tasks: T75418

Differential Revision: https://developer.blender.org/D7346
2020-04-06 13:27:23 +02:00
cc0819aee1 Fix (unreported) wrong hair vertex colors
This was already fixed in rB985f33719ce9 once.
But resurfaced after rB7070e4c15e6c [which just reverted a bit too much
;)].

Spotted while looking into T75263.

Differential Revision: https://developer.blender.org/D7308
2020-04-06 12:19:02 +02:00
ccaf6c7404 Tracking: Fix slow undistored display
TH distortion model was not cached properly, making it so frame is
undistorted on every redraw.
2020-04-06 12:16:28 +02:00
5d3c7d1218 usual PY API doc gen fix after adding a new member to Context... 2020-04-06 12:16:07 +02:00
f9c05f3fc0 Fix f-curve sequencer versioning logic
Screen loop was inside an existing screen loop,
in the body of a function used to initialize the toolbar region.
2020-04-06 20:07:05 +10:00
2fc30978bc Fix T75297: Apply base inflates meshes with Simple subdivision 2020-04-06 11:47:17 +02:00
2a2d0d463a i18n: Disable es_ES locale.
We already have generic `es` one, having more only makes sense if poeple
actually maintain them and they have different contents...
2020-04-06 11:23:29 +02:00
480ff89bf7 Fix T75311, T75310: Edit Weight Paint Overlay Render Artifacts
During recent refactoring of the edit weight overlay we moved a
assignment before it was valid. Making everything one frame off what
resulted in a flashing frame during TAA, not drawing the overlay until a
second action happened, making overlays too bright.

The reason whas that the painting overlay wasn't initialized in the
first sample, but the draw passes and groups were filled. Resulting in
rendering the overlay twice or not at all.

This change moves the assignment to where it is valid.
2020-04-06 10:28:31 +02:00
999134b7ca Cleanup: Add some comments removed in rB0d0036cb53f8 2020-04-06 09:58:57 +02:00
f1bf7bfa1b Cleanup: spelling 2020-04-06 16:02:29 +10:00
6526c3ced8 Fix displaying edit-mesh measurements with deform modifiers
Resolves regression from 2.7x
2020-04-06 15:26:27 +10:00
0ca5b7b69b Fix T74602: Sequencer slip operator ignores offset constraints
Limit offsets, so each strip contains at least 1 frame of content.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D7288
2020-04-06 02:09:20 +02:00
d0d20de183 VSE: Draw f-curves for opacity and volume values on the strips
Feature can be enabled or disabled in timeline view menu item "Show F-Curves".

Author a.monti

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D7205
2020-04-06 00:52:29 +02:00
0e7599bc15 VSE: don't allow strip preview when clicking on the scrubbing region
Don't set 'special preview' or Solo mode if scrubbing in scrubbing region.

Author: a.monti

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D7234
2020-04-06 00:11:55 +02:00
0d0036cb53 Cleanup: Fix comment style and check if they are valid or make sense. 2020-04-05 23:55:51 +02:00
43cc2f3195 Cleanup: Use _fn as a suffix for callbacks in VSE code 2020-04-05 23:39:20 +02:00
9d4300b0c6 Volumes: add volume.grids.frame_filepath to get the current frame filepath
This can be used by external renderers that can load OpenVDB files.
2020-04-05 21:27:30 +02:00
bae1c243ce Build: hide USD symbols, make Blender symbols visible again
Following up to b555b8d.

Building Blender with hidden symbols but using libraries with visible symbols
was giving linker warnings, specifically for USD. So revert that for now, as
it was not needed for the bugfix.

Hide USD symbols (some of which are not in the USD namespace) to avoid potential
conflicts. May potentially help with AMD OpenCL issues in T74262.
2020-04-05 21:04:10 +02:00
f1573731bc UI: Support split property layout for pointer search buttons
Pointer search buttons created with `uiItemPointerR()` (which allows
also passing a collection property to search in) did not work with the
split property layout (i.e. `uiLayout.use_property_split`).
For example vertex group search buttons typically use this.

Note that decorators (`uiLayout.use_property_decorate`) are not
supported yet. Although if they are enabled, the decorator column is
still created to keep the layout alignment visually intact. Also re-uses
the existing hack to allow placing multiple items in the row before the
decorator column.

Needed for some in-progress changes to the modifier stack UI.
2020-04-05 14:49:28 +02:00
3e8a818419 Cleanup: use const for 'clnors' argument where possible 2020-04-05 17:12:10 +10:00
9fe0505db0 Cleanup: macro hygiene, parenthesize arguments 2020-04-05 13:53:32 +10:00
93806ba82b Cleanup: differentiate the evaluation mesh 2020-04-05 12:48:38 +10:00
505a19ed75 Cleanup: Split up Window-Manager VR file (and related changes)
Splits up wm_xr.c into multiple files in their own folder:
source/blender/windowmanager/xr. So this matches how the message bus and
gizmo code have their own folder and files.

This allows better structuring and should make the code scale better.
I rather do this early on than to wait until we end up with a single,
huge file.

Also improves a bit how data is prepared and updated for drawing.
2020-04-04 18:55:24 +02:00
e455536943 UI: 3D Viewport text edit menus
- Adds select menu
- Removes undo/redo controls
- Adds delete menu
- Refactor
- Combines font and text menu

The goal is to match other edit menus better and match the text editor.
2020-04-04 12:41:58 -04:00
a702b095a1 UI: Remove 'Simulation' from 'Fluid Simulation' modifier
This is conistent with other modifiers and is reduntent
with the 'Simulate' menu header.
2020-04-04 12:32:28 -04:00
fe98d8c0ea Cleanup: remove unused method 2020-04-04 14:13:53 +02:00
6fa904765a Cleanup: Rename Panel * variables from pa to panel 2020-04-03 22:20:25 -05:00
7c0e285948 Cleanup: Move Detail Operators and Dyntopo to their own files 2020-04-03 23:41:54 +02:00
17931f3b51 Cleanup: Move Mask Filter and Mask Expand to their own files 2020-04-03 21:46:08 +02:00
f2f30db98d Cleanup: Move Mesh Filter, Smooth and Automasking to their own files 2020-04-03 21:05:54 +02:00
d38023f2f3 fix (unreported): Weld Modifier: possible use of uninitialized variable 2020-04-03 15:09:05 -03:00
82774a9d24 Cleanup: Move all sculpt transform functionality to its own file 2020-04-03 19:42:55 +02:00
d138cbfb47 Code Quality: Replace for loops with LISTBASE_FOREACH
Note this only changes cases where the variable was declared inside
the for loop. To handle it outside as well is a different challenge.

Differential Revision: https://developer.blender.org/D7320
2020-04-03 19:27:46 +02:00
b0c1184875 Cleanup: Including "BLI_listbase.h" for LISTBASE_FOREACH macro
These headers are not needed right away, but will be in the upcoming
commit.
2020-04-03 19:27:42 +02:00
200cc531bd Cleanup: Missing clang format in previous commit 2020-04-03 19:23:05 +02:00
cfc8d73546 Cleanup: Move all Face Set functionality to its own file 2020-04-03 19:17:28 +02:00
63922c5056 Cleanup: Rename ExtensionRNA variables from ext to rna_ext
Makes it more clear that code using this is related to the RNA
integration of a type.
Part of T74432.

Also ran clang-format on affected files.
2020-04-03 18:25:52 +02:00
70b061b4fd Fluid: Refactored caching in main Mantaflow class
This refactor cleans up code for the Manta file IO. It also improves the cache 'Replay' option.
2020-04-03 17:37:37 +02:00
bfdc42d990 Fluid: Refactored MANTA class
Refactored the caching system so that return values are no longer ignored. The aim of this refactor was to make the caching more robust.
2020-04-03 17:37:25 +02:00
d1011c9e64 Cleanup: clarification of 'name' in BKE_idtype functions
The 'name' parameter of `BKE_idtype_idcode_from_name()`, and the `str`
parameter of `idtype_get_info_from_name()`, are expected to be the
'user visible name' of an `IDTypeInfo` struct. This is made clearer in
the code by renaming those parameters to `idtype_name` and mentioning
it in the documentation of the `BKE_idtype_idcode_from_name()`
function.

Differential Revision: https://developer.blender.org/D7317
2020-04-03 16:54:31 +02:00
3208454aa8 Cleanup: Animation, move AnimData API to anim_data.c/BKE_anim_data.h
The `BKE_animsys.h` and `anim_sys.c` files already had a an "AnimData
API" section. The code in that section has now been split off, and
placed into `BKE_anim_data.h` and `anim_data.c`.

All files that used to include `BKE_animsys.h` have been adjusted to
only include the animation headers they need (sometimes none).

No functional changes.
2020-04-03 16:46:48 +02:00
33ab613655 Cleanup: Fix build warning with MSVC
SubdivCCG was unknown when compiling gpuinit_exit.c
2020-04-03 08:29:09 -06:00
49289f31ff Fix T74495: Shrink/Fatten gives strange results with Individual Origins
The island `axismtx` is only necessary in some transform modes.

In the case of `Shrink/Fatten`, the calculated `axismtx` brings an
undesirable result.

This commit rearrange the struct `TransIslandData` in order to
calculate and reference only the arrays that will be used for each
transform mode.

Differential Revision: https://developer.blender.org/D7305
2020-04-03 11:13:42 -03:00
d8b0b8d3db New Undo: Fix crash in some complex production files.
There is no guarantee that depsgraph is ran between two undo steps, so
when re-using an existing data-block we should never wipe completly its
recalc flags, but instead complement them with new ones from accumulated
'storage' as needed.
2020-04-03 16:07:27 +02:00
ad85989a3f Cleanup: Rename bScreen variables from sc/scr to screen
Part of T74432.

Mostly a careful batch rename but had to do few smaller fixes.

Also ran clang-format on affected files.
2020-04-03 14:42:24 +02:00
cff49e625f Cleanup: add missing #includes to some headers
It should be possible to `#include` any header without having to worry
about its dependencies.

I didn't go and check all include files for this, just the ones that caused
me errors while I was refactoring the `anim_sys.c` file.

No functional changes.
2020-04-03 14:28:22 +02:00
905c0269f3 Cleanup: Rename ScrArea variables from sa to area
Follow up of b2ee1770d4 and 10c2254d41, part of T74432.
Now the area and region naming conventions should be less confusing.

Mostly a careful batch rename but had to do few smaller fixes.

Also ran clang-format on affected files.
2020-04-03 13:34:50 +02:00
Asad-ullah Khan
1a69384e76 Fix T74205: crash cancelling transfrom operation in sculpt mode
Differential Revision: https://developer.blender.org/D7018
2020-04-03 13:13:26 +02:00
80513d8574 Fix T75287: other Cycles render passes wrong when using Cryptomatte 2020-04-03 13:13:26 +02:00
82a8da0ec3 Fix T74572: adaptive sampling not scaling render passes correctly 2020-04-03 13:13:26 +02:00
10c2254d41 Cleanup: Continue renaming ARegion variables from ar to region
Continuation of b2ee1770d4, now non-single word variables are also
renamed.
Part of T74432.

Also ran clang-format on affected files.
2020-04-03 12:54:28 +02:00
7ec59cc7b7 Cleanup: split ED_mesh_mirror_*_table into multiple functions
Spatial & topology mirror table each used a single function
taking a char as an identifier.

Split these into begin/end/lookup functions.
2020-04-03 21:52:13 +11:00
b5253159b6 Cleanup: split BKE_anim.h and anim.c into smaller pieces
The files are now split up into the following sections:
- `BKE_anim_path.h` and `anim_path.c` for path/curve functions.
- `BKE_anim_visualization.h` and `anim_visualizationanim_path.c` for
  animation visualization (mostly motion paths).
- `BKE_duplilist.h` for DupliList function declarations. These were
  already implemented in `object_dupli.c`, so they were rather out of
  place being declared in `BKE_anim.h` in the first place.

No functional changes.
2020-04-03 12:13:51 +02:00
736f9f5a69 Fix accidentally reverted changes in VR merge due to merge error
dc2df8307f unintentionally reverted part of 07bdbeda84.
2020-04-03 11:42:27 +02:00
cecb25273e Cleanup: Font, added initialisation for two variables
My compiler (GCC 7.5.0) was warning about these variables potentially not
being initialised. Since the function is highly complex, instead of
analysing it I just trust my compiler and added initial values.

This should be no functional change.
2020-04-03 11:34:25 +02:00
fe7ea8a24c Fix T75250: setting greasepencil active layer not refreshing the dopesheet
This was only reported for the 'Change Active Layer' operator [which was
not setting the channel as selected in the dopesheet], but this is also
the case elsewhere [where BKE_gpencil_layer_active_set is used], namely:
- gp_layer_remove_exec
- gp_layer_copy_exec
- gp_merge_layer_exec
- gp_layer_change_exec
- gp_layer_active_exec
- gp_stroke_separate_exec

We could set GP_LAYER_SELECT "by hand" in
BKE_gpencil_layer_active_set(), but there is already
animchan_sync_gplayer() that does that. For this, we need the
NA_SELECTED notifier though.

Maniphest Tasks: T75250

Differential Revision: https://developer.blender.org/D7311
2020-04-03 10:37:21 +02:00
a2a70cfc41 Cleanup: typo in comment 2020-04-03 10:34:18 +02:00
9aad06db88 Fix T75315: typo in automasking UI text 2020-04-03 10:19:45 +02:00
973e1f9d9a Cleanup: use term 'attr' instead of 'attrib'
This was already the case in most parts of the GPU API.
Use full name for descriptive-comments.
2020-04-03 17:25:58 +11:00
05dcb007e1 Cleanup: use tern 'sync' instead of 'synchronization' for function names
This is a common, unambiguous abbreviation
already used throughout the code-base.
2020-04-03 16:46:34 +11:00
600a627f6e Cleanup: use abbreviated names for unsigned types in editors 2020-04-03 16:21:24 +11:00
04fe37f931 Cleanup: quiet shadow warnings with ghost & mantaflow 2020-04-03 16:15:57 +11:00
71e543c68b Cleanup: replace static list with argument for curve merging 2020-04-03 16:04:02 +11:00
b18608f3e9 Cleanup: bone cursor picking API
There was one function to access both pose/edit bones,
which returned a void pointer type.

Split these into 3 functions which return EditBone, bPoseChannel or Bone
types.

Internally the logic is still shared, this just makes it clearer to
callers which type is expected.

Also use more conventional prefix for picking API:

  - ED_armature_pick_(ebone/pchan/bone)
  - ED_armature_pick_(ebone/pchan/bone)_from_selectbuffer
2020-04-03 15:52:26 +11:00
09071e2799 Fix T75330: Select linked crashes without a bone near the cursor
Own error with recent improvements to select link.
2020-04-03 13:43:03 +11:00
eae40c6c76 Cleanup: improve & use doxy sections for armature_naming.c 2020-04-03 13:16:38 +11:00
d52326bab3 Cleanup: spelling 2020-04-03 12:38:04 +11:00
c154f265de Cleanup: move curve picking functions into 'editcurve_query.c' 2020-04-03 12:32:04 +11:00
6f4dbb661f Revert "Writefile: Cleanup Scene runtime data."
This reverts commit ee0d91df5d. This is
modifying scene data on write, which causes crashes. It can only do that
on a copy of the data.
2020-04-03 02:24:33 +02:00
c4ba0d1508 Fix Linux link error with pcre after recent changes, must use absolute path 2020-04-02 22:05:03 +02:00
75f6e6b39e Fix link error on Linux buildbot with libxml2
On macOS this is part of the collada folder, but for Linux xml2 is in its own
folder for precompiled libraries.
2020-04-02 18:54:58 +02:00
6eb409bb9c Fix warnings caused by own earlier commit
Caused by 34465a7fb0.
2020-04-02 18:46:12 +02:00
12628e0794 Fix Cycles AVX unit test still failing to build with old GCC 2020-04-02 18:19:49 +02:00
Pablo Dobarro
b8d9b5e331 Sculpt: Delay Viewport Updates
In Blender 2.81 we update and draw all nodes inside the view planes.
When navigating with a pen tablet after an operation that tags the whole
mesh to update (like undo or inverting the mask), this introduces some
lag as nodes are updating when they enter the view. The viewport is not
fully responsive again until all nodes have entered the view after the
operation.

This commit delays nodes updates until the view navigation stops, so the
viewport navigation is always fully responsive. This introduces some
artifacts while navigating,  so it can be disabled if you don't want to
see them.

I'm storing the update planes in the PBVH. This way I can add support
for some tools to update in real-time only the nodes inside this plane
while running the operator, like the mesh filter.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D6269
2020-04-02 18:00:51 +02:00
34465a7fb0 VR: Refactor DirectX context management
All DirectX management happens on Ghost level now, higher level code can
just assume everything is OpenGL (except of the upside-down drawing that
still needs to be done for DirectX). This is similar to how the
metal-layer is hidden outside of Ghost.

The Ghost-XR graphics binding for DirectX is responsible for managing
the DirectX compatibility now.
2020-04-02 17:43:45 +02:00
868d4526a8 Fix more build errors/warnings after recent AVX changes
Thanks to Sergey and Ray for the help identifying the problem.
2020-04-02 17:30:56 +02:00
343a874831 add memory address to undo steps print.
Helps identifying who is what in debugger...
2020-04-02 17:22:44 +02:00
9672605938 Fix build error on Windows/Linux after recent AVX changes 2020-04-02 17:09:01 +02:00
5159ba6b33 Fix (harmless) PCRE not found warning when configuring CMake on Linux
Differential Revision: https://developer.blender.org/D7309
2020-04-02 17:09:01 +02:00
2aa938b0ae Cleanup: simplify Linux buildbot config, where default values already match
Ref D7309
2020-04-02 17:09:01 +02:00
1f745e2c72 Sculpt: Add global automasking options for all brushes
This adds the automasking options to the Sculpt Tool options in a way
that they affect all brushes. This is more convenient when working with
some of these options while switching brushes as they don't need to be
enabled/disabled per brush.
An automasking option is enabled if it is enabled in the brush or in the
sculpt options.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D7304
2020-04-02 16:56:44 +02:00
e276558a50 Fix T74983: Material preview icons don't refresh
The root cause of the issue reported in T74983 is that an `IDNode` would
not be marked as user-modified. This marking happened while looping over
outgoing relations of one of its operation nodes. Since rBff60dd8b18ed
unused relations are removed, and as a result the `IDNode` would not be
marked.

The solution was to move the responsible code outside the loop; this is
probably a good idea anyway, as the code did not actually use the
looped-over relations at all, and was thus repeated unnecessarily.
2020-04-02 16:54:17 +02:00
b75a7c2f8f Fix T75302: GPencil fill does not work on python generated strokes 2020-04-02 16:48:00 +02:00
e6c732e0cb GPencil: Cleanup typo error for hardness
The variable cannot be names because it was already renamed.
2020-04-02 16:48:00 +02:00
7c88968c89 Scultp: Face Set boundary automasking
With this brush option it is possible to mask the boundary vertices of
all face sets. This is especially useful in the cloth brush, where face
sets can be used to simulate seams between different patches of cloth
and produce different patterns and effects.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D7230
2020-04-02 16:42:20 +02:00
3dad6294da Sculpt: Store explicit value for multires sculpt level
Allows to know what level sculpting has been done after the value has
been changed in the MultiresModifierData.

No functional changes, just preparing code to have everything needed
for propagation undo.

Differential Revision: https://developer.blender.org/D7307
2020-04-02 16:32:33 +02:00
f868d51bdd Sculpt Undo: Allow Geometry undo step to be non-exclusive
Before this change it was not possible to have base geometry
and grid coordinates to be stored in the same undo step.

Differential Revision: https://developer.blender.org/D7298
2020-04-02 16:29:51 +02:00
009dde69cd Fix Face Sets painting and selection precision
This fixes the following issues:
- Previously, the face set from the active vertex was used directly. Vertices always return the most recently created face set, so in some cases there may be some face sets that were not possible to select as active. Now the active face set is set in the ray intersection, so it always matches the face under the cursor.
- When drawing face sets they were set per vertex, so it was not possible to paint one face at a time. Now face sets are painted per poly when using the brush on meshes, testing the distance to the center of each poly.
- The code for the active vertex on PBVH_GRIDS was not correct, so I also fixed that to test if everything was working correctly.
{F8441699}

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D7303
2020-04-02 15:43:37 +02:00
6cc4c68dad Fix T75121: Memory leak in Surface Smooth
The brush was allocating new memory for storing the displacemnets at the
beginning of each stroke step and not freeing them.

Reviewed By: jbakker

Maniphest Tasks: T75121

Differential Revision: https://developer.blender.org/D7254
2020-04-02 15:36:10 +02:00
43f748a32f Fix mesh boundary automask curve falloff
As the main use case of this feature is to work with cloth, using this
curve makes more sense than a smoothstep to simulate cloth tension near
the edges.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D7262
2020-04-02 15:35:12 +02:00
b26bebd59f Missed file in previous commit 2020-04-02 15:32:17 +02:00
88362565f6 Fix T72688: Vertex Group Weights in Edit Mode Occludes In Front Armatures
Due to legacy this overlay was implemented twice (Edit Mesh and Weight
Painting) with different results. This patch consolidates both drawing
and uses only the Weight Painting drawing.
2020-04-02 15:12:32 +02:00
f5e4f20dc1 Fix: Build error when building with python off 2020-04-02 07:08:51 -06:00
fa8a3c8f26 Revert "Fix T72688: Vertex Group Weights in Edit Mode Occludes In Front Armatures"
This reverts commit 782e6ea4ed.

Said fix introduced a crash the moment one goes to edit mode.
2020-04-02 15:07:56 +02:00
7bffdab93c CMake: Add alembic boost dependency
When building lite + alembic + boost cmake would turn
boost off because it deemed it not needed leading to
build errors.
2020-04-02 07:03:36 -06:00
53d029d6da Cleanup: Avoid complex template type for XR-Swapchain
I rather avoid types like
`std::vector<std::unique_ptr<GHOST_XrSwapchain>>`, which is easy to do
in this case.
2020-04-02 13:50:27 +02:00
782e6ea4ed Fix T72688: Vertex Group Weights in Edit Mode Occludes In Front Armatures
Due to legacy this overlay was implemented twice (Edit Mesh and Weight
Painting) with different results. This patch consolidates both drawing
and uses only the Weight Painting drawing.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D7289
2020-04-02 11:49:39 +02:00
1c3ded12f4 Fluids: improve subframe handling
Reviewers: sebbas

Differential Revision: https://developer.blender.org/D7256
2020-04-02 10:34:05 +02:00
06cb321f33 Sculpt: Give a brief explanation of undo stack
Should make it a bit more clear overview of what is going on in this
module. While some of the details might still be missing, having some
sort of top-level overview is better than nothing.

Differential Revision: https://developer.blender.org/D7300
2020-04-02 09:39:38 +02:00
3ebebe62d7 Sculpt Undo: Fix multires undo for interleaved nodes
Made it so grids array is properly allocated when first node in the
undo list does not contain grid data.

Differential Revision: https://developer.blender.org/D7299
2020-04-02 09:38:26 +02:00
a9963669f9 Fix T75283: GPencil Stroke created by Merge points can't have fill material 2020-04-01 19:35:35 +02:00
c4374bc919 Fix T75271: GPencil Segment select mode doesn't work
The selection was workring with the evaluated data, but need work with the original data.
2020-04-01 18:00:49 +02:00
25b2b6724d Fix T74224: Add missing depsgraph relations for boid particles
Reviewers: brecht

Differential Revision: https://developer.blender.org/D7302
2020-04-01 16:21:34 +02:00
f047d47e24 Cycles: AVX implantation of Perlin noise.
This patch adds an AVX implementation of Perlin noise in Cycles.
An avxi type was also added as a utility based on the respective
type in Intel Embree.

Only 3D and 4D noise were implemented, there is no benefit for
utilizing AVX in 1D and 2D noise. The SSE trilinear interpolation
function was used in the AVX implementation because there is no
benefit from using AVX in interpolating the last three dimensions.

Differential Revision: https://developer.blender.org/D6680
2020-04-01 14:48:01 +02:00
5e176d67e1 Writefile: Cleanup Volume runtime data. 2020-04-01 12:39:06 +02:00
d66519f197 Writefile: Cleanup CacheFile runtime data. 2020-04-01 12:39:06 +02:00
d31f79a9bc Writefile: Cleanup MovieClip runtime data. 2020-04-01 12:39:06 +02:00
1f065df03e Writefile: Cleanup GPencil data.
Note: Not clearing the whole runtime data here, as this is not done in
matching read code, not sure why, needs further investigation...
2020-04-01 12:39:06 +02:00
ec351c7a65 Writefile: Cleanup Nodetree runtime data.
Note: As with collections, this does not affect embedded nodetrees from
material etc. We prpbably need to tackle those as well at some point...
2020-04-01 12:39:06 +02:00
e0dc4130fd Writefile: Cleanup Armature runtime data. 2020-04-01 12:39:06 +02:00
358f8b484f Writefile: Cleanup Collection runtime data. 2020-04-01 12:39:06 +02:00
e24553ca0f Writefile: Cleanup Soung runtime data. 2020-04-01 12:39:06 +02:00
8d63135da3 Writefile: Cleanup World runtime data. 2020-04-01 12:39:06 +02:00
254748c3e7 Writefile: Cleanup Lattice runtime data. 2020-04-01 12:39:06 +02:00
4f509db181 Writefile: Cleanup Text runtime data. 2020-04-01 12:39:06 +02:00
33a622cbf4 Writefile: Cleanup VFont runtime data. 2020-04-01 12:39:06 +02:00
e790aa1f19 Writefile: Cleanup material runtime data. 2020-04-01 12:39:06 +02:00
27b9f1f626 Writefile: Cleanup MBall runtime data. 2020-04-01 12:39:06 +02:00
ee0d91df5d Writefile: Cleanup Scene runtime data. 2020-04-01 12:39:06 +02:00
9532ce4605 Writefile: Cleanup Object runtime data. 2020-04-01 12:39:06 +02:00
80280acc93 Writefile: Cleanup Curve runtime data. 2020-04-01 12:39:06 +02:00
ca0dcd830c Fix T75222: Crash activating menu search 2020-04-01 20:59:50 +11:00
186ac84210 Cleanup: clang-format 2020-04-01 20:47:02 +11:00
60ff3a7daf Fix T66494: Alt+ clicking (assign to all selected) does not work for NLA
strips

This uses the new "selected_nla_strips" context member in
UI_context_copy_to_selected_list().

bonus: this also makes the "Copy To Selected" button operator [in the
button context menu] work for anything NLA Strip related.

Maniphest Tasks: T66494

Differential Revision: https://developer.blender.org/D7281
2020-04-01 10:24:16 +02:00
f8c4f5e308 Add a "selected_nla_strips" context member
Needed for upcomming fix for T66494.

ref T66494 / D7281
2020-04-01 10:22:34 +02:00
029a714fc7 Fix T75234: Saving UDIM tiled texture as OpenEXR saves only the first
tile

This happened when the UDIM tiled image needed to be colormanaged, so
- when you set up the image as sRGB, then save as EXR/HDR/...
- other way around as well: when you set up the images as Linear then
save as PNG/JPG/...

Reason being that for UDIM tiled images, `image_save_single` is called
multiple times [once for each tile] and everytime `image_save_post` will
fire the `IMA_SIGNAL_COLORMANAGE` signal which clears the cache if any of
the above two is the case. Without the cache, the next tiles cannot be
saved.

Now determine if the colorspace changed from
`image_save_single`/'image_save_post' and only fire
IMA_SIGNAL_COLORMANAGE once from BKE_image_save in the end.
(thx @brecht for suggesting this alternative to the original fix)

Maniphest Tasks: T75234

Differential Revision: https://developer.blender.org/D7296
2020-04-01 10:11:54 +02:00
59e001cbf6 GPencil: Cleanup typo error 2020-04-01 10:02:04 +02:00
Bastien Montagne
2ad0ae8dad Tweak write code to allow cleaning up runtime data before write.
This basically generalizes what was being done in `write_mesh`,
since we need to clean up ID tags anyway, it's easier to do it for all IDs.

Then ID write funcs themsleves can do whatever they want on the passed
struct, without risking interferring with regular Blender operations.

Note that Text write function is doing a suspicious change on one of its
flags, but this seems to be by-passed anyway by read code currently, so
think it's OK to not do that on orig data-block.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7294
2020-04-01 09:43:21 +02:00
7952274cf0 Sculpt Undo: Refactor Geometry undo nodes
Made it so there is a single UNDO node in the list which has
both original and modified mesh state.

Makes it easier to achieve "interleaved" undo nodes stored in
the undo step (as opposite of either storing geometry or other
data).

Should be no functional changes, just preparing for an upcoming
work to support undo of operation like Apply Base.

Differential Revision: https://developer.blender.org/D7290
2020-04-01 09:39:58 +02:00
60d3a801db Subdiv: Split evaluation begin+refine into separate steps
Actually, begin will do the entire initialization.

Refine will only refine if there is a topology refiner associated
with the Subdiv descriptor.

Allows to refine Subdiv to new coarse positions without touching
displacement evaluation. Will be needed to update SubdivCCG during
sculpt undo.
2020-04-01 09:32:46 +02:00
29eb891658 Fix curve shortest path picking with right-click select 2020-04-01 17:33:24 +11:00
9bcc83a5d6 Fix problem extruding curve segments with selected handles
Issue introduced in 38685b5a39
2020-04-01 17:08:41 +11:00
8d116e9956 Cleanup: use doxy sections 2020-04-01 16:19:32 +11:00
b157abebe5 UI: avoid term 'Region', use 'Edges & Faces' instead
Change to recent renaming of "Edge Collapse" as it has multiple uses,
as it collapses edge-rings, but isn't limited to collapsing single edges,
it can be used to collapse faces with arbitrary topology.

The name "Collapse Regions" is too vague, users might not think to use
this to collapse edge-rings.

Use a more verbose name "Collapse Edges & Faces", referencing edge-rings
in the tool-tip.
2020-04-01 14:18:21 +11:00
b7868c0b89 Grease Pencil: Fix typo in labels and comments.
Hardeness -> Hardness

Only changed the labels/tooltips, will leave the internal change to @antoniov.
2020-04-01 03:52:58 +02:00
6a1f0c1eaa Cleanup: use doxy sections for 'idprop' API 2020-04-01 11:30:08 +11:00
2d39e46f84 Cleanup: use doxy sections for wm_draw.c 2020-04-01 11:30:08 +11:00
9b0d72aa3d Cleanup: use sections for object_remesh.c
Add missing sections.
2020-04-01 11:29:45 +11:00
18fc4155fd Fix customdata interpolation being done multiple times in Weld Modifier 2020-03-31 20:57:33 -03:00
bcd3c3cb57 UI: rename "Edge Collapse" to "Collapse Regions"
This is useful for collapsing regions of faces & edges,
similar to a 'Merge -> Collapse' which can operate on multiple regions,
merging UV's so they don't need to be manually corrected.

The name & description didn't mention this.
2020-04-01 10:50:21 +11:00
91604279c9 Fix missing break statement in recent face-set support 2020-04-01 10:50:21 +11:00
f9f0f44be8 Cleanup: quiet discarded-qualifiers, unused warnings 2020-04-01 10:50:21 +11:00
e819f67500 Cleanup: Organize Weld Modifier in alphabetical order 2020-03-31 20:39:37 -03:00
74b5e5f6e1 Fix T74588: Weld Modifier: Vertex colors and UVs get incorrect values 2020-03-31 20:27:54 -03:00
da3cb514e5 Multires: Initial Face Sets support
This implements the Sculpt Mode API functions needed for Face Sets and
visibility management for PBVH_GRIDS. No major changes were needed in
the operators and the sculpt mode code. This implementation stores the
face sets in the base mesh, so faces created in higher subdivision
levels can't be modified individually. Also, we are not checking for
multiple face sets per vertex (that can be added in the future), so
relax tools don't work yet. The rest of the features (paint, undo,
visibility operators..) work as expected.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7168
2020-04-01 01:07:47 +02:00
0062813c73 make.bat: Improve messaging when not detecting MSVC
Inspired by @mrwhite in D7295
2020-03-31 13:14:16 -06:00
5b88ab25bd Fix T75219: Move to New Layer not working
This was an old design problem.
2020-03-31 18:54:50 +02:00
6c036a65c9 Add Voxel Mode to the Remesh modifier
This adds the Voxel Mode to the current remesh modifier. It works
exactly the same way as the voxel remesh operator and uses the same
properties to control the remeshing. We can exand this with more options
in the future (fix poles, reprojection...)

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7292
2020-03-31 18:27:37 +02:00
38685b5a39 Edit Curve: Improve Curve extrude
The original code has two logics, extrude the end points or duplicate points (making new splines).
Now all the logic has been redone by extruding contiguous selected segments.

Fix T47169

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D6982
2020-03-31 12:39:53 -03:00
1c1a14dcdf Voxel Remesh: Edit Voxel Size operator
This operator lets the user control the voxel/detail size of the voxel remesher directly from the 3D view in a similar way the Brush radius and strength are controlled.  The shorcut from sculpt mode is Shift + R (similar to Shift + F for brush strength).
It shows a grid that represents the real voxel size of the object. The grid and the text are automatically aligned to the view to avoid rendering all voxels with thousands of lines.

It also has a slow mode when pressing shift that works like the slow mode of the brush radius control.

This operator controls the value changes sensitivity automatically to avoid jumping to extremelly high resolutions and run out of memory.
This way, adjusments done in lower voxel sizes are more precise. Pressing Ctrl disables this functionality and allows changing the voxel size directly in a linear way.

Reviewed By: jbakker, #user_interface, billreynish

Differential Revision: https://developer.blender.org/D6449
2020-03-31 17:31:13 +02:00
f149d5e4b2 Fix VR session toggle not changing reliably on session start/end
The text and icon were supposed to change but didn't reliably, which was
a race condition I think. It depended on how fast the OpenXR runtime
would transition the session state.
This also makes sure the correct notifier is sent on session exit.
2020-03-31 16:49:38 +02:00
afe707cc3a Fix missing XR space destruction
I think destructing the XrSession would destruct this anyway, but rather
have this done explicitly, consistently and in a controlled manner.
2020-03-31 16:49:38 +02:00
b0bd9b4c70 Fix T75244: Screw Modifier Crash
Draw batch extraction wrongly assumed that when mapped extraction
happened that all original data could be found. This is not the case as
mapped extraction is also enabled when part of the data is present.

This fix does additional nullptr checks.
2020-03-31 16:05:19 +02:00
39684e4554 Cleanup: remove duplicate function 2020-03-31 22:37:25 +11:00
17a409e223 Cleanup: use '_recursive' suffix instead of '_rec'
This convention isn't very clear and wasn't used much.
Use the more verbose term instead.
2020-03-31 22:23:33 +11:00
b74e388617 Fix T75210: Frame range does not go down to 0 in the physics tab for mantaflow when clicking the left arrow
Added nore flexibility to cache frame range and ensured validity of frame range.
2020-03-31 12:18:15 +02:00
155f917403 Fix T73513: Facing Overlay Intervene With Selection
Do not draw the facing overlay during selection.
2020-03-31 11:47:09 +02:00
d8217ec6d0 UI: improve names for mesh split operations 2020-03-31 19:45:26 +11:00
039d619c76 Fix T74898: Multiresolution Ghost After Orbiting
EEVEE and Workbench both had the same issue that they continue with the
last sample when leaving navigating. This is ok for regular meshes as
they are all the same. For multiresolution it ain't as a low res version
of the mesh is used during navigation.

This patch also resets the AA samples when the user leaves navigation.
2020-03-31 10:29:34 +02:00
24f8c8491d UI: group edit-mesh Separate with Split & Merge
This was already the case for curve & armature.
2020-03-31 18:21:21 +11:00
c1722a3a8c Keymap: 'M' for edit-mesh merge menu, 'Alt-M' for split menu
As the 'M' key is free, it's convenient to use for the merge menu,
especially since this contains "Merge by Distance",
a frequently used action.

Use 'Alt-M' for a new split menu, following our convention of Alt being
used for opposite functionality.

Also move merge/split menu's into the "Mesh" menu as neither operate
solely on a single mesh element type.
2020-03-31 18:21:21 +11:00
61f9bbbdea Edit Mesh: support splitting vertices
The edge split operator can now split faces & edges
from selected vertices.

This has the same functionality as manually ripping all
faces and edges away from a vertex.
2020-03-31 18:20:06 +11:00
07add4b485 Cleanup: use sections for armature-select 2020-03-31 15:24:06 +11:00
0f5c94bbd1 Armature: add Select Linked (Ctrl-L)
This matches select linked for other modes (curve, mesh)
2020-03-31 15:11:11 +11:00
b555b8dedc Build: hide most symbols on macOS on Linux to avoid conflicts
This means symbols from Blender itself and most external libraries. We can't
just hide all because that breaks some libraries. The better solution would
be to rebuild all library dependencies with hidden visibility.

Fixes T75223: Luxrender add-on failing to load on macOS
2020-03-31 00:07:55 +02:00
899bfdc412 Audaspace: Update From Upstream (For API Docs)
No functional changes:

- Cleanup Spelling, Line Length
- Use proper class method styling for py docs
- Fix Broken Links

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

Fixes T75191
2020-03-30 17:47:40 -04:00
22677d8e1d Fix undo incorrectly detecting mesh as always changed after edits
Mesh writes a modified copy, which meant recalc_undo_accumulated was never
cleared on the actual datablock. Also clear mesh->runtime on write to avoid
detecting changes, since it's cleared on read anyway.

Differential Revision: https://developer.blender.org/D7274
2020-03-30 20:09:15 +02:00
f4982b555c Fix undo misdetecting identical future chunk in some cases
Clear is_identical_future before adding a next undo step, to avoid wrong
values for cases where we undo and then add a step with different changes
than what was previously the next step.

Ref D7274
2020-03-30 20:09:20 +02:00
2e60226f23 Fix undo debug logging not printing all types of undo pushes
Ref D7274
2020-03-30 20:09:15 +02:00
91b334b2f2 Fix T74547 EEVEE: Image texture crash with use after free
Same fix than for the other mapping types.
2020-03-30 19:57:24 +02:00
248873603f GPencil: Remove is_edit_mode from cache data
This value is not used by new engine.
2020-03-30 18:56:46 +02:00
4c40468856 GPencil: Remove GP_DATA_PYTHON_UPDATED used by old engine 2020-03-30 18:54:41 +02:00
2c9e27f209 Fix T75144 Grease Pencil: Python generated strokes flicker and crash
This was caused by a flag not being reset in time, causing discard of
batches already queued to be drawn.
2020-03-30 18:38:15 +02:00
100896e080 GPencil: Rename Overlay blend mode to Hard Light
Differential Revision: https://developer.blender.org/D7280
2020-03-30 18:23:36 +02:00
6428da84ed Fix T74663 GPencil: Fills are Flickering on Nvidia
This was caused by an unitialized variable.
2020-03-30 17:57:31 +02:00
af1e3b0270 GPencil: Fix overlay blend mode creating inverted colors 2020-03-30 17:57:31 +02:00
9371c051b1 EEVEE: Bloom: Fix inverted source and base buffer
This does not change the ouput much.
2020-03-30 17:57:31 +02:00
6f15bc3b52 Fluid: Removed Empty Space option for liquid domains
The option only makes sense for gas domains where there is some density.
2020-03-30 17:34:16 +02:00
1280f3c0ae Fluid: Optimization for mesh file loading
Improved loading times for mesh files by reading bigger chunks of data from the disk at once.
2020-03-30 17:32:38 +02:00
a2d19c1f78 NormalOverlay: Center Dot Normal Drawing With Modifiers
When using generative modifiers too many center dots were rendered in
the normal overlay. This patch only renders the normals of original
center dots.

Known issue: decoding the `norAndFlag` has issues on Intel GPU.
2020-03-30 14:39:16 +02:00
57d8bde088 Normal Overlay: Hide Normals Of Generated Loops
The loop normals were always drawn. We used to only draw the normals if
it was mapped to an original loop of the mesh. Due to recent changes we
can not find the correct loop and decide if we need to draw them.

Note still need to check the face dots normals. This is more complicated
as facedot normals needs to be encoded in a different way
2020-03-30 14:06:54 +02:00
a6a9a12e8f Fix T75142: No autokeying with pose mode X-Mirror
This was caused by the removal of some `BONE_TRANSFORM_MIRROR` flag
handling in rBde530a95dc7b482dc22c933b9b8b2a98c79b5663. I simply
restored those lines that caused this issue.
2020-03-30 13:26:26 +02:00
ef7229d69a Cleanup: reduce code indentation in autokeyframe_pose()
This makes the code a bit simpler to follow, by replacing
`if (x) { all the code here }` with `if (!x) { continue; }` and un-indenting
the remaining code, and by returning early.

No functional changes.
2020-03-30 13:26:26 +02:00
cf258b02f4 Fix T75053: Paint Overlay Show Modified Wires and Edges
The paint mask overlay showed the wires and edges of the final mesh.
This change will only draw wires and edges that are mapped to the
original mesh.

This change enables mapping data in regular Mesh extraction. This
can also be used for better drawing of the normal overlay.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D7277
2020-03-30 13:13:42 +02:00
d6e0d27816 Fix help message misc argument grouping
Correct reference to non-existent argument.
2020-03-30 21:47:07 +11:00
3351a2655d Subdiv: Extend some comments 2020-03-30 12:26:45 +02:00
513885a991 Fix armature edit-mode selected linked
Selecting linked would only select a single arbitrary chain.

Now select linked follows all child-chains of the bone.

Also add support for following all links, similar to how this would work
if it were a mesh with connected edges instead of only child chains.

Leave this off by default to match pose mode.
2020-03-30 19:18:28 +11:00
15cb567c8e Armature: remove merge function, use dissolve instead
This was crashing, when looking into a fix I noticed that it gave
hap-hazard results dissolving past forks in the parent/child hierarchy
arbitrarily following one chain.

This functionality is almost identical to "dissolve" which delimits
forks in the chain predictably.

So remove this in favor of dissolve (available from the delete menu).
2020-03-30 19:18:09 +11:00
6462ea2a8d UI: center align icon-only pull-down menus
Resolve issue noted in D5482, texture slots '+' icon for example
was noticeably off-center.
2020-03-30 14:45:05 +11:00
7b347b225a Cleanup: remove print left in recent fix for T66655 2020-03-30 14:34:32 +11:00
ec3da20896 UI: use operator name for extrude repeat
Match names between the redo popup and the menu item.
2020-03-30 11:41:44 +11:00
9ccaf9899e Extrude Repeat: support storing the offset vector
Without this, adjusting properties always re-initialized
from the view-vector.
2020-03-30 11:41:35 +11:00
e252d2c990 Fix extrude repeat leaving selection history unselected 2020-03-30 10:39:10 +11:00
6b24f7d87c UI: move extrude repeat out of the vertex menu
This works for all selection modes,
include last below a separator since it's a specialized function.

Note that the previous commit was raising an exception as operator
properties don't support 'or'.
2020-03-30 10:29:32 +11:00
086bfffe74 Theme: adjust lamp alpha to visually match 2.82 2020-03-30 10:12:08 +11:00
6c48a36962 DRW: match edge opacity to 2.82
Edges were hard to see in some cases in edit-mesh vertex/face modes.

Since 804e90b42d alpha is handled differently,
update edge alpha to visually match 2.82.
2020-03-30 10:12:08 +11:00
a103d09df4 UI: Move Array Extrude Below Verticies 2020-03-29 17:36:34 -04:00
7d59f84708 Fluid: Optimization for liquid / secondary particle file loading
Improved loading times for particles files by reading bigger chunks of data from the disk at once.
2020-03-29 21:31:20 +02:00
b023c91118 Fluid: Use dynamic mode whenever active rigid bodies are in the scene
Required for collisions with moving rigid bodies. Otherwise the static optimization mode will be kept and the obstacles would be calculated only once at the beginning.
2020-03-29 21:31:20 +02:00
bf3b0db785 Overlay: Edit Mesh: Add offset for thicker edges
Edges with sharpness, seam and bevel are thicker and thus needs more offset
to not appear aliased.

Based on D5448 by @oficsu
2020-03-29 20:49:07 +02:00
0b57ecc665 Overlay: Edit Mesh: Make offset depth dependent (w.r.t depth precision)
The previous offset was done in view space. It is now done in NDC space
to avoid differences when adjusting the near/far plane distances.
2020-03-29 20:46:42 +02:00
a022cb8f62 UI: Add missing operators to menus in the 3D Viewport Mesh Edit mode
Differential Revision: https://developer.blender.org/D7263
2020-03-29 14:09:39 -04:00
bd74f5f7ab Fix T73945: Don't grey out "Calculate to Frames" in some cases
The button seems to behave more as I'd expect without these
additional checks. Previously, the button was often grayed out when
it was actually working.

Reviewers: ISS

Differential Revision: https://developer.blender.org/D7252
2020-03-29 15:09:42 +02:00
Wayde Moss
5b8b6b4c1e RNA: expose the pin flag for AnimData and ActionGroup 2020-03-29 23:05:30 +11:00
Henrik Dick
d8e2cc9f4d Fix missing Surface Deform strength versioning 2020-03-29 22:52:06 +11:00
Yevgeny Makarov
a3d5b949d2 UI: Fix text padding for labels without an icon 2020-03-29 22:47:59 +11:00
c6143da27c Cleanup: remove DNA_view2d_types.h from DNA_sound_types.h 2020-03-29 20:32:45 +11:00
Henrik Dick
fc37318fe7 Screw Modifier: support 1-2 steps
The Screw Modifier had a lower limit for the steps value, which not only
was inconsistent between render and viewport steps, but also was capped
to 2 in UI and also in the code internally.
2020-03-29 20:25:14 +11:00
Cody Winchester
e8dd6128b5 Fix warp modifier using pose matrix without object matrix applied
Error in recent patch D6820
2020-03-29 18:58:37 +11:00
b9faf53182 Fix T72075: Incorrect Grid Fill error message 2020-03-29 18:36:00 +11:00
424fed3cc7 Cleanup: remove unicode character printing
Was added when utf8 was originally introduced - for testing,
but is no longer needed.
2020-03-29 17:11:46 +11:00
aec9e0e1b6 Cleanup: spelling, comments 2020-03-29 17:11:41 +11:00
d5163e06c3 Cleanup: strict-prototypes warning 2020-03-29 16:37:57 +11:00
ac02c702e5 Fix T75156: Cast modifier crash in edit-mode
Add NULL checks to other deform modifiers too.
2020-03-29 16:09:09 +11:00
a24f52c51c Fix T75088: Add tooltips for custom properties 2020-03-28 16:40:49 -04:00
a882debee0 Fix T75161: Random UV doesn´t work with fats drawing
Also fixed T75162
2020-03-28 15:08:13 +01:00
7dbf7255c2 GPencil: Fix error when stroke has 0 points
It's possible create a stroke with 0 points using python
2020-03-28 12:33:32 +01:00
bdec24b40d Cleanup: Removing unused parameter. 2020-03-28 09:14:07 +01:00
10bd3fb4cb Fix T74604: A.N.T Landscape Erode function reports error
Although indicated, the `rna_Object_active_vertex_group_set`
function was missing.
2020-03-27 22:14:47 -03:00
79b391f3a0 Fix missing NULL terminator for new brush option 2020-03-28 02:08:06 +01:00
Asher
e0030d53bc Fix key detection issues introduced by D7229
Removing the GHOST_kKeyUnknown check from processKeyEvent() produces
epeated unknown key events whenever a modifier key is held down, due
to the way ghost uses GHOST_kKeyUnknown as a filter value for modifier
key events.

Differential Revision: https://developer.blender.org/D7257
2020-03-27 20:59:20 -03:00
1f949121cd Fix T74969: Crash in gpencil edit mode
Result of poor shader pre-processing on Intel HD 4000 drivers
2020-03-27 20:12:05 -03:00
90aa771b30 Cleanup: compiler warnings 2020-03-27 23:21:16 +01:00
d85026db15 Overlay: Outline: Fix unreported feedback loop when smooth wire is disabled 2020-03-27 20:11:43 +01:00
a7110618ff Cleanup: GPUShader: Remove unused shaders 2020-03-27 20:00:27 +01:00
Ankit
0c0170f77a Fix error in macOS system file detection in recent changes
Differential Revision: https://developer.blender.org/D7250
2020-03-27 18:56:58 +01:00
9120191fe2 Sculpt: Pose Brush Face Sets origin mode
This commit introduces a new mode for calculating the positions and
weights of the IK segments in the Pose Brush based on the Face Sets.

The first segment of the chain will always include all face sets inside
the brush radius and it will propagate until the boundary of the last
face sets added in the flood fill. Then consecutive connected face sets
are added to the chain until the chain length limit is reached or all
face sets of the mesh are already part of the chain.

This feature enables complete control over the pose brush origins in
case that is needed. Also, with this mode, the user can have a library
of base meshes with face sets already configured to get to the initial
pose as fast as possible.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D7235
2020-03-27 18:15:42 +01:00
4c0cca78eb Rename Edge Automasking to Mesh Boundary Automasking
This makes more clear what this automasking operation does and helps to differenciate it from the future face sets boundary automasking.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D7185
2020-03-27 18:05:10 +01:00
015c084bda Sculpt: Weight normal and area sampling towards the brush center
Previously, all vertices inside the brush radius were taken into account
equally when calculating the sculpt normal and area. This was causing
artifacts and unpredictable results with large brushes or meshes with
curvatures, as the strongest deformation point of all brushes is usually
in the center. By weighting the vertex normal and position towards the
center when sampling, all brushes should now behave in a more
predictable way in non-uniform surfaces.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D6989
2020-03-27 17:55:00 +01:00
7eacda5a2b Fix T74637: Reset face set data when disabling dyntopo
Last time I checked Face Sets were preserved in a more or less
predictable way when modifying the mesh with dyntopo. As it looks that
in some problems this may cause bugs and you can't see or use face sets
when modifying the topology of the mesh whith dyntopo active, it is
probably better to reset them when going from dyntopo to mesh. This way
you know that you are always going to get a predictable face sets state.

Reviewed By: jbakker

Maniphest Tasks: T74637

Differential Revision: https://developer.blender.org/D7099
2020-03-27 17:52:00 +01:00
0db055338a GPencil: Small tweaks to Fill material panel 2020-03-27 16:38:22 +01:00
671d811323 Install_deps: Do not wipe out WITH_PYTHON CMake options.
This is annoying when one want to use system python and hence disables
the `WITH_PYTHON_INSTALL` options...
2020-03-27 15:46:47 +01:00
Mateusz Grzeliński
0a02c288aa install_deps: Enable PIC in Python static library.
Update for D3078, I think it should be fixed

Benefits:
- after installing python 3.7 with `./build_files/build_environment/install_deps.sh`, user will be able to run `make bpy` without linking error:
  - https://blender.stackexchange.com/questions/102933/a-working-guidance-for-building-blender-as-bpy-python-module
  - https://stackoverflow.com/questions/36779834/compiling-blender-bpy-recompile-with-fpic

To prevent errors like `/opt/lib/python-3.7.4/bin/python3.7: error while loading shared libraries: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory`, add python .so lib to ldconfig

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D7177
2020-03-27 15:23:58 +01:00
Daniel Santana
2632ba6703 Fix Optix build error after recent changes
Differential Revision: https://developer.blender.org/D7253
2020-03-27 14:26:26 +01:00
31bd8e6bf3 Fix T74642: Take gravity field weight into account
Reviewers: sebbas

Differential Revision: https://developer.blender.org/D7227
2020-03-27 12:41:14 +01:00
7fd71c1694 GPencil: More cleanups missing in previous commit 2020-03-27 12:39:18 +01:00
70f56167d0 UI: Add missing Annotation tool to Paint modes 2020-03-27 12:36:24 +01:00
8a62fa9855 GPencil: Cleanup of unused code a arguments 2020-03-27 12:36:24 +01:00
25e8550739 CPencil: Cleanup unused fill code
This is now replaced by draw engine and annotations don't use fill.
2020-03-27 12:36:24 +01:00
5ce41e6f57 Fix T75111: Crash when using subframes for animated fluid collider
This is not dependent on having an armature as mentioned in T75111.
The collider simply has to be animated.

Reviewers: sebbas

Differential Revision: https://developer.blender.org/D7251
2020-03-27 12:33:33 +01:00
Cody Winchester
6e505a45a1 Surface Deform modifier: add vertex group and strength control.
This commit aims to add functionality to the surface deform modifier that
gives more control and allows it to work better with the modifier stack.
* Maintains compatibility with older files. The default settings keep it
  so that the whole object is bound and vertex coordinates get overwritten
  as the modifier currently does.
* Turns the deformations from an absolute vertex coordinate overwrite into
  an additive offset from the vertex location before the modifier to the
  resulting bound deformation. This gives the ability to control the
  strength of the deformation and mix the deformation of the modifier
  with the modifier stack that comes before it.
* Also adds in a vertex group with the invert option. This is applied after
  the bind deformation is added. So the whole object is still bound to target,
  and the vertex group filters afterwards what parts get affected.
  I experimented with a version to only binds the geometry weighted to the
  vertex group, but that would break compatibility with old files.
  I may bring it in later as a separate option/mode for the surface deform.

With several fixes from @mont29.

Reviewed By: mont29

Differencial Revision: https://developer.blender.org/D6894
2020-03-27 12:25:37 +01:00
1bb7d42cf6 Cleanup: Silence uninitialized variable warning 2020-03-27 11:12:27 +00:00
da91329291 GPencil: Cleanup unused parameter 2020-03-27 11:43:36 +01:00
b498edb189 Fix T75118: Remove Texture Opacity parameter for Fill materials
This parameter was used in previous version and must be removed from UI panel.
2020-03-27 11:33:09 +01:00
e7af825ded Multires: Fix unwanted assignment of sculpt session pointers
Might have happened when Apply Base is used in sculpt mode.

In practice this probably was fine, since the operator tags object
for update, so the pointers will be restored back to what they should
be.
2020-03-27 11:29:41 +01:00
Cody Winchester
bd86edf116 Solidify modifier: add option to assign shell & rim geometry to selected vertex groups.
This commit gives the solidify modifier the ability to assign the newly created shell
and rim geometries to selected vertex groups. This expands the procedural control over
the modifier stack by letting users apply modifiers to the shell geometry without affecting
the original geometry.

This will be especially helpful for NPR users that use solidify to create backface
culling lines on their characters giving them the ability to add displace noise
and other effects.

Differential Revision: https://developer.blender.org/D6903
2020-03-27 11:12:57 +01:00
Cody Winchester
ba1f7acc3f Warp modifier: add bone from and bone to options when using armature objects
This commit adds the option to use armature bones for the From and To targets
when using armature objects.

The changes are based on the UV Warp modifier.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D6820
2020-03-27 10:42:40 +01:00
3441862c96 Cleanup: Silence warnings 2020-03-27 10:29:33 +01:00
96b3463e25 Cleanup: Remove debug print
Leftover from rB3b59c111821b.
2020-03-27 10:23:34 +01:00
ff62481f65 Fix T69060: File Output Node does not work with Time Remapping
Problem is that the RenderEngines will change the RenderData cfra when
rendering (when time remapping is used -- at least workbench/eevee/
gpencil do a combination of BKE_scene_frame_get() plus
RE_GetCameraWindow() which alters the RenderData cfra).

Later on in the pipeline, the Compositor will use this RenderData cfra
to determine the output file name for the FileOutput node. (In contrast
to this, the 'regular' Output will use the Scene's RenderData -- not the
Render's -- cfra [which hasnt been altered])

It is not entirely clear why RE_GetCameraWindow was setting the cfra on
the Render, but it appears to be legacy OGL rendering related and is not
needed anymore.
Removing this will keep the cfra as needed for the Compositor FileOutput
node.
2020-03-27 10:10:54 +01:00
d0b0a0a894 Fix T74927: Slow playback using Auto Normalization
Caused by rBedb3b7a323a1.

Using evaluate_fcurve_only_curve actually causes quite a bit of slowdown
[6x] compared to bezier forward differencing [which was used prior to
rBedb3b7a323a1]. But full fcurve evaluation is desired with Dynamic
Interpolation Effects [Back/Elastic] since their min/max will not be
captured with forward differencing.

So now gain back speed [using bezier forward differencing] and only do
the full fcurve evaluation for dynamic interpolation effects.

Maniphest Tasks: T74927

Differential Revision: https://developer.blender.org/D7196
2020-03-27 09:58:21 +01:00
6eb1004d50 Fix T58439: Info Editor does not show operator reports immediately when
operator cancelled.

Lots of operators return OPERATOR_CANCELLED when no data really changed.
Reports from those operators do not show immediately in the Info Editor
[they only do if the operator returns OPERATOR_FINISHED].

Now also notify the Info Editor in case of OPERATOR_CANCELLED.

Maniphest Tasks: T58439

Differential Revision: https://developer.blender.org/D7238
2020-03-27 09:41:33 +01:00
3b59c11182 Fix T66655: Add-on tool keymap not working after restart
- Use addon keyconfig for registered tools so reloading the keymap
  doesn't clear them.

- Ensure there is a default keymap, needed for addon keymaps
  to be available in the user keyconfig.
2020-03-27 17:38:13 +11:00
95247b4b14 UI: Use Title Case 2020-03-26 21:34:27 -04:00
03ac301102 UI: Spelling Inconsistencies 2020-03-26 21:20:31 -04:00
e1ee4dff8d Cleanup: redundant mask includes 2020-03-27 11:47:04 +11:00
c8b85d32c5 Cleanup: quiet unused function warning 2020-03-27 11:28:46 +11:00
ed86f3edb6 Cleanup: rename WM_modalkeymap API names, matching WM_keymap
Rename:
- WM_modalkeymap_add to WM_modalkeymap_ensure
- WM_modalkeymap_get to WM_modalkeymap_find
2020-03-27 11:28:46 +11:00
5c74b0964b Cleanup: add iterator macros to clang-format
Also rename START to BEGIN (matching BEGIN/END for most iterator macros).
2020-03-27 11:28:20 +11:00
2f149ebbe9 Cleanup: uppercase macros for sculpt iterators, add to clang-format
Also use sculpt prefix for SCULPT_CLAY_STABILIZER_LEN.
2020-03-27 11:27:10 +11:00
Adrian Newton
f1fb3eb975 UI: use pixel unit for generated image dimensions
Differential Revision: https://developer.blender.org/D7171
2020-03-27 00:49:15 +01:00
Adrian Newton
d663c9d8da UI: fix inconsistent modifier menu order for fluid and multiple strokes
Differential Revision: https://developer.blender.org/D7172
2020-03-27 00:45:49 +01:00
Robert Guetzkow
fcd6fac0a7 Fix T74996: material custom properties not displayed for Cycles
Differential Revision: https://developer.blender.org/D7223
2020-03-27 00:44:18 +01:00
Stephan Seitz
02518be634 Cleanup: suppress warning about float-to-int conversion
Differential Revision: https://developer.blender.org/D7212
2020-03-27 00:43:17 +01:00
5cf6689019 Fluid: Removed obstacle levelset optimization
Currently results in unstable particle behavior and incorrect meshing.
2020-03-27 00:16:34 +01:00
b7666f27d3 UI: Address Issues with recent fluid ui changes
See rB337e86148688aa608d007381ee9ca78879050754
2020-03-26 18:49:54 -04:00
Aaron Carlisle
a921a4daad Mantaflow: remove reminents of high res smoke
It appears this slipped through the code review

Reviewed By: sebbas

Differential Revision: https://developer.blender.org/D6760
2020-03-26 16:29:08 -04:00
56e0249489 GPU: Add workaround for faulty default attrib values on some drivers
On some drivers, the default values is not respected correctly.

To workaround this we create a small VBO that contains only 1 vec4 worth of
data and just bind it using glBindVertexBuffer to ensure 0 stride.

This fixes T75069 Instances not rendered correctly by workbench.
2020-03-26 21:10:44 +01:00
afb1a64ccb Fix T60682: adds macOS alias redirection for directories
This adds support for macOS aliases in addition to symlinks. It also adds
support for hidden, readonly and system file attributes.

Contributed by Ankit (ankitm) with modifications by me.

Differential Revision: https://developer.blender.org/D6679
2020-03-26 19:57:30 +01:00
Chris Clyne
d1972e50cb Add option to Copy the active view layer, and add an empty view layer
Modify the view layer add operator (and underlying `BKE_view_layer_add`)
to allow for copying the current view layer, as well as adding a new one
but with all LayerCollections disabled by default (this is important for
heavy scenes where currently adding view layers can take a long time due
to enabling every collection by default).

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D6862
2020-03-26 19:36:51 +01:00
839f0cfa41 Overlay: Fix crash caused by NULL passes 2020-03-26 19:16:57 +01:00
86c61ce64f Cycles: Restore cycles_cubin_cc to working order
Reviewed by: brecht pmoursnv
Differential Revision: https://developer.blender.org/D7136
2020-03-26 11:41:44 -06:00
58ea0d93f1 Cycles/Optix: Add CYCLES_OPTIX_TEST override
This works similarly to the CYCLES_OPENCL_TEST
environment variable to allow testing on unsupported
hardware.

Note: like the OPENCL test override, this is
for *testing* only and bug reports on unsupported
hardware will *not* be accepted at this point in
time.
2020-03-26 11:30:17 -06:00
48ea173a7d Sculpt: Create Face Set by Edit Mode Selection
This implements a new mode in the Face Sets Create operator to create a
new face sets from the faces selection in edit mode. This can be used
when the user considers that the edit mode tools are more convenient for
a more precise control or a certain type of selection, like creating a
face set from a face loop.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D7211
2020-03-26 16:24:21 +01:00
99530ef4ed Sculpt: Face Sets Init operator
This operator initializes all face sets in the sculpt at once using
different mesh properties. It can create face sets by mesh connectivity,
material slots, face normals, UV seams, creases, sharp edges, bevel
weights and face maps.

For properties that are already in the faces, this is implemented as a
loop. Properties that depend on edge attributes use a similar operation
to sculpt flood fill, but using face adjacency instead of edge vertex
connectivity.

As Multires also stores the face sets in the base mesh, this should work
in the face sets Multires implementation without any changes.

This is implemented as a separate operator as this resets the visibility
and creates all face sets at once, while the create face set operator
creates a single face sets, leaving the rest of the face sets in the
mesh as they are.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D7209
2020-03-26 16:20:24 +01:00
Pablo Dobarro
a218be3080 Sculpt: Surface Smooth Brush and Mesh Filter
This implements the Surface Smooth Brush as a mode inside the Smooth tool,
which uses the HC algorithm from "Improved Laplacian Smoothing of Noisy Surface Meshes".
Comparted to the regular smooth brush with laplacian smooth, this brush removes
the surface while preserving the volume of the object.
The smooth result can be controlled by tweaing the original shape preservation,
displacement and iteration count.
The same surface smooth operation is also available as a mesh filter.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D7057
2020-03-26 16:13:47 +01:00
a0437c3f73 Fix T75087 Workbench: DoF: Divide By Zero when antialiasing is disabled 2020-03-26 16:03:48 +01:00
f5ac118fb3 Sculpt: Use uchar to store the sculpt mask in the GPU
Using a float to store and render the mask seems like a waste of memory
without any noticeable difference in the viewport for its use case.
After this commit, the mask and the face sets combined should take the
same amount of GPU memory than only the mask in previous versions.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D7148
2020-03-26 16:02:30 +01:00
e000dcb849 Overlay: Wireframe: New method to avoid zfighting with geometry
This new method is only enabled if Overlay Smooth Wire is enabled.

This method gives really nice results but has some downside:
- Require a depth copy or loose the ability to write wire depth to the
  depth buffer and have correct depth ordering of wires. This patch use the former, with its associated cost.
- Require some depth sampling and prevent early depth test (i.e: has
  some performance impact).
- Has some relatively minor instability with geometry that are perpendicular
  to the view and intersecting with other geometry.

Pros:
- Compared to a fullpass approach this is surely going to have less
  performance impact and much higher quality.
- Removes the additional vertex offset. (see T74961)
- Fixes all half edges z-fighting.

{F8428014}

{F8428015}

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7233
2020-03-26 15:55:16 +01:00
458f50ba73 Fix T74780: Face sets operators not aware of SCULPT_FACE_SET_NONE
SCULPT_FACE_SET_NONE default value is 0 and it is rendered hidden, so
the invert sign operation to show it was not working. Now the show all
function sets this face set to ID 1 before setting its sign.

I also refactored this check in gpu_buffers.

Not related to the reported issue, but the mesh in attached contains non
manifold geometry with hidden loose vertices, so the visibility state
was not syncing correctly to those vertices. Now the toggle operators
checks the current visibility only on the face sets, so no manifold
vertices are ignored (as they are in the rest of operations in sculpt
mode).

Reviewed By: jbakker

Maniphest Tasks: T74780

Differential Revision: https://developer.blender.org/D7188
2020-03-26 15:50:25 +01:00
83947ea253 Fix T74761: Reimplement vertex to face sets visibility sync
This fixes multiple issues:
- Adds tag to update shading when changing vertex visibiliyt. This makes the mesh visibility update when the operator ends.
- Sync vertex to face sets no longer requires the pmap, so it does not crash. (Maybe we can initialize the pmap on undo to avoid these problems in the future).
- Sync vertex to face sets now works in a coherent way with the rest of visibility operations. Hide Box and Hide mask now sync the visibility changes to the face sets, so the all the operations are now getting a correct visibility state.

Reviewed By: brecht

Maniphest Tasks: T74761

Differential Revision: https://developer.blender.org/D7187
2020-03-26 15:44:50 +01:00
c286fa309e Fix T74899: Add Draw Face Sets brush to versioning defaults
Brushes are created automatically when the tools is enabled, but this
way it gets correct defaults and it is accesible from scripts.

Reviewed By: jbakker

Maniphest Tasks: T74899

Differential Revision: https://developer.blender.org/D7199
2020-03-26 15:41:10 +01:00
32bb848838 Fix T74692: Do not draw nodes with the default face set
The default face set color is white, so we can skip drawing the default
face set. This allows to enable again the optimization of not drawing
overlays in nodes where the mask is empty.

This will still slow down the viewport when a new face set is created
for the whole mesh or when inverting the mask, like in previous
versions.

I also renamed the function to make more clear that now it is checking
for both mask and face sets.

Reviewed By: brecht

Maniphest Tasks: T74692

Differential Revision: https://developer.blender.org/D7207
2020-03-26 15:39:41 +01:00
c32cf06e42 Fix T74808: Division by 0 in Cloth brush solver with overlapping vertices
This checks that the distance of the current positions of two connected
vertices is not 0 before calculating the correction vectors for those
vertices.

Reviewed By: jbakker

Maniphest Tasks: T74808

Differential Revision: https://developer.blender.org/D7184
2020-03-26 15:38:17 +01:00
4ff3d5aded Fix T75089: Missing pmap when using Face Sets in the mesh filter
When using Face Sets to mask the mesh filter the pmap needs to be
initialized to check the face sets of each vertex, otherwise it will
crash because it is null.

Probably now we should just initalize the pmap when building the PBVH as
almost all tools need it, so we can avoid these crashes in the future.

Reviewed By: jbakker

Maniphest Tasks: T75089

Differential Revision: https://developer.blender.org/D7236
2020-03-26 15:36:35 +01:00
Jeroen Bakker
7ed3ebbc6e Fix T67888: Incorrect Wireframe After Applying SubSurf/MultiRes
Show control edges stores the control edges in the mesh which is
picked up by the draw manager. When applyng a subsurf (or multires) we
don't want that data present in the base mesh. Any rebuilding of the mesh
would overwrite the data anyway.

This patch introduces a new flag for applying modifiers
that can be checked to ignore storing display specific data in
the base mesh.

Reviewed By: Brecht van Lommel

Differential Revision: https://developer.blender.org/D7163
2020-03-26 15:34:53 +01:00
Jeroen Bakker
2e8fb95e7c SubDiv: Incorrect normals loose edges
The normals of loose edges can be non uniform as they aren't normalized.
Checked with what happens with edit loose edges and synchronized the
implementation.

Reviewed By: Brecht van Lommel

Differential Revision: https://developer.blender.org/D7127
2020-03-26 14:35:27 +01:00
0545a84729 Fix Crash In Paint Overlay
The previous implementation tested the normal behavior and ignored some
edge cases. This patch will also test for NULL in all cases
2020-03-26 14:16:17 +01:00
Jeroen Bakker
1ca1744c29 Fix T70807: Weight Paint Overlay XRay
Weight paint overlay was not working when XRay was turned on.

The Weight Paint overlay is rendered directly into the default
framebuffer with a depth equal test. This test fails as the depth won't match.
This patch will update the depth buffer in these cases.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D7176
2020-03-26 13:35:06 +01:00
1b1c683f74 Fix missing text input on Windows with certain keyboard layouts
Events for keys specific to certain keyboard layouts unknown to Blender
were ignored. Now pass them along as unknown key events for which we
can still handle text input, like we already do for Linux and macOS.

Differential Revision: https://developer.blender.org/D7229
2020-03-26 09:22:47 -03:00
622e1591da GPencil: Fix unreported fade object when no Gpencil object is selected
Only must fade if the active object is a GPencil.
2020-03-26 13:17:22 +01:00
a093112696 CMake: Fix compilation with Xcode generation on Xcode 11.4
Need to give correct SDKROOT.
2020-03-26 13:07:52 +01:00
bd2b1a67a7 Fix T74939: Random Walk subsurface appearance in OptiX does not match other engines
Random Walk subsurface scattering did look different with OptiX because transmittance is
calculated based on the hit distance, but the OptiX implementation of `scene_intersect_local`
would return the distance in world space, while the Cycles BVH version returns it in object
space. This fixes the problem by simply skipping the object->world transforms in all the
places using the result of `scene_intersect_local` with OptiX.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7232
2020-03-26 13:00:09 +01:00
08b9b95147 Fix T75047: Number input advanced mode is not working in JP keyboard
Check for special ascii values for number input first so that we can
quickly decide if we should go into advanced mode.

Reviewed By: Bastien
2020-03-26 12:45:09 +01:00
90e8f94558 Fix T75094: Gpencil Selection mode crash in Vertex Paint when build modifier is used 2020-03-26 12:34:02 +01:00
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
ef2bde11d2 CMake: Fix spelling for OpenImageDenoise package
The spelling should match exactly between how package is called in
find_package and in FIND_PACKAGE_HANDLE_STANDARD_ARGS.
2020-03-26 11:35:51 +01:00
a22471f1d1 CMake: Fix macOS SDK detection with latest Xcode and macOS
Happens on macOS 10.15.4 and Xcode 11.4.

The reason of failure is caused by following factors:

- xcodebuild reports full semantic macOS SDK version 10.15.4
- The actual SDK file path will only include major and minor part
  of the version (10.15, MacOSX10.15.sdk)
- Previous CMake code of ours expected direct match between SDK
  version and file path.

The solution is to make our detection code a bit more flexible and
additionally check for major.minor macOS SDK version in the path.
2020-03-26 11:35:51 +01:00
f9590c8eaa CMake: Remove support of Xcode prior to 8.2
The specific goal of this change is to get rid of separate code paths
for older and newer Xcode versions.

The version 8.2 is picked since it's the latest version which runs on
macOS 10.11 (which is our current deployment target). If that turns
out too new for some reason the alternative would be to require Xcode
version 5.
2020-03-26 11:35:51 +01:00
c547d431eb Fix T75093: GPencil eraser selection in draw mode erase previous selected points
The selection in Draw mode works as a quick eraser and must erase only the points selected in that operation and not any previous selected point.

Now, before erase, unselect any previous selected point.

Note: It's planned to split select & erase operators for Draw mode.
2020-03-26 10:19:16 +01:00
e8dd96516c Keymap: disallow modal key-maps in add-ons keyconfig
Disable functionality reported in T60766 & only partially worked.

This could be used if the key-map was added after Blender started
as a way to customize modal key-maps, however it didn't work with
the add-on enabled on startup.

Add-on key-maps are intended to extend existing key-maps
so they can call the add-on, not as a way to change modal key-maps
for Blender's built-in functionality.

Disable this since it's not needed as add-ons
can't yet define modal key-maps.
2020-03-26 19:11:50 +11:00
03b2fc1a61 CMake: Cleanup, remove unneeded version requirement
The main CMakeLists already requires CMake 3.5, so there is no point of
requiring "newer" CMake on macOS.

This was a code from a while back where CMake 3 was not required on all
platforms.
2020-03-26 09:02:10 +01:00
fd262d3196 CMake: Fix detection of Xcode version
Legacy code did not take into account the fact that major version can
be two digits. This was causing "Xcode 11.4" to be detected as "11.".
2020-03-26 08:59:08 +01:00
09b8cdb25e Subsurf: Enable Optimal Display by default
Affects both Subdivision Surface and Multires modifiers.
2020-03-26 08:42:29 +01:00
b2f04fce2d Fix T75062: Frame Flashes During 3D Viewport Animation Playback
This issue became visible after fixing other TAA issues recently.
The sample count of the first frame wasn't reset resulting that the
incorrect resolve took place. This issue was already there beforehand,
it is just much clearer during the recent changes.

Now the `taa_sample will be reset when performing an animation playback
in the 3d viewport.
2020-03-26 08:22:52 +01:00
bae9553848 Test: update bl_run_operators blacklist, add volume object 2020-03-26 15:42:52 +11:00
Matt Rossman
eca52402bc Fix T75081: RNA path For FFMPEGSettings missing 2020-03-26 15:38:46 +11:00
b2b6099666 Cleanup: redundant cast, unused arguments 2020-03-26 15:37:33 +11:00
e990e55eba Fix crash with missing NULL check accessing grease pencil paint 2020-03-26 15:32:40 +11:00
a9394aa48e Fix crashes accessing inactive screen properties 2020-03-26 15:32:40 +11:00
38b211b581 Fix crash accessing length unit settings 2020-03-26 15:32:40 +11:00
0a34e5b300 Fix crash accessing the tool with no active space 2020-03-26 15:32:40 +11:00
33da997193 Fix crashes from various missing checks in operator poll functions
Issues exposed by 'bl_run_operators.py' utility.
2020-03-26 15:32:40 +11:00
52cff88f72 Fix crash when make proxy failed to assign a proxy 2020-03-26 15:32:40 +11:00
a8e749f624 Fix crash setting the brush with the current brush was unset 2020-03-26 15:32:40 +11:00
ffd26b420c Fix crash closing a window in background mode 2020-03-26 15:32:40 +11:00
7354f07ead Cleanup: use doxy sections & add missing sections 2020-03-26 15:32:40 +11:00
ba8d819c9b Fix T74417: Freestyle render removes image texture users
This simplifies freestyle render pipeline integration so we don't have to do
much manual ID user management at all. The complexity here was legacy from
Blender Internal.

Based on fix provided by Sybren A. Stüvl.
2020-03-26 01:29:20 +01:00
366cb3a059 Fix T74711: tiling brush option in image editor not working anymore
This makes it work again at least for the non-UDIM case. For UDIM it's not
great still but I'll consider that a known limitation. A proper solution is
probably to find the closest tile at the start of the stroke and then only
paint in that one tile for the rest of the stroke.
2020-03-26 00:02:06 +01:00
99e693d126 UI: rename image source Tiled to UDIM Tiles for easier discovery 2020-03-25 23:29:46 +01:00
d554cf8dd9 Fix T75090: crash with old NVIDIA drivers after overlay refactor
Work around GLSL compiler bug with backslash in preprocessor macros.
2020-03-25 23:14:50 +01:00
6681a33a6f GPencil: Fix unreported Threshold parameter visible in wrong context
The threshold only must be vsisible in Segment mode.
2020-03-25 18:46:45 +01:00
acd84ab105 GPencil: Fix unreported missing parameter for Cutter tool 2020-03-25 18:46:45 +01:00
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
59aaba739d Cleanup: typo in print 2020-03-25 16:52:04 +01:00
68e341e9d5 UI: remove non-unicode font and simplify default font loading code
There is no need to have another font embedded in the Blender executable, we
can assume the bundled font exists. In the future we may provide a fallback
if the font specified by the user in the preferences is missing a character,
but that can use our bundled international font.

Differential Revision: https://developer.blender.org/D6854
2020-03-25 16:39:58 +01:00
9070999c21 UI: always use international font
This means Blender can display more text correctly without having to enable
user interface translation. Previously the quality of the font was lower,
but that has been fixed now.

The font files have now been ungzipped, which results in faster file loading
as Freetype can read only the parts of the file that it needs. Blender download
size should not increase since the release package is compressed.

This includes improvements for Cyrillic characters from the latest DejaVu
Sans fonts from D6960, contributed by Harley Acheson. Fixes T74097.

Differential Revision: https://developer.blender.org/D6854
2020-03-25 16:39:37 +01:00
f48d15a861 Cycles: limit number of processes compiling OpenCL kernel based on memory
The numbers here can probably be tweaked to be better, but it's hard to
predict and this should at least avoid excessive memory swapping.

Fixes T57064.
2020-03-25 16:39:37 +01:00
e5f7b31dd4 Fix VR viewer offset on session start with no positional tracking
The current viewer pose position as determined by the OpenXR runtime
would be applied as offset. This offset should however only be set when
toggling the positional tracking while the session already runs.
2020-03-25 16:09:39 +01:00
04ab677761 Fluid: Small fix for secondary particles
Small tweak to ensure index will not run out of bounds during secondary particle computation.
2020-03-25 16:08:05 +01:00
035a3760af Alpha hash support for hair in EEvee
This patch adds support for alpha hash for hair rendering in EEvee.  Here's a comparison of with alpha hashing:

{F7588610}

And no alpha hashing:

{F7588615}

Note that this needs "soft shadows" enabled, otherwise shadows will be noisy; here's a render with soft shadows disabled:

{F7588621}

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D5221
2020-03-25 15:45:24 +01:00
b4c05a9c89 Cleanup: use doxy sections 2020-03-25 21:24:59 +11:00
567212c343 Fix T74846: UV gizmo swaps X/Y 2020-03-25 19:42:41 +11:00
1587eb16d8 Cleanup: use const to for some mask arguments 2020-03-25 19:32:44 +11:00
4c57f07a0f Cleanup: move mask queries into own file
Similar functions to lookup nearest mask points were in mask_add.c
& mask_edit.c
2020-03-25 19:06:17 +11:00
2bc791437e Cleanup: use 'r_' prefix for output arguments
Also pass some args as 'const'.
2020-03-25 17:58:58 +11:00
c3764fe1e8 Cleanup: update doxy sections 2020-03-25 16:36:01 +11:00
188ccfb0dd Fix T74662: Prefetching causes random crashes
Caused by 18b693bdbd, due to lack of thread safety.
Beteween calling BKE_sequencer_cache_get_num_items and BKE_sequencer_cache_iterate
New items could be inserted in the cache.

BKE_sequencer_cache_iterate() now use 2 callbcack functions for initial setup
during which buffers with correct length can be initialized and finally iterating.

Additionally drawing of unselected items was fixed again introduced in 18b693bdbd.

T74662 is reporting quite different symptoms, than I get on my machine, so I am not
entirely sure this is complete fix.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7220
2020-03-25 00:23:06 +01:00
e1c7549ac9 Fix T75019: Frame Offset does not apply to scopes
Don't check for `sseq->mainb == SEQ_DRAW_IMG_IMBUF`.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7228
2020-03-25 00:09:14 +01:00
8e8fdf875d Windows/Cleanup: Remove VS2015 support from make.bat
VS2015 has not been supported for a while now but make.bat
still had some support for it.
2020-03-24 14:48:23 -06:00
Valentin
27f29cdfba Fix T74038 : Scrolling doesn't work in menu if there is no active item
Fix T74038, the logic didn't handle the case where there was not any button with focus.

Reviewed By: Julian Eisel

Maniphest Tasks: T74038

Differential Revision: https://developer.blender.org/D7208
2020-03-24 21:40:36 +01:00
394a1373a0 Cycles: use OpenCL C 2.0 if available, to improve performance for AMD
Tested with AMD Radeon Pro WX 9100, where it brings performance back to 2.80
level, and combined with recent changes is about 2-15% faster than 2.80 in
our benchmark scenes.

This somehow appears to specifically address the issue where adding more shader
nodes leads to slower runtime. I found no additional speedup by applying this
to change to 2.80 or removing the new shader node code.

Ref T71479

Patch by Jeroen Bakker.

Differential Revision: https://developer.blender.org/D6252
2020-03-24 20:09:36 +01:00
bb26c1359e Add invert mapping option to proximity weight edit modifier, and some cleanup. 2020-03-24 18:28:55 +01:00
Cody Winchester
26ef4fa85e Modifiers: Vertex Weight Edit add invert curve falloff option
This commit adds the option to invert the resulting weights of the
falloff curve.

There is a workflow used by some to convert a texture mask into
vertex weights by using a custom curve and inverting the points.
This allows the same effect with a single click, and gives the modifier
more procedural functionality.

With minor UI tweaks by @mont29.

Differential Revision: https://developer.blender.org/D6899
2020-03-24 18:28:55 +01:00
f3ea8cd608 Overlay: Wireframe: Make facing ratio offset depends on gl_Position.w
This makes the offset dependent of the actual near and far clip distances.
2020-03-24 17:54:30 +01:00
5801a016d4 Cycles: slightly improve OpenCL performance by reordering SVM enum values
Ref T71479
2020-03-24 16:49:46 +01:00
2bec6f1f06 Cycles: work around OpenCL performance regression after AOVs and vector rotate
We appear to be hitting some limit where adding any amount of code causes a
significant performance regression, no matter what it does. To work around
that a new node level was added.

Ref T71479
2020-03-24 16:49:46 +01:00
f8a4fb43fb Cleanup: remove unused Cycles kernel feature flags, replace by node levels 2020-03-24 16:49:46 +01:00
266d243d8d Cleanup: Silence warnings
```
...\gpu_texture.c(466,7): warning C4555: result of expression not used
...\gpu_texture.c(559,7): warning C4555: result of expression not used
...\gpu_texture.c:1205:72: warning: pointer targets in passing argument 4 of ‘glGetTexLevelParameteriv’ differ in signedness [-Wpointer-sign]
```
2020-03-24 12:33:31 -03:00
d5c177bc90 Cleanup: use switch statement instead of if/else on enum value... 2020-03-24 16:26:15 +01:00
a40f2c30ff GPencil: Cleanup previous commit 2020-03-24 16:19:11 +01:00
7ac5c5b08c GPencil: Add blank frame when add layer in Dopesheet
When use the dopesheet add layer operator a new blank frame is created. It's very strange to create a layer and don't see anything in dopesheet.

If the layer is added in properties, the frame is not created.

Reviewed by: @pepeland @mendio
2020-03-24 16:16:47 +01:00
d626ced6f1 GPU: Estimate a better value for the memory used
This commit adds a `mipmaps` member to the `GPUTexture` struct and also
computes to the memory used by these mipmaps and the memory used for
textures that are created from an external bindcode.

So it solves the following inconsistencies:
- The memory value for mipmaps was not being computed.
- As `GPU_texture_from_bindcode` didn't call
 `gpu_texture_memory_footprint_add`, it brought inconsistencies to the
 value of the used memory, especially when the texture is freed.

Differential Revision: https://developer.blender.org/D3554
2020-03-24 12:13:26 -03:00
28c3d952db Fix T74782: WorkBench TAA Artifacts During Painting/Drawing
When the TAA is finished the screen can still be redrawn by other
operations without the TAA resets.
If that happened the TAA did add a blank sample to the result as the
scene wasn't drawn, but the was processed.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D7226
2020-03-24 16:04:09 +01:00
b67b414a85 GPencil: Replace Tint mode "Both" to "Stroke and Fill" 2020-03-24 16:01:59 +01:00
b759857825 Revert "Fix T74782: WorkBench TAA Artifacts During Painting/Drawing"
This reverts commit 58ac113b76.
2020-03-24 14:02:16 +01:00
Michael Soluyanov
88adfc7e54 Fix missing grid theme option for Movie Clip Editor
The theme color is used in code, but not exposed in RNA and therefore
there's no button in the theme editor for it.

Reviewed by: Julian Eisel
Differential Revision: https://developer.blender.org/D7219
2020-03-24 13:49:22 +01:00
28827b62f7 Fix T64573: RNA_path_from_ID_to_property fails for pointcaches
Give pointcaches a proper path function which e.g. also resolves
ALT+click (assign to all selected) not working for anything relating to
pointcaches.

This also cleans up the usage of the 'eModifierTypeFlag_UsesPointCache'
flag (removed from the boolean modifier, added to the softbody modifier).

Maniphest Tasks: T64573

Differential Revision: https://developer.blender.org/D7115
2020-03-24 10:52:38 +01:00
02f7a6b2bd Fix T74744: Studio Lights editor not updating in realtime when tweaking
the settings

Caused by rBc476c36e4008.

This hooks into the existing FIXME (workaround for a missing update
tagging), reactivates the NS_VIEW3D_GPU notifier (introduced in
rB2ad3d8f158d2 -- but not going anywhere atm.) to check changes to rv3d
rflag which indicated UserStudioLight has changed. To not have updates
all the time, the rflag also needs to be cleared again (see original
rB2ad3d8f158d2).

Maniphest Tasks: T74744

Differential Revision: https://developer.blender.org/D7194
2020-03-24 09:58:25 +01:00
ed44bb902d Fix T74872: Clipping Region not updating
Caused by rBc476c36e4008.

This hooks into the existing FIXME (workaround for a missing update
tagging), needs to also check the clip_state (to detect
changes in DRW_STATE_CLIP_PLANES).

Maniphest Tasks: T74872

Differential Revision: https://developer.blender.org/D7193
2020-03-24 09:54:28 +01:00
a6dd22d431 Fix T74957: Matcap flip not updating
Caused by rBc476c36e4008.

This hooks into the existing FIXME (workaround for a missing update
tagging from operators), needs to also check the shading.flag (to detect
changes in V3D_SHADING_MATCAP_FLIP_X).

Differential Revision: https://developer.blender.org/D7192
2020-03-24 09:50:09 +01:00
579447bd89 Fix T74096: Paint Masking overlay can`t be hidden
Caused by rB9516921c05bd.

Dont really see a reason to draw overlays here if overlays are disabled.
Looks like this only affects Face/Vertex mask selection drawing [which
should indeed be hidden when overlays are disabled] next to two
exceptions:

- OVERLAY_paint_vertex_cache_populate draws weights as well [D7176 /
T70807 might be related here, but to me it looks like drawing weights
here is actually not needed at all]

- OVERLAY_paint_texture_cache_populate calls
DRW_cache_mesh_surface_texpaint_get [not sure about this one, this is
also called from workbench_cache_texpaint_populate, looks like this is
not needed when overlays are hidden]

Maniphest Tasks: T74096

Differential Revision: https://developer.blender.org/D7179
2020-03-24 09:44:42 +01:00
Habib Gahbiche
6e4eb2be28 RNA: expose comparison tolerance for Mesh.unit_test_compare 2020-03-24 19:41:46 +11:00
cd02495479 Fix T75036: Assert when copying pose bones 2020-03-24 17:54:06 +11:00
3d3a91103b Doc: remove MeshTessFace reference 2020-03-24 16:26:07 +11:00
Henrik Dick
bb19d96bc5 Fix solidify complex degenerate cases with duplicate faces
The removal of duplicate faces that are created during the handling of
degenerate cases was implemented already but didn't work.
This patch should fix some crashes with the solidify complex mode
related to that.

See D7221 for details.
2020-03-24 16:17:22 +11:00
15b0c76480 UI: add Blender -> System menu
Include technical operators here so they're available
when using menu-search.
2020-03-24 14:11:31 +11:00
c46dcdf887 UI: add menu search functionality to operator search menu
This has some advantages over operator search:

- Some operators need options set to be usefully accessed.
- Shows key bindings to access menus
  (for actions that don't have key bindings themselves).
- Non operator actions such as check-boxes are also shown.
- Menu items can control execution context, using invoke or execute
  where appropriate so we can control how the operator runs.

Part of the design task T74157.

This can be tested using the 'Experimental' preferences section
or selected in the key-map editor.
2020-03-24 13:41:18 +11:00
94b8166a8b Cleanup: clang-format 2020-03-24 10:42:29 +11:00
d0d251b53b Cleanup: spelling 2020-03-24 10:36:42 +11:00
9c280630c9 Fix invalid comma use 2020-03-24 10:17:52 +11:00
cda81d5a4d Fluid: Enforce minimum thickness to planar flow / effector objects
Planar object now have a thickness by default. This should make it more intuitive for users as there is no need to specify an object thickness.
2020-03-23 23:50:39 +01:00
e9629e3cfd Fluid: Use different phi for levelset generation
Phi that is used for mesh should be the one that matches particles best.
2020-03-23 23:50:39 +01:00
1b5b6a5da8 Fix T73505 EEVEE: Group output node sockets default value not working
This just cleanup the code and apply the expand to group output nodes.
2020-03-23 23:50:32 +01:00
765c82e92d Fix possible endless loop in Auto Merge & Split 2020-03-23 17:40:08 -03:00
b701af328a Revert "COW: Edit Mesh: Do not copy the looptris pointer"
The looptri is repeated in the linked Meshes but the pointer
is only referenced in the evaluated ones.

This reverts commit 64982e213f.
2020-03-23 14:18:36 -03:00
ed386507e1 Fix T74984: Crash opening specific production files
More detailed symptoms: there was no curve cache created for an object
which was used by draw manager.

A bit tricky situation, which involves collection instances and their
proxies.

The root of the problem in the dependency graph was that instanced
collections visibility was not updated when object is requested with
different visibility. So what was happening is that one of the objects
was pulled as an indirect dependency of something invisible, so it
built instanced collections as if the instancer is invisible. After
that the same object was built as visible. Before this fix this was
only update object flags, the instanced collections still believed they
are invisible. Since there is no path via relations which would connect
visible object with instanced objects the visibility flush which is
happening during graph finalization did not "fix" the visibility flags.

This change makes it so instanced collections are updating their
visibility when their instancer's visibility is changing to truth.
This is similar to how collections will accumulate their visibility
when same collection is used from multiple ones with different
visibility.

However, this alone wasn't enough to get crash fixed. This marked
collections as visible, but the geometry component of the curve object
was still considering self as invisible.

This is something tricky, since the code which is responsible for this
issue was added as an optimization in afb4da6650. This looks like like
an oversight in that commit since it's rather weird that ID node's
flag would depend on construction order (in "normal" object builder the
ID node's directly_visible flag is initialized to object's visibility).
So it seems logical to get this part of code in sync between "regular"
and "accumulative" object builder.

And last but not least the naming is_directly_visible is old and does
not really represent what it actually mans now: a more correct name
would be "will be used by the draw manager".

Differential Revision: https://developer.blender.org/D7217
2020-03-23 17:19:44 +01:00
58ac113b76 Fix T74782: WorkBench TAA Artifacts During Painting/Drawing
When the TAA is finished the screen can still be redrawn by other
operations without the TAA needs to be reset.
If that happened the TAA did add a blank sample to the result.

This patch will add an early exit in the case TAA was finished. Note
that there are still some cases still not working. The overlay engine
can in certain circumstances draw directly into the default_fb what can
lead to render artifacts.
2020-03-23 17:10:01 +01:00
24b27ea231 Bump subversion for previous theme additions 2020-03-23 16:43:54 +01:00
Michael Soluyanov
c95b522856 UI: Theme options for checkerboard pattern colors and size
This patch adds ability to set up colors and size of background
(transparency) checkerboard pattern in viewport and 2d editors. No new
backgrounds, only changing colors in existing ones.

This is not the background of the viewport, it is a transparency
checkerboard that is turned on only in render mode, when the
transparency mode is on. And also in 2D-editors, (image, sequencer,
etc).

Reviewed By: Pablo Vazquez, Julian Eisel

Differential Revision: https://developer.blender.org/D6791
2020-03-23 16:35:29 +01:00
88a86c025c Deps: TBB changed their repository URL
As a result the MD5sum of the downloaded package also changed.
2020-03-23 16:04:52 +01:00
Henrik Dick
241248223a Change solidify's material offset in complex mode to conform with simple mode
this patch will change the behaviour of the material offset in complex mode to fit simple mode output.
Previously in complex mode this would offset the material of the enire shell,
because when you read the tooltip it says material for new generated geometry.
In complex mode everything is new generated geometry though.
In simple mode on the other hand, this would give you a way to only change the inside faces
material. There may be cases in large modifier stacks where material offset like it is implemented
currently in complex mode may be useful, but it is much more useful in the way it is implemented
by simple mode.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D7215
2020-03-23 15:39:48 +01:00
Henrik Dick
ee4645207f Fix T74195: Solidify Complex Dissolve Crash.
I also added a few more comments to the code as I gone along.

Maniphest Tasks: T74195

Differential Revision: https://developer.blender.org/D7214
2020-03-23 15:22:31 +01:00
f9855800e0 Depsgraph: Driver Relations, skip finding possible relation with one driver
The `build_driver_relations()` function in the depsgraph relations builder
adds relations between drivers that potentially write to the same memory
location. This of course is only useful when there are two or more drivers.
2020-03-23 14:54:07 +01:00
7192a1bca3 Fix T73593: Drivers on hide_viewport and hide_render are unreliable
My previous fix (rB4c30dc343165) worked, except for an off-by-one error.
2020-03-23 14:54:07 +01:00
0b116a84c9 Fix T74923: Weight Painting Overlay Invisible for In Front Objects
For In Front Objects we need to use the in front depth buffer.

This patch will use the in front depth buffer and also makes sure that
it is filled with the center pixel depth.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D7216
2020-03-23 14:03:39 +01:00
6a5bd812b5 Fix T74586: Image Editor Uses Invalid Display Channels
When using the image editor the display channels attribute can become
invalid when selecting another image/buffer. This patch will check what
display channels are valid and when an invalid channel is selected it
will fall back to the color channel.

To de-duplicate the code it also introduces a
`ED_space_image_get_display_channel_mask` function that will determine
the valid bitflags for the display channel of a given `ImBuf`.
2020-03-23 13:56:42 +01:00
64982e213f COW: Edit Mesh: Do not copy the looptris pointer
No functional changes.

Differential Revision: https://developer.blender.org/D7173
2020-03-23 09:30:26 -03:00
bceb91ffd2 Sound: Fix asymmetrical mutex lock/unlock logic
Started to happen after recent fix for T72632.

Was caused by runtime fields backup doing an early exit in the case the
given ID was never expanded by the Copy-on-Write mechanism, but it was
not done int the backup restore function (since it was not possible to
know "locally").

Now both init() and restore() will do an early exit when the ID had
nothing to be backed up.
2020-03-23 09:55:15 +01:00
0710fb724b Fix T72632: Blender crashes using Jack with AV Sync enabled (repeatable) 2020-03-23 09:34:26 +01:00
46c0da6e69 Fix T74964: Stereo Viewport Rendering Not Working
On some platforms the stereo viewport rendering was not working. The
issue was that the fragment shader and vertex shaded didn't match. Some
platforms will remove the non-matching in/out parameters and blender
needs to provide only the optimal set of parameters. Other platform
still want to receive data for the parameters that aren't used.

This fix uses the correct vertex shader that matches the fragment shader
making both platforms render the same result.
2020-03-23 09:10:37 +01:00
0c571db4ad Fix T73988: Mantaflow fluid simulation - Particles for Spray, Foam and Bubbles are one frame ahead of Mesh
Fixes an issue with secondary particles being out of sync with the main simulation. Cleaned up the secondary particle code in general too (making sure that all solver attributes - timestep, framelength, etc. - are set correctly).
2020-03-22 21:46:43 +01:00
95b6090afc Fix T75018: Dirty vertex colours missing tooltip 2020-03-22 21:40:31 +01:00
ad7bb8e42c Cleanup: spelling, correct Mesh.mface docs 2020-03-22 12:17:25 +11:00
1e4f6b231c Cleanup: use static declaration 2020-03-22 11:51:15 +11:00
9e8afa8817 Fix OpenXR SDK failing to compile with no JsonCpp installed
Force the SDK to use its own, bundled JsonCpp sources.
2020-03-21 21:58:17 +01:00
1e8dfe79c6 GPencil: Fade to Viewport color
Actually, the fade objects always fade to Black color, but this is not a good solution.

This patch fade the object to the viewport color.

Differential Revision: https://developer.blender.org/D7206
2020-03-21 20:29:17 +01:00
c589fdc8db Fix install_deps.sh ignoring --skip-xr-openxr 2020-03-21 19:03:56 +01:00
44c6b6615b OpenCL: Bring back CYCLES_OPENCL_TEST override
Back in 2.79 you could either use the debug panel or an
environment variable to override using OpenCL for unsupported
hardware. Which was rather useful for developers when testing
on NVidia just to be sure the CL kernels at-least build properly.

This broke in rB949ab753bb2

This diff restores testing though the CYCLES_OPENCL_TEST
environment variable.

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

Reviewers: brecht
2020-03-21 11:55:45 -06:00
3033b2a044 Fix T73372: cryptomatte not filling last pass for odd number of levels
Make logic consistent with the render pass creation in Python.
2020-03-21 15:04:12 +01:00
ada28d3c65 Fix T67712: cryptomatte sockets created in wrong order in some cases
Simplify the logic and always create node outputs in the order specified
by the render engine, I can't see a reason why built-in passes must be
first.
2020-03-21 15:04:02 +01:00
c0544eedc6 Fix crash with empty volume object and points drawing 2020-03-21 14:43:47 +01:00
0dbbb2eabf Cleanup: compiler warnings 2020-03-21 14:40:51 +01:00
d924e31b42 GPencil: New Hardeness mode for Opacity modifier
Add  new option to change the stroke hardeness. This option works at stroke level, not at point level.

Also replaced the "Both" name mode by "Stroke and Fill".

Differential Revision: https://developer.blender.org/D7195
2020-03-21 09:48:18 +01:00
a22cd6b6a9 UI: Weight Paint: add a menu for locking and unlocking vertex groups.
This is a follow up on rBa1e50cfe6b4dbc360b6118c63a0dc7445023c37b
2020-03-20 20:07:42 -04:00
9607e54985 Fix T74959: Need to be explicit about UTF8 encoding in py.
Because some OSs are still using old 8bits specific encodings... Angry
eye @windows...
2020-03-20 20:52:52 +01:00
3d9d132ccd GPencil: Fix unreported slow transform with proportional edition
Now a hash is used to avoid double update of the same stroke. The old method was not correct with proportional edition.
2020-03-20 20:03:23 +01:00
a696053545 Python API: add bl_use_stereo_viewport for RenderEngine
To indicate if the render engine supports rendering a stereo 3D viewport.
This is not currently supported for Cycles.

Fixes T62582
2020-03-20 16:09:49 +01:00
6777956005 Fix T68370, T74973: Cycles cryptomatte not working when other passes are enabled
Solution found by Blazej Floch.
2020-03-20 15:59:24 +01:00
db65a6e0fb Fix T74345: missing albedo for Cycles principled hair BSDF 2020-03-20 15:23:39 +01:00
0127e8522a Fix Python error in Cycles baking panel 2020-03-20 14:25:16 +01:00
36b55bee42 Fix T74649: Outliner: Cannot set/clear parent with 'Keep Transforms'
Parenting in the outliner via drang and drop would always happen without
the 'Keep Transforms' option. Since this is often desired, this adds the
ability to hold Alt for doing this to the drop action.

Adding the hint to hold Alt to the operator name is not nice, but since
the operator name is used for the UI, there doesnt seem to be a nicer
way of doing this.

If modifier keys are needed back for other actions, spawning a menu
instead could be an alternative for the future.

Maniphest Tasks: T74649

Differential Revision: https://developer.blender.org/D7120
2020-03-20 13:24:05 +01:00
27553a2e4e Multires: Fix assert when removing modifier in edit mode
It is not guaranteed that with Multires modifier existing there
will be CD_MDISPS and CD_GRID_PAINT_MASK custom data layers.

Fixes assert in the following scenario:

- With default cube, go to edit mode
- Add Multires modifier
- Remove the Multires modifier
2020-03-20 12:28:29 +01:00
d931aacef6 Cleanup: Use IDTypeInfo data for id_swap functions.
Part of T74960.
2020-03-20 11:55:34 +01:00
6cbf342cbb Cleanup: Move BKE_libblock_get_alloc_info to using IDTypeInfo.
Part of T74960.
2020-03-20 11:21:02 +01:00
db4d264e70 fix API doc generation after new volume entry in context... 2020-03-20 10:48:30 +01:00
3bab9b4868 Fix T74154: Mantaflow crash: Baking data for domain type fluid on a plane.
Added sanity check to prevent bakes from being triggered when there is no fluid object present.
2020-03-20 10:42:54 +01:00
b8574c7e56 Fix T74885: Stamped lens metadata is wrong when camera lens is animated
The Lens metadata stamped on rendered images was wrong when the camera lens
is animated. This was caused by the render pipeline passing the original
camera to the metadata system, and not the evaluated camera.
2020-03-20 10:15:59 +01:00
86cc29d0cf Multires: Disallow changing mode and quality after subdivision
Avoids possible final object shape destruction since those options
defines how displacement is applied and propagated.
2020-03-20 09:50:00 +01:00
Jeroen Bakker
8ba9efb7d8 Fix T74811: GreasePencil Stereo Rendering
When using grease pencil in a stereo rendering the grease pencil objects are
only visible in the left eye. In the viewport it renders both.

Issue is related that `DRW_render_gpencil` only renders a single view. But
`DRW_render_to_image` renders all views. This patch puts this in a loop to
render both eyes.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D7154
2020-03-20 07:47:04 +01:00
4fc45c7a2b Fix T74643: Outline Overlay Shows Hidden Faces
When in editmode faces can be hidden, but in object mode these faces are
still visible. The flag if a face was hidden in edit mode is stored in
object mode, but should not be used.

The edge detection gpu batch did detect hidden faces and didn't add them
to the draw batch. The edge detection gpu batch is used for workbench
shadows, custom bone shapes and object outlines.

This patch adds all faces to the edge detection batch.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D7157
2020-03-20 07:43:31 +01:00
cb560c01b6 Cleanup: clang-format, comment indentation 2020-03-20 12:23:04 +11:00
85dc8d7477 Cleanup: sort file, struct lists 2020-03-20 12:19:44 +11:00
35e3abb912 Cleanup: remove old header conventions recently re-introduced 2020-03-20 12:19:09 +11:00
d2c3544c5c Cleanup: remove debug print accidentally included in own previous commit.
Thanks to @brecht for the heads up!
2020-03-19 22:12:36 +01:00
Adrian Newton
45dbe0be69 UI: use consistent names in theme preferences and editors menu
Differential Revision: https://developer.blender.org/D7087
2020-03-19 21:55:18 +01:00
Luya Tshimbalanga
f974bf2cba Fix invalid Linux appdata.xml syntax
Differential Revision: https://developer.blender.org/D7149
2020-03-19 21:55:17 +01:00
a1322d7c95 Cleanup: fix typos in comments
Contributed by luzpaz.

Differential Revision: https://developer.blender.org/D7133
2020-03-19 21:55:17 +01:00
Adrian Newton
83f171b626 UI: remove unnecessary Shadow from Shadow Samples label in Eevee volumetrics
Differential Revision: https://developer.blender.org/D7161
2020-03-19 21:55:17 +01:00
Yevgeny Makarov
c8b611b67f Fix UI alignment in generator f-curve modifier.
Differential Revision: https://developer.blender.org/D7167
2020-03-19 21:55:17 +01:00
Stephan
da019efde9 Cleanup: silence warnign in volume grid code
Differential Revision: https://developer.blender.org/D7175
2020-03-19 21:55:17 +01:00
817c38f715 PyAPI Docs: Update aud example
Fixes T74641
2020-03-19 16:21:17 -04:00
4b74b35322 Fix Cycles crash in Windows debug mode with volumes 2020-03-19 20:02:33 +01:00
12b621059a Cleanup/refactor: remove BKE_idcode, in favour of BKE_idtype.
Mpving utils from idcode to idtype proved to be somewhat painful for
some reasons, but now all looks good.

Had to add a fake/empty shell for the special snowflake too,
`ID_LINK_PLACEHOLDER/INDEX_ID_NULL`...
2020-03-19 19:39:23 +01:00
0b7854323d Fix typos in names fo new mesh and texture IDTypeInfo. 2020-03-19 19:39:23 +01:00
e1b2ded7b2 Fix build WITH_CXX_GUARDEDALLOC 2020-03-19 14:42:04 -03:00
3be7d74cba Fix T70126: Can't snap between objects with Rigid Body
`DEG_FOREACH_COMPONENT_IGNORE_TRANSFORM_SOLVERS` was `0`
2020-03-19 13:19:15 -03:00
689606887f Cleanup: add extern C 2020-03-19 16:54:09 +01:00
89b0465136 Fix T74908: volume object step size can not be set back to zero 2020-03-19 16:00:40 +01:00
2be14e0ec4 Fix typo in make.bat help for build directory 2020-03-19 15:31:21 +01:00
2982c9ba0a ColorManagement: Incorrect Memory Read for RGB images
When RGB images or BW images are converted to a GPU texture and color
space conversion was needed the images were read incorrectly.

This patch checks the correct amount of channels in the image and uses
that as the correct pixel stride.
2020-03-19 15:26:53 +01:00
9ace7e2439 Fix T74925: Texture Paint Stencil Mask crash
Use first texture if we dont have an ImageUser.

Maniphest Tasks: T74925

Differential Revision: https://developer.blender.org/D7181
2020-03-19 15:18:09 +01:00
42012493a8 Fix T74916: Industry compat keymap: GP Tweak tool acts like the Cursor tool 2020-03-19 14:43:50 +01:00
91c1759956 Fluid: Cleaned up some parts of the fluid modifier UI
Especially when expanding the UI panel horizontally, there were some problems with empty space.
2020-03-19 13:15:39 +01:00
cc516b82ef Fix T74915: Gpencil Tweak tool does not add point to selection holding Shift 2020-03-19 12:11:48 +01:00
885caa4535 Multires: Support "Subdivide" for Simple subdivision type
Is done by considering all base edges infinitely sharp.

In the future can become a different operator option to allow to mix
Catmull-Clark and simple subdivisions. For now just sticking to what
old good Blender versions were doing.

Fixes T74869: Simple subdivision type is not working as it should
2020-03-19 11:59:45 +01:00
e793a47efb Multires: Optimize memory usage further
Avoid storing any loose edges for the propagation process.
Also avoid any edge which crease is zero.
2020-03-19 11:59:45 +01:00
ccb731f2dd Multires: Reduce memory footprint after previous fix
The idea is following: only store information about edges which are

1. Communicated to the OpenSubdiv topology.

   This rules out all loose edges, as they are not needed for the
   propagation process.

2. Correspond to edge from the base mesh.

   This avoids storing edges which are generated between inner face.
   Those are not to have any sharpness to allow smooth propagation.

There is still possible to have memory peak in some obscure case when
mesh contains a lot of loose edges. It can be optimized further by
utilizing knowledge of the non-loose tags.
2020-03-19 11:59:45 +01:00
317a9cf835 Multires: Subdiv, properly support base edge crease
The title says it all actually. The test case is to get default cube,
set some edges to non-zero crease, add multires modifier and hit the
"Subdivide" button few times.

The memory footprint might be optimized by not storing information
about inner generated edges.
2020-03-19 11:59:45 +01:00
6e39445f80 GPencil: Cleanup - Split BKE_gpencil.h geometry functions into BKE_gpencil_geom.h
This split prepare the code for future geometry functions.
2020-03-19 11:38:22 +01:00
e839a25651 RNA: add MetaElem.select & use_scale_stiffness 2020-03-19 21:16:57 +11:00
7e9575f7a1 Fix T74701: Text on Curve Scaling Issue
Both scaling the text itself, as well as scaling the curve wasnt
updating, now added relations for this.

Maniphest Tasks: T74701

Differential Revision: https://developer.blender.org/D7140
2020-03-19 10:43:10 +01:00
b49dbb635a Subdiv: Make Blender crease to OSD sharpness reusable
Makes it so conversion is centralized in a single place.

We might consider removing any conversion, passing value as-is which
will be easier for I/O scripts to match crease. The downside of that
would be loose of control range in certain qualities and values of
crease.

There shouldn't be any functional changes in this commit.
2020-03-19 10:33:51 +01:00
53674fb255 Multires: Add missing context initialization
Might have caused access to uninitialized memory when foreach()
would have failed for some reason.
2020-03-19 10:08:48 +01:00
9dfc480ad1 Multires: Cleanup, typo in type name 2020-03-19 10:01:56 +01:00
ffb95baebe Multires: Store modifier pointer for subdivide
Allows to access its settings during the subdivision process.
2020-03-19 10:01:56 +01:00
2d1cce8331 Cleanup: make format after SortedIncludes change 2020-03-19 09:33:58 +01:00
008aaaa378 Code quality: Enable SortedIncludes
Code quality: Enable SortedIncludes in .clang-format

This patch does not include a `make format`, which will follow suit.

Differential Revision: D6811
2020-03-19 09:33:43 +01:00
Dalai Felinto
473316e246 Cleanup: make format (and adding . to end of comment) 2020-03-19 09:29:47 +01:00
Jeroen Bakker
fd48ff1296 Fix T73931: Stereo Viewport Color Management
Stereoscopic viewport didn't support Color Manangement due recent
changes in the color management pipeline. In order to solve the issue we
will migrate the strereo rendering into the GPUViewport. This will share
some textures and reduce required GPU memory.

Reviewed By: fclem, dfelinto

Differential Revision: https://developer.blender.org/D6922
2020-03-19 08:26:48 +01:00
Jeroen Bakker
fe045b2b77 WindowManager: Remove Stereo Offscreen
Stereo offscreen rendering has been replaced with stereo viewport
rendering. When an offscreen buffer is used it is only used for mono
rendering.

This patch will remove the second offscreen buffer.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D7153
2020-03-19 08:03:40 +01:00
d68d1da1f3 UI: scale sequence handle by pixelsize 2020-03-19 12:28:59 +11:00
f4a60fd85c Cleanup: rename variables which aren't specific to macOS 2020-03-19 12:28:50 +11:00
326ce2d625 Cleanup: declare & assign variables on the same line
Use less vertical space.
2020-03-19 12:28:50 +11:00
07c4c86049 Theme: update blender light theme
Also correct gizmo_view_align color.
2020-03-19 12:18:41 +11:00
b62e1146e1 UI: add view aligned gizmo color
Was hard coded to white making white backgrounds impractical.

D7162 by @billreynish with edits.
2020-03-19 12:09:53 +11:00
014e569258 Cleanup: use '\' for doxygen commands 2020-03-19 12:09:07 +11:00
ed4c47632f Cleanup: spelling 2020-03-19 12:09:07 +11:00
5bf09bbcdf Cleanup: shadow warning 2020-03-19 12:09:02 +11:00
f3e7c1e8c8 Fix building on Linux as '__time64_t' isn't portable 2020-03-19 11:56:02 +11:00
Robert Guetzkow
f70241deba Fix (unreported): Crash on accessing active sequence in select groupped operator
This patch moves the NULL check of `actseq` to the correct position, which should happen
before the `channel` is assigned. Otherwise an attempt to call the `sequencer_select_grouped_exec`,
when there is no active sequence and `use_active_channel` set to true, results in a crash.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D7170
2020-03-19 00:49:46 +01:00
271231f58e VSE: Strip drawing improvements
This patch include changes:
- Thicker and clearer selection indication
- Slimmer handles
- More transparent muted strips
- Trim frame number is drawn inside the strip
- Strip text is drawn in upper part of strip
- Color strips now have specific color, with chosen color drawn under strip text
- Transition strip will use color of input strips showing direction of transition
- Selecting effect strip will highlight input strips
- Selecting multicam strips will highlight target channel
- Missing media state is now indicated by a red line drawn on the top part of the strip
- A checkerboard pattern is now drawn on the outsides of the meta range
- Hold still regions are now always drawn if existent, with a darker shade of the strip’s background color

Author: Alessio Monti di Sopra <a.monti>

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D6883
2020-03-19 00:24:09 +01:00
348d2fa09e VSE: Disk cache
This patch implements dumping images from cache to HDD.
The main goal of this system is to provide a means to achieve consistent playback speed mainly for strips that are not possible to preview in real time.

How to use:
Disk cache has own settings in user preferences for path to storage, size limit and compression level.
To use disk cache, you need to check `Use Disk Cache` box, set `Disk Cache Directory`, `Disk Cache Limit` and save or open existing .blend file.
By default sequencer output will be cached only. Manual setting is possible in cache panel.

Uses:
 - Replacement or alternative for proxies. Disk cache will work with any strip type, supports float images as well.
 - Storage for strip thumbnails.
 - Less RAM needs to be allocated for preview cache

How it works:
Disk cache is extension of RAM cache. Every image, that is stored or deleted in RAM will be stored or deleted on HDD as well. Images can be compressed to save space and for use on slower drives. Compressed images are slower to write and read though.
Images are stored in bulk of 100 rendered frames per one file. This is to overcome slow file access time for large amount of files. Drawback is, that if one frame needs to be redrawn, all 100 frames are deleted.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D5524
2020-03-19 00:07:30 +01:00
c8b4b4c0fa Fluid: Fixed issue with intial velocities in liquid domains
The fix for T74762 (bf9c4af9bb) introduced this issue. Initial velocities were not applied to liquids anymore.
2020-03-19 00:04:13 +01:00
99be00fdb1 Cleanup: Prepare XR code for sorted headers 2020-03-18 20:53:02 +01:00
1935cd4027 Fix T74837: GPencil: Mirror over first selected marker crashes
'mirror_gpf_marker()' needs a NULL bGPDframe for initialization [but
still requires a scene to get the marker].

Maniphest Tasks: T74837

Differential Revision: https://developer.blender.org/D7166
2020-03-18 20:46:22 +01:00
a12ae67cf7 UI: Update the Clay Thumb Sculpt icon
The previous icon was identical with the Thumb icon.

New icon designed by Damian Winnichenko
2020-03-18 20:38:28 +01:00
c102dfd43d Cleanup: Prepare for sorted headers on windows
To prepare for D6811 small changes were needed.
we can no longer undefine near/far since the windows
headers use those extensively.

some of the imbuf files need to include the windows
headers explicitly to make sure it builds.
2020-03-18 13:26:38 -06:00
6bfe7c7a02 Fix (harmless) use of uninitialized variables in Cycles 2020-03-18 19:51:54 +01:00
9a116c7c2d Cleanup: 64 bit file IO on windows.
Unlike Linux where fseek/tell will be either 32 or 64 bit
depending on the target platform, it will always be 32 bit
on windows.

We had some macro magic in BLI_winstuff.h that substituted
them for 64 bit versions, but that is upsetting the system
headers if they get included after BLI_winstuff.h which
is problematic for D6811.

This diff adds proper functions in blenlib and updates
all calls that were using the BLI_winstuff.h header to
gain 64 bit file IO.

note: Anything that was using the 32 bit versions (ie not
including BLI_winstuff.h) will still be using the 32 bit
versions, which is perhaps a good code quality Friday project.

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

Reviewers: brecht dfelinto
2020-03-18 12:13:03 -06:00
ac74a843d2 Fix NULL-pointer dereference after error during VR session start 2020-03-18 18:24:11 +01:00
1a502097c7 Cleanup: Fix build warnings on windows.
Two headers define the _USE_MATH_DEFINES symbol now, if both
are included warnings are generated.

Added some guards, all good again.
2020-03-18 11:23:56 -06:00
c9c08dc7c8 Fix compilation error after recent change 2020-03-18 18:16:18 +01:00
805c4ab6bc UI: Make sure theme UI names are correctly capitalized
Also removed redundant use of 'color' in some instances.
2020-03-18 18:02:35 +01:00
efb53f5181 Fix T74524: tooltip for smoke dissolve time is backwards 2020-03-18 17:54:17 +01:00
b88ca3e6d1 Cleanup: Resolve HKEY conflict
Both the MS headers and blender headers define the HKEY
which gives all kind of inclusion order issues.

This diff renames all *KEY constants to EVT_*KEY to resolve
this conflict.

Reviewed By: brecht , dfelinto

Differential Revision: http://developer.blender.org/D7164
2020-03-18 10:38:37 -06:00
9e382dd2a3 Fix T74542, T74386: schulpt changes not saving (dyntopo or mutires)
Caused by rB2d423479bdea.
Correct check for stroke being painted.

thx also to brecht checking.
2020-03-18 16:41:41 +01:00
237ef0dcc7 Fix T74842: Remove Vertex Paint hotkeys
There were some conflicts with these keys.
2020-03-18 15:49:58 +01:00
7bde3f63dd GPencil: Fix typo error 2020-03-18 15:33:03 +01:00
19df67cd75 Fix build errors with WITH_HEADLESS or WITH_GHOST_SDL
Disable WITH_XR_OPENXR entirely for these cases. For headless XR
features don't make much sense, for SDL support is not implemented.
2020-03-18 15:19:41 +01:00
82fc81816e Fix openXR building with install_deps in some compilers. 2020-03-18 15:11:03 +01:00
efdc93fcc6 Fix T74876: Crash when snapping to faces
The crash occurs after operators change the amount of editmesh looptris.
The looptris of the evaluated object's editmesh are not updated.
2020-03-18 09:58:24 -03:00
52c0742560 GPencil: Remove Panel Grease Pencil and move Use Lights to Visibility
It was too much to have a panel for that.
2020-03-18 13:48:30 +01:00
d8897bed99 Fix headless and Python module build after recent alert icon changes 2020-03-18 13:31:49 +01:00
0af739ae8a GPencil: Remove duplicated Mode parameter from Color Subpanel in Vertex Paint
This parameter is now at Brush level, so it was duplicated in the Color panel.
2020-03-18 13:16:40 +01:00
e843d4e438 Cleanup: Rename variables 2020-03-18 09:10:39 -03:00
b81b127928 GPencil: Remove background to Dopesheet buttons
This was missing in previous commit.
2020-03-18 13:06:09 +01:00
dd416681fb Fix BPY enum property definiton failing if items contain spaces
Mistake in 03a4d3c33f, turns out this actually is called from BPY
(which I didn't think it was). So only error out during makesrna, not at
runtime.
2020-03-18 12:53:36 +01:00
406026abba Cleanup: spelling 2020-03-18 22:28:54 +11:00
c3651adf89 Tests: add OpenVDB volume tests 2020-03-18 11:23:05 +01:00
7537cad576 Volumes: add render settings for volume datablock
* Space: volume density and step size in object or world space
* Step Size: override automatic step size
* Clipping: values below this are ignored for tighter volume bounds

The last two are Cycles only currently.

Ref T73201
2020-03-18 11:23:05 +01:00
Brecht Van Lommel
1162ba206d Cycles: change volume step size controls, auto adjust based on voxel size
By default it will now set the step size to the voxel size for smoke and
volume objects, and 1/10th the bounding box for procedural volume shaders.

New settings are:
* Scene render/preview step rate: to globally adjust detail and performance
* Material step rate: multiplied with auto detected per-object step size
* World step size: distance to steo for world shader

Differential Revision: https://developer.blender.org/D1777
2020-03-18 11:23:05 +01:00
9d20f170c7 Cycles: support for rendering of new Hair object prototype
Ref T68981
2020-03-18 11:23:05 +01:00
994eb1ec17 Cycles: support rendering new Volume object type
Voxels are loaded directly from the OpenVDB grid. Rendering still only supports
dense grid, so memory usage is not great for sparse volumes, this is to be
addressed in the future.

Ref T73201
2020-03-18 11:23:05 +01:00
006025ead0 Cycles: support for different 3D transform per volume grid
This is not yet fully supported by automatic volume bounds but works fine in
most cases that will have mostly matching bounds.

Ref T73201
2020-03-18 11:23:05 +01:00
fd53b72871 Objects: Eevee and workbench rendering of new Volume, Hair, PointCloud
Only the volume drawing part is really finished and exposed to the user. Hair
plugs into the existing hair rendering code and is fairly straightforward. The
pointcloud drawing is a hack using overlays rather than Eevee and workbench.

The most tricky part for volume rendering is the case where each volume grid
has a different transform, which requires an additional matrix in the shader
and non-trivial logic in Eevee volume drawing. In the common case were all the
transforms match we don't use the additional per-grid matrix in the shader.

Ref T73201, T68981

Differential Revision: https://developer.blender.org/D6955
2020-03-18 11:23:05 +01:00
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
8dcfd392e4 UI: add new icons for Volume, Hair and PointCloud 2020-03-18 11:23:05 +01:00
12720d8b9b GPencil: Cleanup int comparisons 2020-03-18 11:12:11 +01:00
35019443c0 GPencil: Invert Dopesheet icons to same order than properties panel 2020-03-18 10:19:54 +01:00
084bf7daee Weight Paint: Implement a new Lock-Relative mode.
This check box alters how weights are displayed and painted,
similar to Multi Paint, but in a different way. Specifically,
weights are presented as if all locked vertex groups were
deleted, and the remaining deform groups normalized.

The new feature is intended for use when balancing weights within
a group of bones while all others are locked. Enabling the option
presents weight as if the locked bones didn't exist, and their
weight was proportionally redistributed to the editable bones.

Conversely, the Multi-Paint feature allows balancing a group of
bones as a whole against all unselected bones, while ignoring
weight distribution within the selected group.

This mode also allows temporarily viewing non-normalized weights
as if they were normalized, without actually changing the values.

Differential Revision: https://developer.blender.org/D3837
2020-03-18 11:55:44 +03:00
82c51d0edb Modifier: skip calling MOD_deform_mesh_eval_get
This is only needed in certain cases.

When testing performance improvements to the modifier stack
it's useful to bypass this function.
2020-03-18 14:21:40 +11:00
7ba403dc94 Fix typo causing compile error with WITH_XR_OPENXR disabled 2020-03-17 22:23:02 +01:00
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
406bfd4304 Ghost: Ghost-XR API to abstract away and access OpenXR functionality
Extends Ghost to include an abstraction for OpenXR, which I refer to as
Ghost-XR. Such an API is the base for the following commit, which introduces VR
support to Blender.

Main features:
* Simple and high-level interface for Blender specific code to call.
* Extensible for muliple graphics backends, currently OpenGL and a DirectX
  compatibility layer are supported.
* Carefully designed error handling strategy allowing Blender to handle errors
  gracefully and with useful error messages.
* OpenXR extension and API-layer management.
* OpenXR session management.
* Basic OpenXR event management.
* Debug utilities for Ghost-XR and OpenXR

For more information on this API, check
https://wiki.blender.org/wiki/Source/Interface/XR.

Reviewed by: Brecht Van Lommel

Differential Revision: https://developer.blender.org/D6188
2020-03-17 21:39:59 +01:00
c9a8de1d70 Fluid: Correct Tooltip 2020-03-17 16:32:56 -04:00
3af51cacbf Online Manual Reference: Update 2020-03-17 16:28:58 -04:00
a7c660fe61 Cleanup: Fix warnings about function signature of register pass
RE_engine_register_pass is sometimes in the headers with type
as an integer parameter, sometimes as eNodeSocketDatatype.

This caused warnings, the root cause was makesrna was not able
to generate the proper type for enums and defaulted to int.

makesrna has been extended with the RNA_def_property_enum_native_type
that allows telling makesrna the native type of an enum, if set it
will be used otherwise it will still fall back to int.

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

Reviewed By: brecht
2020-03-17 13:45:35 -06:00
2631 changed files with 86715 additions and 52428 deletions

View File

@@ -132,9 +132,7 @@ PenaltyBreakAssignment: 100
AllowShortFunctionsOnASingleLine: None
# Disable for now since it complicates initial migration tests,
# TODO: look into enabling this in the future.
SortIncludes: false
SortIncludes: true
# Don't right align escaped newlines to the right because we have a wide default
AlignEscapedNewlines: DontAlign
@@ -193,6 +191,7 @@ ForEachMacros:
- FOREACH_MAIN_ID_BEGIN
- FOREACH_MAIN_LISTBASE_BEGIN
- FOREACH_MAIN_LISTBASE_ID_BEGIN
- FOREACH_MESH_BUFFER_CACHE
- FOREACH_NODETREE_BEGIN
- FOREACH_OBJECT_BEGIN
- FOREACH_OBJECT_FLAG_BEGIN
@@ -215,6 +214,7 @@ ForEachMacros:
- GHASH_ITER_INDEX
- GPU_SELECT_LOAD_IF_PICKSEL_LIST
- GP_EDITABLE_STROKES_BEGIN
- GP_EVALUATED_STROKES_BEGIN
- GSET_FOREACH_BEGIN
- GSET_ITER
- GSET_ITER_INDEX
@@ -238,7 +238,6 @@ ForEachMacros:
- LISTBASE_FOREACH_BACKWARD
- LISTBASE_FOREACH_MUTABLE
- LISTBASE_FOREACH_BACKWARD_MUTABLE
- MAN2D_ITER_AXES_BEGIN
- MAN_ITER_AXES_BEGIN
- NODE_INSTANCE_HASH_ITER
- NODE_SOCKET_TYPES_BEGIN
@@ -246,12 +245,16 @@ ForEachMacros:
- NODE_TYPES_BEGIN
- PIXEL_LOOPER_BEGIN
- PIXEL_LOOPER_BEGIN_CHANNELS
- RENDER_PASS_ITER_BEGIN
- RNA_BEGIN
- RNA_PROP_BEGIN
- RNA_STRUCT_BEGIN
- RNA_STRUCT_BEGIN_SKIP_RNA_TYPE
- SCULPT_VERTEX_DUPLICATES_AND_NEIGHBORS_ITER_BEGIN
- SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN
- SEQP_BEGIN
- SEQ_BEGIN
- SURFACE_QUAD_ITER_BEGIN
- foreach
# Use once we bump the minimum version to version 8.

View File

@@ -138,11 +138,6 @@ get_blender_version()
#-----------------------------------------------------------------------------
# Options
# First platform specific non-cached vars
if(UNIX AND NOT (APPLE OR HAIKU))
set(WITH_X11 ON)
endif()
# Blender internal features
option(WITH_BLENDER "Build blender (disable to build only the blender player)" ON)
mark_as_advanced(WITH_BLENDER)
@@ -186,8 +181,7 @@ if(APPLE)
option(WITH_XR_OPENXR "Enable VR features through the OpenXR specification" OFF)
mark_as_advanced(WITH_XR_OPENXR)
else()
# Disabled until there's more than just the build system stuff. Should be enabled soon.
option(WITH_XR_OPENXR "Enable VR features through the OpenXR specification" OFF)
option(WITH_XR_OPENXR "Enable VR features through the OpenXR specification" ON)
endif()
# Compositor
@@ -208,7 +202,15 @@ mark_as_advanced(WITH_GHOST_DEBUG)
option(WITH_GHOST_SDL "Enable building Blender against SDL for windowing rather than the native APIs" OFF)
mark_as_advanced(WITH_GHOST_SDL)
if(WITH_X11)
if(UNIX AND NOT (APPLE OR HAIKU))
option(WITH_GHOST_X11 "Enable building Blender against X11 for windowing" ON)
mark_as_advanced(WITH_GHOST_X11)
option(WITH_GHOST_WAYLAND "Enable building Blender against Wayland for windowing (under development)" OFF)
mark_as_advanced(WITH_GHOST_WAYLAND)
endif()
if(WITH_GHOST_X11)
option(WITH_GHOST_XDND "Enable drag'n'drop support on X11 using XDND protocol" ON)
endif()
@@ -233,7 +235,7 @@ if(UNIX AND NOT APPLE)
mark_as_advanced(WITH_OPENMP_STATIC)
endif()
if(WITH_X11)
if(WITH_GHOST_X11)
option(WITH_X11_XINPUT "Enable X11 Xinput (tablet support and unicode input)" ON)
option(WITH_X11_XF86VMODE "Enable X11 video mode switching" ON)
option(WITH_X11_XFIXES "Enable X11 XWayland cursor warping workaround" ON)
@@ -320,6 +322,14 @@ mark_as_advanced(WITH_SYSTEM_GLOG)
# Freestyle
option(WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON)
# New object types
option(WITH_NEW_OBJECT_TYPES "Enable new hair and pointcloud objects (use for development only, don't save in files)" OFF)
mark_as_advanced(WITH_NEW_OBJECT_TYPES)
# New simulation data block
option(WITH_NEW_SIMULATION_TYPE "Enable simulation data block (use for development only, don't save in files)" OFF)
mark_as_advanced(WITH_NEW_SIMULATION_TYPE)
# Misc
if(WIN32)
option(WITH_INPUT_IME "Enable Input Method Editor (IME) for complex Asian character input" ON)
@@ -426,6 +436,8 @@ endif()
option(WITH_GTESTS "Enable GTest unit testing" OFF)
option(WITH_OPENGL_RENDER_TESTS "Enable OpenGL render related unit testing (Experimental)" OFF)
option(WITH_OPENGL_DRAW_TESTS "Enable OpenGL UI drawing related unit testing (Experimental)" OFF)
set(TEST_PYTHON_EXE "" CACHE PATH "Python executable to run unit tests")
mark_as_advanced(TEST_PYTHON_EXE)
# Documentation
if(UNIX AND NOT APPLE)
@@ -466,6 +478,8 @@ endif()
if(CMAKE_COMPILER_IS_GNUCC)
option(WITH_LINKER_GOLD "Use ld.gold linker which is usually faster than ld.bfd" ON)
mark_as_advanced(WITH_LINKER_GOLD)
option(WITH_LINKER_LLD "Use ld.lld linker which is usually faster than ld.gold" OFF)
mark_as_advanced(WITH_LINKER_LLD)
endif()
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
@@ -529,6 +543,15 @@ if(WIN32)
option(WITH_WINDOWS_BUNDLE_CRT "Bundle the C runtime for install free distribution." ON)
mark_as_advanced(WITH_WINDOWS_BUNDLE_CRT)
option(WITH_WINDOWS_SCCACHE "Use sccache to speed up builds (Ninja builder only)" OFF)
mark_as_advanced(WITH_WINDOWS_SCCACHE)
option(WITH_WINDOWS_PDB "Generate a pdb file for client side stacktraces" ON)
mark_as_advanced(WITH_WINDOWS_PDB)
option(WITH_WINDOWS_STRIPPED_PDB "Use a stripped PDB file" On)
mark_as_advanced(WITH_WINDOWS_STRIPPED_PDB)
endif()
# The following only works with the Ninja generator in CMake >= 3.0.
@@ -630,9 +653,10 @@ set_and_warn_dependency(WITH_BOOST WITH_OPENVDB OFF)
set_and_warn_dependency(WITH_BOOST WITH_OPENCOLORIO OFF)
set_and_warn_dependency(WITH_BOOST WITH_QUADRIFLOW OFF)
set_and_warn_dependency(WITH_BOOST WITH_USD OFF)
set_and_warn_dependency(WITH_BOOST WITH_ALEMBIC OFF)
if(WITH_BOOST AND NOT (WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_INTERNATIONAL OR
WITH_OPENVDB OR WITH_OPENCOLORIO OR WITH_USD))
WITH_OPENVDB OR WITH_OPENCOLORIO OR WITH_USD OR WITH_ALEMBIC))
message(STATUS "No dependencies need 'WITH_BOOST' forcing WITH_BOOST=OFF")
set(WITH_BOOST OFF)
endif()
@@ -674,13 +698,15 @@ if(WITH_INSTALL_PORTABLE)
endif()
if(WITH_GHOST_SDL OR WITH_HEADLESS)
set(WITH_X11 OFF)
set(WITH_GHOST_WAYLAND OFF)
set(WITH_GHOST_X11 OFF)
set(WITH_X11_XINPUT OFF)
set(WITH_X11_XF86VMODE OFF)
set(WITH_X11_XFIXES OFF)
set(WITH_X11_ALPHA OFF)
set(WITH_GHOST_XDND OFF)
set(WITH_INPUT_IME OFF)
set(WITH_XR_OPENXR OFF)
endif()
if(WITH_CPU_SSE)

View File

@@ -71,17 +71,6 @@ Testing Targets
which are tagged to use the stricter formatting
* test_deprecated:
Checks for deprecation tags in our code which may need to be removed
* test_style_c:
Checks C/C++ conforms with blenders style guide:
https://wiki.blender.org/wiki/Source/Code_Style
* test_style_c_qtc:
Same as test_style but outputs QtCreator tasks format
* test_style_osl:
Checks OpenShadingLanguage conforms with blenders style guide:
https://wiki.blender.org/wiki/Source/Code_Style
* test_style_osl_qtc:
Checks OpenShadingLanguage conforms with blenders style guide:
https://wiki.blender.org/wiki/Source/Code_Style
Static Source Code Checking
Not associated with building Blender.
@@ -402,45 +391,6 @@ test_cmake: .FORCE
test_deprecated: .FORCE
$(PYTHON) tests/check_deprecated.py
test_style_c: .FORCE
# run our own checks on C/C++ style
PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
"$(BLENDER_DIR)/source/blender" \
"$(BLENDER_DIR)/source/creator" \
--no-length-check
test_style_c_qtc: .FORCE
# run our own checks on C/C++ style
USE_QTC_TASK=1 \
PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
"$(BLENDER_DIR)/source/blender" \
"$(BLENDER_DIR)/source/creator" \
--no-length-check \
> \
"$(BLENDER_DIR)/test_style.tasks"
@echo "written: test_style.tasks"
test_style_osl: .FORCE
# run our own checks on C/C++ style
PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
"$(BLENDER_DIR)/intern/cycles/kernel/shaders" \
"$(BLENDER_DIR)/release/scripts/templates_osl"
test_style_osl_qtc: .FORCE
# run our own checks on C/C++ style
USE_QTC_TASK=1 \
PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
"$(BLENDER_DIR)/intern/cycles/kernel/shaders" \
"$(BLENDER_DIR)/release/scripts/templates_osl" \
> \
"$(BLENDER_DIR)/test_style.tasks"
@echo "written: test_style.tasks"
# -----------------------------------------------------------------------------
# Project Files

View File

@@ -25,6 +25,8 @@ if(UNIX AND NOT APPLE)
set(BZIP2_CFLAGS "-fPIC -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64")
set(BZIP2_CONFIGURE_ENV ${BZIP2_CONFIGURE_ENV} && export LDFLAGS=${BZIP2_LDFLAGS} && export CFLAGS=${BZIP2_CFLAGS}
&& export PREFIX=${BZIP2_PREFIX})
else()
set(BZIP2_CONFIGURE_ENV ${CONFIGURE_ENV})
endif()
ExternalProject_Add(external_bzip2

View File

@@ -21,7 +21,7 @@ set(OIDN_EXTRA_ARGS
-DWITH_EXAMPLE=OFF
-DWITH_TEST=OFF
-DTBB_ROOT=${LIBDIR}/tbb
-DTBB_STATIC_LIB=ON
-DTBB_STATIC_LIB=${TBB_STATIC_LIBRARY}
-DOIDN_STATIC_LIB=ON
)

View File

@@ -36,7 +36,7 @@ if(WIN32)
set(OPENSUBDIV_EXTRA_ARGS
${OPENSUBDIV_EXTRA_ARGS}
-DTBB_INCLUDE_DIR=${LIBDIR}/tbb/include
-DTBB_LIBRARIES=${LIBDIR}/tbb/lib/tbb_static.lib
-DTBB_LIBRARIES=${LIBDIR}/tbb/lib/tbb.lib
-DCLEW_INCLUDE_DIR=${LIBDIR}/clew/include/CL
-DCLEW_LIBRARY=${LIBDIR}/clew/lib/clew${LIBEXT}
-DCUEW_INCLUDE_DIR=${LIBDIR}/cuew/include

View File

@@ -20,8 +20,10 @@ if(WIN32)
-DTBB_BUILD_SHARED=On
-DTBB_BUILD_TBBMALLOC=On
-DTBB_BUILD_TBBMALLOC_PROXY=On
-DTBB_BUILD_STATIC=On
)
-DTBB_BUILD_STATIC=Off
)
set(TBB_LIBRARY tbb)
set(TBB_STATIC_LIBRARY Off)
else()
set(TBB_EXTRA_ARGS
-DTBB_BUILD_SHARED=Off
@@ -29,6 +31,8 @@ else()
-DTBB_BUILD_TBBMALLOC_PROXY=Off
-DTBB_BUILD_STATIC=On
)
set(TBB_LIBRARY tbb_static)
set(TBB_STATIC_LIBRARY On)
endif()
# CMake script for TBB from https://github.com/wjakob/tbb/blob/master/CMakeLists.txt
@@ -46,7 +50,8 @@ ExternalProject_Add(external_tbb
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_tbb after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_static.lib ${HARVEST_TARGET}/tbb/lib/tbb.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb.lib ${HARVEST_TARGET}/tbb/lib/tbb.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb.dll ${HARVEST_TARGET}/tbb/lib/tbb.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.dll ${HARVEST_TARGET}/tbb/lib/tbbmalloc.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_proxy.lib
@@ -57,7 +62,12 @@ if(WIN32)
endif()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_tbb after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_static.lib ${HARVEST_TARGET}/tbb/lib/tbb_debug.lib
# findtbb.cmake in some deps *NEEDS* to find tbb.lib even if they are not going to use it
# to make that test pass, we place a copy with the right name in the lib folder.
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_debug.lib ${LIBDIR}/tbb/lib/tbb.lib
# Normal collection of build artifacts
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_debug.lib ${HARVEST_TARGET}/tbb/lib/debug/tbb_debug.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_debug.dll ${HARVEST_TARGET}/tbb/lib/debug/tbb_debug.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_proxy_debug.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.dll ${HARVEST_TARGET}/tbb/lib/debug/tbbmalloc.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.dll ${HARVEST_TARGET}/tbb/lib/debug/tbbmalloc_proxy.dll

View File

@@ -23,8 +23,8 @@ set(USD_EXTRA_ARGS
-DBoost_USE_STATIC_RUNTIME=OFF
-DBOOST_ROOT=${LIBDIR}/boost
-DTBB_INCLUDE_DIRS=${LIBDIR}/tbb/include
-DTBB_LIBRARIES=${LIBDIR}/tbb/lib/${LIBPREFIX}tbb_static${LIBEXT}
-DTbb_TBB_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}tbb_static${LIBEXT}
-DTBB_LIBRARIES=${LIBDIR}/tbb/lib/${LIBPREFIX}${TBB_LIBRARY}${LIBEXT}
-DTbb_TBB_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}${TBB_LIBRARY}${LIBEXT}
# This is a preventative measure that avoids possible conflicts when add-ons
# try to load another USD library into the same process space.

View File

@@ -146,8 +146,8 @@ set(PYTHON_URI https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTH
set(PYTHON_HASH d33e4aae66097051c2eca45ee3604803)
set(TBB_VERSION 2019_U9)
set(TBB_URI https://github.com/01org/tbb/archive/${TBB_VERSION}.tar.gz)
set(TBB_HASH 584edbec127c508f2cd5b6e79ad200fc)
set(TBB_URI https://github.com/oneapi-src/oneTBB/archive/${TBB_VERSION}.tar.gz)
set(TBB_HASH 26263622e9187212ec240dcf01b66207)
set(OPENVDB_VERSION 7.0.0)
set(OPENVDB_URI https://github.com/dreamworksanimation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz)

View File

@@ -29,6 +29,7 @@ if(UNIX AND NOT APPLE)
-DBUILD_WITH_WAYLAND_HEADERS=OFF
-DBUILD_WITH_XCB_HEADERS=OFF
-DBUILD_WITH_XLIB_HEADERS=ON
-DBUILD_WITH_SYSTEM_JSONCPP=OFF
-DCMAKE_CXX_FLAGS=-DDISABLE_STD_FILESYSTEM=1
)
endif()

View File

@@ -63,8 +63,8 @@ build-ffmpeg,build-opencollada,build-alembic,build-embree,build-oidn,build-usd,\
build-xr-openxr,\
skip-python,skip-numpy,skip-boost,\
skip-ocio,skip-openexr,skip-oiio,skip-llvm,skip-osl,skip-osd,skip-openvdb,\
skip-ffmpeg,skip-opencollada,skip-alembic,skip-embree,skip-oidn,skip-usd, \
skip-xr-openxr\
skip-ffmpeg,skip-opencollada,skip-alembic,skip-embree,skip-oidn,skip-usd,\
skip-xr-openxr \
-- "$@" \
)
@@ -1289,7 +1289,7 @@ compile_Python() {
./configure --prefix=$_inst --libdir=$_inst/lib --enable-ipv6 \
--enable-loadable-sqlite-extensions --with-dbmliborder=bdb \
--with-computed-gotos --with-pymalloc
--with-computed-gotos --with-pymalloc --enable-shared
make -j$THREADS && make install
make clean
@@ -1310,6 +1310,8 @@ compile_Python() {
INFO "Own Python-$PYTHON_VERSION is up to date, nothing to do!"
INFO "If you want to force rebuild of this lib, use the --force-python option."
fi
run_ldconfig "python-$PYTHON_VERSION_MIN"
}
# ----------------------------------------------------------------------------
@@ -2652,7 +2654,7 @@ compile_USD() {
cd $CWD
INFO "Done compiling USD-$USD_VERSION!"
_is_building=true
_is_building=false
else
INFO "Own USD-$USD_VERSION is up to date, nothing to do!"
INFO "If you want to force rebuild of this lib, use the --force-usd option."
@@ -3128,7 +3130,7 @@ compile_XR_OpenXR_SDK() {
fi
# To be changed each time we make edits that would modify the compiled result!
xr_openxr_magic=0
xr_openxr_magic=2
_init_xr_openxr_sdk
# Clean install if needed!
@@ -3185,8 +3187,9 @@ compile_XR_OpenXR_SDK() {
cmake_d="$cmake_d -D BUILD_WITH_WAYLAND_HEADERS=OFF"
cmake_d="$cmake_d -D BUILD_WITH_XCB_HEADERS=OFF"
cmake_d="$cmake_d -D BUILD_WITH_XLIB_HEADERS=ON"
cmake_d="$cmake_d -D BUILD_WITH_SYSTEM_JSONCPP=OFF"
cmake $cmake_d ..
cmake $cmake_d "-DCMAKE_CXX_FLAGS=-DDISABLE_STD_FILESYSTEM=1" ..
make -j$THREADS && make install
make clean
@@ -5188,7 +5191,7 @@ print_info() {
PRINT ""
PRINT "If you're using CMake add this to your configuration flags:"
_buildargs="-U *SNDFILE* -U *PYTHON* -U *BOOST* -U *Boost*"
_buildargs="-U *SNDFILE* -U PYTHON* -U *BOOST* -U *Boost*"
_buildargs="$_buildargs -U *OPENCOLORIO* -U *OPENEXR* -U *OPENIMAGEIO* -U *LLVM* -U *CYCLES*"
_buildargs="$_buildargs -U *OPENSUBDIV* -U *OPENVDB* -U *COLLADA* -U *FFMPEG* -U *ALEMBIC* -U *USD*"
@@ -5351,6 +5354,11 @@ print_info() {
_1="-D WITH_USD=ON"
PRINT " $_1"
_buildargs="$_buildargs $_1"
if [ -d $INST/usd ]; then
_1="-D USD_ROOT_DIR=$INST/usd"
PRINT " $_1"
_buildargs="$_buildargs $_1"
fi
fi
if [ "$NO_SYSTEM_GLEW" = true ]; then

View File

@@ -109,6 +109,9 @@ if (WIN32)
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def
COMMENT "Preprocessing tbbmalloc.def"
)
list(APPEND tbb_src ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/tbb_resource.rc)
list(APPEND tbbmalloc_src ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/tbbmalloc.rc)
list(APPEND tbbmalloc_proxy_src ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/tbbmalloc.rc)
else()
add_custom_command(OUTPUT tbb.def
COMMAND ${CMAKE_CXX_COMPILER} -xc++ -E ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def -I ${CMAKE_CURRENT_SOURCE_DIR}/include -o tbb.def
@@ -145,8 +148,12 @@ if (TBB_BUILD_SHARED)
set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "-Wl,-version-script,${CMAKE_CURRENT_BINARY_DIR}/tbb.def")
elseif(WIN32)
set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "/DEF:${CMAKE_CURRENT_BINARY_DIR}/tbb.def")
endif()
install(TARGETS tbb DESTINATION lib)
if(WIN32)
set_target_properties(tbb PROPERTIES OUTPUT_NAME "tbb$<$<CONFIG:Debug>:_debug>")
endif()
endif()
if(CMAKE_COMPILER_IS_GNUCC)
@@ -196,7 +203,7 @@ if(TBB_BUILD_TBBMALLOC_PROXY)
add_library(tbbmalloc_proxy SHARED ${tbbmalloc_proxy_src})
set_property(TARGET tbbmalloc_proxy APPEND PROPERTY COMPILE_DEFINITIONS "__TBBMALLOC_BUILD=1")
set_property(TARGET tbbmalloc_proxy APPEND_STRING PROPERTY COMPILE_FLAGS ${DISABLE_RTTI})
link_libraries(tbbmalloc_proxy tbbmalloc)
target_link_libraries(tbbmalloc_proxy tbbmalloc)
install(TARGETS tbbmalloc_proxy DESTINATION lib)
endif()
endif()

View File

@@ -18,17 +18,6 @@ diff --git a/mkl-dnn/cmake/TBB.cmake b/mkl-dnn/cmake/TBB.cmake
index 0711e699..c14210b6 100644
--- a/mkl-dnn/cmake/TBB.cmake
+++ b/mkl-dnn/cmake/TBB.cmake
@@ -90,8 +90,8 @@ if(WIN32)
NO_DEFAULT_PATH
)
set(TBB_LIB_DIR ${TBB_ROOT}/lib/${TBB_ARCH}/${TBB_VCVER})
- find_library(TBB_LIBRARY tbb PATHS ${TBB_LIB_DIR} ${TBB_ROOT}/lib NO_DEFAULT_PATH)
- find_library(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${TBB_LIB_DIR} ${TBB_ROOT}/lib NO_DEFAULT_PATH)
+ find_library(TBB_LIBRARY tbb_static PATHS ${TBB_LIB_DIR} ${TBB_ROOT}/lib NO_DEFAULT_PATH)
+ find_library(TBB_LIBRARY_MALLOC tbbmalloc_static PATHS ${TBB_LIB_DIR} ${TBB_ROOT}/lib NO_DEFAULT_PATH)
endif()
else()
@@ -138,13 +138,13 @@ else()
set(TBB_LIBRARY_MALLOC TBB_LIBRARY_MALLOC-NOTFOUND)
if(APPLE)

View File

@@ -7,9 +7,6 @@ message(STATUS "Building in CentOS 7 64bit environment")
set(LIBDIR_NAME "linux_centos7_x86_64")
set(WITH_CXX11_ABI OFF CACHE BOOL "" FORCE)
# Default to only build Blender
set(WITH_BLENDER ON CACHE BOOL "" FORCE)
# ######## Linux-specific build options ########
# Options which are specific to Linux-only platforms
@@ -20,12 +17,6 @@ set(WITH_DOC_MANPAGE OFF CACHE BOOL "" FORCE)
set(WITH_JACK_DYNLOAD ON CACHE BOOL "" FORCE)
set(WITH_SDL_DYNLOAD ON CACHE BOOL "" FORCE)
set(WITH_SYSTEM_GLEW OFF CACHE BOOL "" FORCE)
set(WITH_OPENMP_STATIC ON CACHE BOOL "" FORCE)
set(WITH_PYTHON_INSTALL_NUMPY ON CACHE BOOL "" FORCE)
set(WITH_PYTHON_INSTALL_REQUESTS ON CACHE BOOL "" FORCE)
# ######## Release environment specific settings ########
@@ -33,13 +24,5 @@ set(LIBDIR "${CMAKE_CURRENT_LIST_DIR}/../../../../lib/${LIBDIR_NAME}" CACHE STRI
# Platform specific configuration, to ensure static linking against everything.
set(Boost_USE_STATIC_LIBS ON CACHE BOOL "" FORCE)
# We need to link OpenCOLLADA against PCRE library. Even though it is not installed
# on /usr, we do not really care -- all we care is PCRE_FOUND be TRUE and its
# library pointing to a valid one.
set(PCRE_INCLUDE_DIR "/usr/include" CACHE STRING "" FORCE)
set(PCRE_LIBRARY "${LIBDIR}/opencollada/lib/libpcre.a" CACHE STRING "" FORCE)
# Additional linking libraries
set(CMAKE_EXE_LINKER_FLAGS "-lrt -static-libstdc++ -no-pie" CACHE STRING "" FORCE)

View File

@@ -95,7 +95,7 @@ FIND_LIBRARY(OPENIMAGEDENOISE_LIBRARY
# handle the QUIETLY and REQUIRED arguments and set OPENIMAGEDENOISE_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENIMAGEDENOISE DEFAULT_MSG
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenImageDenoise DEFAULT_MSG
OPENIMAGEDENOISE_LIBRARY OPENIMAGEDENOISE_INCLUDE_DIR)
IF(OPENIMAGEDENOISE_FOUND)

View File

@@ -66,6 +66,9 @@ macro(BLENDER_SRC_GTEST_EX)
if(UNIX AND NOT APPLE)
target_link_libraries(${TARGET_NAME} bf_intern_libc_compat)
endif()
if(WITH_TBB)
target_link_libraries(${TARGET_NAME} ${TBB_LIBRARIES})
endif()
get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(GENERATOR_IS_MULTI_CONFIG)

View File

@@ -440,6 +440,14 @@ function(SETUP_LIBDIRS)
link_directories(${HDF5_LIBPATH})
endif()
if(WITH_GHOST_WAYLAND)
link_directories(
${wayland-client_LIBRARY_DIRS}
${wayland-egl_LIBRARY_DIRS}
${xkbcommon_LIBRARY_DIRS}
${wayland-cursor_LIBRARY_DIRS})
endif()
if(WIN32 AND NOT UNIX)
link_directories(${PTHREADS_LIBPATH})
endif()

View File

@@ -222,12 +222,10 @@ if(WITH_OPENCOLLADA)
-lMathMLSolver
-lGeneratedSaxParser
-lbuffer -lftoa -lUTF
${OPENCOLLADA_LIBPATH}/libxml2.a
)
# PCRE is bundled with openCollada
# set(PCRE ${LIBDIR}/pcre)
# set(PCRE_LIBPATH ${PCRE}/lib)
# PCRE and XML2 are bundled with OpenCollada.
set(PCRE_LIBRARIES pcre)
set(XML2_LIBRARIES xml2)
endif()
if(WITH_SDL)
@@ -449,7 +447,9 @@ if(${XCODE_VERSION} VERSION_EQUAL 5 OR ${XCODE_VERSION} VERSION_GREATER 5)
# Xcode 5 is always using CLANG, which has too low template depth of 128 for libmv
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth=1024")
endif()
# Get rid of eventually clashes, we export some symbols explicitly as local
# Avoid conflicts with Luxrender, and other plug-ins that may use the same
# libraries as Blender with a different version or build options.
set(PLATFORM_LINKFLAGS
"${PLATFORM_LINKFLAGS} -Xlinker -unexported_symbols_list -Xlinker '${CMAKE_SOURCE_DIR}/source/creator/osx_locals.map'"
)

View File

@@ -20,10 +20,6 @@
# Xcode and system configuration for Apple.
# require newer cmake on osx because of version handling,
# older cmake cannot handle 2 digit subversion!
cmake_minimum_required(VERSION 3.0.0)
if(NOT CMAKE_OSX_ARCHITECTURES)
set(CMAKE_OSX_ARCHITECTURES x86_64 CACHE STRING
"Choose the architecture you want to build Blender for: i386, x86_64 or ppc"
@@ -45,54 +41,98 @@ execute_process(
OUTPUT_VARIABLE XCODE_CHECK OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REPLACE "/Contents/Developer" "" XCODE_BUNDLE ${XCODE_CHECK}) # truncate to bundlepath in any case
if(${CMAKE_GENERATOR} MATCHES "Xcode")
if(NOT ${CMAKE_GENERATOR} MATCHES "Xcode")
# Unix makefile generator does not fill XCODE_VERSION var, so we get it with a command.
# Note that `xcodebuild -version` gives output in two lines: first line will include
# Xcode version, second one will include build number. We are only interested in the
# former one. Here is an example of the output:
# Xcode 11.4
# Build version 11E146
# The expected XCODE_VERSION in this case is 11.4.
# earlier xcode has no bundled developer dir, no sense in getting xcode path from
if(${XCODE_VERSION} VERSION_GREATER 4.2)
# reduce to XCode name without dp extension
string(SUBSTRING "${XCODE_CHECK}" 14 6 DP_NAME)
if(${DP_NAME} MATCHES Xcode5)
set(XCODE_VERSION 5)
endif()
endif()
##### cmake incompatibility with xcode 4.3 and higher #####
if(${XCODE_VERSION} MATCHES '') # cmake fails due looking for xcode in the wrong path, thus will be empty var
message(FATAL_ERROR "Xcode 4.3 and higher must be used with cmake 2.8-8 or higher")
endif()
### end cmake incompatibility with xcode 4.3 and higher ###
if(${XCODE_VERSION} VERSION_EQUAL 4 OR ${XCODE_VERSION} VERSION_GREATER 4 AND ${XCODE_VERSION} VERSION_LESS 4.3)
# Xcode 4 defaults to the Apple LLVM Compiler.
# Override the default compiler selection because Blender only compiles with gcc up to xcode 4.2
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42")
message(STATUS "Setting compiler to: " ${CMAKE_XCODE_ATTRIBUTE_GCC_VERSION})
endif()
else() # unix makefile generator does not fill XCODE_VERSION var, so we get it with a command
execute_process(COMMAND xcodebuild -version OUTPUT_VARIABLE XCODE_VERS_BUILD_NR)
string(SUBSTRING "${XCODE_VERS_BUILD_NR}" 6 3 XCODE_VERSION) # truncate away build-nr
# Convert output to a single line by replacling newlines with spaces.
# This is needed because regex replace can not operate through the newline character
# and applies substitutions for each individual lines.
string(REPLACE "\n" " " XCODE_VERS_BUILD_NR_SINGLE_LINE "${XCODE_VERS_BUILD_NR}")
string(REGEX REPLACE "(.*)Xcode ([0-9\\.]+).*" "\\2" XCODE_VERSION "${XCODE_VERS_BUILD_NR_SINGLE_LINE}")
unset(XCODE_VERS_BUILD_NR)
unset(XCODE_VERS_BUILD_NR_SINGLE_LINE)
endif()
message(STATUS "Detected OS X ${OSX_SYSTEM} and Xcode ${XCODE_VERSION} at ${XCODE_BUNDLE}")
if(${XCODE_VERSION} VERSION_LESS 4.3)
# use guaranteed existing sdk
set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX${OSX_SYSTEM}.sdk CACHE PATH "" FORCE)
else()
# note: xcode-select path could be ambiguous,
# cause /Applications/Xcode.app/Contents/Developer or /Applications/Xcode.app would be allowed
# so i use a selfcomposed bundlepath here
set(OSX_SYSROOT_PREFIX ${XCODE_BUNDLE}/Contents/Developer/Platforms/MacOSX.platform)
message(STATUS "OSX_SYSROOT_PREFIX: " ${OSX_SYSROOT_PREFIX})
set(OSX_DEVELOPER_PREFIX /Developer/SDKs/MacOSX${OSX_SYSTEM}.sdk) # use guaranteed existing sdk
set(CMAKE_OSX_SYSROOT ${OSX_SYSROOT_PREFIX}/${OSX_DEVELOPER_PREFIX} CACHE PATH "" FORCE)
if(${CMAKE_GENERATOR} MATCHES "Xcode")
# to silence sdk not found warning, just overrides CMAKE_OSX_SYSROOT
set(CMAKE_XCODE_ATTRIBUTE_SDKROOT macosx${OSX_SYSTEM})
endif()
# Older Xcode versions had different approach to the directory hiearchy.
# Require newer Xcode which is also have better chances of being able to compile with the
# required deployment target.
#
# NOTE: Xcode version 8.2 is the latest one which runs on macOS 10.11.
if(${XCODE_VERSION} VERSION_LESS 8.2)
message(FATAL_ERROR "Only Xcode version 8.2 and newer is supported")
endif()
# note: xcode-select path could be ambiguous,
# cause /Applications/Xcode.app/Contents/Developer or /Applications/Xcode.app would be allowed
# so i use a selfcomposed bundlepath here
set(OSX_SYSROOT_PREFIX ${XCODE_BUNDLE}/Contents/Developer/Platforms/MacOSX.platform)
message(STATUS "OSX_SYSROOT_PREFIX: " ${OSX_SYSROOT_PREFIX})
# Collect list of OSX system versions which will be used to detect path to corresponding SDK.
# Start with macOS SDK version reported by xcodebuild and include possible extra ones.
#
# The reason for need of extra ones is because it's possible that xcodebuild will report
# SDK version in the full manner (aka major.minor.patch), but the actual path will only
# include major.minor.
#
# This happens, for example, on macOS Catalina 10.15.4 and Xcode 11.4: xcodebuild on this
# system outputs "10.15.4", but the actual SDK path is MacOSX10.15.sdk.
#
# This should be safe from picking wrong SDK version because (a) xcodebuild reports full semantic
# SDK version, so such SDK does exist on the system. And if it doesn't exist with full version
# in the path, what SDK is in the major.minor folder then.
set(OSX_SDK_TEST_VERSIONS ${OSX_SYSTEM})
if(OSX_SYSTEM MATCHES "([0-9]+)\\.([0-9]+)\\.([0-9]+)")
string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1.\\2" OSX_SYSTEM_NO_PATCH "${OSX_SYSTEM}")
list(APPEND OSX_SDK_TEST_VERSIONS ${OSX_SYSTEM_NO_PATCH})
unset(OSX_SYSTEM_NO_PATCH)
endif()
# Loop through all possible versions and pick the first one which resolves to a valid SDK path.
set(OSX_SDK_PATH)
set(OSX_SDK_FOUND FALSE)
set(OSX_SDK_PREFIX ${OSX_SYSROOT_PREFIX}/Developer/SDKs)
set(OSX_SDKROOT)
foreach(OSX_SDK_VERSION ${OSX_SDK_TEST_VERSIONS})
set(CURRENT_OSX_SDK_PATH "${OSX_SDK_PREFIX}/MacOSX${OSX_SDK_VERSION}.sdk")
if(EXISTS ${CURRENT_OSX_SDK_PATH})
set(OSX_SDK_PATH "${CURRENT_OSX_SDK_PATH}")
set(OSX_SDKROOT macosx${OSX_SDK_VERSION})
set(OSX_SDK_FOUND TRUE)
break()
endif()
endforeach()
unset(OSX_SDK_PREFIX)
unset(OSX_SDK_TEST_VERSIONS)
if(NOT OSX_SDK_FOUND)
message(FATAL_ERROR "Unable to find SDK for macOS version ${OSX_SYSTEM}")
endif()
message(STATUS "Detected OSX_SYSROOT: ${OSX_SDK_PATH}")
set(CMAKE_OSX_SYSROOT ${OSX_SDK_PATH} CACHE PATH "" FORCE)
unset(OSX_SDK_PATH)
unset(OSX_SDK_FOUND)
if(${CMAKE_GENERATOR} MATCHES "Xcode")
# to silence sdk not found warning, just overrides CMAKE_OSX_SYSROOT
set(CMAKE_XCODE_ATTRIBUTE_SDKROOT ${OSX_SDKROOT})
endif()
unset(OSX_SDKROOT)
# 10.11 is our min. target, if you use higher sdk, weak linking happens
if(CMAKE_OSX_DEPLOYMENT_TARGET)
if(${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_LESS 10.11)

View File

@@ -195,8 +195,14 @@ endif()
if(WITH_OPENCOLLADA)
find_package_wrapper(OpenCOLLADA)
if(OPENCOLLADA_FOUND)
if(WITH_STATIC_LIBS)
# PCRE is bundled with OpenCollada without headers, so can't use
# find_package reliably to detect it.
set(PCRE_LIBRARIES ${LIBDIR}/opencollada/lib/libpcre.a)
else()
find_package_wrapper(PCRE)
endif()
find_package_wrapper(XML2)
find_package_wrapper(PCRE)
else()
set(WITH_OPENCOLLADA OFF)
endif()
@@ -405,13 +411,6 @@ if(WITH_LLVM)
endif()
endif()
if(WITH_LLVM OR WITH_SDL_DYNLOAD)
# Fix for conflict with Mesa llvmpipe
set(PLATFORM_LINKFLAGS
"${PLATFORM_LINKFLAGS} -Wl,--version-script='${CMAKE_SOURCE_DIR}/source/creator/blender.map'"
)
endif()
if(WITH_OPENSUBDIV)
find_package_wrapper(OpenSubdiv)
@@ -505,7 +504,27 @@ if(WITH_SYSTEM_AUDASPACE)
endif()
endif()
if(WITH_X11)
if(WITH_GHOST_WAYLAND)
find_package(PkgConfig)
pkg_check_modules(wayland-client REQUIRED wayland-client>=1.12)
pkg_check_modules(wayland-egl REQUIRED wayland-egl)
pkg_check_modules(wayland-scanner REQUIRED wayland-scanner)
pkg_check_modules(xkbcommon REQUIRED xkbcommon)
pkg_check_modules(wayland-cursor REQUIRED wayland-cursor)
set(WITH_GL_EGL ON)
if(WITH_GHOST_WAYLAND)
list(APPEND PLATFORM_LINKLIBS
${wayland-client_LIBRARIES}
${wayland-egl_LIBRARIES}
${xkbcommon_LIBRARIES}
${wayland-cursor_LIBRARIES}
)
endif()
endif()
if(WITH_GHOST_X11)
find_package(X11 REQUIRED)
find_path(X11_XF86keysym_INCLUDE_PATH X11/XF86keysym.h ${X11_INC_SEARCH_PATH})
@@ -576,6 +595,19 @@ if(CMAKE_COMPILER_IS_GNUCC)
unset(LD_VERSION)
endif()
if(WITH_LINKER_LLD)
execute_process(
COMMAND ${CMAKE_C_COMPILER} -fuse-ld=lld -Wl,--version
ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
if("${LD_VERSION}" MATCHES "LLD")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=lld")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=lld")
else()
message(STATUS "LLD linker isn't available, using the default system linker.")
endif()
unset(LD_VERSION)
endif()
# CLang is the same as GCC for now.
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
@@ -601,3 +633,16 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -static-intel")
endif()
# Avoid conflicts with Mesa llvmpipe, Luxrender, and other plug-ins that may
# use the same libraries as Blender with a different version or build options.
set(PLATFORM_LINKFLAGS
"${PLATFORM_LINKFLAGS} -Wl,--version-script='${CMAKE_SOURCE_DIR}/source/creator/blender.map'"
)
# Don't use position independent executable for portable install since file
# browsers can't properly detect blender as an executable then. Still enabled
# for non-portable installs as typically used by Linux distributions.
if(WITH_INSTALL_PORTABLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -no-pie")
endif()

View File

@@ -51,6 +51,10 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
endif()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} \"${CLANG_OPENMP_LIB}\"")
endif()
if(WITH_WINDOWS_STRIPPED_PDB)
message(WARNING "stripped pdb not supported with clang, disabling..")
set(WITH_WINDOWS_STRIPPED_PDB Off)
endif()
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ${WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS})
@@ -112,7 +116,7 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO")
list(APPEND PLATFORM_LINKLIBS
ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 Comctl32
ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 Comctl32 version
advapi32 shfolder shell32 ole32 oleaut32 uuid psapi Dbghelp Shlwapi
)
@@ -134,7 +138,12 @@ add_definitions(-D_ALLOW_KEYWORD_MACROS)
# We want to support Windows 7 level ABI
add_definitions(-D_WIN32_WINNT=0x601)
include(build_files/cmake/platform/platform_win32_bundle_crt.cmake)
remove_cc_flag("/MDd" "/MD")
remove_cc_flag("/MDd" "/MD" "/Zi")
if(WITH_WINDOWS_PDB)
set(PDB_INFO_OVERRIDE_FLAGS "/Z7")
set(PDB_INFO_OVERRIDE_LINKER_FLAGS "/DEBUG /OPT:REF /OPT:ICF /INCREMENTAL:NO")
endif()
if(MSVC_CLANG) # Clangs version of cl doesn't support all flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_WARN_FLAGS} /nologo /J /Gd /EHsc -Wno-unused-command-line-argument -Wno-microsoft-enum-forward-reference ")
@@ -151,16 +160,30 @@ if(MSVC_VERSION GREATER 1911 AND NOT MSVC_CLANG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:twoPhase-")
endif()
if(WITH_WINDOWS_SCCACHE AND CMAKE_VS_MSBUILD_COMMAND)
message(WARNING "Disabling sccache, sccache is not supported with msbuild")
set(WITH_WINDOWS_SCCACHE Off)
endif()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd /ZI")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MDd /ZI")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MD")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MD")
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MD")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MD")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MD")
if(WITH_WINDOWS_SCCACHE)
set(CMAKE_C_COMPILER_LAUNCHER sccache)
set(CMAKE_CXX_COMPILER_LAUNCHER sccache)
set(SYMBOL_FORMAT /Z7)
else()
unset(CMAKE_C_COMPILER_LAUNCHER)
unset(CMAKE_CXX_COMPILER_LAUNCHER)
set(SYMBOL_FORMAT /ZI)
endif()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd ${SYMBOL_FORMAT}")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MDd ${SYMBOL_FORMAT}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD ${PDB_INFO_OVERRIDE_FLAGS}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MD ${PDB_INFO_OVERRIDE_FLAGS}")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MD ${PDB_INFO_OVERRIDE_FLAGS}")
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MD ${PDB_INFO_OVERRIDE_FLAGS}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MD ${SYMBOL_FORMAT}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MD ${SYMBOL_FORMAT}")
unset(SYMBOL_FORMAT)
# JMC is available on msvc 15.8 (1915) and up
if(MSVC_VERSION GREATER 1914 AND NOT MSVC_CLANG)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /JMC")
@@ -172,6 +195,7 @@ set(PLATFORM_LINKFLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG} /IGNORE:4099 /NODEFAUL
# Ignore meaningless for us linker warnings.
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /ignore:4049 /ignore:4217 /ignore:4221")
set(PLATFORM_LINKFLAGS_RELEASE "${PLATFORM_LINKFLAGS} ${PDB_INFO_OVERRIDE_LINKER_FLAGS}")
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4221")
if(CMAKE_CL_64)
@@ -209,7 +233,7 @@ endif()
# Mark libdir as system headers with a lower warn level, to resolve some warnings
# that we have very little control over
if(MSVC_VERSION GREATER_EQUAL 1914 AND NOT MSVC_CLANG)
if(MSVC_VERSION GREATER_EQUAL 1914 AND NOT MSVC_CLANG AND NOT WITH_WINDOWS_SCCACHE)
add_compile_options(/experimental:external /external:templates- /external:I "${LIBDIR}" /external:W0)
endif()
@@ -572,7 +596,7 @@ if(WITH_SYSTEM_AUDASPACE)
endif()
if(WITH_TBB)
set(TBB_LIBRARIES optimized ${LIBDIR}/tbb/lib/tbb.lib debug ${LIBDIR}/tbb/lib/tbb_debug.lib)
set(TBB_LIBRARIES optimized ${LIBDIR}/tbb/lib/tbb.lib debug ${LIBDIR}/tbb/lib/debug/tbb_debug.lib)
set(TBB_INCLUDE_DIR ${LIBDIR}/tbb/include)
set(TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR})
if(WITH_TBB_MALLOC_PROXY)
@@ -669,7 +693,7 @@ if(WITH_USD)
set(USD_INCLUDE_DIRS ${LIBDIR}/usd/include)
set(USD_RELEASE_LIB ${LIBDIR}/usd/lib/libusd_m.lib)
set(USD_DEBUG_LIB ${LIBDIR}/usd/lib/libusd_m_d.lib)
set(USD_LIBRARY_DIR ${LIBDIR}/usd/lib/usd)
set(USD_LIBRARY_DIR ${LIBDIR}/usd/lib)
set(USD_LIBRARIES
debug ${USD_DEBUG_LIB}
optimized ${USD_RELEASE_LIB}

View File

@@ -6,9 +6,6 @@ if %ERRORLEVEL% EQU 0 goto DetectionComplete
call "%~dp0\detect_msvc2019.cmd"
if %ERRORLEVEL% EQU 0 goto DetectionComplete
call "%~dp0\detect_msvc2015.cmd"
if %ERRORLEVEL% EQU 0 goto DetectionComplete
echo Compiler Detection failed. Use verbose switch for more information.
exit /b 1

View File

@@ -2,6 +2,11 @@ set BUILD_GENERATOR_POST=
set BUILD_PLATFORM_SELECT=
set MSBUILD_PLATFORM=x64
if "%BUILD_WITH_SCCACHE%"=="1" (
echo sccache is only supported with ninja as the build system.
exit /b 1
)
if "%WITH_CLANG%"=="1" (
set CLANG_CMAKE_ARGS=-T"llvm"
if "%WITH_ASAN%"=="1" (

View File

@@ -6,6 +6,13 @@ if %ERRORLEVEL% NEQ 0 (
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Ninja" %TESTS_CMAKE_ARGS% -DCMAKE_BUILD_TYPE=%BUILD_TYPE%
if "%BUILD_WITH_SCCACHE%"=="1" (
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DWITH_WINDOWS_SCCACHE=On
if NOT "%verbose%" == "" (
echo Enabling sccache
)
)
if "%WITH_CLANG%" == "1" (
set LLVM_DIR=
for /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\LLVM" /ve 2^>nul`) DO set LLVM_DIR=%%C

View File

@@ -1,3 +0,0 @@
set BUILD_VS_VER=14
set BUILD_VS_YEAR=2015
call "%~dp0\detect_msvc_classic.cmd"

View File

@@ -1,69 +0,0 @@
if NOT "%verbose%" == "" (
echo Detecting msvc %BUILD_VS_YEAR%
)
set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\%BUILD_VS_VER%.0\Setup\VC"
for /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME% /v ProductDir 2^>nul`) DO set MSVC_VC_DIR=%%C
if DEFINED MSVC_VC_DIR (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% on Win64 detected at "%MSVC_VC_DIR%"
)
goto msvc_detect_finally
)
REM Check 32 bits
set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\%BUILD_VS_VER%.0\Setup\VC"
for /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME% /v ProductDir 2^>nul`) DO set MSVC_VC_DIR=%%C
if DEFINED MSVC_VC_DIR (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% on Win32 detected at "%MSVC_VC_DIR%"
)
goto msvc_detect_finally
)
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% not found.
)
goto FAIL
:msvc_detect_finally
set VCVARS=%MSVC_VC_DIR%\vcvarsall.bat
if not exist "%VCVARS%" (
echo "%VCVARS%" not found.
goto FAIL
)
call "%vcvars%" %BUILD_ARCH%
rem try msbuild
msbuild /version > NUL
if errorlevel 1 (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% msbuild not found
)
goto FAIL
)
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% msbuild found
)
REM try the c++ compiler
cl 2> NUL 1>&2
if errorlevel 1 (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler not found
)
goto FAIL
)
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler found
)
goto DetectionComplete
:FAIL
exit /b 1
:DetectionComplete
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% Detected successfully
)
exit /b 0

View File

@@ -27,7 +27,13 @@ if NOT "%verbose%" == "" (
if "%VS_InstallDir%"=="" (
if NOT "%verbose%" == "" (
echo Visual Studio is detected but the "Desktop development with C++" workload has not been instlled
echo.
echo Visual Studio is detected but no suitable installation was found.
echo.
echo Check the "Desktop development with C++" workload has been installed.
echo.
echo If you are attempting to use either Visual Studio Preview version or the Visual C++ Build tools, Please see 'make help' on how to opt in to those toolsets.
echo.
goto FAIL
)
)

View File

@@ -66,8 +66,6 @@ if NOT "%1" == "" (
) else if "%1" == "2019b" (
set BUILD_VS_YEAR=2019
set VSWHERE_ARGS=-products Microsoft.VisualStudio.Product.BuildTools
) else if "%1" == "2015" (
set BUILD_VS_YEAR=2015
) else if "%1" == "packagename" (
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DCPACK_OVERRIDE_PACKAGENAME="%2"
shift /1
@@ -88,6 +86,8 @@ if NOT "%1" == "" (
set BUILD_UPDATE_ARGS="--no-libraries"
) else if "%1" == "ninja" (
SET BUILD_WITH_NINJA=1
) else if "%1" == "sccache" (
SET BUILD_WITH_SCCACHE=1
) else if "%1" == "clean" (
set MUST_CLEAN=1
) else if "%1" == "verbose" (

View File

@@ -30,3 +30,4 @@ set WITH_PYDEBUG=
set PYDEBUG_CMAKE_ARGS=
set FORMAT=
set TEST=
set BUILD_WITH_SCCACHE=

View File

@@ -23,15 +23,17 @@ echo - with_tests ^(enable building unit tests^)
echo - nobuildinfo ^(disable buildinfo^)
echo - debug ^(Build an unoptimized debuggable build^)
echo - packagename [newname] ^(override default cpack package name^)
echo - buildir [newdir] ^(override default build folder^)
echo - builddir [newdir] ^(override default build folder^)
echo - 2017 ^(build with visual studio 2017^)
echo - 2017pre ^(build with visual studio 2017 pre-release^)
echo - 2017b ^(build with visual studio 2017 Build Tools^)
echo - 2019 ^(build with visual studio 2019^)
echo - 2019pre ^(build with visual studio 2019 pre-release^)
echo - 2019b ^(build with visual studio 2019 Build Tools^)
echo.
echo Experimental options
echo - with_opengl_tests ^(enable both the render and draw opengl test suites^)
echo - 2015 ^(build with visual studio 2015^)
echo - clang ^(enable building with clang^)
echo - asan ^(enable asan when building with clang^)
echo - ninja ^(enable building with ninja instead of msbuild^)

View File

@@ -38,7 +38,7 @@ PROJECT_NAME = Blender
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = "V2.83"
PROJECT_NUMBER = "V2.90"
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

View File

@@ -2,20 +2,20 @@
Basic Sound Playback
++++++++++++++++++++
This script shows how to use the classes: :class:`Device`, :class:`Factory` and
This script shows how to use the classes: :class:`Device`, :class:`Sound` and
:class:`Handle`.
"""
import aud
device = aud.device()
device = aud.Device()
# load sound file (it can be a video file with audio)
factory = aud.Factory('music.ogg')
sound = aud.Sound('music.ogg')
# play the audio, this return a handle to control play/pause
handle = device.play(factory)
handle = device.play(sound)
# if the audio is not too big and will be used often you can buffer it
factory_buffered = aud.Factory.buffer(factory)
handle_buffered = device.play(factory_buffered)
sound_buffered = aud.Sound.buffer(sound)
handle_buffered = device.play(sound_buffered)
# stop the sounds (otherwise they play until their ends)
handle.stop()

View File

@@ -205,15 +205,15 @@ Support Overview
* - Usage
- :class:`bpy.types.MeshPolygon`
- :class:`bpy.types.MeshTessFace`
- :class:`bpy.types.MeshLoopTriangle`
- :class:`bmesh.types.BMFace`
* - Import/Create
- Poor *(inflexible)*
- Good *(supported as upgrade path)*
- Unusable *(read-only)*.
- Best
* - Manipulate
- Poor *(inflexible)*
- Poor *(loses ngons)*
- Unusable *(read-only)*.
- Best
* - Export/Output
- Good *(ngon support)*

View File

@@ -1052,6 +1052,7 @@ context_type_map = {
"selected_editable_fcurves": ("FCurve", True),
"selected_editable_objects": ("Object", True),
"selected_editable_sequences": ("Sequence", True),
"selected_nla_strips": ("NlaStrip", True),
"selected_nodes": ("Node", True),
"selected_objects": ("Object", True),
"selected_pose_bones": ("PoseBone", True),
@@ -1073,6 +1074,7 @@ context_type_map = {
"visible_pose_bones": ("PoseBone", True),
"visible_fcurves": ("FCurve", True),
"weight_paint_object": ("Object", False),
"volume": ("Volume", False),
"world": ("World", False),
}

View File

@@ -72,7 +72,7 @@ if(WITH_CYCLES OR WITH_COMPOSITOR OR WITH_OPENSUBDIV)
endif()
endif()
if(WITH_X11 AND WITH_GHOST_XDND)
if(WITH_GHOST_X11 AND WITH_GHOST_XDND)
add_subdirectory(xdnd)
endif()

View File

@@ -290,14 +290,14 @@ AUD_API AUD_Device* AUD_Device_getCurrent()
return new AUD_Device(device);
}
AUD_API void AUD_seekSynchronizer(AUD_Handle* handle, float time)
AUD_API void AUD_seekSynchronizer(AUD_Handle* handle, double time)
{
auto synchronizer = DeviceManager::getDevice()->getSynchronizer();
if(synchronizer)
synchronizer->seek(*reinterpret_cast<std::shared_ptr<IHandle>*>(handle), time);
}
AUD_API float AUD_getSynchronizerPosition(AUD_Handle* handle)
AUD_API double AUD_getSynchronizerPosition(AUD_Handle* handle)
{
auto synchronizer = DeviceManager::getDevice()->getSynchronizer();
if(synchronizer)

View File

@@ -221,14 +221,14 @@ extern AUD_API AUD_Device* AUD_Device_getCurrent();
* \param handle Playback handle.
* \param time Time in seconds to seek to.
*/
extern AUD_API void AUD_seekSynchronizer(AUD_Handle* handle, float time);
extern AUD_API void AUD_seekSynchronizer(AUD_Handle* handle, double time);
/**
* Returns the current sound scene playback time.
* \param handle Playback handle.
* \return The playback time in seconds.
*/
extern AUD_API float AUD_getSynchronizerPosition(AUD_Handle* handle);
extern AUD_API double AUD_getSynchronizerPosition(AUD_Handle* handle);
/**
* Starts the playback of jack transport if possible.

View File

@@ -101,14 +101,14 @@ AUD_API int AUD_DynamicMusic_pause(AUD_DynamicMusic* player)
return (*player)->pause();
}
AUD_API int AUD_DynamicMusic_seek(AUD_DynamicMusic* player, float position)
AUD_API int AUD_DynamicMusic_seek(AUD_DynamicMusic* player, double position)
{
assert(player);
return (*player)->seek(position);
}
AUD_API float AUD_DynamicMusic_getPosition(AUD_DynamicMusic* player)
AUD_API double AUD_DynamicMusic_getPosition(AUD_DynamicMusic* player)
{
assert(player);
@@ -141,4 +141,4 @@ AUD_API int AUD_DynamicMusic_stop(AUD_DynamicMusic* player)
assert(player);
return (*player)->stop();
}
}

View File

@@ -103,14 +103,14 @@ extern AUD_API int AUD_DynamicMusic_pause(AUD_DynamicMusic* player);
* \param position The new position from which to play back, in seconds.
* \return 0 if the seeking wasn't possible.
*/
extern AUD_API int AUD_DynamicMusic_seek(AUD_DynamicMusic* player, float position);
extern AUD_API int AUD_DynamicMusic_seek(AUD_DynamicMusic* player, double position);
/**
* Retrieves the position of the current scene of a dynamic music player.
* \param player The DynamicMusic object.
* \return The position of the current playing scene.
*/
extern AUD_API float AUD_DynamicMusic_getPosition(AUD_DynamicMusic* player);
extern AUD_API double AUD_DynamicMusic_getPosition(AUD_DynamicMusic* player);
/**
* Retrieves the volume of the current scene of a dynamic music player.
@@ -142,4 +142,4 @@ extern AUD_API int AUD_DynamicMusic_stop(AUD_DynamicMusic* player);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -259,13 +259,13 @@ AUD_API int AUD_Handle_setPitch(AUD_Handle* handle, float value)
return (*handle)->setPitch(value);
}
AUD_API float AUD_Handle_getPosition(AUD_Handle* handle)
AUD_API double AUD_Handle_getPosition(AUD_Handle* handle)
{
assert(handle);
return (*handle)->getPosition();
}
AUD_API int AUD_Handle_setPosition(AUD_Handle* handle, float value)
AUD_API int AUD_Handle_setPosition(AUD_Handle* handle, double value)
{
assert(handle);
return (*handle)->seek(value);

View File

@@ -211,14 +211,14 @@ extern AUD_API int AUD_Handle_setPitch(AUD_Handle* handle, float value);
* param handle The handle to get the position from.
* return The position of the handle.
*/
extern AUD_API float AUD_Handle_getPosition(AUD_Handle* handle);
extern AUD_API double AUD_Handle_getPosition(AUD_Handle* handle);
/**
* Sets the position of a handle.
* param handle The handle to set the position from.
* param value The new position to set.
*/
extern AUD_API int AUD_Handle_setPosition(AUD_Handle* handle, float value);
extern AUD_API int AUD_Handle_setPosition(AUD_Handle* handle, double value);
/**
* Retrieves the relative of a handle.

View File

@@ -41,7 +41,7 @@ AUD_API void AUD_Sequence_free(AUD_Sound* sequence)
delete sequence;
}
AUD_API AUD_SequenceEntry* AUD_Sequence_add(AUD_Sound* sequence, AUD_Sound* sound, float begin, float end, float skip)
AUD_API AUD_SequenceEntry* AUD_Sequence_add(AUD_Sound* sequence, AUD_Sound* sound, double begin, double end, double skip)
{
if(!sound)
return new AUD_SequenceEntry(((Sequence *)sequence->get())->add(AUD_Sound(), begin, end, skip));
@@ -160,7 +160,7 @@ AUD_API void AUD_Sequence_setSpeedOfSound(AUD_Sound* sequence, float value)
AUD_API void AUD_SequenceEntry_move(AUD_SequenceEntry* entry, float begin, float end, float skip)
AUD_API void AUD_SequenceEntry_move(AUD_SequenceEntry* entry, double begin, double end, double skip)
{
(*entry)->move(begin, end, skip);
}

View File

@@ -55,7 +55,7 @@ extern AUD_API void AUD_Sequence_free(AUD_Sound* sequence);
* \param skip How much seconds should be skipped at the beginning.
* \return The entry added.
*/
extern AUD_API AUD_SequenceEntry* AUD_Sequence_add(AUD_Sound* sequence, AUD_Sound* sound, float begin, float end, float skip);
extern AUD_API AUD_SequenceEntry* AUD_Sequence_add(AUD_Sound* sequence, AUD_Sound* sound, double begin, double end, double skip);
/**
* Removes an entry from the scene.
@@ -167,7 +167,7 @@ extern AUD_API void AUD_Sequence_setSpeedOfSound(AUD_Sound* sequence, float valu
* \param end The new end time or a negative value if unknown.
* \param skip How many seconds to skip at the beginning.
*/
extern AUD_API void AUD_SequenceEntry_move(AUD_SequenceEntry* entry, float begin, float end, float skip);
extern AUD_API void AUD_SequenceEntry_move(AUD_SequenceEntry* entry, double begin, double end, double skip);
/**
* Writes animation data to a sequenced entry.

View File

@@ -175,7 +175,7 @@ static void pauseSound(AUD_Handle* handle)
(*handle)->pause();
}
AUD_API AUD_Handle* AUD_pauseAfter(AUD_Handle* handle, float seconds)
AUD_API AUD_Handle* AUD_pauseAfter(AUD_Handle* handle, double seconds)
{
auto device = DeviceManager::getDevice();
@@ -336,7 +336,7 @@ AUD_API const char* AUD_mixdown_per_channel(AUD_Sound* sound, unsigned int start
}
}
AUD_API AUD_Device* AUD_openMixdownDevice(AUD_DeviceSpecs specs, AUD_Sound* sequencer, float volume, float start)
AUD_API AUD_Device* AUD_openMixdownDevice(AUD_DeviceSpecs specs, AUD_Sound* sequencer, float volume, double start)
{
try
{

View File

@@ -45,7 +45,7 @@ extern AUD_API float* AUD_readSoundBuffer(const char* filename, float low, float
* \param seconds The time in seconds.
* \return The silence handle.
*/
extern AUD_API AUD_Handle* AUD_pauseAfter(AUD_Handle* handle, float seconds);
extern AUD_API AUD_Handle* AUD_pauseAfter(AUD_Handle* handle, double seconds);
/**
* Reads a sound into a buffer for drawing at a specific sampling rate.
@@ -101,7 +101,7 @@ extern AUD_API const char* AUD_mixdown_per_channel(AUD_Sound* sound, unsigned in
* \param start The start time of the mixdown in the sound scene.
* \return The read device for the mixdown.
*/
extern AUD_API AUD_Device* AUD_openMixdownDevice(AUD_DeviceSpecs specs, AUD_Sound* sequencer, float volume, float start);
extern AUD_API AUD_Device* AUD_openMixdownDevice(AUD_DeviceSpecs specs, AUD_Sound* sequencer, float volume, double start);
/**
* Initializes audio routines (FFMPEG/JACK if it is enabled).

View File

@@ -4,4 +4,5 @@ Device
.. currentmodule:: aud
.. autoclass:: Device
:members:
:noindex:

View File

@@ -4,4 +4,5 @@ Handle
.. currentmodule:: aud
.. autoclass:: Handle
:members:
:noindex:

View File

@@ -7,6 +7,7 @@ Welcome to audaspace's documentation!
=====================================
.. automodule:: aud
:no-members:
This documentation is valid for both the Python and C bindings of audaspace. If you are looking for installation instructions check the `C++ API documentation <../index.html>`_. As C is not an object oriented language everything is accessible via functions where the first paramter is always the object. For methods these are named as ``AUD_ClassName_method()`` and properties are accessed via ``AUD_ClassName_property_get/set()``. Python users simply ``import aud`` to access the library.
@@ -18,7 +19,7 @@ This documentation is valid for both the Python and C bindings of audaspace. If
Classes:
.. toctree::
:maxdepth: 2
:maxdepth: 1
device
sound

View File

@@ -4,4 +4,5 @@ Sequence
.. currentmodule:: aud
.. autoclass:: Sequence
:members:
:noindex:

View File

@@ -4,4 +4,5 @@ Sequence Entry
.. currentmodule:: aud
.. autoclass:: SequenceEntry
:members:
:noindex:

View File

@@ -4,4 +4,5 @@ Sound
.. currentmodule:: aud
.. autoclass:: Sound
:members:
:noindex:

View File

@@ -4,35 +4,51 @@ Tutorials
Introduction
------------
The C and Python binding for audaspace were designed with simplicity in mind. This means however that to use the full capabilities of audaspace, there is no way around the C++ library.
The C and Python binding for audaspace were designed with simplicity in mind.
This means however that to use the full capabilities of audaspace,
there is no way around the C++ library.
Simple Demo
-----------
The **simple.py** example program contains all the basic building blocks for an application using audaspace. These building blocks are basically the classes :class:`aud.Device`, :class:`aud.Sound` and :class:`aud.Handle`.
The **simple.py** example program contains all the basic
building blocks for an application using audaspace.
These building blocks are basically the classes :class:`aud.Device`,
:class:`aud.Sound` and :class:`aud.Handle`.
We start with importing :mod:`aud` and :mod:`time` as the modules we need for our simple example.
We start with importing :mod:`aud` and :mod:`time`
as the modules we need for our simple example.
.. code-block:: python
#!/usr/bin/python
import aud, time
The first step now is to open an output device and this can simply be done by allocating a :class:`aud.Device` object.
The first step now is to open an output device and this
can simply be done by allocating a :class:`aud.Device` object.
.. code-block:: python
device = aud.Device()
To create a sound we can choose to load one from a :func:`aud.Sound.file`, or we use one of our signal generators. We decide to do the latter and create a :func:`aud.Sound.sine` signal with a frequency of 440 Hz.
To create a sound we can choose to load one from a :func:`aud.Sound.file`,
or we use one of our signal generators. We decide to do the latter
and create a :func:`aud.Sound.sine` signal with a frequency of 440 Hz.
.. code-block:: python
sine = aud.Sound.sine(440)
.. note:: At this point nothing is playing back yet, :class:`aud.Sound` objects are just descriptions of sounds.
.. note:: At this point nothing is playing back yet,
:class:`aud.Sound` objects are just descriptions of sounds.
However instead of a sine wave, we would like to have a square wave to produce a more retro gaming sound. We could of course use the :func:`aud.Sound.square` generator instead of sine, but we want to show how to apply effects, so we apply a :func:`aud.Sound.threshold` which makes a square wave out of our sine too, even if less efficient than directly generating the square wave.
However instead of a sine wave, we would like to have a square wave
to produce a more retro gaming sound. We could of course use the
:func:`aud.Sound.square` generator instead of sine,
but we want to show how to apply effects,
so we apply a :func:`aud.Sound.threshold`
which makes a square wave out of our sine too,
even if less efficient than directly generating the square wave.
.. code-block:: python
@@ -40,13 +56,19 @@ However instead of a sine wave, we would like to have a square wave to produce a
.. note:: The :class:`aud.Sound` class offers generator and effect functions.
The we can play our sound by calling the :func:`aud.Device.play` method of our device. This method returns a :class:`aud.Handle` which is used to control the playback of the sound.
The we can play our sound by calling the
:func:`aud.Device.play` method of our device.
This method returns a :class:`aud.Handle`
which is used to control the playback of the sound.
.. code-block:: python
handle = device.play(square)
Now if we do nothing else anymore the application will quit immediately, so we won't hear much of our square wave, so we decide to wait for three seconds before quitting the application by calling :func:`time.sleep`.
Now if we do nothing else anymore the application will quit immediately,
so we won't hear much of our square wave,
so we decide to wait for three seconds before
quitting the application by calling :func:`time.sleep`.
.. code-block:: python
@@ -55,29 +77,47 @@ Now if we do nothing else anymore the application will quit immediately, so we w
Audioplayer
-----------
Now that we know the basics of audaspace, we can build our own music player easily by just slightly changing the previous program. The **player.py** example does exactly that, let's have a short look at the differences:
Now that we know the basics of audaspace,
we can build our own music player easily
by just slightly changing the previous program.
The **player.py** example does exactly that,
let's have a short look at the differences:
Instead of creating a sine signal and thresholding it, we in fact use the :func:`aud.Sound.file` function to load a sound from a file. The filename we pass is the first command line argument our application got.
Instead of creating a sine signal and thresholding it,
we in fact use the :func:`aud.Sound.file` function to load a sound from a file.
The filename we pass is the first command line argument our application got.
.. code-block:: python
sound = aud.Sound.file(sys.argv[1])
When the sound gets played back we now want to wait until the whole file has been played, so we use the :data:`aud.Handle.status` property to determine whether the sound finished playing.
When the sound gets played back we now want to wait until
the whole file has been played, so we use the :data:`aud.Handle.status`
property to determine whether the sound finished playing.
.. code-block:: python
while handle.status:
time.sleep(0.1)
We don't make any error checks if the user actually added a command line argument. As an exercise you could extend this program to play any number of command line supplied files in sequence.
We don't make any error checks if the user actually added a command
line argument. As an exercise you could extend this program to play
any number of command line supplied files in sequence.
Siren
-----
Let's get a little bit more complex. The **siren.py** example plays a generated siren sound that circles around your head. Depending on how many speakers you have and if the output device used supports the speaker setup, you will hear this effect. With stereo speakers you should at least hear some left-right-panning.
Let's get a little bit more complex. The **siren.py** example
plays a generated siren sound that circles around your head.
Depending on how many speakers you have and if the output
device used supports the speaker setup, you will hear this effect.
With stereo speakers you should at least hear some left-right-panning.
We start off again with importing the modules we need and we also define some properties of our siren sound. We want it to consist of two sine sounds with different frequencies. We define a length for the sine sounds and how long a fade in/out should take. We also know already how to open a device.
We start off again with importing the modules we need and
we also define some properties of our siren sound.
We want it to consist of two sine sounds with different frequencies.
We define a length for the sine sounds and how long a fade in/out should take.
We also know already how to open a device.
.. code-block:: python
@@ -88,27 +128,35 @@ We start off again with importing the modules we need and we also define some pr
device = aud.Device()
The next thing to do is to define our sine waves and apply all the required effects. As each of the effect functions returns the corresponding sound, we can easily chain those calls together.
The next thing to do is to define our sine waves and apply all the required effects.
As each of the effect functions returns the corresponding sound,
we can easily chain those calls together.
.. code-block:: python
high = aud.Sound.sine(880).limit(0, length).fadein(0, fadelength).fadeout(length - fadelength, length)
low = aud.Sound.sine(700).limit(0, length).fadein(0, fadelength).fadeout(length - fadelength, length).volume(0.6)
The next step is to connect the two sines, which we do using the :func:`aud.Sound.join` function.
The next step is to connect the two sines,
which we do using the :func:`aud.Sound.join` function.
.. code-block:: python
sound = high.join(low)
The generated siren sound can now be played back and what we also do is to loop it. Therefore we set the :data:`aud.Handle.loop_count` to a negative value to loop forever.
The generated siren sound can now be played back and what we also do is to loop it.
Therefore we set the :data:`aud.Handle.loop_count` to a negative value to loop forever.
.. code-block:: python
handle = device.play(sound)
handle.loop_count = -1
Now we use some timing code to make sure our demo runs for 10 seconds, but we also use the time to update the location of our playing sound, with the :data:`aud.Handle.location` property, which is a three dimensional vector. The trigonometic calculation based on the running time of the program keeps the sound on the XZ plane letting it follow a circle around us.
Now we use some timing code to make sure our demo runs for 10 seconds,
but we also use the time to update the location of our playing sound,
with the :data:`aud.Handle.location` property, which is a three dimensional vector.
The trigonometic calculation based on the running time of the program keeps
the sound on the XZ plane letting it follow a circle around us.
.. code-block:: python
@@ -119,33 +167,54 @@ Now we use some timing code to make sure our demo runs for 10 seconds, but we al
handle.location = [math.sin(angle), 0, -math.cos(angle)]
As an exercise you could try to let the sound come from the far left and go to the far right and a little bit in front of you within the 10 second runtime of the program. With this change you should be able to hear the volume of the sound change, depending on how far it is away from you. Updating the :data:`aud.Handle.velocity` property properly also enables the doppler effect. Compare your solution to the **siren2.py** demo.
As an exercise you could try to let the sound come from the far left
and go to the far right and a little bit in front of you within the
10 second runtime of the program. With this change you should be able
to hear the volume of the sound change, depending on how far it is away from you.
Updating the :data:`aud.Handle.velocity` property properly also enables the doppler effect.
Compare your solution to the **siren2.py** demo.
Tetris
------
The **tetris.py** demo application shows an even more complex application which generates retro tetris music. Looking at the source code there should be nothing new here, again the functions used from audaspace are the same as in the previous examples. In the :func:`parseNote` function all single notes get joined which leads to a very long chain of sounds. If you think of :func:`aud.Sound.join` as a function that creates a binary tree with the two joined sounds as leaves then the :func:`parseNote` function creates a very unbalanced tree.
The **tetris.py** demo application shows an even more
complex application which generates retro tetris music.
Looking at the source code there should be nothing new here,
again the functions used from audaspace are the same as in the previous examples.
In the :func:`parseNote` function all single notes get joined which leads
to a very long chain of sounds. If you think of :func:`aud.Sound.join`
as a function that creates a binary tree with the two joined sounds as
leaves then the :func:`parseNote` function creates a very unbalanced tree.
Insted we could rewrite the code to use two other classes: :class:`aud.Sequence` and :class:`aud.SequenceEntry` to sequence the notes. The **tetris2.py** application does exactly that. Before the while loop we add a variable that stores the current position in the score and create a new :class:`aud.Sequence` object.
Insted we could rewrite the code to use two other classes:
:class:`aud.Sequence` and :class:`aud.SequenceEntry` to sequence the notes.
The **tetris2.py** application does exactly that.
Before the while loop we add a variable that stores the current position
in the score and create a new :class:`aud.Sequence` object.
.. code-block:: python
position = 0
sequence = aud.Sequence()
Then in the loop we can create the note simply by chaining the :func:`aud.Sound.square` generator and :func:`aud.Sound.fadein` and :func:`aud.Sound.fadeout` effects.
Then in the loop we can create the note simply by chaining the
:func:`aud.Sound.square` generator and :func:`aud.Sound.fadein`
and :func:`aud.Sound.fadeout` effects.
.. code-block:: python
note = aud.Sound.square(freq, rate).fadein(0, fadelength).fadeout(length - fadelength, fadelength)
Now instead of using :func:`aud.Sound.limit` and :func:`aud.Sound.join` we simply add the sound to the sequence.
Now instead of using :func:`aud.Sound.limit` and :func:`aud.Sound.join`
we simply add the sound to the sequence.
.. code-block:: python
entry = sequence.add(note, position, position + length, 0)
The entry returned from the :func:`aud.Sequence.add` function is an object of the :class:`aud.SequenceEntry` class. We can use this entry to mute the note in case it's actually a pause.
The entry returned from the :func:`aud.Sequence.add`
function is an object of the :class:`aud.SequenceEntry` class.
We can use this entry to mute the note in case it's actually a pause.
.. code-block:: python
@@ -158,9 +227,14 @@ Lastly we have to update our position variable.
position += length
Now in **tetris2.py** we used the :data:`aud.SequenceEntry.muted` property to show how the :class:`aud.SequenceEntry` class can be used, but it would actually be smarter to not even create a note for pauses and just skip them. You can try to implement this as an exercise and then check out the solution in **tetris3.py**.
Now in **tetris2.py** we used the :data:`aud.SequenceEntry.muted`
property to show how the :class:`aud.SequenceEntry` class can be used,
but it would actually be smarter to not even create a note for pauses and just skip them.
You can try to implement this as an exercise and then check out the solution in **tetris3.py**.
Conclusion
----------
We introduced all five currently available classes in the audaspace Python API. Of course all classes offer a lot more functions than have been used in these demo applications, check out the specific class documentation for more details.
We introduced all five currently available classes in the audaspace Python API.
Of course all classes offer a lot more functions than have been used in these demo applications,
check out the specific class documentation for more details.

View File

@@ -124,15 +124,17 @@ Device_new(PyTypeObject* type, PyObject* args, PyObject* kwds)
}
PyDoc_STRVAR(M_aud_Device_lock_doc,
"lock()\n\n"
"Locks the device so that it's guaranteed, that no samples are "
"read from the streams until :meth:`unlock` is called.\n"
"This is useful if you want to do start/stop/pause/resume some "
"sounds at the same time.\n\n"
".. note:: The device has to be unlocked as often as locked to be "
"able to continue playback.\n\n"
".. warning:: Make sure the time between locking and unlocking is "
"as short as possible to avoid clicks.");
".. classmethod:: lock()\n\n"
" Locks the device so that it's guaranteed, that no samples are\n"
" read from the streams until :meth:`unlock` is called.\n"
" This is useful if you want to do start/stop/pause/resume some\n"
" sounds at the same time.\n\n"
" .. note::\n\n"
" The device has to be unlocked as often as locked to be\n"
" able to continue playback.\n\n"
" .. warning::\n\n"
" Make sure the time between locking and unlocking is\n"
" as short as possible to avoid clicks.");
static PyObject *
Device_lock(Device* self)
@@ -150,15 +152,15 @@ Device_lock(Device* self)
}
PyDoc_STRVAR(M_aud_Device_play_doc,
"play(sound, keep=False)\n\n"
"Plays a sound.\n\n"
":arg sound: The sound to play.\n"
":type sound: :class:`Sound`\n"
":arg keep: See :attr:`Handle.keep`.\n"
":type keep: bool\n"
":return: The playback handle with which playback can be "
"controlled with.\n"
":rtype: :class:`Handle`");
".. classmethod:: play(sound, keep=False)\n\n"
" Plays a sound.\n\n"
" :arg sound: The sound to play.\n"
" :type sound: :class:`Sound`\n"
" :arg keep: See :attr:`Handle.keep`.\n"
" :type keep: bool\n"
" :return: The playback handle with which playback can be\n"
" controlled with.\n"
" :rtype: :class:`Handle`");
static PyObject *
Device_play(Device* self, PyObject* args, PyObject* kwds)
@@ -210,8 +212,8 @@ Device_play(Device* self, PyObject* args, PyObject* kwds)
}
PyDoc_STRVAR(M_aud_Device_stopAll_doc,
"stopAll()\n\n"
"Stops all playing and paused sounds.");
".. classmethod:: stopAll()\n\n"
" Stops all playing and paused sounds.");
static PyObject *
Device_stopAll(Device* self)
@@ -229,9 +231,9 @@ Device_stopAll(Device* self)
}
PyDoc_STRVAR(M_aud_Device_unlock_doc,
"unlock()\n\n"
"Unlocks the device after a lock call, see :meth:`lock` for "
"details.");
".. classmethod:: unlock()\n\n"
" Unlocks the device after a lock call, see :meth:`lock` for\n"
" details.");
static PyObject *
Device_unlock(Device* self)
@@ -284,7 +286,7 @@ Device_get_channels(Device* self, void* nothing)
PyDoc_STRVAR(M_aud_Device_distance_model_doc,
"The distance model of the device.\n\n"
".. seealso:: http://connect.creativelabs.com/openal/Documentation/OpenAL%201.1%20Specification.htm#_Toc199835864");
".. seealso:: `OpenAL Documentation <https://www.openal.org/documentation/>`__");
static PyObject *
Device_get_distance_model(Device* self, void* nothing)

View File

@@ -60,12 +60,12 @@ DynamicMusic_dealloc(DynamicMusicP* self)
}
PyDoc_STRVAR(M_aud_DynamicMusic_addScene_doc,
"addScene(scene)\n\n"
"Adds a new scene.\n\n"
":arg scene: The scene sound.\n"
":type scene: :class:`Sound`\n"
":return: The new scene id.\n"
":rtype: int");
".. classmethod:: addScene(scene)\n\n"
" Adds a new scene.\n\n"
" :arg scene: The scene sound.\n"
" :type scene: :class:`Sound`\n"
" :return: The new scene id.\n"
" :rtype: int");
static PyObject *
DynamicMusic_addScene(DynamicMusicP* self, PyObject* args)
@@ -90,16 +90,16 @@ DynamicMusic_addScene(DynamicMusicP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_DynamicMusic_addTransition_doc,
"addTransition(ini, end, transition)\n\n"
"Adds a new scene.\n\n"
":arg ini: the initial scene foor the transition.\n"
":type ini: int\n"
":arg end: The final scene for the transition.\n"
":type end: int\n"
":arg transition: The transition sound.\n"
":type transition: :class:`Sound`\n"
":return: false if the ini or end scenes don't exist, true othrwise.\n"
":rtype: bool");
".. classmethod:: addTransition(ini, end, transition)\n\n"
" Adds a new scene.\n\n"
" :arg ini: the initial scene foor the transition.\n"
" :type ini: int\n"
" :arg end: The final scene for the transition.\n"
" :type end: int\n"
" :arg transition: The transition sound.\n"
" :type transition: :class:`Sound`\n"
" :return: false if the ini or end scenes don't exist, true othrwise.\n"
" :rtype: bool");
static PyObject *
DynamicMusic_addTransition(DynamicMusicP* self, PyObject* args)
@@ -125,10 +125,10 @@ DynamicMusic_addTransition(DynamicMusicP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_DynamicMusic_resume_doc,
"resume()\n\n"
"Resumes playback of the scene.\n\n"
":return: Whether the action succeeded.\n"
":rtype: bool");
".. classmethod:: resume()\n\n"
" Resumes playback of the scene.\n\n"
" :return: Whether the action succeeded.\n"
" :rtype: bool");
static PyObject *
DynamicMusic_resume(DynamicMusicP* self)
@@ -145,10 +145,10 @@ DynamicMusic_resume(DynamicMusicP* self)
}
PyDoc_STRVAR(M_aud_DynamicMusic_pause_doc,
"pause()\n\n"
"Pauses playback of the scene.\n\n"
":return: Whether the action succeeded.\n"
":rtype: bool");
".. classmethod:: pause()\n\n"
" Pauses playback of the scene.\n\n"
" :return: Whether the action succeeded.\n"
" :rtype: bool");
static PyObject *
DynamicMusic_pause(DynamicMusicP* self)
@@ -165,10 +165,10 @@ DynamicMusic_pause(DynamicMusicP* self)
}
PyDoc_STRVAR(M_aud_DynamicMusic_stop_doc,
"stop()\n\n"
"Stops playback of the scene.\n\n"
":return: Whether the action succeeded.\n"
":rtype: bool\n\n");
".. classmethod:: stop()\n\n"
" Stops playback of the scene.\n\n"
" :return: Whether the action succeeded.\n"
" :rtype: bool\n\n");
static PyObject *
DynamicMusic_stop(DynamicMusicP* self)
@@ -228,9 +228,9 @@ PyDoc_STRVAR(M_aud_DynamicMusic_position_doc,
static int
DynamicMusic_set_position(DynamicMusicP* self, PyObject* args, void* nothing)
{
float position;
double position;
if(!PyArg_Parse(args, "f:position", &position))
if(!PyArg_Parse(args, "d:position", &position))
return -1;
try
@@ -252,7 +252,7 @@ DynamicMusic_get_position(DynamicMusicP* self, void* nothing)
{
try
{
return Py_BuildValue("f", (*reinterpret_cast<std::shared_ptr<aud::DynamicMusic>*>(self->dynamicMusic))->getPosition());
return Py_BuildValue("d", (*reinterpret_cast<std::shared_ptr<aud::DynamicMusic>*>(self->dynamicMusic))->getPosition());
}
catch(aud::Exception& e)
{
@@ -464,4 +464,4 @@ void addDynamicMusicToModule(PyObject* module)
{
Py_INCREF(&DynamicMusicType);
PyModule_AddObject(module, "DynamicMusic", (PyObject *)&DynamicMusicType);
}
}

View File

@@ -54,16 +54,16 @@ HRTF_dealloc(HRTFP* self)
}
PyDoc_STRVAR(M_aud_HRTF_addImpulseResponse_doc,
"addImpulseResponseFromSound(sound, azimuth, elevation)\n\n"
"Adds a new hrtf to the HRTF object\n\n"
":arg sound: The sound that contains the hrtf.\n"
":type sound: :class:`Sound`\n"
":arg azimuth: The azimuth angle of the hrtf.\n"
":type azimuth: float\n"
":arg elevation: The elevation angle of the hrtf.\n"
":type elevation: float\n"
":return: Whether the action succeeded.\n"
":rtype: bool");
".. classmethod:: addImpulseResponseFromSound(sound, azimuth, elevation)\n\n"
" Adds a new hrtf to the HRTF object\n\n"
" :arg sound: The sound that contains the hrtf.\n"
" :type sound: :class:`Sound`\n"
" :arg azimuth: The azimuth angle of the hrtf.\n"
" :type azimuth: float\n"
" :arg elevation: The elevation angle of the hrtf.\n"
" :type elevation: float\n"
" :return: Whether the action succeeded.\n"
" :rtype: bool");
static PyObject *
HRTF_addImpulseResponseFromSound(HRTFP* self, PyObject* args)
@@ -90,14 +90,14 @@ HRTF_addImpulseResponseFromSound(HRTFP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_HRTF_loadLeftHrtfSet_doc,
"loadLeftHrtfSet(extension, directory)\n\n"
"Loads all HRTFs from a directory.\n\n"
":arg extension: The file extension of the hrtfs.\n"
":type extension: string\n"
":arg directory: The path to where the HRTF files are located.\n"
":type extension: string\n"
":return: The loaded :class:`HRTF` object.\n"
":rtype: :class:`HRTF`\n\n");
".. classmethod:: loadLeftHrtfSet(extension, directory)\n\n"
" Loads all HRTFs from a directory.\n\n"
" :arg extension: The file extension of the hrtfs.\n"
" :type extension: string\n"
" :arg directory: The path to where the HRTF files are located.\n"
" :type extension: string\n"
" :return: The loaded :class:`HRTF` object.\n"
" :rtype: :class:`HRTF`\n\n");
static PyObject *
HRTF_loadLeftHrtfSet(PyTypeObject* type, PyObject* args)
@@ -125,14 +125,14 @@ HRTF_loadLeftHrtfSet(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_HRTF_loadRightHrtfSet_doc,
"loadLeftHrtfSet(extension, directory)\n\n"
"Loads all HRTFs from a directory.\n\n"
":arg extension: The file extension of the hrtfs.\n"
":type extension: string\n"
":arg directory: The path to where the HRTF files are located.\n"
":type extension: string\n"
":return: The loaded :class:`HRTF` object.\n"
":rtype: :class:`HRTF`\n\n");
".. classmethod:: loadLeftHrtfSet(extension, directory)\n\n"
" Loads all HRTFs from a directory.\n\n"
" :arg extension: The file extension of the hrtfs.\n"
" :type extension: string\n"
" :arg directory: The path to where the HRTF files are located.\n"
" :type extension: string\n"
" :return: The loaded :class:`HRTF` object.\n"
" :rtype: :class:`HRTF`\n\n");
static PyObject *
HRTF_loadRightHrtfSet(PyTypeObject* type, PyObject* args)

View File

@@ -38,10 +38,10 @@ Handle_dealloc(Handle* self)
}
PyDoc_STRVAR(M_aud_Handle_pause_doc,
"pause()\n\n"
"Pauses playback.\n\n"
":return: Whether the action succeeded.\n"
":rtype: bool");
".. classmethod:: pause()\n\n"
" Pauses playback.\n\n"
" :return: Whether the action succeeded.\n"
" :rtype: bool");
static PyObject *
Handle_pause(Handle* self)
@@ -58,10 +58,10 @@ Handle_pause(Handle* self)
}
PyDoc_STRVAR(M_aud_Handle_resume_doc,
"resume()\n\n"
"Resumes playback.\n\n"
":return: Whether the action succeeded.\n"
":rtype: bool");
".. classmethod:: resume()\n\n"
" Resumes playback.\n\n"
" :return: Whether the action succeeded.\n"
" :rtype: bool");
static PyObject *
Handle_resume(Handle* self)
@@ -78,11 +78,11 @@ Handle_resume(Handle* self)
}
PyDoc_STRVAR(M_aud_Handle_stop_doc,
"stop()\n\n"
"Stops playback.\n\n"
":return: Whether the action succeeded.\n"
":rtype: bool\n\n"
".. note:: This makes the handle invalid.");
".. classmethod:: stop()\n\n"
" Stops playback.\n\n"
" :return: Whether the action succeeded.\n"
" :rtype: bool\n\n"
" .. note:: This makes the handle invalid.");
static PyObject *
Handle_stop(Handle* self)
@@ -696,7 +696,7 @@ Handle_get_position(Handle* self, void* nothing)
{
try
{
return Py_BuildValue("f", (*reinterpret_cast<std::shared_ptr<IHandle>*>(self->handle))->getPosition());
return Py_BuildValue("d", (*reinterpret_cast<std::shared_ptr<IHandle>*>(self->handle))->getPosition());
}
catch(Exception& e)
{
@@ -708,9 +708,9 @@ Handle_get_position(Handle* self, void* nothing)
static int
Handle_set_position(Handle* self, PyObject* args, void* nothing)
{
float position;
double position;
if(!PyArg_Parse(args, "f:position", &position))
if(!PyArg_Parse(args, "d:position", &position))
return -1;
try
@@ -1122,5 +1122,3 @@ void addHandleToModule(PyObject* module)
Py_INCREF(&HandleType);
PyModule_AddObject(module, "Handle", (PyObject *)&HandleType);
}

View File

@@ -60,14 +60,15 @@ PlaybackManager_dealloc(PlaybackManagerP* self)
}
PyDoc_STRVAR(M_aud_PlaybackManager_play_doc,
"setVolume(sound, catKey)\n\n"
"Plays a sound through the playback manager and assigns it to a category.\n\n"
":arg sound: The sound to play.\n"
":type sound: :class:`Sound`\n"
":arg catKey: the key of the category in which the sound will be added, if it doesn't exist, a new one will be created.\n"
":type catKey: int\n"
":return: The playback handle with which playback can be controlled with.\n"
":rtype: :class:`Handle`");
".. classmethod:: setVolume(sound, catKey)\n\n"
" Plays a sound through the playback manager and assigns it to a category.\n\n"
" :arg sound: The sound to play.\n"
" :type sound: :class:`Sound`\n"
" :arg catKey: the key of the category in which the sound will be added,\n"
" if it doesn't exist, a new one will be created.\n"
" :type catKey: int\n"
" :return: The playback handle with which playback can be controlled with.\n"
" :rtype: :class:`Handle`");
static PyObject *
PlaybackManager_play(PlaybackManagerP* self, PyObject* args)
@@ -103,12 +104,12 @@ PlaybackManager_play(PlaybackManagerP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_PlaybackManager_resume_doc,
"resume(catKey)\n\n"
"Resumes playback of the catgory.\n\n"
":arg catKey: the key of the category.\n"
":type catKey: int\n"
":return: Whether the action succeeded.\n"
":rtype: bool");
".. classmethod:: resume(catKey)\n\n"
" Resumes playback of the catgory.\n\n"
" :arg catKey: the key of the category.\n"
" :type catKey: int\n"
" :return: Whether the action succeeded.\n"
" :rtype: bool");
static PyObject *
PlaybackManager_resume(PlaybackManagerP* self, PyObject* args)
@@ -130,12 +131,12 @@ PlaybackManager_resume(PlaybackManagerP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_PlaybackManager_pause_doc,
"pause(catKey)\n\n"
"Pauses playback of the category.\n\n"
":arg catKey: the key of the category.\n"
":type catKey: int\n"
":return: Whether the action succeeded.\n"
":rtype: bool");
".. classmethod:: pause(catKey)\n\n"
" Pauses playback of the category.\n\n"
" :arg catKey: the key of the category.\n"
" :type catKey: int\n"
" :return: Whether the action succeeded.\n"
" :rtype: bool");
static PyObject *
PlaybackManager_pause(PlaybackManagerP* self, PyObject* args)
@@ -157,12 +158,12 @@ PlaybackManager_pause(PlaybackManagerP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_PlaybackManager_add_category_doc,
"addCategory(volume)\n\n"
"Adds a category with a custom volume.\n\n"
":arg volume: The volume for ther new category.\n"
":type volume: float\n"
":return: The key of the new category.\n"
":rtype: int\n\n");
".. classmethod:: addCategory(volume)\n\n"
" Adds a category with a custom volume.\n\n"
" :arg volume: The volume for ther new category.\n"
" :type volume: float\n"
" :return: The key of the new category.\n"
" :rtype: int\n\n");
static PyObject *
PlaybackManager_add_category(PlaybackManagerP* self, PyObject* args)
@@ -184,12 +185,12 @@ PlaybackManager_add_category(PlaybackManagerP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_PlaybackManager_get_volume_doc,
"getVolume(catKey)\n\n"
"Retrieves the volume of a category.\n\n"
":arg catKey: the key of the category.\n"
":type catKey: int\n"
":return: The volume of the cateogry.\n"
":rtype: float\n\n");
".. classmethod:: getVolume(catKey)\n\n"
" Retrieves the volume of a category.\n\n"
" :arg catKey: the key of the category.\n"
" :type catKey: int\n"
" :return: The volume of the cateogry.\n"
" :rtype: float\n\n");
static PyObject *
PlaybackManager_get_volume(PlaybackManagerP* self, PyObject* args)
@@ -211,14 +212,14 @@ PlaybackManager_get_volume(PlaybackManagerP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_PlaybackManager_set_volume_doc,
"setVolume(volume, catKey)\n\n"
"Changes the volume of a category.\n\n"
":arg volume: the new volume value.\n"
":type volume: float\n"
":arg catKey: the key of the category.\n"
":type catKey: int\n"
":return: Whether the action succeeded.\n"
":rtype: int\n\n");
".. classmethod:: setVolume(volume, catKey)\n\n"
" Changes the volume of a category.\n\n"
" :arg volume: the new volume value.\n"
" :type volume: float\n"
" :arg catKey: the key of the category.\n"
" :type catKey: int\n"
" :return: Whether the action succeeded.\n"
" :rtype: int\n\n");
static PyObject *
PlaybackManager_set_volume(PlaybackManagerP* self, PyObject* args)
@@ -241,12 +242,12 @@ PlaybackManager_set_volume(PlaybackManagerP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_PlaybackManager_stop_doc,
"stop(catKey)\n\n"
"Stops playback of the category.\n\n"
":arg catKey: the key of the category.\n"
":type catKey: int\n"
":return: Whether the action succeeded.\n"
":rtype: bool\n\n");
".. classmethod:: stop(catKey)\n\n"
" Stops playback of the category.\n\n"
" :arg catKey: the key of the category.\n"
" :type catKey: int\n"
" :return: Whether the action succeeded.\n"
" :rtype: bool\n\n");
static PyObject *
PlaybackManager_stop(PlaybackManagerP* self, PyObject* args)
@@ -268,8 +269,8 @@ PlaybackManager_stop(PlaybackManagerP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_PlaybackManager_clean_doc,
"clean()\n\n"
"Cleans all the invalid and finished sound from the playback manager.\n\n");
".. classmethod:: clean()\n\n"
" Cleans all the invalid and finished sound from the playback manager.\n\n");
static PyObject *
PlaybackManager_clean(PlaybackManagerP* self)

View File

@@ -99,30 +99,30 @@ Sequence_new(PyTypeObject* type, PyObject* args, PyObject* kwds)
}
PyDoc_STRVAR(M_aud_Sequence_add_doc,
"add()\n\n"
"Adds a new entry to the sequence.\n\n"
":arg sound: The sound this entry should play.\n"
":type sound: :class:`Sound`\n"
":arg begin: The start time.\n"
":type begin: float\n"
":arg end: The end time or a negative value if determined by the sound.\n"
":type end: float\n"
":arg skip: How much seconds should be skipped at the beginning.\n"
":type skip: float\n"
":return: The entry added.\n"
":rtype: :class:`SequenceEntry`");
".. classmethod:: add()\n\n"
" Adds a new entry to the sequence.\n\n"
" :arg sound: The sound this entry should play.\n"
" :type sound: :class:`Sound`\n"
" :arg begin: The start time.\n"
" :type begin: double\n"
" :arg end: The end time or a negative value if determined by the sound.\n"
" :type end: double\n"
" :arg skip: How much seconds should be skipped at the beginning.\n"
" :type skip: double\n"
" :return: The entry added.\n"
" :rtype: :class:`SequenceEntry`");
static PyObject *
Sequence_add(Sequence* self, PyObject* args, PyObject* kwds)
{
PyObject* object;
float begin;
float end = -1.0f;
float skip = 0.0f;
double begin;
double end = -1.0;
double skip = 0.0;
static const char* kwlist[] = {"sound", "begin", "end", "skip", nullptr};
if(!PyArg_ParseTupleAndKeywords(args, kwds, "Of|ff:add", const_cast<char**>(kwlist), &object, &begin, &end, &skip))
if(!PyArg_ParseTupleAndKeywords(args, kwds, "Od|dd:add", const_cast<char**>(kwlist), &object, &begin, &end, &skip))
return nullptr;
Sound* sound = checkSound(object);
@@ -151,10 +151,10 @@ Sequence_add(Sequence* self, PyObject* args, PyObject* kwds)
}
PyDoc_STRVAR(M_aud_Sequence_remove_doc,
"remove()\n\n"
"Removes an entry from the sequence.\n\n"
":arg entry: The entry to remove.\n"
":type entry: :class:`SequenceEntry`\n");
".. classmethod:: remove()\n\n"
" Removes an entry from the sequence.\n\n"
" :arg entry: The entry to remove.\n"
" :type entry: :class:`SequenceEntry`\n");
static PyObject *
Sequence_remove(Sequence* self, PyObject* args)
@@ -183,16 +183,16 @@ Sequence_remove(Sequence* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sequence_setAnimationData_doc,
"setAnimationData()\n\n"
"Writes animation data to a sequence.\n\n"
":arg type: The type of animation data.\n"
":type type: int\n"
":arg frame: The frame this data is for.\n"
":type frame: int\n"
":arg data: The data to write.\n"
":type data: sequence of float\n"
":arg animated: Whether the attribute is animated.\n"
":type animated: bool");
".. classmethod:: setAnimationData()\n\n"
" Writes animation data to a sequence.\n\n"
" :arg type: The type of animation data.\n"
" :type type: int\n"
" :arg frame: The frame this data is for.\n"
" :type frame: int\n"
" :arg data: The data to write.\n"
" :type data: sequence of float\n"
" :arg animated: Whether the attribute is animated.\n"
" :type animated: bool");
static PyObject *
Sequence_setAnimationData(Sequence* self, PyObject* args)
@@ -325,7 +325,7 @@ Sequence_set_channels(Sequence* self, PyObject* args, void* nothing)
PyDoc_STRVAR(M_aud_Sequence_distance_model_doc,
"The distance model of the sequence.\n\n"
".. seealso:: http://connect.creativelabs.com/openal/Documentation/OpenAL%201.1%20Specification.htm#_Toc199835864");
".. seealso:: `OpenAL Documentation <https://www.openal.org/documentation/>`__");
static PyObject *
Sequence_get_distance_model(Sequence* self, void* nothing)

View File

@@ -43,21 +43,21 @@ SequenceEntry_dealloc(SequenceEntry* self)
}
PyDoc_STRVAR(M_aud_SequenceEntry_move_doc,
"move()\n\n"
"Moves the entry.\n\n"
":arg begin: The new start time.\n"
":type begin: float\n"
":arg end: The new end time or a negative value if unknown.\n"
":type end: float\n"
":arg skip: How many seconds to skip at the beginning.\n"
":type skip: float\n");
".. classmethod:: move()\n\n"
" Moves the entry.\n\n"
" :arg begin: The new start time.\n"
" :type begin: double\n"
" :arg end: The new end time or a negative value if unknown.\n"
" :type end: double\n"
" :arg skip: How many seconds to skip at the beginning.\n"
" :type skip: double\n");
static PyObject *
SequenceEntry_move(SequenceEntry* self, PyObject* args)
{
float begin, end, skip;
double begin, end, skip;
if(!PyArg_ParseTuple(args, "fff:move", &begin, &end, &skip))
if(!PyArg_ParseTuple(args, "ddd:move", &begin, &end, &skip))
return nullptr;
try
@@ -73,16 +73,16 @@ SequenceEntry_move(SequenceEntry* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_SequenceEntry_setAnimationData_doc,
"setAnimationData()\n\n"
"Writes animation data to a sequenced entry.\n\n"
":arg type: The type of animation data.\n"
":type type: int\n"
":arg frame: The frame this data is for.\n"
":type frame: int\n"
":arg data: The data to write.\n"
":type data: sequence of float\n"
":arg animated: Whether the attribute is animated.\n"
":type animated: bool");
".. classmethod:: setAnimationData()\n\n"
" Writes animation data to a sequenced entry.\n\n"
" :arg type: The type of animation data.\n"
" :type type: int\n"
" :arg frame: The frame this data is for.\n"
" :type frame: int\n"
" :arg data: The data to write.\n"
" :type data: sequence of float\n"
" :arg animated: Whether the attribute is animated.\n"
" :type animated: bool");
static PyObject *
SequenceEntry_setAnimationData(SequenceEntry* self, PyObject* args)

View File

@@ -114,11 +114,11 @@ Sound_new(PyTypeObject* type, PyObject* args, PyObject* kwds)
}
PyDoc_STRVAR(M_aud_Sound_data_doc,
"data()\n\n"
"Retrieves the data of the sound as numpy array.\n\n"
":return: A two dimensional numpy float array.\n"
":rtype: :class:`numpy.ndarray`\n\n"
".. note:: Best efficiency with cached sounds.");
".. classmethod:: data()\n\n"
" Retrieves the data of the sound as numpy array.\n\n"
" :return: A two dimensional numpy float array.\n"
" :rtype: :class:`numpy.ndarray`\n\n"
" .. note:: Best efficiency with cached sounds.");
static PyObject *
Sound_data(Sound* self)
@@ -145,24 +145,24 @@ Sound_data(Sound* self)
}
PyDoc_STRVAR(M_aud_Sound_write_doc,
"write(filename, rate, channels, format, container, codec, bitrate, buffersize)\n\n"
"Writes the sound to a file.\n\n"
":arg filename: The path to write to.\n"
":type filename: string\n"
":arg rate: The sample rate to write with.\n"
":type rate: int\n"
":arg channels: The number of channels to write with.\n"
":type channels: int\n"
":arg format: The sample format to write with.\n"
":type format: int\n"
":arg container: The container format for the file.\n"
":type container: int\n"
":arg codec: The codec to use in the file.\n"
":type codec: int\n"
":arg bitrate: The bitrate to write with.\n"
":type bitrate: int\n"
":arg buffersize: The size of the writing buffer.\n"
":type buffersize: int\n");
".. classmethod:: write(filename, rate, channels, format, container, codec, bitrate, buffersize)\n\n"
" Writes the sound to a file.\n\n"
" :arg filename: The path to write to.\n"
" :type filename: string\n"
" :arg rate: The sample rate to write with.\n"
" :type rate: int\n"
" :arg channels: The number of channels to write with.\n"
" :type channels: int\n"
" :arg format: The sample format to write with.\n"
" :type format: int\n"
" :arg container: The container format for the file.\n"
" :type container: int\n"
" :arg codec: The codec to use in the file.\n"
" :type codec: int\n"
" :arg bitrate: The bitrate to write with.\n"
" :type bitrate: int\n"
" :arg buffersize: The size of the writing buffer.\n"
" :type buffersize: int");
static PyObject *
Sound_write(Sound* self, PyObject* args, PyObject* kwds)
@@ -286,14 +286,14 @@ Sound_write(Sound* self, PyObject* args, PyObject* kwds)
}
PyDoc_STRVAR(M_aud_Sound_buffer_doc,
"buffer(data, rate)\n\n"
"Creates a sound from a data buffer.\n\n"
":arg data: The data as two dimensional numpy array.\n"
":type data: numpy.ndarray\n"
":arg rate: The sample rate.\n"
":type rate: double\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`");
".. classmethod:: buffer(data, rate)\n\n"
" Creates a sound from a data buffer.\n\n"
" :arg data: The data as two dimensional numpy array.\n"
" :type data: numpy.ndarray\n"
" :arg rate: The sample rate.\n"
" :type rate: double\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`");
static PyObject *
Sound_buffer(PyTypeObject* type, PyObject* args)
@@ -356,16 +356,17 @@ Sound_buffer(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_cache_doc,
"cache()\n\n"
"Caches a sound into RAM.\n"
"This saves CPU usage needed for decoding and file access if the "
"underlying sound reads from a file on the harddisk, but it "
"consumes a lot of memory.\n\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`\n\n"
".. note:: Only known-length factories can be buffered.\n\n"
".. warning:: Raw PCM data needs a lot of space, only buffer "
"short factories.");
".. classmethod:: cache()\n\n"
" Caches a sound into RAM.\n\n"
" This saves CPU usage needed for decoding and file access if the\n"
" underlying sound reads from a file on the harddisk,\n"
" but it consumes a lot of memory.\n\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`\n\n"
" .. note:: Only known-length factories can be buffered.\n\n"
" .. warning::\n\n"
" Raw PCM data needs a lot of space, only buffer\n"
" short factories.");
static PyObject *
Sound_cache(Sound* self)
@@ -391,15 +392,16 @@ Sound_cache(Sound* self)
}
PyDoc_STRVAR(M_aud_Sound_file_doc,
"file(filename)\n\n"
"Creates a sound object of a sound file.\n\n"
":arg filename: Path of the file.\n"
":type filename: string\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`\n\n"
".. warning:: If the file doesn't exist or can't be read you will "
"not get an exception immediately, but when you try to start "
"playback of that sound.");
".. classmethod:: file(filename)\n\n"
" Creates a sound object of a sound file.\n\n"
" :arg filename: Path of the file.\n"
" :type filename: string\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`\n\n"
" .. warning::\n\n"
" If the file doesn't exist or can't be read you will\n"
" not get an exception immediately, but when you try to start\n"
" playback of that sound.\n");
static PyObject *
Sound_file(PyTypeObject* type, PyObject* args)
@@ -430,15 +432,15 @@ Sound_file(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_sawtooth_doc,
"sawtooth(frequency, rate=48000)\n\n"
"Creates a sawtooth sound which plays a sawtooth wave.\n\n"
":arg frequency: The frequency of the sawtooth wave in Hz.\n"
":type frequency: float\n"
":arg rate: The sampling rate in Hz. It's recommended to set this "
"value to the playback device's samling rate to avoid resamping.\n"
":type rate: int\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`");
".. classmethod:: sawtooth(frequency, rate=48000)\n\n"
" Creates a sawtooth sound which plays a sawtooth wave.\n\n"
" :arg frequency: The frequency of the sawtooth wave in Hz.\n"
" :type frequency: float\n"
" :arg rate: The sampling rate in Hz. It's recommended to set this\n"
" value to the playback device's samling rate to avoid resamping.\n"
" :type rate: int\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`");
static PyObject *
Sound_sawtooth(PyTypeObject* type, PyObject* args)
@@ -470,13 +472,13 @@ Sound_sawtooth(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_silence_doc,
"silence(rate=48000)\n\n"
"Creates a silence sound which plays simple silence.\n\n"
":arg rate: The sampling rate in Hz. It's recommended to set this "
"value to the playback device's samling rate to avoid resamping.\n"
":type rate: int\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`");
".. classmethod:: silence(rate=48000)\n\n"
" Creates a silence sound which plays simple silence.\n\n"
" :arg rate: The sampling rate in Hz. It's recommended to set this\n"
" value to the playback device's samling rate to avoid resamping.\n"
" :type rate: int\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`");
static PyObject *
Sound_silence(PyTypeObject* type, PyObject* args)
@@ -507,15 +509,15 @@ Sound_silence(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_sine_doc,
"sine(frequency, rate=48000)\n\n"
"Creates a sine sound which plays a sine wave.\n\n"
":arg frequency: The frequency of the sine wave in Hz.\n"
":type frequency: float\n"
":arg rate: The sampling rate in Hz. It's recommended to set this "
"value to the playback device's samling rate to avoid resamping.\n"
":type rate: int\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`");
".. classmethod:: sine(frequency, rate=48000)\n\n"
" Creates a sine sound which plays a sine wave.\n\n"
" :arg frequency: The frequency of the sine wave in Hz.\n"
" :type frequency: float\n"
" :arg rate: The sampling rate in Hz. It's recommended to set this\n"
" value to the playback device's samling rate to avoid resamping.\n"
" :type rate: int\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`");
static PyObject *
Sound_sine(PyTypeObject* type, PyObject* args)
@@ -547,15 +549,15 @@ Sound_sine(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_square_doc,
"square(frequency, rate=48000)\n\n"
"Creates a square sound which plays a square wave.\n\n"
":arg frequency: The frequency of the square wave in Hz.\n"
":type frequency: float\n"
":arg rate: The sampling rate in Hz. It's recommended to set this "
"value to the playback device's samling rate to avoid resamping.\n"
":type rate: int\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`");
".. classmethod:: square(frequency, rate=48000)\n\n"
" Creates a square sound which plays a square wave.\n\n"
" :arg frequency: The frequency of the square wave in Hz.\n"
" :type frequency: float\n"
" :arg rate: The sampling rate in Hz. It's recommended to set this\n"
" value to the playback device's samling rate to avoid resamping.\n"
" :type rate: int\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`");
static PyObject *
Sound_square(PyTypeObject* type, PyObject* args)
@@ -587,15 +589,15 @@ Sound_square(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_triangle_doc,
"triangle(frequency, rate=48000)\n\n"
"Creates a triangle sound which plays a triangle wave.\n\n"
":arg frequency: The frequency of the triangle wave in Hz.\n"
":type frequency: float\n"
":arg rate: The sampling rate in Hz. It's recommended to set this "
"value to the playback device's samling rate to avoid resamping.\n"
":type rate: int\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`");
".. classmethod:: triangle(frequency, rate=48000)\n\n"
" Creates a triangle sound which plays a triangle wave.\n\n"
" :arg frequency: The frequency of the triangle wave in Hz.\n"
" :type frequency: float\n"
" :arg rate: The sampling rate in Hz. It's recommended to set this\n"
" value to the playback device's samling rate to avoid resamping.\n"
" :type rate: int\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`");
static PyObject *
Sound_triangle(PyTypeObject* type, PyObject* args)
@@ -627,14 +629,16 @@ Sound_triangle(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_accumulate_doc,
"accumulate(additive=False)\n\n"
"Accumulates a sound by summing over positive input differences thus generating a monotonic sigal. "
"If additivity is set to true negative input differences get added too, but positive ones with a factor of two. "
"Note that with additivity the signal is not monotonic anymore.\n\n"
":arg additive: Whether the accumulation should be additive or not.\n"
":type time: bool\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`");
".. classmethod:: accumulate(additive=False)\n\n"
" Accumulates a sound by summing over positive input\n"
" differences thus generating a monotonic sigal.\n"
" If additivity is set to true negative input differences get added too,\n"
" but positive ones with a factor of two.\n\n"
" Note that with additivity the signal is not monotonic anymore.\n\n"
" :arg additive: Whether the accumulation should be additive or not.\n"
" :type time: bool\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`");
static PyObject *
Sound_accumulate(Sound* self, PyObject* args)
@@ -677,19 +681,19 @@ Sound_accumulate(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_ADSR_doc,
"ADSR(attack,decay,sustain,release)\n\n"
"Attack-Decay-Sustain-Release envelopes the volume of a sound. "
"Note: there is currently no way to trigger the release with this API.\n\n"
":arg attack: The attack time in seconds.\n"
":type attack: float\n"
":arg decay: The decay time in seconds.\n"
":type decay: float\n"
":arg sustain: The sustain level.\n"
":type sustain: float\n"
":arg release: The release level.\n"
":type release: float\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`");
".. classmethod:: ADSR(attack, decay, sustain, release)\n\n"
" Attack-Decay-Sustain-Release envelopes the volume of a sound.\n"
" Note: there is currently no way to trigger the release with this API.\n\n"
" :arg attack: The attack time in seconds.\n"
" :type attack: float\n"
" :arg decay: The decay time in seconds.\n"
" :type decay: float\n"
" :arg sustain: The sustain level.\n"
" :type sustain: float\n"
" :arg release: The release level.\n"
" :type release: float\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`");
static PyObject *
Sound_ADSR(Sound* self, PyObject* args)
@@ -720,14 +724,12 @@ Sound_ADSR(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_delay_doc,
"delay(time)\n\n"
"Delays by playing adding silence in front of the other sound's "
"data.\n\n"
":arg time: How many seconds of silence should be added before "
"the sound.\n"
":type time: float\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`");
".. classmethod:: delay(time)\n\n"
" Delays by playing adding silence in front of the other sound's data.\n\n"
" :arg time: How many seconds of silence should be added before the sound.\n"
" :type time: float\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`");
static PyObject *
Sound_delay(Sound* self, PyObject* args)
@@ -758,19 +760,18 @@ Sound_delay(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_envelope_doc,
"envelope(attack, release, threshold, arthreshold)\n\n"
"Delays by playing adding silence in front of the other sound's "
"data.\n\n"
":arg attack: The attack factor.\n"
":type attack: float\n"
":arg release: The release factor.\n"
":type release: float\n"
":arg threshold: The general threshold value.\n"
":type threshold: float\n"
":arg arthreshold: The attack/release threshold value.\n"
":type arthreshold: float\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`");
".. classmethod:: envelope(attack, release, threshold, arthreshold)\n\n"
" Delays by playing adding silence in front of the other sound's data.\n\n"
" :arg attack: The attack factor.\n"
" :type attack: float\n"
" :arg release: The release factor.\n"
" :type release: float\n"
" :arg threshold: The general threshold value.\n"
" :type threshold: float\n"
" :arg arthreshold: The attack/release threshold value.\n"
" :type arthreshold: float\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`");
static PyObject *
Sound_envelope(Sound* self, PyObject* args)
@@ -801,16 +802,16 @@ Sound_envelope(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_fadein_doc,
"fadein(start, length)\n\n"
"Fades a sound in by raising the volume linearly in the given "
"time interval.\n\n"
":arg start: Time in seconds when the fading should start.\n"
":type start: float\n"
":arg length: Time in seconds how long the fading should last.\n"
":type length: float\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`\n\n"
".. note:: Before the fade starts it plays silence.");
".. classmethod:: fadein(start, length)\n\n"
" Fades a sound in by raising the volume linearly in the given\n"
" time interval.\n\n"
" :arg start: Time in seconds when the fading should start.\n"
" :type start: float\n"
" :arg length: Time in seconds how long the fading should last.\n"
" :type length: float\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`\n\n"
" .. note:: Before the fade starts it plays silence.");
static PyObject *
Sound_fadein(Sound* self, PyObject* args)
@@ -841,17 +842,18 @@ Sound_fadein(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_fadeout_doc,
"fadeout(start, length)\n\n"
"Fades a sound in by lowering the volume linearly in the given "
"time interval.\n\n"
":arg start: Time in seconds when the fading should start.\n"
":type start: float\n"
":arg length: Time in seconds how long the fading should last.\n"
":type length: float\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`\n\n"
".. note:: After the fade this sound plays silence, so that "
"the length of the sound is not altered.");
".. classmethod:: fadeout(start, length)\n\n"
" Fades a sound in by lowering the volume linearly in the given\n"
" time interval.\n\n"
" :arg start: Time in seconds when the fading should start.\n"
" :type start: float\n"
" :arg length: Time in seconds how long the fading should last.\n"
" :type length: float\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`\n\n"
" .. note::\n\n"
" After the fade this sound plays silence, so that\n"
" the length of the sound is not altered.");
static PyObject *
Sound_fadeout(Sound* self, PyObject* args)
@@ -882,20 +884,20 @@ Sound_fadeout(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_filter_doc,
"filter(b, a = (1))\n\n"
"Filters a sound with the supplied IIR filter coefficients.\n"
"Without the second parameter you'll get a FIR filter.\n"
"If the first value of the a sequence is 0 it will be set to 1 "
"automatically.\n"
"If the first value of the a sequence is neither 0 nor 1, all "
"filter coefficients will be scaled by this value so that it is 1 "
"in the end, you don't have to scale yourself.\n\n"
":arg b: The nominator filter coefficients.\n"
":type b: sequence of float\n"
":arg a: The denominator filter coefficients.\n"
":type a: sequence of float\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`");
".. classmethod:: filter(b, a = (1))\n\n"
" Filters a sound with the supplied IIR filter coefficients.\n"
" Without the second parameter you'll get a FIR filter.\n\n"
" If the first value of the a sequence is 0,\n"
" it will be set to 1 automatically.\n"
" If the first value of the a sequence is neither 0 nor 1, all\n"
" filter coefficients will be scaled by this value so that it is 1\n"
" in the end, you don't have to scale yourself.\n\n"
" :arg b: The nominator filter coefficients.\n"
" :type b: sequence of float\n"
" :arg a: The denominator filter coefficients.\n"
" :type a: sequence of float\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`");
static PyObject *
Sound_filter(Sound* self, PyObject* args)
@@ -982,15 +984,15 @@ Sound_filter(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_highpass_doc,
"highpass(frequency, Q=0.5)\n\n"
"Creates a second order highpass filter based on the transfer "
"function H(s) = s^2 / (s^2 + s/Q + 1)\n\n"
":arg frequency: The cut off trequency of the highpass.\n"
":type frequency: float\n"
":arg Q: Q factor of the lowpass.\n"
":type Q: float\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`");
".. classmethod:: highpass(frequency, Q=0.5)\n\n"
" Creates a second order highpass filter based on the transfer\n"
" function :math:`H(s) = s^2 / (s^2 + s/Q + 1)`\n\n"
" :arg frequency: The cut off trequency of the highpass.\n"
" :type frequency: float\n"
" :arg Q: Q factor of the lowpass.\n"
" :type Q: float\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`");
static PyObject *
Sound_highpass(Sound* self, PyObject* args)
@@ -1022,14 +1024,14 @@ Sound_highpass(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_limit_doc,
"limit(start, end)\n\n"
"Limits a sound within a specific start and end time.\n\n"
":arg start: Start time in seconds.\n"
":type start: float\n"
":arg end: End time in seconds.\n"
":type end: float\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`");
".. classmethod:: limit(start, end)\n\n"
" Limits a sound within a specific start and end time.\n\n"
" :arg start: Start time in seconds.\n"
" :type start: float\n"
" :arg end: End time in seconds.\n"
" :type end: float\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`");
static PyObject *
Sound_limit(Sound* self, PyObject* args)
@@ -1060,15 +1062,16 @@ Sound_limit(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_loop_doc,
"loop(count)\n\n"
"Loops a sound.\n\n"
":arg count: How often the sound should be looped. "
"Negative values mean endlessly.\n"
":type count: integer\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`\n\n"
".. note:: This is a filter function, you might consider using "
":attr:`Handle.loop_count` instead.");
".. classmethod:: loop(count)\n\n"
" Loops a sound.\n\n"
" :arg count: How often the sound should be looped.\n"
" Negative values mean endlessly.\n"
" :type count: integer\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`\n\n"
" .. note::\n\n"
" This is a filter function, you might consider using\n"
" :attr:`Handle.loop_count` instead.");
static PyObject *
Sound_loop(Sound* self, PyObject* args)
@@ -1099,15 +1102,15 @@ Sound_loop(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_lowpass_doc,
"lowpass(frequency, Q=0.5)\n\n"
"Creates a second order lowpass filter based on the transfer "
"function H(s) = 1 / (s^2 + s/Q + 1)\n\n"
":arg frequency: The cut off trequency of the lowpass.\n"
":type frequency: float\n"
":arg Q: Q factor of the lowpass.\n"
":type Q: float\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`");
".. classmethod:: lowpass(frequency, Q=0.5)\n\n"
" Creates a second order lowpass filter based on the transfer "
" function :math:`H(s) = 1 / (s^2 + s/Q + 1)`\n\n"
" :arg frequency: The cut off trequency of the lowpass.\n"
" :type frequency: float\n"
" :arg Q: Q factor of the lowpass.\n"
" :type Q: float\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`");
static PyObject *
Sound_lowpass(Sound* self, PyObject* args)
@@ -1139,14 +1142,15 @@ Sound_lowpass(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_modulate_doc,
"modulate(sound)\n\n"
"Modulates two factories.\n\n"
":arg sound: The sound to modulate over the other.\n"
":type sound: :class:`Sound`\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`\n\n"
".. note:: The two factories have to have the same specifications "
"(channels and samplerate).");
".. classmethod:: modulate(sound)\n\n"
" Modulates two factories.\n\n"
" :arg sound: The sound to modulate over the other.\n"
" :type sound: :class:`Sound`\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`\n\n"
" .. note::\n\n"
" The two factories have to have the same specifications\n"
" (channels and samplerate).");
static PyObject *
Sound_modulate(Sound* self, PyObject* object)
@@ -1180,17 +1184,19 @@ Sound_modulate(Sound* self, PyObject* object)
}
PyDoc_STRVAR(M_aud_Sound_pitch_doc,
"pitch(factor)\n\n"
"Changes the pitch of a sound with a specific factor.\n\n"
":arg factor: The factor to change the pitch with.\n"
":type factor: float\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`\n\n"
".. note:: This is done by changing the sample rate of the "
"underlying sound, which has to be an integer, so the factor "
"value rounded and the factor may not be 100 % accurate.\n\n"
".. note:: This is a filter function, you might consider using "
":attr:`Handle.pitch` instead.");
".. classmethod:: pitch(factor)\n\n"
" Changes the pitch of a sound with a specific factor.\n\n"
" :arg factor: The factor to change the pitch with.\n"
" :type factor: float\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`\n\n"
" .. note::\n\n"
" This is done by changing the sample rate of the\n"
" underlying sound, which has to be an integer, so the factor\n"
" value rounded and the factor may not be 100 % accurate.\n\n"
" .. note::\n\n"
" This is a filter function, you might consider using\n"
" :attr:`Handle.pitch` instead.");
static PyObject *
Sound_pitch(Sound* self, PyObject* args)
@@ -1221,12 +1227,12 @@ Sound_pitch(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_rechannel_doc,
"rechannel(channels)\n\n"
"Rechannels the sound.\n\n"
":arg channels: The new channel configuration.\n"
":type channels: int\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`");
".. classmethod:: rechannel(channels)\n\n"
" Rechannels the sound.\n\n"
" :arg channels: The new channel configuration.\n"
" :type channels: int\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`");
static PyObject *
Sound_rechannel(Sound* self, PyObject* args)
@@ -1261,14 +1267,14 @@ Sound_rechannel(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_resample_doc,
"resample(rate, high_quality)\n\n"
"Resamples the sound.\n\n"
":arg rate: The new sample rate.\n"
":type rate: double\n"
":arg high_quality: When true use a higher quality but slower resampler.\n"
":type high_quality: bool\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`");
".. classmethod:: resample(rate, high_quality)\n\n"
" Resamples the sound.\n\n"
" :arg rate: The new sample rate.\n"
" :type rate: double\n"
" :arg high_quality: When true use a higher quality but slower resampler.\n"
" :type high_quality: bool\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`");
static PyObject *
Sound_resample(Sound* self, PyObject* args)
@@ -1316,17 +1322,19 @@ Sound_resample(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_reverse_doc,
"reverse()\n\n"
"Plays a sound reversed.\n\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`\n\n"
".. note:: The sound has to have a finite length and has to be "
"seekable. It's recommended to use this only with factories with "
"fast and accurate seeking, which is not true for encoded audio "
"files, such ones should be buffered using :meth:`cache` before "
"being played reversed.\n\n"
".. warning:: If seeking is not accurate in the underlying sound "
"you'll likely hear skips/jumps/cracks.");
".. classmethod:: reverse()\n\n"
" Plays a sound reversed.\n\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`\n\n"
" .. note::\n\n"
" The sound has to have a finite length and has to be seekable.\n"
" It's recommended to use this only with factories with\n"
" fast and accurate seeking, which is not true for encoded audio\n"
" files, such ones should be buffered using :meth:`cache` before\n"
" being played reversed.\n\n"
" .. warning::\n\n"
" If seeking is not accurate in the underlying sound\n"
" you'll likely hear skips/jumps/cracks.");
static PyObject *
Sound_reverse(Sound* self)
@@ -1352,10 +1360,10 @@ Sound_reverse(Sound* self)
}
PyDoc_STRVAR(M_aud_Sound_sum_doc,
"sum()\n\n"
"Sums the samples of a sound.\n\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`");
".. classmethod:: sum()\n\n"
" Sums the samples of a sound.\n\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`");
static PyObject *
Sound_sum(Sound* self)
@@ -1381,12 +1389,12 @@ Sound_sum(Sound* self)
}
PyDoc_STRVAR(M_aud_Sound_threshold_doc,
"threshold(threshold = 0)\n\n"
"Makes a threshold wave out of an audio wave by setting all samples "
"with a amplitude >= threshold to 1, all <= -threshold to -1 and "
"all between to 0.\n\n"
":arg threshold: Threshold value over which an amplitude counts "
"non-zero.\n"
".. classmethod:: threshold(threshold = 0)\n\n"
" Makes a threshold wave out of an audio wave by setting all samples\n"
" with a amplitude >= threshold to 1, all <= -threshold to -1 and\n"
" all between to 0.\n\n"
" :arg threshold: Threshold value over which an amplitude counts\n"
" non-zero.\n\n"
":type threshold: float\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`");
@@ -1420,15 +1428,17 @@ Sound_threshold(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_volume_doc,
"volume(volume)\n\n"
"Changes the volume of a sound.\n\n"
":arg volume: The new volume..\n"
":type volume: float\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`\n\n"
".. note:: Should be in the range [0, 1] to avoid clipping.\n\n"
".. note:: This is a filter function, you might consider using "
":attr:`Handle.volume` instead.");
".. classmethod:: volume(volume)\n\n"
" Changes the volume of a sound.\n\n"
" :arg volume: The new volume..\n"
" :type volume: float\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`\n\n"
" .. note::\n\n"
" Should be in the range [0, 1] to avoid clipping.\n\n"
" .. note::\n\n"
" This is a filter function, you might consider using\n"
" :attr:`Handle.volume` instead.");
static PyObject *
Sound_volume(Sound* self, PyObject* args)
@@ -1459,14 +1469,15 @@ Sound_volume(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_join_doc,
"join(sound)\n\n"
"Plays two factories in sequence.\n\n"
":arg sound: The sound to play second.\n"
":type sound: :class:`Sound`\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`\n\n"
".. note:: The two factories have to have the same specifications "
"(channels and samplerate).");
".. classmethod:: join(sound)\n\n"
" Plays two factories in sequence.\n\n"
" :arg sound: The sound to play second.\n"
" :type sound: :class:`Sound`\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`\n\n"
" .. note::\n\n"
" The two factories have to have the same specifications\n"
" (channels and samplerate).");
static PyObject *
Sound_join(Sound* self, PyObject* object)
@@ -1501,14 +1512,15 @@ Sound_join(Sound* self, PyObject* object)
}
PyDoc_STRVAR(M_aud_Sound_mix_doc,
"mix(sound)\n\n"
"Mixes two factories.\n\n"
":arg sound: The sound to mix over the other.\n"
":type sound: :class:`Sound`\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`\n\n"
".. note:: The two factories have to have the same specifications "
"(channels and samplerate).");
".. classmethod:: mix(sound)\n\n"
" Mixes two factories.\n\n"
" :arg sound: The sound to mix over the other.\n"
" :type sound: :class:`Sound`\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`\n\n"
" .. note::\n\n"
" The two factories have to have the same specifications\n"
" (channels and samplerate).");
static PyObject *
Sound_mix(Sound* self, PyObject* object)
@@ -1542,11 +1554,11 @@ Sound_mix(Sound* self, PyObject* object)
}
PyDoc_STRVAR(M_aud_Sound_pingpong_doc,
"pingpong()\n\n"
"Plays a sound forward and then backward.\n"
"This is like joining a sound with its reverse.\n\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`");
".. classmethod:: pingpong()\n\n"
" Plays a sound forward and then backward.\n"
" This is like joining a sound with its reverse.\n\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`");
static PyObject *
Sound_pingpong(Sound* self)
@@ -1572,12 +1584,12 @@ Sound_pingpong(Sound* self)
}
PyDoc_STRVAR(M_aud_Sound_list_doc,
"list()\n\n"
"Creates an empty sound list that can contain several sounds.\n\n"
":arg random: wether the playback will be random or not.\n"
":type random: int\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`");
".. classmethod:: list()\n\n"
" Creates an empty sound list that can contain several sounds.\n\n"
" :arg random: whether the playback will be random or not.\n"
" :type random: int\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`");
static PyObject *
Sound_list(PyTypeObject* type, PyObject* args)
@@ -1608,11 +1620,11 @@ Sound_list(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_mutable_doc,
"mutable()\n\n"
"Creates a sound that will be restarted when sought backwards.\n"
"If the original sound is a sound list, the playing sound can change.\n\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`");
".. classmethod:: mutable()\n\n"
" Creates a sound that will be restarted when sought backwards.\n"
" If the original sound is a sound list, the playing sound can change.\n\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`");
static PyObject *
Sound_mutable(Sound* self)
@@ -1638,12 +1650,12 @@ Sound_mutable(Sound* self)
}
PyDoc_STRVAR(M_aud_Sound_list_addSound_doc,
"addSound(sound)\n\n"
"Adds a new sound to a sound list.\n\n"
":arg sound: The sound that will be added to the list.\n"
":type sound: :class:`Sound`\n\n"
".. note:: You can only add a sound to a sound list.");
".. classmethod:: addSound(sound)\n\n"
" Adds a new sound to a sound list.\n\n"
" :arg sound: The sound that will be added to the list.\n"
" :type sound: :class:`Sound`\n\n"
" .. note:: You can only add a sound to a sound list.");
static PyObject *
Sound_list_addSound(Sound* self, PyObject* object)
{
@@ -1671,14 +1683,14 @@ Sound_list_addSound(Sound* self, PyObject* object)
#ifdef WITH_CONVOLUTION
PyDoc_STRVAR(M_aud_Sound_convolver_doc,
"convolver()\n\n"
"Creates a sound that will apply convolution to another sound.\n\n"
":arg impulseResponse: The filter with which convolve the sound.\n"
":type impulseResponse: :class:`ImpulseResponse`\n"
":arg threadPool: A thread pool used to parallelize convolution.\n"
":type threadPool: :class:`ThreadPool`\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`");
".. classmethod:: convolver()\n\n"
" Creates a sound that will apply convolution to another sound.\n\n"
" :arg impulseResponse: The filter with which convolve the sound.\n"
" :type impulseResponse: :class:`ImpulseResponse`\n"
" :arg threadPool: A thread pool used to parallelize convolution.\n"
" :type threadPool: :class:`ThreadPool`\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`");
static PyObject *
Sound_convolver(Sound* self, PyObject* args)
@@ -1720,16 +1732,16 @@ Sound_convolver(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_binaural_doc,
"convolver()\n\n"
"Creates a binaural sound using another sound as source. The original sound must be mono\n\n"
":arg hrtfs: An HRTF set.\n"
":type hrtf: :class:`HRTF`\n"
":arg source: An object representing the source position of the sound.\n"
":type source: :class:`Source`\n"
":arg threadPool: A thread pool used to parallelize convolution.\n"
":type threadPool: :class:`ThreadPool`\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`");
".. classmethod:: convolver()\n\n"
" Creates a binaural sound using another sound as source. The original sound must be mono\n\n"
" :arg hrtfs: An HRTF set.\n"
" :type hrtf: :class:`HRTF`\n"
" :arg source: An object representing the source position of the sound.\n"
" :type source: :class:`Source`\n"
" :arg threadPool: A thread pool used to parallelize convolution.\n"
" :type threadPool: :class:`ThreadPool`\n"
" :return: The created :class:`Sound` object.\n"
" :rtype: :class:`Sound`");
static PyObject *
Sound_binaural(Sound* self, PyObject* args)

View File

@@ -33,8 +33,8 @@ AUD_NAMESPACE_BEGIN
class AUD_API DefaultSynchronizer : public ISynchronizer
{
public:
virtual void seek(std::shared_ptr<IHandle> handle, float time);
virtual float getPosition(std::shared_ptr<IHandle> handle);
virtual void seek(std::shared_ptr<IHandle> handle, double time);
virtual double getPosition(std::shared_ptr<IHandle> handle);
virtual void play();
virtual void stop();
virtual void setSyncCallback(syncFunction function, void* data);

View File

@@ -35,6 +35,9 @@ AUD_NAMESPACE_BEGIN
class AUD_API IDeviceFactory
{
public:
/**
* Destroys the device factory.
*/
virtual ~IDeviceFactory() {}
/**

View File

@@ -105,14 +105,14 @@ public:
* - false if the handle is invalid.
* \warning Whether the seek works or not depends on the sound source.
*/
virtual bool seek(float position)=0;
virtual bool seek(double position)=0;
/**
* Retrieves the current playback position of a sound.
* \return The playback position in seconds, or 0.0 if the handle is
* invalid.
*/
virtual float getPosition()=0;
virtual double getPosition()=0;
/**
* Returns the status of a played back sound.

View File

@@ -56,14 +56,14 @@ public:
* @param handle The handle that should be synchronized/seeked.
* @param time The absolute time to synchronize to.
*/
virtual void seek(std::shared_ptr<IHandle> handle, float time) = 0;
virtual void seek(std::shared_ptr<IHandle> handle, double time) = 0;
/**
* Retrieves the position of the synchronizer.
* @param handle The handle which is synchronized.
* @return The position in seconds.
*/
virtual float getPosition(std::shared_ptr<IHandle> handle) = 0;
virtual double getPosition(std::shared_ptr<IHandle> handle) = 0;
/**
* Starts the synchronizer playback.

View File

@@ -53,8 +53,8 @@ private:
virtual bool stop();
virtual bool getKeep();
virtual bool setKeep(bool keep);
virtual bool seek(float position);
virtual float getPosition();
virtual bool seek(double position);
virtual double getPosition();
virtual Status getStatus();
virtual float getVolume();
virtual bool setVolume(float volume);

View File

@@ -180,8 +180,8 @@ protected:
virtual bool stop();
virtual bool getKeep();
virtual bool setKeep(bool keep);
virtual bool seek(float position);
virtual float getPosition();
virtual bool seek(double position);
virtual double getPosition();
virtual Status getStatus();
virtual float getVolume();
virtual bool setVolume(float volume);

View File

@@ -40,7 +40,10 @@ class Buffer;
class AUD_API IFileInput
{
public:
virtual ~IFileInput() {};
/**
* Destroys the file input.
*/
virtual ~IFileInput() {}
/**
* Creates a reader for a file to be read.

View File

@@ -35,7 +35,7 @@ private:
/**
* The delay in samples.
*/
const float m_delay;
const double m_delay;
// delete copy constructor and operator=
Delay(const Delay&) = delete;
@@ -47,12 +47,12 @@ public:
* \param sound The input sound.
* \param delay The desired delay in seconds.
*/
Delay(std::shared_ptr<ISound> sound, float delay = 0);
Delay(std::shared_ptr<ISound> sound, double delay = 0);
/**
* Returns the delay in seconds.
*/
float getDelay() const;
double getDelay() const;
virtual std::shared_ptr<IReader> createReader();
};

View File

@@ -52,7 +52,7 @@ public:
* \param reader The reader to read from.
* \param delay The delay in seconds.
*/
DelayReader(std::shared_ptr<IReader> reader, float delay);
DelayReader(std::shared_ptr<IReader> reader, double delay);
virtual void seek(int position);
virtual int getLength() const;

View File

@@ -55,7 +55,7 @@ private:
/**
* Length of the crossfade transition in seconds, used when no custom transition has been set.
*/
float m_fadeTime;
double m_fadeTime;
/**
* Handle to the playback of the current scene.
@@ -145,13 +145,13 @@ public:
* Sets the length of the crossfade transition (default 1 second).
* \param seconds The time in seconds.
*/
void setFadeTime(float seconds);
void setFadeTime(double seconds);
/**
* Gets the length of the crossfade transition (default 1 second).
* \return The length of the cressfade transition in seconds.
*/
float getFadeTime();
double getFadeTime();
/**
* Resumes a paused sound.
@@ -177,14 +177,14 @@ public:
* - false if the handle is invalid.
* \warning Whether the seek works or not depends on the sound source.
*/
bool seek(float position);
bool seek(double position);
/**
* Retrieves the current playback position of a sound.
* \return The playback position in seconds, or 0.0 if the handle is
* invalid.
*/
float getPosition();
double getPosition();
/**
* Retrieves the volume of the scenes.

View File

@@ -43,12 +43,12 @@ private:
/**
* The fading start.
*/
const float m_start;
const double m_start;
/**
* The fading length.
*/
const float m_length;
const double m_length;
// delete copy constructor and operator=
Fader(const Fader&) = delete;
@@ -64,7 +64,7 @@ public:
*/
Fader(std::shared_ptr<ISound> sound,
FadeType type = FADE_IN,
float start = 0.0f, float length = 1.0f);
double start = 0, double length = 1);
/**
* Returns the fading type.
@@ -74,12 +74,12 @@ public:
/**
* Returns the fading start.
*/
float getStart() const;
double getStart() const;
/**
* Returns the fading length.
*/
float getLength() const;
double getLength() const;
virtual std::shared_ptr<IReader> createReader();
};

View File

@@ -49,12 +49,12 @@ private:
/**
* The fading start.
*/
const float m_start;
const double m_start;
/**
* The fading length.
*/
const float m_length;
const double m_length;
// delete copy constructor and operator=
FaderReader(const FaderReader&) = delete;
@@ -69,7 +69,7 @@ public:
* \param length How long fading should last in seconds.
*/
FaderReader(std::shared_ptr<IReader> reader, FadeType type,
float start,float length);
double start,double length);
virtual void read(int& length, bool& eos, sample_t* buffer);
};

View File

@@ -35,12 +35,12 @@ private:
/**
* The start time.
*/
const float m_start;
const double m_start;
/**
* The end time.
*/
const float m_end;
const double m_end;
// delete copy constructor and operator=
Limiter(const Limiter&) = delete;
@@ -55,17 +55,17 @@ public:
* play to the end.
*/
Limiter(std::shared_ptr<ISound> sound,
float start = 0, float end = -1);
double start = 0, double end = -1);
/**
* Returns the start time.
*/
float getStart() const;
double getStart() const;
/**
* Returns the end time.
*/
float getEnd() const;
double getEnd() const;
virtual std::shared_ptr<IReader> createReader();
};

View File

@@ -35,12 +35,12 @@ private:
/**
* The start sample: inclusive.
*/
const float m_start;
const double m_start;
/**
* The end sample: exlusive.
*/
const float m_end;
const double m_end;
// delete copy constructor and operator=
LimiterReader(const LimiterReader&) = delete;
@@ -54,7 +54,7 @@ public:
* \param end The desired end time (sample exklusive), a negative value
* signals that it should play to the end.
*/
LimiterReader(std::shared_ptr<IReader> reader, float start = 0, float end = -1);
LimiterReader(std::shared_ptr<IReader> reader, double start = 0, double end = -1);
virtual void seek(int position);
virtual int getLength() const;

View File

@@ -151,7 +151,7 @@ public:
* \param skip How much seconds should be skipped at the beginning.
* \return The entry added.
*/
std::shared_ptr<SequenceEntry> add(std::shared_ptr<ISound> sound, float begin, float end, float skip);
std::shared_ptr<SequenceEntry> add(std::shared_ptr<ISound> sound, double begin, double end, double skip);
/**
* Removes an entry from the scene.

View File

@@ -203,7 +203,7 @@ public:
* \param skip How much seconds should be skipped at the beginning.
* \return The entry added.
*/
std::shared_ptr<SequenceEntry> add(std::shared_ptr<ISound> sound, float begin, float end, float skip);
std::shared_ptr<SequenceEntry> add(std::shared_ptr<ISound> sound, double begin, double end, double skip);
/**
* Removes an entry from the scene.

View File

@@ -55,13 +55,13 @@ private:
std::shared_ptr<ISound> m_sound;
/// The begin time.
float m_begin;
double m_begin;
/// The end time.
float m_end;
double m_end;
/// How many seconds are skipped at the beginning.
float m_skip;
double m_skip;
/// Whether the entry is muted.
bool m_muted;
@@ -124,7 +124,7 @@ public:
* \param skip How much seconds should be skipped at the beginning.
* \param id The ID of the entry.
*/
SequenceEntry(std::shared_ptr<ISound> sound, float begin, float end, float skip, int id);
SequenceEntry(std::shared_ptr<ISound> sound, double begin, double end, double skip, int id);
virtual ~SequenceEntry();
/**
@@ -155,7 +155,7 @@ public:
* \param end The new end time or a negative value if unknown.
* \param skip How many seconds to skip at the beginning.
*/
void move(float begin, float end, float skip);
void move(double begin, double end, double skip);
/**
* Retrieves the muting state of the entry.

View File

@@ -292,7 +292,7 @@ void JackDevice::stopPlayback()
m_nextState = JackTransportStopped;
}
void JackDevice::seekPlayback(float time)
void JackDevice::seekPlayback(double time)
{
if(time >= 0.0f)
AUD_jack_transport_locate(m_client, time * m_specs.rate);
@@ -304,11 +304,11 @@ void JackDevice::setSyncCallback(ISynchronizer::syncFunction sync, void* data)
m_syncFuncData = data;
}
float JackDevice::getPlaybackPosition()
double JackDevice::getPlaybackPosition()
{
jack_position_t position;
AUD_jack_transport_query(m_client, &position);
return position.frame / (float) m_specs.rate;
return position.frame / (double) m_specs.rate;
}
bool JackDevice::doesPlayback()

View File

@@ -174,7 +174,7 @@ public:
* Seeks jack transport playback.
* \param time The time to seek to.
*/
void seekPlayback(float time);
void seekPlayback(double time);
/**
* Sets the sync callback for jack transport playback.
@@ -187,7 +187,7 @@ public:
* Retrieves the jack transport playback time.
* \return The current time position.
*/
float getPlaybackPosition();
double getPlaybackPosition();
/**
* Returns whether jack transport plays back.

View File

@@ -25,12 +25,12 @@ JackSynchronizer::JackSynchronizer(JackDevice* device) :
{
}
void JackSynchronizer::seek(std::shared_ptr<IHandle> handle, float time)
void JackSynchronizer::seek(std::shared_ptr<IHandle> handle, double time)
{
m_device->seekPlayback(time);
}
float JackSynchronizer::getPosition(std::shared_ptr<IHandle> handle)
double JackSynchronizer::getPosition(std::shared_ptr<IHandle> handle)
{
return m_device->getPlaybackPosition();
}

View File

@@ -48,8 +48,8 @@ public:
*/
JackSynchronizer(JackDevice* device);
virtual void seek(std::shared_ptr<IHandle> handle, float time);
virtual float getPosition(std::shared_ptr<IHandle> handle);
virtual void seek(std::shared_ptr<IHandle> handle, double time);
virtual double getPosition(std::shared_ptr<IHandle> handle);
virtual void play();
virtual void stop();
virtual void setSyncCallback(syncFunction function, void* data);

View File

@@ -269,7 +269,7 @@ bool OpenALDevice::OpenALHandle::setKeep(bool keep)
return true;
}
bool OpenALDevice::OpenALHandle::seek(float position)
bool OpenALDevice::OpenALHandle::seek(double position)
{
if(!m_status)
return false;
@@ -335,7 +335,7 @@ bool OpenALDevice::OpenALHandle::seek(float position)
return true;
}
float OpenALDevice::OpenALHandle::getPosition()
double OpenALDevice::OpenALHandle::getPosition()
{
if(!m_status)
return false;

View File

@@ -126,8 +126,8 @@ private:
virtual bool stop();
virtual bool getKeep();
virtual bool setKeep(bool keep);
virtual bool seek(float position);
virtual float getPosition();
virtual bool seek(double position);
virtual double getPosition();
virtual Status getStatus();
virtual float getVolume();
virtual bool setVolume(float volume);

View File

@@ -19,12 +19,12 @@
AUD_NAMESPACE_BEGIN
void DefaultSynchronizer::seek(std::shared_ptr<IHandle> handle, float time)
void DefaultSynchronizer::seek(std::shared_ptr<IHandle> handle, double time)
{
handle->seek(time);
}
float DefaultSynchronizer::getPosition(std::shared_ptr<IHandle> handle)
double DefaultSynchronizer::getPosition(std::shared_ptr<IHandle> handle)
{
return handle->getPosition();
}

View File

@@ -52,12 +52,12 @@ bool NULLDevice::NULLHandle::setKeep(bool keep)
return false;
}
bool NULLDevice::NULLHandle::seek(float position)
bool NULLDevice::NULLHandle::seek(double position)
{
return false;
}
float NULLDevice::NULLHandle::getPosition()
double NULLDevice::NULLHandle::getPosition()
{
return std::numeric_limits<float>::quiet_NaN();
}

View File

@@ -347,7 +347,7 @@ bool SoftwareDevice::SoftwareHandle::setKeep(bool keep)
return true;
}
bool SoftwareDevice::SoftwareHandle::seek(float position)
bool SoftwareDevice::SoftwareHandle::seek(double position)
{
if(!m_status)
return false;
@@ -366,7 +366,7 @@ bool SoftwareDevice::SoftwareHandle::seek(float position)
return true;
}
float SoftwareDevice::SoftwareHandle::getPosition()
double SoftwareDevice::SoftwareHandle::getPosition()
{
if(!m_status)
return false;
@@ -376,7 +376,7 @@ float SoftwareDevice::SoftwareHandle::getPosition()
if(!m_status)
return 0.0f;
float position = m_reader->getPosition() / (float)m_device->m_specs.rate;
double position = m_reader->getPosition() / (double)m_device->m_specs.rate;
return position;
}

View File

@@ -19,13 +19,13 @@
AUD_NAMESPACE_BEGIN
Delay::Delay(std::shared_ptr<ISound> sound, float delay) :
Delay::Delay(std::shared_ptr<ISound> sound, double delay) :
Effect(sound),
m_delay(delay)
{
}
float Delay::getDelay() const
double Delay::getDelay() const
{
return m_delay;
}

View File

@@ -20,7 +20,7 @@
AUD_NAMESPACE_BEGIN
DelayReader::DelayReader(std::shared_ptr<IReader> reader, float delay) :
DelayReader::DelayReader(std::shared_ptr<IReader> reader, double delay) :
EffectReader(reader),
m_delay(int((SampleRate)delay * reader->getSpecs().rate)),
m_remdelay(int((SampleRate)delay * reader->getSpecs().rate))

View File

@@ -133,14 +133,14 @@ bool DynamicMusic::addTransition(int init, int end, std::shared_ptr<ISound> soun
return false;
}
void DynamicMusic::setFadeTime(float seconds)
void DynamicMusic::setFadeTime(double seconds)
{
m_device->lock();
m_fadeTime = seconds;
m_device->unlock();
}
float DynamicMusic::getFadeTime()
double DynamicMusic::getFadeTime()
{
return m_fadeTime;
}
@@ -169,7 +169,7 @@ bool DynamicMusic::pause()
return result || resultTrans;
}
bool DynamicMusic::seek(float position)
bool DynamicMusic::seek(double position)
{
bool result = false;
@@ -183,9 +183,9 @@ bool DynamicMusic::seek(float position)
return result;
}
float DynamicMusic::getPosition()
double DynamicMusic::getPosition()
{
float result = 0.0f;
double result = 0.0f;
if(m_currentHandle != nullptr)
result = m_currentHandle->getPosition();

View File

@@ -18,7 +18,7 @@
AUD_NAMESPACE_BEGIN
Fader::Fader(std::shared_ptr<ISound> sound, FadeType type, float start, float length) :
Fader::Fader(std::shared_ptr<ISound> sound, FadeType type, double start, double length) :
Effect(sound),
m_type(type),
m_start(start),
@@ -31,12 +31,12 @@ FadeType Fader::getType() const
return m_type;
}
float Fader::getStart() const
double Fader::getStart() const
{
return m_start;
}
float Fader::getLength() const
double Fader::getLength() const
{
return m_length;
}

View File

@@ -20,7 +20,7 @@
AUD_NAMESPACE_BEGIN
FaderReader::FaderReader(std::shared_ptr<IReader> reader, FadeType type, float start,float length) :
FaderReader::FaderReader(std::shared_ptr<IReader> reader, FadeType type, double start, double length) :
EffectReader(reader),
m_type(type),
m_start(start),
@@ -36,14 +36,14 @@ void FaderReader::read(int& length, bool& eos, sample_t* buffer)
m_reader->read(length, eos, buffer);
if((position + length) / (float)specs.rate <= m_start)
if((position + length) / specs.rate <= m_start)
{
if(m_type != FADE_OUT)
{
std::memset(buffer, 0, length * samplesize);
}
}
else if(position / (float)specs.rate >= m_start+m_length)
else if(position / specs.rate >= m_start+m_length)
{
if(m_type == FADE_OUT)
{
@@ -58,7 +58,7 @@ void FaderReader::read(int& length, bool& eos, sample_t* buffer)
{
if(i % specs.channels == 0)
{
volume = (((position+i)/(float)specs.rate)-m_start) / m_length;
volume = float((((position + i) / specs.rate) - m_start) / m_length);
if(volume > 1.0f)
volume = 1.0f;
else if(volume < 0.0f)

View File

@@ -20,19 +20,19 @@
AUD_NAMESPACE_BEGIN
Limiter::Limiter(std::shared_ptr<ISound> sound,
float start, float end) :
double start, double end) :
Effect(sound),
m_start(start),
m_end(end)
{
}
float Limiter::getStart() const
double Limiter::getStart() const
{
return m_start;
}
float Limiter::getEnd() const
double Limiter::getEnd() const
{
return m_end;
}

View File

@@ -21,7 +21,7 @@
AUD_NAMESPACE_BEGIN
LimiterReader::LimiterReader(std::shared_ptr<IReader> reader, float start, float end) :
LimiterReader::LimiterReader(std::shared_ptr<IReader> reader, double start, double end) :
EffectReader(reader),
m_start(start),
m_end(end)

View File

@@ -16,9 +16,9 @@
#include "respec/ChannelMapperReader.h"
#include <algorithm>
#include <cmath>
#include <limits>
#include <algorithm>
AUD_NAMESPACE_BEGIN

View File

@@ -66,11 +66,11 @@ void Mixer::setSpecs(Specs specs)
void Mixer::clear(int length)
{
m_buffer.assureSize(length * m_specs.channels * AUD_SAMPLE_SIZE(m_specs));
m_buffer.assureSize(length * AUD_SAMPLE_SIZE(m_specs));
m_length = length;
std::memset(m_buffer.getBuffer(), 0, length * m_specs.channels * AUD_SAMPLE_SIZE(m_specs));
std::memset(m_buffer.getBuffer(), 0, length * AUD_SAMPLE_SIZE(m_specs));
}
void Mixer::mix(sample_t* buffer, int start, int length, float volume)

View File

@@ -90,7 +90,7 @@ AnimateableProperty* Sequence::getAnimProperty(AnimateablePropertyType type)
return m_sequence->getAnimProperty(type);
}
std::shared_ptr<SequenceEntry> Sequence::add(std::shared_ptr<ISound> sound, float begin, float end, float skip)
std::shared_ptr<SequenceEntry> Sequence::add(std::shared_ptr<ISound> sound, double begin, double end, double skip)
{
return m_sequence->add(sound, begin, end, skip);
}

View File

@@ -149,7 +149,7 @@ AnimateableProperty* SequenceData::getAnimProperty(AnimateablePropertyType type)
}
}
std::shared_ptr<SequenceEntry> SequenceData::add(std::shared_ptr<ISound> sound, float begin, float end, float skip)
std::shared_ptr<SequenceEntry> SequenceData::add(std::shared_ptr<ISound> sound, double begin, double end, double skip)
{
std::lock_guard<std::recursive_mutex> lock(m_mutex);

View File

@@ -22,7 +22,7 @@
AUD_NAMESPACE_BEGIN
SequenceEntry::SequenceEntry(std::shared_ptr<ISound> sound, float begin, float end, float skip, int id) :
SequenceEntry::SequenceEntry(std::shared_ptr<ISound> sound, double begin, double end, double skip, int id) :
m_status(0),
m_pos_status(1),
m_sound_status(0),
@@ -84,7 +84,7 @@ void SequenceEntry::setSound(std::shared_ptr<ISound> sound)
}
}
void SequenceEntry::move(float begin, float end, float skip)
void SequenceEntry::move(double begin, double end, double skip)
{
std::lock_guard<std::recursive_mutex> lock(m_mutex);

View File

@@ -57,7 +57,7 @@ void SequenceHandle::start()
m_valid = m_handle.get();
}
bool SequenceHandle::updatePosition(float position)
bool SequenceHandle::updatePosition(double position)
{
std::lock_guard<ILockable> lock(*m_entry);
@@ -140,7 +140,7 @@ void SequenceHandle::stop()
m_3dhandle = nullptr;
}
void SequenceHandle::update(float position, float frame, float fps)
void SequenceHandle::update(double position, float frame, float fps)
{
if(m_sound_status != m_entry->m_sound_status)
{
@@ -229,7 +229,7 @@ void SequenceHandle::update(float position, float frame, float fps)
m_handle->setVolume(0);
}
bool SequenceHandle::seek(float position)
bool SequenceHandle::seek(double position)
{
if(!m_valid)
// sound not valid, aborting
@@ -240,7 +240,7 @@ bool SequenceHandle::seek(float position)
return false;
std::lock_guard<ILockable> lock(*m_entry);
float seekpos = position - m_entry->m_begin;
double seekpos = position - m_entry->m_begin;
if(seekpos < 0)
seekpos = 0;
seekpos += m_entry->m_skip;

View File

@@ -71,7 +71,7 @@ private:
* \param position Current playback position in seconds.
* \return Whether the handle is valid.
*/
bool updatePosition(float position);
bool updatePosition(double position);
public:
/**
@@ -104,14 +104,14 @@ public:
* \param frame The current frame during playback.
* \param fps The animation frames per second.
*/
void update(float position, float frame, float fps);
void update(double position, float frame, float fps);
/**
* Seeks the handle to a specific time position.
* \param position The time to seek to.
* \return Whether the handle is valid.
*/
bool seek(float position);
bool seek(double position);
};
AUD_NAMESPACE_END

Some files were not shown because too many files have changed in this diff Show More