Commit Graph

65 Commits

Author SHA1 Message Date
Pratik Borhade
8e6b276f84 Fix #121660: Auto-keyframe icon Overlapping when Navigation Controls are off
This is due to the wrong offset when "navigation controls" is off. Axis
gizmo is still visible so "else" codeblock is expected to handle the
correct offset value.

Pull Request: https://projects.blender.org/blender/blender/pulls/121775
2024-05-15 14:22:32 +02:00
Harley Acheson
d42e507c14 UI: Fix AutoKeying Text
Recent changes overlay drawing code resulted in a call to draw the
"Autokeying" text being removed, showing only the icon.  This PR just
replaces one removed line.

Pull Request: https://projects.blender.org/blender/blender/pulls/121811
2024-05-15 01:41:10 +02:00
Harley Acheson
92e0545e9f UI: Remove BLF_draw_default_shadowed
With Aras's recent changes in #121383, our text shader now supports
outline shadows, which gives a result that has more contrast than can
be achieved with BLF_draw_default_shadowed. This removes that function.

Pull Request: https://projects.blender.org/blender/blender/pulls/121676
2024-05-13 22:32:59 +02:00
Harley Acheson
03cd8b359b UI: Edge Slide Status Display
While using Edge Slide show only changing values in the area header and
only keymap entries on the Status Bar

Pull Request: https://projects.blender.org/blender/blender/pulls/121585
2024-05-09 00:06:31 +02:00
Germano Cavalcante
93e47ad9a8 Fix #120744: Shrink/Fatten Even with Alt not working
Continuation of 3d6bb6ce04

This 'alt' hotkey is captured in the modal map
`TFM_MODAL_PASSTHROUGH_NAVIGATE` in order to appear in the header.
But this modal map is not necessary.
2024-04-17 12:25:00 -03:00
Germano Cavalcante
115a925ffe Fix: Incremental snap not matching grid resolution
Caused by f0479e915f

`t->snap_spatial` is still required for Incremental snap.
2024-04-07 10:26:21 -03:00
Germano Cavalcante
f0479e915f Transform: Implement Snap to Grid mode
Addresses two improvements to `Snap to Grid` as suggested in #73993:
- Make 'Absolute Grid Snapping' a new Snap Mode
- Snap to Grid in Non-Side View performed at ground level

Implementation details:

- Snap to Grid has no cursor symbol, unless we are in `Set Snap Base`
  mode. Similar to the previous 'Absolute Grid Snap' behavior.
- In Non-Side view, Snap to Grid is performed at ground level.
- If `Snap Base` is `Closest`, Snap to Grid uses the transform pivot
  point instead. Similar to the previous 'Absolute Grid Snap' behavior.
- The "Absolute Grid Snap" option has been removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/116109
2024-03-27 13:17:24 +01:00
Hans Goudey
8b514bccd1 Cleanup: Move remaining GPU headers to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/119807
2024-03-23 01:24:18 +01:00
Campbell Barton
57dd9c21d3 Cleanup: spelling in comments 2024-03-21 10:02:53 +11:00
Campbell Barton
09666e1498 Fix #119387: Precision transform fails to activate
Regression in [0] caused precision fail to activate in the graph editor
and when pressing shift then control (#119395).

[0]: 060174cf14
2024-03-14 11:20:19 +11:00
Germano Cavalcante
a56a975760 UV: Enable 'Set Snap Base' feature
Just like for objects in 3D View, UVs can also benefit from the
`Set Snap Base` feature (key `B`).
2024-03-12 14:35:52 -03:00
Melissa
aaadb5005e UV: Support Edge and Vert Slide
This commit adapts the existing Edge Slide and Vert Slide to work with
UVs as well.

It addresses [0] for the addition of an edge slide tool to the UV
Editor.

This feature allows users to slide UVs towards adjacent edges,
providing more convenient ways to edit UV maps.

[0]: https://blender.community/c/rightclickselect/66dbbc

Pull Request: https://projects.blender.org/blender/blender/pulls/119041
2024-03-12 10:15:55 -03:00
Campbell Barton
91229f0e16 Cleanup: use full sentences for comments in transform & windowmanager 2024-03-09 23:28:03 +11:00
Kyler Kelly
060174cf14 Transform: customizable rotation snap increment values
Add two snapping increment options: a regular value
(activated with Ctrl) and a precise value (activated with Ctrl+Shift).
These values are separate for 2D and 3D views.

Ref !118760
2024-03-09 16:57:12 +11:00
Germano Cavalcante
2d50a41d77 Edge Slide: use snap system to check sliding vertex visibility
This is a different solution to #32068

The sliding edge occlusion test is done to prevent a non-visible
reference vertex from being used to calculate the factor direction.

This commit changes the behavior, but the difference is difficult to
notice.

The changes in behavior are:
- Other objects affect occlusion.
- Slide direction is used to test occlusion instead of edge.
- The reference point is now the point whose direction is visible and
  is closest to the mouse cursor.
2024-03-06 13:50:27 -03:00
Germano Cavalcante
5d3d233784 Merge branch 'blender-v4.1-release' 2024-02-29 20:51:43 -03:00
Germano Cavalcante
3d6bb6ce04 Fix #118906: conflict with alt hotkey in Vert and Edge Slide operators
This 'alt' hotkey is captured in the modal map
`TFM_MODAL_PASSTHROUGH_NAVIGATE` in order to appear in the header.
But this modal map is not necessary.
2024-02-29 20:50:09 -03:00
Brecht Van Lommel
0f2064bc3b Revert changes from main commits that were merged into blender-v4.1-release
The last good commit was 4bf6a2e564.
2024-02-19 15:59:59 +01:00
Miguel Pozo
5eac9e6095 Merge branch 'blender-v4.1-release' 2024-02-15 17:59:44 +01: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
Campbell Barton
b372ebae68 Cleanup: unused headers for source/blender/editors
Remove 1317 includes from editors.
2024-02-13 10:02:53 +11:00
Bastien Montagne
5aaadebbe4 Cleanup: Make BKE_scene.h a full Cpp header. 2024-02-10 19:16:25 +01:00
Bastien Montagne
45e7827898 Clenup: Move BLT headers to Cpp.
Noisy but fairly straight forward.
2024-02-09 18:59:42 +01:00
Damien Picard
019eb5a35e I18n: use IFACE_ to translate status bar info & viewport statistics
Although the information displayed in the status bar is strictly
speaking reports, it makes sense to translate them using the Interface
setting instead of Reports, as the tool names and stats terms are
also translated in other UI places (toolbar, menus).

This change includes status bars statistics and keymaps, and viewport
statistics.

The change is quite extensive as it is all or nothing. Translating
keymaps using Interface means some status messages will include them
indirectly, and thus cannot use Reports without having a weird mix of
original and translated words. In turn, having only some messages
translated would be even more confusing.
The result is that all messages related to input are now translated with
Interface, which I think also makes sense.

Discussed as a followup to !116804.

-----

cc. @gtitaev

Pull Request: https://projects.blender.org/blender/blender/pulls/117234
2024-02-07 11:17:50 +01:00
Hans Goudey
7fa5fc02b7 Cleanup: Move BLF headers to C++ 2024-01-31 14:04:56 -05:00
Hans Goudey
02582213de Cleanup: Move BKE_layer.hh to C++ 2024-01-24 10:55:16 -05:00
Harley Acheson
a4a8683788 UI: Increased Overlay Text Contrast
Increased contrast of light text on any background by increasing the
effectiveness of the dark shadow.

Pull Request: https://projects.blender.org/blender/blender/pulls/117351
2024-01-22 21:57:55 +01:00
Campbell Barton
5b59be81ba Cleanup: spelling in comments 2024-01-22 12:44:56 +11:00
Hans Goudey
21407901f8 Cleanup: Various clang tidy changes 2024-01-19 12:08:48 -05:00
Christoph Lendenfeld
5e28601d69 Anim: Separate keying flags
Splits the flag `..._FLAG_INSERTNEEDED` between autokey and
manual keying. The fact that this flag was shared between the two
systems has been the cause of issues in the past. It wouldn't
let you insert a keyframe even though you explicitly used an operator
to do so.

In order to be clearer what options are used where, the user preferences
have been reordered.

By default "Only Insert Needed" will be enabled for auto-keying, but not for manual keying.
The versioning code will enable both if it was enabled previously.

# Code side changes

The keying system has flags that define the behavior
when keys are inserted. Some of those flags were shared
between keying and auto-keying. Some were only used for
auto-keying.
To clarify that, prefix flags that used exclusively in one or the other
system with `AUTOKEY`/`MANUALKEY`

Also the flag name on the user preferences and the tool settings was renamed.
Previously it was called `autokey_flag`. To indicated that it is not only used
for autokeying, rename it `keying_flag`.

Fixes: #73773

Pull Request: https://projects.blender.org/blender/blender/pulls/115525
2024-01-19 16:26:10 +01:00
Damien Picard
3bd41cf9bc I18n: Go over TIP_ and IFACE_ usages, change to RPT_ when relevant
The previous commit introduced a new `RPT_()` macro to translate
strings which are not tooltips or regular interface elements, but
longer reports or statuses.

This commit uses the new macro to translate many strings all over the
UI.

Most of it is a simple replace from `TIP_()` or `IFACE_()` to
`RPT_()`, but there are some additional changes:
- A few translations inside `BKE_report()` are removed altogether
  because they are already handled by the translation system.
- Messages inside `UI_but_disable()` are no longer translated
  manually, but they are handled by a new regex in the translation
  system.

Pull Request: https://projects.blender.org/blender/blender/pulls/116804

Pull Request: https://projects.blender.org/blender/blender/pulls/116804
2024-01-12 13:37:32 +01:00
Brecht Van Lommel
d377ef2543 Clang Format: bump to version 17
Along with the 4.1 libraries upgrade, we are bumping the clang-format
version from 8-12 to 17. This affects quite a few files.

If not already the case, you may consider pointing your IDE to the
clang-format binary bundled with the Blender precompiled libraries.
2024-01-03 13:38:14 +01:00
Germano Cavalcante
07b5e1bd80 Fix #115153: Snap Base in Camera View crashes Blender
Snap to geometry is not supported when moving camera in camera view.

This is because the camera would make jumps that would be difficult to
predict and control.

The same happens if Snap Base were supported.

Therefore, disable Edit Snap Base when transforming camera into camera
view.
2023-11-20 11:09:55 -03:00
Hans Goudey
3d57bc4397 Cleanup: Move several blenkernel headers to C++
Mostly focus on areas where we're already using C++ features,
where combining C and C++ APIs is getting in the way.

Pull Request: https://projects.blender.org/blender/blender/pulls/114972
2023-11-16 11:41:55 +01:00
Germano Cavalcante
78943edc5d Transform: Custom modifier to navigate while transforming
Discussed in #114646.

This commit transforms the "alt_navigation" option of the transform
operators into a new modal key item. "PASSTHROUGH_NAVIGATE"

In addition to cleaning up a lot of the code, it allows you to
customize the key chosen to navigate while transforming.
2023-11-09 21:33:34 -03:00
Campbell Barton
611930e5a8 Cleanup: use std::min/max instead of MIN2/MAX2 macros 2023-11-07 16:33:19 +11:00
Richard Antalik
4d37fb80b1 Cleanup: Convert VSE headers from .h to .hh 2023-11-03 01:33:54 +01:00
casey bianco-davis
e266b142f6 GPv3: Transform operators
This adds the keybindings, menu, and functionally for the edit mode transform operators to grease pencil v3.

The transform operation include:
 * translate, rotate, scale, change opacity, change radius

Pull Request: https://projects.blender.org/blender/blender/pulls/111836
2023-10-21 15:12:47 +02:00
Hans Goudey
89e3ba4e25 Mesh: Replace auto smooth with node group
Design task: #93551

This PR replaces the auto smooth option with a geometry nodes modifier
that sets the sharp edge attribute. This solves a fair number of long-
standing problems related to auto smooth, simplifies the process of
normal computation, and allows Blender to automatically choose between
face, vertex, and face corner normals based on the sharp edge and face
attributes.

Versioning adds a geometry node group to objects with meshes that had
auto-smooth enabled. The modifier can be applied, which also improves
performance.

Auto smooth is now unnecessary to get a combination of sharp and smooth
edges. In general workflows are changed a bit. Separate procedural and
destructive workflows are available. Custom normals can be used
immediately without turning on the removed auto smooth option.

**Procedural**

The node group asset "Smooth by Angle" is the main way to set sharp
normals based on the edge angle. It can be accessed directly in the add
modifier menu. Of course the modifier can be reordered, muted, or
applied like any other, or changed internally like any geometry nodes
modifier.

**Destructive**
Often the sharp edges don't need to be dynamic. This can give better
performance since edge angles don't need to be recalculated. In edit
mode the two operators "Select Sharp Edges" and "Mark Sharp" can be
used. In other modes, the "Shade Smooth by Angle" controls the edge
sharpness directly.

### Breaking API Changes
- `use_auto_smooth` is removed. Face corner normals are now used
  automatically   if there are mixed smooth vs. not smooth tags. Meshes
  now always use custom normals if they exist.
- In Cycles, the lack of the separate auto smooth state makes normals look
  triangulated when all faces are shaded smooth.
- `auto_smooth_angle` is removed. Replaced by a modifier (or operator)
  controlling the sharp edge attribute. This means the mesh itself
  (without an object) doesn't know anything about automatically smoothing
  by angle anymore.
- `create_normals_split`, `calc_normals_split`, and `free_normals_split`
  are removed, and are replaced by the simpler `Mesh.corner_normals`
  collection property. Since it gives access to the normals cache, it
  is automatically updated when relevant data changes.

Addons are updated here: https://projects.blender.org/blender/blender-addons/pulls/104609

### Tests
- `geo_node_curves_test_deform_curves_on_surface` has slightly different
   results because face corner normals are used instead of interpolated
   vertex normals.
- `bf_wavefront_obj_tests` has different export results for one file
  which mixed sharp and smooth faces without turning on auto smooth.
- `cycles_mesh_cpu` has one object which is completely flat shaded.
  Previously every edge was split before rendering, now it looks triangulated.

Pull Request: https://projects.blender.org/blender/blender/pulls/108014
2023-10-20 16:54:08 +02:00
Campbell Barton
e7e4e63313 Cleanup: spelling in comments, white-space in comments 2023-10-19 18:53:16 +11:00
Christoph Lendenfeld
1f995917a9 Refactor: Replace autokey macros with functions
No functional changes

The following macros have been replaced with identically named functions
* IS_AUTOKEY_ON
* IS_AUTOKEY_MODE
* IS_AUTOKEY_FLAG

Pull Request: https://projects.blender.org/blender/blender/pulls/113610
2023-10-12 16:20:18 +02:00
Christoph Lendenfeld
a3831fe7af Refactor: Move autokeyframing functions to animrig
No functional changes

The following functions have been moved
`autokeyframe_cfra_can_key`
`autokeyframe_object`
`ED_autokeyframe_object`
`ED_autokeyframe_pchan`
`ED_autokeyframe_property`

they are all in a new file
keyframing_auto.cc
while the declarations are in
ANIM_keyframing.cc

The autokeyframe makros also have been moved

Pull Request: https://projects.blender.org/blender/blender/pulls/113607
2023-10-12 15:44:58 +02:00
Germano Cavalcante
4abd59e204 Fix #113320: 'Automatic Constraint' not working in 2D editors
Caused by 586ffcd669

The condition `(t->flag & T_2D_EDIT)` went unnoticed.
2023-10-07 12:08:06 -03:00
Germano Cavalcante
586ffcd669 Fix 'Automatic Constraint' appearing in statusbar although not supported 2023-10-03 11:10:22 -03:00
Campbell Barton
9e41eccc6e Cleanup: spelling in comments 2023-09-08 17:12:29 +10:00
Jacques Lucke
b5c89822ac RNA: return PointerRNA from rna create functions
There are a couple of functions that create rna pointers. For example
`RNA_main_pointer_create` and `RNA_pointer_create`. Currently, those
take an output parameter `r_ptr` as last argument. This patch changes
it so that the functions actually return a` PointerRNA` instead of using
the output parameters.

This has a few benefits:
* Output parameters should only be used when there is an actual benefit.
  Otherwise, one should default to returning the value.
* It's simpler to use the API in the large majority of cases (note that this
  patch reduces the number of lines of code).
* It allows the `PointerRNA` to be const on the call-site, if that is desired.

No performance regression has been measured in production files.
If one of these functions happened to be called in a hot loop where
there is a regression, the solution should be to use an inline function
there which allows the compiler to optimize it even better.

Pull Request: https://projects.blender.org/blender/blender/pulls/111976
2023-09-06 00:48:50 +02:00
Campbell Barton
941dbbc175 Cleanup: various minor C++ changes 2023-08-29 16:43:20 +10:00
Campbell Barton
4d757510be Cleanup: remove unnecessary context arg to transform drawing functions 2023-08-25 10:46:24 +10:00
Campbell Barton
89c2e3c9dc Cleanup: remove unnecessary context argument to drawSnapping 2023-08-25 10:25:58 +10:00
Nate Rupsis
2cb5f83940 Fix #97049: Auto-keyframe Status Message Overlaps Navigation Gizmo
"Auto Keying On" display now respects users MINI_AXIS preferences (default, minimal, none), as well as the navigation (en)disable option. No more text overlapping.

Co-authored-by: Abhinav Chennubhotla
Pull Request: https://projects.blender.org/blender/blender/pulls/111356
2023-08-24 15:25:45 +02:00