TimeControl
v4.0
The TimeControl object represents the clip's Time Control
property, which is used to specify the time reference for a given
Clip object. For example, this property may
be used to add extra clip effects like cycling, bouncing, or
holding for fractions of the clip length. Like ClipEffects, the
time control effects applied to a specific clip do not alter the
original source, nor any other clip instantiated on that
source.
This object provides convenience accessors to some of the time
control parameters (under the General and Extrapolation tabs on the
property page). However, there are certain clip types which do not
nest a time control property under them: for example, the audio
clip and the animation mixer. For these, the TimeControl object
returned by the Clip disables the access to
parameters.
All scripting properties of the TimeControl object are read-only;
however, you can still use the pointer to the TimeControl object to
write to its parameters by going via the ParameterCollection (since the
TimeControl object is a specialized kind of Property object).
# # This example illustrates how to use the time control to trim an instantiated clip. # from win32com.client import constants as c oRoot = Application.ActiveSceneRoot oNull = oRoot.AddNull("myNull") oPosX = oNull.Parameters("Posx") # Create and connect a function curve to the position x oFCurve = oPosX.AddFCurve2([1, 10, 50, 0, 100, 10], c.siUnknownFCurve) # This value should be 10; Application.LogMessage("The animated value at frame 1 is %f " % (oPosX.Value)) # Create the animation source oSource = Application.StoreAction(oRoot,"myNull.kine.local.posx",2,"StoredFcvPose", 1, 1, 100, 0,0) # Create the first clip oClip = Application.AddClip(oRoot, oSource) # Use the ClipIn read-only scripting property to print the inital ClipIn value oTimeControl = oClip.TimeControl Application.LogMessage("The clip in value is %f " % (oTimeControl.ClipIn)) # Now use access the ClipIn parameter via the ParameterCollection (Property.Parameters) to change # the ClipIn value and print the new value oTimeControl.Parameters("ClipIn").Value = 50 Application.LogMessage("The clip in value is now %f " % (oTimeControl.ClipIn)) # Now the value should be 0. Application.LogMessage("The value after the clip manipulation is %f " % (oPosX.Value)) # Expected results: #INFO : The animated value at frame 1 is 10.000000 #INFO : The clip in value is 1.000000 #INFO : The clip in value is now 50.000000 #INFO : The value after the clip manipulation is 0.000000 |