zanoni-mbdyn / blendyn

MBDyn (https://www.mbdyn.org/) graphical post-processor for blender (https://www.blender.org/)
GNU General Public License v2.0
40 stars 8 forks source link

Type error occured while trying to load .log files to Blendyn interface on Blender #48

Closed TranHuuNhatHuy closed 2 years ago

TranHuuNhatHuy commented 2 years ago

Describe problem:

An error popped up when I tried to load .log file after importing .mov file, as shown below:

Python: Traceback (most recent call last):
    File "/home/tranhuunhathuy/.config/blender/3.1/scripts/addons/blendyn-master/blendyn.py", line 931, in invoke
        return self.execute(context)
    File "/home/tranhuunhathuy/.config/blender/3.1/scripts/addons/blendyn-master/blendyn.py", line 866, in execute
        ret_val, obj_names = parse_log_file(context)
    File "/home/tranhuunhathuy/.config/blender/3.1/scripts/addons/blendyn-master/baselib.py", line 384, in parse_log_file
        mbs.num_timesteps = mbs.num_rows/mbs.num_nodes
    TypeError: bpy_struct: item.attr = val: BLENDYN_PG_settings_scene.num_timesteps expected an int type, not float

        location: <unknown location>:-1

Conditions to reproduce:

Steps to reproduce:

  1. Take one input file from MBDyn examples and run simulation with MBDyn.
  2. On Blendyn interface, import .mov output file by clicking Select results file.
  3. Click Load .log file.

Verified solution:

Force type-cast to int for mbs.num_timesteps.

zanoni-mbdyn commented 2 years ago

Thank you for the feedback. Should be fixed in 38a855b2eeacb27f88ab3e042fd4fe1b5622e959, in branch bugfix. Please test and report.