CInterval
from panda3d.direct import CInterval
- class CInterval
Bases:
TypedReferenceCount
The base class for timeline components. A CInterval represents a single action, event, or collection of nested intervals that will be performed at some specific time or over a period of time.
This is essentially similar to the Python “Interval” class, but it is implemented in C++ (hence the name). Intervals that may be implemented in C++ will inherit from this class; Intervals that must be implemented in Python will inherit from the similar Python class.
Inheritance diagram
- ETFinalize = 3
- ETInitialize = 0
- ETInstant = 1
- ETInterrupt = 7
- ETReverseFinalize = 6
- ETReverseInitialize = 4
- ETReverseInstant = 5
- ETStep = 2
- ET_finalize = 3
- ET_initialize = 0
- ET_instant = 1
- ET_interrupt = 7
- ET_reverse_finalize = 6
- ET_reverse_initialize = 4
- ET_reverse_instant = 5
- ET_step = 2
- SFinal = 3
- SInitial = 0
- SPaused = 2
- SStarted = 1
- S_final = 3
- S_initial = 0
- S_paused = 2
- S_started = 1
- __init__(*args, **kwargs)
- auto_finish
- auto_pause
- clearToInitial()
C++ Interface: clear_to_initial(const CInterval self)
- /**
Pauses the interval, if it is playing, and resets its state to its initial
state, abandoning any state changes already in progress in the middle of
the interval. Calling this is like pausing the interval and discarding it,
creating a new one in its place.
*/
- clear_to_initial()
C++ Interface: clear_to_initial(const CInterval self)
- /**
Pauses the interval, if it is playing, and resets its state to its initial
state, abandoning any state changes already in progress in the middle of
the interval. Calling this is like pausing the interval and discarding it,
creating a new one in its place.
*/
- done_event
- duration
- finish()
C++ Interface: finish(const CInterval self)
- /**
Stops the interval from playing and sets it to its final state.
*/
- getAutoFinish()
C++ Interface: get_auto_finish(CInterval self)
- /**
Returns the state of the ‘auto_finish’ flag. See set_auto_finish().
*/
- getAutoPause()
C++ Interface: get_auto_pause(CInterval self)
- /**
Returns the state of the ‘auto_pause’ flag. See set_auto_pause().
*/
- getClassType()
C++ Interface: get_class_type()
- getDoneEvent()
C++ Interface: get_done_event(CInterval self)
- /**
Returns the event that is generated whenever the interval reaches its final
state, whether it is explicitly finished or whether it gets there on its
own.
*/
- getDuration()
C++ Interface: get_duration(CInterval self)
- /**
Returns the duration of the interval in seconds.
*/
- getManager()
C++ Interface: get_manager(CInterval self)
- /**
Returns the CIntervalManager object which will be responsible for playing
this interval. Note that this can only return a C++ object; if the
particular CIntervalManager object has been extended in the scripting
language, this will return the encapsulated C++ object, not the full
extended object.
*/
- getOpenEnded()
C++ Interface: get_open_ended(CInterval self)
- /**
Returns the state of the “open_ended” flag. This is primarily intended for
instantaneous intervals like FunctionIntervals; it indicates true if the
interval has some lasting effect that should be applied even if the
interval doesn’t get started until after its finish time, or false if the
interval is a transitive thing that doesn’t need to be called late.
*/
- getPlayRate()
C++ Interface: get_play_rate(CInterval self)
- /**
Returns the play rate as set by the last call to start(), loop(), or
set_play_rate().
*/
- getState()
C++ Interface: get_state(CInterval self)
- /**
Indicates the state the interval believes it is in: whether it has been
started, is currently in the middle, or has been finalized.
*/
- getT()
C++ Interface: get_t(CInterval self)
- /**
Returns the current time of the interval: the last value of t passed to
priv_initialize(), priv_step(), or priv_finalize().
*/
- getWantsTCallback()
C++ Interface: get_wants_t_callback(CInterval self)
- /**
Returns the state of the ‘wants_t_callback’ flag. See
set_wants_t_callback().
*/
- get_auto_finish()
C++ Interface: get_auto_finish(CInterval self)
- /**
Returns the state of the ‘auto_finish’ flag. See set_auto_finish().
*/
- get_auto_pause()
C++ Interface: get_auto_pause(CInterval self)
- /**
Returns the state of the ‘auto_pause’ flag. See set_auto_pause().
*/
- get_class_type()
C++ Interface: get_class_type()
- get_done_event()
C++ Interface: get_done_event(CInterval self)
- /**
Returns the event that is generated whenever the interval reaches its final
state, whether it is explicitly finished or whether it gets there on its
own.
*/
- get_duration()
C++ Interface: get_duration(CInterval self)
- /**
Returns the duration of the interval in seconds.
*/
- get_manager()
C++ Interface: get_manager(CInterval self)
- /**
Returns the CIntervalManager object which will be responsible for playing
this interval. Note that this can only return a C++ object; if the
particular CIntervalManager object has been extended in the scripting
language, this will return the encapsulated C++ object, not the full
extended object.
*/
- get_open_ended()
C++ Interface: get_open_ended(CInterval self)
- /**
Returns the state of the “open_ended” flag. This is primarily intended for
instantaneous intervals like FunctionIntervals; it indicates true if the
interval has some lasting effect that should be applied even if the
interval doesn’t get started until after its finish time, or false if the
interval is a transitive thing that doesn’t need to be called late.
*/
- get_play_rate()
C++ Interface: get_play_rate(CInterval self)
- /**
Returns the play rate as set by the last call to start(), loop(), or
set_play_rate().
*/
- get_state()
C++ Interface: get_state(CInterval self)
- /**
Indicates the state the interval believes it is in: whether it has been
started, is currently in the middle, or has been finalized.
*/
- get_t()
C++ Interface: get_t(CInterval self)
- /**
Returns the current time of the interval: the last value of t passed to
priv_initialize(), priv_step(), or priv_finalize().
*/
- get_wants_t_callback()
C++ Interface: get_wants_t_callback(CInterval self)
- /**
Returns the state of the ‘wants_t_callback’ flag. See
set_wants_t_callback().
*/
- isPlaying()
C++ Interface: is_playing(CInterval self)
- /**
Returns true if the interval is currently playing, false otherwise.
*/
- isStopped()
C++ Interface: is_stopped(CInterval self)
- /**
Returns true if the interval is in either its initial or final states (but
not in a running or paused state).
*/
- is_playing()
C++ Interface: is_playing(CInterval self)
- /**
Returns true if the interval is currently playing, false otherwise.
*/
- is_stopped()
C++ Interface: is_stopped(CInterval self)
- /**
Returns true if the interval is in either its initial or final states (but
not in a running or paused state).
*/
- loop()
C++ Interface: loop(const CInterval self, double start_t, double end_t, double play_rate)
- /**
Starts the interval playing by registering it with the current
CIntervalManager. The interval will play until it is interrupted with
finish() or pause(), looping back to start_t when it reaches end_t.
If end_t is less than zero, it indicates the end of the interval.
*/
- manager
- name
- notify = <direct.directnotify.Notifier.Notifier object>
- open_ended
- pause()
C++ Interface: pause(const CInterval self)
- /**
Stops the interval from playing but leaves it in its current state. It may
later be resumed from this point by calling resume().
*/
- play(self, t0=0.0, duration=None, scale=1.0)
- play_rate
- playing
- popupControls(self, tl=None)
Popup control panel for interval.
- privDoEvent()
C++ Interface: priv_do_event(const CInterval self, double t, int event)
// These cannot be declared private because they must be accessible to // Python, but the method names are prefixed with priv_ to remind you that // you probably don’t want to be using them directly.
- /**
Calls the appropriate event function indicated by the EventType.
*/
- privFinalize()
C++ Interface: priv_finalize(const CInterval self)
- /**
This is called to stop an interval, forcing it to whatever state it would
be after it played all the way through. It’s generally invoked by
set_final_t().
*/
- privInitialize()
C++ Interface: priv_initialize(const CInterval self, double t)
- /**
This replaces the first call to priv_step(), and indicates that the
interval has just begun. This may be overridden by derived classes that
need to do some explicit initialization on the first call.
*/
- privInstant()
C++ Interface: priv_instant(const CInterval self)
- /**
This is called in lieu of priv_initialize() .. priv_step() ..
priv_finalize(), when everything is to happen within one frame. The
interval should initialize itself, then leave itself in the final state.
*/
- privInterrupt()
C++ Interface: priv_interrupt(const CInterval self)
- /**
This is called while the interval is playing to indicate that it is about
to be interrupted; that is, priv_step() will not be called for a length of
time. But the interval should remain in its current state in anticipation
of being eventually restarted when the calls to priv_step() eventually
resume.
The purpose of this function is to allow self-running intervals like sound
intervals to stop the actual sound playback during the pause.
*/
- privPostEvent(self)
- privReverseFinalize()
C++ Interface: priv_reverse_finalize(const CInterval self)
- /**
Called generally following a priv_reverse_initialize(), this indicates the
interval should set itself to the initial state.
*/
- privReverseInitialize()
C++ Interface: priv_reverse_initialize(const CInterval self, double t)
- /**
Similar to priv_initialize(), but this is called when the interval is being
played backwards; it indicates that the interval should start at the
finishing state and undo any intervening intervals.
*/
- privReverseInstant()
C++ Interface: priv_reverse_instant(const CInterval self)
- /**
This is called in lieu of priv_reverse_initialize() .. priv_step() ..
priv_reverse_finalize(), when everything is to happen within one frame.
The interval should initialize itself, then leave itself in the initial
state.
*/
- privStep()
C++ Interface: priv_step(const CInterval self, double t)
- /**
Advances the time on the interval. The time may either increase (the
normal case) or decrease (e.g. if the interval is being played by a
slider).
*/
- priv_do_event()
C++ Interface: priv_do_event(const CInterval self, double t, int event)
// These cannot be declared private because they must be accessible to // Python, but the method names are prefixed with priv_ to remind you that // you probably don’t want to be using them directly.
- /**
Calls the appropriate event function indicated by the EventType.
*/
- priv_finalize()
C++ Interface: priv_finalize(const CInterval self)
- /**
This is called to stop an interval, forcing it to whatever state it would
be after it played all the way through. It’s generally invoked by
set_final_t().
*/
- priv_initialize()
C++ Interface: priv_initialize(const CInterval self, double t)
- /**
This replaces the first call to priv_step(), and indicates that the
interval has just begun. This may be overridden by derived classes that
need to do some explicit initialization on the first call.
*/
- priv_instant()
C++ Interface: priv_instant(const CInterval self)
- /**
This is called in lieu of priv_initialize() .. priv_step() ..
priv_finalize(), when everything is to happen within one frame. The
interval should initialize itself, then leave itself in the final state.
*/
- priv_interrupt()
C++ Interface: priv_interrupt(const CInterval self)
- /**
This is called while the interval is playing to indicate that it is about
to be interrupted; that is, priv_step() will not be called for a length of
time. But the interval should remain in its current state in anticipation
of being eventually restarted when the calls to priv_step() eventually
resume.
The purpose of this function is to allow self-running intervals like sound
intervals to stop the actual sound playback during the pause.
*/
- priv_reverse_finalize()
C++ Interface: priv_reverse_finalize(const CInterval self)
- /**
Called generally following a priv_reverse_initialize(), this indicates the
interval should set itself to the initial state.
*/
- priv_reverse_initialize()
C++ Interface: priv_reverse_initialize(const CInterval self, double t)
- /**
Similar to priv_initialize(), but this is called when the interval is being
played backwards; it indicates that the interval should start at the
finishing state and undo any intervening intervals.
*/
- priv_reverse_instant()
C++ Interface: priv_reverse_instant(const CInterval self)
- /**
This is called in lieu of priv_reverse_initialize() .. priv_step() ..
priv_reverse_finalize(), when everything is to happen within one frame.
The interval should initialize itself, then leave itself in the initial
state.
*/
- priv_step()
C++ Interface: priv_step(const CInterval self, double t)
- /**
Advances the time on the interval. The time may either increase (the
normal case) or decrease (e.g. if the interval is being played by a
slider).
*/
- resume()
C++ Interface: resume(const CInterval self) resume(const CInterval self, double start_t)
- resumeUntil()
C++ Interface: resume_until(const CInterval self, double end_t)
- /**
Restarts the interval from the current point after a previous call to
pause() (or a previous play-to-point-and-stop), to play until the indicated
point and then stop.
*/
- resume_until()
C++ Interface: resume_until(const CInterval self, double end_t)
- /**
Restarts the interval from the current point after a previous call to
pause() (or a previous play-to-point-and-stop), to play until the indicated
point and then stop.
*/
- setAutoFinish()
C++ Interface: set_auto_finish(const CInterval self, bool auto_finish)
- /**
Changes the state of the ‘auto_finish’ flag. If this is true, the interval
may be arbitrarily finished when the system needs to reset due to some
external event by calling CIntervalManager::interrupt(). If this is false
(the default), the interval must always be explicitly finished or paused.
*/
- setAutoPause()
C++ Interface: set_auto_pause(const CInterval self, bool auto_pause)
- /**
Changes the state of the ‘auto_pause’ flag. If this is true, the interval
may be arbitrarily interrupted when the system needs to reset due to some
external event by calling CIntervalManager::interrupt(). If this is false
(the default), the interval must always be explicitly finished or paused.
*/
- setDoneEvent()
C++ Interface: set_done_event(const CInterval self, str event)
- /**
Sets the event that is generated whenever the interval reaches its final
state, whether it is explicitly finished or whether it gets there on its
own.
*/
- setFinalT(self)
- setManager()
C++ Interface: set_manager(const CInterval self, CIntervalManager manager)
- /**
Indicates the CIntervalManager object which will be responsible for playing
this interval. This defaults to the global CIntervalManager; you should
need to change this only if you have special requirements for playing this
interval.
*/
- setPlayRate()
C++ Interface: set_play_rate(const CInterval self, double play_rate)
- /**
Changes the play rate of the interval. If the interval is already started,
this changes its speed on-the-fly. Note that since play_rate is a
parameter to start() and loop(), the next call to start() or loop() will
reset this parameter.
*/
- setT(self, t)
- setT_Old()
C++ Interface: set_t(const CInterval self, double t)
- /**
Explicitly sets the time within the interval. Normally, you would use
start() .. finish() to let the time play normally, but this may be used to
set the time to some particular value.
*/
- setWantsTCallback()
C++ Interface: set_wants_t_callback(const CInterval self, bool wants_t_callback)
- /**
Changes the state of the ‘wants_t_callback’ flag. If this is true, the
interval will be returned by CIntervalManager::get_event() each time the
interval’s time value has been changed, regardless of whether it has any
external events.
*/
- set_auto_finish()
C++ Interface: set_auto_finish(const CInterval self, bool auto_finish)
- /**
Changes the state of the ‘auto_finish’ flag. If this is true, the interval
may be arbitrarily finished when the system needs to reset due to some
external event by calling CIntervalManager::interrupt(). If this is false
(the default), the interval must always be explicitly finished or paused.
*/
- set_auto_pause()
C++ Interface: set_auto_pause(const CInterval self, bool auto_pause)
- /**
Changes the state of the ‘auto_pause’ flag. If this is true, the interval
may be arbitrarily interrupted when the system needs to reset due to some
external event by calling CIntervalManager::interrupt(). If this is false
(the default), the interval must always be explicitly finished or paused.
*/
- set_done_event()
C++ Interface: set_done_event(const CInterval self, str event)
- /**
Sets the event that is generated whenever the interval reaches its final
state, whether it is explicitly finished or whether it gets there on its
own.
*/
- set_manager()
C++ Interface: set_manager(const CInterval self, CIntervalManager manager)
- /**
Indicates the CIntervalManager object which will be responsible for playing
this interval. This defaults to the global CIntervalManager; you should
need to change this only if you have special requirements for playing this
interval.
*/
- set_play_rate()
C++ Interface: set_play_rate(const CInterval self, double play_rate)
- /**
Changes the play rate of the interval. If the interval is already started,
this changes its speed on-the-fly. Note that since play_rate is a
parameter to start() and loop(), the next call to start() or loop() will
reset this parameter.
*/
- set_t()
C++ Interface: set_t(const CInterval self, double t)
- /**
Explicitly sets the time within the interval. Normally, you would use
start() .. finish() to let the time play normally, but this may be used to
set the time to some particular value.
*/
- set_wants_t_callback()
C++ Interface: set_wants_t_callback(const CInterval self, bool wants_t_callback)
- /**
Changes the state of the ‘wants_t_callback’ flag. If this is true, the
interval will be returned by CIntervalManager::get_event() each time the
interval’s time value has been changed, regardless of whether it has any
external events.
*/
- setupPlay()
C++ Interface: setup_play(const CInterval self, double start_time, double end_time, double play_rate, bool do_loop)
- /**
Called to prepare the interval for automatic timed playback, e.g. via a
Python task. The interval will be played from start_t to end_t, at a time
factor specified by play_rate. start_t must always be less than end_t
(except for the exception for end_t == -1, below), but if play_rate is
negative the interval will be played backwards.
Specify end_t of -1 to play the entire interval from start_t.
Call step_play() repeatedly to execute the interval.
*/
- setupResume()
C++ Interface: setup_resume(const CInterval self)
- /**
Called to prepare the interval for restarting at the current point within
the interval after an interruption.
*/
- setupResumeUntil()
C++ Interface: setup_resume_until(const CInterval self, double end_t)
- /**
Called to prepare the interval for restarting from the current point after
a previous call to pause() (or a previous play-to-point-and-stop), to play
until the indicated point and then stop.
*/
- setup_play()
C++ Interface: setup_play(const CInterval self, double start_time, double end_time, double play_rate, bool do_loop)
- /**
Called to prepare the interval for automatic timed playback, e.g. via a
Python task. The interval will be played from start_t to end_t, at a time
factor specified by play_rate. start_t must always be less than end_t
(except for the exception for end_t == -1, below), but if play_rate is
negative the interval will be played backwards.
Specify end_t of -1 to play the entire interval from start_t.
Call step_play() repeatedly to execute the interval.
*/
- setup_resume()
C++ Interface: setup_resume(const CInterval self)
- /**
Called to prepare the interval for restarting at the current point within
the interval after an interruption.
*/
- setup_resume_until()
C++ Interface: setup_resume_until(const CInterval self, double end_t)
- /**
Called to prepare the interval for restarting from the current point after
a previous call to pause() (or a previous play-to-point-and-stop), to play
until the indicated point and then stop.
*/
- start()
C++ Interface: start(const CInterval self, double start_t, double end_t, double play_rate)
- /**
Starts the interval playing by registering it with the current
CIntervalManager. The interval will play to the end and stop.
If end_t is less than zero, it indicates the end of the interval.
*/
- state
- stepPlay()
C++ Interface: step_play(const CInterval self)
- /**
Should be called once per frame to execute the automatic timed playback
begun with setup_play().
Returns true if the interval should continue, false if it is done and
should stop.
*/
- step_play()
C++ Interface: step_play(const CInterval self)
- /**
Should be called once per frame to execute the automatic timed playback
begun with setup_play().
Returns true if the interval should continue, false if it is done and
should stop.
*/
- stop(self)
- stopped
- t