Commit Graph

128187 Commits

Author SHA1 Message Date
Campbell Barton
a5cd497543 Console: add support for displaying tab-stops
Without this it was necessary to convert pasted text into spaces
for them to display properly.

Since tabs are a valid part of a string, it's incorrect to assume
tabs can always be expanded to spaces.

Pasted text and console output now display tabs properly,
the tab still uses spaces for indenting though.
2023-09-22 13:43:12 +10:00
Harley Acheson
18e07098ef UI: Support additional console text operations
Adds the ability to set text cursor position in the Console editor
by clicking with the mouse and many other expected operations such as
cut, select all & deselect on text entry.

Ref !108626
2023-09-22 13:36:29 +10:00
Campbell Barton
f13f61df98 GHOST/Wayland: follow SDL's method of XDG window initialization
Using SDL's initialization logic, this is mainly a change for XDG
as LIBDECOR already required a configure event before accessing
the underlying XDG window.

While I didn't notice functional changes with this change window
flickering on startup remains an issue with some compositors
(KDE & river). Debugging these issues is simpler when both windowing
decoration systems work in a similar way & window configuration
is guaranteed to have run before the window is returned.
(via #xdg_surface_ack_configure).
2023-09-22 12:43:22 +10:00
Campbell Barton
5fbcb4c27e Cleanup: remove spaces from commented arguments
Also use local enums for `MA_BM_*` in versioning code.
2023-09-22 12:21:18 +10:00
Hans Goudey
867f99c2af Cleanup: Move depsgraph headers to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/110816
2023-09-22 03:18:17 +02:00
Campbell Barton
aba119e192 Cleanup: quiet CMake uninitialized variable warning, sort file lists 2023-09-22 11:04:25 +10:00
Campbell Barton
31aa6fa073 Cleanup: various non-functional C++ changes 2023-09-22 10:52:40 +10:00
Campbell Barton
fb624720eb Cleanup: remove 'apple' variable for key-map parameters
The OSKEY-Comma key-map item will be kept on macOS by the
bl_keymap_utils.platform_helpers utility function.
2023-09-22 10:37:23 +10:00
Campbell Barton
fd0d6b27bb Cleanup: remove unnecessary hasattr check 2023-09-22 10:16:13 +10:00
Campbell Barton
4e46803e04 Docs: add warning regarding WM_redraw_windows 2023-09-22 10:02:05 +10:00
Campbell Barton
6a8fc659ba Cleanup: spelling in comments 2023-09-22 10:02:05 +10:00
Pablo Vazquez
d0aa521ea8 UI: Minor layout and style adjustments in Preferences
Small style and layout tweaks of some tabs in Preferences.
Mainly inline styling for compact layouts, grouping labels and
adding icons where needed.

Purposely leaving aside complex areas such as Themes,
Add-ons, or Keymap. They require larger design decisions.

Pull Request: https://projects.blender.org/blender/blender/pulls/112393
2023-09-22 01:07:56 +02:00
Hans Goudey
ef5e57bbff Cleanup: Move softbody.c to C++
See #103343.

We had attempted to move the file to C++ twice before but found failing
tests each time. To find the code with changed behavior between C and
C++, I temporarily added a header declaring all the functions and moved
them one by one. The problem ended up being one function's use of `exp`
which used floats instead of doubles in C++.

Pull Request: https://projects.blender.org/blender/blender/pulls/112693
2023-09-22 00:34:17 +02:00
Harley Acheson
f58f6d0338 UI: Replace UI Font with Inter Regular v3.19
Replace default UI font DevaVuSans with Inter Regular v3.19

Pull Request: https://projects.blender.org/blender/blender/pulls/112603
2023-09-21 22:44:07 +02:00
Harley Acheson
a0b4ead737 BLF: Subpixel Positioning, Anti-aliasing, Hinting
Text output using subpixel positioning, subpixel anti-aliasing, and
typographically-correct hinting.

Pull Request: https://projects.blender.org/blender/blender/pulls/105441
2023-09-21 22:43:17 +02:00
Brecht Van Lommel
eadb4ad54d Cleanup: compiler warning 2023-09-21 20:10:01 +02:00
Hans Goudey
89422a7719 Fix: Crash drawing node with null panel name
Don't call `strlen` on a null pointer.
2023-09-21 14:02:22 -04:00
Hans Goudey
72a33623e6 Cleanup: Sculpt: Use C++ threading API
Also remove unnecessarily parallelized loop that was just setting a
flag for every PBVH node.
2023-09-21 13:42:13 -04:00
Jeroen Bakker
805c58d9ec Fix 112641: OpenGL Shader Draw Parameter Workaround Broken
The workaround for shader draw parameters isn't working for OpenGL. The
reason is that it isn't looking for the correct attribute to attach the
buffer to.

This fixes the issue that all objects where drawn using the unit matrix when
starting blender with `--debug-gpu-force-workarounds`.

![image](/attachments/f05b712e-e3f2-4ad5-b098-7e9d01bc4ca4)

Fixes #112641

Pull Request: https://projects.blender.org/blender/blender/pulls/112668
2023-09-21 19:34:07 +02:00
Harley Acheson
e7df63ca72 Revert "UI: File Loading Waiting Feedback"
This reverts commit 9173c142d6 as this can cause problems from scripts
and command-line.

Pull Request: https://projects.blender.org/blender/blender/pulls/112682
2023-09-21 18:48:07 +02:00
Brecht Van Lommel
3d15a07bde Revert "install_linux_packages: Raise LLVM default version to 15.0.7."
This reverts commit 607adbca47655833368c435dfde3b6449e120134.

The LLVM upgrade is being postponed to 4.1.

Ref #109244
2023-09-21 18:46:30 +02:00
Brecht Van Lommel
13fac109d3 UI: support drawing buttons inside node panels
With a callback to node panels similar to the one for nodes. Used in the
Principled BSDF to place enums in the relevant panels.

Longer term we want to make enums into sockets, but even then there are
still potentially some types of buttons we want to have in panels.

Pull Request: https://projects.blender.org/blender/blender/pulls/112591
2023-09-21 18:46:30 +02:00
Brecht Van Lommel
8e602d914b UI: draw node panels in material properties editor
The layout for this is not great but consistent with existing
collapse/expand functionality there. There are ideas to replace this
entire material properties drawing longer term, but for 4.0 it's
important to show the panels in some way.

Pull Request: https://projects.blender.org/blender/blender/pulls/112591
2023-09-21 18:46:30 +02:00
Brecht Van Lommel
a4a5ac545c UI: shorten node socket labels when they start with the panel name
Shortening names based on context is something we do in the user
interface throughout Blender. This is a simple automatic mechanism to do
it for node panels as well, which significantly improves the Principled
BSDF layout.

We want the properties and sockets to be identifiable outside of the
panel contextcontent, for example in the animation editor, API docs, or
when exposing a single socket as a group input. So making the actual
name shorter is not an option.

Pull Request: https://projects.blender.org/blender/blender/pulls/112591
2023-09-21 18:46:30 +02:00
Brecht Van Lommel
208323c087 Fix duplicate preference key shortcut on macOS, causing test failure
After recent changes in 86f659a.
2023-09-21 18:46:30 +02:00
Brecht Van Lommel
1ef63e93b4 Fix missing BSDF nodes in add menu with Hydra render engines
Default to displaying nearly all nodes when the engine is not set to
Cycles or Eeeve. And instead hide nodes not supported in Eevee only
when Eevee is selected.

This way external engines can use the same menu, particularly useful
for upcoming support for conversion to MaterialX.

Only the Shader category was incomplete like this, so it can also be
seen as fixing an inconsistency with other categories.
2023-09-21 18:46:30 +02:00
Hans Goudey
64ce21aa2a Cleanup: Move sculpt mask fill to lambda, remove data struct
The actual logic in the callback is quite short, most of the lines are
dedicated to moving arguments in and out of a local "data" struct.
2023-09-21 12:45:17 -04:00
Sergey Sharybin
e807bf23f1 Cleanup: -Wmissing-braces compiler warning
Pull Request: https://projects.blender.org/blender/blender/pulls/112680
2023-09-21 17:50:05 +02:00
Julian Eisel
f292cd6823 Fix duplicated member in grid view item class
This member is located in the `AbstractViewItem` class now, which is a
base class of this. Not sure why this didn't cause issues before.
2023-09-21 17:42:37 +02:00
83306754d4 Collada: add bone collection support
Replace the import/export of armature layers with bone collections.

The Old Way:
- Export: Each bone would store which armature layer it was on.
- Import: All armature layers that contain at least a bone are shown.

The New Way:
- Export: Each armature contains a list of its bone collections,
  including which one is active and which ones are visible.
- Export: Each bone stores which bone collection it is on.
- Import: the above data is simply used as-is.

Due to limitations of the current Collada importer code, each "extra"
tag can only occur once per Collada node. This means that it was
impossible to write a `<collection name="Bones">` tag for each bone
collection, as only one of those would actually be stored by the
importer for further processing. To work around this limitation, all
bone collection related tags store their values as newline-separated
strings. Example:

```
<node id="Armature">
  <extra>
    <technique profile="blender">
      <collections sid="collections" type="string">Layer 1
Layer 3b
Group
That One Bone</collections>
      <visible_collections sid="visible_collections" type="string">Layer 1
Layer 3b
That One Bone</visible_collections>
      <active_collection sid="active_collection" type="string">That One Bone</active_collection>
    </technique>
  </extra>
</node>
```
2023-09-21 17:09:25 +02:00
f0c89afb76 Anim: move creation of default bone collection to the Shift+A operator
Instead of adding the default "Bones" bone collection to every Armature
data-block, only add it for Armatures that are added in the 3D View with
Shift+A > Armature.

This simplifies things like importers, which otherwise would have needed
to remove that default collection before creating the imported ones.

Additionally, this also ensures that the one bone you get by default is
actually assigned to the default bone collection.
2023-09-21 17:09:25 +02:00
004a348efc Anim, refactor the show/hide all bone collections functions
Instead of setting flags directly, use the `ANIM_bonecoll_{show,hide}`
functions. And introduce the `ANIM_bonecoll_show` function for symmetry.
2023-09-21 17:09:25 +02:00
661065aed4 Refactor: Anim, move function for setting active bone collection by name
Move the 'set active bone collection by name' functionality from RNA
to the ANIM module, so that it can be used in other places.

No functional changes.
2023-09-21 17:09:25 +02:00
Brecht Van Lommel
f0840cee2a Build: update 4.0 libraries to address CVEs and bugs
And ignore a few CVEs that do not affect Blender.

openimageio 2.4.15
openssl 3.1.2
python 3.10.13
sndfile 1.2.2
webp 1.3.2

Ref #109244

Pull Request: https://projects.blender.org/blender/blender/pulls/112529
2023-09-21 17:02:46 +02:00
ChengduLittleA
4720fda1a7 Fix #112604: Add "tag" to the tool tip of asset search
Asset search will also filter tags alongside names, this patch makes the
description consistent with what it actually does.

Pull Request: https://projects.blender.org/blender/blender/pulls/112609
2023-09-21 16:00:14 +02:00
Christoph Lendenfeld
057de815ef Fix #97628: Clear and Keep Transformation not working when keyed
When clearing the parent of an object that has keys,
the object position jumped back to world space immediately.
This didn't allow for keying the current position
and was inconsistent with setting a parent.

This PR fixes it by not instantly re-evaluating the animation.

Pull Request: https://projects.blender.org/blender/blender/pulls/112670
2023-09-21 15:43:09 +02:00
Jeroen Bakker
dd3e23e812 Vulkan: Show Missing Implementations
This PR will print a message when a vulkan method isn't implemented.
So we can keep track of what still needs to be implemented.

Pull Request: https://projects.blender.org/blender/blender/pulls/112671
2023-09-21 15:21:32 +02:00
Christoph Lendenfeld
01927e1e45 Anim: Time Offset Slider
This patch has been originally authored by Ares Deveaux #106520
I am just finishing it up.

This is a new operator for the Graph Editor.
It shifts the value of the keys in time,
while keeping the actual key positions in the same place.
It supports wrapping, so when offsetting beyond the range
of the F-Curve it will take values from the other end,
but offset in y-value so there is no jump.

This works best with dense key data.

Co-authored-by: Ares Deveaux <aresdevo@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/110540
2023-09-21 15:11:16 +02:00
Julian Eisel
998e8d0ef6 Asset shelf: Improved region height snapping behavior
Rather than always snapping the region size to the closest multiple of
the row height, remember the amount of rows displayed after the user
resized the region, and try to preserve that. This gives a lot more
predictable behavior, especially when the "Show Names" option is toggled
on and off, and the region resizes in response. With the old method the
amount of visible rows could change multiple times while toggling.

This also enables us to clamp the amount of rows (e.g. while the preview
size is increased and the region becomes too large for the area; or,
when a catalog tab is activated with fewer assets and thus fewer rows)
but still restore the amount of rows the user chose earlier, as soon as
possible.

Part of #107881.

Pull Request: https://projects.blender.org/blender/blender/pulls/112637
2023-09-21 15:08:26 +02:00
Nathan Vegdahl
be5cf8f8a1 Anim: add graph editor key/handles selection operator
This adds an operator `graph.select_key_handles` to the graph editor
that changes the selection of the different parts of a bezier keyframe.  It
operates on all keys that are either themselves selected or have either of
their handles selected, and changes whether the key itself and/or its handles
are selected.

The operator has three options:

- `left_handle_action`
- `right_handle_action`
- `key_action`

Each of which can be set to:

- Select
- Deselect
- Keep (do nothing)

Co-authored-by: cgtinker <Denys.Hsu@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/111143
2023-09-21 15:05:30 +02:00
Julian Eisel
8b610723b6 Fix tooltip showing button label redundantly (regression)
With 9d0907560a, button tooltips would now often display the label even though
it's already visible in the button itself.

This fix brings back the old logic for displaying the label, but it's still
possible to override the label via the callback introduced in the earlier
commit.

Comments are updated/added here to make the behavior more clear.

Pull Request: https://projects.blender.org/blender/blender/pulls/110469
2023-09-21 14:49:53 +02:00
Jacques Lucke
710898a1ec Fix: segfault in geometry nodes with logging
The issue was that the `user_data` pointer in the local user data
is not necessarily valid, because a different user-data might be
passed in when a lazy-function is called a second time (it's semantically
the same user-data but, might have a different pointer).

The solution is to not keep around the dangling pointer but to pass
it in when it is actually needed. I still keep the old constructor of the
local-user-data, because more stuff might be added to it, that needs
the user-data, as was the case in the past already (before 142541c27).
2023-09-21 14:37:29 +02:00
Jeroen Bakker
ecb910a89f Cleanup: Make Format 2023-09-21 13:34:56 +02:00
Jeroen Bakker
6d91d36161 GPU: Remove GPU_shader_storage_buffer_objects_support
Blender 4.0 requires OpenGL 4.3 which always support SSBO's.
Platforms that don't support enough SSBO bind points will be marked
as unsupported.

Users who start Blender on those platforms will be informed via a
dialog. This PR also updates the `--debug-gpu-force-workarounds`
to match our minimum requirements. Note that some bugs are still
there that should be solved in other PRs:

* Workbench only renders the object using a unit matrix this is because
  there is a bug in the workaround for shader_draw_parameters
* Navigating with middle mouse button is not working. Unsure what the
  cause is, but might be a missing feature check in the OpenGL backend.

Related to #112224

Pull Request: https://projects.blender.org/blender/blender/pulls/112572
2023-09-21 12:55:51 +02:00
Christoph Lendenfeld
25031f8a86 Anim: Graph Editor Push/Pull operator
This finishes the work that Ares Deveaux started here #106527

Scales the selected keys from an imaginary line that
runs from the start to the end of the segment.

Co-authored-by: Ares Deveaux <aresdevo@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/112388
2023-09-21 12:46:27 +02:00
Pratik Borhade
7e944b1b2c GPv3: Add statistics information
Like legacy Grease pencil, display strokes, points, frames information
for new grease pencil object

Pull Request: https://projects.blender.org/blender/blender/pulls/112573
2023-09-21 12:42:40 +02:00
Campbell Barton
fb5629adb3 Cleanup: reduce right shift in ui_litem_layout_radial 2023-09-21 20:15:09 +10:00
Campbell Barton
0c4932d3d9 Cleanup: avoid shadowing variables 2023-09-21 20:12:28 +10:00
Lukas Tönne
36b90acde1 Node drawing: fix uninitialized node color return value
Bug in #112658.
2023-09-21 12:07:18 +02:00
Lukas Tönne
fdf1040532 Fix #112462: Panel buttons remain active after redrawing
This seems to be an issue deep inside UI drawing code. The nodes render
the panel button in the correct place,
but it doesn't correctly update the button state after a redraw, unless
the mouse is moved. The button is still in a `BUTTON_STATE_HIGHLIGHT`
state after drawing, and a mouse press will trigger it regardless of
where the mouse cursor actually is.

A common hack to force a reset of the button state is to add a fake
mouse move event using `WM_event_add_mousemove`.

Pull Request: https://projects.blender.org/blender/blender/pulls/112503
2023-09-21 12:05:08 +02:00