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

TextureRegion doesn't update to new copy of AtlasTexture #26814

Open
LATRio opened this issue Mar 9, 2019 · 5 comments
Open

TextureRegion doesn't update to new copy of AtlasTexture #26814

LATRio opened this issue Mar 9, 2019 · 5 comments

Comments

@LATRio
Copy link
Contributor

LATRio commented Mar 9, 2019

Godot version:

master 86d6a72
both GLES3 and GLES2

OS/device including version:

Windows 10 64-bit
GTX 1060 6GB

Issue description:

TextureRegion gets "disconnected from duplicate TextureRect's Atlas Texture when you make it unique"
It works fine with a Sprite.

Steps to reproduce:

  • Create TextureRect and add Atlas Texture
  • Select any image as atlas
  • (Optional) Select any region
  • Duplicate TextureRect
  • Select TextureRect2 and click on AtlasTexture resource to open TextureRegion
  • Make AtlasTexture unique
  • Change region inside TextureRegion
  • It doesn't update current region
    To fix it:
  • Click AtlasTexture resource to close TextureRegion and open it again (Doing it by clicking TextureRegion tab won't fix it)
@KoBeWi
Copy link
Member

KoBeWi commented Aug 22, 2020

Still valid in 3.2.3 rc4, i.e. the TextureRegion editor doesn't update immediately, but you need to click (redraw) it. Probably requires similar fix to #30148

@codevenkat
Copy link

Hello, I'm attempting a fix for this. I'm currently looking at what was done in the mentioned PR.

@codevenkat
Copy link

Hmm I'm not able to replicate it on the master branch

@KoBeWi
Copy link
Member

KoBeWi commented Oct 4, 2020

Huh, so this is actually a different issue. When you open the AtlasTexture in the inspector and make it unique, the TextureRegion editor will still keep the copy of the old texture and when you edit it the new texture is unaffected. The steps are a bit confusing, you need only one TextureRect (or any textured node) to reproduce this.

That said, the fix is probably not as easy.

@KoBeWi
Copy link
Member

KoBeWi commented May 8, 2022

I tried to fix this but failed lol

The problem isn't really related to TextureRegion, any editor is potentially affected. Basically when you have a resource that is being edited and then make it unique, the editor should switch to the new resource. This doesn't happen right now, hence this bug.

The change should be done somewhere here:

}
emit_changed(get_edited_property(), p_resource);
update_property();
// Automatically suggest setting up the path for a ViewportTexture.

If get_edited_object()->get(get_edited_property() before emit_changed() equals to the currently edited resource in the editor, edit p_resource (with _resource_selected()). I couldn't figure out how to check if the current resource is the one currently edited; this shouldn't happen for unrelated resources.

Of course there might be a different fix.

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

4 participants