In my example it really close to 4 seconds (I've just checked the test video!) since I changed framerate to the same number in movie encode

movie encode format h264 quality highest framerate 4 output ./crossfadeTEST.mp4

Il giorno mar 28 gen 2025 alle ore 00:20 Elaine Meng <meng@cgl.ucsf.edu> ha scritto:
The "4" is not seconds, it is graphics frames which are much shorter than a second (default 25 per second in a recorded movie, 60 per second interactively).


> On Jan 27, 2025, at 3:14 PM, Enrico Martinez via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
>
> it still does not work, sorry!
> Here is my script which works correctly, where I manually defined the  transitions from the frame 149 to 122 each 4 seconds. Could you show me:
>
> 1) how to adap exactly this algorithm to your compact coordset expression
>
> 2) how to adapt the coordset to the whole trajectory (from frame 149 to the frame 1) using the same intervals
>
> movie record size 3840,2160 supersample 1
>
> coordset #1 149
> crossfade 4
> coordset #1 148; wait 4
> crossfade 4
> coordset #1 147; wait 4
> crossfade 4
> coordset #1 146; wait 4
> crossfade 4
> coordset #1 145; wait 4
> crossfade 4
> coordset #1 144; wait 4
> crossfade 4
> coordset #1 143; wait 4
> crossfade 4
> coordset #1 142; wait 4
> crossfade 4
> coordset #1 141; wait 4
> crossfade 4
> coordset #1 140; wait 4
> crossfade 4
> coordset #1 139; wait 4
> crossfade 4
> coordset #1 138; wait 4
> crossfade 4
> coordset #1 137; wait 4
> crossfade 4
> coordset #1 136; wait 4
> crossfade 4
> coordset #1 135; wait 4
> crossfade 4
> coordset #1 134; wait 4
> crossfade 4
> coordset #1 133; wait 4
> crossfade 4
> coordset #1 132; wait 4
> crossfade 4
> coordset #1 131; wait 4
> crossfade 4
> coordset #1 130; wait 4
> crossfade 4
> coordset #1 129; wait 4
> crossfade 4
> coordset #1 128; wait 4
> crossfade 4
> coordset #1 127; wait 4
> crossfade 4
> coordset #1 126; wait 4
> crossfade 4
> coordset #1 125; wait 4
> crossfade 4
> coordset #1 124; wait 4
> crossfade 4
> coordset #1 123; wait 4
> crossfade 4
> coordset #1 122; wait 4
>
>
> movie encode format h264 quality highest framerate 4 output ./crossfadeTEST.mp4
>
>
>
> Il giorno lun 27 gen 2025 alle ore 23:59 Tom Goddard <goddard@sonic.net> ha scritto:
> Hi Enrico,
>
>   My command were using the default crossfade of 30 frames.  If you want to have each crossfade last 4 frames you have to add an argument to crossfade
>
> open 8rxe coordset true
> coordset #1 1,10 pause 4 ; perframe "crossfade 4" frames 9 interval 3
>
> The "frames 9" argument tells perframe to do the command 9 times.  Since there are 10 conformations in my 8rxe example, there are 9 transitions that need to be crossfaded.  So that number is one less than the number of coordinate sets.
>
> Tom
>
>
>> On Jan 27, 2025, at 2:52 PM, Enrico Martinez <jmsstarlight@gmail.com> wrote:
>>
>> Thank you very much Tom!
>>
>> BTW using the example of Elaine (per frames) I could achieve good transitions
>> coordset #1 149
>> crossfade 4
>> coordset #1 148; wait 4
>> crossfade 4
>>
>> etc
>> in this way each snapshot appears 4 seconds etc
>>
>>
>> when I use you example in the same way to reduce the pause to 4 seconds it does not work.
>>
>> #coordset #1 1,10 pause 4
>> #perframe crossfade frames 9 interval 3
>>
>> also what is frames 9 ? should it correspond to the number of frames in coordset ?
>>
>> Il giorno lun 27 gen 2025 alle ore 23:49 Tom Goddard <goddard@sonic.net> ha scritto:
>> Oops.  I gave you the wrong open command.  Need to open this NMR ensemble as a coordinate set
>>
>>         open 8rxe coordset true
>>         coordset #1 1,10 pause 30 ; perframe crossfade frames 9 interval 29
>>
>>   Tom
>>
>>
>> > On Jan 27, 2025, at 2:36 PM, Tom Goddard via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
>> >
>> > You would need to use options for the coordset command and the perframe command to pause for enough frames to let each crossfade complete.  The documentation explains these options ("pauseFrames" and "interval").  Here is an example
>> >
>> >       open 8rxe
>> >       coordset #1 1,10 pause 30 ; perframe crossfade frames 9 interval 29
>> >
>> >  Tom
>> >
>> >> On Jan 27, 2025, at 2:22 PM, Elaine Meng via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
>> >>
>> >> It doesn't really make sense to crossfade for 2 frames when you are showing a different docking position every 1 frame.  Also 2 frames is so short you wouldn't even be able to see any transition.  Keep in mind that the perframe and crossfade frame amounts are the graphics frames (which are something like 60 per second), not the trajectory frames.
>> >>
>> >> My advice is you would not even add the movie record/encode commands until the script shows what you want -- otherwise you are wasting your time.
>> >>
>> >> The long way that I told you would be to repeat the coordset and crossfade commands once for every trajectory frame (not graphics frame).  You need the waits so that it won't jump ahead to the other parts until it is done with each transition.  This example does 30-frame crossfades.
>> >>
>> >> coordset #1 149
>> >> crossfade 30
>> >> coordset #1 148; wait 30
>> >> crossfade 30
>> >> coordset #1 147; wait 30
>> >> crossfade 30
>> >> coordset #1 146; wait 30
>> >> [etc.]
>> >>
>> >> That's the way I know how to do it.  It may not be possible to use the perframe command which is per-graphics-frame since you want to have multiple graphics frames for each trajectory frame.  In your example there is no room for transitions when the whole script is only 149 graphics frames long.
>> >>
>> >> The long way may be tedious to create the script for, but you can probably write a script to write your script (ha ha).  Whichever way seems like the most convenient to you.
>> >>
>> >> Elaine
>> >>
>> >>
>> >>> On Jan 27, 2025, at 1:48 PM, Enrico Martinez via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
>> >>>
>> >>> I am so sorry that my question was unclear and (twisely!) very sorry that I could not understand the syntax  !
>> >>>
>> >>> My aim is to introduce a crossfade effect between each frame in the ensemble that I iterate using coordset and then save as the movie with the 2 frames per second (so I show every docking pose each half second). So the movie should look like the slow transition between docking poses with this transparency crossfade effect
>> >>>
>> >>> And here is my script that I have already tried
>> >>>
>> >>> movie record
>> >>>
>> >>> ## play DOCKING movie from end to beginning
>> >>> coordset #1 149,1,-1
>> >>> perframe "crossfade 2"
>> >>> wait 149
>> >>>
>> >>> movie encode format h264 framerate 2 output ./test.mp4
>> >>>
>> >>> This produces a static image of the first frame with very strange resolution .. do I need to add some option to crossfade to automatically process the current frame and the next one ?
>> >>>
>> >>> Il giorno lun 27 gen 2025 alle ore 22:33 Elaine Meng <meng@cgl.ucsf.edu> ha scritto:
>> >>> Hi Enrico,
>> >>> Why don't you try it??-- movie-making is always a long process of trial and error, we can't always give you the exact commands because situations are different.  Usually I don't know the specifics until I spend an hour actually putting it into an example script myself.  As far as I know, it is possible just like I already explained, except you would do it for every docking position.  So you could make a long script that has a line for each transition (like my previous example), or you might be able to do it in a more compact way using "perframe"
>> >>>
>> >>> See "making movies" page and detailed help links therein, including "perframe" (which in turn includes several example commands):
>> >>>
>> >>> <https://rbvi.ucsf.edu/chimerax/docs/user/movies.html>
>> >>> <https://rbvi.ucsf.edu/chimerax/docs/user/commands/perframe.html>
>> >>>
>> >>> Elaine
>> >>> -----
>> >>> Elaine C. Meng, Ph.D.                       
>> >>> UCSF Chimera(X) team
>> >>> Resource for Biocomputing, Visualization, and Informatics
>> >>> Department of Pharmaceutical Chemistry
>> >>> University of California, San Francisco
>> >>>
>> >>>
>> >>>> On Jan 27, 2025, at 12:33 PM, Enrico Martinez via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
>> >>>>
>> >>>> And finally is it possible to apply this crossfade effect for each frame on a selection (e g ligand ) in my multi frame ensemble that I record using movie record  ?  This could be useful for visualisation of docking ensembles ( where receptor is the same in all frames ) ..
>> >>>>
>> >>>> Le lun. 27 janv. 2025 à 21:29, Enrico Martinez <jmsstarlight@gmail.com> a écrit :
>> >>>> Hi Elaine !
>> >>>>
>> >>>> Today I tried to play with movie crossfade to include this transparency effect between frames but it did not work . Where the command should be actually added ( e.g. inside the movie record … wait x or alternatively after recording and before recording)?
>> >>>>
>> >>>> Should I add it for each frame in a loop or there is a more automatic solution e.g to apply it like a filter effect when I record movie using coordset ?
>> >>>>
>> >>>> Thank you very much in advance!
>> >>>>
>> >>>> Enrico
>> >>>>
>> >>>> Le lun. 27 janv. 2025 à 18:21, Elaine Meng <meng@cgl.ucsf.edu> a écrit :
>> >>>> Hi Enrico,
>> >>>> Crossfade does not do any movements, it is only like making one image fade (gets more and more transparent) when the next one fades in (gets more and more opaque).
>> >>>>
>> >>>> coordset #1 96
>> >>>> crossfade 60; coordset #1 95; wait 60
>> >>>>
>> >>>> The "crossfade" help has more examples
>> >>>> <https://rbvi.ucsf.edu/chimerax/docs/user/commands/crossfade.html>
>> >>>>
>> >>>> There is another command "movie crossfade" that gives basically the same result but is only for when you are recording a movie, since it does not show the crossfade in the graphics window.  So you can use that if you want, you just can't see it "live"
>> >>>> <https://rbvi.ucsf.edu/chimerax/docs/user/commands/movie.html#crossfade>
>> >>>>
>> >>>> If you meant actually moving the atoms gradually, you could try morphing from each position to the next position.  However, you cannot do it with the trajectory, you would need to save the ligand docking ensemble as a multi-model pdb if you don't already have it, then reopen it (then you'd have something like #1.1, #1.2 .... #1.96), and then morph from each one to the next, something like
>> >>>>
>> >>>> morph #1.1-96
>> >>>>
>> >>>> .... of course there are adjustable parameters to morph, see options in the help
>> >>>> <https://rbvi.ucsf.edu/chimerax/docs/user/commands/morph.html>
>> >>>>
>> >>>> I hope this helps,
>> >>>> Elaine
>> >>>> -----
>> >>>> Elaine C. Meng, Ph.D.                       
>> >>>> UCSF Chimera(X) team
>> >>>> Resource for Biocomputing, Visualization, and Informatics
>> >>>> Department of Pharmaceutical Chemistry
>> >>>> University of California, San Francisco
>> >>>>
>> >>>>> On Jan 27, 2025, at 5:03 AM, Enrico Martinez via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
>> >>>>>
>> >>>>> Dear ChimeraX users!
>> >>>>>
>> >>>>> I am recording a short animation demonstrating my docking ensemble
>> >>>>>
>> >>>>> # start recording
>> >>>>> movie record
>> >>>>>
>> >>>>> ## play DOCKING movie from end to begining
>> >>>>> coordset #1 96,1,-1
>> >>>>> wait 96
>> >>>>>
>> >>>>> Would it be possible to add a smooth transition between each frame (docking pose) using the movie crossfade command ? If so, how should this command be placed in the script ?
>> >>>>>
>> >>>>> Many thanks in advance !
>> >>>>>
>> >>>>> Enrico
>> >>>>> _______________________________________________
>> >>>>> ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu
>> >>>>> To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu
>> >>>>> Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
>> >>>>
>> >>>> _______________________________________________
>> >>>> ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu
>> >>>> To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu
>> >>>> Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
>> >>>
>> >>> _______________________________________________
>> >>> ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu
>> >>> To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu
>> >>> Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
>> >>
>> >>
>> >> _______________________________________________
>> >> ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu
>> >> To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu
>> >> Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
>> >>
>> >
>> >
>> > _______________________________________________
>> > ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu
>> > To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu
>> > Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
>> >
>>
>
> _______________________________________________
> ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu
> To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu
> Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/