f3d-app / f3d

Fast and minimalist 3D viewer.
https://f3d.app
BSD 3-Clause "New" or "Revised" License
2.88k stars 207 forks source link

Dump "camera" info should dump information about all options #596

Open mwestphal opened 1 year ago

mwestphal commented 1 year ago

Context

F3D support printing information about the current state of the application by pressing ?, specfically about the configuration of the camera. While useful, this feature could become great if it dumped more info, especially enough info to just copy/paste to recreate the state of the application.

Suggested Solution

snoyer commented 1 year ago

Dumping the relevant options as a string of command-line arguments to stdout would allow copy-pasting to get the same state on a subsequent run of the application.

Alternatively/additionally, dumping to the clipboard would allow to use this functionality even when the application was not started from a terminal. In that case loading from the clipboard should also be considered so that the dumped state can be restored within already running instances of the application.

For reference, MeshLab does something like this with its camera state:

It would be cool to be able to get strings like --camera-position 10,15,20 --ssao --depth-peeling --tone-mapping ... from one F3D window to another.

mwestphal commented 1 year ago

Great ideas ! I wonder if we can manage cross platform clipboard. Afaik VTK does not support it.

mwestphal commented 9 months ago

Updated with a suggested solution

mwestphal commented 2 months ago

This is becoming possible with https://github.com/f3d-app/f3d/pull/1580.

Possible formatting suggested by @snoyer :

Updating Options:
  camera-direction: '-1,-0.5,-1' # # from 05_all.json₍₁₎:`.*`
  config: 'config_build' # from CLI options
  input: '/home/glow/dev/f3d/f3d/src/testing/data/dragon.vtu' # from CLI options
  axis: 'true' # from 05_all.json₍₁₎:`.*`
  scalars: '' # from 05_all.json₍₁₎:`.*`
  output: '/home/glow/dev/f3d/f3d/build/Testing/Temporary/TestDefaultConfigFileVTU.png' # from CLI options
  ref: '/home/glow/dev/f3d/f3d/src/testing/baselines/TestDefaultConfigFileVTU.png' # from CLI options
  anti-aliasing: 'true' # from 05_all.json₍₁₎:`.*`
  tone-mapping: 'true' # from 05_all.json₍₁₎:`.*`
  translucency-support: 'true' # from 05_all.json₍₁₎:`.*`
  grid: 'true' # from 05_all.json₍₁₎:`.*`
  hdri-ambient: 'true' # from 05_all.json₍₁₎:`.*`
  resolution: '300,300' # from CLI options
  animation-progress: 'true' # from 05_all.json₍₁₎:`.*`
  filename: 'true' # from 05_all.json₍₁₎:`.*`
  progress: 'true' # from 05_all.json₍₁₎:`.*`
  bar: 'true' # from 10_native.json₍₂₎:`.*(dcm|nrrd|mhd|mha|vt.)`
  verbose: 'debug' # from CLI options
# 05_all.json₍₁₎: /home/glow/dev/f3d/f3d/build/share/f3d/configs/config_build.d/05_all.json
# 10_native.json₍₂₎: /home/glow/dev/f3d/f3d/build/share/f3d/configs/config_build.d/10_native.json