-
-
Notifications
You must be signed in to change notification settings - Fork 21k
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
Tool scripts export categories and their properties to the inspector twice #63454
Comments
cc @YuriSizov |
This is related to the logic introduced by #32428. The approach from that PR is based around taking a list of properties that doesn't have script-class grouping and rebuilding that part from scratch, and then removing the original properties. The problem is, it breaks in the case of annotations because it is made to stop at the first category. So if you add a category in your property list, it thinks it's time to stop there. Accidentally, this doesn't happen if you use the old school way with So this works: @tool
extends Node
func _get_property_list() -> Array:
var properties := []
properties.push_back({
"name": "Extra Category",
"type": TYPE_NIL,
"usage": PROPERTY_USAGE_CATEGORY,
})
properties.push_back({
"name": "some_variable",
"type": TYPE_INT,
"USAGE": PROPERTY_USAGE_DEFAULT,
})
return properties And this breaks: @tool
extends Node
@export_category("Extra Category")
@export var some_variable : int While trying to figure out the logic behind #32428 and if it could be improved, I realized that in the current master I've tested #58443 and it fixes this issue as well. So let's wait for it to either be merged, or improved. |
This issue is still present for for non-tool scripts in alpha 13 and master (9869182) extends Node
@export var my_string: String
|
Closing again as we're consolidating the new issues in #63668. |
Godot version
4.0.alpha12.official [2c11e6d]
System information
Windows 10
Issue description
Tool scripts that export properties under a category using
@export_category
will have this category and properties shown twice in the inspector.Steps to reproduce
From a new project:
@export_category
annotation to add a category.From the reproduction project:
new_resource.tres
.Minimal reproduction project
Duplicate Property Repro.zip
The text was updated successfully, but these errors were encountered: