[chimerax-users] How to estimate 2dlabels fading?
Elaine Meng
meng at cgl.ucsf.edu
Fri Jul 29 08:25:42 PDT 2022
HI Edoardo,
When you do it in two separate commands (first create the arrow and then in second command hide it) it works, as in the example I sent:
> 2dlab arrow start .1,.1 end .28,.33 color orange
> 2dlab arrow #5.1 visibility false
However, you were not doing anything wrong -- in fact, there was a bug so that if you tried to do it all in one command, the arrow would still be shown. This was just fixed yesterday, so if you get the new daily build it should work correctly. Or, you can just do it in two commands as in the workaround above.
I hope this helps,
Elaine
-----
Elaine C. Meng, Ph.D.
UCSF Chimera(X) team
Department of Pharmaceutical Chemistry
University of California, San Francisco
> On Jul 29, 2022, at 7:45 AM, Edoardo D Imprima via ChimeraX-users <chimerax-users at cgl.ucsf.edu> wrote:
>
> Hi Elaine,
>
> Thank you for your prompt reply. When I use this code the arrows are always shown. I tried either visibility 0-1 or hide|show but they are still there since the beginning.
>
> 2dlabels text "Test 01" size 18 xpos .03 ypos .92 bold true bgColor black margin 5 visibility false;
> #2dlabels arrow start 0.112,0.916 end 0.442,0.807 color white weight 0.5 visibility false;
> #2dlabels arrow start 0.112,0.819 end 0.331,0.561 color white weight 0.5 visibility false;
>
> volume #1 planes z,1349,1300; wait 50;
>
> show #2.1 models;
> show #3.1-2 models;
>
> wait 200;
> hide #2.1 models;
> hide #3.1-2 models;
>
> volume #1 planes z,1300,1000; wait 301;
>
> What am I doing wrong?
>
> Many thanks in advance,
>
> Edoardo
>
>
>
> On Thu, Jul 28, 2022 at 18:39, Elaine Meng <meng at cgl.ucsf.edu> wrote:
> Hi Edoardo,
> The frames argument of 2d label is used for gradually changing the label (e.g. fade in, fade out, change color, and/or change position).
>
> It is not used to specify the time point within an existing script where the change starts to happen. Instead you just have to put the command(s) in the right places within your script to get the timing that you would want.
>
> So you would use a setup command to create and hide the label ahead of time, for example (let's say that arrow is created as model #5.1):
>
> 2dlab arrow start .1,.1 end .28,.33 color orange
> 2dlab arrow #5.1 visibility false
>
> (you could have many setup commands like this if you are going to make different labels and arrows appear later)
>
> ... then in the part of the script where it would be frame 10 in your movie, insert the command to start fade-in, specifying the model number of the label:
>
> 2dlab arrow #5.1 visibility true frames 5
>
> If you want to finish fading in before any later actions start, then put a "wait 5" after it. Actually, a fade-in of 5 frames is really fast, maybe try using a bigger number so that you can see it happening gradually!
>
> I see there is an error in the "2dlabels arrow" documentation where it says "visibility hide | show" ... it should be "visibility true | false" instead, as in the example above. I will fix the documentation.
>
> <https://rbvi.ucsf.edu/chimerax/docs/user/commands/2dlabels.html#acreate>
>
> I hope this helps,
> Elaine
> -----
> Elaine C. Meng, Ph.D.
> UCSF Chimera(X) team
> Department of Pharmaceutical Chemistry
> University of California, San Francisco
>
> On Jul 28, 2022, at 2:25 AM, Edoardo D Imprima via ChimeraX-users <chimerax-users at cgl.ucsf.edu> wrote:
>
> Hi,
>
> Could you please explain more how the frames option works when changing 2dlabels? Let’s say I have 100 frames and I wish to have an arrow to appear at frame 10 for 5 frames?
>
> Many thanks in advance,
>
> Edoardo
> ------------------------------------------------------
> Dr. Edoardo D'Imprima
> Postdoctoral fellow
> Structural and Computational Biology Unit
> EMBL Heidelberg - Mahamid Group
> Meyerhofstraße 1
> 69117 Heidelberg
> Germany
>
> Phone: +49 6221 387-8531
More information about the ChimeraX-users
mailing list