Commit Graph

132398 Commits

Author SHA1 Message Date
Harley Acheson d7593c8845 UI: Multiple Interface Icon Additions and Changes
Additional icons for face corner, pointcloud points needed for general
usage. Unselected camera, view locked, and view unlocked for #111076.
Changes to mod_mask for #117467. pointcloud_data changed only for
alignment change. Running Update Icons also changed mod_explode.

Pull Request: https://projects.blender.org/blender/blender/pulls/117732
2024-02-01 20:08:26 +01:00
Hans Goudey 5155feeeb8 Cleanup: UI: Remove a1 and a2 unused arguments from uiDefButF function
These were removed in previous commits like e6f0b60c2e.
2024-02-01 13:09:09 -05:00
Hans Goudey 1a0214471b Fix: Missing translation for asset catalog tooltip
Also remove an unnecessary c_str() call.
2024-02-01 13:09:04 -05:00
Hans Goudey 809499a3d0 Refactor: UI: Use derived struct for number slider buttons
Similar to d204830107. This is the last real use of
the a1 and a2 arguments for many button definition functions.
2024-02-01 13:08:50 -05:00
Eugene Kuznetsov 4024614ecc Fix: correctly set active/render UV maps when realizing instances
As currently implemented, Blender sometimes incorrectly sets active/render
UV maps during the "realize instances" operation. This also comes into play
if you try to modify the mesh with geonodes: e.g., if you use geonodes to
split a mesh into two pieces, transform one of them, and then "join geometry",
join operation internally performs "realize instances", triggering the same bug.

The root cause is that "realize instances" copies both UV map layers and the
active/render layer index, but it reorders layers during this process, so the index
that was correct in the original mesh is now wrong in the modified mesh.

This patch corrects indexes by explicitly checking layer names.

Pull Request: https://projects.blender.org/blender/blender/pulls/116452
2024-02-01 19:07:43 +01:00
Philipp Oeser 3d60209d3d Add an optional "frame" & "tile_index" argument to Image.scale()
`BKE_image_scale` -- which is only used for the python API -- was
getting the `ImBuf` without providing an `ImageUser`.
This is fine, but always gets the first tile (and the current frame for sequences).

To resolve this, add an optional "frame" & "tile_index" argument so these can be specified explicitly (similar to layer_index and pass_index already used for some other API functions).

Fixes #117539 : Scaling UDIM images via Image.scale() only scales one tile

Pull Request: https://projects.blender.org/blender/blender/pulls/117549
2024-02-01 17:28:38 +01:00
Miguel Pozo 5d132ac0c6 GPU: Optimize OpenGL indirect drawing overhead
`GLBatch::draw_indirect` has additional overhead compared to
`GLBatch::draw`, and can become a bottleneck in scenes that require
many draw calls (ie. with too many unique meshes).

The performance difference is almost exclusively caused by the
`GL_COMMAND_BARRIER_BIT` barrier that happens on every call.

This PR adds a `GPU_storagebuf_sync_as_indirect_buffer` function that
can be used to place the barrier only once after filling the indirect
buffer content.
This function is a no-op in Vulkan and Metal since they don't need the
barrier.

Pull Request: https://projects.blender.org/blender/blender/pulls/117561
2024-02-01 17:26:08 +01:00
Jun Mizutani 8ecc654788 UI: Preferences: Sort widget label style settings
Sort Text Style settings hierarchically:

1. Panel Title
2. Widget Label
3. Widget

Pull Request: https://projects.blender.org/blender/blender/pulls/113990
2024-02-01 17:25:28 +01:00
Ray Molenkamp cf4365e555 CMake: Disable unity builds on cmake 2.28.2
CMake 2.28.2 has a regression that breaks the combination of
precompiled headers and unity builds [1]. Disable unity builds
for this specific cmake version to sidestep the issue.

[1] https://gitlab.kitware.com/cmake/cmake/-/issues/25650
2024-02-01 09:09:20 -07:00
Hans Goudey dccf0e8699 Cleanup: Move GPU_material.h to C++ 2024-02-01 10:40:30 -05:00
Aras Pranckevicius 691512b9ce Fix: build failure with WITH_UNITY_BUILD=OFF
Started with 1b6e3d46a
2024-02-01 17:33:28 +02:00
Falk David 898ff6ceee Revert "GPv3: Array modifier"
This reverts commit e1ce3c3cc7.
2024-02-01 16:18:13 +01:00
Christoph Lendenfeld b2aa36485b Fix: Regression of Python API for anim.keyframe_insert
Caused by #113504

The `type` property has been removed from the operator,
but of course that is a breaking change in 4.1.
(e.g. reported here: #117547)

At the time of making the patch,
I wasn't sure how to handle all cases but it turns out its not complicated.
I've added back the property with the following logic.

* Try to get the `KeyingSet` from the `type`.

* `type` defaults to 0 which means the `ANIM_keyingset_get_from_enum_type`
will get it from the scene.

* If the scene doesn't have one, or a valid index isn't passed in the `KeyingSet`
will be a `nullptr` in which case it inserts from the user preferences.

Pull Request: https://projects.blender.org/blender/blender/pulls/117718
2024-02-01 16:14:05 +01:00
Jeroen Bakker 24bc2fef1d GPU: Disable Unsupported OpenGL test cases.
Some test cases are not support when used with the OpenGL backend. These
test cases are easier to support when using Vulkan as we do control the
GPU->CPU data conversion logic.

We remove the test cases that aren't working yet for any backend and
skip test cases where OpenGL support is failing.
2024-02-01 16:13:18 +01:00
YimingWu e1ce3c3cc7 GPv3: Array modifier
Grease Pencil Array modifier migrated to GPv3.

All features now working as expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/117722
2024-02-01 15:58:53 +01:00
Ashley Ruglys fcd10ee33a USD: PointInstancer import support
Added support for static point instancing import.

Added a new USDPointInstancerReader class to import UsdGeomPointInstancer
primitives as Point Clouds with geometry node modifiers that use
Instance on Points geometry nodes to instance collections containing
prototype geometry.

Added logic to the USDStageReader class to traverse the USD stage to
create readers for point instancer prototypes.

Extended USDStageReader::collect_readers() to take arguments to include
undefined prims and to exclude a set of specified prims when traversing
the stage.  Allowing traversing undefined prims is necessary because
prototype prims may be specified as "overs" in the USD stage.

Added a USDPrimReader::is_in_instancer_proto_ boolean flag which
identifies readers of prims that are in point instancer prototypes.
The flag simplifies management of collections and is used to
determine whether global transforms should be applied to root objects.

Limitation: point cloud animation is not yet supported.

This partially addresses https://projects.blender.org/blender/blender/issues/96747.

Co-authored-by: Michael Kowalski <makowalski@nvidia.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/113107
2024-02-01 15:37:43 +01:00
Jacques Lucke 153caeff4d Geometry Nodes: simplify default label in zone nodes
This removes the "Input" and "Output" part of the default label in the
simulation and repeat zone. The outline already makes it very obvious
which one is the input and which one the output. Simplifying the label
makes the zone look prettier. It might also simplify naming other zones
(like for-each zone) in the future, because the name is shorter.

Pull Request: https://projects.blender.org/blender/blender/pulls/117724
2024-02-01 15:20:05 +01:00
Sybren A. Stüvel fd7fcb2cdc Fix #117720: Crash when selecting these two armatures
Properly wrap a returned `char *` that could be `nullptr` into an
`std::optional<std::string>`. `std::string` doesn't like `nullptr`.

Another problem was that the wrapped `char *` was actually allocated on
the heap, and not freed after conversion to a `std::string`, causing
memory leaks.
2024-02-01 14:53:35 +01:00
Sybren A. Stüvel dc40d7b5d7 Cleanup: RNA, do early return in `RNA_path_from_struct_to_idproperty`
Having an early return makes the precondition check an actual precondition
check. This will make an upcoming change easier to implement.

No functional changes.
2024-02-01 14:49:08 +01:00
Sybren A. Stüvel 35317749e0 Depsgraph: add explanation to `evaluated_get` RNA function
Extend the `ID.evaluated_get()` docstring to explain that it does not
trigger a re-evaluation of the data-block.

No functional changes, just expansion of documentation.
2024-02-01 14:49:08 +01:00
Sergey Sharybin 71253e1bb0 Fix Cycles baking forcing denoising of combined pass
This is mistake in the PR #117483

Simple solution: make the pass configuration logic to only disable
denoising, and never allow to enable it.

Pull Request: https://projects.blender.org/blender/blender/pulls/117723
2024-02-01 14:40:50 +01:00
Hans Goudey f4867c0d70 Geometry Nodes: Add Rotate Rotation node
This is meant as a replacement for the Rotate Euler node. Overall it
should be more performant, and the clarity given by the separate socket
type should help distinguish its purpose.

The Rotate Euler node is removed from search and the add menu by this
commit. In the future it can be versioned away. That isn't done now to
avoid a breaking API change and to make this commit less risky.

Pull Request: https://projects.blender.org/blender/blender/pulls/116106
2024-02-01 14:29:30 +01:00
Jeroen Bakker efc37b2573 GPU: Fixed Assert when running Specialization Constants test
Specialization constants tests use points render primitives, but the
shader isn't capable of point rendering. For the test results it doesn't
matter as it only validates the vertex output, but it would trigger an
assert when using Vulkan backend. The vulkan backend is more strict and
currently signals these common errors.
2024-02-01 14:28:02 +01:00
Jeroen Bakker 2f30d220fb Draw: Fix 'draw_resource_id_gen' test
The test uses a none points shader to draw points, which is incorrect
and asserts when using Vulkan. It also didn't test the gpu part of the
pipeline (PassMain).

When using PassMain the order of the resources are expected to be
different as the draw calls are ordered based on the primitive type and
handles.

Pull Request: https://projects.blender.org/blender/blender/pulls/117714
2024-02-01 14:10:51 +01:00
Jacques Lucke dbe2c2707c Geometry Nodes: extract separate geometry code to separate file 2024-02-01 13:33:06 +01:00
Jacques Lucke fcc17780a8 Geometry Nodes: extract geometry transform functions to separate file 2024-02-01 13:18:39 +01:00
casey bianco-davis 1b6e3d46a9 GPv3: Add `stroke_reorder` operator
This implements the `stroke_arrange` operator for grease pencil v3.
This behaves the same as `GPENCIL_OT_stroke_arrange` but renamed to `stroke_reorder`.
It should be more clear what the operator does.

Note: This also adds new key binds.

Co-authored-by: Falk David <filedescriptor@noreply.localhost>
Pull Request: https://projects.blender.org/blender/blender/pulls/116682
2024-02-01 13:15:23 +01:00
Jacques Lucke 7042db684f Cleanup: move some geometry field inputs to more correct header 2024-02-01 12:43:39 +01:00
Campbell Barton c9ad858d9d Extensions: update manifest to bl_info conversion
Update extension to bl_info conversion to account for recent changes.
2024-02-01 22:42:24 +11:00
Clément Foucault 4ea9d75b45 Fix: EEVEE-Next: Unitialized variable in denoise temporal
The wrong member was initialized.
Also fix the broken center sample initialization which
was in the wrong color-space.
2024-02-01 12:26:29 +01:00
Clément Foucault 581c6e9f1f Cleanup: GPU: Fix shader builder compilation warning
The function signature changed recently.
2024-02-01 12:10:06 +01:00
Jeroen Bakker 97852056b2 Cleanup: Incorrect Parameter Order for Expect
The expect and actual parameters were switched in eevee_surfel_list.
2024-02-01 12:05:28 +01:00
Jacques Lucke 70465387cd Cleanup: merge simulation input and output nodes and extract mix geometries function
The simulation input and output node are closely related and also share some code.
That's easier to handle if they are in the same file.

I also extracted out the code to mix geometries.

Pull Request: https://projects.blender.org/blender/blender/pulls/117713
2024-02-01 11:16:29 +01:00
Christoph Lendenfeld 8771e0c4ce Anim: Change tooltip for Insert Needed and Insert Available
This changes the tooltip for the user preference settings
`Only Insert Needed` and `Only Insert Available`
to better explain what these features are for.

Only Insert Available
Automatic keyframe insertion in available F-Curves
-> Insert Keyframes only for properties that are already animated

Auto-Key Needed
Auto-Keyframe insertion only when keyframe needed
-> Auto-Keying will skip inserting keys that don't affect the animation

Manual Key Needed
Keyframe insertion only when keyframe needed
-> When keying manually, skip inserting keys that don't affect the animation

Pull Request: https://projects.blender.org/blender/blender/pulls/117270
2024-02-01 10:52:47 +01:00
Jacques Lucke 61c3dbc297 Cleanup: Geometry Nodes: merge repeat zone node files
This nodes belong quite closely together.
2024-02-01 10:50:29 +01:00
Sybren A. Stüvel e2c4058d6c Fix build error when compiling without OpenImage denoiser
Fix build error when compiling `WITH_OPENIMAGEDENOISE=OFF`.

No functional changes, just a working build.
2024-02-01 10:21:42 +01:00
Jeroen Bakker 958ec9f37f Vulkan: Use Generic Buffer to Store DrawList Commands
Previously a storage buffer was used to store draw list commands as it
matches already existing APIs. Unfortunately StorageBuffers prefers to
be stored on the GPU device and would reduce the benefit of a dynamic
draw list.

This PR replaces the storage buffer with a regular buffer, which keeps
more control where to store the buffer.

Pull Request: https://projects.blender.org/blender/blender/pulls/117712
2024-02-01 10:03:47 +01:00
Philipp Oeser 5e2bad1589 Fix #117674: stereoscopy rendering with overwrite disabled broken
This would still overwrite (even though frames existed).

Mistake in 6b9a500a3a.

char "filepath" was already in use/shadowed, instead use "filepath_view" to
correctly glue path/suffix together (as done already a bit below for the
R_TOUCH case).

Pull Request: https://projects.blender.org/blender/blender/pulls/117696
2024-02-01 09:50:48 +01:00
Jacques Lucke 2d2b087fcf Geometry Nodes: support baking data block references
With this patch, materials are kept intact in simulation zones and bake nodes
without any additional user action.

This implements the design proposed in #108410 to support referencing
data-blocks (only materials for now) in the baked data. The task also describes
why this is not a trivial issue. A previous attempt was implemented in #109703
but it didn't work well-enough.

The solution is to have an explicit `name (+ library name) -> data-block`
mapping that is stored in the modifier for each bake node and simulation zone.
The `library name` is necessary for it to be unique within a .blend file. Note
that this refers to the name of the `Library` data-block and not a file path.
The baked data only contains the names of the used data-blocks. When the baked
data is loaded, the correct material data-block is looked up from the mapping.

### Automatic Mapping Generation

The most tricky aspect of this approach is to make it feel mostly automatic.
From the user point-of-view, it should just work. Therefore, we don't want the
user to have to create the mapping manually in the majority of cases. Creating
the mapping automatically is difficult because the data-blocks that should
become part of the mapping are only known during depsgraph evaluation. So we
somehow have to gather the missing data blocks during evaluation and then write
the new mappings back to the original data.

While writing back to original data is something we do in some cases already,
the situation here is different, because we are actually creating new relations
between data-blocks. This also means that we'll have to do user-counting. Since
user counts in data-blocks are *not* atomic, we can't do that from multiple
threads at the same time. Also, under some circumstances, it may be necessary to
trigger depsgraph evaluation again after the write-back because it actually
affects the result.

To solve this, a small new API is added in `DEG_depsgraph_writeback_sync.hh`. It
allows gathering tasks which write back to original data in a synchronous way
which may also require a reevaluation.

### Accessing the Mapping

A new `BakeDataBlockMap` is passed to geometry nodes evaluation by the modifier.
This map allows getting the `ID` pointer that should be used for a specific
data-block name that is stored in baked data. It's also used to gather all the
missing data mappings during evaluation.

### Weak ID References

The baked/cached geometries may have references to other data-blocks (currently
only materials, but in the future also e.g. instanced objects/collections).
However, the pointers of these data-blocks are not stable over time. That is
especially true when storing/loading the data from disk, but also just when
playing back the animation. Therefore, the used data-blocks have to referenced
in a different way at run-time.

This is solved by adding `std::unique_ptr<bake::BakeMaterialsList>` to the
run-time data of various geometry data-blocks. If the data-block is cached over
a longer period of time (such that material pointers can't be used directly), it
stores the material name (+ library name) used by each material slot. When the
geometry is used again, the material pointers are restored using these weak name
references and the `BakeDataBlockMap`.

### Manual Mapping Management

There is a new `Data-Blocks` panel in the bake settings in the node editor
sidebar that allows inspecting and modifying the data-blocks that are used when
baking. The user can change what data-block a specific name is mapped to.

Pull Request: https://projects.blender.org/blender/blender/pulls/117043
2024-02-01 09:21:55 +01:00
Jeroen Bakker 9e0c78e783 Draw: Remove Unused Refine Shaders
When drawing curves or particle hair, the hair is refined using GPU
shaders. See eParticleRefineShaderType. OpenGL since Blender 4.0
always uses compute shaders. Metal since Blender 4.1 always uses
compute shaders. Vulkan will only uses compute shaders.

The transform feedback isn't used and not supported by our vulkan backend.
Transform feedback workaround was a Apple specific solution as they didn't
support transform feedback. Metal didn't use Compute shaders in
EEVEE-Legacy for performance reasons. Since EEVEE-Next/Workbench-Next
Metal uses compute shaders.

Fixes: #117497
Pull Request: https://projects.blender.org/blender/blender/pulls/117507
2024-02-01 07:48:30 +01:00
Campbell Barton fb29925158 Extensions: support addon_utils.module_bl_info() for enabled extensions
Add-ons "bl_info" was supported for add-ons which weren't registered,
however the real modules weren't handled causing module_bl_info()
to return dummy values when an extensions add-ons module was passed in.

This caused the minimum Blender version check after enabling an add-on
to do nothing.

Now the "bl_info" from extension modules is ignored and the bl_info
is created on demand from the manifest.
2024-02-01 17:11:15 +11:00
Campbell Barton 355fd2313d Extensions: detect time-stamp changes to extensions manifest on refresh
- Add a warning when an extensions meta-data is missing.
- Remove the time-stamps from message that time-stamps have changes
  since knowing the exact times isn't helpful.
2024-02-01 17:03:47 +11:00
Campbell Barton 3906bf0174 Extensions: only hide the add-ons UI when the panel has been extended
Now disabling the extensions add-on restores the original UI.
2024-02-01 17:03:44 +11:00
Campbell Barton dd641d15d0 Fix is_extended method for UI classes (menu, panel, headers... etc)
Appending then removing a draw function caused the is_extended()
method to return true afterwards, resolve by checking if there are
multiple draw functions.
2024-02-01 17:03:42 +11:00
Campbell Barton a8e73616b9 Cleanup: rename add-on related variables for clarity
- Rename info to bl_info, to avoid confusion with extensions manifest,
  which should eventually be accessible in a similar way.
- Rename module_name to addon_module_name to avoid confusion with
  extension repositories name-spaced modules.
- Clarify naming for TOML manifest.
2024-02-01 17:03:40 +11:00
Hans Goudey c87e51790d Cleanup: Make format 2024-01-31 22:01:30 -05:00
Hans Goudey ed500d93b4 Cleanup: Pass const context to asset function 2024-01-31 21:18:09 -05:00
Hans Goudey fac27b1b6b Cleanup: Replace most used of SWAP macro with std::swap
Also remove / replace use of the math vector double swapping functions.
2024-01-31 21:12:16 -05:00
Philipp Oeser 33fc594da1 Fix #117679: operator_menu_enum crashes for an unfound property
Caused by d6a6c3e1fc.

Code from d6a6c3e1fc was trying to get enum items for a property even if
the property itself was not found.

Now return early here (same as to how an early return happens if the
operator was not found).

Pull Request: https://projects.blender.org/blender/blender/pulls/117691
2024-02-01 01:50:55 +01:00
Harley Acheson 93562a1cc5 UI: Image Rotate
Operator to rotate images in 90 degree increments.

Pull Request: https://projects.blender.org/blender/blender/pulls/117352
2024-01-31 23:36:28 +01:00