Opened 5 years ago

Last modified 5 years ago

#3437 assigned enhancement

RFE: positions file include camera position

Reported by: Elaine Meng Owned by: Tom Goddard
Priority: moderate Milestone:
Component: Input/Output Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

For my purposes, the positions file would be way more useful if it also included the camera position. My use case is trying to regenerate a figure where the tool windows are important. Session does not save any of the tool windows. I have a script that does everything, but then I have to hand-position the structure and it is very time-consuming and difficult to find the right position. So my idea is to save positions from the session, close session, run the script so that I have all the tool windows but then apply the positions (including camera) to get the view that is in the session.

Maybe the real problem is that all the tools (including results panels like crosslink histogram) aren't saved in the session, but who knows when THAT will happen.

Also I do see a snag in that open/save positions requires specifying models, and then it would also need an option whether to also set camera (at least on open) or ignore that part. So maybe you would consider it not worth doing. I thought it was worth asking, at least.

Change History (9)

comment:1 by Elaine Meng, 5 years ago

Current workaround is instead to use "view matrix" to report camera position, then try to copy from Log (which is a challenge in itself because does not horizontally scroll when mouse-highlighting), then put into command file as "view matrix camera <matrix>". Still seems more logical to me for the positions file to include camera position.

in reply to:  2 ; comment:2 by goddard@…, 5 years ago

It would be sensible to request that sessions restore tool windows, and be specific about which tool windows are most important so that a small amount of work could perhaps achieve the result.  That request should describe what "restore" means, do you very much want the placement and size to be identical (or can you manage fixing that by hand), or is it the contents of the tool window (like how a sequence is annotated with region boxes) that is in need of restore support?

Now to this request.  If I understand you are using a command script instead of a session.  Isn't the "view matrix" command intended exactly to handle this?  allowing you to simply make a command that positions all models and the camera.

I am inclined to avoid complicating the positions format unless it has a less hacky use.  Options to include camera position on save and to use it on open could be added but I prefer this problem is solved in a better way (either of the 2 suggestions above).  If the camera options had other more compelling uses it would not be particularly hard to add those options.

in reply to:  3 ; comment:3 by Elaine Meng, 5 years ago

My command script didn't set up the positions.  The session had the positions I wanted, but not the tools.  As I said, yes, the workaround was to report camera matrix after hand-positioning and then add that to the command script.  It is just requiring another cycle of rigamarole to what should be a natural process.  My script is with the feature highlight which has a slightly different (manual) positioning than the figure I'm making in this case, so I didn't want to change THAT script.  So I have to make a new script with the matrix junk in it that goes with this paper figure.

I originally just tried saving positions and was momentarily suprised that restoring positions didn't do anything, until I remembered that the overall position is the camera and not the model.  Just thought other people might have the same misconception and confusion: I generally think of the set of positions as what I see in the graphics window.

in reply to:  4 ; comment:4 by goddard@…, 5 years ago

Ok, you have a session.  I still am struggling to understand how adding a positions file is a simple solution.  If you have a session why not save a named view and simply restore to that camera view in the script?  I am also perplexed at why the current camera view saved in the session does not do the jobs -- I guess the commands you run somehow move the camera view.

in reply to:  5 ; comment:5 by Elaine Meng, 5 years ago

I cannot use the session because the session does not have the tools saved.  No crosslink histogram etc.  This is for the screenshot image.

in reply to:  6 ; comment:6 by Elaine Meng, 5 years ago

As I said, the solution is to open session, report camera matrix, add camera matrix-setting to script, close session, run script.  It is a pain to copy the camera matrix info from the Log.  I had to change the Log window to be wide enough to show the entire matrix.

comment:7 by Tom Goddard, 5 years ago

Sorry I am having such trouble grasping this. It seems trivial to me to get the camera position with view matrix and put it in a script. It seems equally trivial to save a positions file that had the camera position in it and then add a command to the script to use that file, if the positions file had that option. If I were choosing between those, the view matrix seems better because I still have just one file a script that does everything, while with the positions file I now have two files to keep together. As for copy and paste of the command I don't understand the "pain to copy the camera matrix" -- why does the Log have to be resized -- I just tried now (after making the log very narrow so the matrix did not fit) and copy and paste works fine with wrapped multiple lines.

in reply to:  8 ; comment:8 by Elaine Meng, 5 years ago

It did not wrap in mine.  The Log has a horizontal scroll bar which does not automatically scroll over when you are highlighting text inside to try to copy that text.

Also I wanted to record an enhancement of what I thought would be useful, considering that people might think of "position" as having all the positional information.  If  you don't agree (which I was prepared for) just close or ignore the ticket. 

in reply to:  9 ; comment:9 by goddard@…, 5 years ago

It would be nice if the Log scrolled when dragging, it seems to do it sometimes but not others.  Unfortunately Qt has many small issues like this.

A trick to copy a line from the Log when it has a horizontal scrollbar is click at the start of the line and drag directly down to the next line below.  This drag select will get the entire line including the part that is beyond the right edge of the window.  You may want only part of that selected line.  In that case I would still copy the entire line then paste and delete the extra part of the line that is not needed.

I appreciate the positions file suggestion and will leave the ticket open and see if other uses arise that would benefit.  But I don't feel it is a high enough priority right now.
Note: See TracTickets for help on using tickets.