Coder Social home page Coder Social logo

Comments (10)

REDxEYE avatar REDxEYE commented on September 9, 2024

Should be fixed by 1474295

from sourceio.

REDxEYE avatar REDxEYE commented on September 9, 2024

Please test and close issue if resolved

from sourceio.

Teajai2 avatar Teajai2 commented on September 9, 2024

I tested commit 1474295. Unfortunately, the issue has not been resolved yet.

MDL v4 Import Error Code w/ 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 53, 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 90, in import_model
    model_vertices = model.vertices * options.scale
                     ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
numpy.core._exceptions._UFuncNoLoopError: ufunc 'multiply' did not contain a loop with signature matching types (dtype([('id', '<u4', (1,)), ('pos', '<f4', (3,))]), dtype('float64')) -> None

MDL v6 Import Error Code w/ 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 53, 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 90, in import_model
    model_vertices = model.vertices * options.scale
                     ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
numpy.core._exceptions._UFuncNoLoopError: ufunc 'multiply' did not contain a loop with signature matching types (dtype([('id', '<u4', (1,)), ('pos', '<f4', (3,))]), dtype('float64')) -> None

from sourceio.

REDxEYE avatar REDxEYE commented on September 9, 2024

c1f9af3 Should fix that, please try again

from sourceio.

Teajai2 avatar Teajai2 commented on September 9, 2024

Tried c1f9af3, still does not work.

Error code for MDL V6, 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 53, 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 30, in from_buffer
    sequences = buffer.read_structure_array(header.sequence_offset, header.sequence_count, StudioSequence)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\teajai\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\SourceIO-master\library\utils\file_utils.py", line 208, in read_structure_array
    obj = data_class.from_buffer(self)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\teajai\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\SourceIO-master\library\models\mdl\v6\structs\sequence.py", line 37, in from_buffer
    ) = buffer.read_fmt('<fI9I')
        ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\teajai\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\SourceIO-master\library\utils\file_utils.py", line 70, in read_fmt
    return unpack(self._endian + fmt, self.read(calcsize(self._endian + fmt)))
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
struct.error: bad char in struct format

Error code for MDL v4, 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 53, 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 119, in import_model
    remap[model_material_index] = load_material(model_name, model_material_index, model_texture_info,
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\teajai\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\SourceIO-master\blender_bindings\models\mdl4\import_mdl.py", line 153, in load_material
    bpy_material.create_nodes(material)
  File "C:\Users\teajai\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\SourceIO-master\blender_bindings\material_loader\shaders\goldsrc_shaders\goldsrc_shader.py", line 29, in create_nodes
    if self._valve_material.flags & MdlTextureFlag.CHROME:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'StudioTexture' object has no attribute 'flags'

from sourceio.

REDxEYE avatar REDxEYE commented on September 9, 2024

Try now

from sourceio.

Teajai2 avatar Teajai2 commented on September 9, 2024

Same error messages as before. Interestingly, I took a look at some older versions of the addon and found that they also can't import these older MDL files into the newest version of Blender anymore — it only imports their skeletons.

MDL V6

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 53, 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 30, in from_buffer
    sequences = buffer.read_structure_array(header.sequence_offset, header.sequence_count, StudioSequence)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\teajai\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\SourceIO-master\library\utils\file_utils.py", line 208, in read_structure_array
    obj = data_class.from_buffer(self)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\teajai\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\SourceIO-master\library\models\mdl\v6\structs\sequence.py", line 37, in from_buffer
    ) = buffer.read_fmt('<fI9I')
        ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\teajai\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\SourceIO-master\library\utils\file_utils.py", line 70, in read_fmt
    return unpack(self._endian + fmt, self.read(calcsize(self._endian + fmt)))
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
struct.error: bad char in struct format

MDL V4

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 53, 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 119, in import_model
    remap[model_material_index] = load_material(model_name, model_material_index, model_texture_info,
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\teajai\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\SourceIO-master\blender_bindings\models\mdl4\import_mdl.py", line 153, in load_material
    bpy_material.create_nodes(material)
  File "C:\Users\teajai\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\SourceIO-master\blender_bindings\material_loader\shaders\goldsrc_shaders\goldsrc_shader.py", line 29, in create_nodes
    if self._valve_material.flags & MdlTextureFlag.CHROME:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'StudioTexture' object has no attribute 'flags'

from sourceio.

REDxEYE avatar REDxEYE commented on September 9, 2024

Can you just drop me mdl v4 and v6 so I can test locally?

from sourceio.

Teajai2 avatar Teajai2 commented on September 9, 2024

Sure thing, here you go.
0.52 Alpha Models.zip

In addition, here's a link to a copy of the 0.52 Prototype these files originate from, if that might be of help to you.

from sourceio.

REDxEYE avatar REDxEYE commented on September 9, 2024

4cdd1d6 should fix your issues

from sourceio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.