Commit Graph

120055 Commits

Author SHA1 Message Date
Omar Emara
75f1cbb6dd Refactor: Clarify code around scheduling composite nodes
There is a special case in the compositor code where viewer nodes are
treated as composite nodes. This patch renames relevant methods and
updates comments to clarify this use case.

Pull Request: https://projects.blender.org/blender/blender/pulls/133811
2025-01-31 07:43:00 +01:00
Omar Emara
5fd5685a6a Compositor: Allow repeating in the Translate node
This patch changes how the Wrap option in the Translate node works. It
now repeats infinitely when realized, and not just in its own domain.
This is essentially how it used to work prior to version 4.2, so we are
reverting that change. We also rename Wrap to Repeat for clarity.

This is part of an ongoing to project to allow the user to control how
boundaries and empty areas are filled after transformations. So similar
options will be added to all transform nodes. But this patch is the
first step, since the functionality is already there, we just need to
extend it to work in all domains.

Pull Request: https://projects.blender.org/blender/blender/pulls/133766
2025-01-31 07:41:40 +01:00
Campbell Barton
09cf9caa75 Docs: clarify doc-strings for edit-bone selection & visibility
Ref !133743
2025-01-31 15:43:52 +11:00
Campbell Barton
2be282a8f3 Cleanup: spelling in comments (check_spelling target) 2025-01-31 13:27:05 +11:00
Jonas Holzman
8a2336bf0a Cleanup: Remove unused variable 2025-01-30 21:32:05 +01:00
Hans Goudey
8e13b2b048 Fix: Missing subtype for Points node position input 2025-01-30 14:31:02 -05:00
Harley Acheson
224dffc41b UI: Corrections for Object Scale Warnings
Small changes to the status bar display when the active object has non-
uniform or negative scale. Use CTX_data_active_object rather than
BKE_view_layer_active_object_get. Case correction for a text string.
Small spacing change. Improved comments.

Pull Request: https://projects.blender.org/blender/blender/pulls/133834
2025-01-30 20:10:22 +01:00
Hans Goudey
c2fd4eb9cc Cleanup: Deduplicate custom VectorSet identifier hash and equality
Add `CustomIDVectorSet` for this purpose.
Based on code from Jacques in #133778.

Pull Request: https://projects.blender.org/blender/blender/pulls/133821
2025-01-30 19:51:40 +01:00
John Kiril Swenson
cc97c55515 Cleanup: VSE: Replace usage of find_nearest_seq
The original function did extensive calculations to get the nearest handle,
even though none of the calling functions used that information.

Its functionality was very similar to `mouseover_strips_sorted_get`, except
that it was less precise and did not factor in `STRIP_OFSBOTTOM/OFSTOP`.
`mouseover_strips_sorted_get` is called by
`ED_sequencer_pick_strip_and_handle`, so update all of the calling functions to
use this instead.

Refactor and replace `find_nearest_seq` into `mouseover_strip_get`, which does
not factor in padded strip handles, and is used only by
`ED_sequencer_special_preview_set` as a static function for scrubbing over
strips.

Pull Request: https://projects.blender.org/blender/blender/pulls/133744
2025-01-30 18:57:30 +01:00
Harley Acheson
46a418e7b5 UI: Status Bar Display for Key Blending
For all 12 items in the Graph Editor Key Blend menu, improve the
display of the status bar by using icons, state highlighting, etc.

Pull Request: https://projects.blender.org/blender/blender/pulls/133461
2025-01-30 18:49:26 +01:00
Harley Acheson
06a43d7d99 UI: Object Scale Warnings
Show warnings on the status bar during idle time (not running any
operators) when the active object has non-uniform or negative scale.

Pull Request: https://projects.blender.org/blender/blender/pulls/132969
2025-01-30 18:09:46 +01:00
Hans Goudey
9c94c3803f Cleanup: Follow style guide for public member naming 2025-01-30 11:27:14 -05:00
Laurynas Duburas
a806f1c866 Curves: Optimization of ed::curves::duplicate_points
Adds new function `foreach_content_slice_by_offsets` that gathers mask's
indices into `IndexRange` lists grouped by given offsets. New approach
doesn't need temporary `points_to_duplicate` array of size
`curves.points_num()`. Traversal is more effective as only selected
indices get visited. Also point data is copied by point ranges instead
of point by point.

Performance was tested with following code:
```cpp
TEST(curves_geometry, DuplicatePoints)
{
  CurvesGeometry curves = create_basic_curves(100000, 100);

  IndexMaskMemory memory;
  IndexMask every_second = IndexMask::from_predicate(
      curves.points_range(), GrainSize(100), memory, [](const int i) {
        return bool(i % 2);
      });

  for (const int i : IndexRange(1000)) {
    CurvesGeometry copy = curves;
    const int expected_point_count = copy.points_num() + every_second.size();
    ed::curves::duplicate_points(copy, every_second);
    EXPECT_EQ(copy.points_num(), expected_point_count);
  }
}
```
|          |   main   | mask slices | slices & copy by ranges |
| -------- | -------- | ----------- | ----------------------- |
| full copy|  3346 ms | 2270 ms | 1614 ms |
| `i % 2`  |  8084 ms | 5918 ms | 5112 ms |
| `!((i % 10 == 0) or` <br/>`(i % 10 == 1) or` <br/>`(i % 10 == 2))` | 4522 ms | 2860 ms | 2343 ms|
| `(i % 10 == 0) or` <br/> `(i % 10 == 1) or` <br/> `(i % 10 == 2)`| 4088 ms | 1961 ms | 1639 ms|
| `IndexRange(50020, 70)` <br/> <sub>(one small range in the middle)</sub>| 1966 ms | 100 ms | ~75 ms |

