Commit Graph

97054 Commits

Author SHA1 Message Date
Philipp Oeser
dbf96e6252 Fix T77957: Height change in Camera Properties column when changing lens type
Remove unneeded extra column from perspective type properties.

Maniphest Tasks: T77957

Differential Revision: https://developer.blender.org/D8060
2020-06-18 11:09:53 +02:00
a5e176a8ed Allow interpolation of matrices with negative scale / axis flips
The matrix interpolation function `interp_m3_m3m3()` decomposes the
matrices into rotation and scale matrices, converts the rotation
matrices to quaternions, SLERPs the quaternions, and converts the result
back to a matrix. Since quaternions cannot represent axis flips, this
results in interpolation problems like described in T77154.

Our interpolation function is based on "Matrix Animation and Polar
Decomposition", by Ken Shoemake & Tom Duff. The paper states that it
produces invalid results when there is an axis flip in the rotation
matrix (or negative determinant, or negative scale, those all indicate
the same thing). Their solution is to multiply the rotation matrix with
`-I`, where `I` is the identity matrix. This is the same as element-wise
multiplication with `-1.0f`. My proposed solution is to not only do that
with the rotation matrix `R`, but also with the scale matrix `S`. This
ensures that the decomposition of `A = R * S` remains valid, while also
making it possible to conver the rotation component to a quaternion.

There is still an issue when interpolating between matrices with
different determinant. As the determinant represents the change in
volume when that matrix is applied to an object, interpolating between a
negative and a positive matrix will have to go through a zero
determinant. In this case the volume collapses to zero. I don't see this
as a big issue, though, as without this patch Blender would also produce
invalid results anyway.

Reviewed By: brecht, sergey

Differential Revision: https://developer.blender.org/D8048
2020-06-18 10:37:52 +02:00
46e4cdf788 Tests: added simple unittests for matrix interpolation
The interpolation of 4x4 and 3x3 matrices will fail when the rotation
component has a singularity, i.e. when there is one axis mirrored. Two
mirrored axes are just a rotation of 180 degrees around the third, and
three mirrored axes are such a rotation + a single axis mirror. To
prepare for a fix, I first wanted to cover the basic functionality with
a few unit tests.

These tests check that `interpolate(A, B, alpha)` always returns `A` for
`alpha=0`, always return `B` for `alpha=1`, and something in between for
`alpha=0.5`.
2020-06-18 10:37:46 +02:00
Campbell Barton
099d47f8a3 Sequencer: revert selection & keymap changes from D7679
These changes aren't aligned with other timeline selection keymaps
(graph & action for e.g.).

Revert these changes, shortcuts to time-line editors
should take other similar spaces into account.
2020-06-18 16:30:56 +10:00
Campbell Barton
502e6bd839 Fix doc generation for enum & attr's with multi-line descriptions 2020-06-18 16:26:16 +10:00
Campbell Barton
3ada1949f8 Python API: path mapping options for library writing function
When "Relative Remap" option was added, the intention was only to remap
paths that were already relative. However it remapped all paths.

This was reported as T62612 and fixed recently,
however some Python script authors depended on the old behavior.

For users, it's reasonable to use the existing operators to make paths
absolute/relative. For scripts however it's useful to be able to write
out individual data-blocks with the ability to make all paths relative.

Now `bpy.data.libraries.write()` takes a path_remap argument which can
be `NONE/RELATIVE/RELATIVE_ALL/ABSOLUTE` allowing the script author to
choose how paths are handled when writing out data-blocks.

Addresses T77768.
2020-06-18 15:49:10 +10:00
Campbell Barton
aab165b575 Cleanup: remove unnecessary flag clearing
This is not read from blend files.
2020-06-18 14:30:04 +10:00
Campbell Barton
978e2b6f98 BKE_global: No longer read/write G_FILE_HISTORY
This is a runtime only flag
which doesn't make sense to store in the file.
2020-06-18 14:30:04 +10:00
Campbell Barton
44f4eaf13b Cleanup: doxy sections for walk/fly operators 2020-06-18 14:30:04 +10:00
Campbell Barton
3aa1143d57 Cleanup: redundant parenthesis 2020-06-18 14:30:04 +10:00
Campbell Barton
790d942b69 Cleanup: unused variables 2020-06-18 14:30:04 +10:00
Richard Antalik
229ed078d1 Fix T75414: Incorrect masking in Color Balance modifier
Color balance factor was infinity. Clamp to +/- `FLT_MAX`

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D7884
2020-06-18 05:53:25 +02:00
Richard Antalik
f7f3b2d318 Cleanup: Remove goto statements from strip rendering functions
Remove goto statement from `seq_render_image_strip()` and `seq_render_movie_strip()`.
`seq_render_image_strip_view()` and `seq_render_movie_strip_view()` is used to render individual views in both monoview and multiview branch.

I have included `seq_can_use_proxy()` for convinience

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D7870
2020-06-18 05:53:25 +02:00
Richard Antalik
67a822e086 Fix T73056: Cache not invalidated in fade operator
This operator is written in python it is inserting keyframes to create fade
effects.

Add Sequence.invalidate() python function to invalidate strip if it is
changed in python.

Perhaps I could implement cache invalidation to actual curve manipulation.
I guess it wouldn't be very hard to do but having means to invalidate form
python is useful as well.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7885
2020-06-18 05:53:25 +02:00
Richard Antalik
47f98a38d0 VSE: Fix assigning effect strip inputs
Partialy fixes T73828

Currently all 3 effect inputs were assigned even if not all 3 were used.
This causes problems with reassigning effects in python, because 3rd input is
not accessible.

This patch will only assign inputs that are necessary for effect to work
properly.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D6868
2020-06-18 05:53:25 +02:00
Richard Antalik
8df99b1c0c Cleanup: Remove unused code from seq_proxy_get_fname()
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7868
2020-06-18 05:53:25 +02:00
Richard Antalik
ac16d56aa8 Fix T66390: Update missing when snaping strips.
Effect strips bound recalculation was mixed with overlap handling, which
caused, that effects wasn't handled.

In some cases there may be problem with order of strips in seqbase. We should
traverse hierarchy instead. This is design issue that applies to all
operators, and should be fixed separately.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7880
2020-06-18 05:53:25 +02:00
Germano Cavalcante
d8206602fe Transform: Snap to the intersection between constraint and geometry
This commit changes the behavior of 4 snapping combinations:

**1. While constraining to a plane, snap to an edge element:**
The snap is made at the intersection between the edge direction and the
constraint plane.

**2. While constraining to a plane, snap to a face element:**
The snap is made to the nearest point between the snap point and the
line that intersects the face plane with the constraint plane.

**3. While constraining to an axis, snap to an edge/line element:**
The snap is made to the nearest point on the axis to the edge/line.

**4. While constraining to an axis, snap to a face element:**
The snap is made at the intersection of the axis and the plane defined
by the face.

To avoid unpredictable jumps outside view boundaries, an alignment
check is made for each of these snapping combinations.

Resolve/fix T66422

Differential Revision: https://developer.blender.org/D5608
2020-06-18 00:01:05 -03:00
Nathan Craddock
18ccf328ac Outliner: Fix (unreported) object select in multiple collections
Previous commits to fix parent selection introduced incorrect behavior
when selecting objects linked to multiple collections. The clicked
object would be selected, but also the first listed object in the tree
would be selected.

Instead of always searching for a parent object to select, only search
back when the selected element is not an ID_OB. This prevents multiple
selection of objects linked to multiple collections.
2020-06-17 20:31:55 -06:00
Antonio Vazquez
e079bf6996 GPencil: Chnage default Vertex Color mode to Stroke and Fill
The previous value was Stroke only.
2020-06-17 22:49:59 +02:00
Antonio Vazquez
ffa23b6c77 GPencil: Fix unreported Vertex Opacity Overlay not working
This values was not working because was removed by error in refactor.

Reviewed By: mendio, fclem

Differential Revision: https://developer.blender.org/D8061
2020-06-17 22:42:49 +02:00
Germano Cavalcante
a874cec02b UI: Match some properties set in keymaps with those set for buttons
This allows the operator's shortcut to appear in the context menu.

Except for the shortcut display, there is no functional change from the
user's point of view.

This fix T77839
2020-06-17 16:30:31 -03:00
Lukas Stockner
eacdcb2dd8 Cycles: Add new Sky Texture method including direct sunlight
This commit adds a new model to the Sky Texture node, which is based on a
method by Nishita et al. and works by basically simulating volumetric
scattering in the atmosphere.

By making some approximations (such as only considering single scattering),
we get a fairly simple and fast simulation code that takes into account
Rayleigh and Mie scattering as well as Ozone absorption.

This code is used to precompute a 512x128 texture which is then looked up
during render time, and is fast enough to allow real-time tweaking in the
viewport.

