#984 closed defect (fixed)
Depth cueing fails if an empty Model is added before first AtomicStructure
Reported by: | Tristan Croll | Owned by: | Tom Goddard |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | Graphics | Version: | |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Notify when closed: | Platform: | all | |
Project: | ChimeraX |
Description
If I do:
from chimerax.core.models import Model m = Model('test', session) session.models.add([m])
... then load an atomic structure, ChimeraX fails to center the display on the new model, and after manually re-centering depth-cueing is non-functional, despite
session.view.lighting.depth_cue True
Running lighting depthCue true
does reinstate it.
This only happens if done before any atomic structures have been loaded. If I load an atomic model, immediately close it and then do the above, everything works fine.
Change History (3)
comment:1 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:2 by , 8 years ago
If you wish to open empty models initially, your tool should control when the initial camera view is set, by calling
session.main_view.initial_camera_view()
follow-up: 3 comment:3 by , 8 years ago
I agree it’s an obscure edge case, and it will eventually go away for ISOLDE. What’s happening at the moment is that ISOLDE creates a Model on startup as a container for various annotations, but I’m in the process of refactoring things so that all annotations are properties of the structure they belong to (as they should have been in the first place... we live and learn). Once that’s done this Model will be retired. Tristan Croll Research Fellow Cambridge Institute for Medical Research University of Cambridge CB2 0XY
Note:
See TracTickets
for help on using tickets.
Fixed.
Lighting was not being updated the first time the scene was drawn. Not clear how this worked before.
The camera initial view is set when the first model is opened. So if that model displays nothing then the camera view will not be set. While we could try to change the rule so the initial camera is updated when the first model that actually shows something is open I'm inclined to leave it as is. This case of opening an model that displays nothing is obscure. And to handle it better really requires not setting the camera view when the model is open. I could for instance open a model but it initially displays nothing, so no camera view set, then the user makes it show something, and I guess now I might want the camera view to update. That logic would have to move to setting the camera view whenever something is first shown. Doesn't make sense to make the code more complex for such obscure cases.