Commit Graph

144969 Commits

Author SHA1 Message Date
Aaron Carlisle
1bcc01519a Cleanup: Spelling: "Explicitly" 2025-01-03 22:35:05 -05:00
Alaska
38ce90da59 Tests: Add more transparent shadow bounce render tests
Test more combinations of rendering transparent shadows with different
bounce limits.

Ref:
blender/blender#123012
blender/blender#125093
2025-01-04 04:02:26 +01:00
Harley Acheson
9ed7b03e35 Fix #100652: Correct Shortcut Hovering Editor Type Button
When hovering over the "Editor Type" button it always shows Shift-F1 as
the shortcut no matter what the current Editor Type is. We already have
specific code for "SCREEN_OT_space_type_set_or_cycle" for the items on
the popup menu, but it doesn't handle the case of hovering the menu
itself. This adds just adds a line to handle this.

Pull Request: https://projects.blender.org/blender/blender/pulls/132612
2025-01-04 00:58:20 +01:00
Julien Duroure
2add9e8224 glTF: Revert last changes, as these changes are reverted in core too 2025-01-03 21:08:42 +01:00
Jesse Yurkovich
e5b3b9b9cb Cleanup: USD: various non-functional changes
- Pass large std::function by const ref
- Shift the mesh material assignment helpers inside main namespace
- Use MaterialFaceGroups type alias in more places
- Remove unused bmain argument from import_mesh_skel_bindings

Pull Request: https://projects.blender.org/blender/blender/pulls/132586
2025-01-03 20:36:07 +01:00
Damien Picard
e3f1a62a3f Geometry Nodes: rename Curve Spiral to Spiral in Add Node menu
Nodes should have the same name in the Add Node menu as their actual
name, but the Spiral node is called "Curve Spiral". Since there is no
ambiguity with another primitive node called Spiral, it can be renamed
to that.

This also fixes an issue with translation, where the node could not be
translated since its name was never extracted to the translation
files.

Pull Request: https://projects.blender.org/blender/blender/pulls/122289
2025-01-03 20:26:11 +01:00
Jacques Lucke
dc797e1210 Revert "Fix #132408: crash when outputting anonymous attribute from foreach zone"
This breaks some tests.

This reverts commit e948279818.
2025-01-03 19:55:15 +01:00
Hans Goudey
48cecef1e0 Cleanup: Use is_same_any_v wrapper
Pull Request: https://projects.blender.org/blender/blender/pulls/132567
2025-01-03 19:15:01 +01:00
Hans Goudey
3df7c6a428 Fix #132426: Crash loading old file with noise texture node
Some recently added versioning code incorrectly assumed that the
noise texture node would always have its storage struct allocated.
Just create the storage struct in versioning where necessary, to
avoid relying on defaults not changing in the future when the
struct is created as the node tree is initialized.

Pull Request: https://projects.blender.org/blender/blender/pulls/132555
2025-01-03 18:47:32 +01:00
Jacques Lucke
e948279818 Fix #132408: crash when outputting anonymous attribute from foreach zone
The issue was that the propagation of referenced anonymous attributes treated
geometry outputs of the foreach zone as "normal". That means that every
anonymous attributes referenced by the input socket would also be referenced by
the output socket.

However, just like in the repeat zone, this so called "propagate relation" needs
some special behavior, because anonymous attributes references created inside a
zone have to remain inside that zone. Instead, the output node creates a new
anonymous attribute reference that is used outside of the zone.

Pull Request: https://projects.blender.org/blender/blender/pulls/132560
2025-01-03 18:42:09 +01:00
Philipp Oeser
b79af08ade Fix #132548: keyframe_points.insert() misinterprets arguments
Symptoms were broken `keyframe_type` & `options` (e.g. falsely assuming
'NEEDED' option when this was not provided at all).

The parameter order was flipped (leading to false interpretations for
the enum (flag) values).

For historic reference: the `keyframe_type` was introduced in
570fbba3f3 (but in a way that would have broken the existing API),
that was tried to be corrected in 46aaa53998 (but that commit only
flipped the order in the parameter definitions, not in the actual
function `rna_FKeyframe_points_insert`).

So to resolve, correct the order in the function declaration.

Pull Request: https://projects.blender.org/blender/blender/pulls/132595
2025-01-03 17:42:07 +01:00
Philipp Oeser
8fa61bfdef Fix #132254: Symmetrized Limit Location Constraint wrong enabled min/max
We were already flipping the minima & maxima the right way, but the
checkboxes for which axis gets limited to a min/max were not updated. So
when a max X actually gets a min X, those checkboxes should be set
accordingly (now done).

Pull Request: https://projects.blender.org/blender/blender/pulls/132265
2025-01-03 17:41:31 +01:00
Christoph Lendenfeld
7636e6fca4 Fix #132182: Graph Editor slider increment having no visible effect
The issue was that the range for the time offset operator
was so large, that the 0.1 increment seemingly had no effect.
The solution is to add functionality to the slider to specify the increment step.
Since the time offset operator deals in frames it made sense to snap to whole numbers.

Also fixes #132187
For that the increment step has been chosen to allow for 10 steps in the slider range.

Pull Request: https://projects.blender.org/blender/blender/pulls/132554
2025-01-03 17:23:12 +01:00
Sean Kim
4c8fd7a17e Cleanup: Adjust some Sculpt undo multires comments
Pull Request: https://projects.blender.org/blender/blender/pulls/132600
2025-01-03 17:20:11 +01:00
Hans Goudey
c01b7ff9ad Fix: Mistaken node legacy enum change in recent refactor
Mistake in b43e2168e3.
2025-01-03 10:03:02 -05:00
Hans Goudey
05603e0a64 Fix: Build error from missing include in Cycles after recent cleanups 2025-01-03 09:54:43 -05:00
Sybren A. Stüvel
266d1e8d2f Anim: do not draw constraint relationship lines for invalid targets
Only draw relationship lines between a constrained object/bone and its
target when there is actually a valid target. Previously Blender would
always draw a line, which would go to the world origin when the
constraint has no target. This was visually rather noisy and potentially
even misleading when there is actually an object at the origin.

Fixes #131477

Pull Request: https://projects.blender.org/blender/blender/pulls/132592
2025-01-03 15:51:40 +01:00
Julien Duroure
eb09364030 glTF: Update after recent Blender changes on b43e2168e3 2025-01-03 15:24:54 +01:00
Sean Kim
c9ffd42417 Fix #132530: Undo after Apply Base doesn't correctly restore data
With the recent sculpt refactor project prior to 4.3, the Sculpt undo
system was changed such that an individual `SculptUndoStep` would store
a single type on the `StepData` struct instead of storing individual
nodes that each had their own type.

This works for most operators supported by Sculpt Mode, however, the
`Apply Base` multires operator was dependent on needing to store both
Geometry and Position data.

To restore old functionality, this commit removes the need for storing
this Position data by instead forcing the object space Sculpt Mode
multires data to be flushed to the tangent space MDisp data prior to
saving the current geometry state so that it can be restored correctly.

This has the following benefits:
* We can continue to assume that Geometry steps represent full-mesh
  changes and should require no further specialized processing.
* This better aligns with the future state of trying to flush this
  multires data on a per-stroke basis instead of needing to wait unti
  lthe user either quits or exits sculpt mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/132569
2025-01-03 15:06:24 +01:00
Alaska
793918f2b1 Cycles: Update OptiX denoiser type
Update the OptiX denoiser model type to the newer and more frequently
updated `OPTIX_DENOISER_MODEL_KIND_AOV` denoiser.

The output of the new denoiser type is typically higher quality.
And the old denoiser is no longer being updated.

Original change was proposed by Patrick Mours from NVIDIA.

Pull Request: https://projects.blender.org/blender/blender/pulls/132542
2025-01-03 14:11:44 +01:00
Sybren A. Stüvel
61f8364dd1 Refactor: Anim, reduce cognitive complexity in ..._get_tarmat functions
Simplify the `${CONSTRAINT}_get_tarmat` functions, mostly by reducing
nesting via early returns.

Code like this:

```cpp
void blabla_get_tarmat(...) {
  if (VALID_CONS_TARGET(ct)) {
    // ... do useful stuff.
  }
  else if (ct) {
    unit_m4(ct->matrix);
  }
}
```

now looks like:

```cpp
void blabla_get_tarmat(...) {
  if (!VALID_CONS_TARGET(ct)) {
    unit_ct_matrix_nullsafe(ct);
    return;
  }

  // ... do useful stuff.
}
```

This is mostly done as preparation for an upcoming functional change.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/132591
2025-01-03 14:07:29 +01:00
Bastien Montagne
34908de285 Update BPY API 'creation & destruction' section re __del__().
While in theory it would be good to have calls to super classes'
`__del__()` destructors in subclasses, matching the ones to
`__init__()`, several limitations of current CPython implementation do
not make it a practical requirement.

So remove `__del__` from examples, and add a note summarizing the
current problems with using it (aka `tp_finalize` in C++ code).

Also see !132476 for some discussion about that topic.
2025-01-03 12:16:50 +01:00
Brecht Van Lommel
d48e73977c Fix: Build errors on Linux/GCC after recent Cycles refactoring 2025-01-03 11:52:13 +01:00
RedMser
f58f77d24e Fix #132033: Falloff options greyed out when disabled
Falloff/cavity mask checkboxes seems disabled themselves when unticked.
The layout was split so that only the options below the checkbox are inactive.
UI looks and acts the same when checkboxes are ticked.

Pull Request: https://projects.blender.org/blender/blender/pulls/132507
2025-01-03 11:02:21 +01:00
Brecht Van Lommel
988c1798ac Refactor: Cycles: Replace new/delete with unique_ptr also for nodes
Using new unique_ptr_vector utility class.

Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:23:32 +01:00
Brecht Van Lommel
9971648783 Refactor: Cycles: Replace new/delete by unique_ptr, in simple cases
Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:23:30 +01:00
Brecht Van Lommel
a8654a1dbe Refactor: Cycles: Make CPU kernel globals storage more sane
Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:23:27 +01:00
Brecht Van Lommel
57ff24cb99 Refactor: Cycles: Add const keyword to more function parameters
Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:23:24 +01:00
Brecht Van Lommel
dd51c8660b Refactor: Cycles: Add const keyword where possible, using clang-tidy
Check was misc-const-correctness, combined with readability-isolate-declaration
as suggested by the docs.

Temporarily clang-format "QualifierAlignment: Left" was used to get consistency
with the prevailing order of keywords.

Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:23:20 +01:00
Brecht Van Lommel
f2c13cb639 Refactor: Cycles: Work around strange clang-tidy behavior in transform.h
Get rid of somewhat unusual include.

Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:23:17 +01:00
Brecht Van Lommel
689633d802 Refactor: Cycles: Avoid unsafe memcpy and memcmp
Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:23:15 +01:00
Brecht Van Lommel
da5251f06c Cleanup: Cycles: Remove unused math_matrix.h
Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:23:13 +01:00
Brecht Van Lommel
0a0696261d Cleanup: Cycles: clang-tidy warnings about missing switch default case
Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:23:11 +01:00
Brecht Van Lommel
d9150484a2 Cleanup: Cycles: Remove some unnecessary #if 0 and #if 1
Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:23:09 +01:00
Brecht Van Lommel
60bec183cb Refactor: Cycles: Replace foreach() by range based for loops
Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:23:05 +01:00
Brecht Van Lommel
71b8ecdd84 Cleanup: Cycles: Remove workaround for slow expf in glibc < 2.16
We're on 2.28 now, and were already on 2.17 for many years before that.

Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:23:03 +01:00
Brecht Van Lommel
3a57b97eba Cleanup: Cycles: Remove unneeded oneAPI double emulation for NanoVDB
Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:22:59 +01:00
Brecht Van Lommel
d0c2e68e5f Refactor: Cycles: Automated clang-tidy fixups in Cycles
* Use .empty() and .data()
* Use nullptr instead of 0
* No else after return
* Simple class member initialization
* Add override for virtual methods
* Include C++ instead of C headers
* Remove some unused includes
* Use default constructors
* Always use braces
* Consistent names in definition and declaration
* Change typedef to using

Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:22:55 +01:00
Brecht Van Lommel
4951356ebc Refactor: Cycles: Stop using entire OIIO namespace
Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:22:52 +01:00
Brecht Van Lommel
5c46063607 Refactor: Cycles: Make kernel headers work by themselves
Shuffle around some code and add more includes so that individual
header files compile without errors.

Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:22:50 +01:00
Brecht Van Lommel
7db0bc2e64 Refactor: Cycles: Make math and type headers work by themselves
Remove separate impl.h headers, shuffle around some code and add more
includes so that individual header files compile without errors.

Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:22:47 +01:00
Brecht Van Lommel
f53e13411b Refactor: Cycles: Use #pragma once
Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:22:45 +01:00
Brecht Van Lommel
3c2a6fbb9c Refactor: Cycles: Use nullptr instead of NULL
Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:22:43 +01:00
Brecht Van Lommel
4e777476b5 Refactor: Cycles: Replace std::bind by lambdas
Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:22:35 +01:00
Alaska
7d5ec0c441 Tests: Add Texture coordinate render tests for common mesh configurations
This commit adds render tests for the outputs of the
texture coordinate node tested on:
- A scaled and rotated mesh
- A instanced scaled and rotated mesh
- A mesh with and without smooth shading
- A mesh with a volumetric shader
- The world background chader

And a few extra objects for specific outputs. Examples including:
- A deformed mesh for the `Generated` output
- View meshes through a reflection for view dependent outputs
- Instanced meshes using the old instancing system to test the
"from instancer" option with the UV and Generated outputs
- Additional objects with extra UV maps to ensure the correct UV map
is loaded
- And more

There are other aspects that we would ideally test
(E.g. Point clouds and hair), but these will be handled by a
separate commit and set of tests.

Ref blender/blender-test-data!30

Pull Request: https://projects.blender.org/blender/blender/pulls/132512
2025-01-03 05:38:17 +01:00
Campbell Barton
c7fb01ff91 Cleanup: use static sets for "contains" checks 2025-01-03 14:47:57 +11:00
Campbell Barton
33e38c605f Cleanup: correct indentation for CMake files, strip trailing space 2025-01-03 13:23:38 +11:00
Harley Acheson
72a9990779 Fix #92998: Allow UI List Reversed Alpha Sort
UI Lists has some buttons at the bottom related to sorting. One button
sorts in alphabetical order, the other reverses sort order. But when
both buttons are enabled you don't get reserved alpha. Contrary to what
the buttons show, enabling "reversed" turns off alpha sorting so you
just get a reversal of the natural order. This button fixes that so you
can reverse both natural and alpha sorted lists.

Pull Request: https://projects.blender.org/blender/blender/pulls/132578
2025-01-03 02:28:51 +01:00
Iliya Katueshenock
fa8574b80b Fix: Geometry Nodes: Triangulate Mesh node assertion case
Typo from ea875f6f32.
A range of triangles is pushed into the mask, but _last_ instead of _end_
was  used. This was found in #132333 report, but this PR does not fix a
reported issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/132405
2025-01-03 01:42:39 +01:00
Charles Wardlaw
0c544974d1 USD: option to convert the scene's meters per unit value
This rescales the whole scene by its root transform to match the same
visual size while not forcing the user to wait for scale to be applied to
each object.

This is requested by studios whose main applications / USD scenes are
in CM, because referencing and payloading scenes from disparate scales
can cause issues at resolution time.

If "Apply Unit Scale Conversion" is unchecked on import, the user now
has the ability to bring the objects in with a scale factor of 1.0, so that the
objects may be edited as if Blender's scene units matches the imported
stage's.

At export time, a "Stage Meters Per Unit" value can be chosen from a list
of common measurements, as well as setting a custom value.

Co-authored-by: kiki <charles@skeletalstudios.com>
Co-authored-by: Michael Kowalski <makowalski@nvidia.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/122804
2025-01-02 22:04:58 +01:00