From: FX (fxcoudert_at_gmail.com)
Date: Thu Nov 20 2008 - 05:07:17 CST

The current list of babel/openbabel formats in the vmd importer plugin
is hardcoded, and corresponds to either babel 1.6 or openbabel
1.100.2. Recent openbabel releases support many more formats. This
patch allows the plugin to actually ask openbabel itself what formats
it can read (the command is "babel -L formats read", supported since
at least babel 2.2.0). On my build, it adds 75 formats to the list!

Some notes:
   -- built and tested on MACOSX86 only
   -- the code is rather crude C, but so is the rest of the plugin
   -- old behaviour can be retained by undefined
USE_OPENBABEL_AUTODETECT and defining either USE_BABEL_1_6 or
USE_OPENBABEL_1_100_2 at the top of the file
   -- the code actually launching the conversion and reading the
results is untouched


Best regards,
FX

PS: for some reason, on my own build, I kept getting an error about
VMDBABELBIN being undefined (though it never happens with the official
or alpha packages form the website and Biocore); this is the reason
for the following change:

    babelbin = getenv("VMDBABELBIN");
- if (!babelbin) {
- fprintf(stderr, "Babel plugin needs VMDBABELBIN environment
variable\n"
- "to point to location of Babel executable\n");
+ if (!babelbin)
+ babelbin = "babel";

I suppose this is not actually needed if you get your build right, but
as I can't test, I let it in.