Commit Graph

120656 Commits

Author SHA1 Message Date
Jacques Lucke
006e905957 Tests: support running benchmark when Blender prints unrelated text
I noticed that sometimes the geometry nodes benchmark would not work
if there were some left-over debug prints in the code. The reason it did
not work was because the prints were mixed with the test output print.
I also tried using explicit flusing and `atexit` for printing the test output,
but that didn't solve it. Just printing additional newlines to better separate
the test output from other printed output helped though.
2023-01-06 13:04:49 +01:00
Jacques Lucke
3337838b49 Fix: retrieved writable attribute but did not write to it
This caused a warning because `attribute.finish` was not called.
2023-01-06 13:04:49 +01:00
bd36c712b9 Pose Library: while blending, use CTRL for flipping the pose
Using negative blend factors for blending in flipped poses was undesirable.
Instead, the pose blending operator now uses CTRL to flip the pose.

Negative blend values are still allowed, and cause the pose asset to be
subtracted from the current pose. It can quickly break the rig, but for
small adjustments it can be useful.
2023-01-06 11:57:44 +01:00
8556741183 Editors: Slider, add possibility to disable ctrl-for-increments
The slider component can now be told to not use CTRL for toggling stepped
10% increments. This is useful when the operator that uses the slider needs
that modifier key for its own purposes.
2023-01-06 11:57:44 +01:00
Julian Eisel
1229b96652 Fix empty asset index files after bug in asset loading
Initial error caused by 1efc94bb2f7b and fixed in 6a7917162c56. However
the empty index files (empty as in, they contain the version number but
no assets) will have to be fixed somehow, since otherwise assets don't
show up at all for people who saved asset files in a broken version.

Delete empty index files if the modification timestamp indicates a time
when the bug was present (plus a day before and after, to address
possible time zone differences). This will basically make Blender skip
the optimization for .blend files without assets for one load, but even
then the index should still produce faster results than a completely
non-index read.

This can be removed after a while, it's just a (much needed) fix for
people who were using alpha/beta builds.

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

Reviewed by: Jeroen Bakker
2023-01-06 11:55:24 +01:00
Jacques Lucke
42b88c0088 Functions: simplify multi-function parameters
The use of `std::variant` allows combining the four vectors
into one which more closely matches the intend and avoids
a workaround used before.

Note that this uses `std::get_if` instead of `std::get` because
`std::get` is only available since macOS 10.14.
2023-01-06 11:50:56 +01:00
Bastien Montagne
fc9c39e320 Fix T103242: Missing update on undo/redo for some image properties.
Issue comes from the fact that some of the image updates are handled
outside of depsgraph context (through the signal system), and therefore
completely ignored by the undo/redo code.

Now that undo/redo tries to update as little data as possible, it needs
to be aware of these changes.

As a temporary workaround, until image update is fully handled through depsgraph,
consider that IDs tagged with `ID_RECALC_SOURCE` should get their caches
cleared on undo/redo, and tag some RNA property updates of
Image/ColorSpace as such.

Reviewed By: sergey

Maniphest Tasks: T103242

Differential Revision: https://developer.blender.org/D16927
2023-01-06 11:06:27 +01:00
Arnd Marijnissen
5c4d11d709 Bump buildbot gcc version to 11 2023-01-06 11:00:12 +01:00
Jesse Yurkovich
b6c74b4c6f Fix T82081: Remove workaround for OCIO Unicode issue on Windows
This workaround is no longer needed and prevents our OCIO configuration
from being loaded if Blender is unpacked under a Unicode path.

Differential Revision: https://developer.blender.org/D16818
2023-01-05 20:44:52 -08:00
Chris Blackbourn
280502e630 Fix T103469: improve uv cylinder projection and uv sphere projection
Multiple improvements to UV Cylinder and UV Sphere projection including:

 * New option "Pinch" or "Fan" to improve unwrap of faces at the poles.
 * Support for "Polar ZY" option on "View On Equator" and "Align To Object"
 * Better handling of inputs with round-off error.
 * Improved handling of faces touching the unit square border.
 * Improved handling of very wide quads spanning the right hand border.
 * Improved accuracy near to (0, 0).
 * Code cleanup and simplification.

