Commit Graph

150077 Commits

Author SHA1 Message Date
Charles Wardlaw
bfa54f22ce USD Import: Added an option to import only defined prims
Prims in a UsdStage can be created directly (def) or as an over. Overs
might not always be desired at import time. This patch adds the ability
to choose whether to load only defined prims (the default behaviour, and
as it exists currently in main). By unchecking this option at import
time, prims created as overs will also be imported.

Co-authored-by: Charles Wardlaw <cwardlaw@nvidia.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/121321
2024-05-24 23:50:08 +02:00
Jacques Lucke
6b6657405f Fix #76704: resetting socket values always resets to zero instead of default value
The fundamental limitation here was that RNA did not support different default values
for the same property yet (and all sockets of the same type have the same property).
This patch solves this by adding a new callback to rna property types to retrieve a
default value dynamically. Together with the socket declarations it's fairly easy to get
this working nowadays.

This also works for group nodes, because they use the socket declaration internally too.

Pull Request: https://projects.blender.org/blender/blender/pulls/122216
2024-05-24 22:16:59 +02:00
Charles Wardlaw
a6a5fd053a USD Export: filtering option for types to export
Added option for filtering types of objects to export.  Meshes,
materials, lights, cameras, volumes, and curves are all equally
supported.

This is useful for many situations in which a user might want a
subset of objects from a Collection without wanting to build a
sub-collection or otherwise reorganize their scene.  Exporting
Armatures and their animation as UsdSkel objects and UsdSkelAnim
clips, but without meshes, is a good example.

Co-authored-by: Charles Wardlaw <cwardlaw@nvidia.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/121325
2024-05-24 22:16:43 +02:00
Sergey Sharybin
62ebc5f351 Fix Image Save operator locking when saving render result
The issue has been introduced by #122105

The image save operator does exactly the thing which was not supported by
the change and was not caught during development or view: it acquires and
releases image buffers while a render result of the Image data-block is
held acquired.

The solution is to implement a simple user-counter for the render result.
Currently it is only used by the image's render result acquire/release API,
as it is the most important case for now. The render pipeline uses its own
way of protecting the result, for which the user counter is not needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/122231
2024-05-24 20:41:08 +02:00
Sergey Sharybin
30c1e11388 Fix tests on macOS after recent debug shadow changes
Clément says its all good!
2024-05-24 20:37:00 +02:00
Julian Eisel
717389887b Cleanup: Keep panel functions internal to UI code
These were added/exposed in aa03646a74.

There's no need to expose them in the public UI API, and they don't seem
like functions that should be used outside of the UI internals.
2024-05-24 20:29:37 +02:00
Sergey Sharybin
f4a7c42255 Fix crash in viewer node with quick toggle of frame in Compositor
The issue was caused by a non-initialized ibuf_ used to set the non-color
space to. For now limit the tweaks to the image data-block, which is always
ensured. This makes it consistent with the GPU compositor which does not
have access to ibuf at the moment when the meta-data is being checked.

Ideally we do need to set the color space, but it needs to happen consistently,
and in a thread-safe manner. The way how the CPU compositor releases the
ibuf right after acquisition does not feel safe, so less we rely on it is
better.
2024-05-24 19:26:50 +02:00
Ray Molenkamp
ca0b38032c libs-windows: OIDN 2.3.0-beta 2024-05-24 10:49:47 -06:00
Clément Foucault
b96b87a75c EEVEE-Next: World: Add shadow options
This adds jitter option and filter option.
2024-05-24 18:41:18 +02:00
Clément Foucault
fb85ea535f Fix: EEVEE-Next: Broken sun soft shadows
The soft shadows were only getting blurred up to a radius
of 1 unit.
2024-05-24 18:41:18 +02:00
Clément Foucault
4c75babf03 EEVEE-Next: Shadow: Improve shadow tagging debugging
The tilemap debug mode now shows updates in the
viewport and cached pages in the bottom tilemaps.
2024-05-24 18:41:18 +02:00
Bastien Montagne
6426de4489 Core: IDManagement: Refactor how 'never unused' IDs are defined.
A few ID types are considered as 'never unused' in Blender (UI related
ones, the Libraries and the Scenes). Local IDs of this type are always
considered as used, even if no other ID links to them.

This was previously fairly weekly defined and implemented (mainly in the
writefile code and the 'tag unused' libquery functions).

This commit formalize this characteristic of ID types by adding a new
`IDTYPE_FLAGS_NEVER_UNUSED` flag, and using this in the few places in
the code that handle unused IDs.
2024-05-24 17:43:22 +02:00
Sergey Sharybin
1b18e07232 Fix #121480: Cryptomatte shows some objects as black
The issue originates to the change in default view transform from Filmic
to AgX, which does slightly different clipping, and clips color to black
if there is any negative values.

This change implements an idea of skipping view transform for viewer
node when it is connected to the Pick output of the cryptomatte node.
It actually goes a bit deeper than this and any operation can tag its
result as a non-color data, and the viewer node will respect that.
It is achieved by passing some extra meta-data along the evaluation
pipeline. For the CPU compositor it is done via MetaData, and for the
GPU compositor it is done as part of Result.

Connecting any other node in-between of viewer and Cryptomatte's Pick
will treat the result as color values, and apply color management.

Connecting Pick to the Composite output will also consider it as color,
since there is no concept of non-color-managed render result.

An alternative approaches were tested, including:

- Doing negative value clamping at the viewer node.
  It does not work for legacy cryptomatte node, as it needs to have
  access to original non-modified Pick result.

- Change the order of components, and store ID in another channel.

  Using one of other of Green or Blue channels might work for some view
  transforms, but it does not work for AgX.

  Using Alpha channel seemingly works better, but it is has different
  issues caused by the fact that display transform de-associates alpha,
  leading to over-exposed regions which are hard to see in the file from
  the report. And might lead to the similar issues as the initial report
  with other objects or view transforms.

- Use positive values in the Pick channel.

  It does make things visible, but they are all white due to the nature
  of how AgX works, making it not so useful as a result.

Pull Request: https://projects.blender.org/blender/blender/pulls/122177
2024-05-24 17:25:57 +02:00
Julian Eisel
ae7edf26ed UI: Remove Outliner element collapse chevron for empty scene elements
Scenes that have no children displayed (either because there was nothing
to display or because we didn't expand the sub-tree, such as in the
"Unused Data" display mode) would always have a chevron icon indicating
the collapsed state, but it wasn't interactive. As such it just felt
broken. This explicit exception to always draw the chevron for scene
elements was added a long time ago (13 years ago or longer), and I
couldn't find any good rationale for it.
2024-05-24 16:34:28 +02:00
Campbell Barton
97e017d89c Unbreak build from missing fmtlib reference on some systems 2024-05-25 00:32:23 +10:00
Julian Eisel
341281627d UI: Don't expand sub-trees in Outliner "Unused Data" display mode
For example scenes would make the entire collections & objects hierarchy
show up, even if these collections/objects are linked into other scenes.
So this was misleading, and from what I can tell not intentional, as a
comment in `TreeDisplayIDOrphans::build_tree()` indicates. Also
validated with Bastien.
2024-05-24 16:27:15 +02:00
Julien Duroure
1e802d971a glTF exporter: Draco: fix normalized draco accessors
Fix exporting normalized accessor with Draco enabled.
json was ok, but accessor data itself was not flagged as normalized

Pull Request: https://projects.blender.org/blender/blender/pulls/122224
2024-05-24 16:25:56 +02:00
Pratik Borhade
105463e28a GPv3: Change active node after selecting group in outliner
active element in properties panel is not updated after selecting group
from outliner. To fix this, remove the layer specific condition.
Also renamed the function for clarity.

Pull Request: https://projects.blender.org/blender/blender/pulls/121970
2024-05-24 16:22:56 +02:00
Falk David
fc2c078322 GPv3: Consider layer transform in radius_from_input_sample
The `radius_from_input_sample` function did not depend
on the layer transformation. This refactors the code a bit
and makes sure we use the right `to_world` matrix for the
transformation.
2024-05-24 16:01:34 +02:00
Clément Foucault
d15ce8dff5 Fix: EEVEE-Next: Displacement doesn't affect normal map node
While this might not always be the expected behavior,
this at least make it consistent with Cycles.

Fix #122184
Rel #122212
2024-05-24 15:35:51 +02:00
Jeroen Bakker
e5680542aa GPU: Fix GPUStateMutable size
Current size was to big (9X64 bits) when only (3X64 bits) were
needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/122214
2024-05-24 15:19:59 +02:00
Nathan Vegdahl
ec0a3e966c Refactor: Anim: make insert_key_rna() take RNAPath's instead of strings
This allows each path to optionally specify a single array index,
enabling `insert_key_rna()` to optionally insert keys for just a single
element of an array property. This will allow us to use it in more
places, and eventually reduce the total number of keying functions
needed in the code base.

PR #121879

Pull Request: https://projects.blender.org/blender/blender/pulls/121879
2024-05-24 15:06:21 +02:00
Nathan Vegdahl
8c9c88d70c RNA: add RNAPath type for conveniently storing and passing rna paths
This new type was initially motivated by a use case in the animation
code, where we want to pass RNA paths around as a string-index pair.
The final design was reached after discussion and review from Bastien
Montagne (mont29), with the aim of making the type generally useful for
many areas of Blender.

PR #121879
2024-05-24 15:06:19 +02:00
Campbell Barton
b1d98014a0 UI: replace URL icon with INTERNET for extension repository location
These aren't clickable links so the URL icon wasn't correct.
2024-05-24 22:45:02 +10:00
Campbell Barton
ae73c8aa25 UI: order "Network" after "OS Settings" in the System preferences
With the default window size this panel wasn't visible making it more
difficult to discover. Reorder since this is essential for enabling
extensions.
2024-05-24 22:45:02 +10:00
Bastien Montagne
b8a8a97440 RNA: ImageUser path: Add generic 'unresovled' for Screen-owned cases.
E.g. the Image editor can have such an ImageUser data. Ref. #122163.
2024-05-24 14:39:11 +02:00
Julien Duroure
5bf160818f glTF exporter: Cleanup: quiet warning for debug builds on startup 2024-05-24 14:33:16 +02:00
Jeroen Bakker
b6002872a1 Vulkan: Optional device extensions maintenance 4
When VK_EXT_maintenance4 extension is used at device creation its
extension should also be part of the device extension list.

This wasn't the case and would trigger UB in the validation layers.

Pull Request: https://projects.blender.org/blender/blender/pulls/122208
2024-05-24 13:39:04 +02:00
Jason Fielder
81a1570cf5 EEVEE Next: Add imageStore/LoadFast ops to Raytrace passes
Add fast image writing and reading variants for RT passes.
These variants do not perform range checking on values
and should only be used in cases where the written texel is
guaranteed to be in range. This eliminates additional
branching and simplifies shader logic.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/121117
2024-05-24 12:51:21 +02:00
Jason Fielder
f20ad70c08 EEVEE Next: Add imageStore/LoadFast ops to Renderpasses
Add fast image writing and reading variants for render passes.
These variants do not perform range checking on values
and should only be used in cases where the written texel is
guaranteed to be in range. This eliminates additional
branching and simplifies shader logic.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/121116
2024-05-24 12:41:47 +02:00
Jeroen Bakker
94e2880dfb GPU: Fix use after free in draw tests
Pull Request: https://projects.blender.org/blender/blender/pulls/122201
2024-05-24 12:36:30 +02:00
Falk David
d960b922b3 Fix #122151: Undo crash in edit mode if active node is group
This was caused by 8d8d358196
(changed the active layer to be an active node)
which overlooked the undo code.

This makes sure we save the name of the active node
in each undo step and set the active node based on this
name when decoding a step.

Pull Request: https://projects.blender.org/blender/blender/pulls/122195
2024-05-24 11:39:42 +02:00
Iliya Katueshenock
788b34649e Nodes: improve tooltip for extend-sockets
Display descriptive tooltip for this socket function in any editor.
In case of geometry nodes, there is no point to display info about
lack of value, so cleanup this.

Pull Request: https://projects.blender.org/blender/blender/pulls/121798
2024-05-24 11:39:08 +02:00
Bastien Montagne
ef8fe6a4ab Fix #122189: Unused IDs with 'extra' usages not shown in Unused Outliner view.
The only ID usages that make it a 'used' ID are its own 'fake user'
flag, and normal refcounting usages from other IDs.

