Commit Graph

121967 Commits

Author SHA1 Message Date
Campbell Barton
32f9b65cc5 BLI_convexhull_2d: ensure stable order, correct doc-strings
Since [0], removing degenerate points at the beginning of the hull
would re-order points so the last were moved to the beginning.

While this isn't an error, having the resulting hull *sometimes*
re-ordering it's result based on internal error correction isn't ideal.

Document that the first point in the hull has the lowest Y value and
update tests to ensure this.

Also correct the doc-string regarding the hulls cross-product
and tests this is working as documented.

[0]: 87f9fd8fb3
2025-07-31 02:06:43 +00:00
Sean Kim
193b91e04c Cleanup: Use switch instead of if / else for set_pivot cases
Also ensures the case ordering is the same as the enum declaration

Pull Request: https://projects.blender.org/blender/blender/pulls/143678
2025-07-31 03:27:58 +02:00
Sean Kim
bc17734177 Cleanup: Use C++ math types and functions for sculpt.set_pivot 2025-07-30 17:33:59 -07:00
Sean Kim
6a6d636843 Cleanup: Remove redundant comments 2025-07-30 17:33:59 -07:00
Sean Kim
1aa6b73b9a Fix #143630: Pivot to Active Vertex moves 3D cursor to infinity
There are a number of issues with the "Active Vertex" mode for the Set
Pivot operator in Sculpt Mode:

1. The menu option did not require the cursor, so moving off of the mesh
   and using this option would previously pick the last value in the
   `SculptSession`
2. The active vertex information was not updated when this was called,
   so even if the user invoked this operator with their mouse on the
   mesh via the Operator Search popup, it would not use the right
   position. This also means behavior would differ depending on if a
   brush tool was being used or the transform tools.

To fix these issues, the relevant flags are set for the operator as a
whole, and the internal active vert information is updated prior to
being requested for this operator.

Note that this does add an extra mouse click required for calling the
operator via the Operator Search menu, but given that it only worked in
specific situations before, this is an acceptable tradeoff. Assigning a
shortcut to this operator removes this requirement, as expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/143675
2025-07-31 02:27:00 +02:00
Sean Kim
978fa597c0 Fix: SculptSession#last_active_vert uses incorrect value
Error in ab5ce3061a

Pull Request: https://projects.blender.org/blender/blender/pulls/143672
2025-07-31 00:51:19 +02:00
Harley Acheson
39187001c4 Fix #141442: Ensure Panel Text Colors Are Opaque
This PR alters the new panel colors introduced in 140726 so that
panel_text and panel_title have full opacity rather than none.

Pull Request: https://projects.blender.org/blender/blender/pulls/142992
2025-07-31 00:41:56 +02:00
Harley Acheson
276eee8f53 BLF: Correct the Showing of VFont Not Found Character
When VFont objects use a custom (non-default) font and reference a
character that is not contained in that font, our intention is to show
placeholder curves that represents "not found". Instead we are
currently showing the ".notdef" glyph if there is one defined inside
the font or blank space if not. This PR fixes that by altering
BLF_character_to_curves so that it returns a boolean success instead of
character advance. This way we can properly distinguish "not found"
from the return of other empty, non-advancing characters.

Pull Request: https://projects.blender.org/blender/blender/pulls/143484
2025-07-30 21:25:18 +02:00
Jacques Lucke
4afe62ee29 Nodes: always initialize new links in closure zone when syncing 2025-07-30 20:56:24 +02:00
Aras Pranckevicius
f942767b14 Fix: VSE gaussian blur size was incorrect in proxies / render scale
Gaussian blur effect size is expressed in pixels (not ideal, but that is
what it is). It was not taking render output scale or preview proxy
size into account, resulting in much larger blur at lower render scales.

Pull Request: https://projects.blender.org/blender/blender/pulls/143627
2025-07-30 20:53:43 +02:00
Aras Pranckevicius
23242002c4 Cleanup: add get_render_scale_factor helper to use across VSE, proxy size type safety
- Some functions that took integer arguments for proxy size enums; make
  them take said enums directly.
- Add get_render_scale_factor() that calculates effective render scale,
  use that in places that did manual "use either scene render scale setting
  or proxy size" calculation in 5 places.
- Replace previous double with float in proxy size scale factors; all
  the factors are exactly representable as floats, and all the calling
  places used them as floats too.
2025-07-30 20:53:42 +02:00
Jacques Lucke
1260e90b4c Refactor: Geometry Nodes: simplify detection of syncable nodes
This moves most of the code to deal with syncable nodes (such as
Combine/Separate Bundle) to the nodes module. Over time it might be possible to
decentralize it more.

This also changes the caching mechanism from storing a flag on the node to
storing a map on the node editor runtime data. This simplifies the code quite
significantly and also removes the need to store any of this data in DNA.

The node tree update code now always clears this cache because before it was
missing many cases, e.g. when creating links that would connect a Combine to a
Separate Bundle node.

Pull Request: https://projects.blender.org/blender/blender/pulls/143661
2025-07-30 20:42:20 +02:00
Harley Acheson
f0634f6dfc Fix #140406: Inset Scroll Bars for Left-Aligned Panels
As shown in the complaint, when a panel region with category tabs is
aligned to the left we are not insetting the position of the scroll
bars like we do if aligned to the right. There are two separate
fixes needed. In ED_region_panels_draw we are just not doing this for
regions on the left.  And in UI_view2d_mask_from_win when sizing a
left-algined scrollbar we just use scrollbar width as xmax, when it
should be xmin + width. This means that the scroll bar will not be seen
if the mask xmin is greater than the scrollbar width.

Pull Request: https://projects.blender.org/blender/blender/pulls/141470
2025-07-30 19:03:46 +02:00
Jacques Lucke
21ca4584b6 Geometry Nodes: show sync button on bundle and closure nodes if syncing is possible
This shows a sync button when Geometry Nodes has detected that
syncing is possible and might be necessary.

Pull Request: https://projects.blender.org/blender/blender/pulls/140967
2025-07-30 18:51:14 +02:00
Habib Gahbiche
0a0dd4ca37 Compositor: add asset shelf
Add an asset shelf to the compositor node editor.

This is part of simplifying the compositing workflow:
https://projects.blender.org/blender/blender/issues/134214.

The reasoning is:
- Assets will help users get started more easily with compositing
- Assets will help keeping users within Blender and use the compositor
instead of doing post processing in a different software.
- The asset shelf is better than the asset browser because it has a
better user interface; it's easily hidable and doesn't take much space

The asset shelf is hidden by default in this PR, since we have no
assets yet.

Previously, a similar implementation was proposed for all node editors,
see https://projects.blender.org/blender/blender/pulls/110589.
We didn't move forward with this PR for the following reasons:
- For geometry nodes, no concrete use case was known/proposed
- The PR didn't intend to actually show the asset shelf, only
implement the possibility that it can be shown in node editors

Known Issues:
- Can't hide the asset shelf if region overlap is off: #129737

Pull Request: https://projects.blender.org/blender/blender/pulls/138983
2025-07-30 18:41:00 +02:00
Jacques Lucke
7186ab7e86 Geometry Nodes: add conversion warnings for closures and bundles
This adds warnings to inform the user when potentially unexpected implicit
conversions happen in the Separate Bundle and Evaluate closure node.

Pull Request: https://projects.blender.org/blender/blender/pulls/143645
2025-07-30 18:03:52 +02:00
Jacques Lucke
78c161585b Fix: Nodes: single value types sometimes shown as dynamic 2025-07-30 17:05:00 +02:00
Jacques Lucke
f646948ace Geometry Nodes: change closure socket/zone and repeat zone color
This implements #143624.

Pull Request: https://projects.blender.org/blender/blender/pulls/143631
2025-07-30 16:53:03 +02:00
Yahia
a37157f12b UI: Changed the UI text from "Click Drag" to "Drag"
Address change proposed in #131899.

Ref !131985
2025-07-31 00:12:52 +10:00
Jacques Lucke
6cd1c5c031 Fix: missing main invariants update after append
This could result in a crash before when appending a data-block that was already linked before.

Pull Request: https://projects.blender.org/blender/blender/pulls/143606
2025-07-30 15:41:40 +02:00
Jacques Lucke
76a861ab41 Geometry Nodes: move more menu inputs to sockets
This is a continuation of #140705. It changes more menu node options to be input
sockets. It also changes the order of the input sockets in a few cases to make
the node look a bit better.

Forward and backward compatibility is preserved.

Pull Request: https://projects.blender.org/blender/blender/pulls/142220
2025-07-30 15:32:10 +02:00
Miguel Pozo
4a87a7e290 Fix #142800: Broken selection with Clipping Regions
Add missing DRW_CLIPPING_UBO_SLOT UBO.

(4.5 backport candidate)

Pull Request: https://projects.blender.org/blender/blender/pulls/143493
2025-07-30 15:23:38 +02:00
Campbell Barton
4d6af81b58 Fix #143629: Tool gizmo disappears when resizing areas & regions
After resizing screen data an additional redraw is needed so gizmos
are refreshed without `G_TRANSFORM_WM` being set which causes some
gizmos not to display.
2025-07-30 23:21:51 +10:00
Brecht Van Lommel
e82dab28b8 Fix #143148: Attribute shader node no longer finds custom property
This code was not meant to be changed to system ID properties, it was
explicitly looking for custom properties before resolving the RNA path.

There are tests for this functionality, but because the versioning copies
the ID properties to the system ID Properties, it worked for existing
properties but not newly created ones.

Pull Request: https://projects.blender.org/blender/blender/pulls/143574
2025-07-30 14:30:56 +02:00
Falk David
d6b1805e2c Fix: Grease Pencil: Remove fill guide attribute in remove_fill_guides
When using the "Remove Fill Guides" operator, it deleted the strokes
that were used as fill guides, but it didn't remove the attribute
afterwards.
2025-07-30 13:38:45 +02:00
Habib Gahbiche
5783c600dc Fix: wrong user count for compositing node tree
**How to reproduce:**
1. Assign a node tree to the scene compositing node group in Python
2. Notice how the node tree has the wrong user count

Example:
```python
C.scene.compositing_node_group = \
    D.node_groups.new("ntree", "CompositorNodeTree")
print(C.scene.compositing_node_group.users) # returns 0
```

Pull Request: https://projects.blender.org/blender/blender/pulls/143577
2025-07-30 13:18:47 +02:00
Bastien Montagne
23e03be72d Fix #143600: Library overrides on custom properties are broken.
Mistake in 7276b2009a, where iterator over StructRNA properties was
changed to iterate over the new system IDProps, instead of the existing
(now 'custom data'-only) user IDProps.

System IDProps do not need to be handled in this iterator, as they are
expected to already be processed through their wrapping RNA properties.
2025-07-30 12:44:20 +02:00
Pratik Borhade
3f338f923d Shape Key: Move multiple selected elements
Similar to !141881, add support to move selected elements in the list
Now basis shape key is fixed at the first location. It cannot be moved
up/down. Other keys cannot be moved either above shape key.

Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/141930
2025-07-30 11:42:37 +02:00
Pratik Borhade
3bfd4c83f6 Core: Rename ID name and plural_name for annotations
This resolves a bug #143101 caused by 20383e4d82
`outliner_idcode_to_plural` fails to find correcty idtype with old
plural name. Fix this so it matches with `MainCollectionDef`.

Pull Request: https://projects.blender.org/blender/blender/pulls/143179
2025-07-30 11:41:44 +02:00
Aras Pranckevicius
cf27df45f8 Cleanup: Add enum types around various VSE DNA enums
- In various VSE related DNA structs, indicate which enums they use
  as comments,
- Add enum types for the enums that were untyped,
- Move Wipe effect enums to DNA header for clarity, since they are
  serialized values,
- Reduce SeqRetimingKey size from 40 bytes to 32 bytes; there
  was too much unnecessary padding.
- Rename some enums SEQUENCE_ -> STRIP_ where relevant.
- Rename wipe enums DO_MEOW_WIPE -> SEQ_WIPE_MEOW

Pull Request: https://projects.blender.org/blender/blender/pulls/143565
2025-07-30 11:00:19 +02:00
Guillermo Venegas
0cc1c212a8 Cleanup: UI: Remove public access to uiItem::type_
Follow up from recent UI refactors.
Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/143324
2025-07-30 07:17:00 +02:00
Campbell Barton
f281f5a500 Cleanup: header grouping
Group includes, this is mostly being done already but had become mixed
up in some areas.
2025-07-30 14:22:06 +10:00
Campbell Barton
d13540fe7d Cleanup: rename locked interface setting functions
Follow the convention of using terms such as get/set as a suffix.
2025-07-30 13:01:43 +10:00
YimingWu
46bd73f967 Fix #143360: Separate geometry flags RNA access from weight proximity modifier
In vertex weight proximity modifier, `proximity_geometry` shares the
same DNA variable as `proximity_flags`, which brings interference when
setting these two properties at the same time. Now separated
`proximity_geometry` access in RNA with a separated set function so it
only changes the relevant flags.

Pull Request: https://projects.blender.org/blender/blender/pulls/143405
2025-07-30 02:27:04 +02:00
Campbell Barton
61fe1f09e0 Cleanup: quiet compiler warnings
Also remove operation check in `file_os_operations_menu_item` since a
zero value is never passed in.
2025-07-30 10:10:44 +10:00
Harley Acheson
fcc434d60e Fix #134231: Allow Use of Shortcuts to External Operation Items
Right-clicking on a File Browser item shows a context menu that
(usually) includes a submenu "External". The items on that work
correctly when selected from the menu, but will not work correctly if
you create a keyboard shortcut directly to the item. This PR removes
the use of a filepath property on these, instead having each operate
on the currently-selected File Browser item.

Pull Request: https://projects.blender.org/blender/blender/pulls/134819
2025-07-30 00:13:00 +02:00
Sean Kim
4858e8e1bc Cleanup: Use enum class for PlaneAABBIsect
Pull Request: https://projects.blender.org/blender/blender/pulls/143586
2025-07-30 00:03:23 +02:00
Sean Kim
0e19a40e3a Cleanup: Rename internal Paint BVH node_tree struct 2025-07-30 00:03:16 +02:00
Harley Acheson
e154175a90 UI: Fade In Some Area Maintenance Overlays
This adds a slight ease-in fade in to the start of some area
maintenance operations. Fade in the highlighting of join areas, docking
targets, closed areas, etc.

Pull Request: https://projects.blender.org/blender/blender/pulls/140319
2025-07-29 23:36:05 +02:00
Harley Acheson
37a11ad824 UI: Shrink/Fatten Status Bar Display
This PR moves all keymap information for the mesh Shrink/Fatten
operator to the status bar and only the values on the area header.

Pull Request: https://projects.blender.org/blender/blender/pulls/141957
2025-07-29 22:59:46 +02:00
Harley Acheson
a08aabc9ee UI: Mesh Shear Status Bar Display Improvements
This PR adds some missing keymap items to the status bar display for
the mesh Shear operator. Adds snapping, precision, and proportional
editing size (when applicable).

Pull Request: https://projects.blender.org/blender/blender/pulls/141975
2025-07-29 22:39:41 +02:00
Harley Acheson
8ba44fe799 UI: Change "Full Screen Area" to "Focus Mode"
Areas can be made to take up more space in two different ways. One we
call "Maximize Area" that just takes up the rest of non-global space,
so leaving Top Bar and Status Bar and everything in the area unchanged.
The other option is shown as "Fullscreen Area" and it calls the same
operator with a use_hide_panels property. This hides the global areas
and also all regions in the area. This was added as an option for the
stereo 3D pipeline for viewing without the distraction of UI elements
that cause depth issue. #142418 further removed text overlays and the
navigation gizmos. This PR just renames the option to better describe
the result, using "Focus Mode".

Pull Request: https://projects.blender.org/blender/blender/pulls/142605
2025-07-29 21:30:25 +02:00
Harley Acheson
bbfc42fbf7 UI: Hide Content Selectively for Full Screen Area
Commit #142418 hid the navigation gizmo and text overlays while in Full
Screen Area by just not allowing those operations while in that mode.
This PR undoes that and instead selectively hides those items and
restores them afterward if they had been showing. The difference is
that this makes it possible to optionally bring them back while in the
mode. This adds a new fullscreen_flag to bScreen to store what was
visible to allow restoring afterward.

Pull Request: https://projects.blender.org/blender/blender/pulls/143144
2025-07-29 20:22:11 +02:00
Habib Gahbiche
06fe1357cf Cleanup: Silence warning on buildbot windows
`warning C4805: '==': unsafe mix of type 'short' and type 'bool'`

Pull Request: https://projects.blender.org/blender/blender/pulls/143567
2025-07-29 18:15:52 +02:00
Daniel Salazar
750d0df4e7 Shaders: Change default Blackbody node temperature to 6500K
Match the default value in Light Properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/143504
2025-07-29 17:49:05 +02:00
Omar Emara
0a1d146389 Fix #143542: Missing Media Type when in saving operator
If the scene is currently set to a Video media type and the user uses
the Save Image As operator, the Media Type in the operator will be
empty. That's because the image saving format is initialized based on
the scene format, but image saving does not support videos, so the enum
is invalid in that context.

This issue already existed before the introduction of media types, but
it happened for the file format field directly.

To fix this, we default to an image type if the scene is set to a video.

Pull Request: https://projects.blender.org/blender/blender/pulls/143549
2025-07-29 16:21:50 +02:00
Lukas Tönne
e676146516 Fix: Deleting instances fails assert on index range
Resizing instances initializes new element attributes, but this is only
valid when the capacity grows. Shrinking produces an invalid index range.

Pull Request: https://projects.blender.org/blender/blender/pulls/143535
2025-07-29 16:00:16 +02:00
Christoph Lendenfeld
5dfbe1af21 Refactor: Replace PBONE_SELECTED macro with functions
This PR changes the uses of `PBONE_SELECTED` and all the
places where it *should* have been used
with a new function `bone_is_selected` or `...editbone`
and `...pose_bone` specializations.

No functional changes intended.

Do note that there are still places in the code
where this function should probably be called,
but this PR is very careful not to change any behavior,
even if the current behavior is probably wrong.

In preparation for storing pose bone selection state
on the `bPoseChannel`
Related to #138482

Pull Request: https://projects.blender.org/blender/blender/pulls/139496
2025-07-29 14:37:35 +02:00
Campbell Barton
3de916ca25 RNA: support for marking properties as deprecated
Deprecation meta-data support for RNA properties.

- Properties may have a deprecated note and version.
- Warnings shown when these are accessed from Python.
- A note is included in the generated documentation.

Support for marking functions as deprecated can be added in the future.

Ref !139487
2025-07-29 22:09:59 +10:00
Campbell Barton
c4ba04428c PyAPI: show Python warnings by default when debugging
Show warnings for debug builds or when `--debug-python` is passed in.

Without this, only scripts running in the `__main__` namespace
show warnings - hiding warnings for almost all scripts & add-ons.

This is also needed so deprecation warnings can be shown, see !139487.
2025-07-29 22:09:59 +10:00