Merge pull request #114057 from BastiaanOlij/xrcamera_hide_managed_properties

Hide properties on XRCamera3D that are managed by XRInterface
This commit is contained in:
Rémi Verschelde 2025-12-16 11:27:07 +01:00
commit 7fcf2d4b6a
No known key found for this signature in database
GPG Key ID: C3336907360768E1
2 changed files with 12 additions and 0 deletions

View File

@ -36,6 +36,16 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
void XRCamera3D::_validate_property(PropertyInfo &p_property) const {
if (!Engine::get_singleton()->is_editor_hint()) {
return;
}
// Hide properties that are managed by XRInterface or otherwise not applicable for XRCamera3D.
if (p_property.name == "fov" || p_property.name == "projection" || p_property.name == "size" || p_property.name == "frustum_offset" || p_property.name == "keep_aspect") {
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
}
}
void XRCamera3D::_bind_tracker() {
XRServer *xr_server = XRServer::get_singleton();
ERR_FAIL_NULL(xr_server);

View File

@ -47,6 +47,8 @@ protected:
StringName pose_name = SceneStringName(default_);
Ref<XRPositionalTracker> tracker;
void _validate_property(PropertyInfo &p_property) const;
void _bind_tracker();
void _unbind_tracker();
void _changed_tracker(const StringName &p_tracker_name, int p_tracker_type);