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

IsADirectoryError: [Errno 21] when importing MDL #168

Closed
othello777 opened this issue Oct 13, 2022 · 8 comments
Closed

IsADirectoryError: [Errno 21] when importing MDL #168

othello777 opened this issue Oct 13, 2022 · 8 comments

Comments

@othello777
Copy link

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
Copy link
Owner

REDxEYE commented Oct 13, 2022

Imported fine for me. I need more time to investigate

@othello777
Copy link
Author

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
Copy link

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
Copy link
Owner

REDxEYE commented Nov 3, 2022

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

@REDxEYE
Copy link
Owner

REDxEYE commented Nov 3, 2022

And it it crash again, provide full console log

@CmdrMaylee
Copy link

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! 💯

@REDxEYE
Copy link
Owner

REDxEYE commented Nov 4, 2022

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

@REDxEYE
Copy link
Owner

REDxEYE commented Dec 13, 2022

@othello777 please take a look at #156 and #88 you can find solution to your problem there

@REDxEYE REDxEYE closed this as completed Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants