Skip to content

Commit a9416da

Browse files
committed
GLTF export: Propagate property_list_changed from extensions
1 parent 7e08477 commit a9416da

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

modules/gltf/editor/editor_scene_exporter_gltf_settings.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ void EditorSceneExporterGLTFSettings::_get_property_list(List<PropertyInfo> *p_l
8484
}
8585
}
8686

87+
void EditorSceneExporterGLTFSettings::_on_extension_property_list_changed() {
88+
generate_property_list(_document);
89+
emit_signal("property_list_changed");
90+
}
91+
8792
bool EditorSceneExporterGLTFSettings::_set_extension_setting(const String &p_name_str, const Variant &p_value) {
8893
PackedStringArray split = String(p_name_str).split("/", true, 1);
8994
if (!_config_name_to_extension_map.has(split[0])) {
@@ -130,6 +135,10 @@ void EditorSceneExporterGLTFSettings::generate_property_list(Ref<GLTFDocument> p
130135
String image_format_hint_string = "None,PNG,JPEG";
131136
// Add properties from all document extensions.
132137
for (Ref<GLTFDocumentExtension> &extension : GLTFDocument::get_all_gltf_document_extensions()) {
138+
const Callable on_prop_changed = callable_mp(this, &EditorSceneExporterGLTFSettings::_on_extension_property_list_changed);
139+
if (!extension->is_connected("property_list_changed", on_prop_changed)) {
140+
extension->connect("property_list_changed", on_prop_changed);
141+
}
133142
const String config_prefix = get_friendly_config_prefix(extension);
134143
_config_name_to_extension_map[config_prefix] = extension;
135144
// If the extension allows saving in different image formats, add to the enum.

modules/gltf/editor/editor_scene_exporter_gltf_settings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class EditorSceneExporterGLTFSettings : public RefCounted {
4848
bool _set(const StringName &p_name, const Variant &p_value);
4949
bool _get(const StringName &p_name, Variant &r_ret) const;
5050
void _get_property_list(List<PropertyInfo> *p_list) const;
51+
void _on_extension_property_list_changed();
5152

5253
bool _set_extension_setting(const String &p_name_str, const Variant &p_value);
5354
bool _get_extension_setting(const String &p_name_str, Variant &r_ret) const;

0 commit comments

Comments
 (0)