Commit graph

145376 commits

Author SHA1 Message Date
Sean Kim
440e87ce55 Cleanup: Reorganize hsv sort paint functions
Pull Request: https://projects.blender.org/blender/blender/pulls/132959
2025-01-13 00:04:36 +01:00
Pratik Borhade
d2418b89c3 UI: Meshcache modifier boolean flip axis property
`flip_axis` is currently an enum RNA property. This makes impossible to
toggle the individual axis. Now fixed by converting the property to
boolean. UI drawing code is same as done for mirror modifier.
New enum values are introduced for each axis

Resolves #70237

Pull Request: https://projects.blender.org/blender/blender/pulls/132849
2025-01-12 09:58:30 +01:00
Alaska
ec161e50b4 Fix: Extra letter in Grease Pencil curve handle type tooltip
The tool tip for the Grease Pencil curve handle type Aligned contained
a random `W` at the end of the tooltip.

This commit removes the extra letter.
2025-01-12 16:50:26 +13:00
Jesse Yurkovich
c3589a4c0a Cleanup: USD: Make USDCurvesReader abstract to prepare for Nurbs changes
In preparation for allowing the Nurbs reader to import as curves rather
than mesh, change `USDCurvesReader` to be abstract so we can share most
of the boilerplate in the base class. The existing basis-curves code is
shifted into a new `USDBasisCurvesReader` class.

Pull Request: https://projects.blender.org/blender/blender/pulls/132954
2025-01-12 01:00:19 +01:00
John Kiril Swenson
225c5c9745 Cleanup: VSE: Improve 'Preview During Transform' Tooltip
Should better clarify the intent of the operator.
2025-01-11 16:39:06 -06:00
John Kiril Swenson
c6f8f24c29 VSE: Cleanup RCS logic and add comments
- Previously, `change_frame_invoke` always ran
  `sequencer_skip_for_handle_tweak` check, even if the user was not
  using the sequencer. Now, the check is only done if the user is in the
  sequencer, where it is possible for them to tweak strips.
- It is now impossible to change the frame from the sequencer preview,
  so remove that logic.
- Also add some explanatory comments for RCS keymap logic in the code.
2025-01-11 15:55:43 -06:00
John Kiril Swenson
6ac58a5b8a VSE: Auto-include effect chain for copying and metastrip creation
Part of Code Quality Project outlined in #130975.

This patch eschews warning messages urging the user to "select all
related strips" when copying or creating new metastrips and instead
automatically includes those related strips in the operation.

- Attempting to copy or create a metastrip with no strips selected no
  longer delivers a warning.
- When copying strip(s), if there are related effect chains, they will
  be automatically selected and included in the copy if the operation
  succeeds.
  - The decision to select related strips was intentional, as it allows
    the user to easily see the entire effect chain and thus which strips
    were copied.
- When creating a new metastrip, if there are related effect chains,
  they will automatically be included in the resulting metastrip.
  - This is done using a new
    `SEQ_query_strip_connected_and_effect_chain()` iterator. This
    iterator is only used for metastrips, and not copying, since the
    user may wish to only copy single strips in a connection, but
    connected strips should always stay together in a metastrip/seqbase.

Pull Request: https://projects.blender.org/blender/blender/pulls/132930
2025-01-11 20:45:46 +01:00
Harley Acheson
e203c7b554 Fix #132931: Allow Wider Icons for Collapsed XYZ Modifiers
Event Icons, those typically shown on the taskbar to indicate keymap
entries, can differ in width. This length is not taken into account
for the modifier keys used when showing collapsed XYZ operations. This
PR just does so.

Pull Request: https://projects.blender.org/blender/blender/pulls/132945
2025-01-11 19:08:15 +01:00
Aras Pranckevicius
4e113c256f UI: improve styling and placement of image/movie current frame indicator
Make it have similar display style and placement as current frame
indicators used elsewhere (timeline, animation etc.), i.e.
time_scrub_ui.cc draw_current_frame:

- The text label is centered on the frame (instead of left aligned),
- Background box uses rounded corners,
- Background box uses padding that scales with overall UI scale,
- Text color uses TH_HEADER_TEXT_HI which makes it more readable

This partially addresses issue #124287 (better text legibility, and
due to label being centered it is less clipped when on the right
side). But fully solving the issue would probably have to be done
across the board for all current frame indicators, with some design
work.

Screenshots in the PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/132911
2025-01-11 11:21:32 +01:00
Alaska
2703bbe147 Tests: Add a render test for a complex scene that can sometimes have missing shadows
While testing the RX 5700XT with HIP on Linux, I noticed that under
specific conditions, shadows would not render properly. The specific
conditions being a combination of:
- Curve rendering
- Subsurface Scattering
- Custom mesh light shaders
- Specific GPU and HIP compiler combinations

This specific combination was not present in the render test suite.
This commit adds a heavily simplified verion of a file that is affected
(Cosmos Laundromat demo) to the test suite to test for this specific
issue.

Ref: blender/blender-test-data!41
2025-01-11 04:31:09 +01:00
Alaska
5985f04a88 Tests: Add a render test for triangle light sampling
The Cycles render engine switches between two triangle light sampling
methods depending on the distance to the triangle, and the size of the
triangle.

In a earlier version of Blender, one of the sampling methods was broken
during a refactor. This commit adds a test scene that clearly shows off
both sampling systems so if it breaks again, it will easily
and clearly be shown in the test results.

References:
Original bug report: blender/blender#117771
Fix commit: blender/blender@583af2a6e5
Test repository PR: blender/blender-test-data!42
2025-01-11 04:27:42 +01:00
Philipp Oeser
0c612cecef Fix #109995: Outliner listen to collection change in the header region
Changing the active collection redraws many regions, not the Outliner
header though (blender itself does not need a redraw there -- it does
not present anything related to active collection in the header). This
was requested from Addon devs in #109995 (placing active collection
related buttons there).

Pull Request: https://projects.blender.org/blender/blender/pulls/111725
2025-01-11 01:19:57 +01:00
Hans Goudey
eb7df01ef3 Cleanup: Reduce unnecessary includes in curves headers
Pull Request: https://projects.blender.org/blender/blender/pulls/132925
2025-01-10 23:31:49 +01:00
Hans Goudey
d381379b47 Cleanup: Nodes: Use StringRef in a few more places
Pull Request: https://projects.blender.org/blender/blender/pulls/132923
2025-01-10 22:27:45 +01:00
Hans Goudey
be887bd37d Cleanup: Move NOD_common.h to C++ 2025-01-10 22:27:44 +01:00
Hans Goudey
73ff099405 Cleanup: Remove unnecessary casts for PropertyFlag enum type 2025-01-10 15:18:40 -05:00
Habib Gahbiche
9dff507ca9 Fix #132893: Node Groups are broken
Caused by c8dbde8779.
The root cause is probably implicit cast from `VecBase<T>` to `T *`.

Pull Request: https://projects.blender.org/blender/blender/pulls/132918
2025-01-10 20:25:33 +01:00
Julian Eisel
4b2a4341a7 Fix #130611: Grease Pencil: Airbrush affects material of other brushes
Don't change the object's active material when adding a material slot. This
active material will be used by brushes with no pinned material, while the
added slot is meant for the pinned material.

The if-statement in `BKE_grease_pencil_object_material_ensure_from_brush()`
would change the active unpinned material, even though it was only meant to
handle the pinned material. This was not a new issue, it was just unlikely to
run into it.

Before brush assets were introduced this if-statement would not be
executed when activating any of the default brushes. Afterwards it would
be, because the material was newly linked (because the brush asset was
linked) and so there was no material slot created for it yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/132865
2025-01-10 18:09:30 +01:00
Sergey Sharybin
179c305a40 Cleanup: Type in the comment 2025-01-10 17:54:06 +01:00
Jeroen Bakker
6bcf34668a Fix #131474: Overlay: Image background
Overlay engine rendered the editor background incorrectly when no image
is present. It used to render an alpha checker background indicating
that an image was present. The cause for this was that the in front
depth texture was attached, but isn't used at all.

The second change is that the image prepass should only be drawn when
there is an image present in the image editor other wise external the
prepass would alter the depth texture indicating that there is an image
present.

Pull Request: https://projects.blender.org/blender/blender/pulls/132847
2025-01-10 16:25:21 +01:00
Nathan Vegdahl
4fd011675b Cleanup: improve documentation of Action C++ APIs
A pass at cleaning up / improving the code documentation for the layered action
C++ classes.

There is still more work to do here, but this should be good for an initial
first pass. I've focused on clarifying the behavior of and updating stale docs
of the methods in the action-related C++ classes.

Pull Request: https://projects.blender.org/blender/blender/pulls/131318
2025-01-10 15:13:38 +01:00
Pratik Borhade
eb57878bec Grease Pencil: Support Boolean property in modifier panel header
A separate function is declared/defined `uiLayoutPanelPropWithBoolHeader`,
it will add a boolean property to the panel.header.
Clear decorate and separator flag, otherwise they will offset the panel
header horizontally and also adds animate decorator on the right side.

Resolves #131623.

Pull Request: https://projects.blender.org/blender/blender/pulls/132726
2025-01-10 14:51:19 +01:00
Pratik Borhade
06a2617107 Fix #100786: Collection hide viewport in properties tab
Similar to other visibility properties, include "hide_viewport" in
collection properties tab. One issue is that, when collection is
disabled, automatically parent collection is selected or tab is gone
when parent collection does not exist. The check was added in
0a903e7ab1, it doesn't seem very useful so
removed that.

Pull Request: https://projects.blender.org/blender/blender/pulls/132107
2025-01-10 14:49:43 +01:00
Lukas Tönne
b9ec08b551 Fix #132861: Proportional edit broken due to uninitialized transform data
The `td->center` value is used to compute proportional editing distances,
but initialization order was broken in 9d86fada which sets every center
to zero.

Pull Request: https://projects.blender.org/blender/blender/pulls/132913
2025-01-10 14:41:25 +01:00
YimingWu
6a9b3183db Fix #131992: Grease Pencil: "Scale Stroke Thickness" behaviour fix
Previously there are two problems with grease pencil transformation:

1. Transform in Grease Pencil Opacity mode would change stroke thickness
    if "Scale Stroke Thickness" is enabled.
2. "Scale Stroke Thickness" is ineffective when scaling strokes in edit
    mode while in GPv2 implementation it will scale stroke thickness in
    sync with overall dimensions.

This patch fixes those problems by:

1. Altering the logic of determining which attribute to feed into the
    TransData.
2. Swapping the arguments for fall off interpolation (Previously was
    inverted, causing the factor to always be zero hence appeared to be
    ineffective).

Pull Request: https://projects.blender.org/blender/blender/pulls/132274
2025-01-10 14:02:16 +01:00
Aras Pranckevicius
64f1f29a50 Audio: add AAC and Opus to Render Audio operator
There's a "Render -> Render Audio" operator that pretty much calls into Audaspace functionality directly. This PR adds two new options in there, that boThere's a "Render -> Render Audio" operator that pretty much calls
into Audaspace functionality directly. This PR adds two new options in
there, that both feel like an oversight:

- There's an option for AAC container, when someone wants to render
  into .aac file. Previously you could render AAC audio, but only in
  MKV (Matroska) container. This is a user request #131980.
- When using MKV (Matroska) or Ogg container, it did not list Opus as
  an audio codec that can be used. This felt like an oversight; both
  the rest of Blender and Audaspace can handle that, jus the option
  was not spelled out in the RNA enums.

Pull Request: https://projects.blender.org/blender/blender/pulls/132877th feel like an oversight:

- There's an option for AAC container, when someone wants to render into `.aac` file. Previously you _could_ render AAC audio, but only in MKV (Matroska) container. This is a user request #131980.
- When using MKV (Matroska) or Ogg container, it did not list Opus as an audio codec that can be used. This felt like an oversight; both the rest of Blender and Audaspace can handle that, jus the option was not spelled out in the RNA enums. Note however that without fix in #132872 the Matroska container continues to be useless in that it produces wrong result.

Upstream Audaspace PR for the 2nd point: https://github.com/neXyon/audaspace/pull/47 (was just merged!)

Pull Request: https://projects.blender.org/blender/blender/pulls/132877
2025-01-10 12:26:24 +01:00
Aras Pranckevicius
6a865a2265 Fix #132214: wrong Render Audio result when using Matroska container format
Matroska container really really wants to internally keep on using
milliseconds as a time base. Even if at initialization time both the
m_stream and m_codecCtx are set to use {1, sample_rate} timebase,
later during the avformat_write_header call the audio stream gets set
to {1, 1000}.

Doing av_packet_rescale_ts for each packet after receiving it but
before writing it seems to do all the correct work. This is what is
being done inside Blender movie_write_audio.cc, and in official ffmpeg
mux.c example.

Pull Request: https://projects.blender.org/blender/blender/pulls/132872
2025-01-10 12:25:01 +01:00
Omar Emara
6a1ac88b8e Fix: Crash when versioning node groups contain Glare
When running versioning for the Glare node, the code assumes the ID
given by the iterator belongs to the scene containing the node tree. But
this might not be the case, as the Glare node might be inside a node
group, in that case, the ID will be the node tree itself.

To fix this, recursively go over the node trees starting from the scene,
passing the scene down all the way. And for node groups not used by any
scene, assume the first scene, since this is better than not doing
versioning.

Pull Request: https://projects.blender.org/blender/blender/pulls/132869
2025-01-10 12:20:43 +01:00
Aras Pranckevicius
f355683e4b Fix #132216: no video (audio only) animation render produces broken file
Looks like this regressed in c1f5d8d023 (blender 3.1), basically
since then if there was no video, then no audio was ever written
either.

From what I can tell, the original change tried to fix the problem
that "file size autosplit" logic was after video, but before audio
data writing. So it moved audio writing to be before the split (good),
but also (not sure whether by accident) moved audio writing to
only happen if video is written.

Pull Request: https://projects.blender.org/blender/blender/pulls/132874
2025-01-10 12:20:32 +01:00
Lukas Tönne
d27e0fcbaf Fix #130855: RegionView3D matrices need to be reset before transforming points
- In "Surface" mode the depth buffer needs to be cached after constructing the base DrawingPlacement, otherwise there is no depth data for projection and the origin is used as a fallback.
- The DrawingPlacement relies on the RegionView3D matrices to project from the rendered image back into 3D space. Because the boundary projection is called while the rv3d matrices are still set up for the image render it will look up the wrong pixels from the depth buffer. The solution is to make sure the viewport reset happens before projecting the boundary, i.e. by making sure the reset function is called before `process_image`.
- The aspect ratio needs to be taken into account for the boundary-to-strokes transform, otherwise the placement is wrong depending on how much the region aspect deviates from square.

The code for computing the zoom factor and offset has also been cleaned up and documented somewhat better, and now uses the `Bounds<float2>` struct instead of old `rctf`.

Pull Request: https://projects.blender.org/blender/blender/pulls/131321
2025-01-10 12:17:38 +01:00
Aras Pranckevicius
1b322de0aa Fix #124588: Do not select strip handles when clicking inside time ruler
Inside sequencer_main_cursor, the logic for showing a custom cursor
was already ignoring the time scrub ruler area, and not showing
the strip edge resizing cursors. However confusingly enough, actually
clicking there was still going into the
ED_sequencer_pick_strip_and_handle which found a strip edge and
returned it. Modify ED_sequencer_pick_strip_and_handle to return empty
selection when mouse is inside the time scrub ruler.

Pull Request: https://projects.blender.org/blender/blender/pulls/132891
2025-01-10 11:57:31 +01:00
Habib Gahbiche
9b484b5251 UI: Add hint for snapping inversion in status bar
Followup to https://projects.blender.org/blender/blender/pulls/130379

Status bar now shows correctly that pressing `ctrl` while snapping will invert snapping.

Pull Request: https://projects.blender.org/blender/blender/pulls/131009
2025-01-10 10:12:27 +01:00
Lukas Tönne
fadde9da75 Fix: Regression of Grease Pencil arguments when caching depth buffer
Depth buffer caching was broken in 62897317bd. The `use_basic` parameter was removed but `use_gpencil`
should remain unmodified. This caused overlays to be included in the depth buffer for Grease Pencil.

Pull Request: https://projects.blender.org/blender/blender/pulls/132871
2025-01-10 10:11:26 +01:00
Lukas Tönne
9348d5ec05 Fix #132418: Joining Grease Pencil object creates invalid duplicate of nested layers
The `copy_layer_group_content` function was using the `LayerGroup::nodes()` API
for iterating over layers and inserting unique copies into the target geometry.
This function lists __all__ the layers inside a group, not just direct children.
A layer inside a group will be copied twice or more this way, once for the root
layer and for any of its parent groups. Looping only over directly child layers
and groups is the correct thing to do here.

Pull Request: https://projects.blender.org/blender/blender/pulls/132868
2025-01-10 08:56:07 +01:00
Pratik Borhade
905d6c435a Fix #132807: Grease Pencil: Joining strokes removes selection
Ensure selection attribute for last stroke after join operation.

Pull Request: https://projects.blender.org/blender/blender/pulls/132840
2025-01-10 08:05:45 +01:00
Jesse Yurkovich
75f3fab268 USD: Add test for the export_texture_mode option
Add tests covering the PRESERVE and KEEP export_texture_mode options.

Pull Request: https://projects.blender.org/blender/blender/pulls/132885
2025-01-10 06:34:27 +01:00
Campbell Barton
372ecb847f Fix #108658: Geometry with non-finite coordinates crashes bevel 2025-01-10 16:30:52 +11:00
Hans Goudey
c8dbde8779 Cleanup: Remove unused includes in space node folder
Pull Request: https://projects.blender.org/blender/blender/pulls/132882
2025-01-10 03:09:00 +01:00
Alaska
9f6d605743 Tests: Add render tests for a few missing simple shader tests
There are a few simple shader nodes that were missing test files.
This commit adds tests for those nodes:
- Camera data
- Fresnel
- Layer weight
- Hue/Saturation/Value
- Invert
- Normal
- Wavelength

Ref: blender/blender-test-data!39
2025-01-10 02:44:13 +01:00
Harley Acheson
fe071cd076 Fix #124814: Correctly Collapse Long Non-Categorized Lists
Multi-column lists are supposed to collapse to single-column when they
are estimated to be wider than the available window width. However,
current code has two errors. First the calculation of the maximum
number of possible rows is based on entire screen height when the most
available is a bit less than half. This too-large value was used in
the calculation of widths, yet the maximum rows is actually clamped
to about 24 for uncategorized lists. Whenever the former is greater
than the latter this could cause collapsing to not occur. This issue is
only really noticeable for lists in Nodes as these can be shown much
smaller than regular size.  This PR fixes the max-row calculation and
uses this correctly when breaking lists without categories.

Pull Request: https://projects.blender.org/blender/blender/pulls/132881
2025-01-10 00:56:33 +01:00
Harley Acheson
e5e45dc140 Fix #132122: Default Value for Camera FOV Angle
In a Camera's properties you can "Reset to Default" on "Focal Length"
because "lens" is a direct member of Camera and it has "50.0f" as its
default value in DNA_camera_defaults.h. However change the "Len Unit"
to "Field of View" and what you are changing is "angle". This is not
a member of Camera but is a calculated value based on sensor size. So
"reset to default" makes this "0", which is invalid and otherwise not
possible to enter.  This PR uses RNA_def_property_float_default to set
a default value of 0.6911504f radians which is the 39.6° FOV for the
default 50mm lens.

Pull Request: https://projects.blender.org/blender/blender/pulls/132364
2025-01-09 21:52:10 +01:00
Pratik Borhade
60ac0421b3 Fix #132830: Regression: Cursor restores the update in GN input
For node region, `event_cursor` is true, it sends update to the cursor
every draw call, this restores the cursor `WM_CURSOR_X_MOVE`.
Issue is originally caused by e6d941cdf4 and it introduced couple other
issues. So best fix would be to revert the commit. And to fix #129178,
restore modal cursor after drawing context menu, i.e. execution of
`ui_popup_context_menu_for_button`.

Pull Request: https://projects.blender.org/blender/blender/pulls/132848
2025-01-09 21:21:30 +01:00
Xavier Hallade
ce463bd6b1 Cycles: oneAPI: optimize device<->host copies
There is a large overhead when doing copies between a device and non-USM host memory.
Using the prepare/release API avoids it, as presented in the optimization guide:
https://www.intel.com/content/www/us/en/docs/oneapi/optimization-guide-gpu/2025-0/optimizing-data-transfers.html

This currently translates to a 4-5% overall rendering speedups on my Arc B580 in most scenes.

Pull Request: https://projects.blender.org/blender/blender/pulls/132859
2025-01-09 21:00:12 +01:00
Hans Goudey
954d708d99 Cleanup: Formatting 2025-01-09 14:29:47 -05:00
Hans Goudey
f2c9fccee0 Cleanup: Move legacy node integer types defines to separate header
Moving these defines to a separate header makes their "legacy" status
more obvious. This commit just adds the include wherever necessary.

Followup to 971c96a92c.

Pull Request: https://projects.blender.org/blender/blender/pulls/132875
2025-01-09 20:03:08 +01:00
Sean Kim
e2d6517109 Sculpt: Allow running performance test in 4.3 releases
Unfortunately, the tests as they are right now will likely not work with
4.2 and previous versions, as the brush asset changes will need to be
accounted for.

Pull Request: https://projects.blender.org/blender/blender/pulls/132827
2025-01-09 19:27:20 +01:00
Hans Goudey
7c775c6f57 Cleanup: Move some node editors functions to C++ namespace
Pull Request: https://projects.blender.org/blender/blender/pulls/132873
2025-01-09 19:19:06 +01:00
Hans Goudey
b44a86e281 Cleanup: A few clang tidy fixes in node_draw.cc
- Remove unused headers
- Use const arguments
- Add default case
- Remove unnecessary casts
2025-01-09 19:19:05 +01:00
Miguel Pozo
f005f4d562 FIx #132007: Overlay-Next: Center view to mouse sculpt flicker
Skip passes that draw to render_fb directly if is_depth_only_drawing.
2025-01-09 18:21:37 +01:00
Jacques Lucke
6ddebc0888 Fix #132831: memory leak when deleting simulation zone
The leak happened because the bake data of the removed zone was only partially freed.

Pull Request: https://projects.blender.org/blender/blender/pulls/132867
2025-01-09 18:19:53 +01:00