lasa01 / Plumber

A Blender addon for importing Source 1 engine maps, models, materials and textures. This addon makes it possible to import full CS:GO, TF2, CS:S or other Source 1 game maps into Blender.
MIT License
389 stars 30 forks source link

Doesnt work in blender 4.1 #184

Closed Fennecai closed 1 month ago

Fennecai commented 2 months ago

Describe the bug due to the removal of the auto smoothing feature in blender 4.1, in favor of a modifier that does the same thing (smooth by angle modifier), this addon no longer works on model importing.

To Reproduce Steps to reproduce the behavior:

  1. import a vmf or model in blender 4.1
  2. see the errors

Expected behavior i expected the models/vmf to import correctly, but they dont import at all.

Related files it does this with any mdl or vmf containing models, so...

Logs

AttributeError: 'Mesh' object has no attribute 'use_auto_smooth'
[Plumber] [ERROR] Asset importing errored: AttributeError: 'Mesh' object has no attribute 'use_auto_smooth'
Traceback (most recent call last):
  File "C:\Users\[REDACTED]\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\plumber\asset\__init__.py", line 61, in model
    self.model_tracker.import_model(model, self.prop_collection)
  File "C:\Users\[REDACTED]\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\plumber\asset\model.py", line 80, in import_model
    mesh_obj = import_mesh(
               ^^^^^^^^^^^^
  File "C:\Users\[REDACTED]\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\plumber\asset\model.py", line 176, in import_mesh
    mesh_data.use_auto_smooth = True
    ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Mesh' object has no attribute 'use_auto_smooth'
[Plumber] [ERROR] Asset importing errored: AttributeError: 'Mesh' object has no attribute 'use_auto_smooth'
[Plumber] [INFO] vmf imported in 4.71 s
Info: Deleted 1 object(s)

Screenshots Not applicable, theres nothing there because it doesnt import.

Details (please complete the following information):

Additional context im suprised nobody has reported this yet.

lazyRares commented 2 months ago

Ah, so that's why it's doing that. I was getting the error myself but I was not sure on the cause of it. Thankfully you have discovered it though, hope to see this fixed eventually.

Fennecai commented 2 months ago

I fixed it by editing the script on my end. my fix maybe isnt up to the best coding practices since i have very little experience in python (just in other languages) but it works without any issues.

i dont know how pull requests work or even what they are really, so if anybody wants my patch before the addon is patched officially, here is my modified version of plumber/asset/model.py

https://mega.nz/folder/omwBQK4A#BGzm5qmKftDSYOuPWurVrw

lasa01 commented 1 month ago

This is fixed in the latest release.