Add-ons: Import-Export: Atomic Blender PDB/XYZ division error #105322

Closed
opened 2024-05-09 14:32:36 +02:00 by Byeongyoon-Kim · 7 comments

System Information
Operating system: Windows-10-10.0.22631-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 4060/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 552.22

Blender Version
Broken: version: version: 4.0.2, branch: blender-v4.0-release, commit date: 2023-12-05 07:41, hash: 9be62e85b727
Worked: (newest version of Blender that worked as expected)

Addon Information
Name: Atomic Blender PDB/XYZ (1, 8, 1)
Author: Clemens Barth

Short description of error

Dear developer.
When I imported the attached file 'Cabon monooxide_v1.pdb with the addon, it showed error massage below.

Python: Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\addons\io_mesh_atomic\pdb_gui.py", line 203, in execute
    import_pdb(self.ball,
  File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\addons\io_mesh_atomic\pdb_import.py", line 1542, in import_pdb
    sticks = draw_sticks_dupliverts(all_atoms,
  File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\addons\io_mesh_atomic\pdb_import.py", line 863, in draw_sticks_dupliverts
    n_b   = b / b.length
ZeroDivisionError: Vector division: divide by zero error

Then, I found by chance that slight differenct coordinations with same structure works without error: the attached 'Carbon monooxide_v2.pdb' file. Whether I turn on the 'bonds' option or not.

In another case, the attached 'acetonitirile3_cd_ob.pdb' file only works without checking 'bonds' in import option (the option for double and triple bonds). with enabling the option, it resulting the following error:

Python: Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\addons\io_mesh_atomic\pdb_gui.py", line 203, in execute
    import_pdb(self.ball,
  File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\addons\io_mesh_atomic\pdb_import.py", line 1423, in import_pdb
    all_sticks = read_pdb_file_sticks(filepath_pdb,
  File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\addons\io_mesh_atomic\pdb_import.py", line 429, in read_pdb_file_sticks
    dist_n = dist_n / dist_n.length
ZeroDivisionError: Vector division: divide by zero error

I have failed to figure out the solution in my ability. Please check this issue.
Many thanks,

Sincerely yours,

Exact steps for others to reproduce the error
The error have been reproduced with newely installed blender 4.0 and 4.1 either. and distinct PCs. newely installed blender opened, check addon 'atomic blender PDB/XYZ' in preference, file-import-PDB, then import the attached file with default options.

**System Information** Operating system: Windows-10-10.0.22631-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 4060/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 552.22 **Blender Version** Broken: version: version: 4.0.2, branch: blender-v4.0-release, commit date: 2023-12-05 07:41, hash: `9be62e85b727` Worked: (newest version of Blender that worked as expected) **Addon Information** Name: Atomic Blender PDB/XYZ (1, 8, 1) Author: Clemens Barth **Short description of error** Dear developer. When I imported the attached file 'Cabon monooxide_v1.pdb with the addon, it showed error massage below. ``` Python: Traceback (most recent call last): File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\addons\io_mesh_atomic\pdb_gui.py", line 203, in execute import_pdb(self.ball, File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\addons\io_mesh_atomic\pdb_import.py", line 1542, in import_pdb sticks = draw_sticks_dupliverts(all_atoms, File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\addons\io_mesh_atomic\pdb_import.py", line 863, in draw_sticks_dupliverts n_b = b / b.length ZeroDivisionError: Vector division: divide by zero error ``` Then, I found by chance that slight differenct coordinations with same structure works without error: the attached 'Carbon monooxide_v2.pdb' file. Whether I turn on the 'bonds' option or not. In another case, the attached 'acetonitirile3_cd_ob.pdb' file only works without checking 'bonds' in import option (the option for double and triple bonds). with enabling the option, it resulting the following error: ``` Python: Traceback (most recent call last): File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\addons\io_mesh_atomic\pdb_gui.py", line 203, in execute import_pdb(self.ball, File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\addons\io_mesh_atomic\pdb_import.py", line 1423, in import_pdb all_sticks = read_pdb_file_sticks(filepath_pdb, File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\addons\io_mesh_atomic\pdb_import.py", line 429, in read_pdb_file_sticks dist_n = dist_n / dist_n.length ZeroDivisionError: Vector division: divide by zero error ``` I have failed to figure out the solution in my ability. Please check this issue. Many thanks, Sincerely yours, **Exact steps for others to reproduce the error** The error have been reproduced with newely installed blender 4.0 and 4.1 either. and distinct PCs. newely installed blender opened, check addon 'atomic blender PDB/XYZ' in preference, file-import-PDB, then import the attached file with default options.
Byeongyoon-Kim added the
Status
Needs Triage
Priority
Normal
Type
Report
labels 2024-05-09 14:32:37 +02:00
Member

Hi, thanks for the report. Can confirm
@Blendphys 👋

Hi, thanks for the report. Can confirm @Blendphys 👋
Member

Dear @Byeongyoon-Kim and @PratikPB2123.

I confirm this error. It seems that the bonds should not be in the XY plane (and other planes also?) ... so, as an emergency solution, just turn the molecule a little bit in the PDB file.

I will deal with this in the next days. Please, be patient: I have to re-build Blender from scratch ... ;-).

Cheers.

Dear @Byeongyoon-Kim and @PratikPB2123. I confirm this error. It seems that the bonds should not be in the XY plane (and other planes also?) ... so, as an emergency solution, just turn the molecule a little bit in the PDB file. I will deal with this in the next days. Please, be patient: I have to re-build Blender from scratch ... ;-). Cheers.
Member

No problem, thanks for checking :)

No problem, thanks for checking :)
Member

Dear @Byeongyoon-Kim and @PratikPB2123.

I have finished my work, it should run now without any issues.

Note that I could not upload the new version because of a current philosophy change of all Blender add-ons (see here: https://devtalk.blender.org/t/changes-to-add-on-bundling-4-2-onwards/34593) - the repository is read-only so far.

For the newest version of Blender currently under construction (Blender 4.2 and onwards) , I have started to update the add-on in its new repository: https://projects.blender.org/extensions/io_mesh_atomic. There you can see also my commit I have done today.

Fast fix: for all those of you, who work with the current or an older version, just replace 'pdb_import.py' with the new version attached to this message (see below).

Let me know if things work, thx.

Dear @Byeongyoon-Kim and @PratikPB2123. I have finished my work, it should run now without any issues. Note that I could not upload the new version because of a current philosophy change of all Blender add-ons (see here: https://devtalk.blender.org/t/changes-to-add-on-bundling-4-2-onwards/34593) - the repository is read-only so far. For the newest version of Blender currently under construction (Blender 4.2 and onwards) , I have started to update the add-on in its new repository: https://projects.blender.org/extensions/io_mesh_atomic. There you can see also my commit I have done today. Fast fix: for all those of you, who work with the current or an older version, just replace 'pdb_import.py' with the new version attached to this message (see below). Let me know if things work, thx.
Member

@PratikPB2123 , if I forget to close this report, just do it for me ... thx. ;-)

@PratikPB2123 , if I forget to close this report, just do it for me ... thx. ;-)
Member

Thanks. For some reason I'm not able to activate add-on after installing it from extensions platforms :/
Will close as the fix has already been pushed to repo: 1a938c45f1

Thanks. For some reason I'm not able to activate add-on after installing it from extensions platforms :/ Will close as the fix has already been pushed to repo: https://projects.blender.org/extensions/io_mesh_atomic/commit/1a938c45f19affdd9d99ae111b33319fcd8bee62
Blender Bot added
Status
Archived
and removed
Status
Confirmed
labels 2024-05-16 11:15:49 +02:00
Author

Wonderful! You are my hero! Thanks for your commitment.
The replaced pdb_import.py works perfectly 🎉
I also will happily wait for the new Blender 4.2 to be released.

Wonderful! You are my hero! Thanks for your commitment. The replaced pdb_import.py works perfectly 🎉 I also will happily wait for the new Blender 4.2 to be released.
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#105322
No description provided.