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

[3.x] Drag multiple resources onto exported array variable at once #50718

Conversation

AaronRecord
Copy link
Contributor

@AaronRecord AaronRecord commented Jul 21, 2021

Backport of #37965

@AaronRecord AaronRecord marked this pull request as draft July 21, 2021 21:50
@AaronRecord AaronRecord marked this pull request as ready for review July 21, 2021 22:16
@AaronRecord
Copy link
Contributor Author

AaronRecord commented Jul 21, 2021

It seems it's possible to drag non-valid resource types (e.g. dragging an audio file onto an array of textures) onto the array and it just creates a new empty element. It's not a big deal, but it seems there's code that's supposed to stop this from happening:
https://github.com/godotengine/godot/pull/50718/files#diff-17781aa265945f5f8988f4d66150a04b73fcdd99f5600b24409d731d24e6fbf1R442-R445, cc @EricEzaM.

It also prints an error message like so:

ERROR: Failed to set a resource of the type 'PackedScene' because this EditorResourcePicker only accepts 'Texture' and its derivatives.
   at: (editor\editor_resource_picker.cpp:753)

I'm not sure if this is a problem with the backport of if the original PR had this problem too.

@AaronRecord AaronRecord marked this pull request as draft July 21, 2021 22:27
@Calinou Calinou added this to the 3.4 milestone Jul 22, 2021
@EricEzaM
Copy link
Contributor

More issues caused by this damn code snippet:
#40383 (comment)

allowed_type was being set to subtype, but subtype is just Object in this case, not, for example, Texture. The string value "Texture" is stored in subtype_hint_string, so when the subtype is Object, we should also look to see if there is a subtype_hint_string, and make the allowed type that. I will submit a PR for this. 🙃

@AaronRecord AaronRecord marked this pull request as ready for review July 26, 2021 16:53
@AaronRecord
Copy link
Contributor Author

#50805 should probably be merged first, then I can cherry-pick it as part of this PR, but other than that I think this PR is good.

@akien-mga
Copy link
Member

#50805 should probably be merged first, then I can cherry-pick it as part of this PR, but other than that I think this PR is good.

It has now been merged :)

@AaronRecord AaronRecord marked this pull request as draft October 1, 2021 19:25
@AaronRecord AaronRecord force-pushed the drag-multiple-resources-onto-array-export-3.x branch from 508e667 to 6628fe0 Compare October 1, 2021 19:26
@AaronRecord AaronRecord marked this pull request as ready for review October 1, 2021 20:10
@AaronRecord
Copy link
Contributor Author

AaronRecord commented Oct 1, 2021

I think this should be good to go now.

@akien-mga akien-mga requested a review from EricEzaM October 1, 2021 20:40
@akien-mga akien-mga merged commit 74727be into godotengine:3.x Oct 5, 2021
@akien-mga
Copy link
Member

Thanks!

@AaronRecord AaronRecord deleted the drag-multiple-resources-onto-array-export-3.x branch October 5, 2021 15:02
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.

4 participants