Commit Graph

120055 Commits

Author SHA1 Message Date
Campbell Barton
8fdb190278 Cleanup: typos in comments (duplicate words) 2024-07-14 18:55:43 +10:00
Sean Kim
06ba62f278 Cleanup: Remove unused variables
Pull Request: https://projects.blender.org/blender/blender/pulls/124667
2024-07-13 21:57:31 +02:00
Sean Kim
e4c72ef30c Fix: Sculpt: Multiple brushes do not work with Shape Keys
This commit inverts the conditional as the # of elements is getting too
large for the `ELEM` macro.

Pull Request: https://projects.blender.org/blender/blender/pulls/124634
2024-07-13 16:54:25 +02:00
Campbell Barton
9fb0d3c3ef Cleanup: spelling in comments 2024-07-13 16:56:57 +10:00
Campbell Barton
355aced2c4 Cleanup: various non-functional changes, remove redundant null check 2024-07-13 16:56:55 +10:00
Campbell Barton
cc81eeff3b Unbreak build from missing include 2024-07-13 16:56:53 +10:00
Sean Kim
26159ace0b Cleanup: make format 2024-07-12 16:23:49 -07:00
Sean Kim
4b515e9a49 Sculpt: Initial data oriented refactor of topology relax brush
Part of #118145.

Largely shares code with the Relax Face Set brush

Pull Request: https://projects.blender.org/blender/blender/pulls/124633
2024-07-13 00:54:20 +02:00
Harley Acheson
858f58fde5 Fix #124626: Check for Null Area Type for Get_Name & Get_Icon
This report demonstrates a time when an area can have a null
SpaceType. This just adds an extra check for this.

Pull Request: https://projects.blender.org/blender/blender/pulls/124631
2024-07-12 22:45:23 +02:00
Alaska
0afee246ea Fix #124593: Reorder EEVEE material shadow versioning
Caused by 983e4a7543

Bail out case should be at the top

Pull Request: https://projects.blender.org/blender/blender/pulls/124600
2024-07-12 22:44:01 +02:00
Hans Goudey
40c25eaa03 Fix: Viewport transform node projection incorrectly transformed
The projection was transformed by the object transform, but it's meant
to be in camera space, not affected by the camera view transform or by
the local object's transform. This fix makes viewport raycasting use
cases work without a manual fix in nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/124610
2024-07-12 21:40:37 +02:00
Sean Kim
178966b0ba Fix: Draw Sharp and Topology Slide use incorrect position data
These brushes should use positions_eval, not the original data sourced
from the undo nodes for determining the clipping & translation.

Pull Request: https://projects.blender.org/blender/blender/pulls/124572
2024-07-12 20:59:02 +02:00
Sean Kim
f03b35e669 Fix: Relax Face Set deform & shape key extra application
Missed in 4f73bf2871

Pull Request: https://projects.blender.org/blender/blender/pulls/124573
2024-07-12 20:47:21 +02:00
Harley Acheson
2ca366827c Cleanup: Space_node.cc static_casts
Use of static_cast in place of c-style casts in space_node.cc.

Pull Request: https://projects.blender.org/blender/blender/pulls/124562
2024-07-12 17:14:59 +02:00
Sebastian Parborg
231f1d719f Cleanup: Combine two if statements in the VSE retiming code 2024-07-12 16:56:11 +02:00
Hans Goudey
c1f701762b Merge branch 'blender-v4.2-release' 2024-07-12 10:35:01 -04:00
Hans Goudey
38ee38f35f Fix #124548: Node tools redo behavior inconsistent
Currently the node tool operator stores the mouse position from
the first execution because it's not possible to retrieve it again from
the operator redo callback which doesn't have access to the event.

However, other inputs like the region size and the viewport transform
are retrieved again for every redo execution. This creates inconsistency
and generally makes redo less useful for node tools than it should be.
Generally tweaking an input in the redo panel should keep everything
else the same.

This commit adds the rest of the inputs as RNA properties just like
how mouse position is already handled.

Pull Request: https://projects.blender.org/blender/blender/pulls/124557
2024-07-12 16:23:20 +02:00
Falk David
ec2839e0ee GPv3: Draw Tool: Enable eraser while holding CTRL
This allows the draw tool to temporarily enable the eraser.

Adds a new `BrushStrokeMode` called `BRUSH_STROKE_ERASE`.
This is used by the keymap to enable erasing while using
the draw tool with CTRL.

