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

After using the export to DDS, Blender freezes when closing. #10

Closed
SNamiris opened this issue Oct 17, 2023 · 7 comments · Fixed by #12
Closed

After using the export to DDS, Blender freezes when closing. #10

SNamiris opened this issue Oct 17, 2023 · 7 comments · Fixed by #12
Labels
bug Something isn't working

Comments

@SNamiris
Copy link

windows10
blender3.6
If I modify texconv.py to unload the DLL immediately after converting the file, Blender still freezes. Idk if the dll cause the problem?
Additionally, when exporting to BC7 sRGB, the color becomes lighter even if the original format is BC7 sRGB. Only if I choose BC7, it works.

@matyalatte
Copy link
Owner

Thanks for the report.
I confirmed it on Blender3.0 and 3.6.
This will happen when using GPU via the DLL.
I mean, Blender will crash with the unloading after exporting BC6 or BC7 textures.
Idk how to fix it for now, but I'll look into it.

when exporting to BC7 sRGB, the color becomes lighter

I noticed texconv required an option to disable the colorspace conversion.
I opened a new issue for it and I'll fix it later.
#11

@matyalatte
Copy link
Owner

matyalatte commented Oct 18, 2023

As a workaround, you can disable the unloading like this.

# blender_dds_addon/__init__.py
def unregister():
    """Remove addon."""
    for module in modules:
        module.unregister()
    # unload_texconv()

It's not a good way to fix becuase you can't remove the addon while loading the DLL.
You will get an error when uninstalling the addon after using it.
But you won't get the crash at least.

@SNamiris
Copy link
Author

As a workaround, you can disable the unloading like this.

# blender_dds_addon/__init__.py
def unregister():
    """Remove addon."""
    for module in modules:
        module.unregister()
    # unload_texconv()

It's not a good way to fix becuase you can't remove the addon while loading the DLL. You will get an error when uninstalling the addon after using it. But you won't get the crash at least.

Thank you!It works

@matyalatte
Copy link
Owner

I fixed the issues. Can you test if it'll work as you expected or not?
blender_dds_addon_efad51f_Windows.zip

The crash when closing was fixed at matyalatte/Texconv-Custom-DLL@a9d196f.
The sRGB issue was fixed at 5cf72c1.
And the addon will release DLL resources after conversion. (0db4c68)

@SNamiris
Copy link
Author

SNamiris commented Oct 22, 2023

I fixed the issues. Can you test if it'll work as you expected or not? blender_dds_addon_efad51f_Windows.zip

The crash when closing was fixed at matyalatte/Texconv-Custom-DLL@a9d196f. The sRGB issue was fixed at 5cf72c1. And the addon will release DLL resources after conversion. (0db4c68)

It can't export dds.
image
It seems the dll doesn't work?

@matyalatte
Copy link
Owner

Sorry, I updated DirectXTex to the April 2023 release. and it had a bug.
I tested it with BC1_UNORM_SRGB and BC7_UNORM when I fixed the sRGB issue.
But it won't work with BC7_UNORM_SRGB lol
microsoft/DirectXTex#378

So, I updated the library to the September 2023 release.

Can you try the updated version? It should work.
blender_dds_addon_9b6d23f_Windows.zip

@SNamiris
Copy link
Author

Sorry, I updated DirectXTex to the April 2023 release. and it had a bug. I tested it with BC1_UNORM_SRGB and BC7_UNORM when I fixed the sRGB issue. But it won't work with BC7_UNORM_SRGB lol microsoft/DirectXTex#378

So, I updated the library to the September 2023 release.

Can you try the updated version? It should work. blender_dds_addon_9b6d23f_Windows.zip

It now works with BC7_UNORM_SRGB. Thank you for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants