Open MunWolf opened 1 year ago
Judging by your screenshot, this happens with the bundled font, and is kind of expected. For the record, you don't have to make a copy of the entire default theme, and at the very least you don't have to bundle the fonts. Themes merge together, and your project theme only needs to contain the parts that you override from the default one.
That is interesting, because this is what we have in the theme and I don't see any fonts there We initially copied the whole theme and then deleted a bunch of things later on. Did the font data stick around? EDIT: Here is the theme file for reference default.zip
Well, I can be wrong, there is only so much I can tell from a screenshot. If you can't provide an MRP, you can try debugging it yourself by recreating the theme anew and adding only the stuff you need.
Seems like there was 1 font on the label, but it does not show up in the Edit Items window, only when I try to import from it into another theme. Importing to another theme and ignoring that one font reduced the file massively so I assume that fixed it So the issue here is more that the font did not show up in the Edit Items window. (if the IDs changing is intended)
The ids that change seem to also include icons so I removed those as well.
As an update, including any fonts or textures in your theme from the default theme causes this issue.
I have the same issue, and it seems to affect ImageTexture IDs specifically.
The effect is similar to how a material flagged Local to Scene keeps changing its ShaderMaterial ID (an issue I have yet to report, as I'll try to make a MRP first), but since this is a resource and there is no Local to Scene to check, the cause must be different.
I forgot the post the issue I created for Material ID: https://github.com/godotengine/godot/issues/77997 although the cause must be different since it only happens when checking Local to Scene (and this seems to apply to other resources as well)
Setting Image
for ImageTexture
ultimately sets a copy of the original image
. And the copy does not retain the scene_unique_id
of the original image
. A new scene_unique_id
will be generated when the file is saved.
It seems that the image of ImageTexture
exists in the form of data, not an object.
Similar to #55190.
At the same time, I feel the need to solve a problem. When I copy a node, such as an animation_player, the id of the sub_resource does not change. This can lead to confusing issues. Here is my case: I am currently creating multiple monsters, some of which require AnimationPlayer and Sprite2D nodes. After creating one monster, I want to quickly copy these two nodes to other monster nodes. I expect the nodes to be copied normally. However, the AnimationPlayer node is actually copied with the same id as the resource type, and when I make changes to other monsters, the previous monster is unknowingly affected and damaged.
same here... it changes the theme file even if i don't change anything in the theme... got a changed theme file on every commit...
yes this currently drives me nuts I have a theme file in the project, that I dont even touch Every time I start godot, just start, I dont even change anything The Theme file is modified again... Why?
Can someone just shortly reiterate what the current workaround is (except for ignoring the id changes)?
As an update, including any fonts or textures in your theme from the default theme causes this issue.
Remove resources (fonts/textures) from your theme file that reference the default theme or maybe make them unique?
Thanks a ton @jamie-pate !
~This button did the trick for me~
EDIT: No, that was the wrong button. This one (local to scene
) also didn't do the trick
I couldn't find any resources that were referencing the default theme (it should be in the resource path, am I right? all of those referenced my own theme).
We have the same issue and it's driving me crazy that default_theme.tres keeps changing just because it decides to change IDs, so that file gets commited in Github every single commit.
Here is my absurd workaround that possibly might have bad consequences for the integrity of your project:
Godot will complain about not being able to write to the file whenever you save, but it appears to work...
Here is my absurd workaround that possibly might have bad consequences for the integrity of your project:
1. put the theme tres in a subdirectory all of its own 2. remove permissions from that directory and the tres file so you can't write to it (e.g. chown & chmod to root)
Godot will complain about not being able to write to the file whenever you save, but it appears to work...
Thanks for the suggestions, but that's not really a viable workaround for us, and I find it rather absurd. Has there been any official word about this bug yet?
The ID change because you have ImageTexture embedded in your Theme. Trying to get Image of ImageTexture will always return a new instance (#25209), hence the IDs will change.
We already have a warning when importing theme icons: I guess it could clarify what does it mean exactly or maybe it should be outright not allowed, because icons imported from default/editor theme get embedded. The only way to "fix" this is to save each icon to a new file, so it gets referenced as an external dependency.
I think the warning doesn't really let you know how it's not just bigger but it's unstable and will change frequently which makes it practically incompatible with source control .
On Wed, Jul 24, 2024, 21:48 Tomek @.***> wrote:
The ID change because you have ImageTexture embedded in your Theme. Trying to get Image of ImageTexture will always return a new instance (#25209 https://github.com/godotengine/godot/issues/25209), hence the IDs will change.
We already have a warning when importing theme icons: image.png (view on web) https://github.com/user-attachments/assets/6ecb3466-820d-480f-98f5-aa7383cf3914 I guess it could clarify what does it mean exactly or maybe it should be outright not allowed, because icons imported from default/editor theme get embedded. The only way to "fix" this is to save each icon to a new file, so it gets referenced as an external dependency.
— Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/74001#issuecomment-2247994925, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAP4ANGESGCGROCLYOYODM3ZN6WCTAVCNFSM6AAAAAAVIUBDYGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBXHE4TIOJSGU . You are receiving this because you are subscribed to this thread.Message ID: @.***>
This isn't an issue with themes I don't think - I am using ImageTexture in my project and every time the project loads the internal id of the sub-resource containing the image data is changed. The IDs change even when no changes to the image occur - i.e. just opening and closing the editor changes the IDs, I assume it is the loading and unloading of the resource that does it.
I have tried everything I can think of and everything recommended on other threads to try and fix this but nothing works. I have even written a system that saves the image as a PNG before loading it into the ImageTexture, hoping that that would sort it but no luck.
This the the kind of ID that keeps changing in the ImageTexture:
[sub_resource type="Image" id="Image_spgdd"]
data = {
...
}
image = SubResource("Image_spgdd")
If anyone has any ideas I'd be very grateful.
For me, (I think) it was that I had to recreate my theme without starting from a copy of the default theme.
Save the Image as file instead of embeddimg it. From the inspector, not using script.
Yes, this is an issue with images being embedded in the theme. This can happen when you don't set a texture for a type; it will load the default texture into your theme, and directly embed the data into your theme as a SubResource. To fix this:
This will remove the embedded data for the texture. When you play the game, it will still use the texture, it just doesn't load it directly from the theme now. I don't know why this happens, but I think it can occur during some point of setting up a theme for a certain type for the first time, but other than that I genuinely have no idea how to reproduce this issue.
@basilicon Thank you so much for the step by step solution that at last I was able to follow. Your post will be remembered! Now I don't care that much anymore if it's fixed or not, this workaround is sufficient for me.
Bugsquad note: This issue has been confirmed several times already. No need to confirm it further.
Godot version
4.0 rc5
System information
Windows 10 and Linux
Issue description
My friend and I are working on a game and we have a theme that we use for all of our UI.
We created it by importing it from the default theme and making some changes (not very important as this was happening before we made the changes)
Every time we save the project if the person who was saving isn't the last one to have commited a change to the theme it changes all the ids on the entries
Example image
Notably I am working on the windows release of rc5 while my friend is on the linux release, I assume that has something to do with this issue.
Steps to reproduce
Minimal reproduction project
N/A