Pull Request: https://projects.blender.org/blender/blender/pulls/124591
2024-07-12 16:07:28 +02:00
Lukas Tönne
0a70096a5b GPv3: Interpolate Tool
Interpolation tool for strokes ported from GPv2.

Adds a new operator that inserts a new frame with interpolated curves.
The source curves are taken from the previous/next keyframe.

Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/122155
2024-07-12 15:59:56 +02:00
Bastien Montagne
e576c19097 Fix (unreported) broken CMake regex to filter RNA C/C++ files.
No idea _why_ the previous regex is not working as expected, AFAICS it
is valid. But it did fill `GENSRC_C` list with all RNA `.cc` generated
files.
2024-07-12 15:52:54 +02:00
Sebastian Parborg
1eaa47c215 Fix: Don't draw spans for out of bounds retiming keys in the VSE
Previously the spans would be drawn even if you had slid the retiming
keys out of bounds of the strip margins, leading to them being drawn out
side of the strip.

Pull Request: https://projects.blender.org/blender/blender/pulls/123438
2024-07-12 15:43:29 +02:00
Sebastian Parborg
7b25d1327e VSE: Hook up sound subframe sliding to the VSE slip modal operator
Updates the slide operator to be able to do subframe adjustments of
audio strips. If you hold shift while sliding (the S shortcut), it will
start to do subframe adjustments. It is also possible to type in
fractional inputs while in modal mode. (IE start sliding then type 1.5)
2024-07-12 15:43:27 +02:00
Sebastian Parborg
fb6aaf3200 VSE: Expose subframe sound offset to the end user
It is now possible to adjust the built in sound offset of the sound
strips.
2024-07-12 15:43:27 +02:00
Sebastian Parborg
f7de07d88b Fix: Positive Sound offsets not working
Regular sound offsets (based on VSE strip offset) only worked with
negative values even if the waveform was draw correctly. Fix so positive
frame offsets does the correct thing.
2024-07-12 15:43:27 +02:00
Jeroen Bakker
14fb537eca Merge branch 'blender-v4.2-release' 2024-07-12 15:41:39 +02:00
Jeroen Bakker
8ac023da61 Fix #124530: EEVEE: Math wrap function not working
Due to incorrect check the result was always returning the min
parameter.

Found issue by comparing the implementation with cycles.
Regression introduced by 7fe7b2eed0

Pull Request: https://projects.blender.org/blender/blender/pulls/124604
2024-07-12 15:40:12 +02:00
Falk David
00a640a482 Cleanup: Remove unnecessary break statements 2024-07-12 14:56:53 +02:00
Jeroen Bakker
d953f6b6f7 Vulkan: Reset command buffer
Previously we create a new command buffer when the render graph is being
submitted. This PR changes that by resetting the command buffer for
reuse.

Pull Request: https://projects.blender.org/blender/blender/pulls/124596
2024-07-12 14:38:42 +02:00
Pratik Borhade
05e7a2f1b2 Fix: Make undo step after renaming socket
This is a regression since the new tree-view is used for nodes.
@mod_moder spotted this in #124546

Pull Request: https://projects.blender.org/blender/blender/pulls/124592
2024-07-12 13:26:02 +02:00
Jacques Lucke
052d011c5e Fix: group input node socket with gizmo does not show label 2024-07-12 13:09:57 +02:00
Jacques Lucke
09c29ed625 Merge branch 'blender-v4.2-release' 2024-07-12 13:00:58 +02:00
Jacques Lucke
eb55d3f0d6 Fix: wrong type cast in previous commit
This was broken in 4c7456677d.
2024-07-12 13:00:30 +02:00
Omar Emara
308b53746b Fix #101263: Vector pass wrongly saved in File Output
The vector pass and potentially other vectors that store 4 values are
stored wrongly, in particular, the last channel is ignored. To fix this
we identify if a vector pass is 4D and store the information in the
result meta data, then use this information to either save a 3D or a 4D
pass in the File Output node.

This is a CPU implementation of the same mechanism in the GPU compositor
implemented in 57a6832b17. The CPU implementation is a bit more complex
because the CPU compositors stores 4D vectors in color images internally
which can lead to information loss in case of implicit conversion when
the File Output has vector sockets. So what we do is force all vector
inputs to the File Output operation to be color, then save that as 3D or
4D depending on the meta data as well as the original UI socket type.

Pull Request: https://projects.blender.org/blender/blender/pulls/124580
2024-07-12 12:53:16 +02:00
Jeroen Bakker
0cbc354b54 Fix: Vulkan: Texture Views ignored array length
The array-length of a texture view isn't stored at the same location as
the array-base and was forgotten that it was a feature what had to be
supported.

Detected when testing `monster.blend` where the SSS object id wasn't
set and lead to missing materials.

**Before**
![image](/attachments/e503a48a-d365-459b-901d-7b72f224e163)

**After**
![image](/attachments/a321494b-042a-4534-a4e0-b864babbd5aa)

Pull Request: https://projects.blender.org/blender/blender/pulls/124590
2024-07-12 12:50:50 +02:00
Christoph Lendenfeld
1a8053939b Fix #106372: Wrong message in driver for disabled execution
When using a python expression, its execution is disabled by
default unless specified differently in the user preferences.
Previously this only produced the error
"Error: Invalid Python expression". However that isn't really the correct error.

Now the error reads "Python restricted for security".

I've added a new flag to the driver `DRIVER_FLAG_PYTHON_BLOCKED` that is set
if the driver can't run because python is blocked

Co-authored by Phillip Oeser

Pull Request: https://projects.blender.org/blender/blender/pulls/124587
2024-07-12 12:37:15 +02:00
Christoph Lendenfeld
780dc67f6d Fix #124125: Depsgraph and scene time out of sync
When quickly running the "frame step" and "insert key" operators it was possible to
run the key insertion when the depsgraph hasn't yet been updated.
Because the key insertion code took the frame from the scene, but the channel values
from the depsgraph, the inserted keys were appearing to be duplicated from a different frame.

The fix is to ensure an evaluated depsgraph is used, so the correct values are placed
at the correct time.

Pull Request: https://projects.blender.org/blender/blender/pulls/124583
2024-07-12 12:09:12 +02:00
Sybren A. Stüvel
d828e9471e Anim: add concept of 'active slot'
Add the concept of 'active slot' within an Action. This allows
clicking on a slot in the Action editor, to select it and mark it as
'active'.

Note that this does _not_ add support for action slots in
`ANIM_set_active_channel()`, as that function doesn't get enough info
to do that, and refactoring it is not on my wishlist.

RNA property `action.slots.active` can be used to access and set the
active slot in Python. `slot.active` can be used to query the slot's
active state, and is read-only (so that there is one way to set the
active slot).

A panel in the Action editor shows info about the active slot. This
panel is just a minimal UI that shows the name and an icon
representing the idtype of the active slot.

Pull Request: https://projects.blender.org/blender/blender/pulls/124422
2024-07-12 11:59:04 +02:00
Lukas Tönne
d0089e6fe1 GPv3: Automerge feature for joining curve endpoints by distance
This implements the _automerge_ feature which finds nearby end points
during stroke draw and merges the new curve with existing strokes.

New utility functions are added in `geometry` for slightly generalized
functionality. The `curves_merge_endpoints` takes an index map that
describes how to connect curves by index. It performs a topological sort
and reorders connected curves into contiguous ranges. This can be used
with an arbitrary number of connected curves. The tool feature itself
only uses a single curve, based on 2D end point positions.

Unit tests have been added for the curve merge utility function.

Pull Request: https://projects.blender.org/blender/blender/pulls/124459
2024-07-12 11:21:23 +02:00
Julian Eisel
fdf10495d0 Cleanup: Fix missing declaration warning
Own error in 99fe6785d0.
2024-07-12 11:18:34 +02:00
Lukas Tönne
3d4b8f91e7 GPv3: Fill tool overlay for extension lines and circles
The (GPv2) fill tool has an "extension" mode to assist with filling
small gaps where strokes don't fully meet.

- Overlay: Draws various helpers during modal fill tool operation, using
  the same functions as the render-to-image used for applying the fill
  tool.
- Extension lines: Scrolling or page up/down extends the tips of strokes
  and draws extra boundary lines to limit filling.
- Extension circles: Press S to toggle the mode. This draws circles
  around stroke tips.
- Stroke overlay: This can be enabled in the brush settings
  (_Advanced > Visual Aids_) to draw strokes in a simple color on top of
  the viewport.
- Extension line collision: Tests for intersections of extension lines
  with other lines and with strokes, and cuts them short. Enable in
  brush settings (_Advanced > Strokes Collision_).
- Better defaults for extension increments: The values are in Blender
  units, and quite arbitrary. Using lower values makes it feel more like
  GPv2 in the 2D animation template.
- Draw functions in the `ed::greasepencil::image_render` namespace now
  consistently expect coordinates in view space (avoids confusion and
  works better for 2D elements).
- Some internal renaming and cleanup (many variable names come from GPv2
  and were not very clear).

Pull Request: https://projects.blender.org/blender/blender/pulls/122771
2024-07-12 11:11:17 +02:00
Nathan Vegdahl
cb38406a94 Fix: Follow Curve constraint/parenting doesn't animate with layered actions
Both the Follow Curve constraint and parenting with the follow curve option
require a property on the Curve ID to be animated if the user wants the
follower object to animate along the curve. However, the fcurve for this
was always getting created as a legacy action fcurve, regardless of whether
the action was actually legacy or not. If the action was layered, this
resulted in the follower object not animating along the path.

The underlying issue was that the code that created the fcurve was using
`action_fcurve_ensure()`, which hadn't yet been updated to work correctly with
layered actions, and thus the fcurve was created as if the action was legacy.

This commit fixes that by updating `action_fcurve_ensure()` to work with
Baklava phase-1 layered actions in limited circumstances, and also
ensuring that the follow curve code passes an appropriate ID RNA pointer
(required to find/create an appropriate Slot).

Pull Request: https://projects.blender.org/blender/blender/pulls/124353
2024-07-12 10:47:32 +02:00
Jacques Lucke
b76a1db907 Merge branch 'blender-v4.2-release' 2024-07-12 10:18:47 +02:00
Jacques Lucke
4c7456677d Fix: correct potentially wrongly initialized curve attributes
The `resolution` and `nurbs_order` attributes of curves are expected to be `>=
1`. Due to a bug, it was possible that they are initialized to zero: #124534.
This fix adds versioning code to fix the curves that have been written
incorrectly.

Pull Request: https://projects.blender.org/blender/blender/pulls/124539
2024-07-12 10:16:45 +02:00
Jacques Lucke
0c57e95f09 Fix: initialize built-in attributes with proper default value
Previously, it was fairly easy to create built-in attributes which have invalid
values, because attributes were generally zero-initialized. This was especially
problematic for attributes that had certain invariants that Blender relies on
and that should never be zero. For example, the curve resolution should always
be at least 1.

To reproduce the issue, add the `resolution` attribute from the attributes panel
to curves. They had a value of 0 by default. I found this while investigating
#124416.

Pull Request: https://projects.blender.org/blender/blender/pulls/124534
2024-07-12 10:12:03 +02:00
Julian Eisel
99fe6785d0 Fix issues with asset shelf context menu operators
Shortcut and quick favorite operators wouldn't show up in the regular asset
shelf. In the popup the shortcut operators would but they crashed with use
after frees.

Basic issue is that activating view-items by applying the button didn't work
well. That messes with button storage, but also the operator data (like
`uiBut.optype`) is unset after applying, in this case before the context menu
was built.

Instead, activate the view-item directly, and call the activate operator in its
`on_activate()` callback. The button shouldn't call this operator again, so
added a way to attach operators to buttons without calling them.

Seems generally useful to be able to attach an operator to buttons for
tooltips, "Assign Shortcut" and the like, without it being called on button
apply.

Pull Request: https://projects.blender.org/blender/blender/pulls/124466
2024-07-12 10:02:10 +02:00
Richard Antalik
6282f62449 VSE: Pass scrubbing and playing state in SeqRenderData
This change simplifies access to this state by prefetching code.
Previously it had to iterate over screens from `bMain` in code local to
prefetching. Now this state is available to other code in VSE.
2024-07-12 07:45:17 +02:00
Sean Kim
70d6926ab9 Cleanup: Restructure and rename relax_face_sets.cc
In preparation for the topology relax brush which shares much of this
code, this commit renames the file and distinguishes between methods
that will and will not be shared between the topology relax and face set
relax brushes.

Pull Request: https://projects.blender.org/blender/blender/pulls/124563
2024-07-12 05:24:13 +02:00
YimingWu
ea56b408ef Fix #124526: VSE: Null check for seq->scene.
In `sequencer_check_scene_recursion`, `seq->scene` can be null which
leads to crashes, thus guard against that.

Pull Request: https://projects.blender.org/blender/blender/pulls/124536
2024-07-12 05:17:59 +02:00
Richard Antalik
d97c4e6606 Merge branch 'blender-v4.2-release' 2024-07-12 04:06:29 +02:00
Richard Antalik
5d9f9f9964 Fix: VSE handle position drawing is reversed
When left handle is selected, right handle position was displayed.

Pull Request: https://projects.blender.org/blender/blender/pulls/124503
2024-07-12 03:59:19 +02:00