Movie fade: Difference between revisions

From PyMOLWiki
Jump to navigation Jump to search
(moved to github)
(Added additional example (surface) with code and file)
Line 9: Line 9:


== Usage ==
== Usage ==
  movie_fade setting, startFrame, startVal, endFrame, endVal [, selection ]
  movie_fade setting, startFrame, startVal, endFrame, endVal [, selection ]


== Examples ==
== Examples ==
To fade in sticks from fully transparent to fully opaque across 60 frames do:
To fade in sticks from fully transparent to fully opaque across 60 frames do:


Line 32: Line 30:
movie_fade transparency, 41, 1., 80, 0.
movie_fade transparency, 41, 1., 80, 0.
</source>
</source>
'''Example file:'''
{| width="30%"
|+ style="font-weight:bold; text-align:center; font-size:100%;" |
! Code !! Result
|-
||
<source lang="python">
import movie_fade
fetch 1hpv, async=0
orient
#format
bg black
show_as cartoon
color marine, ss s
color red, ss h
color white, ss l+""
show sticks, resn 478
util.cbao resn 478
set surface_color, white, 1hpv
show surface
#movie
mset 1x120
movie_fade transparency,1, 0, 60, 1, 1hpv
movie_fade transparency,61, 1, 120, 0, 1hpv
</source>
||[[File:Movie fade example.gif]]
|}


== See Also ==
== See Also ==

Revision as of 06:25, 6 June 2014

Type Python Module
Download movie_fade.py
Author(s) Jason Vertrees and Thomas Holder
License BSD-2-Clause
This code has been put under version control in the project Pymol-script-repo

This script will help fade in and out settings in a movie. Just specify the setting, it's initial value at an initial frame and it's ending value and frame.

Usage

movie_fade setting, startFrame, startVal, endFrame, endVal [, selection ]

Examples

To fade in sticks from fully transparent to fully opaque across 60 frames do:

mset 1x60
movie_fade stick_transparency, 1, 1., 60, 0.

More complex example which involves camera motion:

fetch 1rx1, async=0
as cartoon
show surface
mset 1x80
movie.roll
movie_fade transparency,  1, 0., 40, 1.
movie_fade transparency, 41, 1., 80, 0.


Example file:

Code Result
import movie_fade

fetch 1hpv, async=0
orient

#format
bg black
show_as cartoon
color marine, ss s
color red, ss h
color white, ss l+""
show sticks, resn 478
util.cbao resn 478
set surface_color, white, 1hpv
show surface

#movie
mset 1x120
movie_fade transparency,1, 0, 60, 1, 1hpv
movie_fade transparency,61, 1, 120, 0, 1hpv
Movie fade example.gif


See Also