Search code examples
user-interfaceusabilitymeshlab

Meshlab - Possible to export / import the current camera configuration?


I frequently spend time moving the camera around a mesh and fine-tuning just the right angle etc to view some feature, and would like to be able to easily save and restore that view for use in another session with the same or a different mesh, or to send the view to a colleague, etc. Ideally this would export / import XML or json directly to/from the system clipboard. Is this possible ? If not, where's an appropriate place to make such a feature request ?


Solution

  • Since meshlab-2016, you can save current camera configuration between sessions or send it to somebody, just by clicking in the menu Windows->Copy shot, which will paste into your clipboard a chunk of XML text like this:

    <!DOCTYPE ViewState>
    <project>
     <VCGCamera TranslationVector="-11.8361 18.817 -14.9087 1" RotationMatrix="0.897925 0.384971 -0.213371 0 -0.0662652 0.597485 0.799138 0 0.435131 -0.703427 0.562007 0 0 0 0 1 " CenterPx="452 309" CameraType="0" ViewportPx="905 619" FocalMm="19.7896" PixelSizeMm="0.0369161 0.0369161" BinaryData="0" LensDistortion="0 0"/>
     <ViewSettings TrackScale="0.112629" FarPlane="8.49669" NearPlane="0.303109"/>
    </project>
    

    you can save that piece of text on a file or send to a colleague by email.

    To restore the position of the camera, just copy the text from your file or email to your clipboard and choose the option Window->Paste shot

    Also, current pre-release version of meshlab has included 4 new buttons that allow to store and recall 4 camera positions (called "Views" in their argot) , but they are not stored between sessions.

    Store views

    And last, if you want to ask for a new feature or report a bug to meshlab developers, you can leave a message in https://github.com/cnr-isti-vclab/meshlab/issues . Please be nice, and try to provide a minimal reproducible example in case you are reporting a bug. Don't forget to include which meshlab version are you using.