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

Convert Nodepath properties to Object if "node_type" property hint has been set #83006

Conversation

warriormaster12
Copy link
Contributor

@warriormaster12 warriormaster12 commented Oct 8, 2023

This fixes an issue when instantiating a scene, script's properties that have "node_type" hint set are read as a nodepath causing "revert" button to popup due variant mismatch.

before pr:

2023-10-08.19-47-00.mp4

pr:

2023-10-08.19-39-25.mp4

@warriormaster12
Copy link
Contributor Author

warriormaster12 commented Oct 8, 2023

#82670 (comment)

Related comment, but doesn't solve the issue.

@warriormaster12 warriormaster12 marked this pull request as draft October 9, 2023 09:07
Copy link
Member

@AThousandShips AThousandShips left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assume these were added by IDE

@@ -31,8 +31,11 @@
#include "property_utils.h"

#include "core/config/engine.h"
#include "core/object/object.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#include "core/object/object.h"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup

#include "core/templates/local_vector.h"
#include "core/variant/array.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#include "core/variant/array.h"

#include "core/object/script_language.h"
#include "core/string/print_string.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#include "core/string/print_string.h"

@warriormaster12
Copy link
Contributor Author

Converting to draft since I realized that it wasn't as simple as I thought. Arrays are giving me currently a headache.

@warriormaster12
Copy link
Contributor Author

@AThousandShips if you notice something that can be done differently, I'm all ears :)

@AThousandShips
Copy link
Member

I'm currently taking a bit of a break for personal reasons so won't be able to do much complex work, but can take a look when I am able :)

@warriormaster12
Copy link
Contributor Author

Yeah no worries, I just need someone more experienced with the source code than me to give feedback. You were just first one who replied.

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.

3 participants