Author: bugman Date: Fri Aug 1 11:11:39 2008 New Revision: 7057 URL: http://svn.gna.org/viewcvs/relax?rev=7057&view=rev Log: Converted the VMD code to the new relax design. Modified: 1.3/generic_fns/vmd.py Modified: 1.3/generic_fns/vmd.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/vmd.py?rev=7057&r1=7056&r2=7057&view=diff ============================================================================== --- 1.3/generic_fns/vmd.py (original) +++ 1.3/generic_fns/vmd.py Fri Aug 1 11:11:39 2008 @@ -35,7 +35,7 @@ from relax_errors import RelaxNoPdbError -def view(self, run): +def view(): """Function for viewing the collection of molecules using VMD.""" # Test if the module is available. @@ -43,16 +43,19 @@ print "VMD is not available (cannot import Scientific.Visualization.VMD due to missing Numeric dependency)." return + # Alias the current data pipe. + cdp = ds[ds.current_pipe] + # Test if the PDB file has been loaded. - if not ds.pdb.has_key(run): - raise RelaxNoPdbError, run + if not hasattr(cdp, 'structure'): + raise RelaxNoPdbError # Create an empty scene. - ds.vmd_scene = VMD.Scene() + cdp.vmd_scene = VMD.Scene() # Add the molecules to the scene. - for i in xrange(len(ds.pdb[run].structures)): - ds.vmd_scene.addObject(VMD.Molecules(ds.pdb[run].structures[i])) + for i in xrange(len(cdp.structure.structures)): + cdp.vmd_scene.addObject(VMD.Molecules(cdp.structure.structures[i])) # View the scene. - ds.vmd_scene.view() + cdp.vmd_scene.view()