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 error when dropping image onto the scene dock #92470

Merged
merged 1 commit into from
May 28, 2024

Conversation

timothyqiu
Copy link
Member

@timothyqiu timothyqiu commented May 28, 2024

Fixes a regression described in #92004 (comment).

Dropping files onto the scene dock has 3 situations:

  1. Any single resource file: Set type-matching property of that node.
  2. One or more scene files: Instantiate the scene.
  3. One or more audio files: Create an AudioStreamPlayer.

#92004 first tries to do the property drop (1 above). 2 and 3 will be tried if the resource file does not have any matching property, so that audio stream players are easier to create. But I did not check the "single file, not audio stream" situation, thus the error message.

CC @patwork

@timothyqiu timothyqiu added this to the 4.3 milestone May 28, 2024
@timothyqiu timothyqiu requested a review from a team as a code owner May 28, 2024 11:09
@akien-mga akien-mga merged commit e408c77 into godotengine:master May 28, 2024
16 checks passed
@timothyqiu timothyqiu deleted the drop-error branch May 28, 2024 14:32
@akien-mga
Copy link
Member

Thanks!

@patwork
Copy link
Contributor

patwork commented May 31, 2024

@timothyqiu hi, just tested in 4.3.beta1 and now I cannot drop any image into scene tree (can drop them into editor window).

	if (ClassDB::is_parent_class(res_type, "PackedScene")) {
		_perform_instantiate_scenes(p_files, node, to_pos);
	} else if (ClassDB::is_parent_class(res_type, "AudioStream")) {
		_perform_create_audio_stream_players(p_files, node, to_pos);
	}

I guess images are not type "PackedScene"?

@timothyqiu
Copy link
Member Author

just tested in 4.3.beta1 and now I cannot drop any image into scene tree

You can't create nodes by drop images there in previous versions either.

@patwork
Copy link
Contributor

patwork commented May 31, 2024

Oh indeed, I'm so sorry, I was convinced that dropping in a scene tree would work the same way. 😓😓😓

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