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

GLTFDocument.append_from_scene executed on non-ui thread cost tool much time compared to on ui thread. #100263

Open
didong-lin opened this issue Dec 11, 2024 · 2 comments

Comments

@didong-lin
Copy link

Tested versions

Reproducible in Godot v4.0.4.stable

System information

Mac & Android & iOS - Godot v4.0.4.stable

Issue description

try to execute GLTFDocument.append_from_file on ui thread and non-ui thread respectively, the time cost on non-ui thread is much higher than on ui thread. for example, in the minimal reproduction project, append on ui thread time cost: 3436ms,
but append on other thread time cost: 117287ms
Hope to see your replay as soon as possible! Thanks so much!

Steps to reproduce

run the MRP Main.tscn to check result

Minimal reproduction project (MRP)

MinimalProject.zip

@fire
Copy link
Member

fire commented Dec 11, 2024

Can you try later versions of Godot Engine to see if the time changes?

@didong-lin
Copy link
Author

Can you try later versions of Godot Engine to see if the time changes?

Thx for your reply, just tested on godot 4.3
raised this error:
E 0:00:03:0670 Main.gd:35 @ appendFromScene(): This function in this node (/root/Node3D/@node3d@2) can only be accessed from either the main thread or a thread group. Use call_deferred() instead.
<C++ Error> Condition "!is_readable_from_caller_thread()" is true. Returning: (false)
<C++ Source> scene/3d/node_3d.cpp:821 @ is_visible()
Main.gd:35 @ appendFromScene()
Main.gd:26 @ ()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants