Commit Graph

101796 Commits

Author SHA1 Message Date
Clément Foucault
983ff8e616 GPU: Framebuffer: Add multi viewport support
This add the possibility to define different
viewports inside a single framebuffer and
let the vertex shader decide which viewport
to render to.

This only contain the GL and VK implementation.
The Vulkan implementation works but still
has a validation error related to shader features
and extension. The test passes nonetheless.

Pull Request: https://projects.blender.org/blender/blender/pulls/110923
2023-08-08 17:12:49 +02:00
Bastien Montagne
e1b1b2a8b4 Fix (unreported) collection 'readfile' expand incorrect assertion.
Naming is bad and confusing, but the 'expander' code path from readfile
can also be used outside of the reading context (see e.g.
`BKE_blendfile_write_partial` code). So code cannot assume that it is
exclusively working on data freshly read from file.

This should be renamed - but should also be probably replaced by
proper usage of the more generic 'foreach_id' code anyway, see #105134.

Found while investigating #109588.
2023-08-08 15:55:17 +02:00
Bastien Montagne
5dfd3e3c28 Fix (unreported) missing handling of ViewLayer IDProperties in foreach_id code.
Yet another 'obviously' missing bit in foreach_id processing found and fixed.
2023-08-08 15:24:20 +02:00
Hoshinova
b880485492 Nodes: add Floored Modulo mode to Math nodes
Both the `Math` node and the `Vector Math` currently only explicitly
support modulo using truncated division which is oftentimes not the
type of modulo desired as it behaves differently for negative numbers
and positive numbers.

Floored Modulo can be created by either using the `Wrap` operation or
a combination of multiple `Math` nodes. However both methods obfuscate
the actual intend of the artist and the math operation that is actually
used.

This patch adds modulo using floored division to the scalar `Math` node,
explicitly stating the intended math operation and renames the already
existing `"Modulo"` operation to `"Truncated Modulo"` to avoid confusion.
Only the ui name is changed, so this should not break compatibility.

Pull Request: https://projects.blender.org/blender/blender/pulls/110728
2023-08-08 12:13:00 +02:00
Pratik Borhade
6e66125f34 GPv3: New is_layer_active function
New Grease Pencil function to determine whether the layer
is active.

Pull Request: https://projects.blender.org/blender/blender/pulls/110890
2023-08-08 11:26:22 +02:00
Philipp Oeser
12ef20990b Fix #103410: name collisions between vertex groups and attributes
These name collisions should be avoided with attributes, all sorts of
issues can arise from those. We already warned in the attributes
(but not the vertex groups) list if those were found.

Previously, creating a vertex group with the same name as an already
existing attribute would allow this (and give said warning), and creating
an attribute with the same name as an already existing vertex group
would silently fail (as in: not return a layer) -- and then due to an oversight
in 101d04f41f (which assumed a valid layer would always be returned
by `BKE_id_attribute_new`) would even crash.

Now name collisions between vertex groups and attributes are avoided,
unique names will be found across attributes and vertex groups if either
`BKE_id_attribute_calc_unique_name` or `BKE_object_defgroup_unique_name`
is called.

This is done by unifying the checks and callbacks for both into a single.

Pull Request: https://projects.blender.org/blender/blender/pulls/109910
2023-08-08 10:11:10 +02:00
Michael Kowalski
ecb3262bf0 USD export: prototype invoking Python chasers
This commit allows invoking user-defined Python 'hook' functions to extend
the USD export functionality.

Added support for registering subclasses of a new bpy.types.USDHook
type which may implement the hooks as member functions.  Supported
hook functions are on_export() and on_material_export().  Also added
definitions and Python registration for USDSceneExportContext and
USDMaterialExportContext structs that encapsulate arguments
to these functions.

Pull Request: https://projects.blender.org/blender/blender/pulls/108823
2023-08-07 23:02:47 +02:00
ok_what
5f0a8759b0 VSE: Improve drawing of strip title and preview
This patch includes set of smaller changes to address visual
inconsistencies and bugs:

- Strip previews are drawn under title bar
- All strip previews now disappear when there isn't enough space for
  drawing
- Like the sound strip, the color strip expands to fill the whole strip
  when there is little vertical space, "taking over" the strip title
  Color is more important visual indicator than the name of the strip
- Disabling strip title no longer disables strip handle frame previews
- All strip previews are now be affected by the "Show overlays" toggle
- Turning off strip text overlay no longer makes the color strip
  preview disappear
2023-08-07 21:35:45 +02:00
Germano Cavalcante
04a07d5e08 Fix #110821: Tracker resizing with S+S also resizes search area
Regression caused by 03f17c42d0

In that commit it was assumed that the hotkey modifier `S` had no
influence if we were already resizing.

But this is not the case in tracking. The second `S` has influence and
should not be filtered.

The solution is to add a conditional only to Trackers transformation.

This commit also fixed the canceling of this transformation which did
not revert the search area to its original value.
2023-08-07 15:13:05 -03:00
Bastien Montagne
9e7e0a01b2 LibOverride: Fix persistent override property in some RNA pointer cases.
When the override property over a non-ID RNA pointer is not needed
anymore, remove it.

This case is a bit special, because the match does (potentially) detect
differences within the RNA structures pointed to by the property, yet
there should be no override rule for the property itself.
An override rule may have been created in a previous diffing if one of
the RNA pointers was null.

Note that while fairly rare, this is not a corner-case, as it affects at
least one (very common) RNA pointer: the 'animation_data' one.

This left-over rule (created when the liboverride is animated, while the
linked reference data would have no anim data, and becoming useless once
both have anim data) was harmless so far, but would become a problem
with up-coming changes related to #110067.
2023-08-07 18:43:11 +02:00
Bastien Montagne
d9ec3985a3 LibOverride: Remove an override property when it has no operations.
Update #BKE_lib_override_library_id_unused_cleanup to also clear the
property when all its operations have been removed, even if the
property itself was not tagged as unused.
2023-08-07 18:41:19 +02:00
Habib Gahbiche
2f907a0b53 Cleanup: Compositor: Remove outdated TODO
Done in #108858 but comment was not removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/110856
2023-08-07 18:29:59 +02:00
Brecht Van Lommel
803b541307 Fix OpenImageIO thread pool not following -t command line option
We do this for the OpenEXR thread pool as well. Needed until OIIO fully
switches over to TBB.

Pull Request: https://projects.blender.org/blender/blender/pulls/110501
2023-08-07 18:19:33 +02:00
Brecht Van Lommel
03530d3d48 Hydra: export USD preview surface for materials
Sharing code with USD export, as a step towards making Hydra and USD more
consistent. Upcoming USD hooks will provide more control over material
export rather than always using preview surface.

Ref #110765

Pull Request: https://projects.blender.org/blender/blender/pulls/110836
2023-08-07 16:22:17 +02:00
Brecht Van Lommel
8ff98504ea Refactor: add single entry point for creating USD materials
To be used by both USD and Hydra.
2023-08-07 16:21:08 +02:00
Brecht Van Lommel
6e4b1f78cd Refactor: move default initialization of USDExportParams to definition
Matching the default file export settings.
2023-08-07 16:20:05 +02:00
Brecht Van Lommel
288fe44d4c Refactor: move USD hierarchy iterator out of export context
With goal of using this context in Hydra where there is no hierachy iterator.
2023-08-07 16:20:05 +02:00
Amelie Fondevilla
242e94acec GPv3: Fix floating-point error in the hard eraser tool.
The hard eraser tool was not working properly when trying to erase closely to existing points, leading either to the insertion of various close points in the stroke, or to deleting a whole stroke segment.

This was due to the differenciation between the computation of the intersections between the eraser and the stroke, and the computation of whether a point lie inside the eraser, which lead to inconsistencies in the interpretation of the result.

This patch solves this issue by  :
 * computing if the point is inside the eraser based on the result of the intersection, to avoid unconsistencies,
 * computing with integers and not float (we are in screen space anyways),
 * adding the ability for source points to be cuts, and not only the inner intersections.

Pull Request: https://projects.blender.org/blender/blender/pulls/110801
2023-08-07 15:11:34 +02:00
Jeroen Bakker
8de4b5a5ed Vulkan: Shader Compilation Errors
Fixing several shader compilation errors when using the vulkan backend.

* `eevee_lightprobe_irradiance_load_comp`: local variables used same name as push constants.
* `compositor_summed_area_table_compute_complete_y_prologues`: loop with texture_size call

Pull Request: https://projects.blender.org/blender/blender/pulls/110891
2023-08-07 14:49:08 +02:00
Jeroen Bakker
6273a2dca4 GPU: Disable Multi-Bindings for AMD Official Drivers
AMD official driver reports that they support multi-bindings, but
in the cases we are using it it fails. This is noticable in Eevee-
next where the shadows aren't rendered.

This fix disables multi-bindings for images for AMD Official drivers
n all OS's. Textures will still use multi-bindings.

Pull Request: https://projects.blender.org/blender/blender/pulls/110882
2023-08-07 14:47:46 +02:00
Campbell Barton
0f120b6364 Fix hydra API, incorrect Python API handling of invalid arguments
Exceptions must return nullptr, not None.
2023-08-07 22:10:35 +10:00
Campbell Barton
b086bd411e Cleanup: use listbase macros 2023-08-07 22:02:19 +10:00
Campbell Barton
ae4286d12b Cleanup: function style casts for C++, nullptr & other minor changes 2023-08-07 22:02:15 +10:00
Nathan Vegdahl
d4d0daa934 Fix #110169: nearly flat normalized fcurves jump around in editor
The root cause was a classic fixed-size epsilon issue.  The code that
checked if an fcurve was effectively flat, and thus shouldn't be
normalized, used a fixed-size epsilon that was reasonable for values
close-ish to zero, but didn't work well for values >= 1.0.

This patch addresses the issue by introducing a new function
`ulp_diff_ff()` that robustly computes the number of floating point
steps between two floats, and using that to ensure that a minimum
number of representable floats exist between the min/max values
of the curve.  This approach scales appropriately up and down to
both huge and tiny values.

This patch also updates the existing `compare_ff_relative()` function
to use the new robust ulps code for the ulps-based part of its
comparison, resolving an issue documented in its unit tests where
it behaved poorly for values close to zero.

Pull Request: https://projects.blender.org/blender/blender/pulls/110796
2023-08-07 10:53:01 +02:00
Lukas Tönne
14bc097015 Nodes: Remove the experimental "node panels" feature
This feature is going to be replaced with a more thorough refactoring
of the node group interface UI, which has actual node drawing support
and a new API for integration of panels into nodes.

Design task: #109135
Implementation: #110272

Pull Request: https://projects.blender.org/blender/blender/pulls/110803
2023-08-07 10:40:29 +02:00
Bastien Montagne
f32f775e5b Fix (unreported) missing 'need resync' detection in overrides of overrides.
In case the reference data of a liboverride is aslo a liboverride, and
is already tagged for resync, the override of the override also needs to
be resynced.

Note that linked overrides are guaranteed to be processed by apply code
(and hence get checked for needed resync) before the liboverrides using
them.
2023-08-06 23:11:18 +02:00
Clément Foucault
cc34a0ae2e EEVEE-Next: Irradiance Volume: Allow object copy
This copies the baked lighting data during object
duplication. This allows library overrides to
work as expected on irradiance volumes.
2023-08-06 21:30:30 +02:00
Clément Foucault
453cc9b84a EEVEE-Next: Irradiance Pool Size
Add pool size to allow predictable memory
footprint.
2023-08-06 20:30:08 +02:00
Clément Foucault
5d2e351baf EEVEE-Next: Irradiance Grid Compositing
This allows irradiance volume that have less priority to
transfer lighting to the ones with higher priority.
Meaning interactive relighting from the world or
lookdev HDRI is now supported if the world isn't baked
inside the volume data.

This should improve workflow with larger scenes and
interactivity with light setups.

To help setup with dynamic objects, this patch introduce
3 new parameter to remove some components from the
irradiance grids.

Pull Request: https://projects.blender.org/blender/blender/pulls/110838
2023-08-06 16:30:12 +02:00
Clément Foucault
5ac026c23a EEVEE-Next: Irradiance Volume validity weighting
This avoid samples inside walls to contribute to
the interpolated lighting. This help preventing
light leaking.

Pull Request: https://projects.blender.org/blender/blender/pulls/110851
2023-08-06 13:43:17 +02:00
Campbell Barton
8b8fe49d34 License headers: add SPDX-FileCopyrightText 2023-08-06 18:59:05 +10:00
Campbell Barton
845a5146e7 Cleanup: avoid term '_len' for buffer size 2023-08-06 16:09:04 +10:00
Campbell Barton
9e3dc02bed Cleanup: naming consistency for find functions
- find_from_name -> find_by_name.
- find_from_index -> find_index.

This matches naming used elsewhere in Blender API's.
2023-08-06 15:57:24 +10:00
Campbell Barton
0701c65d93 Cleanup: use DNA_struct_default_alloc utility function, doxy section 2023-08-06 15:47:50 +10:00
Clément Foucault
d870f9e841 EEVEE-Next: Add back visibility group for irradiance volumes 2023-08-05 20:23:38 +02:00
Clément Foucault
46a17df415 Fix EEVEE-Next: Incorrect Irradiance Volume sorting
`world_to_grid_transposed` contains the resolution of
the grid and is also transposed which isn't what we
need for computing the volume.
2023-08-05 19:47:16 +02:00
Campbell Barton
b879a4f2d8 Cleanup: replace MEM_callocN with MEM_mallocN when overwritten afterward
Also pair allocation with memcpy calls.
2023-08-05 20:06:42 +10:00
Jacques Lucke
9150f6d1a9 BLI: refactor string search to use C++ API
The API becomes much simpler by using C++. Also, it removes the need
for manual memory management.

Pull Request: https://projects.blender.org/blender/blender/pulls/110826
2023-08-05 10:54:23 +02:00
Jacques Lucke
b41c6489bc Cleanup: set node struct ui names at run-time
The goal is to get to closer to removing `NOD_static_types.h` and to define all/most
aspects of a node in the node file itself instead. Data defined in node files is not
available when rna structs are created currently, because that happens in a preprocessing
step. This patch moves part of what was defined in `rna_nodetree.cc` to `node.cc` which
makes it easier to replace when `NOD_static_types.h` is removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/110824
2023-08-05 09:12:27 +02:00
Jacques Lucke
4719caf660 Cleanup: move BLI_string_search.h to C++ 2023-08-05 08:52:29 +02:00
Jacques Lucke
607d203b98 Cleanup: fix compilation errors and warnings 2023-08-05 08:31:31 +02:00
Campbell Barton
a81063e4a1 Cleanup: use const mtex for TexCallData & multitex_* functions 2023-08-05 14:26:29 +10:00
Campbell Barton
bf2b1f7e01 Cleanup: simplify enum typedefs 2023-08-05 14:22:48 +10:00
Campbell Barton
a86ef5d3f6 Cleanup: minor changes to logic that shows render window
- Rename find_area_showing_r_result -> *find_area_showing_render_result.
- Only set the return window argument when the render area is found
  instead of leaving this value set to the last window.
- Use doxygen sections.
2023-08-05 14:05:43 +10:00
Campbell Barton
9ea8477c23 Cleanup: various non-functional C++ changes 2023-08-05 13:57:29 +10:00
Campbell Barton
7f34ad736a Cleanup: spelling in comments 2023-08-05 13:54:25 +10:00
Hans Goudey
07019e7ef5 Cleanup: Remove more struct keywords from C++ headers 2023-08-04 22:47:29 -04:00
Campbell Barton
7e06454663 Fix build error from references to unknown types 2023-08-05 12:23:01 +10:00
Hans Goudey
88de2f25ed Cleanup: Remove unnecessary struct keyword from editors includes 2023-08-04 22:15:25 -04:00
Hans Goudey
ffe4fbe832 Cleanup: Move editors headers to C++
See #103343

Pull Request: https://projects.blender.org/blender/blender/pulls/110820
2023-08-05 02:57:52 +02:00