Commit Graph

108868 Commits

Author SHA1 Message Date
Brecht Van Lommel cc653c9b02 Fix potential render tests error with invalid utf-8 characters
In general should not happen, but better to report the actual error instead
of the Python test code failing.
2021-09-28 20:50:38 +02:00
Jacques Lucke 95fca22bfe Geometry Nodes: Remove experimental option for fields
This enables fields as the official workflow for geometry nodes.
While many features are converted to use fields rather than the old
attribute workflow, many are not yet converted. In that case, the
unconverted nodes are still accessible with an experimental option.
In the coming weeks the rest of the nodes will be converted.

Differential Revision: https://developer.blender.org/D12672
2021-09-28 13:22:52 -05:00
Brecht Van Lommel 86ec9d79ec Fix build without Cycles HIP device 2021-09-28 20:00:55 +02:00
Hans Goudey e45ffce5fa Geometry Nodes: Use factor slider for distribution density factor
Though the factor isn't so useful to adjust by itself, and is mostly
useful when used with a field connected, the slider from 0 to 1 can
help to make it clear that it's just used as a multiplier for the max
density after distribution.

Differential Revision: https://developer.blender.org/D12654
2021-09-28 12:44:50 -05:00
Erik Abrahamsson faedfd5740 Fix VS2017 compile error in String to Curves node
Because of a bug in VS2017 codecvt is replaced with Blender
BLI functions to convert from UTF8 to UTF32.

Differential Revision: https://developer.blender.org/D12655
2021-09-28 12:37:56 -05:00
Brian Savery 044a77352f Cycles: add HIP device support for AMD GPUs
NOTE: this feature is not ready for user testing, and not yet enabled in daily
builds. It is being merged now for easier collaboration on development.

HIP is a heterogenous compute interface allowing C++ code to be executed on
GPUs similar to CUDA. It is intended to bring back AMD GPU rendering support
on Windows and Linux.

https://github.com/ROCm-Developer-Tools/HIP.

As of the time of writing, it should compile and run on Linux with existing
HIP compilers and driver runtimes. Publicly available compilers and drivers
for Windows will come later.

See task T91571 for more details on the current status and work remaining
to be done.

Credits:

Sayak Biswas (AMD)
Arya Rafii (AMD)
Brian Savery (AMD)

Differential Revision: https://developer.blender.org/D12578
2021-09-28 19:18:55 +02:00
Hans Goudey 262b211856 Geometry Nodes: Mesh Point Cloud Conversion Nodes
This commit adds nodes to do direct conversion between meshes and point
clouds in geometry nodes. The conversion from mesh to points is helpful
to instance once per face, or once per edge, which was previously only
possibly with ugly work-arounds. Fields can be evaluated on the mesh
to pass them to the points with the attribute capture node.

The other conversion, point cloud to mesh vertices, is a bit less
obvious, though it is still a common request from users. It's helpful
for flexibility when passing data around, better visualization in the
viewport (and in the future, cycles), and the simplicity of points.

This is a step towards T91754, where point clouds are currently
combined with meshes when outputing to the next modifier after geometry
nodes. Since we're removing the implicit behavior for realizing
instances, it feels natural to use an explicit node to convert points
to vertices too.

Differential Revision: https://developer.blender.org/D12657
2021-09-28 12:14:13 -05:00
Hans Goudey 797064544e Geometry Nodes: Only show attribute toggle for field inputs
Change the toggle to switch between an attribute and a single value to
only display for inputs that are fields, as determined statically by
the field inferencing added in rB61f3d4eb7c7db7. This means the field
inferencing must be calculated on file load, since it's used in the UI.

Differential Revision: https://developer.blender.org/D12623
2021-09-28 12:05:42 -05:00
Hans Goudey 44e4f077a9 Geometry Nodes: Run nodes once on unique instance data
As described in T91672, often it can be much more efficient to run each
node only on the unique geometry of the instances, rather than realizing
all instances and potentially processing redundant data. Sometimes the
performance difference can be completely smooth vs. completely unusable.

