MonZop / BioBlender

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

Blender gets stuck at core_create_Models #27

Open nantille opened 9 years ago

nantille commented 9 years ago

I tried loading a protein called 1qx7 and it froze Blender to death – I did this a couple of times. Then I tried loading another molecule – this time from test molecules provided with BioBlender, 03_3IV5_DNA_proteinComplex.pdb – and I still have the same problem. I know that some weeks ago, I could load a molecule without having this problem.

Loading Test molecule 02_4IHVonlyDNA.pdb works because it seems more simple. Though I only see one sphere as a result. And it's only when I start the embed game engine that I see many spheres moving.

When that issue arises, Blender gets stuck at "core_create_Models" so if I understand this, the meshing part is concerned. PDB String Bootstrapping create_fi_materials get_new_PDB_id appending file appending file Import Preview Import Ready: True core_import_File get_num_model: [0] core_parse_pdb A core_sort_hr appending file core_create_Models

zeffii commented 9 years ago

are you using BioBlender-master ?

zeffii commented 9 years ago

03_3IV5_DNA_proteinComplex.pdb works in BioBlender-master and takes roughly 4 minutes to load and rig. on a slow machine. (2.4ghz) -- for this period of time Blender is as good as frozen, this is to be expected. There's no multi-threading going on.

The various debug print statements will slow it down too, I can remove those from master, but I doubt they contribute by any great amount compared to the ridiculous amount of repeated object updates. I estimate that as much as 95% of the processing time is spend on updating the scene and all objects over and over again when each new rigid-body constraint is added)

As for 1qx7 , if it seems like it's frozen it's because it's busy with currently no way to show you how much progress is being made.

nantille commented 9 years ago

Yes I am using the master branch.

I'm testing an external 4K monitor atm, I wonder if it could affect performances but mesh creation depends on the cpu, not the gpu if I'm not mistaken. I have no cpu-intensive thread running and I have a 3.5Ghz iMac. Even so, Blender is stuck for more than 5 minutes. I kill it at some point.

I don't think the print statement are a problem since you have to run Blender from the line command to have console output.

There is no clear documentation on the Blender side as to how to process a lot of meshes efficiently in python so it's a bit of a guess. If possible, I'd try to remove updating the scene for every rigid body created and I would update it only after they're created. Or even better, linking the objects to the scene only when the import is complete – again if that's possible.

Or maybe show a placeholder empty and let it load in background...Amateurish conceptual idea again.

zeffii commented 9 years ago

BioBlender-master (addon) is not ready for consumption. When BioBlender was implemented as a Patch in C/C++ it was able to set the scene and hold off on the update (and the chained effect that has) until the last moment. Development then switched to python instead of custom builds, with the hope that it would allow more convenient implementation. For whatever reason that development was stopped, and the current state is, as you can tell, quite rough. With no-one working on it for about 2 years (from what I can summize) this repo is an attempt to throw it a life-vest.

after about 15 minutes 1qx7 gives the error:

appending file
core_create_Models
Import Failed: ('Unable to generate 3D model from PDB File', KeyError('bpy_prop_collection[key]: key "O" not found',))

obviously i'm not going to want to wait 15 minutes too often, so a solution to the exceeding slow scene-graph update is essential to the future..

MonZop commented 9 years ago

The file contains selenomethionines, I am not sure BioBlender is equipped to deal with selenium.

nantille commented 9 years ago

When I read the 4000 lines of code python file, I got the feeling of the life-vest alright. I will be of no help in the C++ realm though. I thought it could be ready for consumption in given scenarios since some visualisation were produced with BioBlender but I now see that may not be possible in its current state. The project is very interesting though.

zeffii commented 9 years ago

@nantille It has been very tempting to start from scratch after 3 weeks of reading the current code base. Not only split the 4k file to smaller manageable pieces, but dramatically change the structure. I may still do that.. but I haven't really experimented exhaustively with the current code.

zeffii commented 9 years ago

@MonZop you are correct

core_createModels()
0
Import Failed: ('Unable to generate 3D model from PDB File', 
KeyError('bpy_prop_collection[key]: key "SE" not found',))
pmadhikar commented 9 years ago

It has been very tempting to start from scratch after 3 weeks of reading the current code base. Not only split the 4k file to smaller manageable pieces, but dramatically change the structure. I may still do that.. but I haven't really experimented exhaustively with the current code.

I think that is a good idea. It might also be a good idea to move away from third party packages and try to write only the things that we need from scratch.

zeffii commented 9 years ago

I'm not ready to ditch the existing code yet, it may be possible to significantly speed up the set-up of the rigidbody simulation by first carefully constructing the (a)cyclic dependency graph(s) so those structures are separate first, then joined resulting in (i think) a considerable redux in time. That would at least address a major concern that @MonZop has.

Maybe i'm completely wrong here, but it seems to me that there might be an efficient update sequence for adding the atoms.

MonZop commented 9 years ago

The idea of re-designing BioBlender might be a good one. We started by fixing (trying to) the existing porogram because we considered it a fast way to provide BioBlender functions to users. If we are going to restart from scratch, then this operation of getting the program running can be considered a sort of exercise to get familiar with the concepts of molecular biology and the visualization idea that is behind it. It is also good to have the program usable while we work at a new version. My gratitude to the volunteers that are providing help is growing daily, and has laready reached a size beyond description.