Differential Revision: https://developer.blender.org/D16869
2023-01-06 17:12:41 +13:00
Campbell Barton
8d0c98740a Cleanup: remove unused OffsetGpencilModifierData.object
Added as part of D15106 but was not used anywhere.
2023-01-06 14:06:37 +11:00
Campbell Barton
14fc02f91d Cleanup: spelling in comments 2023-01-06 14:00:36 +11:00
Campbell Barton
706b13959e Cleanup: use double-quotes for non-enum strings 2023-01-06 14:00:36 +11:00
Campbell Barton
cb7f97891d Cleanup: quiet shadow variable warning, unused variable 2023-01-06 14:00:36 +11:00
Lukas Stockner
00a20aec07 Fix T103403: Lightgroup passes can contain lighting on shadow catchers 2023-01-06 02:33:22 +01:00
Lukas Stockner
bc5337a05a Fix T103507: Distant lights partially contribute to wrong lightgroup
The the BSDF-sampling half of MIS next-event estimation for distant lights was
using the background lightgroup instead of the lamp's lightgroup.
2023-01-06 01:40:44 +01:00
Alexander Gavrilov
4fb0eb3a6e Minor fixes after introducing special BVH traversal for self-collision.
- Add parentheses to suppress an assertion on some compilers.

- It turns out cloth self-collision math is not precisely symmetric,
  so sort the triangle index pair to restore behavior exactly identical
  to the version before the new traversal.

Follow up to rB0796210c8df32
2023-01-06 02:35:23 +02:00
Alexander Gavrilov
0796210c8d BVH: implement an optimized self-overlap traversal.
Previously cloth self-collision and other code that wants self-overlap
data was using an ordinary BVH overlap utility function. This works,
but is suboptimal because it fails to take advantage of the fact that
it is comparing two identical trees.

The standard traversal for self-collision essentially devolves into
enumerating all elements of the tree, and then matching them to the
tree starting at the root. However, the tree itself naturally partitions
the space, so overlapping elements are likely to be mostly placed nearby
in the tree structure as well.

Instead, self-overlap can be computed by recursively computing ordinary
overlap between siblings within each subtree. This only considers each
pair of leaves once, and provides significantly better locality.
It also avoids outputting every overlap pair twice in different order.

Differential Revision: https://developer.blender.org/D16915
2023-01-05 21:46:42 +02:00
Brecht Van Lommel
87f7b630b5 Cleanup: make format 2023-01-05 19:43:19 +01:00
Brecht Van Lommel
084b52bcd8 Cycles: take into account IES texture node strength input for light tree
To better estimate light contribution. Note that estimating the texture
from the IES file is still missing.

Contributed by Alaska.

Differential Revision: https://developer.blender.org/D16901
2023-01-05 19:43:19 +01:00
frogstomp
7d712dcd0b Gpencil: Add offset(Location, Rotation, Scale) by Layer, Stroke and Material to Offset modifier
This patch adds two new panels in which users can control
offset (position, rotation, scale) by layer and by stroke number.

Use cases:
- if you want to create array of Suzannes and place them one behind 
another, in 2d mode, Z depth will be wrong. 
In 3d mode there will be Z fighting. With combination of stroke 
and layer offset we can fight this issue without touching original drawing.
- even easier way to create 2.5d environments.. 
simply draw on layers and then displace them in one panel 
instead fiddling with every layer individually

Possible improvements:
- add offset by material slot
- add step parameter, to allow displacing groups of N strokes.

{F13129598}

Reviewed By: mendio, antoniov

Differential Revision: https://developer.blender.org/D15106
2023-01-05 19:21:51 +01:00
Antonio Vazquez
0fb12a9c2e GPencil: Fix size difference between radial control and Brush size
Due an internal scale of the brush size done by grease pencil
draw tool (this scale factor cannot be removed), the size of the
radial control is not equal to the actual stroke thickness and
this makes the radial size displayed useless.

This patch adds a new property that allows to pass the
path of the tool path and this value is used to apply
the correct scale to the radial size.

Reviewed By: mendio, frogstomp, pepeland, brecht

Differential Revision: https://developer.blender.org/D16866
2023-01-05 19:06:22 +01:00
David Ballesteros
59ce7bf5a9 Nodes: better default name for custom node tree datablocks
Use NodeTree.bl_label instead of "NodeTree" for more descriptive name.

Implemented by Iliya Katueshenock.

Differential Revision: https://developer.blender.org/D16856
2023-01-05 18:37:58 +01:00
8a65e33d41 Pose Library: properly set hard min/max for blend factor
Since rBcommit 74c4977a the pose library blending operator can extrapolate.
This is now also reflected in the hard min/max value of the blend factor
RNA property. The soft min/max are still -1/1 to indicate normal use.
2023-01-05 17:13:01 +01:00
Bastien Montagne
b099e9924e install_deps: Add building of MaterialX.
Ref. T99618
2023-01-05 17:08:45 +01:00
74c4977aea Pose Library: allow extrapolating the pose
While blending, press E to enable extrapolation / overshoot of the pose.
It will make it possible to blend in more than 100% of the pose asset.
This has the potential to completely break the rig, but it can be useful
to exaggerate poses when used with caution.
2023-01-05 16:19:45 +01:00
Philipp Oeser
d1810d11f4 Fix T103303: Dbl-click in the Graph Editor wont select all keyframes
This was the case when an Annotation is also present as in the report.

Since {rB92d7f9ac56e0}, Dopesheet is aware of greaspencil/annotations
(displays its channels/keyframes, can rename their data, layers, fcurve
groupings etc.). However, the Graph Editor does not display these /
should not be aware of them.

Above commit already had issues that were addressed in the following
commits (mostly adding the new `ANIMFILTER_FCURVESONLY` to places that
dont handle greasepencil/annotations)
- {rBfdf34666f00f}
- {rB45f483681fef}
- {rBa26038ff3851}

Now in T103303 it was reported that doublicking a channel would not
select all fcurve`s keyframes anymore and this wasnt actually an issue
with that particular operator, but instead with another operator that is
also mapped to doubleclicking: the channel renaming (I assume the
keyconflict here is actually wanted behavior).
Channel renaming would not return `OPERATOR_PASS_THROUGH` here anymore
in the case nothing cannot be renamed, so we would not actually reach
the 2nd operator at all (the one selecting all keyframes).
Deeper reason for this is that the renaming operator would actually
"see" a channel that could be renamed (in the case of the report: an
annotation layer), but then cannot proceed, because the "real"
underlying data where the doubleclick happens is an fcurve...

So now exclude non-greasepencil channels in filtering as well where
appropriate by also adding `ANIMFILTER_FCURVESONLY` to the filter there.

Fixes T103303.

Maniphest Tasks: T103303

Differential Revision: https://developer.blender.org/D16871
2023-01-05 16:12:25 +01:00
Antonio Vazquez
2a5104e368 Cleanup: Remove compiler warnings 2023-01-05 15:59:51 +01:00
Aleš Jelovčan
a5d4c63e86 GPencil: remove multiframe copy/paste restriction
Multiframe copy paste operations were prohibited by a block of code.
While this is understandable as it prevents confusing actions, there is a good use case to allow multiframe copy pasting.

This patch does:
- remove restricting block of code
- adds outer loops for frames both in copy and paste actions.

In copy action it will create an array of selected strokes from all selected frames
In paste action it will create new from previous copy action merged to a single frame. It will paste to all selected frames and create new frame if autokey is on and time cursor is not on any of the keyframes.

The main usecase is for creating motion smears as in examples attached. The user still need to do some actions in order to achieve desired look, such as stroke ordering and deleting excessive strokes.

{F14069747}

{F14069743}

Reviewed By: antoniov, mendio

Differential Revision: https://developer.blender.org/D16805
2023-01-05 15:49:39 +01:00
Jacques Lucke
3819a9b15a Fix T103614: crash during geometry nodes evaluation with tbb disabled 2023-01-05 15:36:39 +01:00
Bastien Montagne
25e28f518c install_deps: Add package handling for fribidi, harfbuzz, shaderc and vulkan ICD loader.
All these are available on recent distros, don't think it's worth adding
support to build them for the time being.

Ref. T99618.
2023-01-05 14:56:24 +01:00
Jacques Lucke
862d08bb97 Fix: use-after-free when threadlocal is destructed after static variable
This issue was introduced in rB78f28b55d39288926634d0cc.

The fix is to use a `std::shared_ptr` to ensure that the `Global` will live
long enough until all `Local` objects are destructed.
2023-01-05 14:38:34 +01:00
Bastien Montagne
a318f3b8d6 install_deps: Add py binding for OCIO, OIIO, OpenVDB and USD.
This was quite a fight, some resulting notes:
* We cannot use anymore Boost packages because of a weird bug breaking
  Blender debug builds and ivolving Boost, TBB and USD (see also
  rB019b930d6b9c).
* OCIO, OIIO, OpenVDB and USD build options where updated to match these
  from cmake libs building.
** Most notably, USD now has imaging, OIIO, OpenVDB and GL support.

Ref. T99618.
2023-01-05 14:14:01 +01:00
Jacques Lucke
2ffd08e952 Geometry Nodes: deterministic anonymous attribute lifetimes
Previously, the lifetimes of anonymous attributes were determined by
reference counts which were non-deterministic when multiple threads
are used. Now the lifetimes of anonymous attributes are handled
more explicitly and deterministically. This is a prerequisite for any kind
of caching, because caching the output of nodes that do things
non-deterministically and have "invisible inputs" (reference counts)
doesn't really work.

For more details for how deterministic lifetimes are achieved, see D16858.

No functional changes are expected. Small performance changes are expected
as well (within few percent, anything larger regressions should be reported as
bugs).

Differential Revision: https://developer.blender.org/D16858
2023-01-05 14:05:30 +01:00
Sergey Sharybin
4813c37ae2 Cleanup: Better const-correctness in the space clip 2023-01-05 12:40:34 +01:00
Sergey Sharybin
fdc918c32c Cleanup: Better const-correctness in MovieClip
Mainly make MovieClipUser constant.
2023-01-05 12:40:34 +01:00
Sergey Sharybin
58b6c91d36 Cleanup: Remove unused runtime field from the MovieClip
It is a part of old-standing TODO, and code which accesses
the value was commented out for many years.

Remove the field to help with an upcoming const-correctness
improvements.
2023-01-05 12:40:34 +01:00
963600ddc0 CMake: when compiler is too old, report found version
To aid in debugging the case where your compiler is too old for Blender,
actually log which version CMake found.

Before, CMake would output:
```
CMake Error at CMakeLists.txt:121 (message):
  The minimum supported version of GCC is 11.0.0
```

With the patch, it logs:
```
CMake Error at CMakeLists.txt:121 (message):
  The minimum supported version of GCC is 11.0.0, found 10.4.0
```

This has been implemented for GCC and Clang. MSVC has been explicitly
excluded, as the version numbers used for this comparison are internal
versions and not directly usable/recognisable.

Reviewed By: LazyDodo, brecht

Differential Revision: https://developer.blender.org/D16849
2023-01-05 11:34:11 +01:00
Christoph Lendenfeld
200a114e15 Fix T87548: Propagate Pose, Next Keyframe
Change the logic for propagating poses such that it checks keyframes
on all selected bones to determine the frame on which a pose
should be propagated to.
It then adds keyframes if they don't exist on whatever
frame the pose should be propagated to.

Reviewd by: Sybren A. Stüvel
Differential Revision: https://developer.blender.org/D16654
Ref: D16654
2023-01-05 10:39:39 +01:00
Christoph Lendenfeld
76a68649c1 Animation: Graph Editor Ease operator
Added a new operator that aligns selected keys on an exponential curve

Revied by Reviewed by: Sybren A. Stüvel
Differential Revision: https://developer.blender.org/D9479
Ref: D9479
2023-01-05 10:11:24 +01:00
Damien Dh
34fa369b48 Eevee: Mark Properties on Samples Panel Animatable.
Eevee:
Mark `Scene->Sampling->Render/Viewport` samples animatable.
Mark Viewport Denoising also animatable

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D16827
2023-01-05 09:21:23 +01:00
Jeroen Bakker
d7598c8081 Metal: Fix crash when compiling compositor shaders.
Although viewport compositor isn't supported yet on Apple deviced the
shaderlibs are compiled. The compositor shaders uses mat3 constructor
with a single vec3 and 6 floats. This constructor wasn't defined in
metal so it failed the compilation.

This patch adds the override to mat3.
2023-01-05 08:30:41 +01:00
Campbell Barton
bfb0b1decc Cleanup: pass matrix & vector by const reference instead of value 2023-01-05 18:11:16 +11:00
Campbell Barton
77c3e0895d Cleanup: quiet -Wcomma warnings with clang 2023-01-05 17:02:43 +11:00
Campbell Barton
7690872ce4 Cleanup: quiet missing-declaration warnings 2023-01-05 16:44:33 +11:00
YimingWu
93fc352cfa Fix T102612: Line art crash on loading due to references to other scenes. 2023-01-05 12:43:05 +08:00
YimingWu
168091a1d6 Cleanup: Missing debug #ifdef for GPU_vertbuf_raw_step 2023-01-05 11:01:32 +08:00
Michael Jones
a7cc6e015c Cycles: Additional Metal kernel specialisation exposed through UI
This patch adds a new "Kernel Optimization Level" dropdown menu to control Metal kernel specialisation. Currently this defaults to "full" optimisation, on the assumption that the changes proposed in D16371 will address usability concerns around app responsiveness and shader cache housekeeping.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D16514
2023-01-04 23:36:52 +00:00
Chris Blackbourn
496d736adc Cleanup: format 2023-01-05 11:21:51 +13:00
Iliya Katueshenock
433d436b84 Fix: sort link indices in multi input sockets incorrect
For some reason I don't understand, the dragged link is sorted across
all the node's multi-input sockets. This leads to problems when there
are multiple sockets to sort. With this patch, I'm making the feature
work more directional.

Differential Revision: https://developer.blender.org/D16892
2023-01-04 16:37:32 -05:00