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

Fix property of type Node duplication when script is attached to a child node #87387

Merged
1 commit merged into from
Mar 24, 2024

Conversation

warriormaster12
Copy link
Contributor

This is a continuation of a last PR where I seemed to have only partially solved the problem with node duplication as pointed out by one of the comments after the PR got merged.

This PR should hopefully solve the edge case when a script is attached to a child node but the user duplicates that node's parent.

@warriormaster12 warriormaster12 requested a review from a team as a code owner January 19, 2024 21:19
scene/main/node.cpp Outdated Show resolved Hide resolved
scene/main/node.cpp Outdated Show resolved Hide resolved
scene/main/node.h Outdated Show resolved Hide resolved
@AThousandShips AThousandShips added this to the 4.3 milestone Jan 19, 2024
@warriormaster12 warriormaster12 force-pushed the dup_prop_refactor branch 2 times, most recently from dcdee1b to 34799bc Compare January 20, 2024 09:38
@warriormaster12
Copy link
Contributor Author

@AThousandShips is it possible to get this cherry-picked for 4.2?

@AThousandShips
Copy link
Member

I don't know the area well enough to make that call

@ryevdokimov
Copy link
Contributor

ryevdokimov commented Feb 21, 2024

I think this is related to this PR and the previous one, but I believe there is an issue when duplicating nodes that have children that are instances of other scenes added via add_childen() and the owner set to its parent. As far as I can tell nothing seems broken when I duplicate, it's just the console gets flooded with these errors.

Edit: Disregard.

@warriormaster12
Copy link
Contributor Author

Can you confirm that this doesn’t happen with a version of godot before my PRs?

@ryevdokimov
Copy link
Contributor

Ah whoops, I didn't pay attention enough to git blame, and thought the relevant code was introduced there. Ignore this.

scene/main/node.cpp Outdated Show resolved Hide resolved
scene/main/node.cpp Outdated Show resolved Hide resolved
scene/main/node.cpp Outdated Show resolved Hide resolved
scene/main/node.cpp Outdated Show resolved Hide resolved
scene/main/node.cpp Outdated Show resolved Hide resolved
@KoBeWi
Copy link
Member

KoBeWi commented Mar 13, 2024

There is some bug where if you duplicate a node and the duplicated node has its properties updated, the original will also have them changed.

aoYq8ZNIt4.mp4

@warriormaster12
Copy link
Contributor Author

@KoBeWi Try again, value now is deeply duplicated so the bug shouldn't happen.

akien-mga added a commit that referenced this pull request Mar 24, 2024
Fix property of type Node duplication when script is attached to a child node
@akien-mga akien-mga closed this pull request by merging all changes into godotengine:master in 06abc86 Mar 24, 2024
@akien-mga
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

5 participants