112492 Commits

Author SHA1 Message Date
Hans Goudey
40e8b9775d Fix: Missing changes in recent "Curves" rename
More missing changes in fe1816f67fbc6aaf3. This will hopefully fix a
Python API docs build error, and fixes the "Object Types Visibility"
popover.
2022-02-10 15:51:26 -06:00
Campbell Barton
75bcc096a1 License: add Apache-2.0 to doc/license
Include this as it's used the source/ directory.
2022-02-11 08:50:46 +11:00
Henrik Dick
6804ab2381 Merge branch 'blender-v3.1-release' 2022-02-10 22:39:38 +01:00
Henrik Dick
39bac58cdf Fix: Enable edge bevel weight in solidify if needed
Complex Solidify creates edge bevel weights on the rim if the
according vertex has some vertex bevel weight. If there are no
edge bevel weights, they were left disabled even if vertex bevel
weights are used.
2022-02-10 22:29:10 +01:00
Henrik Dick
5cac5a1a69 Fix: Bevel vertex didn't use weights in some cases
Bevel Vertices did not use vertex/bevel weights if the Width Type
was set to Width or Depth.
2022-02-10 22:14:02 +01:00
Hans Goudey
516781da80 Fix: Incorrect size used for reading curves data
Copy and paste mistake in fe1816f67fbc6aaf383ec
2022-02-10 11:45:15 -06:00
Hans Goudey
29674d5e78 Merge branch 'blender-v3.1-release' 2022-02-10 11:34:20 -06:00
Hans Goudey
88ff5e5fb9 Fix T95458: Line art ignores curve objects with no evaluated mesh
Some curve objects don't have an evaluated mesh at all, but line art
currently assumes that all curve objects have one before converting
it to a mesh internally. Fix this by checking if the curve object has an
evaluated mesh before skipping it.

The remaining problem is that evalauted from non-mesh objects or
evaluated curves from non-curve objects, etc. will be ignored if
"Allow Duplicates" is off. That's a different problem though.

Differential Revision: https://developer.blender.org/D14036
2022-02-10 11:33:36 -06:00
Michael Jones
a44366a642 Cycles: Expose "Use MetalRT" checkbox
For curve-heavy scenes, memory consumption regressed when we switched from MetalRT to bvh2. Allow users to opt in to MetalRT to workaround this.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D14071
2022-02-10 17:32:46 +00:00
Michael Jones
35dedc11d5 Fix T95477: Report error instead of crashing when Metal texture size limits exceeded.
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D14074
2022-02-10 17:06:29 +00:00
Michael Jones
3d12dd59ce Cycles: Workaround for failing "bake" unit tests in Metal
Allocate "RenderBuffers" with MTLResourceStorageModeShared.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D14073
2022-02-10 17:05:13 +00:00
Michael Jones
410e4e7ce1 Workaround for T94142: Cycles Metal crash with simultaneous viewport and final render
Disable binary archives on Apple Silicon (issue stems from instancing multiple PSOs from the same binary archive). Pipeline creation still filters through the OS shader cache, mitigating any impact on setup times after the initial render.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D14072
2022-02-10 17:04:08 +00:00
Jacques Lucke
25c4000796 Fix T95613: remove anonymous attributes when converting object
This is the same behavior as when applying a geometry nodes modifier
that adds anonymous attributes.
2022-02-10 18:03:37 +01:00
Hans Goudey
22c60ac8b1 Cleanup: Remove defenition for unused flag 2022-02-10 11:00:47 -06:00
Hans Goudey
7682d7de04 Refactor: Move PBVH update tag out of MVert
This is part of the project of converting `MVert` into `float3`.
(more details in T93602), The pbvh update flag is removed and
replaced with a bitmap stored in the PBVH structure. This
patch is similar to D13878. This is mainly setup for an eventual
performance improvement by removing the extra data from
mesh vertices, but if it's consistent with testing in the other patch
doing the same thing for another "temp tag", then it may actually
increase the speed of sculpt code slightly, since less memory needs
to be loaded when checking/changing the flags.

Differential Revision: https://developer.blender.org/D14000
2022-02-10 10:59:20 -06:00
Jacques Lucke
2cd1472f86 Merge branch 'blender-v3.1-release' 2022-02-10 17:32:16 +01:00
Jacques Lucke
720d653b41 Fix T95624: video texture not refreshing when changing offset in node
The main issue is that the image and image user is not updated correctly
in `rna_ImageUser_update`. `BKE_image_user_frame_calc` does not set the
correct frame, because the image is null. Also `IMA_GPU_REFRESH` is not
set for the same reason.

When gpu materials are first created, it is expected that the frame is set
correctly, and the flag is set if necessary. Therefore, somewhere during
depsgraph evaluation, those have to be updated. The depsgraph node
to do the update existed already. Now there is a new relation so that it is
executed when the node tree changed, not only when the frame changed.
2022-02-10 17:31:25 +01:00
Bastien Montagne
9a2b206639 Minor cleanup: Use ID_IS_LINKED. 2022-02-10 17:30:07 +01:00
Hans Goudey
64dd6877aa Merge branch 'blender-v3.1-release' 2022-02-10 10:25:20 -06:00
Hans Goudey
c0674aa145 Fix T95334: Crash with no vertex normals in multires bake
This is partially caused by a stupid mistake in cfa53e0fbeed7178c78
where I missed initializing the `vert_normals` pointer in
`MResolvePixelData`. It's also caused by questionable assumptions
from DerivedMesh code that vertex normals would be valid.

The fix used here is to create a temporary mesh with the data necessary
to compute vertex normals, and ensure them here. This is used because
normal calculation is only implemented for `Mesh` and edit mesh, not
`DerivedMesh`. While this might not be great for performance, it's
potentially aligned with future refactoring of this code to remove
`DerivedMesh` completely. Since this is one of the last places the data
structure is used, that would be a great improvement.

Differential Revision: https://developer.blender.org/D13960
2022-02-10 10:10:45 -06:00
Bastien Montagne
d5a88f9bf4 Fix (unreported) over-resync from RNA detection code in linked cases.
While applying liboverrides on linked data, RNA code (in
`rna_property_override_check_resync`) would detect a lot of false positive
regarding IDs needing resync, because the temporary ID used to apply
overrides was always local, breaking the libraries comparison check.

NOTE: that whole 'apply liboverrides' code could use some refreshment,
it did not change much from initila version several years ago, we now
have better tools and control over non-main data.

But for now the 'trick' in that commit should do the job, ultimately
those temps IDs should never be put in Main at all.
2022-02-10 16:58:22 +01:00
Sergey Sharybin
ad77b52abc Correction to previous Clang strict warning commit
Need to only pop diagnostic if it was really pushed.

Pointed out by Aras Pranckevicius, thanks!
2022-02-10 16:05:11 +01:00
Sergey Sharybin
b73c265974 Merge branch 'blender-v3.1-release' 2022-02-10 16:04:50 +01:00
Sergey Sharybin
94f0230230 Fix T95666: Crash when attempting multires linear subdivide
The crash was happening when the mesh had loose edges.

Loose edges are not part of OpenSubdiv topology and hence should not be
communicated to the refiner. Pass ta boolean flag indicating whether an
edge is loose or not in the mesh foreach routines, which seems to be
the easiest way.
2022-02-10 15:51:19 +01:00
Bastien Montagne
e9c9a2183d LibOverride: Fix/improve handling of hierarchy root in tagged creation.
Decouple the reference (linked) root ID and the hierarchy (override) root ID.
Previous code was assuming that the reference ID was always also tagged
for override creation, which is true in current master, but cannot be
assumed in general (and won't be true with partial resync anymore).

Also add asserts to validate conditions that the reference/hierarchy_root
variables must meet.
2022-02-10 14:55:12 +01:00
Sergey Sharybin
d16e5babaf Merge branch 'blender-v3.1-release' 2022-02-10 14:12:35 +01:00
Sergey Sharybin
04d55038ee Fix size_t -> int -> size_t round trip in Cycles
There are two things achieved by this change:

- No possible downcast of size_t to int when calculating motion steps.
- Disambiguate call to `min()` which was for some reason considered
  ambiguous on 32bit platforms `min(int, unsigned int)`.
- Do the same for the `max()` call to keep them symmetrical.

On an implementation side the `min()` is defined for a fixed width
integer type to disambiguate uint from size_t on 32bit platforms,
and yet be able to use it for 32bit operands on 64bit platforms without
upcast.

This ended up in a bit bigger change as the conditional compile-in of
functions is easiest if the functions is templated. Making the functions
templated required to remove the other source of ambiguity which is
`algorithm.h` which was pulling min/max from std.

Now it is the `math.h` which is the source of truth for min/max.
It was only one place which was relying on `algorithm.h` for these
functions, hence the choice of `math.h` as the safest and least
intrusive.

Fixes 32bit platforms (such as i386) in Debian package build system.

Differential Revision: https://developer.blender.org/D14062
2022-02-10 12:39:41 +01:00
Jacques Lucke
87d2de88fd Fix T95664: missing update after changing active output node 2022-02-10 12:07:48 +01:00
Falk David
e2befa425a GPencil: Update-on-write using update cache
This implements the update cache described in T95401.

The cache is currently only used for drawing strokes and
sculpting (using the push brush).
**Note: Making use of the cache throughout grease pencil will
have to be done incrementally in other patches. **

The update cache stores what elements have changed in the
original data-block since the last time the eval object
was updated. Additionally, the update cache can store multiple
updates to the data and minimizes the number of elements
that need to be copied.

Elements can be tagged using `BKE_gpencil_tag_full_update` and
`BKE_gpencil_tag_light_update`. A full update means that the element
itself will be copied but also all of the content inside. E.g. when a
layer is tagged for a full update, the layer, all the frames inside the
layer and all the strokes inside the frames will be copied.
A light update means that only the properties of the element are copied
without any of the content. E.g. if a layer is tagged with a light
update, it will copy the layer name, opacity, transform, etc.

When the update cache is in use (e.g. elements have been tagged) then
the depsgraph will not trigger a copy-on-write, but an update-on-write.
This means that the update cache will be used to determine what elements
have changed and then only those elements will be copied over to the
eval object.

If the update cache is empty or the data block was tagged with a full
update, we always fall back to a copy-on-write.

Currently, the update cache is only used by the active depsgraph. This
is because we need to free the update cache after an update-on-write so
it's reset and we need to make sure it is not freed or read by other
depsgraphs.

Co-authored-by: @yann-lty
This patch was contributed by The SPA Studios.

Reviewed By: sergey, antoniov, #dependency_graph, pepeland, mendio

Maniphest Tasks: T95401

Differential Revision: https://developer.blender.org/D13984
2022-02-10 11:35:56 +01:00
Peter Kim
84f30ac3a2 Deps: upgrade OpenXR 1.0.17 -> 1.0.22
Simple upgrade of OpenXR to 1.0.22, following the steps from
https://wiki.blender.org/wiki/Source/OpenXR_SDK_Dependency and
rBb69ab42982a1. No changes to Blender code were necessary, only a version
bump.

The primary motivation for this upgrade is to utilize the
`XR_HTCX_vive_tracker_interaction` extension introduced in ver. 1.0.20.
However, the latest release (1.0.22) also adds a number of potentially
useful extensions such as:
- `XR_FB_render_model`
- `XR_HTC_facial_expression`
- `XR_HTC_vive_focus3_controller_interaction`

Ref T95206

Reviewed By: LazyDodo, sybren, mont29

Maniphest Tasks: T95206

Differential Revision: https://developer.blender.org/D13950
2022-02-10 19:15:29 +09:00
Brad Clark
26740aaf51 Fix T84486: NLA, disable "Sync Length" after split
Turn off "Sync Length" when splitting an NLA strip.

The NLA Strip-Action Clip has a setting called "Sync Length" that is on
by default and helps to update the length of the clip to the current
actions keyframes so the strip shows the entire actions stored
animation.

When you split one of these strip-action clips in the NLA to trim it
shorter or to move it somewhere else in the NLA tracks to blend or work
with, the "Sync Length" setting stays checked on.  You can have many
strips in the NLA that all look to the same action, if you split one
strip , you now have two strips showing or linked to the same action.

To see or edit keyframes on a strip, you enter tweak mode. When you exit
tweak mode, if "Sync Length" is active on the strip-action clip
settings, the strip length is changed/reset to match the action keys.
When you have many clips, this causes all of them to evaluate and update
no matter where they are in the NLA.  This destroys/undoes all the user
work to trim down and place the clips in the NLA.

**Description of the proposed solution:**

This patch/change would turn off, the "Sync Length" setting when the
split tool was used on a strip/action clip to help protect the users
choice to trim and keep the clip that length. It doesn't change the
ability to turn the setting back on or off, it just makes sure that the
user doesn't accidentally or unknowingly loose work.

The same process happens when an action is created that has a "manual
range" set that is different than the length of the actions start-end
keyframes. It makes sense to do the same thing for the split tool.

**Alternative solutions:**

While the user could know this and turn off this setting by hand, it is
easy to forget and or the user might think that it only happened to the
one clip they were editing and not realize it happened to all the
trimmed versions, changing the users choice without the user knowing it
happened.

**Limitations of the proposed solution:**

It only fixes the split tool, if another tool was created and some how
impacted the clip length we would need to have that tool also take the
sync length into account.

Reviewed By: sybren

Maniphest Tasks: T84486

Differential Revision: https://developer.blender.org/D10168
2022-02-10 11:08:00 +01:00
Sergey Sharybin
9e9355190c Fix compilation with strict Clang flags
There is no `-Wformat-truncation` warning in Clang, so tweak checks
around diagnostics pragma accordingly.
2022-02-10 10:55:50 +01:00
Sergey Sharybin
8c18b16829 Merge branch 'blender-v3.1-release' 2022-02-10 10:48:06 +01:00
Sergey Sharybin
5312cf50a1 Fix strict warning initializing texture result in compositor
From a strict language point of view the code required a braces around
`trgba` initialization. But it is easier to rely on the fact that fields
which are not specified are zero-initialized.
2022-02-10 10:46:06 +01:00
Sergey Sharybin
507a4deef1 Fix invalid creation of partial image updater 2022-02-10 10:42:25 +01:00
Campbell Barton
e6ad11f06d Cleanup: quiet warnings including RE_pipeline.h directly 2022-02-10 16:45:54 +11:00
Hans Goudey
c824c06f38 Cleanup: Clang tidy, unused variabel warnings 2022-02-09 23:07:48 -06:00
Hans Goudey
2887df119c Fix: Complete curves renaming missed in previous commit
This made cycles not render curves. Missed in fe1816f67fbc6aaf383ec7
2022-02-09 17:56:19 -06:00
Campbell Barton
fe80ff446f Cleanup: copyright in headers, spelling in comments
- Order year consistently.
- Minor consistency (case, double-spacing).
- Correct typos.
2022-02-10 10:25:06 +11:00
Campbell Barton
58761eb11a GNUmakefile: move editor settings to .editorconfig
Remove inline vim/emacs editor configuration,
add makefile to editorconfig instead.
2022-02-10 09:20:34 +11:00
Campbell Barton
7b0174ef81 Cleanup: remove overly detailed contact info, correct md5 copyright
Also remove copyright text with no assignment.
2022-02-10 09:05:40 +11:00
Hans Goudey
e420514892 Merge branch 'blender-v3.1-release' 2022-02-09 11:06:34 -06:00
Hans Goudey
d1202bd641 Fix T95620: Crash When Entering Edit Mode on a Curve
Under some circumstances, simply adding a curve object and going
to edit mode would cause a crash. This is because the evaluated
`CurveEval` was accessed but also freed by the dependency graph.

The fix reverts the part of b76918717dbfd8363f that uses the
`CurveEval` for the curve object bounds. While this isn't ideal,
it was the previous behavior, and some unexpected behavior
with object bounds is much better than a crash. Plus, given the plans
of using the new "Curves" data-block for evaluated curves, this
situation will change relatively soon anyway.
2022-02-09 11:06:10 -06:00
Sergey Sharybin
6e14be858c Merge branch 'blender-v3.1-release' 2022-02-09 16:16:34 +01:00
Sergey Sharybin
c69ee218d7 Revert "Fix size_t -> int -> size_t round trip in Cycles"
This reverts commit d74bb7be1916744ae56347b49333eac22ebb7339.

Need to re-iterate to have a proper support of all platforms.
2022-02-09 16:16:21 +01:00
Richard Antalik
3e67831d3f VSE: Fix sound strip not aligned with movie strip
Strip aligning wasn't done when length of 2 strip is equal, but since
these strips are aligned according to position in stream this can
produce offset.
2022-02-09 16:06:56 +01:00
Jacques Lucke
e098a29606 Merge branch 'blender-v3.1-release' 2022-02-09 15:54:41 +01:00
Jacques Lucke
7313a84c5a Fix T95612: only overwrite existing attributes with matching domain and type
Also fixes T95611 and T95610.

Differential Revision: https://developer.blender.org/D14051
2022-02-09 15:50:03 +01:00
Sergey Sharybin
669d3bbad6 Merge branch 'blender-v3.1-release' 2022-02-09 14:46:00 +01:00
Sergey Sharybin
d74bb7be19 Fix size_t -> int -> size_t round trip in Cycles
There are two things achieved by this change:

- No possible downcast of size_t to int when calculating motion steps.
- Disambiguate call to min() which was for some reason considered
  ambiguous on 32bit platforms `min(int, unsigned int)`.

On an implementation side the `min()` is defined for a fixed width
integer type to disambiguate uint from size_t on 32bit platforms,
and yet be able to use it for 32bit operands on 64bit platforms without
upcast.

Fixes 32bit platforms (such as i386) in Debian package build system.

Differential Revision: https://developer.blender.org/D13992
2022-02-09 14:45:39 +01:00