Commit graph

84 commits

Author SHA1 Message Date
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
MinusKube
d56185146d Add editor properties for Callable and Signal 2022-06-30 17:39:10 +02: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
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
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
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
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
Rémi Verschelde
f8ab79e68a Zero initialize all pointer class and struct members
This prevents the pitfall of UB when checking if they have been
assigned something valid by comparing to nullptr.
2022-04-04 19:49:50 +02:00
Aaron Franke
918b09cabc
Initialize bools in the headers in editor 2022-03-12 13:34:06 -06:00
jmb462
b619a47416 Renaming layers from the inspector via a popup menu. 2022-01-28 23:52:11 +01:00
bruvzg
40c56ed410
Improve locale detection.
Use separate language, script and country lists.
Add locale selection dialog and property hint.
2022-01-18 14:30:00 +02:00
Fabio Alessandrelli
98b147b319 [Editor] Fix inspector keying signals argument count.
The second parameter of the signals `EditorInspector.property_keyed` and
`EditorProperty.property_keyed_with_value` can be NIL, causing the event
to fire with less arguments when using `emit_signal` that accepts
Variant arguments, so we use the pointer version instead.
2022-01-07 15:48:37 +01:00
Rémi Verschelde
fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
kobewi
acf563e59f Add drag and drop for NodePaths 2021-12-09 18:50:57 +01:00
Yuri Sizov
2e4d18c929 Fix EditorInspectorPlugin virtual bindings and add parse_group callback 2021-11-10 17:56:59 +03:00
Rémi Verschelde
bbee193957
Merge pull request #52781 from KoBeWi/node's_favorite_shader 2021-11-03 16:33:50 +01:00
kobewi
07065d67e1 Infer shader type based on edited node 2021-11-03 15:27:38 +01:00
Yuri Sizov
67cbca341a Add a flag to EditorResourcePicker to differentiate selection contexts 2021-11-02 14:35:15 +03:00
Rémi Verschelde
a3d1bc757d
Merge pull request #32068 from aaronfranke/transform-editor
Reformat Transform(2D) matrix display in the inspector
2021-09-15 13:06:25 +02:00
Silc 'Tokage' Renew
facf8f1883 Apply set_read_only() to child classes of EditorProperty elements 2021-09-05 18:22:17 +09:00
Aaron Franke
288f0b6555
Reformat Transform(2D) inspector menus
Move, rename, recolor, and fix the inspector for these in the inspector. Coloring is now done by a helper method in "editor_inspector.cpp".
2021-08-31 11:24:40 -05:00
Juan Linietsky
07707a3627
Revert "Display a matrix for Node2D and don't display a duplicate origin" 2021-08-29 17:01:07 -03:00
Aaron Franke
ee7bb9bbb9
Display a matrix for Node2D and don't display a duplicate origin 2021-08-29 10:34:50 -05:00
Yuri Sizov
4ee0e6ddf5 Add type variations to Theme 2021-07-13 02:26:28 +03:00
Aaron Franke
2508fd0533
Use PROPERTY_USAGE_NONE instead of 0 for no property usage
Also use const more often.
2021-07-01 14:13:27 -04:00
reduz
75688772b3 Fix editor suffixes and degrees conversion
* Functions to convert to/from degrees are all gone. Conversion is done by the editor.
* Use PROPERTY_HINT_ANGLE instead of PROPERTY_HINT_RANGE to edit radian angles in degrees.
* Added possibility to add suffixes to range properties, use "min,max[,step][,suffix:<something>]" example "0,100,1,suffix:m"
* In general, can add suffixes for EditorSpinSlider
Not covered by this PR, will have to be addressed by future ones:

* Ability to switch radians/degrees in the inspector for angle properties (if actually wanted).
* Animations previously made will most likely break, need to add a way to make old ones compatible.
* Only added a "px" suffix to 2D position and a "m" one to 3D position, someone needs to go through the rest of the engine and add all remaining suffixes.
* Likely also need to track down usage of EditorSpinSlider outside properties to add suffixes to it too.
2021-06-30 12:38:25 -03:00
Gilles Roudière
30a615dd94 Implement painting properties over TileSets 2021-06-29 11:07:46 +02:00
Gregory Basile
8ab13f8ace Documentation search fixes
Updates rich_text_label so that the built-in documentation can be searched
Previously, it would only find the first result and would not select other results
Renames "_entered" functions to "_submitted"
2021-06-16 09:43:34 -07:00
Marcel Admiraal
8acd13a456 Rename Quat to Quaternion 2021-06-04 18:14:32 +01:00
Aaron Franke
6f472d154b
Rename EditorPropertyTransform to EditorPropertyTransform3D 2021-06-03 21:58:26 -04:00
Aaron Franke
de3f6699a5
Rename Transform to Transform3D in core 2021-06-03 07:30:01 -04:00
Yuri Sizov
e9206a55ea Use EditorResourcePicker in the Inspector 2021-05-19 21:39:15 +03:00
Gilles Roudière
ba1344408f Implement Navigation layers 2021-03-10 11:23:06 +01:00
reduz
b9b68b755c Improved Inspector Sub-Resource Editing
-Better margins
-Colors to delimit subresources better.
2021-02-12 09:31:47 -03:00
kobewi
a00ac12ae9 Emit changed signal from Color Picker when changed 2021-01-09 14:17:33 +01:00
kobewi
a22b2f86e7 Don't emit changed signal on Color Picker close 2021-01-03 18:12:00 +01:00
Rémi Verschelde
b5334d14f7
Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆
2021-01-01 20:19:21 +01:00
Rafał Mikrut
e1811b689b Initialize class/struct variables with default values in platform/ and editor/ 2020-12-02 16:09:11 +01:00
Aaron Franke
02161aad5a
Remove empty lines around braces with the formatting script 2020-11-16 23:38:11 -05:00
Marcel Admiraal
26fcf2b04c Add override keywords. 2020-07-10 13:56:54 +01:00
TwistedTwigleg
24905becb2 Made low level changes to the Skeleton3D class and Skeleton3D inspector. Changes listed below:
* Added helper functions to Skeleton3D for converting transforms from bone space to global space, and vice versa.
* Updated the Skeleton3D class reference.
* Changed the icon used for bones in the Skeleton3D inspector to use BoneAttachement3D's icon.
* Changed the Skeleton3D inspector to use EditorPropertyTransform and EditorPropertyVector3 when possible.
* Placed the Transform/Matrix for each bone in a sub-section, so it is visually similar to the Node3D inspector.
2020-06-15 17:18:06 -04:00
Juan Linietsky
0e1c66d9fc Implement global and per instance shader uniforms.
Adds two keywords to shader language for uniforms:
-'global'
-'instance'

This allows them to reference values outside the material.
2020-04-17 12:35:41 -03:00
Juan Linietsky
3c0059650d Added StringName as a variant type.
Also changed all relevant properties defined manually to StringName.
2020-02-21 14:25:29 +01:00
Juan Linietsky
3f335ce3d4 Texture refactor
-Texture renamed to Texture2D
-TextureLayered as base now inherits 2Darray, cubemap and cubemap array
-Removed all references to flags in textures (they will go in the shader)
-Texture3D gone for now (will come back later done properly)
-Create base rasterizer for RenderDevice, RasterizerRD
2020-02-11 11:53:26 +01:00
Aaron Franke
5e1dad3b28
Use int64_t for EditorPropertyInteger and warn when out of double range 2020-01-15 23:39:49 -05:00
Rémi Verschelde
a7f49ac9a1 Update copyright statements to 2020
Happy new year to the wonderful Godot community!

We're starting a new decade with a well-established, non-profit, free
and open source game engine, and tons of further improvements in the
pipeline from hundreds of contributors.

Godot will keep getting better, and we're looking forward to all the
games that the community will keep developing and releasing with it.
2020-01-01 11:16:22 +01:00
Anubhab Ghosh
4972ef801a Add clear menu entries for extending and replacing scripts 2019-10-23 01:57:17 +05:30
Hugo Locurcio
21222fb478
Make editor inspector easing lines use the accent color when dragged
This makes their visual feedback more consistent with other controls.

This also makes easing lines slightly more subtle by decreasing
their opacity by 10%.
2019-09-06 16:11:26 +02:00