summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2019-11-26 16:39:50 +0100
committerHugo Locurcio <hugo.locurcio@hugo.pro>2019-11-26 18:57:29 +0100
commit639c9b3a351e0ed8070a4c00e07b3ed5514d1a30 (patch)
treef621f770359cbf8958710afa359d76bc4fe77427
parent8ea909f5b69ba30070083c45d17ebf1d125bad7f (diff)
Only display Environment sky rotation in degrees in the Inspector
This makes it consistent with Spatial.
-rw-r--r--doc/classes/Environment.xml6
-rw-r--r--scene/resources/environment.cpp4
2 files changed, 6 insertions, 4 deletions
diff --git a/doc/classes/Environment.xml b/doc/classes/Environment.xml
index 2b44eb81b1..0d64f0ff64 100644
--- a/doc/classes/Environment.xml
+++ b/doc/classes/Environment.xml
@@ -96,13 +96,13 @@
[Sky] resource's custom field of view.
</member>
<member name="background_sky_orientation" type="Basis" setter="set_sky_orientation" getter="get_sky_orientation" default="Basis( 1, 0, 0, 0, 1, 0, 0, 0, 1 )">
- [Sky] resource's rotation expressed as a [Basis]
+ [Sky] resource's rotation expressed as a [Basis].
</member>
<member name="background_sky_rotation" type="Vector3" setter="set_sky_rotation" getter="get_sky_rotation" default="Vector3( 0, 0, 0 )">
- [Sky] resource's rotation expressed as euler angles in radians
+ [Sky] resource's rotation expressed as Euler angles in radians.
</member>
<member name="background_sky_rotation_degrees" type="Vector3" setter="set_sky_rotation_degrees" getter="get_sky_rotation_degrees" default="Vector3( 0, 0, 0 )">
- [Sky] resource's rotation expressed as euler angles in degrees
+ [Sky] resource's rotation expressed as Euler angles in degrees.
</member>
<member name="dof_blur_far_amount" type="float" setter="set_dof_blur_far_amount" getter="get_dof_blur_far_amount" default="0.1">
Amount of far blur.
diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp
index bc96b5e9f3..ddf97f48d1 100644
--- a/scene/resources/environment.cpp
+++ b/scene/resources/environment.cpp
@@ -978,7 +978,9 @@ void Environment::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "background_sky", PROPERTY_HINT_RESOURCE_TYPE, "Sky"), "set_sky", "get_sky");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "background_sky_custom_fov", PROPERTY_HINT_RANGE, "0,180,0.1"), "set_sky_custom_fov", "get_sky_custom_fov");
ADD_PROPERTY(PropertyInfo(Variant::BASIS, "background_sky_orientation"), "set_sky_orientation", "get_sky_orientation");
- ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "background_sky_rotation", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "set_sky_rotation", "get_sky_rotation");
+ // Only display rotation in degrees in the inspector (like in Spatial).
+ // This avoids displaying the same information twice.
+ ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "background_sky_rotation", PROPERTY_HINT_NONE, "", 0), "set_sky_rotation", "get_sky_rotation");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "background_sky_rotation_degrees", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "set_sky_rotation_degrees", "get_sky_rotation_degrees");
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "background_color"), "set_bg_color", "get_bg_color");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "background_energy", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_bg_energy", "get_bg_energy");