Commit Graph

111823 Commits

Author SHA1 Message Date
Sean Kim
ac344aae1f Subdiv: Add neighbor slicing helper methods
Pull Request: https://projects.blender.org/blender/blender/pulls/125513
2024-07-26 21:42:09 +02:00
Sean Kim
eda872b6eb Cleanup: SubdivCCG: Add SubdivCCGCoord constructor from key and index
* Adds test for this usecase.
* Reduces existing duplicated code.

Pull Request: https://projects.blender.org/blender/blender/pulls/125511
2024-07-26 21:16:37 +02:00
Hans Goudey
a5374d8e30 Cleanup: Sculpt: Use C++ vector type in pose brush code 2024-07-26 12:57:51 -04:00
Hans Goudey
0e5858e226 Sculpt: Data oriented refactor for pose brush deformation
Part of #118145.
There are some things to address with the "fake neighbor" system before
the rest of the brush can be refactored.
2024-07-26 12:57:51 -04:00
Hans Goudey
c2ac890f6b Cleanup: Fix name of function argument 2024-07-26 12:57:51 -04:00
Hans Goudey
78c73eacd2 Cleanup: Use Array for pose brush mask data 2024-07-26 12:57:51 -04:00
Harley Acheson
f2f408bebf UI: Tooltip Final Period and Other Typography
This removes the terminal periods automatically added to the end of
tooltip items. The current desire is to only end in period if there
are multiple sentences - so if there is one in the middle of the
description. This also converts our uses of lists to use space and
bullet, rather than just bullet or asterisks.

Pull Request: https://projects.blender.org/blender/blender/pulls/125460
2024-07-26 18:29:50 +02:00
Omar Emara
406a2d3ff0 Fix #125380: Viewport compositor slows complex scenes
The viewport compositor slows down complex scenes even if it has very
simple setups. That's because it internally computes previews which
involves a fair bit of CPU computation, however, those previews are
actually never written to the original tree, so previewers weren't
really visible so it is effectively redundantly computations.

To fix this, we double down on disabling previews for the viewport
compositor and avoid any redundant computations in that case.
2024-07-26 19:08:58 +03:00
Sean Kim
8a812e334d Fix #125375: Sculpt undo with duplicate object causes crash
Introduced with d527e3a6bd.

Cached values are tagged as dirty during the update step, this can cause
conflicts where we attempt to then flush then changes into the PBVH but
have not yet updated the mesh pointers and reinitialized them.

This commit forcibly initializes the underlying data to prevent such
cases from happening when flushing to the PBVH.

Pull Request: https://projects.blender.org/blender/blender/pulls/125396
2024-07-26 18:01:11 +02:00
Falk David
6f050fecfb GPv3: Python API for frame, drawing and drawing attributes
This is a PR that is built on top of #122094 (thanks to @SietseB
for the initial work).

Adds the following properties and functions:
* `layer.frames`,
* `layer.frames.new(frame_number)`
* `layer.frames.remove(frame_number)`
* `layer.frames.copy(from, to)`
* `frame = layer.get_frame_at(frame_number)`
* `frame.drawing`
* `frame.frame_number`
* `frame.select`: the selection state of the keyframe in the dope sheet
* `frame.keyframe_type`
* `drawing = frame.drawing`
* `drawing.type` (`DRAWING`/`REFERENCE`)
* `drawing.user_count`: The number of keyframes that use this drawing
* `drawing.attributes`: attribute read/write access to the drawing data

To be able to access attributes on drawings, a new
`AttributeOwnerType::GreasePencilDrawing` is added.
The API in `BKE_attributes.h` is updated to handle this type.

In `rna_attributes.cc`, there is a new
`rna_def_attribute_group_grease_pencil_drawing` that defines the
attribute group. For this to work, it also defines its own rna
callback functions.

Pull Request: https://projects.blender.org/blender/blender/pulls/124787
2024-07-26 16:29:59 +02:00
Julian Eisel
5aa0695d12 Refactor: Use std::variant instead of union for asset data
Rather than a manually managed union, use `std::variant` which is
generally safer. E.g. an invalid access will now throw an exception
instead of causing undefined behavior (which may or may not crash, or
cause a data corruption). Code is also simplified this way.

Pull Request: https://projects.blender.org/blender/blender/pulls/125494
2024-07-26 15:55:03 +02:00
YimingWu
f9810ce99c GPv3: LineArt: Baking operators
This patch implements all baking operators for LineArt for GPv3.
The old baking operators are renamed with `_legacy_` to
distinguishing both when calling the operator.

Pull Request: https://projects.blender.org/blender/blender/pulls/125079
2024-07-26 15:48:52 +02:00
Pratik Borhade
1da83ab046 GPv3: Duplicate active keys operator
Port legacy `frame_duplicate()` operator.

Pull Request: https://projects.blender.org/blender/blender/pulls/125369
2024-07-26 15:39:42 +02:00
Falk David
cc28ad8dcf Grease Pencil: Remove legacy python API
While the python API for the legacy Grease Pencil object can be fully
deprecated, annotations still make use of the `bGPdata` DNA and
therefore need their own python API.

This removes `RNA_def_gpencil` entirely, but replaces parts of it
in `RNA_def_annotations` to make sure that annotations keep
working as before. Note that this is only a very small subset of the
legacy Grease Pencil API.

Technically, this "removes" python API functionality from annotations
because they are full Grease Pencil IDs, but the idea is to make them
simpler and encourage users to use Grease Pencil objects instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/125097
2024-07-26 15:39:02 +02:00
Julian Eisel
ea254f64e3 Cleanup: Improve name of asset storage type
Use "asset storage" instead of just "storage", because there are other
members acting as storage (e.g. holding all catalog data), while this is
asset specific.
2024-07-26 15:30:38 +02:00
Bastien Montagne
cd07327584 BLO write: Avoid double lookup in already added blocks addresses. 2024-07-26 15:29:00 +02:00
Julian Eisel
489a5e92b8 Cleanup: Remove now unused asset identifier files
Missed this in 693e590d9f.
2024-07-26 15:12:51 +02:00
Julian Eisel
693e590d9f Refactor: Assets: Remove unnecessary asset identifier class
This was just rather useless level of abstraction. I heard from other
devs that these helper classes caused confusion, so better to avoid
this.

Now the asset representation has all the needed bits to create its full
path, blend-file path and asset library relative path. In fact only the
asset library relative path needs to be stored to make all this
available, since the asset representation already stores a reference to
the asset library owning it, so the paths can be recreated easily.
2024-07-26 15:03:06 +02:00
Germano Cavalcante
0dad3bdfa7 Fix #123179: can't select multiple snap target elements in UV Editor
Missed after 'Set Snap Base' commit.

Just like in 3D View, UV editing can also benefit from selecting
multiple snap target elements.

The C++ code was already done, it was only necessary to edit the
interface.

Pull Request: https://projects.blender.org/blender/blender/pulls/124986
2024-07-26 14:59:13 +02:00
Christoph Lendenfeld
2c46b022a5 Fix: Compiler warning after recent refactor
`rna_path` was passed to `BKE_reportf`, while it should be `rna_path.path.c_str()`
2024-07-26 14:50:38 +02:00
Hans Goudey
99594f7281 Sculpt: Use Vector::resize instead of reinitialize
Though it amounts to the same thing for trivially destructible types,
conceptually `reinitialize` destructs old values before resizing. This
isn't necessary, and in the cases where it was used for a vector of
vectors (like vertex neighbor index storage), it could be slower.
I measured a few percent performance improvement for the smooth brush.

Also change some dynamically resized Arrays to vectors to make
use of amortized growth.
2024-07-26 08:44:29 -04:00
Jacques Lucke
f600d5681b Fix #125346: wrong transparency for dashed node links
This changed accidentally in 3410d0bf3f.
2024-07-26 14:40:03 +02:00
Christoph Lendenfeld
e540325f3e Refactor: clear_keyframe function arguments
No functional changes intended.

The function `clear_keyframe` had more arguments than needed:
* The `bAction *` was always a nullptr
* the unused parameter `eInsertKeyFlags` was removed
* the rna path and the array index were merged with the `RNAPath` struct

Pull Request: https://projects.blender.org/blender/blender/pulls/125487
2024-07-26 14:08:45 +02:00
Nathan Vegdahl
c9797d5390 Refactor: move layered action evaluation function/types out of internal
We need these publicly exposed for upcoming work to enable use
of layered actions in the NLA.

Pull Request: https://projects.blender.org/blender/blender/pulls/125483
2024-07-26 13:55:02 +02:00
Sybren A. Stüvel
9dc2f1fed5 Anim: add missing WITH_ANIM_BAKLAVA clauses in some CMakeLists.txt files
Some code was accidentally always disabled, even when building with
experimental features.

Pull Request: https://projects.blender.org/blender/blender/pulls/125482
2024-07-26 13:49:17 +02:00
Pratik Borhade
843a9ca5b9 UI: Add title to asset shelf context menu
Similar to !120694

Pull Request: https://projects.blender.org/blender/blender/pulls/125413
2024-07-26 13:43:05 +02:00
Christoph Lendenfeld
ebd123c90b Refactor: delete_keyframe function arguments
No functional changes intended.

This simplifies the arguments for the `delete_keyframe` function.
The `bAction *` was always a `nullptr` so I just removed it.
The rna path char array and the array index were merged into the `RNAPath` struct.

Pull Request: https://projects.blender.org/blender/blender/pulls/125479
2024-07-26 13:29:25 +02:00
Julian Eisel
3ec3704af6 Cleanup: Remove unused header in asset system header 2024-07-26 12:52:25 +02:00
Julian Eisel
28539c7dcf Refactor: Assets: Remove unnecessary asset storage class
This was just a useless level of abstraction, where the asset library
would have functions with the same name, just to pass the call on to the
asset storage. Now asset library stores and manages the asset
representations itself directly.

This should simplify the asset system a bit. I heard from other devs
that these kind of helper classes caused confusion for them.
2024-07-26 12:52:25 +02:00
Bastien Montagne
536fb53dc6 Core: Blendfile Write: Check against multiple writing at same address.
Blendfile uses the 'old (memory) address' of its data as 'uid' in the
blendfile. There should only be one block written for a given address
and a same ID (each ID define its own 'virtual address space').

This commit checks that this condition is met at wrtite time (except for
undo steps, for performances reasons).

Tooling part of the investigations on #125001.
2024-07-26 12:40:25 +02:00
Julian Eisel
2100623a96 Refactor: UI: Use unique_ptr for tooltip data management
Mostly to allow leak-free early exiting from functions generating the
tooltip data, otherwise cleanups have to be duplicated. But using smart
pointers is good practice in general. Also use references instead of
pointers, to indicate that null is not an expected value.
2024-07-26 12:31:01 +02:00
Casey Bianco-Davis
ddbc34829f GPv3: Initial transform operator support for bezier handles
This adds initial support for transforming bezier handles.
In some cases, the pivot is not correct, e.g. when scaling or rotating
one left or right handle. This will be added in a separate PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/123110
2024-07-26 12:24:04 +02:00
Casey Bianco-Davis
e864cb0614 GPv3: Bezier handles selection in pick operator
This modifies the Grease Pencil `pick` selection operator to use bezier handles as points to be selected.

Pull Request: https://projects.blender.org/blender/blender/pulls/125398
2024-07-26 12:19:10 +02:00
Lukas Tönne
9afe70968d GPv3: Fill tool: Hide extension circles when adding lines
The "radius" mode shows circles for the radius in which new lines are
formed. However, all circles currently remain visible when a point is
found in the circumference. This patch removes circles once they add
a line.

Followup fix for #125229.

Pull Request: https://projects.blender.org/blender/blender/pulls/125475
2024-07-26 11:40:20 +02:00
Sergey Sharybin
3ae945c34a Cleanup: Strict compiler warnings
Happens in release builds or when GPU_FORCE_ENABLE_SHADER_PRINTF=1.
2024-07-26 11:29:50 +02:00
Sybren A. Stüvel
c7bf1a697e Anim: forward compatibility for F-Curves in layered Actions
When writing a layered Action to disk, take the F-Curves from the
first keyframe strip and write that as `action.curves` as well. This
will make older Blender versions see those curves and load them
properly.

Only the curves for the first slot are written this way. This means
that any legacy Action that was converted to a layered Action will be
loaded again properly by older Blender versions. Of course this is
limited to a single layer, single strip, and single slot -- once the
newer features are used, older versions of Blender will not be able to
see this extra data.

When an Action contains multiple slots, so with animation for multiple
distinct objects, the forward compatibility becomes a bit iffy. Older
versions of Blender will just see a legacy Action, with its legacy
semantics, and thus all objects that use that Action will receive the
exact same animation data. I don't think there's a way around this.
(_Unless we start breaking up Actions into an Action per slot, alter
the assignments, and then store metadata so that modern Blenders can
reassemble them. I do not think this is a good idea._)

Ref: #124714

Pull Request: https://projects.blender.org/blender/blender/pulls/125065
2024-07-26 11:13:40 +02:00
Aras Pranckevicius
160f27330f Fix #124922: VSE text strip shadow now casts shadow of the outline
As well as takes text color transparency into account. That is, text
"shadow" now virtually casts shadow of however the text itself + outline
looks like. The result is blurred, and extra shadow color tint and
transparency is applied.

Performance testing: seems to be slightly faster than before in my tests.
Probably because the shadow "image" that is now blurred only contains
one byte per pixel (the transparency), instead of full uchar4 per pixel
(with only the "transparency" being blurred).

I have extended sequencer render tests to better cover various text
outline/shadow/box combinations.

Pull Request: https://projects.blender.org/blender/blender/pulls/125445
2024-07-26 10:49:10 +02:00
Omar Emara
945f7f5e23 Fix: Grease Pencil not visible when using compositor
Grease Pencil objects are not visible when using the viewport
compositor. That's because since the introduction of multi-pass
compositing, the compositor now access the combined pass written by
EEVEE, which does not include GP.

To fix this, we skip writing the EEVEE combined pass, then read the
viewport texture for the combined pass as a special case, which should
include GP.
2024-07-26 10:31:29 +03:00
Philipp Oeser
09cb2be159 Fix #124444: Painting from python ignores certain brush features
The reported issue was that Texture Mask mapping behaves wrong (wrong
coordinates -- seemed as if it was always using `Tiled` mapping), but
the issue actually spawns to more brush features (the coordinates were
wrong not only for mask mapping but for the actual texture mapping, too,
next to randomness and offsets/angles being ignored, jitter was also not
working at all).

On the code side, for the reported issue, we can observe that
`BKE_brush_sample_masktex` relies on `UnifiedPaintSettings`
`mask_tex_mouse` to be set. Other stuff mentioned above also ends up in
`UnifiedPaintSettings`.

In regular painting (has its own modal), this gets updated in
`paint_brush_stroke_add_step` by calling `paint_brush_update` before
adding another step. This is not called when doing painting from python
(here the modal handling happens in py, usually
`bpy.ops.paint.image_paint`is executed immediately for each mousemove).

Jitter is also doing stuff in `paint_brush_stroke_add_step` -- equally
ignored from above py workflow.

So to resolve, now make sure we are calling the necessary stuff in
`paint_exec` as well.

NOTE: There was a similar case in
9aa20a0979, where we could simply move
part of the necessary code from `paint_brush_update` to
`paint_stroke_new`

NOTE: `Rake` is still ignored, depends on previous positions, cannot be
supported

Pull Request: https://projects.blender.org/blender/blender/pulls/124582
2024-07-26 08:36:13 +02:00
Campbell Barton
656fe6d3e4 Extensions: support "blocklist" in the remote repository
Support blocking extensions so there is a way for the maintainers of
the remote repository to notify the user if one of their installed
extensions blocked along with a reason for blocking.

Blocked extensions cannot be installed from the preferences or by
dropping a URL.

When an installed & blocked extension is found:

- An icon int the status bar shows an alert,
  clicking on the icon shows the blocked extensions.
- The extensions preferences show a warning.
- The extensions & add-ons UI shows an alert icon
  and "details" section shows the reason.

Details:

- Blocked & installed extensions are shown first in the installed
  extensions panel.
- The internal "install" logic prevents downloading & installing
  blocked extensions.
- Blocked extensions can still be downloaded & installed from disk.
- The "list" command includes an error message if any installed
  extensions are blocked.
- The "server-generate" command can optionally take a configuration
  file that includes the blocklist for the generated JSON.

See design #124954.
2024-07-26 16:05:34 +10:00
Hans Goudey
437cb33a73 Refactor: Sculpt: Use new mesh vertex neighbor function
Use for voxel detail size sample, paint smearing, and
interior vertex neighbor calculation.
2024-07-26 00:19:32 -04:00
Hans Goudey
ce0f51ac1b Cleanup: Sculpt: Use enum class in various places 2024-07-26 00:19:16 -04:00
Hans Goudey
806ce8ebe3 Sculpt: Data oriented refactor for color filter tool
Part of #118145.
Move the operation switch out of the hot loop.
Use a series of thread local arrays to split some loops into simpler parts.
2024-07-26 00:19:16 -04:00
Hans Goudey
5f168b9ff6 Refactor: Sculpt: Use newer structure for color filter factors
Part of #118145.
2024-07-26 00:00:49 -04:00
Hans Goudey
70a72ca483 Sculpt: Refactor for color filter pre-smoothing
Part of #118145.
The pass was completely single threaded before, it's no parallelized.
2024-07-26 00:00:49 -04:00
Sean Kim
31e636a29e Refactor: Reorganize sculpt_boundary.cc calculations
* Moves boundary initialization out of indices_init
* Change parameters for edit_data_init since all it needs is the index
* Revert change to queues to use PBVHVertRef again since the newly
  refactored code will have to use int / SubdivCCGCoord / BMVert* for
  neighbor processing anyways
* Reduce scope of some variables
* Reduce nested branching

Pull Request: https://projects.blender.org/blender/blender/pulls/125390
2024-07-26 06:00:25 +02:00
Sean Kim
8d454ba13f Sculpt: Add vert_neighbors_get_mesh method
Note, this doesn't expose a similar method for grids due to
BKE_subdiv_ccg_neighbor_coords_get.

Pull Request: https://projects.blender.org/blender/blender/pulls/125470
2024-07-26 05:54:58 +02:00
Sean Kim
6568629520 SubdivCCG: Add to_index helper method
This commit adds a method to compute the position of a given
SubdivCCGCoord in an appropriately sized array.

Pull Request: https://projects.blender.org/blender/blender/pulls/125462
2024-07-26 04:35:34 +02:00
Campbell Barton
12a6cefe1a Cleanup: remove redundant theme color lookup 2024-07-26 10:24:36 +10:00
Sean Kim
d5617d5a2b Cleanup: Remove unnecessary const parameters for vert_is_boundary
* Also removes extra duplicated function declaration.

Pull Request: https://projects.blender.org/blender/blender/pulls/125461
2024-07-26 01:05:09 +02:00