Geometry nodes used to hide that choice from users by always realizing
instances, but recently we have decided to expose it. So this commit
makes nodes run once per unique reference in the entire tree of nested
instances in their input geometries, continuing the work started in
rB0559971ab377 and rBf94164d89629f0d2. For the old behavior, a realize
instances node can be added before the nodes, which is done in the
versioning code.

Differential Revision: https://developer.blender.org/D12656
2021-09-28 11:36:28 -05:00
Bastien Montagne b32b38b380 Fix T89400: Possible to delete objects used by overrides of collections.
This should not be allowed in general, added some initial call to check
when user is allowed to delete a data to search for mandatory override
usages...
2021-09-28 18:30:33 +02:00
Hans Goudey f35ea668a1 Geometry Nodes: Move more nodes to legacy
- Curve to Points: Needs output sockets
- Curve Endpoitns: Needs the same output sockets
- Edge Split: Should have a selection input instead
- Subdivision Surface: Should not use "crease" implicitly
All new versions of these nodes should also not implicitly
realize instances.
2021-09-28 11:03:12 -05:00
Dalai Felinto e694165123 VSE: fix versioning code to the new maximum zoom level (128)
Since we bumped the number of channels to 128, I forgot to doversion the
editors. So new files (new editors) would have this right, but not
existing files.

Fixup to: 8fecc2a852
2021-09-28 17:58:41 +02:00
Sybren A. Stüvel 6ee2f2da96 Cleanup: asset catalog, remove obsolete TODO
No functional changes.
2021-09-28 17:47:34 +02:00
Sybren A. Stüvel 10d926cd4a Cleanup: asset catalogs, move file header definition to constant
Define the standard catalog definition file header in a constant,
separating it from the function that writes the entire file.

No functional changes.
2021-09-28 17:47:34 +02:00
Jacques Lucke 3acf3e9e2f Geometry Nodes: don't realize instances in Instance on Points node
Part of T91672.
2021-09-28 17:46:32 +02:00
Bastien Montagne 330a04d7c7 Fix T91393: Duplicating an action with python crashes Blender.
Own mistake when making NLA overridable, instead of assuming things
about the ID owner of the animation data being processed, properly
return and use the one found by `ED_actedit_animdata_from_context`.
2021-09-28 17:41:40 +02:00
Bastien Montagne 53fa4801a0 Fix: Fluid/Cloth/DynamicPaint: Only share pointcaches in CoW case.
Particle copying code was already properly sharing pointcache between
orig data and its copy only when `LIB_ID_COPY_SET_COPIED_ON_WRITE` is
set, do the same for the other point cache users.

Using `LIB_ID_CREATE_NO_MAIN` here is waaaaaaay to much wide scope for
such a dangerous/advanced behavior, that kind of things has to be
strictly restricted in scope.
2021-09-28 17:41:40 +02:00
Sybren A. Stüvel 34ba6968b2 Cleanup: asset catalog service, remove obsolete `write_to_disk` function
Remove `AssetCatalogService::write_to_disk()` function. It has been
superseded by `write_to_disk_on_blendfile_save()`; the handful of test
functions that called the old function have been adjusted to use the
new one.

No functional changes to Blender itself.
2021-09-28 17:32:58 +02:00
Sergey Sharybin f17ca53cdd Fix wrong update with shadow catcher and transparent film
This change fixes an issue when scene has a shadow catcher and film is
configured to be transparent. Starting viewport render and making the
background non-transparent will cause bad memory access (wrong render
and possibly crash).

Film passes depends on transparency of background, so check for this.

Demo file: F10650585

Differential Revision: https://developer.blender.org/D12666
2021-09-28 17:06:16 +02:00
Sergey Sharybin 640c4ace0b Cycles: Disable tile-level denoising
Only do denoising on the full-frame result. Saves render time.

Can re-consider in the future when/if we'll want to support
denoising during rendering (similar to viewport) to allow artists
to stop rendering when they see image to be good enough. Until
there is a design for that workflow stick to a more time efficient
rendering.

Differential Revision: https://developer.blender.org/D12662
2021-09-28 17:05:47 +02:00
Dalai Felinto ff7e67afd5 Geometry Nodes: Dashed lines for function flow
Use dashes to represent the function flow (while keeping continuous
lines for the data-flow).

It is important to tell both flows apart (the data and the function
 flow). The sockets help with that, the noodles help this further.

The "data flow" is evaluated at every single node. A user can inspect
the output sockets of those nodes and have a glimpse at their values.

The "function flow" (nodes) however is only evaluated in the geometry
nodes. The noodles are not transporting data in the same sense of the
"data flow". All that can be inspected are the attributes the functions
depend on.

Having this clearly communicated should help users to inspect the
nodetrees, read and understand the different flows in the same tree.

---

Known limitations:

At the moment the dash lines are not equidistant:

* It would be nice to get the "uv.x" to be resampled for the bezier curve
so the dashes are equally distributed in the curve.

* Using distance between the P3 and P0 instead of the real bezier curve
length seems to be fine.

---

Full disclaimer:

Changes with that much of a visual impact tend to be controversial. So
far the main feedback is that dashed lines can be associated to broken
link, and that there are better ways to represent the flows (or
different information that should be visually represented).

I'm fully aware of that. However dashed lines are already used in the
viewport and outliner to indicate (hierarchical) relation. Besides,
other approaches (double-lines, having the data flow to be more
distinct, ...) didn't pan out in the end (or didn't look as good as
this).

---

Impact in other editors:

The compositor uses mostly a "data flow" nodetree, so no change is
expected there.

The shader nodetree is one that could but doesn't have to change its
visual language.

The shader nodetree uses mostly "function flow" with some "data flow" nodes.
One can argue that it should be adapted to follow the
same pattern as geometry nodes (with the new noodles and the diamond
sockets). Oh the other hand, a shader nodetree has a single context.
When a node depends on the "UV", there is only one UV at a time for the
entire nodetree. So it can also be treated as a psedo "data flow"
nodetree if we want to avoid too many changes in other parts of Blender.

Differential Revision: https://developer.blender.org/D12602
2021-09-28 17:03:03 +02:00
Sergey Sharybin 728ae33f37 Cycles: Improve handling of tile file error
Expose them to the interface, and stop rendering as soon as possible.

Differential Revision: https://developer.blender.org/D12617
2021-09-28 16:58:27 +02:00
Sybren A. Stüvel 52a702468a Asset Catalog Service: add function to change catalog path
Add `AssetCatalogService::update_catalog_path()` to change the catalog
path of the given catalog, and also change the path of all the catalogs
contained within the given catalog.

Rebuilds the tree structure for the UI, but does not save the new catalog
definitions to disk.

No user-facing changes, just backend preparation for UI work.
2021-09-28 16:09:12 +02:00
Jacques Lucke d2004326a1 Geometry Nodes: remove empty mesh component in distribute node output 2021-09-28 15:52:31 +02:00
Germano Cavalcante 3e78c9e5bb Fix T91766: NLA Editor - Segmentation fault on strip resize
NLA and Dope Sheet use a specific transform operation to scale.

Unlike the conventional resize operation, `TIME_SCALE` operates on `td->val`.

This is a bit outside the convention of transform operators.

The expected thing in this case would be to work in `td->loc` and use the conventional resize operator.

But for now, to fix the problem, use `td->loc` in the `TIME_SCALE` operation.

This commit also brings a cleanup in the style of some comments and removing unnecessary `memset`.
2021-09-28 10:24:02 -03:00
Sybren A. Stüvel 3674347849 Assets: Clear Asset operator variants for clearing/setting Fake User
The Clear Asset operator (`ASSET_OT_clear`) now clears the Fake User.
This makes it symmetrical with the Mark Asset (`ASSET_OT_mark`)
operator, which sets Fake User to ensure assets are always saved to
disk.

Clear Asset now also has a `set_fake_user` boolean option, which allows
users to Clear Asset and set Fake User in one go.

The asset browser now shows these options in the context menu:
- Clear Asset: also clears Fake User. This makes it possible to actually
  remove assets from the blend file without leaving the Asset Browser.
- Clear Asset (Set Fake User): keeps the Fake User bit set. This makes
  it possible to "hide" the asset from the asset browser, without
  loosing the actual data.

