
Hey Mike, I take snapshots inside OFS scripts invoked from the command line all the time. I don't do it with core.snapshot, though but with core.viewerSnapshot. Here's a snippet from one of my scripts.
var snapshot_filename = "/foo/bar.png"; core.viewerSnapshot( snapshot_filename, true, true, false, true, 2560, -1, true, true, 16, true );
The parameters correspond to the different fields in the viewer snapshot dialog you can invoke in the GUI with the F2 key. See
http://openflipper.org/Documentation/latest/a00346.html#a41ea5c5ecb93c3bdc83... for the parameter names.
Before you take the actual snapshot, you probably want to get the viewport into a predefined state:
var view = "ACG::QtWidgets::QGLViewerWidget encoded view \ 1 0 0 0 \ 0 1 0 0 \ 0 0 1 -3 \ 0 0 0 1 \ 1.59302 0 0 0 \ 0 2.35585 0 0 \ 0 0 -3 -8 \ 0 0 -1 0 \ 0 0 630 1 1.62675 \ 1924 1301"; core.setViewAndWindowGeometry(view);
You can get your own view definition by right clicking the coordinate cross in the upper right and then holding CTRL and selecting "Copy View" in the context menu. (Holding CTRL will copy the view to the clipboard as a multi line JavaScript string instead of a raw string.) When you start OpenFlipper from the command line with your script, the main window should open and resize to the size defined in the view. Then a snapshot will be taken and saved to /foo/bar.png. Hope this helps. Hans-Christian On 03.01.2017 23:46, Caplan, Michael wrote:
Hi there,
I am trying to run a script from the command line. The script (see below) simply reads in a PLY and outputs a snapshot. When run from the OpenFlipper GUI, it produces the expected thumbnail. When run from the CLI, no thumbnail is produced. can core.snapshot be called from the batch CLI interface?
Thanks,
Mike
var objectId = core.loadObject("/home/michael/Pictures/dental/lower.ply") print(objectId) core.snapshotBaseFileName("/home/michael/Pictures/dental/lower-openflipper.png") core.snapshot(0,300,300,false,true) print("snapshot taken")
_______________________________________________ Openflipper mailing list Openflipper@lists.rwth-aachen.de http://mailman.rwth-aachen.de/mailman/listinfo/openflipper
-- Dipl.-Inform. Hans-Christian Ebke RWTH Aachen University Department for Computer Graphics, Multimedia, and Computer Vision Ahornstraße 55 52074 Aachen Building E3, Room 114 Phone: +49 241 8021803