Unable to import PDB file using PDB/XYZ addon #94008

Closed
opened 2021-12-13 10:23:21 +01:00 by dadel · 16 comments

System Information
Operating system: Linux-5.4.0-91-generic-x86_64-with-glibc2.31 #102-Ubuntu SMP Fri Nov 5 16:31:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Graphics card:

Blender Version
Broken: io_mesh_atomic addon in blender 3.0.0, branch: master, commit date: 2021-12-02 18:35, hash: f1cca3055776, type: release
Python version: 3.9.7 (default, Oct 11 2021, 10:06:01) [GCC 9.3.1 20200408 (Red Hat 9.3.1-2)]

Short description of error
Importing a PDB file failes because of the use of a not assigned variable in the python script.

Exact steps for others to reproduce the error
When trying to import a PDB file generated by OpenBabel, the following error arises:
{F12736494, size=full}

The source code uses the variable line that is actually a local loop variable in the previous block as you can see:

{F12736503, size=full}

**System Information** Operating system: Linux-5.4.0-91-generic-x86_64-with-glibc2.31 #102-Ubuntu SMP Fri Nov 5 16:31:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux Graphics card: **Blender Version** Broken: io_mesh_atomic addon in blender 3.0.0, branch: master, commit date: 2021-12-02 18:35, hash: f1cca3055776, type: release Python version: 3.9.7 (default, Oct 11 2021, 10:06:01) [GCC 9.3.1 20200408 (Red Hat 9.3.1-2)] **Short description of error** Importing a PDB file failes because of the use of a not assigned variable in the python script. **Exact steps for others to reproduce the error** When trying to import a PDB file generated by OpenBabel, the following error arises: {[F12736494](https://archive.blender.org/developer/F12736494/Capture_d_écran_de_2021-12-13_09-50-36.png), size=full} The source code uses the variable `line` that is actually a local loop variable in the previous block as you can see: {[F12736503](https://archive.blender.org/developer/F12736503/Capture_d_écran_de_2021-12-13_10-19-50.png), size=full}
Author

Added subscriber: @dadel

Added subscriber: @dadel
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Hi, thanks for the report. Seems broken from the very first revision.

Can confirm. (Will check if I can fix this)

When trying to import a PDB file generated by OpenBabel, the following error arises:

I import the exported file from blender and still it appeared (Which is expected because line is used away from the for loop scope)

Hi, thanks for the report. Seems broken from the very first revision. Can confirm. (Will check if I can fix this) > When trying to import a PDB file generated by OpenBabel, the following error arises: I import the exported file from blender and still it appeared (Which is expected because line is used away from the for loop scope)
Member

Added subscriber: @Blendphys

Added subscriber: @Blendphys
Member

The source code uses the variable line that is actually a local loop variable in the previous block as you can see:

Changing the scope does not fix importing issue here (may be I am doing some mistake).
Hi @Blendphys, can you look at this?

> The source code uses the variable line that is actually a local loop variable in the previous block as you can see: Changing the scope does not fix importing issue here (may be I am doing some mistake). Hi @Blendphys, can you look at this?
Member

Hi all.

It seems that there is an issue with the file pointer 'filepath_pdb_p' since 'line' has no value from the beginning of the loop.
Hmm, I have Blender version 3.0 on a different computer and will deal with this on Monday. I keep you informed. Please, be patient ... ;-)

PS: Please, can you send the PDB file which you were using? Thanks.

Hi all. It seems that there is an issue with the file pointer 'filepath_pdb_p' since 'line' has no value from the beginning of the loop. Hmm, I have Blender version 3.0 on a different computer and will deal with this on Monday. I keep you informed. Please, be patient ... ;-) PS: Please, can you send the PDB file which you were using? Thanks.
Member

Dear Dadel and Patrik.

I tested a dozen of PDB and some XYZ files: there is no problem, I can import all structures.

To proceed, I would like to have your PDB files, Dadel and Pratik. With this, I can then check what is going on. Below, you find some specifications of the system, which I'm using.

.


Blender 3.1.0 Alpha System Information


Blender:


version: 3.1.0 Alpha, branch: master, commit date: 2022-01-03 13:46, hash: a3e634d4d7a3, type: Release
build date: 2022-01-03, 14:30:42
platform: 'Linux-5.4.0-91-generic-x86_64-with-glibc2.27'

Python:


version: 3.9.7 (default, Oct 11 2021, 10:06:01) [GCC 9.3.1 20200408 (Red Hat 9.3.1-2)]
file system encoding: utf-8:surrogateescape

Python (External Binary):


binary path: '/home/cle/blender-git/build_linux/bin/3.1/python/bin/python3.9'
version: Python 3.9.7

GPU:


renderer: 'Quadro RTX 4000/PCIe/SSE2'
vendor: 'NVIDIA Corporation'
version: '4.5.0 NVIDIA 460.91.03'

Cycles:


CPU device capabilities: SSE2 SSE3 SSE41 AVX AVX2
CUDA device capabilities:
Quadro RTX 4000

Dear Dadel and Patrik. I tested a dozen of PDB and some XYZ files: there is no problem, I can import all structures. To proceed, I would like to have your PDB files, Dadel and Pratik. With this, I can then check what is going on. Below, you find some specifications of the system, which I'm using. . **** # Blender 3.1.0 Alpha System Information **** Blender: **** version: 3.1.0 Alpha, branch: master, commit date: 2022-01-03 13:46, hash: a3e634d4d7a3, type: Release build date: 2022-01-03, 14:30:42 platform: 'Linux-5.4.0-91-generic-x86_64-with-glibc2.27' Python: **** version: 3.9.7 (default, Oct 11 2021, 10:06:01) [GCC 9.3.1 20200408 (Red Hat 9.3.1-2)] file system encoding: utf-8:surrogateescape Python (External Binary): **** binary path: '/home/cle/blender-git/build_linux/bin/3.1/python/bin/python3.9' version: Python 3.9.7 GPU: **** renderer: 'Quadro RTX 4000/PCIe/SSE2' vendor: 'NVIDIA Corporation' version: '4.5.0 NVIDIA 460.91.03' Cycles: **** CPU device capabilities: SSE2 SSE3 SSE41 AVX AVX2 CUDA device capabilities: Quadro RTX 4000
Member

Changed status from 'Confirmed' to: 'Needs User Info'

Changed status from 'Confirmed' to: 'Needs User Info'
Member

Bit strange. I was getting traceback earlier. (with same error message: local variable line referenced before assignment)

Now I am seeing different error (I will submit a separate report for it)

Hi @dadel , can you please provide a broken .pdb file?

Bit strange. I was getting traceback earlier. (with same error message: `local variable line referenced before assignment`) Now I am seeing different error (I will submit a separate report for it) Hi @dadel , can you please provide a broken .pdb file?
Member

Patrik, I do not wonder that things do not work considering the other report (https://developer.blender.org/T94292): the user should be in the 'Object' and not in the 'Edit' mode!

Let's hope that we get the PDB file ... .

Patrik, I do not wonder that things do not work considering the other report (https://developer.blender.org/T94292): the user should be in the 'Object' and not in the 'Edit' mode! Let's hope that we get the PDB file ... .

Added subscriber: @scurest

Added subscriber: @scurest

I'm pretty sure this can only happen for an empty .pdb file. Otherwise the for line in filepath_pdb_p loop would have been entered, so line would be assigned.

I'm pretty sure this can only happen for an empty .pdb file. Otherwise the `for line in filepath_pdb_p` loop would have been entered, so line would be assigned.
Member

Small note: I just changed the code such that the user is now always in the 'OBJECT' mode.
See changes: link

PS: Shall we close the thread @PratikPB2123 and @dadel ?

Small note: I just changed the code such that the user is now always in the 'OBJECT' mode. See changes: [link ](https://developer.blender.org/rBA2829c040f488) PS: Shall we close the thread @PratikPB2123 and @dadel ?
Member

Changed status from 'Needs User Info' to: 'Archived'

Changed status from 'Needs User Info' to: 'Archived'
Member

@Blendphys , yes. Will close as we do not have sufficient information (test file).

@scurest , on importing empty pdb file I get ZeroDivisionError (not the same as said in this report).
@dadel feel free to comment or reopen the ticket if issue persists with recent fixes. Be sure to provide sample file to test the issue. Thanks for the report!

@Blendphys , yes. Will close as we do not have sufficient information (test file). @scurest , on importing empty pdb file I get ZeroDivisionError (not the same as said in this report). @dadel feel free to comment or reopen the ticket if issue persists with recent fixes. Be sure to provide sample file to test the issue. Thanks for the report!
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 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#94008
No description provided.