Skip to content

Fix Curve point properties usage flags#116331

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
kleonc:curves_fix_per_per_point_props_stored_twice
Feb 18, 2026
Merged

Fix Curve point properties usage flags#116331
Repiteo merged 1 commit into
godotengine:masterfrom
kleonc:curves_fix_per_per_point_props_stored_twice

Conversation

@kleonc

@kleonc kleonc commented Feb 15, 2026

Copy link
Copy Markdown
Member

Fixes #116323.
Fixes #116442

Regression from #92282:

Curve/Curve2D/Curve3D per point properties were incorrectly changed to use default usage flags (including PROPERTY_USAGE_STORAGE). These should be editor-only, actual data is stored in a single _data property per curve.
Duplicated data in #116323 MRP:

[sub_resource type="Curve" id="Curve_tgo4v"]
resource_local_to_scene = true
_limits = [1.0, 8.0, 0.0, 1.0]
_data = [Vector2(0, 1.103612), 0.0, 0.0, 0, 0, Vector2(1, 8), 0.0, 0.0, 0, 0]
point_count = 2
point_0/position = Vector2(0, 1.103612)
point_1/position = Vector2(1, 8)

Curve::_set_point_position got value/offset values swapped. But in fact, before #92282 there was a bug in the Curve::_set, as when setting a point position it was setting the offset before the value for the same point index:

if (property == "position") {
Vector2 position = p_value.operator Vector2();
set_point_offset(point_index, position.x);
set_point_value(point_index, position.y);

but setting the offset for a point at given index might result in changing the index of the given point (as points are sorted by offsets). Correct is either:

set_point_value(point_index, position.y);
set_point_offset(point_index, position.x);

or:

int new_index = set_point_offset(point_index, position.x);
set_point_value(new_index, position.y);
@kleonc kleonc added this to the 4.7 milestone Feb 15, 2026
@kleonc kleonc requested a review from KoBeWi February 15, 2026 19:12
@shakesoda

Copy link
Copy Markdown
Contributor

thanks, curve edit is totally unusable without this rn

@Repiteo Repiteo merged commit 6e5b661 into godotengine:master Feb 18, 2026
20 checks passed
@Repiteo

Repiteo commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment