﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	notify_on_close	platform	project
3554	Update clip caps only when changed so coloring is preserved	Elaine Meng	Tom Goddard	"
On Jul 27, 2020, at 4:57 PM, Tom Goddard <goddard@sonic.net> wrote:

Hi Elaine,

 It looks like a bug but unfortunately it is expected behavior and I am not sure how it can be fixed.  The problem is the transparency command

open 1g74
surface
clip
mlp map true; wait 1
color sample #1.1.1 map #2 palette lipophilicity range -20,20; wait 1
transparency #1.1.1 50

You colored the cap using the mlp volume which will automatically recolor it whenever the cap changes (e.g. you move the clip plane).  But then the transparency command changes the cap coloring and turns off the auto recoloring.  Auto recoloring as a surface shape changes sets both the colors and transparency, so if anything else changes those then auto recoloring is turned off.  All still looks ok because the cap has not changed.  But then hiding the volume causes the cap to recompute.  Why?  Unfortunately the capping code only knows that the scene has changed and so it recomputes all caps.

One way to fix this would be to make clip caps not recompute if nothing has changed.  There is a comment in the code to add that improvement.  But reliably determining if the cap needs recomputing is hard and would likely introduce bugs where the cap fails to update.  It could be done but I am not keen on it -- the smarter the code the more bugs it has.

Not a great solution but I think the best is to change the script and get rid of the transparency command by using the transparency option of the color command.  This has the advantage that the cap will also stay mlp colored if you move it with the mouse.

open 1g74
surface
mlp map true
clip
wait 1   # In a script this draws the graphics which is needed to create the clip cap before coloring it.
color sample #1.1.1 map #2 palette lipophilicity range -20,20 transparency 50

I also rearranged your wait and put an explanation in.

Feel free to make a ticket.  It would be could to include this email, and in the summary something like ""Update clip caps only when changed so coloring is preserved"".

	Tom"	enhancement	assigned	minor		Surface								all	ChimeraX
