Commit Graph

120055 Commits

Author SHA1 Message Date
Harley Acheson
d9971d6414 UI: Detailed Large File & Folder Icons
Changes to the icons used for document and folder when in thumbnail
view in File Browser. A bit more detail, less chunky, more in tune
with OS versions. Better match for the recent increased fidelity of
the "type" icons that are shown in their centers.

Pull Request: https://projects.blender.org/blender/blender/pulls/126760
2024-08-29 20:49:55 +02:00
Hans Goudey
69add5aa47 Cleanup: PBVH: Standardize some usage of node grid indices
- Call the data pointers "elems" and the grid indices "grids"
- Remove null check that really shouldn't be necessary
- Use Span and range based for loops
- Use accessor function instead of raw node field access
2024-08-29 14:12:26 -04:00
Hans Goudey
9791625ae3 Cleanup: PBVH: Add accessor for node triangle indices 2024-08-29 14:11:17 -04:00
Hans Goudey
347ec1acd7 Refactor: Sculpt: Switch to new API for BVH node selection & data access
Use `IndexMask` for a selection of nodes, and remove the temporarily
added type-agnostic functions for PBVH node data access. This change
results in a lot of boilerplate change since all iteration over nodes is
affected, and the proper types for nodes need to be used to access
their data.

Until leaf and inner nodes are split, the `all_leaf_nodes` function has
an unfortunate signature now since it needs to return an `IndexMask`
as well. That should be simplified in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/126944
2024-08-29 19:34:22 +02:00
Nathan Vegdahl
1c1e389d4b Refactor: misc improvements to the channel groups code
Addressing post-landed review comments from @dr.sybren in #125774.

These changes are all refactors and cleanups, and should have no functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/126822
2024-08-29 19:12:45 +02:00
Jacques Lucke
df59028d0b Geometry Nodes: use different icons for warning and error messages
Pull Request: https://projects.blender.org/blender/blender/pulls/126936
2024-08-29 18:04:49 +02:00
Christoph Lendenfeld
0c2e162557 Fix #126137: Unable to create pose asset with layered action
The issue was that the `id_root` property can be 0,
but the enum doesn't officially support this value.

The fix is to create a new function `rna_id_root_itemf`
that dynamically creates the enums, which is basically
`rna_enum_id_type_items` + an extra entry for 0.

Pull Request: https://projects.blender.org/blender/blender/pulls/126837
2024-08-29 17:45:16 +02:00
Julian Eisel
6f1676acc9 Fix: UI: Missing properties texture tab when entering image paint mode
When opening an image editor and setting that do "Paint" mode, the
navigation bar in the properties editor wouldn't redraw to display the
texture tab.
2024-08-29 16:41:08 +02:00
Jacques Lucke
e8b81065bc Geometry Nodes: support custom warnings in node groups
This implements the `Warning` node that allows node groups to communicate
expectations about input values to the user.

By default, the `Warning` node is only evaluated if the node group that contains
it is evaluated in any way. This is better than always evaluating it, because
that could trigger lots of unnecessary evaluation in parts of the potentially
large node tree which should be ignored. In this basic mode, the output of the
node should not be connected to anything and it must not be in a zone.

For more fine-grained control for when the `Warning` node should be evaluated,
one can use the boolean output which is just a pass-through of the `Show` input.
If this output is used, the `Warning` node will only be evaluated if its output
is used. A simple way to use it is to control a Switch node with it that e.g.
"disables" a specific output when the inputs are invalid. In this case, the
`Warning` node may also be in a zone.

The node allows the user to choose between 3 severity levels: Error, Warning and
Info. Those are the same levels that we use internally. Currently, the error and
warning mode are pretty much the same, but that may change in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/125544
2024-08-29 16:03:25 +02:00
Jonas Holzman
4449fba2f3 Obj-C Refactor: Remove unsound use of const in Objective-C code
The use of `const` for Objective-C object pointer is not standard and
generally unsound. Unlike a C++ class, which has support for const and
non-const methods. An Objective-C object will still respond to mutable
selectors even if its object pointer is const, making it semantically
useless.

