-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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 export variable of type Node pointing to a wrong child node when duplicating #83343
Fix export variable of type Node pointing to a wrong child node when duplicating #83343
Conversation
4784743
to
7a3e94d
Compare
7e6cd65
to
a02905d
Compare
a02905d
to
a0f62f0
Compare
Updated a comment in the node.cpp as it was a bit unclear |
Is it also possible to cherrypick for 4.1.x? If there's going to be another maintenance release. |
Am I reading this correctly? Does this also supersede #81866 by solving a similar or pretty much identical issue? |
@Mickeon seems like it solves a similar problem. Though I'm not sure how yours handles arrays if it even does. |
So what is the next step? Would be nice to merge this so that I can continue working on my game project without worrying about duplicating nodes 😊 |
No team member has approved this yet, it's still waiting for a review |
a0f62f0
to
0409a5d
Compare
Is it that way before? If not this PR should make sure it doesn't introduce that behaviour In other words: Does this happen without this PR, then you can but not necessary in this PR, otherwise you have to ensure it doesn't introduce new bugs |
Aight, I'll take a closer look at home. Hopefully it will be simple enough to patch this. |
I'd suggest to first update your branch to get a good view of how the code looks right now, as you're about 9 days behind |
Do you mean that I should update the branch with the master? |
Yes, rebase it |
Aight, I'll do that 👍 |
0409a5d
to
35dd13d
Compare
Does someone know what is the status for this PR? |
It has 4.3 milestone with 4.2 cherry-pick label, so it will be available in 4.2.1. |
Would be nice to evaluate if this would lead to performance regressions like other similar recent changes did. Looks like we're iterating over a bunch of nodes and all of their properties to solve the issue here. |
It's not recursive, so it's probably fine. |
It kind of is, I think? We just collect all the nodes ahead of time. Though that's not new to this PR. So I guess it won't be any worse. |
The pr itself imo doesn't have recursion directly since it just takes the nodepath and converts into an object. If you have child with a property that needs to be converted then you get recursion. Maybe there might be a performance penalty for nodepath conersion 🤔 |
Thanks! |
I couldn't find this commit in either 4.2.1 nor 4.3-dev. Was it included? |
Once the cherry-pick is done, the label is removed, so this has been forgotten. |
It was included in 4.3 dev1 You just have to go through interactive commit history. |
The issue solved by this PR still happens in 4.3-dev1, so that's why I guessed the commit wasn't included. I don't know, though. The test I did:
I selected
|
Interesting, maybe I misunderstood how interactive commit page works. I’ll have to check once I get a chance. |
@MikeFP could you send a minimum project? |
@MikeFP Can confirm, indeed this case seems to be broken. 🤔
#82670 was specifically reporting a case when it's the Node with the exported Node property being duplicated though. And such case seems to be fixed by this PR. |
@kleonc I see. In fact, there's already an issue here: #78060, with an open PR #81866. I thought it would get superseded by this, like a previous comment in this discussion suggested:
But maybe this PR didn't actually end up covering that case. Now it's a matter of working on that other PR, then. |
I’ll take a look after new year celebration. I already have one suspect. |
Took a while to figure that this was a two part issue.
get_property_value
method would return a variant that was read from a packed scene file (NodePath). However, when callinginstantiate
the variants would be converted to a proper type (Object) if they were in the deferred_properties list.before pr:
before_duplication_fixed.mp4
pr:
duplication_fixed.mp4
Fixes: #82670
Supersedes: #83006