-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
ImageTextureLayered does not persist its state #66558
Comments
I'd love to create a PR for this, but then I first have to understand how this is supposed to work. Since the whole |
Which alpha/beta version are you using? 4.0 isn't released in stable form yet. |
Yeah sorry for not specifying that, it is a |
Duplicate of #63025 As explained there, this:
Should be:
|
Have discussed this on rocket chat, but adding a comment here for clarity - I don't believe the static In my tests, creating e.g. a |
So, is there any suggested docs I should look at if I want to create an MR for this? My gut feeling says This bug is really blocking me from seriously using Godot :( |
Don't know if this is useful, but here's a valid It's just 3 128x128 textures from OpenGameArt. As you can see it's the raw image data stored as subresources, followed by some metadata about the TextureArray itself. Interestingly, the Truncated for brevity:
I was trying to figure out in Godot's source where in the |
The problem you describe above is
I agree it isn't very obvious, and it is lacking documentation (serialisation in general). If you look at the C++ classes mapping to the GDScript classes you can find where it defines the "public" GDScript attributes which are serialised automagically. |
Okay, I think I have a fix for Anyway, hopefully this will finally be the end of all the TextureLayered woes with Godot, and I can go back to hacking on my game instead of Godot 😄 |
Ah, I didnt realise it was actually a problen in 3.x - just that porting my game from 3.x to 4 indeed means I'm blocked by the broken serialization, I just posted the 3.x as an example in case it gave someone some insight into why it wasn't working in 4. Sounds like you nailed it though, I will keep an eye out for the 4 PR as I can finally continue my porting :) |
If you feel experimental enough, the 4.x commit that fixes it for me is here: Game3DEE@68bb829, feel free to grab it, but this is only tested with the above script, so YMMV. so, with the above commit, the
and has the correct (red square) preview in the Inspector. |
@Ithamar I just compiled master with your patch and can confirm, it fixed my problem with Texture2DArray saving - worked perfectly! Thanks! |
Nice! I'll clean it up and post a PR for it as well tonight, so we can get all the Texture2DArray stuff back working again 🎊 |
Fixed by #71394 |
Godot version
4.0b1dev (commit c2f6664)
System information
Windows 10, Vulkan
Issue description
ImageTextureLayered
and its subclasses do not save their "content" when asked by usingResourceSaver.save
. No persistable properties are defined, so none are stored.Steps to reproduce
The following code:
Results in
layered.tres
looking empty like this:while
image.tres
shows the proper image was created (and saved):Minimal reproduction project
See code above.
The text was updated successfully, but these errors were encountered: