Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reset button next in Path2D "curve" property not working. #36372

Closed
shafnaz opened this issue Feb 19, 2020 · 2 comments · Fixed by #39479
Closed

reset button next in Path2D "curve" property not working. #36372

shafnaz opened this issue Feb 19, 2020 · 2 comments · Fixed by #39479

Comments

@shafnaz
Copy link

shafnaz commented Feb 19, 2020

Godot version:
3.2
OS/device including version:
Windows 10
Issue description:
The reset button does not reset to an empty curve. (See .gif animation)
godot path2D

Steps to reproduce:

  1. Create "Path2D" node.
  2. Draw your curve.
  3. Now press the reset button. Curve disappears, but when you now draw a new curve, the reset button is also gone.
  4. If you select "New Curve2D" from the dropdown, and then reset, it will default to the previous curve you had drawn.
    Minimal reproduction project:
@simpuid
Copy link
Contributor

simpuid commented Feb 28, 2020

Same kind of bug is present in spatial path.
It can be fixed by using an empty Ref<Curve2D> and Ref<Curve3D> for curve property of Path2D and Path respectively.

@shafnaz If the above fix is applied then you have to assign a new Curve2D to Path2D through drop down menu before editing it or after a revert.

@KoBeWi If that sounds good to you then I will issue a PR (already tested).

@KoBeWi
Copy link
Member

KoBeWi commented Feb 28, 2020

@simpuid If you have a PR ready, just open it and someone will review whether the fix is good or not.

@akien-mga akien-mga added this to the 4.0 milestone Jun 9, 2020
akien-mga added a commit to akien-mga/godot that referenced this issue Jun 9, 2020
To do so, Object gets a new virtual `object_duplicate` (`duplicate`
already taken by incompatible implementations in derived classes)
which is implemented in `Node` and `Resource`.

This allows fixing godotengine#36372 properly in `ClassDB` by duplicating
Objects that need it to avoid using the same one as default value.
(So far it seems only Path2D/Path3D's `curve` property uses this.)

Fixes godotengine#36372.
Fixes godotengine#36650.

Supersedes godotengine#36644 and godotengine#36656.
akien-mga added a commit to akien-mga/godot that referenced this issue Jun 12, 2020
Fixes godotengine#36372 as Path2D/Path3D's `curve` property no longer uses a Curve
instance as default value, but instead it gets a (unique) default Curve
instance when created through the editor (CreateDialog).

ClassDB gets a sanity check to ensure that we don't do the same mistake
for other properties in the future, but instead use the dedicated
property usage hint.

Fixes godotengine#36372.
Fixes godotengine#36650.

Supersedes godotengine#36644 and godotengine#36656.

Co-authored-by: Thakee Nathees <thakeenathees@gmail.com>
Co-authored-by: simpuid <utkarsh.email@yahoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment