summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/classes/ARVRController.xml7
-rw-r--r--doc/classes/ARVRInterface.xml20
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp16
-rw-r--r--editor/spatial_editor_gizmos.cpp18
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs10
-rw-r--r--scene/resources/packed_scene.cpp3
6 files changed, 51 insertions, 23 deletions
diff --git a/doc/classes/ARVRController.xml b/doc/classes/ARVRController.xml
index 9c6cfc1d7d..24d8b48077 100644
--- a/doc/classes/ARVRController.xml
+++ b/doc/classes/ARVRController.xml
@@ -22,7 +22,7 @@
<return type="int" enum="ARVRPositionalTracker.TrackerHand">
</return>
<description>
- Returns the hand holding this controller, if known. See [code]TRACKER_*[/code] constants in [ARVRPositionalTracker].
+ Returns the hand holding this controller, if known. See [enum ARVRPositionalTracker.TrackerHand].
</description>
</method>
<method name="get_is_active" qualifiers="const">
@@ -61,7 +61,7 @@
<argument index="0" name="button" type="int">
</argument>
<description>
- Returns [code]true[/code] if the button at index [code]button[/code] is pressed.
+ Returns [code]true[/code] if the button at index [code]button[/code] is pressed. See [enum JoystickList], in particular the [code]JOY_VR_*[/code] constants.
</description>
</method>
</methods>
@@ -73,7 +73,8 @@
When a controller is turned off, its slot is freed. This ensures controllers will keep the same ID even when controllers with lower IDs are turned off.
</member>
<member name="rumble" type="float" setter="set_rumble" getter="get_rumble" default="0.0">
- The degree to which the tracker rumbles. Ranges from [code]0.0[/code] to [code]1.0[/code] with precision [code].01[/code]. If changed, updates [member ARVRPositionalTracker.rumble] accordingly.
+ The degree to which the controller vibrates. Ranges from [code]0.0[/code] to [code]1.0[/code] with precision [code].01[/code]. If changed, updates [member ARVRPositionalTracker.rumble] accordingly.
+ This is a useful property to animate if you want the controller to vibrate for a limited duration.
</member>
</members>
<signals>
diff --git a/doc/classes/ARVRInterface.xml b/doc/classes/ARVRInterface.xml
index 1da1351e49..41effcaecb 100644
--- a/doc/classes/ARVRInterface.xml
+++ b/doc/classes/ARVRInterface.xml
@@ -21,7 +21,7 @@
<return type="int">
</return>
<description>
- Returns a combination of flags providing information about the capabilities of this interface.
+ Returns a combination of [enum Capabilities] flags providing information about the capabilities of this interface.
</description>
</method>
<method name="get_name" qualifiers="const">
@@ -51,9 +51,9 @@
<description>
Call this to initialize this interface. The first interface that is initialized is identified as the primary interface and it will be used for rendering output.
After initializing the interface you want to use you then need to enable the AR/VR mode of a viewport and rendering should commence.
- [b]Note:[/b] You must enable the AR/VR mode on the main viewport for any device that uses the main output of Godot such as for mobile VR.
- If you do this for a platform that handles its own output (such as OpenVR) Godot will show just one eye without distortion on screen. Alternatively, you can add a separate viewport node to your scene and enable AR/VR on that viewport and it will be used to output to the HMD leaving you free to do anything you like in the main window such as using a separate camera as a spectator camera or render out something completely different.
- While currently not used you can activate additional interfaces, you may wish to do this if you want to track controllers from other platforms. However, at this point in time only one interface can render to an HMD.
+ [b]Note:[/b] You must enable the AR/VR mode on the main viewport for any device that uses the main output of Godot, such as for mobile VR.
+ If you do this for a platform that handles its own output (such as OpenVR) Godot will show just one eye without distortion on screen. Alternatively, you can add a separate viewport node to your scene and enable AR/VR on that viewport. It will be used to output to the HMD, leaving you free to do anything you like in the main window, such as using a separate camera as a spectator camera or rendering something completely different.
+ While currently not used, you can activate additional interfaces. You may wish to do this if you want to track controllers from other platforms. However, at this point in time only one interface can render to an HMD.
</description>
</method>
<method name="is_stereo">
@@ -73,13 +73,13 @@
</methods>
<members>
<member name="ar_is_anchor_detection_enabled" type="bool" setter="set_anchor_detection_is_enabled" getter="get_anchor_detection_is_enabled" default="false">
- On an AR interface, is our anchor detection enabled?
+ On an AR interface, [code]true[/code] if anchor detection is enabled.
</member>
<member name="interface_is_initialized" type="bool" setter="set_is_initialized" getter="is_initialized" default="false">
- Has this interface been initialized?
+ [code]true[/code] if this interface been initialized.
</member>
<member name="interface_is_primary" type="bool" setter="set_is_primary" getter="is_primary" default="false">
- Is this our primary interface?
+ [code]true[/code] if this is the primary interface.
</member>
</members>
<constants>
@@ -93,10 +93,10 @@
This interface supports stereoscopic rendering.
</constant>
<constant name="ARVR_AR" value="4" enum="Capabilities">
- This interface support AR (video background and real world tracking).
+ This interface supports AR (video background and real world tracking).
</constant>
<constant name="ARVR_EXTERNAL" value="8" enum="Capabilities">
- This interface outputs to an external device, if the main viewport is used the on screen output is an unmodified buffer of either the left or right eye (stretched if the viewport size is not changed to the same aspect ratio of [method get_render_targetsize]). Using a separate viewport node frees up the main viewport for other purposes.
+ This interface outputs to an external device. If the main viewport is used, the on screen output is an unmodified buffer of either the left or right eye (stretched if the viewport size is not changed to the same aspect ratio of [method get_render_targetsize]). Using a separate viewport node frees up the main viewport for other purposes.
</constant>
<constant name="EYE_MONO" value="0" enum="Eyes">
Mono output, this is mostly used internally when retrieving positioning information for our camera node or when stereo scopic rendering is not supported.
@@ -111,7 +111,7 @@
Tracking is behaving as expected.
</constant>
<constant name="ARVR_EXCESSIVE_MOTION" value="1" enum="Tracking_status">
- Tracking is hindered by excessive motion, player is moving faster than tracking can keep up.
+ Tracking is hindered by excessive motion (the player is moving faster than tracking can keep up).
</constant>
<constant name="ARVR_INSUFFICIENT_FEATURES" value="2" enum="Tracking_status">
Tracking is hindered by insufficient features, it's too dark (for camera-based tracking), player is blocked, etc.
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 3dffbf5f9b..de9efaf8ba 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -1111,7 +1111,11 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve
if (dragged_guide_index >= 0) {
vguides.remove(dragged_guide_index);
undo_redo->create_action(TTR("Remove Vertical Guide"));
- undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", vguides);
+ if (vguides.empty()) {
+ undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "remove_meta", "_edit_vertical_guides_");
+ } else {
+ undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", vguides);
+ }
undo_redo->add_undo_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", prev_vguides);
undo_redo->add_undo_method(viewport, "update");
undo_redo->commit_action();
@@ -1140,7 +1144,11 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve
if (dragged_guide_index >= 0) {
hguides.remove(dragged_guide_index);
undo_redo->create_action(TTR("Remove Horizontal Guide"));
- undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", hguides);
+ if (hguides.empty()) {
+ undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "remove_meta", "_edit_horizontal_guides_");
+ } else {
+ undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", hguides);
+ }
undo_redo->add_undo_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", prev_hguides);
undo_redo->add_undo_method(viewport, "update");
undo_redo->commit_action();
@@ -4759,13 +4767,13 @@ void CanvasItemEditor::_popup_callback(int p_op) {
if (root->has_meta("_edit_horizontal_guides_")) {
Array hguides = root->get_meta("_edit_horizontal_guides_");
- undo_redo->add_do_method(root, "set_meta", "_edit_horizontal_guides_", Array());
+ undo_redo->add_do_method(root, "remove_meta", "_edit_horizontal_guides_");
undo_redo->add_undo_method(root, "set_meta", "_edit_horizontal_guides_", hguides);
}
if (root->has_meta("_edit_vertical_guides_")) {
Array vguides = root->get_meta("_edit_vertical_guides_");
- undo_redo->add_do_method(root, "set_meta", "_edit_vertical_guides_", Array());
+ undo_redo->add_do_method(root, "remove_meta", "_edit_vertical_guides_");
undo_redo->add_undo_method(root, "set_meta", "_edit_vertical_guides_", vguides);
}
undo_redo->add_undo_method(viewport, "update");
diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp
index cfd9ec19d2..fd9e44cd5f 100644
--- a/editor/spatial_editor_gizmos.cpp
+++ b/editor/spatial_editor_gizmos.cpp
@@ -202,6 +202,9 @@ void EditorSpatialGizmo::add_mesh(const Ref<ArrayMesh> &p_mesh, bool p_billboard
}
void EditorSpatialGizmo::add_lines(const Vector<Vector3> &p_lines, const Ref<Material> &p_material, bool p_billboard) {
+ if (p_lines.empty()) {
+ return;
+ }
ERR_FAIL_COND(!spatial_node);
Instance ins;
@@ -4190,8 +4193,19 @@ void JointSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
p_gizmo->clear();
- const Spatial *node_body_a = Object::cast_to<Spatial>(joint->get_node(joint->get_node_a()));
- const Spatial *node_body_b = Object::cast_to<Spatial>(joint->get_node(joint->get_node_b()));
+ Spatial *node_body_a = NULL;
+ if (!joint->get_node_a().is_empty()) {
+ node_body_a = Object::cast_to<Spatial>(joint->get_node(joint->get_node_a()));
+ }
+
+ Spatial *node_body_b = NULL;
+ if (!joint->get_node_b().is_empty()) {
+ node_body_b = Object::cast_to<Spatial>(joint->get_node(joint->get_node_b()));
+ }
+
+ if (!node_body_a && !node_body_b) {
+ return;
+ }
Ref<Material> common_material = get_material("joint_material", p_gizmo);
Ref<Material> body_a_material = get_material("joint_body_a_material", p_gizmo);
diff --git a/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs b/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs
index b9b2b0fded..c7e8ea511a 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs
@@ -209,23 +209,25 @@ namespace GodotTools.Export
string TemplateDirName() => $"data.mono.{platform}.{bits}.{target}";
string templateDirPath = Path.Combine(Internal.FullTemplatesDir, TemplateDirName());
+ bool validTemplatePathFound = true;
if (!Directory.Exists(templateDirPath))
{
- templateDirPath = null;
+ validTemplatePathFound = false;
if (isDebug)
{
target = "debug"; // Support both 'release_debug' and 'debug' for the template data directory name
templateDirPath = Path.Combine(Internal.FullTemplatesDir, TemplateDirName());
+ validTemplatePathFound = true;
if (!Directory.Exists(templateDirPath))
- templateDirPath = null;
+ validTemplatePathFound = false;
}
}
- if (templateDirPath == null)
- throw new FileNotFoundException("Data template directory not found");
+ if (!validTemplatePathFound)
+ throw new FileNotFoundException("Data template directory not found", templateDirPath);
string outputDataDir = Path.Combine(outputDir, DataDirName);
diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp
index 7d62873bbd..5ce269fff9 100644
--- a/scene/resources/packed_scene.cpp
+++ b/scene/resources/packed_scene.cpp
@@ -397,6 +397,9 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map
if (p_owner->get_scene_inherited_state().is_null() && (p_node == p_owner || (p_node->get_owner() == p_owner && (p_node->get_parent() == p_owner || p_node->get_parent()->get_owner() == p_owner)))) {
//do not save index, because it belongs to saved scene and scene is not inherited
nd.index = -1;
+ } else if (p_node == p_owner) {
+ //This (hopefully) happens if the node is a scene root, so its index is irrelevant.
+ nd.index = -1;
} else {
//part of an inherited scene, or parent is from an instanced scene
nd.index = p_node->get_index();