Commit Graph

133002 Commits

Author SHA1 Message Date
Campbell Barton
07ff3bcb70 GHOST/Wayland: support dropping text
This matches X11's support for GHOST_kDragnDropTypeString.

Dropping URL's from a web-browser uses this mime-type.
2024-02-16 14:27:00 +11:00
Campbell Barton
82c753a940 GHOST/Wayland: drag & drop cleanup, minor changes
- Don't generate a drop event when the drop data failed to read.
- Remove redundant drop-buffer duplication.
2024-02-16 14:26:58 +11:00
Campbell Barton
eafecb2bc3 Cleanup: remove unused WM_DRAG_VALUE 2024-02-16 14:26:56 +11:00
Campbell Barton
23a8ba3cd3 Cleanup: remove blenfont library linking from blenloader
This was only needed for tests.
2024-02-16 14:26:54 +11:00
Campbell Barton
adaf791dd7 Cleanup: remove unused struct members in uiHandleButtonData 2024-02-16 14:26:53 +11:00
Campbell Barton
5ae0b0c7f4 Cleanup: use the term "sincos" in convexhull_2d for clarity
The 2D vector calculated from edge vectors represents sin & cos which
wasn't obvious.
2024-02-16 14:26:51 +11:00
Campbell Barton
503d56e2c8 Cleanup: use const variables in convexhull_2d_sorted for clarity 2024-02-16 14:26:49 +11:00
Campbell Barton
37475d252f Cleanup: use "use_" prefix for RNA boolean 2024-02-16 14:26:47 +11:00
Campbell Barton
7582b15c4c Cleanup: spelling in comments 2024-02-16 14:26:46 +11:00
Campbell Barton
9992718703 Cleanup: restore macro to avoid repetition for swapping values 2024-02-16 14:26:45 +11:00
Jesse Yurkovich
551b846bcd Merge branch 'blender-v4.1-release' 2024-02-15 16:55:12 -08:00
Jesse Yurkovich
9e8bbc1129 Fix: USD hooks leak
If hooks are not unregistered Blender will report a leak on exit.

Store the hooks as unique_ptrs to remove manual memory management and
encapsulate the previous global list inside a function. These changes
ensure that everything is cleaned up on termination.

Also makes a small change to the hook documentation for a missing
`import` statement.

Pull Request: https://projects.blender.org/blender/blender/pulls/118294
2024-02-16 01:53:33 +01:00
Jacques Lucke
d803b6acca Cleanup: simplify usage of Map 2024-02-15 22:51:18 +01:00
Jacques Lucke
d9d9ff1dcd Nodes: hide shader input in node properties panel
This was missing in d27a1c47fa.
2024-02-15 21:55:53 +01:00
Jacques Lucke
f727ec95b7 Cleanup: typo 2024-02-15 21:49:27 +01:00
Jacques Lucke
75e9056cac Geometry Nodes: support group ids in Sample Nearest Surface node
This adds group ids to the `Sample Nearest Surface` node. This allows e.g. finding
the closest point on a specific mesh island.

Three new sockets are added:
* `Group ID`: Is evaluated on the face domain and splits the input mesh into  multiple
  parts, each with its own id.
* `Sample Group ID`: Determines in which group the closest nearest surface is detected.
* `Is Valid`: Outputs true if a nearest surface was found, it's false if the group is empty.

Pull Request: https://projects.blender.org/blender/blender/pulls/118150
2024-02-15 20:35:02 +01:00
Bastien Montagne
0801fcd6b3 Cleanup: make format 2024-02-15 19:49:58 +01:00
Bastien Montagne
f8541337bb IDType: Refactor some 'conversion' helpers.
Use IDTypeInfo data as much as possible, to avoid too many functions
`switch`ing over all ID type values.

Now only `BKE_idtype_idcode_to_index` and `BKE_idtype_idfilter_to_index`
do that, all others are using one of the above to retrieve the valid
IDTypeInfo and return data from it.

Also tweaked some namings to make them more consistent.

No behavioral changes expected here.
2024-02-15 19:45:10 +01:00
Bastien Montagne
f21540f428 Cleanup: IDTypeInfo: Use std::array for the static array of ID types.
Also add a hard, direct failure in `id_type_init`, in case one ID type
is missing processing there.

