1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-31 18:41:20 +00:00

Hide properties on XRCamera3D that are managed by XRInterface

This commit is contained in:
Bastiaan Olij
2025-12-16 08:28:49 +11:00
parent 4b6c88deda
commit 775bd3497e
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);