Pull Request: https://projects.blender.org/blender/blender/pulls/133101
2025-01-30 17:19:16 +01:00
Harley Acheson
40eadc75be UI: Transform Feedback for Invalid States
This adds support for Transform MouseInputMode INPUT_ERROR using a new
transform cursor HLP_ERROR (dashed line ending with WM_CURSOR_STOP.
This is shown when attempting an object rotation or scale when
transforms are set to "Affect Only Locations". At this time the status
bar is also cleared and an warning message is shown.

Pull Request: https://projects.blender.org/blender/blender/pulls/132957
2025-01-30 17:11:14 +01:00
Philipp Oeser
fd9f046db2 ANIM: remove redundant BONE_SELECTED check
This is already included in the EBONE_EDITABLE macro

Pull Request: https://projects.blender.org/blender/blender/pulls/133661
2025-01-30 16:40:49 +01:00
Philipp Oeser
4fc6d7685b Fix #133635: "Move to Collection" acts on EditBones in hidden groups
Operators should not act on non-visible entities really.

Posemode already did the combination of "visible and selected" via
`FOREACH_PCHAN_SELECTED_IN_OBJECT_BEGIN`, editmode didnt.

To resolve, add `EBONE_VISIBLE` as a condition (as done elsewhere).

Pull Request: https://projects.blender.org/blender/blender/pulls/133660
2025-01-30 16:40:21 +01:00
Jeroen Bakker
4dbb9b34c6 Fix: Vulkan: Compositor cryptomatte
When using cryptomatte the last identifier was never used due to a
memory alignment issue. Scalar types should not be aligned, but they
were.

Pull Request: https://projects.blender.org/blender/blender/pulls/133815
2025-01-30 15:51:09 +01:00
Hans Goudey
ce5bdecf89 Refactor: Use VectorSet for panels, menus, gizmos, lists, operators
Previously, the global storage of these types either used a GHash or a
blender::Map. VectorSet is preferrable to GHash because it's type safe,
clearer, and faster. It's preferrable to Map because the key doesn't
have to be duplicated and because iteration is faster.

This PR moves these registered types to VectorSet, just like the
node, node socket, and node tree types. Note that none of these types
use RAII for allocation, so freeing is still done manually.

Testing was manually interacting with each of these systems, including
with addons that register their own types.

Pull Request: https://projects.blender.org/blender/blender/pulls/133778
2025-01-30 15:35:00 +01:00
Clément Foucault
6ab4e99cf7 Fix #133645: Metal: Crash when activating EEVEE on MacOS 13.7.2 with AMD
This was caused by the subpass input workaround for non-tilebased
GPU using `texelFetch` on an `image`. This was supported before
the cleanup 9c0321ae9b.
But is against the GLSL specification and was removed inside the
cleanup.

Using `imageLoad` instead of `texelFetch` fixes the crash.
However rendering seems to be broken for other reasons.
2025-01-30 15:32:17 +01:00
Janne Nylander
74b3605be2 Grease Pencil: Allow "Show All" to reveal Layer Groups
Currently the "Show All" layer operator operator only enables visibility
for layers only. If the Grease Pencil object has layers that are children
to a Layer Group that is hidden, these layers would not be revealed
to the user.

This pull request modifies the grease_pencil_layer_reveal_exec function
to iterate through Layer Groups present in the object and sets them visible.

Pull Request: https://projects.blender.org/blender/blender/pulls/133613
2025-01-30 15:07:06 +01:00
Hans Goudey
ada6059d7a Cleanup: Remove unused include 2025-01-30 08:57:09 -05:00
Aras Pranckevicius
2b39897d18 Fix #133799: render of VSE 10/12bpp videos broken unless source strips are float
10/12bpp movie writing code assumes that input image is properly
floating point for these cases. That is always true for regular
rendering, however VSE can produce 8bpp images, if there
are no float/HDR strips in there. Make these convert into a float
image in the render pipeline when needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/133802
2025-01-30 14:55:41 +01:00
Lukas Tönne
b85e2d492d Fix #133720: Grease Pencil fill operator always enters modal operation
If the "Visual Aids" option (aka. "show extension lines") is disabled
the operator should just apply and exit immediately.

Pull Request: https://projects.blender.org/blender/blender/pulls/133809
2025-01-30 14:24:59 +01:00
Philipp Oeser
0d37f36ae8 Fix #133762: Grease Pencil does not name new vertex groups as bones
Was just getting the default name, but if we also have a bone selected
in weightpaint mode, these should be named after the bone (otherwise the
armature modifier does not deform accordingly).

To resolve, basically do the same we do for meshes in
`ED_wpaint_ensure_data`.

Pull Request: https://projects.blender.org/blender/blender/pulls/133804
2025-01-30 14:20:01 +01:00
Philipp Oeser
ae8bd075e5 Fix #133480: Missing animation data conversion on Opacity modifier
Both "factor" and "hardness" were renamed from GPv2 > GPv3.
Use AnimDataConvertor to account for this.

Pull Request: https://projects.blender.org/blender/blender/pulls/133476
2025-01-30 14:19:30 +01:00
Lukas Tönne
3be9f3d599 Fix #133516: Add basic support for radial control in the primitive operator
This adds another operator mode for changing brush radius and opacity while the
modal primitive operator is running. It's based on the `wm.radial_control`
operator but only implements simple mouse control for these two properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/133675
2025-01-30 14:09:42 +01:00
Jeroen Bakker
4b99bc8515 Fix: Renderdoc: Corruption in debug stack
In renderdoc the debug stack got corrupted when render graphs where
reused. The previous usage didn't clear the stack. This PR clears
the debug stack when render graphs are reset.
2025-01-30 13:46:21 +01:00
Jonas Holzman
22582bf6f0 UI: Node Editor Color Drag & Drop Support
This patch adds support for drag and dropping colors (from color buttons) into
the Compositing, Shading and Geometry node trees.

Additional support was added for dragging and dropping colors with an Alpha
component (which was previously ignored), both in the context of the Node Editor
and for Color Buttons in general. This handles cases like drag and dropping a
color from an RGB to an RGBA button, which recreates the color with a default
Alpha value of 1.0.

Pull Request: https://projects.blender.org/blender/blender/pulls/129026
2025-01-30 12:37:15 +01:00
Omar Emara
7f4cf5a949 Fix #124566: Compositor Normal node does not update
Changes to the compositor Normal node does not propagate and the
compositor result is not updated. That's because the node is a special
case since its output socket value is used as its input property, which
is not tracked by the node update code.

Apparently, a similar node exists in shader nodes, and a workaround is
implemented for that node in the node updater, so we just need to extend
that check to include the compositor node as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/133803
2025-01-30 11:45:59 +01:00
Pratik Borhade
a1d31ca412 Core: Always Compress quit.blend file
Similar to !132685 / 2a85a27609, compress quit.blend that is generated
after closing blender.

Pull Request: https://projects.blender.org/blender/blender/pulls/133694
2025-01-30 11:43:13 +01:00
Pratik Borhade
600ffd3568 Fix #133768: Grease Pencil: Select strokes with active material fails
Caused by fd83be0fa5. Following `if()` condition doesn't seem useful. Entire
curve range is returned when no material is locked and active material
index is ignored.

Pull Request: https://projects.blender.org/blender/blender/pulls/133798
2025-01-30 11:17:30 +01:00
Sybren A. Stüvel
6d832ee5b3 Anim: refactor keyframe copy/paste code
Refactor the keyframe copy-paste code to prepare for supporting action slots.

This is a non-functional change, as the slots are stored but otherwise completely ignored. This way the refactor to the new data structure can be reviewed & tested before actually changing the behaviour.

Related: #129690
Pull Request: https://projects.blender.org/blender/blender/pulls/133497
2025-01-30 10:28:45 +01:00
Nathan Vegdahl
77f4fd2637 Cleanup: Anim: rename *_move() methods to *_move_to_index()
There were three methods with succinct but slightly unclear names:

- Action::slot_move()
- Channelbag::channel_group_move()
- Channelbag::fcurve_move()

The ambiguity is due to other functions with similar names that e.g.
move fcurves *between* Channelbags, etc. Whereas these methods only move
items to other positions within the array they're already in.

To make this clearer, this PR adds `_to_index` to the end of these
array-oriented methods.

Pull Request: https://projects.blender.org/blender/blender/pulls/133730
2025-01-30 10:24:47 +01:00
Sergey Sharybin
0c4e76fb78 Fix #125642: Cycles OptiX background render crash with GPU compositor
Apple same workaround for driver issue as was done for grease pencil,
the OpenGL context needs to be initialized before OptiX.

Pull Request: https://projects.blender.org/blender/blender/pulls/133759
2025-01-30 08:49:06 +01:00
Philipp Oeser
b1b7e82f25 Fix #97021: Viewroll doesn't respect QuadView's 'Lock Rotation'
The current poll function uses `ED_view3d_context_user_region` [which
falls back to `ED_view3d_area_user_region` if the context region is
flagged `RV3D_LOCK_ROTATION`, so it finds the non-locked region in quad
view]. So in a way it is permissive to do the roll even when we are
within one of the quad regions which is actually locked. This can be
useful if we just want to roll by a specific angle or use one of the
types `V3D_VIEW_STEPLEFT`/`V3D_VIEW_STEPRIGHT` - these are then executed
in the non-locked region.

However for mouse-interacting roll, we should not do this at all when
initiated from a locked region.

To resolve, we could use `view3d_rotation_poll`  (instead of
`ED_operator_rv3d_user_region_poll`), but that would prevent us from the
useful scenarios mentioned above. So instead, once we reach the mouse-
interacting code path, check again if we are really in a non-locked
region and only proceed if we are.

Pull Request: https://projects.blender.org/blender/blender/pulls/133643
2025-01-30 07:30:28 +01:00
Campbell Barton
7de7ea350c Cleanup: quiet compiler warning 2025-01-30 14:33:25 +11:00
Campbell Barton
c86d3b429e Cleanup: spelling in comments 2025-01-30 14:18:40 +11:00
Campbell Barton
3d68af0cf2 Cleanup: use ELEM macros for clarity
Also use shorter "uchar" type.
2025-01-30 14:18:40 +11:00
Harley Acheson
d62c143ab7 Refactor: Separated Functions from uiTemplateInputStatus
Just separating out two blocks of code into separate functions to make
it more readable. No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/133785
2025-01-30 00:31:27 +01:00
Howard Trickey
b2998848c5 Fix #109765 - Prevent Dissolve Edges from dissolving verts...
that are unrelated to the selected edge,
See https://projects.blender.org/blender/blender/issues/109765 .
This comes from PR https://projects.blender.org/blender/blender/pulls/131645
by jcwenger.
2025-01-29 16:26:46 -05:00
Jesse Yurkovich
7754a776e5 Cleanup: USD: Remove unused token values
Remove dead TfToken values that are not used.

Pull Request: https://projects.blender.org/blender/blender/pulls/133777
2025-01-29 21:25:15 +01:00
Jesse Yurkovich
a6ad8f4fd9 Cleanup: USD: Pass struct by ref and add more tests for scaling options
- There's only a few unit conversion options, just test all of them
- Use reference instead of pointer when passing export settings struct
- Organize scaling struct fields to keep similar options together

Pull Request: https://projects.blender.org/blender/blender/pulls/133774
2025-01-29 20:03:36 +01:00
Hans Goudey
ca64f2f7e7 Cleanup: Use StringRef instead of StringRefNull 2025-01-29 12:49:41 -05:00
Bartosz Kosiorek
5bcde9cbff UI: Make colorspace tooltips more useful for non English languages
Use longer descriptions for colorspace tooltips that better explain the
meanings of the acronyms.

Pull Request: https://projects.blender.org/blender/blender/pulls/119810
2025-01-29 18:46:38 +01:00
Habib Gahbiche
b51c560f6e Compositor: Implement shortcuts for Viewer nodes
Artists often want to quickly switch back and forth between two or more nodes while compositing.

This patch implements two operators `NODE_OT_viewer_shortcut_set` and `NODE_OT_viewer_shortcut_get` that allow users to map a viewer node to a shortcut. For example, pressing `cltr+1` while a node is selected, assigns that node to the shortcut `1`, creates a viewer node if it has none attached and sets that viewer node to active. Pressing `1` will set the active node with shortcut `1` to active.

Shortcuts are saved in DNA to preserve them after saving/loading blend files.

Limitations:
- Only compositor node tree is supported, because shading editor has no viewer node and geometry nodes viewer works differently.

Pull Request: https://projects.blender.org/blender/blender/pulls/123641
2025-01-29 18:35:26 +01:00
Habib Gahbiche
5eb8101efa UI: Show error if drag and drop of images fail
Adding an image object using drag and drop can fail without an apparent reason.

This patch shows an error when this happens so that the user can react accordingly (in this example switch to object mode, add the image and switch back to edit mode).

Pull Request: https://projects.blender.org/blender/blender/pulls/132994
2025-01-29 18:31:00 +01:00
Harley Acheson
1a2b126d5c UI: Simplification of Grease Pencil Fill Status Bar
Use icons and state highlighting to simplify the status bar display in
“Grease Pencil Fill” (GREASE_PENCIL_OT_fill).

Pull Request: https://projects.blender.org/blender/blender/pulls/133247
2025-01-29 18:19:13 +01:00
Omar Emara
2b2b27abf5 Fix #133565: Single value nodes wrongly return an image
In certain setups, nodes whose inputs are single value and whose outputs
are expected to be single value wrongly return an image. That's because
they wrongly join a pixel operation that operates on images.

To fix this, we split pixel operations by their value types. Single
value sub-trees get compiled into their own pixel operation and none
single value sub-trees get compiled into their own pixel operation.

This might unfortunately break up a long chain of pixel operations if
one of them was single value. This is solvable, but will require more
time and research, so we need to fix the bug first then look into it.

Pull Request: https://projects.blender.org/blender/blender/pulls/133701
2025-01-29 15:13:45 +01:00
Michael Kowalski
e021cf0491 Fix: USD export: missing prototype proxies
The scene graph instancing export code contains logic for
determining which instances need to be converted to prototypes
because the original prototypes are not included in the export
(e.g., because they are not visible).

This commit fixes an error in this logic, which incorrectly
assumed that if the root of the original prototype is included
in the export, then the entire original hierarchy beneath the
root is included as well.

To fix this, the logic in AbstractHierarchyIterator::
determine_duplication_references was updated so that if any
descendants of an instance are converted to prototypes, the
parent instance is converted to a prototype as well.

This addresses the bug noted by Brecht in
https://projects.blender.org/blender/blender/pulls/131707#issuecomment-1403309

Pull Request: https://projects.blender.org/blender/blender/pulls/133750
2025-01-29 14:05:52 +01:00
Omar Emara
c786b385ee Fix #133729: Crash when appending Glare node group
Blender crashes when appending a node group containing a Glare node from
older versions. That's because the Glare node is versioned taking the
scene resolution into account, and in case of appending a node group,
there is associated scene, and accessing a nullptr scene causes the
crash.

To fix this, assume some default resolution in cases where the node
can't be associated with a scene.
2025-01-29 14:19:02 +02:00