No behavioral changes expected here.
2024-02-15 19:45:10 +01:00
Bastien Montagne
d083f69295 IDType: Add FILTER_ID_ for deprecated IPO ID type.
Although this type is not much encountered anymore, it's simpler and
cleaner to have a FILTER value for all known ID types.
2024-02-15 19:45:10 +01:00
Bastien Montagne
df0efda0d6 Refactor: IDTypeInfo: Add info about 'potentially used IDTypes'.
This data was 'hidden' away in a util in
`lib_query.cc`, which made it hard to discover and keep up-to-date.

However, as shown by e.g. #108407, critical low-level features in ID
management code, such as remapping, now rely on this information being
valid.

Also simplify `BKE_library_id_can_use_filter_id` and
`BKE_library_id_can_use_idtype` to make them more generic, relying on
IDTypeInfo to retrieve IDtype-specific info.

No behavioral changes expected here.
2024-02-15 19:45:10 +01:00
Bastien Montagne
f674e486e1 Merge branch 'blender-v4.1-release' 2024-02-15 18:26:31 +01:00
Bastien Montagne
401a2397db Fix mistake in fix for #108407 (crash on deleting shapekeys).
Own d38824bc02 mistakenly added the 'FILTER_ID_KE' to the list IDTypes
usable by Lights (`ID_LA`) instead of Lattices (`ID_LT`)...

Note that this did not cause any additional issue, but only missed part
of the expected fix.
2024-02-15 18:25:50 +01:00
Sebastian Parborg
91100fc6d4 Merge branch 'blender-v4.1-release' 2024-02-15 18:08:35 +01:00
Sebastian Parborg
86522d9ab1 Fix #118276: IDs were remapped by mistake when copying in the VSE
All IDs in the current bmain were remapped while it should have only
been done for IDs in the dummy scene created for the copy operation.
2024-02-15 18:06:54 +01:00
Miguel Pozo
50a3a0253d Revert "EEVEE: Remove Thickness output"
This reverts commit 91b727028a.
The change was only meant for 4.1.
Thickness output is required for EEVEE-Next.
2024-02-15 18:04:30 +01:00
Miguel Pozo
5eac9e6095 Merge branch 'blender-v4.1-release' 2024-02-15 17:59:44 +01:00
Miguel Pozo
91b727028a EEVEE: Remove Thickness output 2024-02-15 17:57:20 +01:00
Hans Goudey
ca49998049 Cleanup: Make format 2024-02-15 11:36:28 -05:00
Hans Goudey
af9709089e Cleanup: Remove unnecessary set curve type optimization
Now that attributes use implicit sharing, copying CurvesGeometry
is relatively cheap, and the complexity of this function isn't worth
the remaining optimization of avoiding user count updates.
2024-02-15 11:35:33 -05:00
Christoph Lendenfeld
0c560fb7ef Fix #112395: Proportional editing indicator in Graph Editor and Dope Sheet
When using proportional editing in the Graph Editor or the Dope Sheet,
the GUI displays a circle suggesting that the influence is limited in x and y.

In reality those editors only look at the x-axis to determine which keys to influence.

This PR fixes that by adding a new drawing function for those editors that
draws 2 lines to indicate a range.

In theory this can be a feature in other 2D editors in the future.
I assume the VSE would benefit from this as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/118196
2024-02-15 16:50:34 +01:00
Hans Goudey
1bf6d8b0b9 WM: Move report list to runtime struct
These reports were embedded in the window manager DNA,
but they were always cleared when reading it from files. It's clearer
to just not store the reports in files at all. I also moved the reports
initialization and freeing to the constructor and destructor of the
runtime class.

This is the only place `ReportList` was embedded in DNA, so
after this we can move that to use C++ features if we want.

Pull Request: https://projects.blender.org/blender/blender/pulls/118329
2024-02-15 16:42:35 +01:00
YimingWu
b661b368c4 GPv3: Length modifier
This ports the length modifier to Grease Pencil v3.

Pull Request: https://projects.blender.org/blender/blender/pulls/117124
2024-02-15 16:37:54 +01:00
Sebastian Parborg
8a388a39ea Fix #118276: IDs were remapped by mistake when copying in the VSE
All IDs in the current bmain were remapped while it should have only
been done for IDs in the dummy scene created for the copy operation.
2024-02-15 16:31:30 +01:00
Sean Kim
a2f49b05f8 Sculpt: Disable set pivot and select color for invisible objects
This PR disables the `SCULPT_OT_sample_color` and `SCULPT_OT_set_pivot_position` operators and the following actions that correspond to them when attempting to operate on invisible objects:
* Set Pivot
* Sample Color

| Set Pivot | Sample Color |
| --- | --- |
| ![invisible_set_pivot.gif](/attachments/0dd23857-abdf-4214-a08d-ce986f15e16f) | ![invisible_set_color.gif](/attachments/84950810-1c3d-4f02-8e84-67425d80754d) |

### Limitations
* All of the operators invoked by a menu option do not indicate to the user that they are currently invalid or will not operate due to the mesh being invisible, potentially leading to a confusing user experience.

Addresses part of #112371

Pull Request: https://projects.blender.org/blender/blender/pulls/118306
2024-02-15 16:30:31 +01:00
Sean Kim
1e3e5c5ac2 Sculpt: Disable face set operators on invisible objects
This PR disables the `SCULPT_OT_face_sets_init`, `SCULPT_OT_face_sets_create`, `SCULPT_OT_face_sets_edit`, `SCULPT_OT_face_sets_randomize_colors`, `SCULPT_OT_face_set_change_visibility`, `SCULPT_OT_face_set_box_gesture`, and `SCULPT_OT_face_set_lasso_gesture` operators and the following actions that correspond to them when attempting to operate on invisible objects:
* Face Set From Masked
* Face Set from Visible
* Face Set from Edit Mode Selection
* Initialize Face Sets
* Grow Face Set
* Shrink Face Set
* Randomize Colors
* Toggle Visibility
* Hide Active Face SEt
* Box Face Set
* Lasso Face Set

| Init | Create | Edit |
| --- | --- | --- |
| ![fs_init.gif](/attachments/f44e96ab-e1c9-4279-9f69-80ea9503c830) | ![fs_create.gif](/attachments/3992b8fc-bd59-4aee-a2f6-6d7aa507f0b9) | ![fs_edit.gif](/attachments/78a7c447-8fd8-41dc-846a-5617751e5594) |

| Randomize Colors | Visibility | Gestures |
| --- | --- | --- |
| ![fs_color.gif](/attachments/43230f6b-4a39-4417-ac90-b94e3f33e724) | ![fs_hide.gif](/attachments/fe6fcdac-eda9-4f55-b013-f132f373fe65) | ![fs_gesture.gif](/attachments/5f36d7ed-c5bf-4154-af9e-0f19fb24249c) |
### Limitations
* All of the operators invoked by a menu option do not indicate to the user that they are currently invalid or will not operate due to the mesh being invisible, potentially leading to a confusing user experience.

Addresses part of #112371

Pull Request: https://projects.blender.org/blender/blender/pulls/118228
2024-02-15 16:29:08 +01:00
Sean Kim
fca979e237 Sculpt: Disable modal filter operators on invisible objects
This PR disables the `SCULPT_OT_mesh_filter`,  `SCULPT_OT_cloth_filter`, and `SCULPT_OT_color_filter` operators and the following actions that correspond to them when attempting to operate on invisible objects:
* Mesh Filter
* Color FIlter
* Cloth Filter
| Mesh & Cloth | Color |
| ---- | --- |
| ![invisible_filter_mesh.gif](/attachments/87d2dfe2-be27-40bf-bb58-e9aa761a3f0a) | ![invisible_filter_color.gif](/attachments/ac51584e-bd87-4392-9bda-6ad5191cf38f) |

Addresses part of #112371

Pull Request: https://projects.blender.org/blender/blender/pulls/118172
2024-02-15 16:26:38 +01:00
Sean Kim
d76c1e30e7 Sculpt: Disable mask operators on invisible objects
This PR disables the `SCULPT_OT_mask_init`, `SCULPT_OT_mask_filter`, `SCULPT_OT_mask_by_color`,  and `SCULPT_OT_mask_from_cavity` operators and the following actions that correspond to them when attempting to operate on invisible objects:
* Random Mesh
  * Per Vertex
  * Per Face Set
  * Per Loose Part
* Smooth Mask
* Sharpen Mask
* Grow Mask
* Shrink Mask
* Increase Contrast
* Decrease Contrast
* Mask By Color
* Mask From Cavity

| Init | Filter | By Color | From Cavity |
| ---- | --- | --- | --- |
| ![](/attachments/fc2ea68e-0af9-4887-b1a3-b2aa2eacaf21) | ![](attachments/3e94f48c-b463-417c-9ad9-bdc74e24bd70) | ![](/attachments/16029e7c-d973-483e-8c4a-164133d0fe11) | ![](/attachments/b356a248-354b-4c68-bf5b-c49907edcaff)

