ArchLeaders / MubinImporter

1 stars 0 forks source link

won't run on linux (arch) #1

Open Lepidopteran opened 2 years ago

Lepidopteran commented 2 years ago

I use Linux for blender and tried running this plugin on my PC which runs Linux, but every time I try to enable it gives me this error

Traceback (most recent call last):
  File "/usr/user/blender/3.0/scripts/modules/addon_utils.py", line 351, in enable
    mod = __import__(module_name)
  File "/home/user/.config/blender/3.0/scripts/addons/mubin_importer/__init__.py", line 15, in <module>
    from .interface import IMPORT_MUBIN_DEPS_OT_install, IMPORT_MUBIN_SCENE_OT_smubin, TOOL_PT_MubinImporter
  File "/home/user/.config/blender/3.0/scripts/addons/mubin_importer/interface.py", line 12, in <module>
    from .importer import import_mubin
  File "/home/user/.config/blender/3.0/scripts/addons/mubin_importer/importer.py", line 8, in <module>
    Data.init()
  File "/home/user/.config/blender/3.0/scripts/addons/mubin_importer/io/system.py", line 21, in init
    Data.data_dir = json.loads(Path(f'{os.environ["LOCALAPPDATA"]}\\mubin_importer\\config.json').read_text())['data_dir']
  File "/usr/lib/python3.10/os.py", line 679, in __getitem__
    raise KeyError(key) from None
KeyError: 'LOCALAPPDATA'

I don't know what LOCALAPPDATA is. but I'm guessing it's something to do with windows any suggestions?

ArchLeaders commented 2 years ago

You are correct, LOCALAPPDATA is a windows environment variable. I don't know much about Linux, but you try could installing wine (if you haven't already) and see if that works. Otherwise, I will try to add support for Linux environments in the future.

Lepidopteran commented 2 years ago

I will try to add support for Linux environments in the future.

That would be great! Thank you

Lepidopteran commented 2 years ago

but you try could installing wine (if you haven't already) and see if that works.

I'm not sure how i would install the blender addon through wine

ArchLeaders commented 2 years ago

but you try could installing wine (if you haven't already) and see if that works.

I'm not sure how i would install the blender addon through wine

I don't know how wine works, but I would assume you would have to install Blender through wine and then install the addon in that Blender install.

Lepidopteran commented 2 years ago

I launched blender through wine. after that i installed the add-on successfully, I clicked Install Dependencies and got this this error:

Python: Traceback (most recent call last):
  File "Z:\home\user\Downloads\blender-3.0.1-windows-x64\3.0\python\lib\shutil.py", line 814, in move
    os.rename(src, real_dst)
FileNotFoundError: [WinError 2] File not found: 'C:\\users\\user\\Downloads\\blender-3.0.1-windows-x64\\export' -> 'C:\\users\\user\\Downloads\\blender-3.0.1-windows-x64\\exported'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\users\user\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\mubin_importer\interface.py", line 82, in execute
    shutil.move(f'{Data.data_dir}\\export', f'{Data.data_dir}\\exported')
  File "Z:\home\user\Downloads\blender-3.0.1-windows-x64\3.0\python\lib\shutil.py", line 834, in move
    copy_function(src, real_dst)
  File "Z:\home\user\Downloads\blender-3.0.1-windows-x64\3.0\python\lib\shutil.py", line 443, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "Z:\home\user\Downloads\blender-3.0.1-windows-x64\3.0\python\lib\shutil.py", line 265, in copyfile
    with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\users\\user\\Downloads\\blender-3.0.1-windows-x64\\export'

location: <unknown location>:-1
Lepidopteran commented 2 years ago

manually created the export folder. This seems to fix the Install Dependencies Error

Lepidopteran commented 2 years ago

Tried importing a smubin file. Got the following error

  File "C:\users\user\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\mubin_importer\interface.py", line 31, in execute
    import_mubin(Path(self.filepath), context, self.import_shader)
  File "C:\users\user\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\mubin_importer\importer.py", line 167, in import_mubin
    for actor in data.content['Objs']:
SystemError: <built-in method __next__ of PyCapsule object at 0x0000000012096840> returned NULL without setting an error

location: <unknown location>:-1
ArchLeaders commented 2 years ago

I launched blender through wine. after that i installed the add-on successfully, I clicked Install Dependencies and got this this error:

Python: Traceback (most recent call last):
  File "Z:\home\user\Downloads\blender-3.0.1-windows-x64\3.0\python\lib\shutil.py", line 814, in move
    os.rename(src, real_dst)
FileNotFoundError: [WinError 2] File not found: 'C:\\users\\user\\Downloads\\blender-3.0.1-windows-x64\\export' -> 'C:\\users\\user\\Downloads\\blender-3.0.1-windows-x64\\exported'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\users\user\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\mubin_importer\interface.py", line 82, in execute
    shutil.move(f'{Data.data_dir}\\export', f'{Data.data_dir}\\exported')
  File "Z:\home\user\Downloads\blender-3.0.1-windows-x64\3.0\python\lib\shutil.py", line 834, in move
    copy_function(src, real_dst)
  File "Z:\home\user\Downloads\blender-3.0.1-windows-x64\3.0\python\lib\shutil.py", line 443, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "Z:\home\user\Downloads\blender-3.0.1-windows-x64\3.0\python\lib\shutil.py", line 265, in copyfile
    with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\users\\user\\Downloads\\blender-3.0.1-windows-x64\\export'

location: <unknown location>:-1

This is because the addon fails to run a Windows x64 executable that creates the export folder with required files. And therefore the folder does not exist in the expected location.

ArchLeaders commented 2 years ago

Tried importing a smubin file. Got the following error

  File "C:\users\user\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\mubin_importer\interface.py", line 31, in execute
    import_mubin(Path(self.filepath), context, self.import_shader)
  File "C:\users\user\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\mubin_importer\importer.py", line 167, in import_mubin
    for actor in data.content['Objs']:
SystemError: <built-in method __next__ of PyCapsule object at 0x0000000012096840> returned NULL without setting an error

location: <unknown location>:-1

No idea what that's about, sorry.