Commit Graph

344 Commits

Author SHA1 Message Date
Rémi Verschelde f9f2446972
Merge pull request #64367 from Mickeon/rename-var-to-str
Rename `str2var` to `str_to_var` and similar
2022-08-26 23:04:06 +02:00
Micky 59e11934d8 Rename `str2var` to `str_to_var` and similar
Affects the Math class, a good chunk of the audio code, and a lot of other miscellaneous classes, too.

- `var2str` -> `var_to_str`
- `str2var` -> `str_to_var`
- `bytes2var` -> `bytes_to_var`
- `bytes2var_with_objects` -> `bytes_to_var_with_objects`
- `var2bytes` -> `var_to_bytes`
- `var2bytes_with_objects` -> `var_to_bytes_with_objects`
- `linear2db` -> `linear_to_db`
- `db2linear` -> `db_to_linear`
- `deg2rad` -> `deg_to_rad`
- `rad2deg` -> `rad_to_deg`

- `dict2inst` -> `dict_to_inst`
- `inst2dict` -> `inst_to_dict`
2022-08-26 14:58:22 +02:00
bruvzg d91cb1d5d5
[macOS export] Simplify code signing options, add support for rcodesign tool for signing and notarization. 2022-08-26 14:23:31 +03:00
Rémi Verschelde 2961651444
Merge pull request #64691 from TokageItLab/Quaternion-editor 2022-08-24 18:36:54 +02:00
Silc Renew 673c649adb Implement Quaternion Editor 2022-08-24 22:04:49 +09:00
SaracenOne dd814a0dca Disable editing properties in foreign resources
from imported scenes or objects returning
true from a function named '_is_read_only' and
disable resaving imported resources.
2022-08-23 23:16:13 +01:00
Rémi Verschelde 5d69dd1631
Merge pull request #63173 from fire-forge/layers-grid 2022-08-08 15:30:51 +02:00
Rémi Verschelde f3a76f63c6
Merge pull request #62089 from Step-an/add_drag_and_drop_to_EditorPropertyPath 2022-08-07 16:00:46 +02:00
Rémi Verschelde e1809f5667
Merge pull request #63704 from fire-forge/no-code
Fix EditorPropertyMultilineText expression mode
2022-08-06 00:32:22 +02:00
Hugo Locurcio 6059a9b624
Improve easing inspector usability
- Add `positive_only` property hint to disallow using negative presets.
  These values are clamped in several places in the editor already,
  so this avoids displaying presets that don't work.
- Move the Zero preset at the end of the positive list to match
  the custom property editor. It's also used less often than Linear,
  Ease In and Ease Out.
- Rename presets to be consistent between the easing property editor
  and custom property editor.
- Remove unused `inout` hint which was redundant since it was already
  the default.
2022-08-01 18:40:04 +02:00
Rémi Verschelde 6c5330154e
Merge pull request #63429 from RandomShaper/indicate_overridden 2022-07-31 23:54:38 +02:00
Hugo Locurcio 4b478c2854
Use a PackedStringArray for the "open in new inspector" editor setting
This is safer and provides a more convenient array editor for users.
2022-07-30 21:00:22 +02:00
Pedro J. Estébanez 4a127cb5fe Improve usability of non-default values in the property inspector
- Provide a visual indication that a (sub)group contains non-default (revertable) values when it's collapsed.
- Add a new option to the inspector's tools menu for expanding only (sub)groups containing properties with non-default values.
2022-07-30 15:25:45 +02:00
Rémi Verschelde 74d92bf459
Merge pull request #43081 from KoBeWi/property_keeper
Keep property values when extending script
2022-07-29 19:29:52 +02:00
Tomasz Chabora 44cf3c22ac Keep property values when extending script 2022-07-29 16:57:50 +02:00
Juan Linietsky d4433ae6d3 Remove Signal connect binds
Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind().
Changed all uses of it to Callable.bind()
2022-07-29 16:26:13 +02:00
FireForge 993b41198c Fix code font usage in EditorPropertyMultilineText
- Only use code font while in expression mode
- Use code font and syntax highlighter in big text box
2022-07-27 09:58:18 -05:00
Rémi Verschelde 3084a48ace
Merge pull request #63219 from reduz/implement-vector4-projection 2022-07-25 11:13:27 +02:00
reduz 455c06ecd4 Implement Vector4, Vector4i, Projection
Implement built-in classes Vector4, Vector4i and Projection.

* Two versions of Vector4 (float and integer).
* A Projection class, which is a 4x4 matrix specialized in projection types.

These types have been requested for a long time, but given they were very corner case they were not added before.
Because in Godot 4, reimplementing parts of the rendering engine is now possible, access to these types (heavily used by the rendering code) becomes a necessity.

**Q**: Why Projection and not Matrix4?
**A**: Godot does not use Matrix2, Matrix3, Matrix4x3, etc. naming convention because, within the engine, these types always have a *purpose*. As such, Godot names them: Transform2D, Transform3D or Basis. In this case, this 4x4 matrix is _always_ used as a _Projection_, hence the naming.
2022-07-23 14:00:01 +02:00
Rémi Verschelde a5bc65bbad
Merge pull request #63265 from reduz/stream-bpm-support
Implement BPM support in AudioStream files.
2022-07-23 11:21:14 +02:00
reduz d1ddee2258 Implement BPM support
Based on #62896, only implements the BPM support part.

* Implements BPM support in the AudioStreamOGG/MP3 importers.
* Can select BPM/Bar Size and total beats in a song file, as well as edit looping points.
* Looping is now BPM aware
* Added a special importer UI for configuring this.
* Added a special preview showing the audio waveform as well as the playback position in the resource picker.
* Renamed `AudioStream::instance` to `instantiate` for correctness.
2022-07-23 07:31:17 +02:00
Rémi Verschelde e5df1e65f9
Merge pull request #62581 from Guh-Feng/Color-Picker-Update 2022-07-22 23:46:27 +02:00
kleonc 07118d7094 Fix in editor drag and dropping a `Node` to generic `NodePath` property 2022-07-22 18:32:36 +02:00
Guh-Feng 1b8652e86a Color Pickers Respect Settings
Updated editor_node with function that sets up color pickers throughout Godot to respect editor's settings.
2022-07-21 18:11:09 -04:00
FireForge caa0cdaac6 Use menu icon for layers grid button 2022-07-17 00:42:23 -05:00
Rémi Verschelde b942c1ffe3
Merge pull request #62827 from fire-forge/ok-cancel
Add `ok_button_text` to AcceptDialog and `cancel_button_text` to ConfirmationDialog
2022-07-13 14:10:38 +02:00
FireForge e4067064ce Add ok_button_text to AcceptDialog and cancel_button_text to ConfirmationDialog 2022-07-09 10:47:08 -05:00
Rémi Verschelde 7d3ff927de
Merge pull request #62075 from Vitika9/gsoc-colorpicker 2022-07-08 09:06:47 +02:00
Vitika9 0011d93c81 ColorPicker Refactor 2022-07-06 22:11:43 +05:30
Nolkaloid 31745a8b15 Fix drag'n drop type check for NodePaths 2022-07-04 20:10:40 +02:00
MinusKube d56185146d Add editor properties for Callable and Signal 2022-06-30 17:39:10 +02:00
Rémi Verschelde 4c14bf7482
Merge pull request #62470 from vnen/gdscript-export-nodes
GDScript: Enable exporting nodes to the inspector
2022-06-28 08:07:00 +02:00
George Marques 9490146a16
GDScript: Enable exporting nodes to the inspector
Also fix an small issue in the property editor for NodePath trying to
use the meta property when not needed.
2022-06-27 18:42:52 -03:00
K. S. Ernest (iFire) Lee 9ddebc0c22 Add a const call mode to Object, Variant and Script.
For this to work safely (user not call queue_free or something in the expression), a const call mode was added to Object and Variant (and optionally Script).

This mode ensures only const functions can be called, making it safe to use from the editor.

Co-Authored-By: reduz <reduzio@gmail.com>
2022-06-27 13:33:06 -07:00
Rémi Verschelde fbc3777467
Merge pull request #62185 from reduz/export-node-pointer-path
Add ability to export Node pointers as NodePaths
2022-06-27 11:14:36 +02:00
reduz b7c41f9ba1 Add ability to export Node pointers as NodePaths
This PR implements:
* A new hint: PROPERTY_HINT_NODE_TYPE for variant type OBJECT, which can take specific node types as hint string.
* The editor will show it as a node path, but will set it as a pointer to a node from the current scene if you select a path.
* When scene is saved, the node path is saved, then restored as a pointer.

NOTE: This is a proof of concept and this approach will most likely not work. The reason if that, if the node referenced is deleted, then when trying to edit this the node will become invalid.

Potential workarounds: Since this uses the Variant API, it should obtain the pointer from the Variant object ID. Yet, this would either only really work in GDScript or it would need to be implemented with workarounds in every language.
Alternative ways to make this work: Nodes could export an additional property with a node path (like for which_node, it could be which_node_path).
Another alternative: Path editing could happen as a hidden metadata (ignoring the pointer).
2022-06-25 15:50:15 +02:00
Marcus Elg 6c1ac9f3be Rename export_range's noslider option to no_slider 2022-06-24 10:45:34 +02:00
reduz 5786516d4d Implement Running Godot as Movie Writer
* Allows running the game in "movie writer" mode.
* It ensures entirely stable framerate, so your run can be saved stable and with proper sound (which is impossible if your CPU/GPU can't sustain doing this in real-time).
* If disabling vsync, it can save movies faster than the game is run, but if you want to control the interaction it can get difficult.
* Implements a simple, default MJPEG writer.

This new features has two main use cases, which have high demand:
* Saving game videos in high quality and ensuring the frame rate is *completely* stable, always.
* Using Godot as a tool to make movies and animations (which is ideal if you want interaction, or creating them procedurally. No other software is as good for this).

**Note**: This feature **IS NOT** for capturing real-time footage. Use something like OBS, SimpleScreenRecorder or FRAPS to achieve that, as they do a much better job at intercepting the compositor than Godot can probably do using Vulkan or OpenGL natively. If your game runs near real-time when capturing, you can still use this feature but it will play no sound (sound will be saved directly).

Usage:

$ godot --write-movie movie.avi [scene_file.tscn]

Missing:

* Options for configuring video writing via GLOBAL_DEF
* UI Menu for launching with this mode from the editor.
* Add to list of command line options.
* Add a feature tag to override configurations when movie writing (fantastic for saving videos with highest quality settings).
2022-06-21 11:28:47 +02:00
cow-neaz 3ed980a4b7 Add drag and drop support to EditorPropertyPath 2022-06-16 20:08:14 +03:00
kobewi 5553e27fe8 Add vector value linking
Co-authored-by: redlamp <244062+redlamp@users.noreply.github.com>
2022-06-14 14:58:44 +02:00
FireForge 4678736a39 Add suffixes to all nodes and resources 2022-06-11 09:41:05 -05:00
Rémi Verschelde 4922fee09e
Merge pull request #59770 from fire-forge/rounded-corners 2022-06-10 10:53:09 +02:00
Raul Santos 329818f20b
Support explicit values in flag properties, add C# flags support
- Add support for explicit values in properties using `PROPERTY_HINT_FLAGS`
that works the same way it does for enums.
- Fix enums and flags in VisualScriptEditor (it wasn't considering the
explicit value).
- Use `PROPERTY_HINT_FLAGS` for C# enums with the FlagsAttribute instead
of `PROPERTY_HINT_ENUM`.
2022-06-03 05:19:01 +02:00
kobewi a1899111be Use Spatial shader as default for Mesh 2022-05-26 20:46:17 +02:00
FireForge 9bc6f44c80 Add rounded corners to EditorProperty and EditorSpinSlider
- Adds rounded corners to the EditorProperty child background, EditorSpinSlider label background, and resource sub-inspector borders and background.
- Allows customizing EditorSpinSlider label background through a new Theme StyleBox property, label_bg.
- Makes margins consistent in resource sub-inspectors.
- Removes space between buttons in NodePath, Resource, and multiline string editors.
- Adds space between label background and content for vertical property editors.
2022-05-25 15:31:30 -05:00
Aaron Franke 5dc3bfb80e
Use suffixes for units in nodes and resources 2022-05-19 14:34:27 -05:00
kobewi 9a1054d942 Tweak minsize of editor ColorPickerButtons 2022-05-19 15:20:46 +02:00
Hugo Locurcio 180e5d3028
Remove `RES` and `REF` typedefs in favor of spelled out `Ref<>`
These typedefs don't save much typing compared to the full `Ref<Resource>`
and `Ref<RefCounted>`, yet they sometimes introduce confusion among
new contributors.
2022-05-03 01:43:50 +02:00
kobewi fd490c95a5 Fix wrong condition checking for foreign resources 2022-04-30 00:12:22 +02:00
Aaron Franke 50495bcb08
Allow using other property hints without the range hint 2022-04-26 07:54:25 -05:00