REDxEYE / SourceIO

SourceIO is an Blender(3.4+) addon for importing source engine textures/models/maps
https://discord.gg/XJvhzaXZf3
MIT License
611 stars 54 forks source link

IsADirectoryError: [Errno 21] when importing MDL #168

Closed othello777 closed 1 year ago

othello777 commented 1 year ago

Hi, I'm trying to import the V1 model from /home/othello7/Documents/Ultrakill_SFM/models/ultrakill/v1.mdl V1 model: https://nitter.net/ULTRAKILLGame/status/1276646762539896837

but I get this error:

Python: Traceback (most recent call last):
  File "/home/othello7/.config/blender/3.3/scripts/addons/SourceIO/blender_bindings/operators/source1_operators.py", line 56, in execute
    model_container = import_model_from_full_path(mdl_path, self.scale, self.create_flex_drivers,
  File "/home/othello7/.config/blender/3.3/scripts/addons/SourceIO/blender_bindings/source1/mdl/model_loader.py", line 46, in import_model_from_full_path
    return import_model_from_files(str(name), mdl_path, vvd_file, vtx_file, vvc_file, scale, create_drives,
  File "/home/othello7/.config/blender/3.3/scripts/addons/SourceIO/blender_bindings/source1/mdl/model_loader.py", line 81, in import_model_from_files
    container = import_model_v49(mdl_file, vvd_file, vtx_file, None, scale, create_drives, re_use_meshes,
  File "/home/othello7/.config/blender/3.3/scripts/addons/SourceIO/blender_bindings/source1/mdl/v49/import_mdl.py", line 145, in import_model
    vtx = Vtx(vtx_file)
  File "/home/othello7/.config/blender/3.3/scripts/addons/SourceIO/library/source1/vtx/v6/vtx.py", line 13, in __init__
    self.reader = ByteIO(filepath)
  File "/home/othello7/.config/blender/3.3/scripts/addons/SourceIO/library/utils/byte_io_mdl.py", line 33, in __init__
    self.file = open(path_or_file_or_data, mode)
IsADirectoryError: [Errno 21] Is a directory: '/home/othello7/Documents/Ultrakill_SFM/models/ultrakill'

Everything is the latest update.

REDxEYE commented 1 year ago

Imported fine for me. I need more time to investigate

othello777 commented 1 year ago

My system specs in case it's helpful:

Linux Mint upgraded to 22.10 packages
blender 3.3.1 downloaded from the blender website
Sourceio 4.0.3

and there are several layers of symbolic links in the path to the file.

CmdrMaylee commented 1 year ago

I am personally getting an identical error from what I can tell, every source model .mdl I've tried to import thus far end up in the same IsADirectoryError. As a sidenote, an excplicit install of Python 3.8 was required to enable the plug-in after installation, otherwise a missing dependency of py3.8 libs would occur. Probably has nothing to do with anything in this particular error, but may be worth mentioning just in case. This was tested on Arch Linux with the latest Blender 3.3.1 from the official package repo alongside 4.0.3 of SourceIO. An attempt on the windows partition might be in order to check for the potential of an OS anomaly.

REDxEYE commented 1 year ago

I've made an attempt to fix it. Try with version from master

REDxEYE commented 1 year ago

And it it crash again, provide full console log

CmdrMaylee commented 1 year ago

Ace fixing mate, top marks! Loading in the same models from before now works a charm! Sorry to say however that the next step of loading in the textures for said models leads to a somewhat similar error. Unfortunately I cannot tell at a glance whether this is user error or not.

[INFO]--[Source1::VTF:import_texture]: Loading "wings.vtf" texture
Traceback (most recent call last):
  File "/home/maylee/.config/blender/3.3/scripts/addons/SourceIO/blender_bindings/operators/source1_operators.py", line 211, in execute
    import_texture(file.name, (directory / file.name).open('rb'), True)
  File "/home/maylee/.config/blender/3.3/scripts/addons/SourceIO/blender_bindings/source1/vtf/__init__.py", line 18, in import_texture
    rgba_data, image_width, image_height = load_texture(file_object)
  File "/home/maylee/.config/blender/3.3/scripts/addons/SourceIO/library/source1/vtf/__init__.py", line 33, in load_texture
    vtf_lib = VTFLib.VTFLib()
  File "/home/maylee/.config/blender/3.3/scripts/addons/SourceIO/library/source1/vtf/VTFWrapper/VTFLib.py", line 79, in __init__
    self.vtflib_cdll = self.load_dll()
  File "/home/maylee/.config/blender/3.3/scripts/addons/SourceIO/library/source1/vtf/VTFWrapper/VTFLib.py", line 345, in load_dll
    return cdll.LoadLibrary(os.path.join(full_path, vtf_lib_name))
  File "/usr/lib/python3.10/ctypes/__init__.py", line 452, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libtxc_dxtn.so: cannot open shared object file: No such file or directory

Many thanks for what you've done thus far though! :100:

REDxEYE commented 1 year ago

It's weird to see stack trace to system python instead of blender bundled

REDxEYE commented 1 year ago

@othello777 please take a look at https://github.com/REDxEYE/SourceIO/issues/156 and https://github.com/REDxEYE/SourceIO/issues/88 you can find solution to your problem there