Commit Graph

136509 Commits

Author SHA1 Message Date
Brecht Van Lommel
412671a765 Fix: Wrong python tag version in bpy pip package
Did not cause known issues, but better to be right.
2024-05-27 11:58:49 +02:00
Brecht Van Lommel
ef5e04c02e Fix #120181: bpy pip package not installing on macOS
Since macOS 11, the minor version should be zero. Previously 10.x were
major releases.
2024-05-27 11:58:49 +02:00
Philipp Oeser
908552e5f3 Fix #122300: F3 crash (missing null check in recent image operator poll)
Caused by own recent f93360b3bb

Pull Request: https://projects.blender.org/blender/blender/pulls/122301
2024-05-27 11:02:01 +02:00
Clément Foucault
e7fc8d5d64 Fix: EEVEE-Next: Incorect GGX reflection PDF
Fix #122291
2024-05-27 10:46:13 +02:00
Jeroen Bakker
da4f84a416 Fix: Reduce compilation warnings
Reduces compilation warnings on
- clang
- GCC < 14
- MSVC

Pull Request: https://projects.blender.org/blender/blender/pulls/122298
2024-05-27 10:30:54 +02:00
Amine Bensalem
4708e9ec6d Fix #114780: Cycles: Principled Chiang Hair importance sampling correction
Principled Chiang hair longitudinal importance sampling correction,
according to the new pbrt fix here :
https://github.com/mmp/pbrt-v3/pull/256

Pull Request: https://projects.blender.org/blender/blender/pulls/115241
2024-05-27 09:35:35 +02:00
Campbell Barton
7911e2614f Cleanup: remove redundant check in image as planes
There was a logical error in some code that didn't run,
remove the check.
2024-05-27 13:02:55 +10:00
Campbell Barton
b5003fa56c Support "Add -> Image -> Mesh Plane" as a built-in operator
Add the operator from the io_import_images_as_planes add-on,
making it a built-in operator.

The main differences with the add-on are:

- Compositor integration has been removed.
- The file handler for dropping images has been removed
  to avoid a popup whenever images are dropped onto Blender.

There were also changes to follow Blender's core scripts more closely:

- Defer imports where possible.
- Use `str.format`.
- Use double-quotes for non-enum strings.
- Remove or "_" prefix unused arguments.
- Avoid unnecessary use back-slashes for wrapping lines.

Otherwise all other functionality has been kept.

Ref !122223

Co-authored-by: Aaron Carlisle <carlisle.b3d@gmail.com>
Co-authored-by: Bastien Montagne <bastien@blender.org>
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Co-authored-by: Brendon Murphy <meta.androcto1@gmail.com>
Co-authored-by: CoDEmanX <codemanx@gmx.de>
Co-authored-by: Dalai Felinto <dalai@blender.org>
Co-authored-by: Damien Picard <dam.pic@free.fr>
Co-authored-by: Daniel Salazar <zanqdo@gmail.com>
Co-authored-by: Florian Meyer <florianfelix@web.de>
Co-authored-by: Jacques Lucke <mail@jlucke.com>
Co-authored-by: Jesse Yurkovich <jesse.y@gmail.com>
Co-authored-by: Jonathan Smith <j.jaydez@gmail.com>
Co-authored-by: Luca Bonavita <mindrones@gmail.com>
Co-authored-by: meta-androcto <meta.androcto1@gmail.com>
Co-authored-by: Philipp Oeser <info@graphics-engineer.com>
Co-authored-by: Pratik Borhade <pratikborhade302@gmail.com>
Co-authored-by: Rick Astley <mrbimax>
Co-authored-by: Sergey Sharybin <sergey@blender.org>
Co-authored-by: Sibo Van Gool <SiboVG>
Co-authored-by: Sun Kim <perplexing.sun@gmail.com>
Co-authored-by: Thomas Dinges <blender@dingto.org>
Co-authored-by: Victor Chedeville <victor-09@noreply.localhost>
2024-05-27 12:42:36 +10:00
Campbell Barton
580ddfbd4b Cleanup: remove outdated reference to "derived" mesh 2024-05-27 12:08:22 +10:00
Campbell Barton
52d34d1a44 Cleanup: spelling in comments 2024-05-27 12:07:03 +10:00
Campbell Barton
db58cde877 Cleanup: suppress template-id-cdtor GCC warnings
Ignoring from CMake didn't suppress the warnings from GPU sources
that include this header. Suppress the warning using a pragma instead.
2024-05-27 11:58:46 +10:00
Clément Foucault
c3b985906d Cleanup: EEVEE-Next: Remove leftover debug printf
It was never meant to be commited.
2024-05-26 22:11:01 +02:00
Jesse Yurkovich
91ad904cca Cleanup: make format 2024-05-26 21:33:28 +02:00
Clément Foucault
0e11f168db EEVEE-Next: Expose Fast GI ray and step count
This allow to reduce the amount of noise and reduce
the lost energy caused by low thickness and large
stride (low sample count).

Actual number of rays is twice the UI count.
2024-05-26 20:23:42 +02:00
Clément Foucault
eaf1454475 EEVEE-Next: UI: Move simplify panel just before post processes
Follow Cycles order.
2024-05-26 19:33:45 +02:00
Clément Foucault
e323a7d391 EEVEE-Next: UI: Rename Horizon Scan to Fast GI approximation
This matches Cycles feature name and is less technical.
2024-05-26 19:29:15 +02:00
Clément Foucault
fbeb4b5914 Fix: EEVEE-Next: Light transmission influence is 0 in startup file
Was just missing the versionning code for it.
2024-05-26 19:01:48 +02:00
Clément Foucault
9f2f1a5c57 EEVEE-Next: Shadow: Remove per light resolution scale
The reasonning is that we already have a resolution limit
slider per light.

The global shadow resolution scale is usefull as a quick
speedup option to reduce shadow cost for viewport regular
work or for quick rendering. For final render, the per
light resolution limit is more suited  than a LOD scale
since it doesn't modify the filtering of based on distance
from the camera.

This feature is really not hard to add back if there is
a compelling use case for it.
2024-05-26 18:56:03 +02:00
Clément Foucault
4bc015310f Fix: EEVEE-Next: Fix broken shadow global resolution scale
It was not connected to anything.
2024-05-26 18:27:18 +02:00
Iliya Katueshenock
4fc8a72780 Fix: correct offset for internal multi-input link
Pull Request: https://projects.blender.org/blender/blender/pulls/109776
2024-05-26 13:37:52 +02:00
Clément Foucault
03bcd70cd1 EEVEE-Next: Improve shadow map filter
This make the filter have a constant width in shadow
space making sure to always filter the correct amount
of pixels.

This uses the receiver slope to put the samples on a
cone with its apex at the shading position instead of
setting up the disk in shading tangent space.

We limit the slope bias to 45 degrees and offset the
cone in normal direction if the angle between light and
receiver is greater than 45 degrees. This avoid any
self shadowing artifacts cause by this technique.

