Opened 5 years ago

Closed 5 years ago

#3276 closed defect (fixed)

nucleotide sugar-tubes disconnected from ribbon in restored session

Reported by: Elaine Meng Owned by: Tom Goddard
Priority: major Milestone: 1.1
Component: Depiction Version:
Keywords: Cc: Greg Couch, pett
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

open 2bna
save nuctest.cxs
close
open nuctext.cxs

.... now nucleotides are no longer connected to ribbon.

Strangely, if I no open another 2bna, it also shows nucleotides as disconnected from ribbon.

Only if I close all and then open another 2bna are the nucleotides connected.

Comparison of images suggests it is the tube lengths that change, not the ribbon position.

Tested in UCSF ChimeraX version: 1.0rc202005210540 (2020-05-21) on Mac

Change History (12)

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

clarification:  "if I no open" was supposed to be "if I now open" ...sorry about that, too much rushing

comment:2 by pett, 5 years ago

Component: UnassignedDepiction

comment:3 by Scooter Morris, 5 years ago

Priority: blockermajor

comment:4 by Greg Couch, 5 years ago

Rerunning the cartoon command fixes the end points.

comment:5 by Greg Couch, 5 years ago

Can replicate without a session: (1) open 2bna autostyle false, (2) style stick, (3) nucleotides tube/slab, (4) cartoon. A subsequent (1) ~cartoon, (2) cartoon, fixes it.

comment:6 by Greg Couch, 5 years ago

Cc: Tom Goddard added

Tom, the new Atom ribbon_coord attribute is updated too late for nucleotides to get the right value. Nucleotides is updating its representation in the 'new frame' trigger. And the ribbon is generated lazily afterwards. Nucleotides used to call structure.bounds() to get the coordinates updated. Is there is new way?

Last edited 5 years ago by Greg Couch (previous) (diff)

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

I'll have to look into it.  Ribbon graphics are update in the "graphics update" trigger that comes after the "new frame" trigger.  If nucleotides used the "graphics update" trigger the ribbon might already be updated, but it is not good since the order of trigger callbacks being called is not defined and nucleotides may be called before ribbon update.

The session.main_view.check_for_drawing_change() will update the graphics if needed and return True if an update was actually done.  That is probably what you want.  But calling that every frame could have bad performance implications.  It is already being called by core/updateloop.py as part of the main graphics redraw loop.  I wonder how nucleotides determines that the ribbons have changed and the tethers need updating.


comment:8 by pett, 5 years ago

FYI: triggers are fired in the order they were registered.

--Eric

comment:9 by pett, 5 years ago

Err, triggers _handlers_ are fired in the order they were registered.

comment:10 by Greg Couch, 5 years ago

Cc: Greg Couch pett added; Tom Goddard removed
Owner: changed from Greg Couch to goddar

The triggers are fired in the right order. The ribbon tether coordinates are computed lazily during the draw pass, and that is too late. Nucleotides needs to know the ribbon positions when it creates the tubes for the sugars and the stubs/rungs for ladders. The way nucleotides used to get correct information was to call structure.bounds() which updated the ribbon information to get the correct bounding box.

Replacing the call to structure.bounds(),with a call to structure._update_graphics_if_needed(), works around the bug, but is not a public API.

Reassigning to Tom because structure.bounds() no longer updates the ribbon tether coordinates.

comment:11 by pett, 5 years ago

Owner: changed from goddar to Tom Goddard

comment:12 by Tom Goddard, 5 years ago

Resolution: fixed
Status: assignedclosed

Fixed.

I made Structure update_graphics_if_needed() public and had nucleotides call it.

Note: See TracTickets for help on using tickets.