MonZop / BioBlender

AddOn for Blender to do molecular work
BSD 2-Clause "Simplified" License
115 stars 21 forks source link

How to have a surface mesh ? #28

Open nantille opened 9 years ago

nantille commented 9 years ago

I read the manual and I know it's getting written little by little so I'm not surprised if I don't find information about surface mesh representation.

I would like to know if I can use this feature for close-ups. What is the current status of this feature ? If it is available, how can I switch between atom-view to surface-view ?

Thank you, Nicolas

zeffii commented 9 years ago

I read in the other thread you do have it installed, hopefully it's in a path that Blender can find.

In the MLP panel, switch from Atomic to Surface, then press 'Show MLP on Surface'. This generates the surface mesh (and also removes doubles, thus making the mesh entirely manifold).

nantille commented 9 years ago

So I tried loading test molecule 05 called 05_glycoprotein_4AY9_FSH. After 30secs (really there is something wrong here, I've seen BioBlender running faster) I see a sphere which looks like it's a dummy. When I select Blender Game and run the embed player, it slowly plays a simulation with now lots of spheres moving around in something like a brownian motion. Now, back to the GUI. I still see the sphere dummy. I go to Surface then Show MLP on Surface as you said. The sphere disappears and I get another dummy, an Empty that looks like xy axis. I hit render in case it does the same thing as for the simulation (replacing the dummy by the mesh) but I see nothing.

Removing doubles is also what I did in other experiments to weld polygons together. Luckily, the mesh becomes manifold thanks to the nice triangulation done in pymol.

MonZop commented 9 years ago

It is really strange that you don't have all the atoms in the viewport. Can you select the molecule (from the outliner) and press . to bring into view? So we know if themolecule is really not imported or is simply out of view

nantille commented 9 years ago

I will describe what I see with these screenshots so that you have a better view of what's happening. So first I create a new scene. Then BioBlender 2 PDB Import, I add test molecule 05 and hit Make preview. Fields are populated. I'm allowed to import. Import PDB. Wheel of death for a while. Then screen-01.png. Notice that in the Outline (top right corner), lots of objects are here and they should be visible, except if their position is out of my camera field of view. For the sake of the demo, I switch to Blender Game, hit Start under Embedded Player. screen-02.png It seems that many spheres are lined and the UI is very slow for 20 seconds then a motion is applied on the spheres and they form a molecule. screen-03.png Back to the MLP vis, I select Surface, Show MLP on Surface and the result is screen-04.png This time, it didn't change anything BUT, it seems it selected the light (you see the circle on the right turns orange), check vs screen-01.png screen-01 screen-02 screen-03 screen-04

zeffii commented 9 years ago

for the screenshots it would be OK to show a blender window which is not 4k pixels..for those of us reading this on a mobile device The screen-resolution isn't contributing to the problem.

zeffii commented 9 years ago

@nantille are you using Master or a branch?

nantille commented 9 years ago

I did this git clone https://github.com/MonZop/BioBlender.git I guess this is the Master.

zeffii commented 9 years ago

05_glycoprotein_4AY9_FSH works for me in the Alternative_MLP_with_EmptyTest branch. it's worth a try. image no errors..

edit but it also works in master, for me..

MonZop commented 9 years ago

@nantille Can you report the console message? console

zeffii commented 9 years ago

@MonZop that won't show up on a Mac, @nantille will have start blender from a console to get the debug output :(

zeffii commented 9 years ago

the outliner suggests that the import doesn't go according to plan.. hoping for an error to clarify that..

image A successful import would lead to the molecule getting one parent, thus reducing the clutter in the outliner. image

I concur that the 'center of gravity' of the molecule is not placed in the scene at the origin, that's a simple translation thing which could be applied to the Parent Empty as a final step ( will include this in the todo ) things )

nantille commented 9 years ago

So I cloned your branch with git clone -b alternative_MLP_with_EmptyTest --single-branch https://github.com/MonZop/BioBlender.git

Then I uninstalled the master branch and installed this one. Now I loaded a small molecule, test molecule 06. It loads almost instantly. Did the MLP trick and an error shows in the console. Here's what I get:

pE: _4GE pdppath: /Users/nantille/workspace/repositories/BioBlender/Test_molecules/06_1L2Y_4GE.pdb Exporting PDB... =============== exporting PDB Exporting model '_4GE' to /Users/nantille/Library/Application Support/Blender/2.73/scripts/addons/BioBlender/tmp/tmp.pdb =======outPath = /Users/nantille/Library/Application Support/Blender/2.73/scripts/addons/BioBlender/tmp/tmp.pdb Setup is complete! chmod: /Users/nantille/Library/Application: No such file or directory chmod: Support/Blender/2.73/scripts/addons/BioBlender/bin/pyMLP-1.0/pyMLP.py: No such file or directory Running PyMLP PyMLP command succeded Making Surface using PyMOL /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file '/Users/nantille/Library/Application': [Errno 2] No such file or directory PyMOL(TM) Molecular Graphics System, Version 1.7.4.0. Copyright (c) Schrodinger, LLC. All Rights Reserved.

Created by Warren L. DeLano, Ph.D.

PyMOL is user-supported open-source software.  Although some versions
are freely available, PyMOL is not in the public domain.

If PyMOL is helpful in your work or study, then please volunteer
support for our ongoing efforts to create open and affordable scientific
software by purchasing a PyMOL Maintenance and/or Support subscription.

More information can be found at "http://www.pymol.org".

Enter "help" for a list of commands.
Enter "help <command-name>" for information on a specific command.

Hit ESC anytime to toggle between text and graphics.

Command mode. No graphics front end. Detected 8 CPU cores. Enabled multithreaded rendering. PyMOL>resume /Users/nantille/Library/Application Traceback (most recent call last): File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pymol/parser.py", line 382, in parse layer.script = open(path,'r') IOError: [Errno 2] No such file or directory: 'Support/Blender/2.73/scripts/addons/BioBlender/tmp/surface.pml' PyMOL: normal program termination. Failed to open file: /Users/nantille/Library/Application Support/Blender/2.73/scripts/addons/BioBlender/tmp/tmp.wrl An error occured after importing the WRL ShapeIndexedFaceSet in surface Loading MLP values into Blender An error occured in MLP while loading values into Blender; be careful; [Errno 2] No such file or directory: '/Users/nantille/Library/Application Support/Blender/2.73/scripts/addons/BioBlender/tmp/tmp.dx' MLP function completed

zeffii commented 9 years ago

cool. we'll start from the first errors. give me some time to digest, it seems very workable.

nantille commented 9 years ago

In the outliner, I see that the spheres are hidden but still there. So this error prevents me from getting the MLP surface. If you don't start blender from the console, you don't have a feedback in the UI that it didn't work.

Thank you for your quick answers though. Have a nice weekend. Cheers.

zeffii commented 9 years ago

yep, until the addon version of BioBlender is stable it's not a bad idea to start it from console. Consider all these builds development builds for the time being please :)

This does suggest that it might be a good idea to include some internal reporting, (progress bars, and the info panel can be used to show status), i've been reluctant to add code until things work... but this kind of reporting code I think is acceptable and useful.

zeffii commented 9 years ago

it's really this section:

Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pymol/parser.py", line 382, in parse
layer.script = open(path,'r')
IOError: [Errno 2] No such file or directory: 'Support/Blender/2.73/scripts/addons/BioBlender/tmp/surface.pml'
PyMOL: normal program termination.
Failed to open file: /Users/nantille/Library/Application Support/Blender/2.73/scripts/addons/BioBlender/tmp/tmp.wrl
An error occured after importing the WRL ShapeIndexedFaceSet in surface
Loading MLP values into Blender
An error occured in MLP while loading values into Blender; be careful; [Errno 2] No such file or directory: '/Users/nantille/Library/Application Support/Blender/2.73/scripts/addons/BioBlender/tmp/tmp.dx'
MLP function completed
zeffii commented 9 years ago

it isn't finding: Support/Blender/2.73/scripts/addons/BioBlender/tmp/surface.pml' for each operating system there's a separate execution route, it seems the MAC route is not fully tested.

The separate code execution paths is another thing which is quite clunky, and i'm eager to make platform agnostic (as much as possible).

zeffii commented 9 years ago

@nantille your screen-01.png shows that something did fail during the pdb to molecule rig for 05_glycoprotein_4AY9_FSH, in the end all atoms should be parented. i'd be interested in just the errors you get for only that importing section.

But overall I get the sense that this is a paths issue

zeffii commented 9 years ago

just a bit if side-info:

BioBlender addon has a lot of try / except for testing locations of the external binaries it uses, this means there's probably a bit more error reporting than you might want to see and it might be confusing (it reports the failed path lookups but simply continues when it finds a valid path..and doesn't print 'yes!! found path..continuing;' . But ..in fairness.. i prefer to have verbose error reporting than the opposite no errors.