Pull Request: https://projects.blender.org/blender/blender/pulls/122266
2024-05-26 12:53:18 +02:00
Philipp Oeser
f93360b3bb Fix: dont allow image operations on non-editable images
Non-editable is mostly linked (besides some incoming exception for the
Brush Asset project).
If the Image is linked but not packed, conceptually it does not really
make a difference (edits for a linked vs local image would still end up
in the same external file when saved). However when it is linked and
packed we are running into Undo crashes (#122131). Also the image
remains linked, so data remains to be read/loaded from the packed
version from the library (so any edits are lost).

For consistency, disallow image operations for all non-editable images.

ref. #122131
ref. #122033

Pull Request: https://projects.blender.org/blender/blender/pulls/122209
2024-05-26 11:32:50 +02:00
Philipp Oeser
a65df02031 Fix: Dont unpack resources that are packed in linked files (next round)
These remain linked, so data remains to be read/loaded from the packed
version from the library (making this a useless and wasteful
duplication, also changes could be perceived as lost)

Continuation of !122092 which came up in #122033 -- but spread to more
operators / API so it is consistent everywhere

For operators, first intuition was to do it in a poll function, but that
isnt possible because the actual ID might depend on a given (to the
operator) ID name.

NOTE: Still not 100% in which scenarios linked data could still be
editable, but using ID_IS_EDITABLE for this now.

c6aa1fec2b / 918d34a9ed are related

Pull Request: https://projects.blender.org/blender/blender/pulls/122204
2024-05-26 11:32:06 +02:00
Philipp Oeser
9c534cda00 Fix: Still allow unpacking of editable linked datablocks
Similar to 918d34a9ed, enable the button in `template_ID()`

Ref #122092

Pull Request: https://projects.blender.org/blender/blender/pulls/122199
2024-05-26 11:30:56 +02:00
Clément Foucault
4624b1a9ae Cleanup: EEVEE-Next: Group BSDF functions to per BSDF type files
The goal of this is to make it easier to add more BSDF
support in the future. Avoids code fragmentation and
allows easy entry points to all algorithms using BSDFs.

Pull Request: https://projects.blender.org/blender/blender/pulls/122255
2024-05-25 23:40:12 +02:00
Jesse Yurkovich
9daded5d87 USD: Use nodes for alpha-clip behavior instead of material properties
EEVEE-next has removed the MA_BM_CLIP / alpha_threshold material
properties in favor of using nodes for equivalent functionality. This
changes USD to build and traverse node graphs during import and export
accordingly. Indirectly this allows Cycles to correctly render such
materials now too.

A complicating factor is that the UsdPreviewSurface defines its opacity
threshold using greater-than-equals[1], which Blender does not support
(and for which was technically already incorrect as EEVEE-legacy only
used greater-than for its shaders). Due to this we actually need to use
2 nodes: A less-than, followed by a one-minus invert, to arrive at the
proper value. We'll translate UsdPreviewSurface to this form on Import.

For Export we will look for either this 2-node pattern or a Round
node plugged into Alpha. Looking for Round is a result of the glTF
documentation which recommended the use of this node for thresholds of
0.5[2]. It's a tiny addition that seems reasonable to accommodate.

[1] https://openusd.org/release/spec_usdpreviewsurface.html (search for "opacityThreshold")
[2] https://docs.blender.org/manual/en/4.2/addons/import_export/scene_gltf2.html#alpha-modes

See PR for example images

Pull Request: https://projects.blender.org/blender/blender/pulls/122025
2024-05-25 23:30:13 +02:00
Jesse Yurkovich
21db0daa4e USD: Read and write custom attributes for Curves
Add support for reading and writing custom `Curves` attributes.

This allows us to roundtrip Blender's Hair grooms containing UVs and
other attribute data. Note that animated attribute values are not
supported with this change.

This will also address #120042

Pull Request: https://projects.blender.org/blender/blender/pulls/121928
2024-05-25 22:23:40 +02:00
Hans Goudey
d3dbd7bdd0 Cleanup: Slightly simplify crazyspace quats loop
- Use "vert" in variable names instead of "i"
- Declare variables where their values are assigned
- Use float3 instead of pointers
- Avoid empty checks in loop by assigning span differently
2024-05-25 10:41:07 -04:00
Iliya Katueshenock
10befe6de7 Fix: Nodes: Assert on node copy
Fix of issue after fac97d6c49.
If node have dynamic declaration, update of node cause update of the declaration and its sockets.
So, links update have to be in separate loop.

Pull Request: https://projects.blender.org/blender/blender/pulls/122261
2024-05-25 14:55:15 +02:00
Pratik Borhade
200cf730d8 Fix #122241: Apply selected as rest pose not working
Mistake in acd1b0b7f9
This is due to early return from the operator execution when selection
exists.

Thanks @Ruri-Res for finding it.

Pull Request: https://projects.blender.org/blender/blender/pulls/122254
2024-05-25 11:20:28 +02:00
Charles Wardlaw
b2d1979882 USD Export: option to triangulate meshes
This allows for the source of truth data in the Blender scene to remain
untouched while producing triangulated output suitable for game and VR
pipelines, where only triangles are ingested. This addition aligns USD
with some of the other exporters which offer a similar feature.

Co-authored-by: Charles Wardlaw <cwardlaw@nvidia.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/121274
2024-05-25 03:47:35 +02:00
Lukas Stockner
896ef010f6 Fix #122031: Cycles: OSL implementation of Thin Film is missing 2024-05-24 23:55:12 +02:00
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