Skip to content

Commit

Permalink
Merge pull request #64428 from godotengine/gdextension-ignore-propert…
Browse files Browse the repository at this point in the history
…y-array

Ignore class's property array when generating extension_api.json (not…
  • Loading branch information
akien-mga authored Aug 23, 2022
2 parents 7e4817a + a696332 commit f97f5a6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/extension/extension_api_dump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ static String get_type_name(const PropertyInfo &p_info) {
if (p_info.type == Variant::INT && (p_info.usage & (PROPERTY_USAGE_CLASS_IS_BITFIELD))) {
return String("bitfield::") + String(p_info.class_name);
}
if (p_info.type == Variant::INT && (p_info.usage & PROPERTY_USAGE_ARRAY)) {
return "int";
}
if (p_info.class_name != StringName()) {
return p_info.class_name;
}
Expand Down Expand Up @@ -840,12 +843,16 @@ Dictionary NativeExtensionAPIDump::generate_extension_api() {
List<PropertyInfo> property_list;
ClassDB::get_property_list(class_name, &property_list, true);
for (const PropertyInfo &F : property_list) {
if (F.usage & PROPERTY_USAGE_CATEGORY || F.usage & PROPERTY_USAGE_GROUP || F.usage & PROPERTY_USAGE_SUBGROUP) {
if (F.usage & PROPERTY_USAGE_CATEGORY || F.usage & PROPERTY_USAGE_GROUP || F.usage & PROPERTY_USAGE_SUBGROUP || (F.type == Variant::NIL && F.usage & PROPERTY_USAGE_ARRAY)) {
continue; //not real properties
}
if (F.name.begins_with("_")) {
continue; //hidden property
}
if (F.name.find("/") >= 0) {
// Ignore properties with '/' (slash) in the name. These are only meant for use in the inspector.
continue;
}
StringName property_name = F.name;
Dictionary d2;
d2["type"] = get_type_name(F);
Expand Down

0 comments on commit f97f5a6

Please sign in to comment.