We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
4.0.beta
Windows 10/11, Web
get_image() from a Texture2D returns null when running in Web.
The problem was solved in previous versions but returned in version 4
Just get an image from texture from a node in the scene. And play in the browser.
Examples: $Icon.get_texture().get_image() get_viewport().get_texture().get_image()
$Icon.get_texture().get_image()
get_viewport().get_texture().get_image()
No response
The text was updated successfully, but these errors were encountered:
Confirmed, I had worked around this issue in #65704 for one case which was raising an error in the web editor.
Now the web editor as of 4.0 beta 4 is crashing in this code:
void EditorRunNative::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { for (int i = 0; i < EditorExport::get_singleton()->get_export_platform_count(); i++) { Ref<EditorExportPlatform> eep = EditorExport::get_singleton()->get_export_platform(i); if (eep.is_null()) { continue; } Ref<ImageTexture> icon = eep->get_run_icon(); if (!icon.is_null()) { Ref<Image> im = icon->get_image(); im = im->duplicate(); im->clear_mipmaps(); if (!im->is_empty()) { im->resize(16 * EDSCALE, 16 * EDSCALE); Ref<ImageTexture> small_icon = ImageTexture::create_from_image(im); MenuButton *mb = memnew(MenuButton); mb->get_popup()->connect("id_pressed", callable_mp(this, &EditorRunNative::run_native).bind(i)); mb->connect("pressed", callable_mp(this, &EditorRunNative::run_native).bind(-1, i)); mb->set_icon(small_icon); add_child(mb); menus[i] = mb; } } } } break;
Because there's no null check before im->duplicate().
im->duplicate()
Sorry, something went wrong.
clayjohn
Successfully merging a pull request may close this issue.
Godot version
4.0.beta
System information
Windows 10/11, Web
Issue description
get_image() from a Texture2D returns null when running in Web.
The problem was solved in previous versions but returned in version 4
Steps to reproduce
Just get an image from texture from a node in the scene. And play in the browser.
Examples:
$Icon.get_texture().get_image()
get_viewport().get_texture().get_image()
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: