Skip to content

GoldSrc MDL V4 and V6 cannot import into Blender v4.1, w/ SourceIO v5.3.0 #281

@Teajai2

Description

@Teajai2

MDL versions 4 and 6 no longer import on Blender v4.1, using the SourceIO v5.3.0 plugin. Regular GoldSrc models still import fine.

While fixing this would understandably not be a high priority, given the limited uses for importing v4 and v6 models, importing these files would still be a nice luxury to have given that this is currently the only method of converting v4 models into any kind of decompilable format.

MDL v4 error code when trying to open the 0.52 Half-Life 1 prototype's "hsarge.mdl":

Python: Traceback (most recent call last):
File "C:\Users\teajai\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\SourceIO-master\blender_bindings\operators\source1_operators.py", line 51, in execute
model_container = import_model(mdl_path, f, content_manager, self, None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\teajai\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\SourceIO-master\blender_bindings\models_init_.py", line 30, in import_model
container = handler(model_path, buffer, content_manager, options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\teajai\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\SourceIO-master\blender_bindings\models\mdl4_init_.py", line 14, in import_mdl4
return import_model(model_path.stem, buffer, options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\teajai\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\SourceIO-master\blender_bindings\models\mdl4\import_mdl.py", line 71, in import_model
mdl = Mdl.from_buffer(mdl_buffer)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\teajai\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\SourceIO-master\library\models\mdl\v4\mdl_file.py", line 40, in from_buffer
assert total_model_count == header.unk_count,
^^^^^^^^^^^^^^^^
AttributeError: 'StudioHeader' object has no attribute 'unk_count'. Did you mean: 'bone_count'?_

MDL v6 error code when trying to open the 0.52 Half-Life 1 prototype's "hgrunt.mdl":

Python: Traceback (most recent call last):
File "C:\Users\teajai\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\SourceIO-master\blender_bindings\operators\source1_operators.py", line 51, in execute
model_container = import_model(mdl_path, f, content_manager, self, None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\teajai\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\SourceIO-master\blender_bindings\models_init
.py", line 30, in import_model
container = handler(model_path, buffer, content_manager, options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\teajai\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\SourceIO-master\blender_bindings\models\mdl6_init_.py", line 17, in import_mdl6
return import_model(buffer, texture_mdl, options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\teajai\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\SourceIO-master\blender_bindings\models\mdl6\import_mdl.py", line 66, in import_model
mdl = Mdl.from_buffer(mdl_file)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\teajai\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\SourceIO-master\library\models\mdl\v6\mdl_file.py", line 26, in from_buffer
header = StudioHeader.from_buffer(buffer)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\teajai\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\SourceIO-master\library\models\mdl\v6\structs\studioheader.py", line 60, in from_buffer
return cls(version, name, file_size, *hdr_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: StudioHeader.init() missing 2 required positional arguments: 'body_part_count' and 'body_part_offset'_

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions