Opened 5 years ago

Closed 5 years ago

#4482 closed defect (fixed)

Compute clip caps immediately in scripts so they can be colored

Reported by: Tom Goddard Owned by: Tom Goddard
Priority: moderate Milestone:
Component: Surface Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: asarnow@msg.ucsf.edu Platform: all
Project: ChimeraX

Description

Command scripts that create a clip cap then try to color it don't work because the cap is only created when the scene is rendered. This requires putting a tricky "wait 1" in the script. No one can figure that out.

We solved this same type of problem with volume threshold changes by having the volume code recompute surfaces immediately if session.in_script is true. Could do the same for the clip caps.

Begin forwarded message:

From: Daniel Asarnow
Subject: [chimerax-users] Surface caps only colored interactively
Date: April 7, 2021 at 6:27:04 PM PDT
To: ChimeraX Users Help <chimerax-users@…>

Hi,
I'm trying to generate a figure using several surfaces colored by map
values. If I clip a surface, and then color it, the caps have the
correct colors. However, when I do the same thing non-interactively,
the caps are uncolored. Am I doing something wrong?

view front.cut
color sample #1.1 map #1.2 palette cyanmaroon range 2.25,7.0
#surface dust #1.1 size 100
save front_cut.png pixelSize 0.1 transparentBackground true

Best,
-da

Change History (3)

comment:1 by Tom Goddard, 5 years ago

Begin forwarded message:

From: Tom Goddard
Subject: Re: [chimerax-users] Surface caps only colored interactively
Date: April 7, 2021 at 6:37:28 PM PDT
To: Daniel Asarnow
Cc: ChimeraX Users Help <chimerax-users@…>

Hi Daniel,

Put a "wait 1" command after the "view front.cut" command. Cryptic, I know!

The trouble is that when running a script the graphics is never redrawn unless you use this "wait" command which says to draw a frame. The cap is not computed unless the graphics is redrawn. So the coloring happens before the cap is computed unless you use this wait command.

In Chimera running scripts redraws between each line of the script, but this slows down running the script so we are trying not doing those redraws in ChimeraX. But this case and a few others (like changing map contouring level) only cause updates to the surfaces when the frames are redrawn. We need to figure out a better compromise between speed and obvious behavior.

Tom

comment:2 by Tom Goddard, 5 years ago

Commands "clip" or "view" can create the cap.

Is there a better way to make sure all the "new frame", "graphics update" or update loop changes get handled while in scripts? Maybe during a script the updating should be done after each command, but not the actual rendering that would go into a movie.

comment:3 by Tom Goddard, 5 years ago

Resolution: fixed
Status: assignedclosed

Fixed.

Made clip and view commands update the clip cap surfaces immediately.

Note: See TracTickets for help on using tickets.