matyalatte / blender-dds-addon Goto Github PK
View Code? Open in Web Editor NEWBlender addon to import and export dds textures
License: MIT License
Blender addon to import and export dds textures
License: MIT License
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.
Blender 3.5, got this error importing texture below.
RuntimeError: Failed to get Image Editor. This is unexpected.
Traceback (most recent call last):
File "\addons\blender_dds_addon\ui\import_dds.py", line 166, in execute_base
import_dds(context, os.path.join(directory, file.name))
File "\addons\blender_dds_addon\ui\import_dds.py", line 123, in import_dds
space = get_image_editor_space(context)
File "\addons\blender_dds_addon\ui\bpy_util.py", line 24, in get_image_editor_space
raise RuntimeError('Failed to get Image Editor. This is unexpected.')
RuntimeError: Failed to get Image Editor. This is unexpected.
Game: Helldivers 2
Texture Type: Material LUT
Imported Format: RGBA16 UNORM
*DM Sent As Well, So You Know
Blender supports ARM64 chips for macOS. (e.g. Apple M1)
But the DDS addon will raise an error (be56016) for them because libtexconv.dylib
was built for x64.
It's possible to build the ARM64 version but I don't have mac for testing.
Please comment if you want the ARM64 build and you can test it with Apple silicon.
I'll upload it on this thread.
Related to #10.
Here is an example. The second image is the exported one.
Texconv seems to do the colorspace conversion if the DXGI format is *_SRGB
.
We have to disable it with the colorspace options.
But the custom build of texconv doesn't support the options.
So, we need to rebuild the DLL to restore them.
I got two warnings when importing dds in GIMP.
It uses DDSD_PITCH when it should use DDSD_LINEARSIZE.
And it uses DDSD_LINEARSIZE when it should use DDSD_PITCH.
dds.py says
class DDS_FLAGS(IntEnum):
PITCH = 0x8 # Use "w * h * bpp" for pitch_or_linear_size
LINEARSIZE = 0x80000 # Use "w * bpp" for pitch_or_linear_size
but it should be
class DDS_FLAGS(IntEnum):
PITCH = 0x8 # Use "w * bpp" for pitch_or_linear_size
LINEARSIZE = 0x80000 # Use "w * h * bpp" for pitch_or_linear_size
Most of dds libraries don't care the flags but this should be fixed.
I noticed the addon will cause a segfault on Ubuntu22.04 with Blender versions older than or equal to 3.2.
I think it's a Blender issue posted here
Segfault on Linux when running third party Python library function with multithreading enabled
If you get the same problem, try to update your Blender to 3.3 or later.
Just a simple thing, DDS arrays with mipmaps do not import due to being 'unexpected'.
Blender 4.1 got APIs for drag-drop events.
https://docs.blender.org/api/current/bpy.types.FileHandler.html
You can't overwrite the drag-drop events on the image editor.
But you can add a new event to the DDS panel.
def is_dds_panel(context):
return (context.area and context.area.type == 'IMAGE_EDITOR'
and context.region and context.region.type == 'UI'
and context.region.active_panel_category == 'DDS')
class DDS_FH_import(bpy.types.FileHandler):
bl_idname = "DDS_FH_import"
bl_label = "File handler for dds import"
bl_import_operator = "dds.import_dds"
bl_file_extensions = ".dds"
@classmethod
def poll_drop(cls, context):
return is_dds_panel(context)
It means, you can drop dds files on the addon's panel to import them.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.