Commit Graph

7644 Commits

Author SHA1 Message Date
Pratik Borhade
8d8d358196 GPv3: Replace active_layer with active_node
This was discussed in #121390 for further selection support of
layer groups.

Pull Request: https://projects.blender.org/blender/blender/pulls/121475
2024-05-07 11:26:33 +02:00
Campbell Barton
eda129a768 Cleanup: quiet parentheses warning 2024-05-07 12:59:12 +10:00
Hans Goudey
88b4498b32 Cleanup: Miscellaneous cleanups to workspace status items
- Remove meaningless const for by-value arguments in declarations
- Use std::move for strings (otherwise StringRef should be used)
- Move struct to C++ namespace
- Avoid unnecessary namespace specification
- Use static constexpr instead of macros
- Add const for other arguments in function definitions
- Avoid copying struct in for loop
- Remove redundnat "private" in class
2024-05-06 18:20:43 -04:00
Harley Acheson
44606c5e4d UI: Status Bar While Menus Are Open
While menus are open display a nicer status in the Status Bar, whether
spacebar search or type to search.

Pull Request: https://projects.blender.org/blender/blender/pulls/121502
2024-05-07 00:19:01 +02:00
Harley Acheson
c4e5a70e07 UI: Optional Complex Layout for Workspace Status
Optionally allow complex layout instead of just plain text when using
ED_workspace_status_text.

Pull Request: https://projects.blender.org/blender/blender/pulls/120595
2024-05-06 23:52:37 +02:00
Campbell Barton
0fedcc2f3c Cleanup: correct invalid use of "r_" prefixed return arguments
These arguments are modified in-place and aren't output-only variables.
2024-05-06 11:58:44 +10:00
Campbell Barton
bb172dae61 Cleanup: use const variables & arguments 2024-05-06 09:20:03 +10:00
Julian Eisel
a700c90ec3 Asset Shelf: Add callback to get active asset
Add a function for asset shelves, `get_active_asset` in RNA, that
can be used to sync the active item of an asset shelf with an asset
reference elsewhere in Blender. In the brush asset system this is
used to retrieve the asset reference from the active `Paint` struct.

Pull Request: https://projects.blender.org/blender/blender/pulls/121405
2024-05-03 15:27:35 -04:00
Hans Goudey
798219225d Asset Shelf: Add optional operator to activate assets
The operator stored when registering the asset shelf will be called
with properties that reference the asset (a weak reference, split into
three properties already used in other asset-related operators). The
operator is called whenever a grid view item is activated, and is
meant to do things like import and activate a brush asset.

Previously Reviewed: https://projects.blender.org/blender/blender/pulls/117861

Pull Request: https://projects.blender.org/blender/blender/pulls/121402
2024-05-03 19:24:00 +02:00
Campbell Barton
9918488bb1 Cleanup: use uppercase tags, following own style guide 2024-05-03 11:33:21 +10:00
YimingWu
e8d028b7a5 Fix #121338: Depthdropper ensure viewport camera
Depthdropper should ensure that the viewport is in camera view to use
active camera position, otherwise it should still use rv3d->viewinv[3]
to ensure correct distance result.

Pull Request: https://projects.blender.org/blender/blender/pulls/121339
2024-05-02 13:24:22 +02:00
Campbell Barton
f6b7464b4c Cleanup: spelling in comments 2024-05-02 16:44:10 +10:00
Hans Goudey
9c1fe82e06 UI: Enable "apply" handler for preview tile buttons
For example, allow calling an operator when clicking on a
preview tile button. Useful for brush assets where clicking
on an asset shelf item activates the brush.
2024-05-01 13:17:44 -04:00
Hans Goudey
14e8d0d9aa UI: Use "label tooltip" as a fallback for quick favorites menu text
Useful when the button has no display text but has been set up
to have a quickly accessible tooltip in its place (for example
a brush asset item in the asset shelf).
2024-05-01 13:11:55 -04:00
Hans Goudey
722ad638c5 UI: Add optional icon argument to search visit params
Allows adding an icon to some search items, similar to what is done
manually for property search. Used for asset catalog search in the
brush assets branch, but more widely useful too.
2024-05-01 11:49:48 -04:00
Pratik Borhade
a42e2a5a29 GPv3: Mask toggle in dopesheet channel
Add `use_mask` property in dopesheet layer channel.
Also add an icon to the `use_mask` property.

Pull Request: https://projects.blender.org/blender/blender/pulls/121259
2024-05-01 15:10:22 +02:00
Campbell Barton
da4b81e980 Cleanup: move doc-strings into headers 2024-04-30 12:52:52 +10:00
Nathan Vegdahl
bd3518946e Anim: implement "Copy Driver to Selected" operator
This allows the user to copy the driver(s) of a property to other selected items (e.g. objects, nodes, etc.) via the right-click menu.  The implementation is based on the "Copy to Selected" operator, and generally behaves the same except for copying drivers instead of values.

Resolves #120518
2024-04-29 18:34:57 +02:00
Campbell Barton
c9dba4d31f Cleanup: use const variables & argument, remove duplicate include 2024-04-29 09:09:44 +10:00
Jacques Lucke
71ba360ddc Cleanup: use Map for operator types
This simplifies the code, makes it more type safe and also makes it
easier to use the construct-on-first-use-idiom.

Pull Request: https://projects.blender.org/blender/blender/pulls/121170
2024-04-27 21:44:55 +02:00
Bartosz Kosiorek
749433f20b UI: Add tooltips with node description to node titles
These were already displayed in the node add menu. But it can also be
useful to see node descriptions when opening existing projects.

Pull Request: https://projects.blender.org/blender/blender/pulls/119705
2024-04-26 16:29:46 +02:00
Falk David
fe0e2907b3 GPv3: Remove OB_MODE_PAINT_GREASE_PENCIL flag
This reverts part of 36cda3b3116acba3b895daf68689f8af01b62392
and replaces the use of `OB_MODE_PAINT_GREASE_PENCIL`
`OB_MODE_PAINT_GPENCIL_LEGACY` flag instead.
The `OB_MODE_PAINT_GREASE_PENCIL` is removed.

The `GREASE_PENCIL_OT_draw_mode_toggle` operator is removed
and the `GPENCIL_OT_paintmode_toggle`  operator is adapted to
work with GPv3.

Pull Request: https://projects.blender.org/blender/blender/pulls/121027
2024-04-25 14:23:46 +02:00
Campbell Barton
08b3db500f Cleanup: correct asserts
Also remove redundant assert.
2024-04-25 12:02:14 +10:00
Pratik Borhade
1e61cf7cf4 Fix #120958: Redundant Operations Tips in Status Bar when Transforming
Caused by 49bd285529.
keyitem with "release" events are shown in the status bar which is not
necessary. Move the if condition outside of for loop and exit early from
`uiTemplateStatusBarModalItem` to skip drawing of "release" type of
keyitems.

Pull Request: https://projects.blender.org/blender/blender/pulls/120974
2024-04-24 20:19:59 +02:00
Aras Pranckevicius
c64050ecd2 VSE: Timeline strip visual design updates
Design updates as per #118288:
- Tweak text labels (colors, drop shadows)
- Strip border colors, inset outlines
- Muted strips are mostly gray, and their thumbnails are faded
- Overlapping strips are not semitransparent anymore
- Locked stripes only in content area
- Missing data blocks
- Updates to meta strips w/ missing data blocks

Pull Request: https://projects.blender.org/blender/blender/pulls/118581
2024-04-24 12:37:38 +02:00
Campbell Barton
2a2579e69c Cleanup: use const pointers 2024-04-23 15:41:55 +10:00
Harley Acheson
49bd285529 UI: Collapse XYZ Operations in Status Bar
Reduce the number of duplicated modal operator keymap entries by just
showing "XYZ Axis" rather than "X X Axis", "Y Y Azis", etc. This allows
more items to be shown on the status bar. Note this only does so if the
keymap contains all of X, Y, & Z.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/120148
2024-04-22 20:03:11 +02:00
Aras Pranckevicius
689fce50bd Fix #120789: Slowness when using image vectorscope opacity slider
Since image vectorscope RGB mode addition (567455124d), changing
the opacity was causing the scope to get recalculated from scratch,
because opacity value was put into vecscope_rgb data directly.

Instead of that, make vecscope_rgb data only contain RGB, and fill in
the GPU vertex buffer alpha values when creating the GPU batch.

Now tweaking the scope opacity slider feels at about the same
performance as in 4.0.

Pull Request: https://projects.blender.org/blender/blender/pulls/120854
2024-04-20 17:08:56 +02:00
Campbell Barton
fd589fdca4 Cleanup: various non functional C++ changes 2024-04-20 13:46:14 +10:00
Harley Acheson
d8f6ae7919 UI: Outliner "File Mode" Manage User Count
In Outliner "Blender File Mode" view, show user counts, and allow
removing and adding fake user, requested in #118655.

Pull Request: https://projects.blender.org/blender/blender/pulls/118691
2024-04-20 02:50:12 +02:00
Hans Goudey
29ac593363 Cleanup: Use C++ Vector for color band samples 2024-04-17 12:51:36 -04:00
Hans Goudey
f39c30dc60 Cleanup: Move eyedropper_colorband.cc to proper C++ namespace 2024-04-17 12:51:36 -04:00
Hans Goudey
504992cb0e Fix #120302: Color Ramp eyedropper update crash
Caused by c5d855b497 `eyedropper_colorband_init` wasn't
updated for the change from `UI_but_funcN_set` to `UI_but_func_set`
in `colorband_buttons_layout`.

Now store the RNA pointer and property in the button itself to avoid
the error-prone use of `func_argN`.
2024-04-17 12:51:36 -04:00
Campbell Barton
01101dcaf9 Cleanup: use const references instead of copy-by-value 2024-04-17 11:36:44 +10:00
Campbell Barton
cf37424203 Cleanup: use const pointers, quiet cppcheck unreadVariable warning 2024-04-17 11:36:38 +10:00
Campbell Barton
0a8a3bc15a Fix misuse of RNA_struct_name_get_alloc
Callers to RNA_struct_name_get_alloc weren't accounting for allocation
which is unlikely as the fixed sized buffers used in these cases were
large.

- CTX_data_dir_get_ex & context_path_add_generic
  would use uninitialized stack memory.
- OverrideRNAPathTreeBuilder::build_path & ensure_entire_collection
  would leak memory.
2024-04-17 11:36:32 +10:00
Bartosz Kosiorek
b1fb8eccb4 UI: Add tooltips to inputs of Color shader nodes
Pull Request: https://projects.blender.org/blender/blender/pulls/119576
2024-04-16 19:07:08 +02:00
Bastien Montagne
4dc53709b2 Fix #120703: Overrides: Missing 'override' Color overlay for some UI widgets.
Outliner's 'Restrictions' set of icon buttons would not show the
'liboverridden' teal-blue background.
2024-04-16 18:38:39 +02:00
Brecht Van Lommel
07922a99e9 UI: Tweaks to collection export
* Remove embossing from preset / export / delete buttons.
   For example modifiers also don't have emboss for X, and presets
   never do. So it seems consistent.
* Remove duplicated preset buttons, only have the one in the header
  like other panels in properties editor.
* Use property separate layout without boxes for file path.
* Show info message when exporting a single or all collections,
  otherwise it's not obvious that something happened when clicking
  the button.

Pull Request: https://projects.blender.org/blender/blender/pulls/120667
2024-04-16 15:02:33 +02:00
Jacques Lucke
d1634b2a4a UI: support adding a search weight to menu entries for menu-search
The goal is to support better search experience in the cases where we want to
explicitly influence the ordering instead of relying only on general heuristics.
We used to support this already at some point I think, but not anymore since we
started using menu-search.

The implementation is fairly straight forward. It mainly just forwards the
search weight from the menu definition to the search code through various
required steps. The main annoying thing is that changing the signature of e.g.
`uiItemFullO_ptr` is fairly involved. Even using default parameters for these
functions is a bit annoying and becomes fairly unreadable and error-prone on the
call-site. For now, I worked around this by storing the search weight on the
`uiLayout` and to copy it to the `uiBut` from there. That seems preferable until
we have a better solution for adding parameters to all the `uiItem*` functions.

Pull Request: https://projects.blender.org/blender/blender/pulls/120572
2024-04-16 12:18:45 +02:00
Campbell Barton
20b0805213 Cleanup: use const pointers where possible 2024-04-16 12:27:47 +10:00
Harley Acheson
aae8b956dd Refactor: BLF Extract Function BLF_str_offset_to_cursor
Move into own BLF function, code that returns a text cursor (caret)
position given a string offset. This code is currently just in
interface_widgets.cc but should be a separate BLF function.

Pull Request: https://projects.blender.org/blender/blender/pulls/120622
2024-04-15 18:29:25 +02:00
Campbell Barton
904d51d6cb RNA: use boolean for function callbacks & "valid" iterator state
Integers were used when the value is logically a boolean.

Ref !120130
2024-04-15 23:04:38 +10:00
Damien Picard
c306677119 I18n: extract and disambiguate a few messages
Extract
- Statuses for the external text editor
- Newly created enum node item
- Newly created plane track data
- Newly created custom orientation data
- Operator names in drag and drop menu (need to use operator's
  translation context)
- GN attribute statistic node inputs

Disambiguate
- Single-letter colors: A and B can mean Alpha and Blue, or simply A
  and B as in two operands in an operation
- Dissolve: issue reported by Tamar Mebonia in #43295
- Translate in the User Preferences. This introduces a new
  BLT_I18NCONTEXT_EDITOR_PREFERENCES ("Preferences") translation
  context
- Planar (reported by deathblood)
  This one is incomplete, because there is currently no way to
  disambiguate presets or GN fields. I don't see how either could be
  achieved cleanly.
  The former would need to define the context inside the preset and
  evaluate the file prior to showing it in the presets menu, which
  sound bad.
  The latter would need to introduce an additional string inside
  `FieldInput`s, which would be controversial given how little it
  would be used.

Remove
- Unused translation `iface_("%s")` in toolbar
- Remove obsolete N_() tags in a few node descriptions.

Pull Request: https://projects.blender.org/blender/blender/pulls/119065
2024-04-15 12:02:17 +02:00
Sybren A. Stüvel
51e1f29a68 Anim: Add new keyframe type 'GENERATED'
Add a new keyframe type named 'generated', which is meant to indicate
that the key was set by some automated tool (like an add-on), rather
than manually by an animator.

This is meant for tooling that needs to create keys in a repeatable way.
With this new key type, the tool can know which keys it generated
before, and thus those can be removed and re-generated.

Pull Request: https://projects.blender.org/blender/blender/pulls/120564
2024-04-15 10:42:54 +02:00
Campbell Barton
78413ff4e2 Fix error resetting the theme which would add a new theme
Regression caused by [0], also correct memcpy calls that overwrite
listbase link variables and the theme name, note that this is more a
code-correctness issue as it wouldn't cause user visible bugs.

[0]: adbec9eea9
2024-04-12 16:54:57 +10:00
Jeroen Bakker
9c1cba528b OpenGL: Remove Apple specific workarounds
This PR removes apple specific OpenGL workarounds. OpenGL on Apple isn't supported
so they can be removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/120522
2024-04-11 17:25:21 +02:00
Campbell Barton
adbec9eea9 Theme: reset the default theme fails & fix invalid ListBase links
If the theme's name was changed, resetting the default theme did
nothing from a user perspective.

Internally it would add the Default theme to the end of the list where
it was ignored, then the default theme overwrote the data including the
next/prev links causing the ListBase to be invalid.

Resolve by ensuring the default theme is always first and use the
MEMCPY_STRUCT_AFTER macro to prevent links being overwritten.
2024-04-11 17:44:27 +10:00
Jesse Yurkovich
509a7870c3 Collection Exporters: Enable file exporters to be specified on Collections
This implements the ability to have file exporters added and configured on Collections.

Exporting is reachable from several locations:
- Individually on each exporter configuration: The `Export` button in each panel header
- For all exporters on the collection: The `Export All` button in the main panel interface
- For all exporters on all collections in the scene: The `File`->`Export All Collections` button

Visibility of which collections currently have exporters configured is done by ways of an icon added to the Collection row in the Outliner.

Adding multiple exporters for the same file type is permitted. The user is free to setup several exports of the same format but with different file locations or settings etc.

Notes:
Only USD and Wavefront OBJ are enabled for the initial commit. Additional formats, including those implemented in Python will be added as separate commits after this.

Ref #115690
Pull Request: https://projects.blender.org/blender/blender/pulls/116646
2024-04-08 22:10:39 +02:00
Campbell Barton
430d7961a2 Cleanup: remove redundant checks & struct declaration 2024-04-08 12:03:08 +10:00