godotengine / godotengine/godot

Deleting a selected curve point in Path3D causes an error

Open
#89,153 1 comment 0 reactions 0 assignees View on GitHub
bug topic:3d topic:editor
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

- Reproducible in v4.3.dev4.official [df78c0636]

### System information

Godot v4.3.dev4 - Fedora Linux 39 (Workstation Edition) - Wayland - Vulkan (Forward+) - integrated Intel(R) Xe Graphics (TGL GT2) () - 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (8 Threads)

### Issue description

When a curve point is selected in the 3D scene editor and that point is deleted in the inspector, an error is displayed in the console. For example:

```
editor/plugins/path_3d_editor_plugin.cpp:899 - Index p_id = 2 is out of bounds (curve->get_point_count() = 2).
```

The issue appears to be that the subgizmos are not updated when a point is deleted. This leads to a subgizmo index is associated with a curve point that no longer exists and is thus out of bounds.

### Steps to reproduce

1. Create new empty scene (3D)
2. Add a Path3D node
3. Select the Path3D node
4. Add 1 or more points to the curve (CTRL + click)
5. Select all the points (SHIFT + click)
6. Delete any of the curve points in the inspector under the "Curve" property.

### Minimal reproduction project (MRP)

N/A

Contributor guide

Open the contributing guide

Research direction

Start in editor/plugins/path_3d_editor_plugin.cpp, especially around the reported out-of-bounds access at line 899, and reproduce the deletion from the Path3D inspector in the 3D scene editor. Trace how selected subgizmos relate to curve points after deletion. Done means deleting a selected curve point no longer produces the reported out-of-bounds error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, godot
Domain
game-dev, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.