Due to the nature of the simulation, it exposes several parameters that
allow for lots of flexibility in choosing the look and matching real-world
conditions (such as Air/Dust/Ozone density and altitude).

Additionally, the same volumetric approach can be used to compute absorption
of the direct sunlight, so the model also supports adding direct sunlight.
This makes it significantly easier to set up Sun+Sky illumination where
the direction, intensity and color of the sun actually matches the sky.

In order to support properly sampling the direct sun component, the commit
also adds logic for sampling a specific area to the kernel light sampling
code. This is combined with portal and background map sampling using MIS.

This sampling logic works for the common case of having one Sky texture
going into the Background shader, but if a custom input to the Vector
node is used or if there are multiple Sky textures, it falls back to using
only background map sampling (while automatically setting the resolution to
4096x2048 if auto resolution is used).

More infos and preview can be found here:
https://docs.google.com/document/d/1gQta0ygFWXTrl5Pmvl_nZRgUw0mWg0FJeRuNKS36m08/view

Underlying model, implementation and documentation by Marco (@nacioss).
Improvements, cleanup and sun sampling by @lukasstockner.

Differential Revision: https://developer.blender.org/D7896
2020-06-17 21:06:41 +02:00
Hans Goudey
d6ef9c157a UI: Solve crash with move to index in modifier menu 2020-06-17 14:43:48 -04:00
Hans Goudey
bcb2b8ab57 UI: Improve Modifier Panel Header Menu
This makes a few changes to the modifier panel header:
  1. Adds "move to top" and "move to bottom" buttons.
  2. Adds a checkmark icon for "apply"
  3. Makes it narrower, the text is closer to the dropdown icon.
     (Requires the change in ui_block_func_POPUP)

Differential Revision: https://developer.blender.org/D8040
2020-06-17 14:09:17 -04:00
Hans Goudey
4cfdd10c2b UI: Modifier Panel Header Improvements
This includes a few improvments:
  1. Always expose delete. This is the button everyone wants the most,
     it makes a lot of sense to expose this.
  2. Improve "name hiding capability." Basically always align the mode
     buttons to the right, and count their number to see if the name fits.
  3. Aligns more items, to look better, save space, and make the whole
     header seem more grouped.
  4. In my tests the "switch contexts" button never coincides with the
     delete button, so they share the same space.

Differential Revision: https://developer.blender.org/D8037
2020-06-17 13:51:33 -04:00
Hans Goudey
c1c02f45f7 UI: Ctrl-click on panel header expands & collapses subpanels
If the panel is already open and you ctrl click on its header, its
sub-panels are now expanded / collapsed instead of toggling the
expansion for all other panels. If you're toggling a panel's expansion
it's already in view anyway, so there is no need to collapse the
other panels.

Differential Revision: https://developer.blender.org/D8042
2020-06-17 13:37:59 -04:00
Sergey Sharybin
2e0ac1e0c4 Buildbot: Cleanup, remove unused script and change naming
Follow upstream convention.
2020-06-17 17:39:17 +02:00
Ray Molenkamp
e590526af6 Fix T76767: Cycles performance regression with CLI renders
When picking a small tile size when doing a CLI render will
yield many status updates being printed to the console
causing a slowdown in the render process. 2.79 with the
same amount of tiles did not have this slowdown.

The reason for this turned out to be a debugging aid added
in rBd2757d149bf2 which disabled buffering for stdout which
on windows caused every single character being printed to the
console to try to obtain a mutex, and worse the thread being
put to sleep when this mutex was unavailable leading to poor
performance.

This patch changes the behaviour by only disabling the
buffering in debug builds.

CLI render of the default cube with 16x16 tiles at 1080p

2.83 : 37.57s
now  : 17.03s

note: this only affected CLI renders, renders from the UI
do not report this kind of information and had no such
slowdown.
2020-06-17 09:26:49 -06:00
Germano Cavalcante
9bfd78ae14 Fix T77914: Blender Crashes if viewport is changed manually while having loop cut selected
The selection engine requires a viewport.
2020-06-17 12:16:32 -03:00
Germano Cavalcante
ddf4b909de Cleanup: Rearrange SELECTID_Context members for better alignment 2020-06-17 12:16:32 -03:00
Bastien Montagne
13f591d400 ID Duplicate: Factorize a lot the code.
Now that we have a uniform consistent behavior in all our ID duplicate
funtions, we can easily factorize it greatly. Code gets cleaner,
smaller, and less error-prone.

