0 votes

I've got some pretty massive textures in the sprites in my project and it's slowing down the Editor. I've got a way of loading the textures dynamically from an external location (even in tool mode), but it still saves the loaded texture data with the project. Is there a way to stop it saving a sprite's texture data?

Godot version 3.4.2
in Engine by (1,053 points)

1 Answer

+1 vote
Best answer

Only way I can think of is not using sprite in saved scene directly, but by instancing sprite from code. As long as you don't define owner, the node and it's resources won't be saved on disk.

If you need to have the sprite in editor to adjust settings etc. you can duplicate the sprite. Something along these lines:

if Engine.editor_hint:
    # Duplicate without scripts, groups or signals
    var duplicate_sprite = target_sprite.duplicate(DUPLICATE_USE_INSTANCING)
    # Set duplicate_sprite.texture
    # Set target_sprite.texture
by (1,100 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.