Commit Graph

103289 Commits

Author SHA1 Message Date
Miguel Pozo
c6194afc41 Fix: Workbench: Missing texture flag
Drawing volumes would trigger an assertion after fe39456ba5.
2023-10-06 17:48:40 +02:00
Jacques Lucke
2fdb38f972 Fix: failing string search test 2023-10-06 17:27:48 +02:00
Germano Cavalcante
cf93c16775 Fix #112580: Limit Constraint with 'Affect Transform' not working properly in 'World Space'
The problem is observed with the "Limit Distance" and "Limit Location"
constraints.

There is an incorrect usage of `td->mtx` and `td->smtx` when converting
`TransData` space from local to global.

In this case, the code is concatenating matrices instead of converting
the location component space.

Also, these matrices only inform the global transformation components
of rotation and scale. They do not include location.

Since the "Limit Distance" and "Limit Location" constraints only require
the location component, it is not necessary to convert the rotation and
scale components.

So, the solution is to convert the location component space instead of
concatenating matrices.

Pull Request: https://projects.blender.org/blender/blender/pulls/112601
2023-10-06 12:19:53 -03:00
Jacques Lucke
0aa91a30dd Fix #113092: take highlighted part of search item into account in more places
When using menu-search, only the last part of a search item is highlighted.
When sorting the search results, this should be taken into account and
the highlighted words should be prioritized.

This was already partially implemented in 56e98f8ba6. Now it's also
taken into account with prefix search. For example, `TC` now prefers
`Input > Texture Coordinate` over `Texture > Checker Texture`.
2023-10-06 16:38:45 +02:00
Jacques Lucke
046155572d UI: use recent search for weighting only if the query is short
The idea is that accessing recent searches is mostly only useful when actually
searching for something very recent, which means that it would show up at the
top even if the query is empty or extremely short. If the user is typing a longer
query, it likely means that what is at the top is not what is actually desired, so
it's better to not take recent searches into account anymore.

Pull Request: https://projects.blender.org/blender/blender/pulls/113338
2023-10-06 16:16:07 +02:00
Miguel Pozo
fe39456ba5 Workbench: Fix: Performance Regressions
Optimize Workbench performance so it's on par with the previous
implementation.
Most of these changes are barely noticeable on powerful GPUs,
but can cause a notable performance improvement on old or low-end
hardware.

* Avoid unnecessary texture copies and draw directly to the viewport
   textures.
* Optimize-out depth/stencil reads, using stencil testing instead.
* Avoid using `Texture::clear` and use framebuffer clears instead.
* Avoid framebuffer state changes (always use the same attachments).
* Avoid constant variation of acquired `TextureFromPool`s.

Fix #113010

Pull Request: https://projects.blender.org/blender/blender/pulls/113251
2023-10-06 15:31:44 +02:00
Iliya Katueshenock
1a30e0597b Fix #113095: deduplicate attributes in search
Pull Request: https://projects.blender.org/blender/blender/pulls/113097
2023-10-06 14:41:33 +02:00
Jacques Lucke
271f634a84 Fix #113319: crash with out of bounds index in curve sample node
This was broken in 5063f7a725.
2023-10-06 13:58:17 +02:00
Christoph Lendenfeld
d85e7f4577 Fix #87160: Clean Keyframes only works if channels are selected
The issue was that the code filtered for selected channels,
while the expectation was that it would only filter for selected keys.

This PR changes the behavior of the operator in the following way:
* when "Clean Channels" is **disabled**, it will clean only selected keyframes, regardless of the channel selection
* when "Clean Channels" is **enabled**, it will clean selected channels regardless of keyframe selection

The same logic was applied to the Graph Editor code.
It only makes a difference in the case when "Clean Channels" is enabled.
That is because channels were automatically selected when a key was selected.

In addition to that I moved the menu entry for "Clean Channels" to the channel menu
to reduce confusion.

Another solution would have been to make the Dope Sheet select channels
when keys are selected. This might still be done in the future, but I think the
only correct fix is to change the actual operator behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/113335
2023-10-06 13:51:04 +02:00
Leon Schittek
8d15783a7e UI: display invalid cache as striped lines in the timeline
Unify the way the different state's of a cache are shown in the timeline:
* Baked: fully opaque
* Cached: slightly transparent
* Invalid cache: slightly transparent, dark diagonal stripes

This improves accessibility since patterns are easier to recognize
for colorblind or otherwise visually impaired people.

The slight transparency is done with an alpha of 0.7 and the diagonal
stripes use the cache's color at 50% value.

Implements #108196.

Pull Request: https://projects.blender.org/blender/blender/pulls/108481
2023-10-06 13:12:16 +02:00
Pratik Borhade
b5ebf31fb1 Fix #113022: Disabled menu item's text uses inner color
This fails to differentiate between active buttons and disabled buttons
for some custom themes (and also in blender light theme)

Instead use text color with 0.5 alpha value for disabled item's text.
(Don't blend between text and inner color)

Pull Request: https://projects.blender.org/blender/blender/pulls/113082
2023-10-06 12:54:14 +02:00
Sybren A. Stüvel
4c64c34f49 Fix #110874: Anim: Theme confusion with 'Pose Bone' label
Update the label of the "Bone Pose" theme setting to "Bone Pose Selected".
That is now consistent with the already-existing "Bone Pose Active"
label.

Also add tooltips that clarify what these theme colors are used for.
2023-10-06 11:46:52 +02:00
Campbell Barton
35edcf2ed6 Fix #107594: Phantom cursor motion when resizing windows under Wayland
Resizing a window in Wayland caused cursor motion events in the window
which could be seen as buttons flashing when the cursor was detected
as hovering over buttons.

This was caused by two bugs:

- Missing checks for failure to access the cursor location before
  converting the coordinates from GHOST to screen-space meant the
  wmWindow::eventstate location would move each time the location
  was updated.

- Resizing the window wasn't detecting state changes and would
  continuously send window activation events. Window activation set
  wmWindpw::addmousemove which triggered the previous bug, making the
  cursor flicker during resize.

This commit only addresses the first issue, where failure to access
the cursor location wasn't accounted for
(window activation will be fixed separately).

All GHOST_GetCursorPosition & wm_cursor_position_get calls now account
for failure, resolving uninitialized stack memory use in some cases.

This resolves similar issues for macOS, WIN32 & X11 although it seems
likely these platforms rarely fail to access the cursor location.
2023-10-06 17:12:32 +11:00
Jeroen Bakker
c801c73d79 Python: Update BGL Deprecation Warning
BGL is deprecated and will not work on Metal devices. Although the
inital plan was to remove it in Blender 4.0, We don't see any harm
to still have it in the code-base until OpenGL itself is deprecated.

Add-on developers are warned when using the BGL module that the
add-on/script will not work on all platforms.

There are still some limitations inside the GPU module that needs
a more friendly API. This API isn't clear at this time.

Pull Request: https://projects.blender.org/blender/blender/pulls/112579
2023-10-06 07:37:44 +02:00
Campbell Barton
5e2b8c43e4 Fix invalid collection length for dummy unit collection
While this didn't show up as a bug, if this length was used it could
result in an out of bounds read.
2023-10-06 13:23:42 +11:00
Hans Goudey
ecb52140cd Fix #113128: Socket hide value not copied to group input
This needs to be copied explicitly to the interface socket.

Pull Request: https://projects.blender.org/blender/blender/pulls/113286
2023-10-06 00:43:45 +02:00
coyo_t
b0706a57ac Fix #106760: Cycles OSL boolean socket not working
Pull Request: https://projects.blender.org/blender/blender/pulls/109576
2023-10-05 21:55:10 +02:00
Denis Kovacs
7a9284107d USD: Improve camera import/export and round-tripping
Fix various issues in import and export of cameras.

* Wrong units and flipped shift values on import
* Wrong clip start lower range on import
* Wrong units for aperture and focal length properties on export
* Issue with auto sensor fit and height > width on export

Pull Request: https://projects.blender.org/blender/blender/pulls/112905
2023-10-05 19:47:11 +02:00
Sergey Sharybin
ba767610cf Fix #113280: Incorrect display of Cycles border render while rendering
A regression since d579ac2b3f.

Cycles delays allocation of the render buffers, which makes it impossible
to access effective render resolution during rendering. This was making the
drawing code to fall-back to the full scene resolution with only percentage
and crop accounted for.

This change makes it so an empty ImBuf is used to communicate the render
result resolution. It does not have any pixel buffer associated with it,
which actually matches the behaivor prior to the offending commit.

Pull Request: https://projects.blender.org/blender/blender/pulls/113282
2023-10-05 15:16:15 +02:00
Damien Picard
730bb2ee3e I18n: make new bones and bone collections' names translatable
Newly created bones and bone collections get a default name. Like
other types of data, these names should be translated if the user
enabled the translation of new data in the preferences.

This commit adds the appropriate `DATA_()` macro:
- when creating a new armature;
- when creating a new bone;
- when creating a new bone collection through `ANIM_bonecoll_new()`;
- when ensuring that a new bone collection has a unique name;
- when renaming a bone collection;
- in the bone collection tests, to check that new bones have the
  expected translated name.

It also sets the default value of the bone name in the
`ARMATURE_OT_bone_primitive_add()` operator to a null string instead
of "Bone", so that the default name may be chosen while checking for
unique names, since an empty string will default to the translation.

Pull Request: https://projects.blender.org/blender/blender/pulls/113171
2023-10-05 14:38:51 +02:00
Damien Picard
e773e0952a I18n: fix translation of Grease Pencil 3.0 layer names
The Grease Pencil 3.0 layers and groups were not properly translated:
- The layers and groups' names were translated during display in the
  layer list. Since they are data, they should be left untranslated at
  this time.
- On object creation, the names "GP_Layer", "Color", "Lines", and
  "Fills" were not translated at all.
  This adds DATA_() macros around to translate them if the user has
  enabled translation of new data names.
- The functions returning unique names for layers and groups
  unique_layer_group_name() and unique_layer_name() would return
  "GP_Layer" and "GP_Group" by default.
  These defaults are now translated.
- When adding new layers and groups, the name was always hardcoded to
  "GP_Layer" and "GP_Group" because the operators' properties for the
  names defaulted to that, and prop defaults cannot be translated.
  Instead, make them default to a null string, but choose an
  appropriate name when executing the op. This name is chosen by
  unique_layer_name() and unique_layer_group_name(), whose defaults
  are now translated.

Pull Request: https://projects.blender.org/blender/blender/pulls/112930
2023-10-05 10:51:31 +02:00
Campbell Barton
c1ee3f9759 UI: correct names for sequencer modifiers
The commit that de-duplicated arrays [0] changed the user visible names
since the names didn't match exactly.

[0]: 9f06aec32f
2023-10-05 15:03:31 +11:00
Campbell Barton
2cf8c7ecf4 Docs: note why the wait cursor isn't set for the startup file 2023-10-05 14:56:29 +11:00
Campbell Barton
9d20632925 Cleanup: ensure trailing newline, delete trailing space 2023-10-05 13:57:14 +11:00
Campbell Barton
3859a08704 Cleanup: use the name 'ot' for wmOperatorType for unused arguments 2023-10-05 13:55:35 +11:00
Campbell Barton
9d4dc5376c Fix #112377: Edit Source missing info in the status bar
Reports from the internal operator weren't forwarded to the Python
operator, they were printed in the console instead.

Resolve by moving the operator to C++, use a utility function
to launch the external editor instead of an operator.
2023-10-05 13:09:47 +11:00
Campbell Barton
c9130e38e3 Cleanup: spelling in comments 2023-10-05 13:07:58 +11:00
Campbell Barton
0e1eff96e2 Cleanup: use exec/invoke suffix for operator callbacks 2023-10-05 12:57:31 +11:00
Campbell Barton
291e54abfb Fix building WITH_PYTHON=OFF 2023-10-05 12:57:29 +11:00
Germano Cavalcante
d6b2b5d0c5 Fix #112978: MacOS no longer has a path associated with the window
The problem was introduced in 636f3697ee

MacOS has a different way of handling the title.

In this OS the directory is searched and taken from the title string
which is then formatted.

This limits the title format and makes it prone to errors.

This commit makes the code more generic by splitting each component of
the title beforehand and allowing the associated directory to be informed
with `GHOST_SetTitle`.
2023-10-04 21:23:38 -03:00
Brecht Van Lommel
6f6fd99dbb Fix I/O debug message printed without debugging enabled 2023-10-04 21:30:41 +02:00
Harley Acheson
af91b3dd72 Cleanup: Make format
Just formatting changes from Make Format
2023-10-04 12:12:31 -07:00
ChengduLittleA
6d64c6dcd7 UI: Recognize CJK punctuation when selecting text
Add frequently-used Chinese, Japanese, Korean special character
delimiters (punctuation, quote characters, brackets, etc) to aid the
selection of character segments in text operations.

Pull Request: https://projects.blender.org/blender/blender/pulls/112852
2023-10-04 21:08:13 +02:00
Richard Antalik
dcf2c11d5e Fix build warning in previous commit 2023-10-04 19:44:14 +02:00
Richard Antalik
1b59571f6b Fix VSE retiming usability issues
Rename Retime Strips -> Toggle Retiming Keys
Gray out items in retiming menu instead of hiding
Remove selection operators from retiming menu
Gray out items in select menu when retiming
Prevent selecting keys, if overlay is disabled
Add show retiming keys toggle to sidebar time panel

ref https://projects.blender.org/blender/blender/issues/112343

Pull Request: https://projects.blender.org/blender/blender/pulls/113211
2023-10-04 19:27:28 +02:00
Vasilis-Milios
6d1c5790d5 Fix #113194: show the single value for sockets of type field
Pull Request: https://projects.blender.org/blender/blender/pulls/113244
2023-10-04 19:21:07 +02:00
Sergey Sharybin
92647bdbdd Fix light linking state being lost on collection copy and duplicate
This preserves the light linking state when collection is copied manually
via the copy-paste or duplicate functionality, but also should fix the
problem of lost light linking state when adding a collection override.

Pull Request: https://projects.blender.org/blender/blender/pulls/113243
2023-10-04 18:10:09 +02:00
Damien Picard
1fa7ba125c I18n: translate bones' 'Move to Collection' operator menu.
Several items are untranslated in the 'Move to Collection' operator
menu (the bone collections one, `ARMATURE_OT_move_to_collection`).
This is because it uses custom callback to allow the menu content
to be dynamically generated.

Because of this, some labels have to be translated manually using
`CTX_IFACE_()`. The translation context is "Operator" because these
messages come from an operator.

On the other hand, the destination collections themselves should not
have their name translated since they are data. The property now uses
the `PROP_ENUM_NO_TRANSLATE` flag for this.

PR: https://projects.blender.org/blender/blender/pulls/113224.
2023-10-04 16:59:57 +02:00
Bastien Montagne
2d2c7457cf Fix #112548: Assert in object parenting liboverride code.
Dummy mistake in commit(s) a few months ago that fixed/improved handling
of parenting between objects in liboverride context, trying to access an
Enum propoerty as an int one...

This will have to be backported to 3.6LTS as well.
2023-10-04 14:43:42 +02:00
Bastien Montagne
c820f9b85c Fix #112649: Crash loading early 2.80 blend file without a scene collection.
Caused by 23835a393c, which removed entirely the transitive
`SceneCollection` struct and associated versioning code. This was used
in very early 2.80 development period (up to 2.80 sub 14 apparently)
instead of the current 'master collection'.

The purpose of this commit is only to fix the crash, not to restore
the support for this old, deprecated and never-released type of data.
2023-10-04 12:42:53 +02:00
Peng Yan
dcb2c0bdf6 BMesh: remove redundant calculation from BMesh bisect
Besides being a redundant calculation,
reducing stack memory usage is generally worthwhile.

Ref !113153.
2023-10-04 15:25:07 +11:00
Colin Basnett
46647ed911 Fix typo in documentation for BMVertSeq.new
Ref !113190.
2023-10-04 15:13:06 +11:00
Campbell Barton
30a580bf30 Fix failure to remove temp-dir when initializing GPU backend fails
Call WM_exit() instead of exit() cleanup functions run.
2023-10-04 11:41:59 +11:00
Campbell Barton
f82e520d22 Cleanup: spelling in comments 2023-10-04 10:31:52 +11:00
Harley Acheson
e44f500be8 Fix #102591: Improvements to Context Menu Path Operators
Improvements to `ui_but_menu_add_path_operators` so that it properly
differentiates between files and directories even if the filepath is
not slash terminated. It will also not add the operators to the menu
if the filepath does not exist.

---

Right-clicking on a pathname input we get a context menu that might contain "Open File Externally" and/or "Open Location Externally".  But the first problem is that it does not check if this location exists, and we do have times where the paths do not exist yet.  This PR makes this function a bool so that can return false if the files do not exist.

The second problem is that the function does not properly differentiate between a file path and directory path. For a directory path that is not slash terminated it will assume it is a file path.  This PR actually checks the path (BLI_is_dir) to see if it really is a directory path.

Pull Request: https://projects.blender.org/blender/blender/pulls/113216
2023-10-03 18:44:56 +02:00
Damien Picard
b05db089af I18n: translate node panel titles
Nodes recently gained the ability to group inputs into collapsible
panels. These were untranslated, so this commit:
- Adds the appropriate regex to extract node panels defined with
  the `add_panel()` callback.
- Adds the `IFACE()` translation macro to the drawing code for the
  nodes, as well as the properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/112968
2023-10-03 18:24:19 +02:00
Damien Picard
52fcd5fdfd I18n: extract and disambiguate a few messages
Disambiguate:
- Rename "Near" to "Proximity" as a particle event type, because using
  an adjective in this context is inconsistent and sounds
  strange (even in English IMO).

Extract:
- "Skip" (Geometry nodes Simulation node output socket)
- "Bake" (Directory path to geometry nodes bake files in the modifier
  UI)
- " (Recovered)" (File information in title bar)

Pull Request: https://projects.blender.org/blender/blender/pulls/112974
2023-10-03 18:21:03 +02:00
Marcos Perez
5c76c7bf84 Fix: #113084 VSE equalizer stutters when any strip is animated
Only update equalizer data, when sound is tagged to be recalculated.

Co-authored-by: menda <alguien@aqui.es>
Pull Request: https://projects.blender.org/blender/blender/pulls/113156
2023-10-03 18:13:24 +02:00
Lukas Tönne
050c081784 Fix #113210: Custom socket declarations require idname reference
This was removed accidentally. Custom socket declarations require the
idname reference to check for matching node group sockets.

Pull Request: https://projects.blender.org/blender/blender/pulls/113214
2023-10-03 18:09:17 +02:00
Sergey Sharybin
fff74145f1 Fix #113186: The Render Result attribute "has_data" is always False
Caused by d579ac2b3f

This change restores the behavior of the flag to how it was prior to
the refactor which used ImBuf for storage in the RenderResult.

This flag still has issues with configurations when there are multiple
scenes in the .blend file, and that it is only "valid" when the image
is actually displayed. However, these limitations and quirks already
existed prior to the refactor commit.

Pull Request: https://projects.blender.org/blender/blender/pulls/113199
2023-10-03 17:09:04 +02:00