From: Jason F. <ja...@di...> - 2011-10-06 15:05:13
|
Hi Dan, I see two issues. First is that you need to call pymol.start() before calling any of the pymol.cmd methods. Second is that PyMOL 1.4 attempts OpenGL shader initialization in start(), even if you're not using the shaders. With PyMOL 1.3 your code below would probably work once you added the start() call, but with 1.4 you have to have to do something to create a valid OpenGL context for PyMOL before calling start(). I'm been working on a couple of articles about embedding pymol. Hopefully I'll have them finished and posted in the next few weeks.. By the way, here is a screenshot of a Qt based app I did that uses embedded pymol. http://www.jacquette.com/images/scientific/embeddedpymol.jpg The 'icons' in the QTreeView molecule lists on the left and right sides are all live PyMOL instances that can be rotated and zoomed. And of course the main display in the center is also live PyMOL. On 10/05/2011 06:21 PM, Dan O'Donovan wrote: > Dear All, > > I read with interest Jason Ferrara's post concerning embedding PyMOL in a QT app (back in January > http://www.mail-archive.com/pym...@li.../msg08607.html ). I've spent a short time experimenting and have encountered a problem or two - I was wondering if any insightful users had any pointers for me. > > I've built pymol from the SourceForge source (1.4.1) on some Fedora linux x86 box. I initially jumped straight into the QT code, but experienced a few crashes. Taking things apart further, I've got a little script that consistently crashes with a segfault: > > import sys > sys.path.append( os.path.join( os.environ['PYMOL_PATH'], 'modules' ) ) > > import pymol2 > pymol = pymol2.PyMOL() > > print 'pymol initialised' > pymol.cmd.set("internal_gui",0) > print 'we never see this' > > $ python crash.py >> pymol initialised >> Segmentation fault (core dumped) |