### Limitations
* All of the operators invoked by a menu option do not indicate to the user that they are currently invalid or will not operate due to the mesh being invisible, potentially leading to a confusing user experience.

Addresses part of #112371

Pull Request: https://projects.blender.org/blender/blender/pulls/118173
2024-02-15 16:24:39 +01:00
Omar Emara
49faea5f36 Fix #111345: Compositor uses entire viewport in camera view
The compositor assumes the entire viewport as its compositing space even
in camera view. The current design decision was to limit the compositing
space by the camera region only if the camera passepartout is opaque,
that is, areas outside of the camera are not visible.

This patch changes that behavior to always limit the compositing space
by the camera region. The downside is that areas outside of the camera
will be left uncomposited.

This is useful to match viewport compositing to final render compositing
in terms of maintaining the same space, but not necessarily the same
resolution. However, this still has the limitation that space will be
different when the camera region intersects the viewport, since we only
composite their intersection in that case.

Pull Request: https://projects.blender.org/blender/blender/pulls/118241
2024-02-15 15:46:34 +01:00
Raul Fernandez
ed6f8c5b86 Fix #81948: Sculpt mode Annotation tool cursor conflict
This fix checks if the annotation tool is active in `bool SCULPT_mode_poll_view3d(bContext *C)` to hide the sculpt cursor .

Pull Request: https://projects.blender.org/blender/blender/pulls/118255
2024-02-15 15:28:16 +01:00
Aras Pranckevicius
b4c6c69632 ImBuf: do not clear newly allocated image pixels when not needed
In some/many cases, an `ImBuf` is allocated, and all the pixels are
immediately filled by some code. Doing the memory clear within allocation
is just memory traffic for no good reason.

Add a flag to skip initialization of ImBuf pixels (IB_uninitialized_pixels)
and use that in some parts of VSE effects/rendering/cache/scopes, as well
as image loading code.

Rendering out VSE movie, on Windows/VS2022/Ryzen5950X:
- Sprite Fright: 443sec -> 414sec (takes 93% of previous time)
- Gold previs: 367sec -> 325sec (takes 88% of prev time)

Pull Request: https://projects.blender.org/blender/blender/pulls/118321
2024-02-15 14:54:57 +01:00
YimingWu
76b0976500 GPv3: Multiple Strokes Modifier
This migrates the multiple strokes modifier to Grease Pencil v3.

Pull Request: https://projects.blender.org/blender/blender/pulls/117796
2024-02-15 14:19:50 +01:00
Pratik Borhade
43996a54cf GPv3: Lock/Unlock All Layers
Port the legacy lock/unlock all layers operator from GPv2.

Pull Request: https://projects.blender.org/blender/blender/pulls/118259
2024-02-15 12:14:17 +01:00
Omar Emara
4780cd3368 Fix: GPU compositor ignores border region
The GPU compositor does not take the border region into consideration,
which means it reads more than it should, leading to corruption. Fix
this by taking the border region into account when computing render
width and height.
2024-02-15 12:56:16 +02:00
Campbell Barton
7e66026fa0 Cleanup: odd doc-string formatting, match argument names in headers
Quiet argument name mis-match warning.
Assert that WM_event_timer_add takes a timer event type.
2024-02-15 21:31:08 +11:00
Jacques Lucke
c1c3a4e45d Merge branch 'blender-v4.1-release' 2024-02-15 11:29:31 +01:00
Campbell Barton
67481dcd47 Merge branch 'blender-v4.1-release' 2024-02-15 21:22:56 +11:00
Campbell Barton
55adfdc7af Merge branch 'blender-v4.1-release' 2024-02-15 21:22:52 +11:00
Jacques Lucke
590e4652b6 Fix #118211: clarify use cases of layout panels in api docs
We could support layout panels in sublayouts like boxes eventually,
but for now this is out of scope.
2024-02-15 11:21:11 +01:00
Campbell Barton
4b7d44d015 Fix incorrect use of sizeof() for Wayland
The size of the string in bytes happened to match the the pointer size
on 64bit systems, nevertheless the logic was wrong would would fail on
32bit systems. Also use a character to search the string instead of a
single character string.
2024-02-15 20:56:45 +11:00