Internally, the `ED_asset_clear_id(id)` function now always clears the
Fake User bit. If it was intended that this bit was kept set, it's up to
the caller to explicitly call `id_fake_user_set(id)` afterwards.

Manifest Task: T90844

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D12663
2021-09-28 15:04:55 +02:00
Philipp Oeser 73b2ecb297 Cleanup: typo in comment
Noticed by @david_black in D12392, thx!
2021-09-28 14:37:06 +02:00
Vitor Boschi da Silva 9490db1ad2 Cleanup: remove unused variable
As the title says

Reviewed By: lichtwerk, campbellbarton

Differential Revision: https://developer.blender.org/D12665
2021-09-28 14:29:02 +02:00
Jacques Lucke 6a745e54f6 Cleanup: remove incorrect assert
The method works perfectly fine when `resource` is empty.
2021-09-28 13:32:22 +02:00
Jacques Lucke 5d160dec3b Geometry Nodes: move legacy nodes to separate folder
Previously, we were moving them one by one. It's a lot easier
to just move all files at the same time.
2021-09-28 11:31:46 +02:00
Philipp Oeser b3431a8846 Fix Drivers Editor showing playhead on the X Axis
Currently the Drivers Editor shows this (the blue thing can be dragged
to change frame):
{F10647661}

But the Drivers Editors X axis is the output of the driver [which can be
further tweaked by the curve] not time(frame).
So it seems better to not mix them here, it is just confusing to have
two different units on one axis.
Especially since what we really want to look at in X (the drivers output
value) can be in a totally unrelated range compared to frames, so e.g.
we might be interested in a drivers range from 0.0 to 1.0 and a
framerange of 100 to 200, so putting this on one axis just does not make
sense. Better to use a separate timeline for this.

Note 2.79 also did not do this.

Maniphest Tasks: T91157

Differential Revision: https://developer.blender.org/D12392
2021-09-28 11:14:44 +02:00
Philipp Oeser 6f29801f1b Fix Drivers Editor not hiding vertical part of cursor
When "Show Cursor" is unchecked, the Drivers Editor would still display
the vertical line representing the cursor x.

Probably overseen in {rB65072499c65a} (historically the vertical line
could represent either the current frame of the cursor X in drawing, but
this is now much more separate).

There is no point in seeing part of the cursor in the Drivers Editor if
this is disabled.

Also correct outdated comments.

ref. T91157

Maniphest Tasks: T91157

Differential Revision: https://developer.blender.org/D12391
2021-09-28 11:14:44 +02:00
Sybren A. Stüvel b91946780c Path util: BLI_path_contains() case-insensitive on Windows
Make `BLI_path_contains()` case-insensitive on Windows. This behaviour
is dependent on the platform Blender is running on, like the rest of
BLI_path, and not on the style of paths (Windows-style paths will be
treated case-sensitively when Blender is running on Linux/macOS).
2021-09-28 11:05:45 +02:00
Sergey Sharybin 741fa8180c Fix T91679: Crash when saving bordered render as multilayer exr
The related issue which is fixed by this change is the missing noisy
image pass when denoising and border render is used,

Need to allocate passes after the passes has been copied from the
original render result.
2021-09-28 10:49:01 +02:00
Dalai Felinto e5ff9f3615 Cleanup: Move VSE channels check into own util function
Differential Revision: https://developer.blender.org/D12661
2021-09-28 10:44:39 +02:00
Dalai Felinto a64782b133 VSE: Implement sanity check for files with more channels than supported
This is a follow up to 8fecc2a852.

This makes sure future .blend files that have more channels than the
limit won't break Blender.

It can be backported to LTS.

This is part of https://developer.blender.org/D12645

Differential Revision: https://developer.blender.org/D12648
2021-09-28 10:23:13 +02:00
Jacques Lucke 7cd43a9d28 Fix: field inferencing fails when there are undefined nodes 2021-09-28 10:19:16 +02:00
Jacques Lucke def8fd6330 Cleanup: support moving InstanceReference 2021-09-28 10:17:49 +02:00
Jacques Lucke e7b9423623 Geometry Nodes: multi-threading when modifying multiple geometry sets
Differential Revision: https://developer.blender.org/D12652
2021-09-28 10:17:00 +02:00
Campbell Barton c7d94a7827 UI: avoid excessive padding for labels in headers
Labels in headers reserved space for an icon even when no icon was used.

This is caused by the shared function ui_text_icon_width adding 1.5x
a buttons X-units width the the width of the string.

Menu buttons detected this and subtracted the extra padding.

Instead of adding the same workaround for labels,
add ui_text_icon_width_ex that takes a padding argument.

Add presets for 'default', 'compact' and 'none' to avoid duplicating
padding values.

This allows removal of hard-coded label scaling for the add-object tool.
2021-09-28 14:36:52 +10:00
Jesse Yurkovich 986d60490c Asset Browser: Allow World assets to be drag/dropped onto the viewport
While World data has always been able to be marked as an asset, there
was no way to actually use them from the asset browser. This change
allows users to drag-drop world assets onto the Viewport and have them
appended/linked to their scene.

Differential Revision: https://developer.blender.org/D12566
2021-09-27 21:00:17 -07:00
Hans Goudey c53ffda8a4 Cleanup: Fix incorrect comments 2021-09-27 13:29:53 -05:00
Hans Goudey f94164d896 Geometry Nodes: Do not realize instances in the material assign node
Only run the node once for every unique geometry set in the input's
instance heirarchy. This can massively improve performance when
there are many instances, but it will mean that the result is the same
for every instance. For the previous behavior, a "Realize Instances"
node can be used before this one.

This node can be changed without versioning since the old material
assign node was already deprecated and replaced.
2021-09-27 13:22:44 -05:00
Hans Goudey 5d70a4d7ee Geometry Nodes: Move output attribute names to a subpanel
In a sub-panel it will be clearer that they are outputs, since they
just look like more inputs now. Unfortunately it is not possible to
make sub-panels display conditionally currently, so the output
sub-panel will always be visible whether or not it is empty.

Differential Revision: https://developer.blender.org/D12653
2021-09-27 13:04:58 -05:00
Brecht Van Lommel e6aabcae14 Fix part of T91516: Cycles not rendering geometry nodes instances
Part of the fix is by Jacques. This fixes the most obvious case, but it's
still not clear how to deal with non-mesh geometry instances or how to handle
motion blur for such instances.
2021-09-27 19:49:43 +02:00
Brecht Van Lommel 50b7253257 Cleanup: fix (harmless) uninitialized variable usage 2021-09-27 19:49:43 +02:00
Alexander Gavrilov 8da23fd5aa Constraints: change default Stretch To rotation type to Swing.
As also explained in D6134, in most case of Stretch To usage in
rigs, it is desirable to use swing rotation, either via the old
method of pairing the constraint with Damped Track, or via the
Swing rotation type introduced in 2.82. This is for instance true
for all usages of the constraint in Rigify.

The reason can be understood by realizing that unlike order-
dependent euler rotations, swing is not biased to an axis, and
isn't affected by gimbal lock effects at merely 90 degrees
of rotation (it has only one singularity at 180 degrees).

Thus it makes sense to change the default for newly created
constraints to the Swing mode. This has no backward compatibility
concerns except for old tutorials and rig generation scripts.

Differential Revision: https://developer.blender.org/D12643
2021-09-27 20:45:03 +03:00
Aaron Carlisle 8967bcb755 Update RNA to user manual url mappings 2021-09-27 13:42:41 -04:00
Julian Eisel 847d355cab File/Asset Browser: Don't deselect other items when dragging
Basically this enables the select-tweaking behavior as per the
guidelines:
https://wiki.blender.org/wiki/Human_Interface_Guidelines/Selection#Select-tweaking.

We use this in most other other editors that allow selecting and
dragging multiple items. But besides the consistency improvement, this
is important if we want to support dragging multiple assets (or files)
in future. We want to support this at least for dragging multiple assets
into an asset catalog for the upcoming asset catalog UI.
2021-09-27 18:52:16 +02:00
Jacques Lucke c76ccd85be Cleanup: incorrect null check in asset library
Found by clang tidy (P2439).
2021-09-27 18:42:19 +02:00