Commit graph

355 commits

Author SHA1 Message Date
bruvzg
de4c97758a
Fix more issues found by cppcheck. 2022-04-20 10:34:00 +03:00
SaracenOne
f8cc2e054d Ensure gizmos are added to newly created Node3D-derivatives and silence error for attempting to create gizmos twice 2022-04-13 04:39:01 +01:00
bruvzg
f851c4aa33
Fix some issues found by cppcheck. 2022-04-06 14:34:37 +03:00
bruvzg
d1207a0504
[Input] Add extra shortcut_input input processing step to process Unicode character input with Alt / Ctrl modifiers, after processing of shortcuts. 2022-04-05 13:46:45 +03:00
Rémi Verschelde
01a3b84545
Merge pull request #59558 from V-Sekai/primitive-indicies 2022-03-29 14:43:26 +02:00
Markus Sauermann
0494e024d8 Rename warp mouse functions to warp_mouse 2022-03-27 14:12:01 +02:00
K. S. Ernest (iFire) Lee
ee954914d9 Clarify what primitives means. 2022-03-26 10:25:13 -07:00
Yuri Roubinsky
0d9aecd967 Rename several transform built-ins in shaders 2022-03-18 12:10:55 +03:00
Priyansh Rathi
edbf757208
fix axis handle gizmo letters at wrong positions on varying editor scale 2022-03-17 02:20:57 +05:30
Rémi Verschelde
51bbcbdec2
Merge pull request #45263 from KoBeWi/😕 2022-03-15 13:18:27 +01:00
Hugo Locurcio
6f76aaec82
Improve display of freelook/zoom speed indicator bars in the 3D editor
- Use a different color for freelook and zoom speed bars.
- Use an outline for the text to make it readable on any background.
2022-03-13 18:57:28 +01:00
kobewi
39d429e497 Change some math macros to constexpr
Changes `MAX`, `MIN`, `ABS`, `CLAMP` and `SIGN`.
2022-03-09 16:24:32 +01:00
kobewi
2057ea2883 Remove duplicate editor settings definitions 2022-03-06 22:05:49 +01:00
Rémi Verschelde
52b6088c1d
Merge pull request #58800 from rcorre/blender-nav
Disable blender-style transforms in freelook.
2022-03-06 10:19:41 +01:00
kobewi
bc3aff9b46 Various code and documentation improvements 2022-03-05 22:00:35 +01:00
Ryan Roden-Corrent
34b87772b4
Disable blender-style tranforms in freelook.
It's common to bind instant_scale to s, which conflicts with WASD
bindings in freelook mode.

Fixes #58502.
2022-03-05 15:00:11 -05:00
Eric M
f6edd2d2a0 Fixed issues with shortcut checking in 3d node editor
The freelook shortcuts now use the action system by proxy. This allows the actions system to be leveraged for input checking. When the shortcut changes, the respective action is updated.
2022-02-18 23:19:22 +10:00
megalobyte
8824b6c5e9 Update if == NOTIFICATION_* to switch statements to match coding style 2022-02-16 08:44:37 -05:00
Rémi Verschelde
f810f76890
Merge pull request #57306 from trollodel/remove_editornode_param 2022-02-14 16:40:40 +01:00
trollodel
05b56f316d Remove most EditorNode constructor parameters and fields 2022-02-14 14:16:24 +01:00
JFonS
8317753c24
Merge pull request #57964 from mbrlabs/deselect
Deselect nodes in the 3D editor when pressing ESC
2022-02-14 10:42:46 +01:00
JFonS
58199e5ad0
Merge pull request #57990 from jmb462/fix-drag-lines-precision-issue
Fix 3D editor axis drag lines precision issue
2022-02-14 10:39:44 +01:00
Rémi Verschelde
498805282a
Merge pull request #57993 from Calinou/sky-tweak-default-values 2022-02-12 16:46:19 +01:00
Jean-Michel Bernard
b452534e60 Fix 3D Editor axis drag lines precision issue 2022-02-12 10:20:31 +01:00
Hendrik Brucker
b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
Hugo Locurcio
b7b18a4940
Tweak default ProceduralSkyMaterial and PhysicalSkyMaterial appearance
- Tweak colors to be less saturated and more balanced (in terms of hue).
  The cool blue sky is balanced by a warm brown ground,
  which makes reflections look closer to how they'd look like when using
  an HDRI panorama texture.
- Make the ground color dark on both ProceduralSkyMaterial and
  PhysicalSkyMaterial to reduce indoor light leaking, especially
  when using GI.
- Tweak the PhysicalSkyMaterial colors to be as close as possible
  to ProceduralSkyMaterial (with the default sun orientation).
- Tweak editor environment defaults to be identical to the default
  ProceduralSkyMaterial colors. Previously, the default editor sky
  color was different from the colors of a newly created
  ProceduralSkyMaterial resource.

Both new skies were tested without GI, with SDFGI and with VoxelGI.
They were tuned to look best when using ACES tonemapping with a
whitepoint set to 6, but they still look good with other
tonemapping operators.
2022-02-12 02:22:40 +01:00
Marcus Brummer
55fda17742 Deselect nodes in the 3D editor when pressing ESC 2022-02-11 11:41:51 +01:00
JFonS
3aa7b7eaf2
Merge pull request #57919 from mbrlabs/region-select-fixes
Fixed issues with 3D region-select in the editor
2022-02-11 10:59:18 +01:00
Marcus Brummer
3c4c73b100 Fixed issues with 3D region-select in the editor 2022-02-11 09:43:40 +01:00
Rémi Verschelde
519075cf41
Merge pull request #57912 from rcorre/fix-blender 2022-02-10 16:53:01 +01:00
kobewi
283ec9e640 Fix texture file dropping in 2D editor 2022-02-10 15:06:13 +01:00
Ryan Roden-Corrent
628219c922
Don't block input after cancelling transform.
After starting an instant transform and cancelling it, the mouse was
blocked because cancel_transform did not set _edit.instant back to
false.

This refactors all the cleanup into a separate function that both
cancel_transform and commit_transform can call.

Fixes #57868.
2022-02-10 08:23:10 -05:00
Marcus Brummer
c283a0ece7 Improved region-select in the 3D editor viewport 2022-02-09 12:22:03 +01:00
Rémi Verschelde
d6deada47c
Revert "Show the 3D transform gizmo in the center when otherwise offscreen"
This reverts commit 4234a72b25.

There are some errors which are problematic to have in 4.0 alpha 2.
The PR can be redone with fixes and merged again after the dev release.

Fixes #57839.
2022-02-09 09:39:28 +01:00
Aaron Franke
4234a72b25
Show the 3D transform gizmo in the center when otherwise offscreen 2022-02-08 14:38:31 -06:00
jfons
8345aabaf4 Improve rotation in the 3D transform gizmo
* Get rid of deadzones.
* Make it easier to select rotation handles at very oblique angles.
* Handle rotation for axes that are perpendicular to the camera.
2022-02-08 20:56:59 +01:00
jfons
e0c82913ff Fix navigation in 3D viewport
The incorrect initialization of EditData::instant to true was preventing the navigation code to run until the transform gizmo was used.
2022-02-08 19:24:50 +01:00
Rémi Verschelde
96e4de3511
Merge pull request #57626 from Calinou/3d-editor-rename-debug-draw-modes 2022-02-08 16:42:01 +01:00
Rémi Verschelde
cc097cd22b
Merge pull request #56543 from rcorre/blendermotion-4.0 2022-02-08 16:39:19 +01:00
Rémi Verschelde
a66e55069e
Merge pull request #57796 from akien-mga/revert-sname-theme-setters 2022-02-08 11:13:24 +01:00
Rémi Verschelde
fc076ece3d
Revert "Add missing SNAME macro optimization to all theme methods call"
This reverts commit a988fad9a0.

As discussed in #57725 and clarified in #57788, `SNAME` is not meant to be used
everywhere but only in critical code paths. For theme methods specifically, it
was by design that only getters use `SNAME` and not setters.
2022-02-08 10:17:25 +01:00
Rémi Verschelde
317cd0b19a
Refactor some object type checking code with cast_to
Less stringly typed logic, and less String allocations and comparisons.
2022-02-08 10:08:34 +01:00
jmb462
a988fad9a0 Add missing SNAME macro optimization to all theme methods call 2022-02-06 23:06:11 +01:00
Hugo Locurcio
21b9f1ecfe
Rename 3D editor debug draw modes to be more explicit
- Rename "Directional Shadow" to "Directional Shadow Map"
  to distinguish it from the "Directional Shadow Splits" option.
- Rename "Disable LOD" to "Disable Mesh LOD" as it only affects
  automatic mesh LOD, not visibility ranges.
- Rename "GI Buffer" to "VoxelGI/SDFGI Buffer" as it doesn't cover
  LightmapGI or SSIL.
- Rename the cluster options to match the respective node names.
2022-02-04 16:37:43 +01:00
Gilles Roudière
73e784de1e Remove get_focus_owner() from Control, replaced by get_viewport()->gui_get_focus_owner() 2022-02-03 11:59:32 +01:00
Rémi Verschelde
e6caaf4c80
Merge pull request #57205 from TechnoPorg/variant-template-cast
Allow method binds to take Object subclasses as arguments
2022-01-27 23:46:37 +01:00
TechnoPorg
051ef479c9 Allow method binds to take Object subclasses as arguments
This commit adds a condition to VariantCaster that casts Variants of type OBJECT to any type T, if T is derived from Object.
This change enables a fair bit of code cleanup. First, the Variant implicit cast operators for Node and Control can be removed, which allows for some invalid includes to be removed. Second, helper methods in Tree whose sole purpose was to cast arguments to TreeItem * are no longer necessary.
A few small changes also had to be made to other files, due to the changes cascading down all the includes.
2022-01-25 09:03:36 -07:00
Ryan Roden-Corrent
58e8e5f219
Implement blender-style 3D transform tools.
See godotengine/godot-proposals#1215.

This adds shortcuts for blender-inspired transforms, where you can press
the key and immediately be transforming an object without holding the
mouse. Clicking commits the transformation, ESC aborts it.

This is inspired by Blender's G(rab)/R(otate)/S(cale) shortcuts, but I
decided not to add default bindings as `S` is already bound to the
regular scale tool, and it might be confusing to only bind some of them.

While actively using a transform tool, you can press X/Y/Z to lock the
transform to an axis or (shift)+X/Y/Z to constrain the transform to a
plane. These keys are only processed if you have a transform tool
(translate/rotate/scale) active _and_ the mouse button is held.

Pressing XX/YY/ZZ will lock the transform to a local (rather than
global) axis.

This is achieved by temporarily toggling the local transform button. I
did this (vs handling it in the transform functions) for 3 reasons:

- Transform logic for translate/rotate (but not scale) appears to be
  tightly coupled to the gizmo
- This ensures the gizmo changes to indicate we're transforming
  locally/globally
- Toggling the button state in the UI also gives the user feedback about
  the nature of the transform.

The original state of the button is reset when the transform completes.

Pressing the `spatial_editor/cancel_transform` shortcut key during a
transform operation will cancel the transform and reset the objects back
to their original transforms.

This functionality was already accessible by pressing RMB during a
transform, however:

- ESC is more familiar to blender users, and a more common "cancel" key
  in general.
- Given you must hold LMB during a transform, pressing RMB as well is
  clumsy if not impossible (on a laptop trackpad).
2022-01-22 20:55:39 -05:00
trollodel
aa1102fc53 Store panels and docks singletons in their own classes 2022-01-20 20:13:26 +01:00
Fabio Alessandrelli
7e14548fc6 [Editor] Move some animation specific keying logic out of inspector.
Most of the custom logic to handle special keying cases is now inside
the AnimationPlayerEditorPlugin.

The EditorInspector now emits a signal when inspecting a new object.
2022-01-19 11:08:25 +01:00