Another problem with const Objective-C object is that they cannot be
properly passed into other Objective-C object selectors due to type
differences. Even if that selector didn't modify the underlying object.

For consistency with general Objective-C code style guidelines, usage of
const pointer syntax (`Class *const`) were also removed.

Ref #126772

Pull Request: https://projects.blender.org/blender/blender/pulls/126768
2024-08-29 15:59:07 +02:00
Sybren A. Stüvel
090c7aa68e Anim: add operator for creating a new Action Slot to the dope sheet header
Add new operator `anim.slot_new_for_object`, which creates a new action
slot for the active object. Since this slot is created on the action
used by the object, it requires that this action exists and is a
layered/slotted action (which by definition includes empty actions).

Pull Request: https://projects.blender.org/blender/blender/pulls/126934
2024-08-29 15:37:03 +02:00
Bastien Montagne
b6e022d913 BPY/RNA: Add a note to ObjectBase documentation that it is never exposed.
Blender Python API does not expose the 'base' object data currently (it
always converts it to the actual object).
2024-08-29 15:27:36 +02:00
Campbell Barton
0f3793205d Fix #126852: "Lock Camera to View" crashes after "Reload Scripts"
Tag gizmos to be re-created when reloading scripts.
2024-08-29 23:09:43 +10:00
Nathan Vegdahl
9d49c1c622 Fix: respect ANIMFILTER_FCURVESONLY in animation filtering code
The code for filtering slots was still including channel groups even
when `ANIMFILTER_FCURVESONLY` was set. There were no apparent behavioral
issues resulting from this, but the code was semantically incorrect.

This fixes the code by excluding channel groups when
`ANIMFILTER_FCURVESONLY` is set.

Pull Request: https://projects.blender.org/blender/blender/pulls/126926
2024-08-29 14:35:31 +02:00
Nathan Vegdahl
73c1ceb18b Fix: channel groups in duplicated channel bag point to old bag
In layered actions, the channel groups in a channel bag hold a
non-owning pointer to the channel bag they belong to, to allow looking
up the fcurves in the group. However, when a duplicate was made of a
channel bag, those pointers in the (also duplicated) channel groups
weren't updated to point at it, and thus were still pointing at the
original channel bag.

This commit adds the code to properly update those pointers when
duplicating channel bags.

Pull Request: https://projects.blender.org/blender/blender/pulls/126923
2024-08-29 14:33:51 +02:00
Philipp Oeser
743e24a86b Fix #126869: frame navigation keymap missing from relevant sidebars
Affected NLA, Dopesheet, Timeline

Region needs `ED_KEYMAP_FRAMES` flag to initialize the corresponding
"Frames" keymap.

Basically the same as cd1d6d7770 , but now also for `space_nla` &
`space_action`

Pull Request: https://projects.blender.org/blender/blender/pulls/126918
2024-08-29 14:20:46 +02:00
Bastien Montagne
9506fed905 Refactor: Move some Editors' data allocation from C alloc/free to C++ new/delete.
Part of the effort to make PointerRNA non-trivial (#122431).
2024-08-29 14:20:37 +02:00
Hans Goudey
784b418475 Cleanup: Use simpler method to convert boolean array to bits 2024-08-29 08:19:36 -04:00
Jacques Lucke
acda21e055 Cleanup: move inline method definitions out of class
This makes it easier to scan the API.
2024-08-29 13:43:26 +02:00
Pratik Borhade
28ed225100 Fix #126860: Outliner Delete skips selected child collections
`collection_collect_data_to_edit` blocks the tree_traverse once a
valid selected collection is found. This prevents delete operation
from deleting child collection when selected. To fix this, introduce a
new boolean `is_recursive`. When this is true, callback function will
return `TRAVERSE_CONTINUE` to continue the walk to  children.

Pull Request: https://projects.blender.org/blender/blender/pulls/126883
2024-08-29 13:31:55 +02:00
Pablo Vazquez
b885562ba7 UI: Rename Asset Browser "All" to "All Libraries"
To avoid having two "All" (libraries, and catalogs) entries close
together. Tell libraries apart by renaming "All" to "All Libraries".

Pull Request: https://projects.blender.org/blender/blender/pulls/125714
2024-08-29 12:28:07 +02:00
Jacques Lucke
66adedbd78 BLI: optimize constructing IndexMask from bits and bools
This patch optimizes `IndexMask::from_bits` by making use of the fact that many
bits can be processed at once and one does not have to look at every bit
individual in many cases. Bits are stored as array of `BitInt` (aka `uint64_t`).
So we can process at least 64 bits at a time. On some platforms we can also make
use of SIMD and process up to 128 bits at once. This can significantly improve
performance if all bits are set/unset.

As a byproduct, this patch also optimizes `IndexMask::from_bools` which is now
implemented in terms of `IndexMask::from_bits`. The conversion from bools to
bits has been optimized significantly too by using SIMD intrinsics.

Pull Request: https://projects.blender.org/blender/blender/pulls/126888
2024-08-29 12:15:33 +02:00
Jacques Lucke
491df9df6f Fix #126836: frame node labels are hidden by zones 2024-08-29 12:13:46 +02:00
Julian Eisel
48208ab2d8 Physics: Show texture properties tab when fluid modifier uses texture
Investigation into #126306 showed that the texture tab shown would actually be
for the active image paint brush, but people used it to set up a texture for
the fluid modifier settings anyway. Now properly register the texture user for
the UI, so the texture properties tab will always be displayed when there is a
fluid modifier with a "Flow" fluid type.

Main issue is that fluid modifiers weren't handled by the
`BKE_modifiers_foreach_tex_link()` iterator.

While this could be handled as another special case in
`buttons_texture_modifier_foreach()`, I updated the texture-link iterators to
support texture properties that are not directly stored in the modifier, but in
some nested data. Seems like this should be supported generally. It's enabled
here by passing a pointer-property pair, rather than just a property name.

Pull Request: https://projects.blender.org/blender/blender/pulls/126893
2024-08-29 12:08:50 +02:00
Sybren A. Stüvel
c9f147d301 Fix #126783: Anim: keying will select previously-assigned Slot
Fix an issue that was caused by common code used for both these flows:

- 'ensure a slot exists for an ID so keys for it can be inserted' and
- 'assign an Action to an ID'

Both flows search for suitable slots for the ID, but should do so in
subtly different ways. Most importantly, the first case should _not_
search a slot by name (when an Action is already assigned but not a
slot). This is relevant in the following flow:

- Assign an Action to an Object. This auto-selects the most appropriate
  slot (by name).
- Un-assign the slot (for whatever reason it's not desired).
- Insert a key.
- This should create a new slot, and not re-assign the slot just
  un-assigned above.

Pull Request: https://projects.blender.org/blender/blender/pulls/126850
2024-08-29 12:07:58 +02:00
Jacques Lucke
925bed91c7 Fix: mutable parameter should not be const
This worked fine when passing in a `MutableBitSpan` to `invert`, but not when
passing in a `BitVector`.
2024-08-29 11:15:54 +02:00
Campbell Barton
d497452a73 Cleanup: typo, spaces in comments, comment blocks & use double quotes 2024-08-29 17:16:44 +10:00
Campbell Barton
4ed0d9f30e Cleanup: spelling in comments 2024-08-29 17:16:42 +10:00
Campbell Barton
d1139277a0 Cleanup: add missing include 2024-08-29 17:16:41 +10:00
Jeroen Bakker
e82ba8d495 Vulkan: Incorrect buffer size when allocating large buffers
When 'really' large buffers are allocated the incorrect clamping
function was used and the actual buffer allocated was smaller than
expected.

This was detected during investigation of #126863.

Pull Request: https://projects.blender.org/blender/blender/pulls/126915
2024-08-29 08:55:02 +02:00
Aras Pranckevicius
528471541b VSE: Faster and more consistent thumbnails
Implementing part of design outlined in #126087.

- VSE thumbnail cache has a new implementation, hopefully simpler
  and easier to understand.
    - Instead of cache key being a VSE strip, frame index, plus
      complicated logic for cache items linking etc.,
    - The cache is keyed by media file path (if multiple strips
      use the same input file, they will share cache entries), frame
      index within media file, and any extra data (e.g. steam index
      for multi-steam videos)
- Much reduced cache flickering and strange/weird thumbnail choices.
    - Likewise, thumbnails no longer disappear-and-reload on operations
      like Undo, dragging new video strip into timeline, or F12 render.
- Thumbnails now load faster.
    - Images use dedicated/faster thumbnail loading routines when a
      format can do that (e.g. JPG and EXR can).
    - Movies reuse ffmpeg decoding context for neighboring strips
      that use the same file (as often happens when cutting footage)
    - Thumbnail requests are processed on several threads now too.

Images and more detail in PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/126405
2024-08-29 08:27:12 +02:00
Campbell Barton
ef174d1e81 Cleanup: remove logic for un-subdivide to support hidden faces
Revert [0] which intended to support hidden geometry but didn't
entirely fix #99887 which was reported again as #122786.

[0]: 00e2f55239
2024-08-29 14:56:53 +10:00
Campbell Barton
53072345cb Cleanup: simplify BMesh API use & avoid redundant checks
- Avoid counting elements when it's not needed.
- Pass multiple elements to functions instead of calling multiple times.
2024-08-29 14:48:00 +10:00
Campbell Barton
86f2c120f2 Fix multi-res un-subdivide skipping faces & leaking memory
When unsibdivide ran with quads that share shared two edges,
only one of the loops attached to the vertex would have its grid
initialized (multiple times), skipping the other loops grid calculation
and leaking memory.
2024-08-29 14:47:59 +10:00
Campbell Barton
2cc395be06 Fix #126633: Multi-resolution modifier un-subdivide freezes
Hidden geometry caused an eternal loop in the un-subdivide internal
logic.

Also fix the un-subdivide operator leaving an invalid selection,
where faces where unselected while all their edges were selected.
2024-08-29 14:47:58 +10:00
Harley Acheson
04652334f3 UI: Fix Docking Issue With No Overlay
Docking uses window overlays during feedback and these have to be
stopped and changed if you move the target from window to window.
The logic of changing the window that gets the overlay will sometimes
fail when the target window is null and old window was null - it
gets stopped (because they are equal) but not started again. This PR
just adds a check for null window.

Pull Request: https://projects.blender.org/blender/blender/pulls/126906
2024-08-29 04:36:49 +02:00
Arius-Cr
db5cd39a67 Fix incorrect location from SpaceText.region_location_from_cursor
The resulting location was incorrect because the offset didn't account
for multi-byte characters and the logic had not been updated to use the
TXT_LINE_HEIGHT macro.

Also removes use of `goto` in favor of early return.

Ref !126720.
2024-08-29 11:42:49 +10:00
Hans Goudey
e0733e0bca Cleanup: Formatting 2024-08-28 16:21:22 -04:00
Hans Goudey
2d9a3e2593 Cleanup: Make PBVH tree constructor explicit 2024-08-28 15:14:56 -04:00
Hans Goudey
44e765bc7c Fix: Typo in recent node splitting change 2024-08-28 15:14:56 -04:00
Sean Kim
d42aec3cf7 Cleanup: Replace raw float[4] for math::Quaternion
Part of #126672

Also removes a "valid" boolean value in favor of using `std::optional`.

Pull Request: https://projects.blender.org/blender/blender/pulls/126725
2024-08-28 20:53:02 +02:00
Sean Kim
bb97131bb9 Fix #126713: Sculpting with shape keys produces artifacts
Brushes that were verified to be impacted by this:
* Clay
* Smooth
* Cloth

Brushes that were verified to not be impacted:
* Draw
* Blob

There is some dependency within the brush code that expects that the
`ss.deform_cos` variable is not updated during the middle of the stroke.
This commit only deals with fixing the immediate user-facing issue, for
a longer-term or more comprehensive fix, it is likely that these values
should not be touched at all inside the `sculpt_update_object` function
but should instead be initialized somewhere else so that the lifecycle
is more obvious and maintainable.

Pull Request: https://projects.blender.org/blender/blender/pulls/126803
2024-08-28 20:51:10 +02:00
Bastien Montagne
08c0f1adcb Refactor: Make gizmo use more C++ features, and new/delete allocations.
This mainly move some allocated data to new/delete, and storage of
operators data to a blender::Vector.

Part of the effort to make PointerRNA non-trivial (#122431).

Pull Request: https://projects.blender.org/blender/blender/pulls/126855
2024-08-28 17:46:19 +02:00
Bastien Montagne
39867e84d3 Cleanup: make format. 2024-08-28 17:26:20 +02:00
Bastien Montagne
bb43726ddd Fix #126802: Embedded data ID usages doubled-refcounted on copying.
ID usages of embedded data would be refcounted twice when copying their
owner ID.

Also did cleanup on naming, since proper names of these IDs is
'embedded', not the old 'private' one.
2024-08-28 17:06:13 +02:00
Philipp Oeser
d1f0084a33 Compositor: add button to add a new texture in the Texture node
This replaces the plain texture selector with a proper TemplateID,
resulting in buttons to add a new texture if none is there yet, and if
there is one, there will be the usual conveniece buttons to add a fake
user, create single user copies, ..., as well as the button to go to the
textures tab in the Properties Editor for more fine-grained control over
the texture.

Fixes #126856

Pull Request: https://projects.blender.org/blender/blender/pulls/126890
2024-08-28 16:54:19 +02:00
Hans Goudey
52bf292349 Sculpt: Split BVH nodes structs by geometry type
In order to make per-BVH-node overhead smaller and also to improve
type safety and code clarity, split the `pbvh::Node` struct into four classes:
a base class, and a class for each sculpt geometry type.

The size of a mesh BVH node changes from 408 to 176 bytes. For multires
the nodes are smaller at 96 bytes. This gives us leeway to make nodes smaller
to benefit more from spacial locality, etc. It also just reduces memory usage.

Using a `std::variant` makes the change quite simple actually. For the few
places that actually need to process the node types separately given their
different types, we use `std::visit`. Elsewhere we use `IndexMask` to retrieve
selections of nodes from the vector instead, though most code will be
refactored to that pattern separately. The new function `search_nodes`
is the equivalent of the existing `gather_nodes` that returns an `IndexMask`
instead of a vector of node pointers.

Part of #118145.

Pull Request: https://projects.blender.org/blender/blender/pulls/126873
2024-08-28 15:18:21 +02:00
Campbell Barton
21b820cd33 Fix the type value of 'bpy.types.*.bl_rna'
The type of an RNA types "bl_rna" should be `bpy.types.Struct`,
it was being set to the type it represented so:
`type(bpy.types.Object.bl_rna) == bpy.types.Object`
which wasn't correct.

Ref !126877

Co-authored-by: Bastien Montagne <bastien@blender.org>
2024-08-28 19:07:14 +10:00
Clément Foucault
25b2c5f170 BLI: Add reduce_mul 2024-08-28 09:48:17 +02:00
YimingWu
17397dae19 Fix #125680: Grease Pencil edit overlay shader theme switch
Grease Pencil v3 was using the same shader as particle strands, this leads
to sharing edit overlay color as particle strands. This patch fixes this
behaviour by adding a grease pencil toggle in the shader so grease pencil
overlay will use appropriate color and point sizes specified in the theme.

Pull Request: https://projects.blender.org/blender/blender/pulls/125689
2024-08-28 09:10:05 +02:00