VMD-L Mailing List
From: John Stone (johns_at_ks.uiuc.edu)
Date: Tue Sep 16 2008 - 14:00:06 CDT
- Next message: jani sahil: "regarding rotating dihedral"
- Previous message: John Stone: "Re: parallel VMD"
- In reply to: Shay Amram: "Tachyon render and Tcl scripting"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Hi,
The render command arguments must include the full path to the renderer
executable as well as the command line arguments to the executable.
Your example below is missing the path to the Tachyon executable.
I would suggest looking at how the "vmdmovie" plugin works.
Here's a snippet of useful code you will want to copy/clone in
your own routines. This is taken directly from the vmdmovie plugin.
You'll have to modify the code so it doesn't depend on the variables
in the ::MoveMaker:: namespace, etc.
##
## Render one frame using existing settings
##
proc ::MovieMaker::renderframe { basefilename } {
global env
variable renderer
variable rendercmd
variable scenefilename
variable imgfilename
variable imgformat
# set platform-specific executable suffix
set archexe ""
switch [vmdinfo arch] {
WIN64 -
WIN32 {
set archexe ".exe"
}
}
set imgfilename $basefilename.$imgformat
switch $renderer {
snapshot {
render snapshot $imgfilename
}
libtachyon {
render TachyonInternal $imgfilename
}
tachyon {
set scenefilename $basefilename.dat
set tachyonexe [format "tachyon%s" $archexe];
set tachyoncmd \
[::ExecTool::find -interactive -description "Tachyon Ray Tracer" \
-path [file join $env(VMDDIR) "tachyon_[vmdinfo arch]$archexe"] $tachyonexe]
if {$tachyoncmd == {}} {
puts "Cannot find Tachyon, aborting"
}
set rendercmd [ format "\"%s\"" $tachyoncmd]
switch $imgformat {
bmp {
set rendercmd [concat $rendercmd \
"-mediumshade $scenefilename -format BMP -aasamples 4 -trans_vmd -o $imgfilename"]
}
ppm {
set rendercmd [concat $rendercmd \
"-mediumshade $scenefilename -format PPM -aasamples 4 -trans_vmd -o $imgfilename"]
}
rgb {
set rendercmd [concat $rendercmd \
"-mediumshade $scenefilename -format RGB -aasamples 4 -trans_vmd -o $imgfilename"]
}
tga {
set rendercmd [concat $rendercmd \
"-mediumshade $scenefilename -format Targa -aasamples 4 -trans_vmd -o $imgfilename"]
}
default {
puts "Image format unsupported, aborting"
}
}
render Tachyon $scenefilename $rendercmd
}
povray {
set scenefilename $basefilename.pov
set povrayexe [format "povray%s" $archexe];
switch [vmdinfo arch] {
WIN64 -
WIN32 {
set povrayexe "pvengine.exe";
set povraycmd \
[::ExecTool::find -interactive -path "c:/program files/POV-Ray for Windows v3.6/bin/pvengine.exe" -description "POV-Ray Ray Tracer" \
$povrayexe]
}
default {
set povraycmd \
[::ExecTool::find -interactive -description "POV-Ray Ray Tracer" \
$povrayexe]
}
}
if {$povraycmd == {}} {
puts "Cannot find POV-Ray, aborting"
}
set rendercmd [ format "\"%s\"" $povraycmd]
# get image resolution so we can pass it into POV command line
set imagesize [display get size]
set xsize [lindex $imagesize 0]
set ysize [lindex $imagesize 1]
# Add required Windows-specific options to drive the POV-Ray
# GUI to do what we'd normally do on Unix
switch [vmdinfo arch] {
WIN64 -
WIN32 {
set rendercmd [concat $rendercmd "/NR /EXIT"]
}
}
switch $imgformat {
bmp {
# XXX Assume that "S" will give us BMP format on Windows
set rendercmd [concat $rendercmd \
"-I$scenefilename -O$imgfilename +X +A +FS +W$xsize +H$ysize"]
}
ppm {
set rendercmd [concat $rendercmd \
"-I$scenefilename -O$imgfilename +X +A +FP +W$xsize +H$ysize"]
}
}
render POV3 $scenefilename $rendercmd
}
default {
puts "Unsupported renderer"
}
}
}
On Mon, Sep 15, 2008 at 07:42:00PM +0300, Shay Amram wrote:
> Greetings,
>
>
>
> I would like to write a script for VMD that will rotate a given molecule and
> take snapshot for each rotation.
>
> While making the rotation script was rather trivial, the snapshot bit is
> quite troublesome for me:
>
> I want to use tachyon render to get a high quality snapshot of each
> rotation, but I'm at a loss, since I can't seem to pass on the tachyon
> arguments I need through the script.
>
>
>
> Tried to pass something like:
>
>
>
> Render Tachyon filename
>
> or
>
> render Tachyon Myicture "-mediumshade -format BMP -aasamples 4 -o
> MyPicture.bmp"
>
>
>
> But all I got was a file in some unfamiliar format. I know this is probably
> not the way to call the tachyon command but I really tried (and couldn't)
> find too much documentation how I should pass along the tachyon arguments.
>
> The output I want could be BMP or JPG. I'm can use either Linux or Windows
> version of VMD. So my questions are:
>
> How can I have tachyon make snapshots as part of Tcl script?
>
> How do I pass it's command line arguments through the script?
>
> Can you refer me to proper documentation in that regard?
>
>
>
> Thanks in advance,
>
> -Shay
>
-- NIH Resource for Macromolecular Modeling and Bioinformatics Beckman Institute for Advanced Science and Technology University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801 Email: johns_at_ks.uiuc.edu Phone: 217-244-3349 WWW: http://www.ks.uiuc.edu/~johns/ Fax: 217-244-6078
- Next message: jani sahil: "regarding rotating dihedral"
- Previous message: John Stone: "Re: parallel VMD"
- In reply to: Shay Amram: "Tachyon render and Tcl scripting"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]