Commit Graph

117289 Commits

Author SHA1 Message Date
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
Sergey Sharybin
c70a38798d API: Better documentation of scene.frame_set()
Make it explicit that it updates all view layers.

Ref #133379

Pull Request: https://projects.blender.org/blender/blender/pulls/133536
2025-01-29 12:13:59 +01:00
Jacques Lucke
e1753900b7 BLI: improve UTF-8 safety when copying StringRef to char buffers
Previously, there was a `StringRef.copy` method which would copy the string into
the given buffer. However, it was not defined for the case when the buffer was
too small. It moved the responsibility of making sure the buffer is large enough
to the caller.

Unfortunately, in practice that easily hides bugs in builds without asserts
which don't come up in testing much. Now, the method is replaced with
`StringRef.copy_utf8_truncated` which has much more well defined semantics and
also makes sure that the string remains valid utf-8.

This also renames `unsafe_copy` to `copy_unsafe` to make the naming more similar
to `copy_utf8_truncated`.

Pull Request: https://projects.blender.org/blender/blender/pulls/133677
2025-01-29 12:12:27 +01:00
Philipp Oeser
bf2264a3b8 Cleanup: typo 2025-01-29 10:09:59 +01:00
Philipp Oeser
8703317b81 Fix #133687: editbone transform wrong with hidden connected parent bone
If the parent editbone is hidden, it will (rightfully) not be taken into
account in `createTransArmatureVerts`.
In `recalcData_edit_armature` though, there was the assumption in a
particular code path that "this bone has a parent tip that has been
moved" even though it wasnt (because it was hidden -- see above).

To resolve, guard this code path with a `EBONE_VISIBLE` check.

Pull Request: https://projects.blender.org/blender/blender/pulls/133707
2025-01-29 10:07:27 +01:00
Philipp Oeser
0b97b60b2a Fix #133614: Grease Pencil: Handles wrong after Selection to cursor
Just missing the re-calculating of the handles [we already have a
function for this, just call it]

Pull Request: https://projects.blender.org/blender/blender/pulls/133649
2025-01-29 10:01:30 +01:00
Philipp Oeser
a77e0ccd78 Fix: Curves "Warp" and "Randomize" dont update properly
Resolve by tagging positions as changed.

With this and !133544 (which fixes #133537) we can also expose those operators in the menu.

Pull Request: https://projects.blender.org/blender/blender/pulls/133548
2025-01-29 10:00:05 +01:00
Philipp Oeser
8a45c24f57 Fix: "Affect only origins" does not work for Curves
For this to work, we need to properly support `XFormObjectData` for
`Curves`.

Similar to 50770bd8f5

Part of #103680

Also fixes #133537

Pull Request: https://projects.blender.org/blender/blender/pulls/133544
2025-01-29 09:57:36 +01:00
Campbell Barton
1fdb91c766 License Headers: quiet "check_licenses" warnings 2025-01-29 17:22:51 +11:00
Michael B Johnson
662c1b815c Fix #131459: Treat USD DomeLight options as Lights rather than Materials
This commit moves the Convert World Material checkbox under Materials to
a World Dome Light option "under" Lights. Based on feedback this is more
intuitive for artists. Previously artists would try unchecking "Lights"
and be confused why a DomeLight would still be in their scene.

This is only a UI layout change, API remains unchanged.

Authored by Apple

Co-authored-by: Dhruv Govil <dgovil2@apple.com>

Pull Request: https://projects.blender.org/blender/blender/pulls/131829
2025-01-29 06:56:40 +01:00
Campbell Barton
91fc1c7fac Refactor: split viewport bounds calculation into utility functions
Move 3D viewport bounds calculation out of the operator callbacks
into utility functions, needed for !129594.

Some minor renaming:

- `ok` -> `changed`.
- `ok_dist` -> `do_zoom`.
2025-01-29 14:39:33 +11:00
Harley Acheson
867e9d879a Fix #59358: Don't Show Status Bar Impossible Confirms & Cancels
When performing a transform operation that drags or tweaks, do not show
the Cancel or Confirm keymap item on the Status Bar if they use the
same mouse button that initiated the operation. For example if you are
RCS and are tweaking an object, don't show Cancel on status bar since
that requires right click. If LCS then don't show Confirm (requires
left click) when tweaking, dragging gizmo parts, etc.

Pull Request: https://projects.blender.org/blender/blender/pulls/131336
2025-01-29 03:57:08 +01:00
Campbell Barton
bd1ded952b Cleanup: spelling in comments 2025-01-29 12:31:19 +11:00
Campbell Barton
915ba086ca Cleanup: use EBONE_VISIBLE / EBONE_SELECTABLE to simplify checks
ANIM_bone_is_visible_editbone was being used in situations where the
intention is to check if the bone is visible to the user.

In this case, EBONE_VISIBLE makes more sense as it also accounts
for hidden bones too.
2025-01-29 12:15:54 +11:00
Campbell Barton
73f66f5a72 Transform: use consistent bone visibility checking
Check bone visibility before selection to ensure bones in hidden
collections aren't handled as selected.
2025-01-29 12:15:53 +11:00
Campbell Barton
01e879957c 3D View: add missing calls to force-finish smooth view
Operations that act on the viewport should finish smooth-view first.
2025-01-29 12:15:53 +11:00
Campbell Barton
eb1340517f Fix use after free toggling quad-view 2025-01-29 12:15:53 +11:00