
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")

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

Thanks Hans-Christian, That points me in a good direction. When I set the view geometry, I get a segfault (see below). When skipping setting the view geometry no snapshot is produced. I have noticed that many of the plugins don't load in batch mode ("Running in nogui mode which is unsupported by this plugin, skipping"). Can it be that a required plugin is not available in batch mode? Regardless, my end game is creating snapshots in a headless server environment. Is that a technical possibility to do this with maybe Xvfb? Thanks, Mike Trying a backtrace to show what happened last: Stack frames: 13 0: ./OpenFlipper(_Z9backtracev+0x31) [0x556ed4af1ea1] 1: ./OpenFlipper(_Z16segfaultHandlingi+0x18f) [0x556ed4af21ff] 2: /lib/x86_64-linux-gnu/libc.so.6(+0x35860) [0x7f26adfd6860] 3: ./OpenFlipper(_ZN10CoreWidget28slotSetViewAndWindowGeometryE7QString+0x31) [0x556ed4bb87d1] 4: ./OpenFlipper(_ZN4Core24setViewAndWindowGeometryE7QString+0x31) [0x556ed4b56b41] 5: ./OpenFlipper(+0x1b6117) [0x556ed4c26117] 6: ./OpenFlipper(_ZN4Core11qt_metacallEN11QMetaObject4CallEiPPv+0x4b) [0x556ed4c2939b] 7: /usr/lib/x86_64-linux-gnu/libQtScript.so.4(+0x211ab3) [0x7f26b10e2ab3] 8: /usr/lib/x86_64-linux-gnu/libQtScript.so.4(+0x21387a) [0x7f26b10e487a] 9: /usr/lib/x86_64-linux-gnu/libQtScript.so.4(+0x213aea) [0x7f26b10e4aea] 10: /usr/lib/x86_64-linux-gnu/libQtScript.so.4(+0x1065e0) [0x7f26b0fd75e0] 11: /usr/lib/x86_64-linux-gnu/libQtScript.so.4(+0xdaf13) [0x7f26b0fabf13] 12: [0x7f262696891d] On 2017-01-04 05:26 AM, Hans-Christian Ebke wrote:
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 https://urldefense.proofpoint.com/v2/url?u=http-3A__openflipper.org_Documentation_latest_a00346.html-23a41ea5c5ecb93c3bdc839d774d879e5e3&d=DgIFAw&c=yY4CMAuTGYfRli0JwzUYHmQg2Qdg_NdchGW_KJ5k-xY&r=Idz8RgP8Rp-OEm-PF0RQlV25ifY4-V0CabChLrEZPy8&m=bupmPlaU9oq-uxUuGTsBRqbWhXCIbLuzKF4OXWy3ScM&s=rZdaZ2Idue8mBPmG7lMqt5LcsuYcwZKWWgeYO9Y_Wag&e= 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 https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.rwth-2Daachen.de_mailman_listinfo_openflipper&d=DgIFAw&c=yY4CMAuTGYfRli0JwzUYHmQg2Qdg_NdchGW_KJ5k-xY&r=Idz8RgP8Rp-OEm-PF0RQlV25ifY4-V0CabChLrEZPy8&m=bupmPlaU9oq-uxUuGTsBRqbWhXCIbLuzKF4OXWy3ScM&s=-0kOfauZHrQKOph1EHM6HvjIBD7mDN6lp32GKZO82EU&e=
Please consider the environment before printing this email. E-mail messages may contain viruses, worms, or other malicious code. By reading the message and opening any attachments, the recipient accepts full responsibility for taking protective action against such code. Henry Schein is not liable for any loss or damage arising from this message. The information in this email is confidential and may be legally privileged. It is intended solely for the addressee(s). Access to this e-mail by anyone else is unauthorized.

core.exitApplication(); if you want batch processing. But you'd need an X Server running for
You can't take snapshots (or set the viewport) in non-gui mode. You can, however, start OpenFlipper in GUI mode and end your script with this to work. I don't know how hard it would be to support a headless mode with an off screen framebuffer in OpenFlipper. I'm pretty sure though that the development of anything like that is not planned any time soon. Best Hans-Christian On 04.01.2017 13:56, Caplan, Michael wrote:
Thanks Hans-Christian,
That points me in a good direction. When I set the view geometry, I get a segfault (see below). When skipping setting the view geometry no snapshot is produced.
I have noticed that many of the plugins don't load in batch mode ("Running in nogui mode which is unsupported by this plugin, skipping"). Can it be that a required plugin is not available in batch mode?
Regardless, my end game is creating snapshots in a headless server environment. Is that a technical possibility to do this with maybe Xvfb?
Thanks,
Mike
Trying a backtrace to show what happened last: Stack frames: 13 0: ./OpenFlipper(_Z9backtracev+0x31) [0x556ed4af1ea1] 1: ./OpenFlipper(_Z16segfaultHandlingi+0x18f) [0x556ed4af21ff] 2: /lib/x86_64-linux-gnu/libc.so.6(+0x35860) [0x7f26adfd6860] 3: ./OpenFlipper(_ZN10CoreWidget28slotSetViewAndWindowGeometryE7QString+0x31) [0x556ed4bb87d1] 4: ./OpenFlipper(_ZN4Core24setViewAndWindowGeometryE7QString+0x31) [0x556ed4b56b41] 5: ./OpenFlipper(+0x1b6117) [0x556ed4c26117] 6: ./OpenFlipper(_ZN4Core11qt_metacallEN11QMetaObject4CallEiPPv+0x4b) [0x556ed4c2939b] 7: /usr/lib/x86_64-linux-gnu/libQtScript.so.4(+0x211ab3) [0x7f26b10e2ab3] 8: /usr/lib/x86_64-linux-gnu/libQtScript.so.4(+0x21387a) [0x7f26b10e487a] 9: /usr/lib/x86_64-linux-gnu/libQtScript.so.4(+0x213aea) [0x7f26b10e4aea] 10: /usr/lib/x86_64-linux-gnu/libQtScript.so.4(+0x1065e0) [0x7f26b0fd75e0] 11: /usr/lib/x86_64-linux-gnu/libQtScript.so.4(+0xdaf13) [0x7f26b0fabf13] 12: [0x7f262696891d]
On 2017-01-04 05:26 AM, Hans-Christian Ebke wrote:
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 https://urldefense.proofpoint.com/v2/url?u=http-3A__openflipper.org_Documentation_latest_a00346.html-23a41ea5c5ecb93c3bdc839d774d879e5e3&d=DgIFAw&c=yY4CMAuTGYfRli0JwzUYHmQg2Qdg_NdchGW_KJ5k-xY&r=Idz8RgP8Rp-OEm-PF0RQlV25ifY4-V0CabChLrEZPy8&m=bupmPlaU9oq-uxUuGTsBRqbWhXCIbLuzKF4OXWy3ScM&s=rZdaZ2Idue8mBPmG7lMqt5LcsuYcwZKWWgeYO9Y_Wag&e= 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 https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.rwth-2Daachen.de_mailman_listinfo_openflipper&d=DgIFAw&c=yY4CMAuTGYfRli0JwzUYHmQg2Qdg_NdchGW_KJ5k-xY&r=Idz8RgP8Rp-OEm-PF0RQlV25ifY4-V0CabChLrEZPy8&m=bupmPlaU9oq-uxUuGTsBRqbWhXCIbLuzKF4OXWy3ScM&s=-0kOfauZHrQKOph1EHM6HvjIBD7mDN6lp32GKZO82EU&e=
Please consider the environment before printing this email.
E-mail messages may contain viruses, worms, or other malicious code. By reading the message and opening any attachments, the recipient accepts full responsibility for taking protective action against such code. Henry Schein is not liable for any loss or damage arising from this message.
The information in this email is confidential and may be legally privileged. It is intended solely for the addressee(s). Access to this e-mail by anyone else is unauthorized.
_______________________________________________ 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
participants (2)
-
Caplan, Michael
-
Hans-Christian Ebke