-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Add support for ImageTexture3D serialization #82055
Add support for ImageTexture3D serialization #82055
Conversation
45c81ab
to
5d998a9
Compare
Those errors might come when the binary or text resource loader tries to get the property default value ( TypedArray<Image> ImageTexture3D::_get_images() const {
TypedArray<Image> images;
if (texture.is_valid()) {
Vector<Ref<Image>> raw_images = get_data();
ERR_FAIL_COND_V(raw_images.is_empty(), TypedArray<Image>());
for (int i = 0; i < raw_images.size(); i++) {
images.push_back(raw_images[i]);
}
}
return images;
} ImageTextureLayered might possibly need a similar check if used in a same manner as the ImageTexture3D in the issue code snippet, but that would need some more testing and is a bit out of scope of this PR. Kind of speculating here, so needs testing for confirmation. |
5d998a9
to
d9d2bb3
Compare
Thanks! It solved my problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me. This isn't really my area of expertise, but I also tested locally and it appears to work fine.
Thanks! |
Fixes #80866
In the issue comment, @clayjohn posted a partially working diff to support ImageTexture3D serilization. I took it and modifed the code to make it work correctly (at least in the MRP provided).
If anyone needs this function, feel free to take it and help test this code. I would appreciate any feedback or alternative suggestions.