Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Script property selector #47837

Open
Gallilus opened this issue Apr 12, 2021 · 4 comments
Open

Visual Script property selector #47837

Gallilus opened this issue Apr 12, 2021 · 4 comments

Comments

@Gallilus
Copy link
Contributor

Gallilus commented Apr 12, 2021

3.3.rc8
WIN 10
GLES3

The visual script editor provides a limited amount of property's to select from.
That the VSeditor gives the same options as GDscript

I will give a example using the Timer Node timer.time_left
Timer Node VScript autocompete example
Timer Node GDScript autocompete example
Timer Node propeties sourcecode

I assume this is due to this code difference in propery_selector.cpp vs visual_script_property_selector.cpp
(my understanding of c++ and the Godot project is minimal)

Control drag property
Add visual script try to get any autocomplete hints in the editor

Projects debug.zip

Being able to edit the inspector-property in line edit would be a awesome work around

Similar to #28136

workaround created using https://godotengine.org/asset-library/asset/922

@Calinou
Copy link
Member

Calinou commented Apr 12, 2021

This is because the time_left property is a read-only property. We should probably remove this property for 4.0 in favor of the get_time_left() method, but doing so will break backwards compatibility.

In GDScript, we haven't settled on whether we should expose read-only properties or not. In the meantime, we should only expose getter methods for read-only information.

@Calinou Calinou added this to the 4.0 milestone Apr 12, 2021
@Gallilus
Copy link
Contributor Author

get_time_left() is also not exposed to VisualScript So I think it is filtered on Property hints.

@briansemrau
Copy link
Contributor

This issue exists because of this check:

if (!(E->get().usage & PROPERTY_USAGE_EDITOR) && !(E->get().usage & PROPERTY_USAGE_SCRIPT_VARIABLE)) {
continue;
}

Many properties such as Node2D.global_transform have their usage flag set to 0, so they get excluded from the property selector.

I think the property selector should have a "Show all/hidden properties" checkbox to replace the usage flag filter to exclude any PROPERTY_USAGE_GROUP, PROPERTY_USAGE_CATEGORY, or PROPERTY_USAGE_INTERNAL.

This filter could be enabled by default (removing the need for a checkbox) but this risks a regression if any previously-viewable properties accidentally get filtered out.

@Gallilus
Copy link
Contributor Author

Just tested after merging of #56252.
Using select from visual script works.
Using select property is still as described above.

@KoBeWi KoBeWi modified the milestones: 4.0, 3.x Sep 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

4 participants