Note that ultimately, this duplicate/deep copy behavior could be added
as a callback of IDTypeInfo.
We could also rethink the duplicate flags (some data, even some obdata,
like Lattice, are not coverred currently).
And so on. But at least code should now be much more easily maintainable
and extendable.
2020-06-17 17:06:05 +02:00
Bastien Montagne
c84fee1ffe ID Duplicate: uniformize Action duplication.
Previously, object (and sub-data) actions would be controlled by the
user preferences flag, collections actions would never be duplicted, and
scenes actions were always duplicated...

Now they all follow the user preferences settings.
2020-06-17 17:06:05 +02:00
Bastien Montagne
ad6cccf058 Refactor duplicate of data-blocks.
Main change from user side, besides that all pointers should now be
properly remapped to new IDs, is that linked objects are no longer
preserved when doing a full copy of scenes.

Will open a task to check whether we actually still want that behavior
(and re-code it in a more correct way then).

This is the main part of work done here, it aims at uniformizing and
sanitizing that 'deep copy' process for supported IDs (currently scenes,
collections and objects).

Note that there will be more follow up commits after that one, but this
should be the most risky and changing one.
2020-06-17 17:06:05 +02:00
Bastien Montagne
514f80b0c4 Fix (unreported) broken logic in BKE_libblock_relink_to_newid
Existing code would not follow as expected into new sub-IDs if they were
only encoutered once in usages by parent IDs...
2020-06-17 17:06:05 +02:00
Nathan Craddock
26c0ca3aa7 Outliner: Unified delete hierarchy operator
This resolves T73673 by allowing delete hierarchy in all outliner view
modes. It also unifies the collection and object hierarchy delete into a
single operator like in rBae98a033c856. This makes it easier to delete
all selected collection and object hierarchies at once.

This also removes the old object delete hierarchy code in favor of the
batch delete code which has been default for over a year.

Maniphest Tasks: T73673

Differential Revision: https://developer.blender.org/D7675
2020-06-17 09:00:04 -06:00
Brecht Van Lommel
a2c4e5d222 Cleanup: clang-format 2020-06-17 16:07:26 +02:00
Brecht Van Lommel
fc7c34e380 Cleanup: fix compiler warnings 2020-06-17 14:36:51 +02:00
Brecht Van Lommel
25b8dedfb4 Fix T77915: Cycles OSL microfacet closure not working in custom shaders
The code to implement the newer closure in terms of the old one got lost in
the removal of our stdosl.h copy. Now implement it as a builtin closure.
2020-06-17 14:09:28 +02:00
Campbell Barton
8591ee748f Cleanup: doxy sections for meta-ball operators. 2020-06-17 21:22:08 +10:00
Campbell Barton
70c061ee0a Fix T63411: Crash adding meta-ball with a small radius
Change how the radius, changing the size of meta plane, sphere & cube.

Previously the size of these primitives would be kept the same,
with only the radius outside the primitive being scaled.

This led to small scale adding a lot of polygons instead
of scaling the primitive down as users would expect.

Also change behavior not to change the resolution when adding
to an existing meta-ball.
2020-06-17 21:13:47 +10:00
Campbell Barton
7dae6eb5a2 Doc: minor change to curve select more/less
Address T55218
2020-06-17 18:07:53 +10:00
Campbell Barton
1dfd262f2d Cleanup: name mesh join functions using ED_{type} prefix 2020-06-17 17:07:11 +10:00
Campbell Barton
4892470a47 Fix T70287: Connect vertex path can create duplicate edges/faces 2020-06-17 16:41:16 +10:00
Campbell Barton
ba312bc8a7 Cleanup: doxy comments 2020-06-17 14:00:09 +10:00
Philipp Oeser
3ff9769762 Fix T76041: Low contrast dirty vertex colors with loose geometry
Add option to normalize vertex colors.
2020-06-17 13:43:20 +10:00
Campbell Barton
f9be5374ac Cleanup: warning 2020-06-17 13:43:20 +10:00
Aaron Carlisle
c7b03fe9c0 UI: Backspace is one word 2020-06-16 14:15:54 -04:00
Sergey Sharybin
efb1bf80df Buildbot: Cleanup, typo in logging 2020-06-16 18:12:15 +02:00
Bastien Montagne
1b2a24aae0 Fix issue with uint in headers in recent own commit.
Would break on some systems/compilers...
2020-06-16 18:03:36 +02:00