This was already the behavior of the Purge operation, but the Outliner
view would still hide IDs who were only used by shallow 'extra' usages
(typically the UI, e.g. the Image Editor).
2024-05-24 11:32:42 +02:00
Bastien Montagne
63e2124aa9 Core: ID usercount macros: Add ID_REFCOUNTING_USERS.
This new macro return the actual usercount due to refcounting normal
usages of the ID.

Also document all of these 'amount of users' ID macros.
2024-05-24 11:32:42 +02:00
Falk David
4e60b96e87 Fix: GPv3: Crash in draw mode when group is active
Hovering the mouse over the 3D viewport while a layer group
was active would cause a crash if the brush radius unit was `Scene`.

This was because the `DrawingPlacement` helper expected a
layer to be passed to the constructor.

Since it's not always the case that there is an active layer, this
change makes sure that we fallback to "object space" in
the drawing placement.
2024-05-24 11:17:13 +02:00
Falk David
f011d8f508 Fix #122159: GPv3: Missing update after selecting frames in multiframe edit
The `ANIM_animdata_update` wasn't handling the GPv3 cases.
This meant that e.g. changing the selection of keyframes did not
cause an update to be triggered.

This fixes the issue by making sure we call `ANIM_list_elem_update`
for all the grease pencil channel types.

Pull Request: https://projects.blender.org/blender/blender/pulls/122167
2024-05-24 10:30:26 +02:00
Julien Duroure
4aadff7e97 glTF exporter: Fix retrieving attribute after recent merged 2024-05-24 10:22:40 +02:00
Sergey Sharybin
a7793a871b Libs: Enable threads support for FFTW library
It originally came from the Compositor work about optimizing Glare
node (#121653), but it might be used in more places later as well.

This PR only contains changes to the build system, the library
itself needs to be re-compiled.

Ref #118455

Pull Request: https://projects.blender.org/blender/blender/pulls/121816
2024-05-24 10:08:14 +02:00
Bastien Montagne
7f1a8f9956 Fix #122162: GPv3: always clamp stroke thickness to positive values for drawing.
While having negative values in the data itself seems fine (at least
there is nothing in the design forbidding it, and it was also allowed in
GPv2 data), drawing code should only accept positive values, and clamp
negative ones to zero:
  * It matches GPv2 behavior.
  * Drawing code uses negative values as some sort of 'flag' for
    rounded tips of strokes.

Note: This is a follow-up of !120840.

Co-authored-by: Falk David <falk@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/122173
2024-05-24 10:02:59 +02:00
Sergey Sharybin
6f560f8f09 Fix compilation error after recent changes in screen 2024-05-24 09:41:39 +02:00
Julien Duroure
0f0a8df8a9 glTF exporter: Option to export VC even if not used in node tree
glTF specification says that VC must be used as a base color multiplier, so you should add it to your node tree to see it.
But seems common usage of VC is to use it for custom data. Custom properties/attribute is the best place for these data,
but in order not to break production workflow/pipeline, we add an option to export active VC
2024-05-24 09:36:14 +02:00
Julien Duroure
d80a1dd5f8 glTF exporter: Fix exporter both VertexColor & colorFactor in the same time 2024-05-24 09:32:42 +02:00
Julien Duroure
f8b8a1a5b6 glTF exporter: cleanup user warnings 2024-05-24 09:30:37 +02:00
Julien Duroure
ac97907841 glTF exporter: Fix UVMap export when is set from an attribute node 2024-05-24 09:28:53 +02:00
Julien Duroure
a71027d37f glTF exporter: UDIM for merged channel textures
Was never implemented
2024-05-24 09:26:27 +02:00
Julien Duroure
c297a9513e glTF exporter: Fix material check on evaluated data 2024-05-24 09:23:36 +02:00
Julien Duroure
be96d5144a glTF exporter: Instanced collection can have regular children 2024-05-24 09:21:43 +02:00
Julien Duroure
f86fe707ce glTF exporter: Fix merge after extra anim feature merge 2024-05-24 09:19:36 +02:00
Julien Duroure
c9daea2d5b glTF exporter: Fix typo in socket name 2024-05-24 09:17:41 +02:00