-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtimelinePanel.html
More file actions
197 lines (173 loc) · 17.7 KB
/
timelinePanel.html
File metadata and controls
197 lines (173 loc) · 17.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Interacting with the Timeline — Autograph 2026.0.1 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=19f00094" />
<link rel="stylesheet" type="text/css" href="../_static/dark_mode_css/general.css?v=c0a7eb24" />
<link rel="stylesheet" type="text/css" href="../_static/dark_mode_css/dark.css?v=70edf1c7" />
<!--[if lt IE 9]>
<script src="../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=6cbb5e0f"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/dark_mode_js/default_dark.js?v=fd565c74"></script>
<script src="../_static/dark_mode_js/theme_switcher.js?v=358d3910"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="API Reference" href="../reference.html" />
<link rel="prev" title="Using 2D Paths" href="2DPaths.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
Autograph
</a>
<div class="version">
2026.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Developer Guide</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="startupscripts.html">Start-up scripts</a></li>
<li class="toctree-l2"><a class="reference internal" href="architecture.html">Architecture Overview</a></li>
<li class="toctree-l2"><a class="reference internal" href="importItems.html">Manage a Project</a></li>
<li class="toctree-l2"><a class="reference internal" href="editComposition.html">Edit a Composition</a></li>
<li class="toctree-l2"><a class="reference internal" href="editParams.html">Edit Params</a></li>
<li class="toctree-l2"><a class="reference internal" href="rendering.html">Creating Renders</a></li>
<li class="toctree-l2"><a class="reference internal" href="customPanels.html">Creating custom Panels</a></li>
<li class="toctree-l2"><a class="reference internal" href="2DPaths.html">Using 2D Paths</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Interacting with the Timeline</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#controlling-the-time">Controlling the time</a></li>
<li class="toctree-l3"><a class="reference internal" href="#get-the-current-rows-selection">Get the current rows selection</a></li>
<li class="toctree-l3"><a class="reference internal" href="#saving-the-current-selection-to-json">Saving the current selection to JSON</a></li>
<li class="toctree-l3"><a class="reference internal" href="#mapping-time-to-params">Mapping time to Params</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../reference.html">API Reference</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">Autograph</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="index.html">Developer Guide</a></li>
<li class="breadcrumb-item active">Interacting with the Timeline</li>
<li class="wy-breadcrumbs-aside">
<a href="../_sources/Guide/timelinePanel.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="interacting-with-the-timeline">
<h1>Interacting with the Timeline<a class="headerlink" href="#interacting-with-the-timeline" title="Link to this heading"></a></h1>
<p>The <a class="reference internal" href="../reference.html#Autograph.TimelinePanel" title="Autograph.TimelinePanel"><code class="xref py py-class docutils literal notranslate"><span class="pre">TimelinePanel</span></code></a> allows to control the <a class="reference internal" href="../reference.html#Autograph.TimelinePanel.currentTime" title="Autograph.TimelinePanel.currentTime"><code class="xref py py-attr docutils literal notranslate"><span class="pre">TimelinePanel.currentTime</span></code></a>, the <a class="reference internal" href="../reference.html#Autograph.TimelinePanel.activeComposition" title="Autograph.TimelinePanel.activeComposition"><code class="xref py py-attr docutils literal notranslate"><span class="pre">TimelinePanel.activeComposition</span></code></a>, the current <a class="reference internal" href="../reference.html#Autograph.TimelineRow" title="Autograph.TimelineRow"><code class="xref py py-class docutils literal notranslate"><span class="pre">TimelineRow</span></code></a> selection and the selected keyframes.</p>
<section id="controlling-the-time">
<h2>Controlling the time<a class="headerlink" href="#controlling-the-time" title="Link to this heading"></a></h2>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># Get the user focused timeline panel</span>
<span class="n">timeline</span><span class="o">=</span><span class="n">project</span><span class="o">.</span><span class="n">getLastFocusedTimelinePanel</span><span class="p">()</span>
<span class="c1"># Move the timeline to 1 sec</span>
<span class="n">timeline</span><span class="o">.</span><span class="n">currentTime</span> <span class="o">=</span> <span class="n">Autograph</span><span class="o">.</span><span class="n">Timecode</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">0</span><span class="p">)</span>
</pre></div>
</div>
<p>You can react to the timeline’s changes with the <a class="reference internal" href="../reference.html#Autograph.TimelinePanel.onCurrentTimeChanged" title="Autograph.TimelinePanel.onCurrentTimeChanged"><code class="xref py py-meth docutils literal notranslate"><span class="pre">TimelinePanel.onCurrentTimeChanged()</span></code></a> :</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">def</span><span class="w"> </span><span class="nf">onTimeChanged</span><span class="p">(</span><span class="n">timeline</span><span class="p">,</span> <span class="n">time</span><span class="p">):</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">"The time is now </span><span class="si">%r</span><span class="s2">"</span> <span class="o">%</span> <span class="n">time</span><span class="p">)</span>
<span class="n">timeline</span><span class="o">.</span><span class="n">onCurrentTimeChanged</span><span class="p">(</span><span class="n">onTimeChanged</span><span class="p">)</span>
</pre></div>
</div>
</section>
<section id="get-the-current-rows-selection">
<h2>Get the current rows selection<a class="headerlink" href="#get-the-current-rows-selection" title="Link to this heading"></a></h2>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">for</span> <span class="n">row</span> <span class="ow">in</span> <span class="n">timeline</span><span class="o">.</span><span class="n">getSelectedRows</span><span class="p">():</span>
<span class="c1"># row.model is a tuple [Effect,Param] since each row</span>
<span class="c1"># can be either an Effect (which could be a layer or generator or modifier) or a Param</span>
<span class="k">if</span> <span class="n">row</span><span class="o">.</span><span class="n">model</span><span class="p">[</span><span class="mi">0</span><span class="p">]:</span>
<span class="nb">print</span><span class="p">(</span><span class="n">row</span><span class="o">.</span><span class="n">model</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">getDisplayName</span><span class="p">())</span>
</pre></div>
</div>
<p>You can react to changes made to the selection with <a class="reference internal" href="../reference.html#Autograph.TimelinePanel.onSelectionChanged" title="Autograph.TimelinePanel.onSelectionChanged"><code class="xref py py-meth docutils literal notranslate"><span class="pre">TimelinePanel.onSelectionChanged()</span></code></a> .</p>
<p>The keyframes selection is also available with <a class="reference internal" href="../reference.html#Autograph.TimelinePanel.getSelectedKeyframes" title="Autograph.TimelinePanel.getSelectedKeyframes"><code class="xref py py-meth docutils literal notranslate"><span class="pre">TimelinePanel.getSelectedKeyframes()</span></code></a> .</p>
</section>
<section id="saving-the-current-selection-to-json">
<h2>Saving the current selection to JSON<a class="headerlink" href="#saving-the-current-selection-to-json" title="Link to this heading"></a></h2>
<p>You can save the selected row with <a class="reference internal" href="../reference.html#Autograph.TimelinePanel.getClipboardFromSelection" title="Autograph.TimelinePanel.getClipboardFromSelection"><code class="xref py py-meth docutils literal notranslate"><span class="pre">TimelinePanel.getClipboardFromSelection()</span></code></a> or even with an arbitrary list of rows and keyframes with <a class="reference internal" href="../reference.html#Autograph.TimelinePanel.getClipboard" title="Autograph.TimelinePanel.getClipboard"><code class="xref py py-meth docutils literal notranslate"><span class="pre">TimelinePanel.getClipboard()</span></code></a>.</p>
<p>The <code class="xref py py-class docutils literal notranslate"><span class="pre">TimelineClibpoard</span></code> can then be saved to JSON with <a class="reference internal" href="../reference.html#Autograph.TimelineClipboard.getText" title="Autograph.TimelineClipboard.getText"><code class="xref py py-meth docutils literal notranslate"><span class="pre">TimelineClipboard.getText()</span></code></a>.
It can also be stored in the Operating System’s clipboard with <a class="reference internal" href="../reference.html#Autograph.TimelineClipboard.storeInSystemClipboard" title="Autograph.TimelineClipboard.storeInSystemClipboard"><code class="xref py py-meth docutils literal notranslate"><span class="pre">TimelineClipboard.storeInSystemClipboard()</span></code></a>.
This is useful to paste the JSON text in a text editor and save it somewhere.</p>
<p>To load from a JSON string, you can use <a class="reference internal" href="../reference.html#Autograph.TimelinePanel.getClipboardFromSystem" title="Autograph.TimelinePanel.getClipboardFromSystem"><code class="xref py py-meth docutils literal notranslate"><span class="pre">TimelinePanel.getClipboardFromSystem()</span></code></a> or directly construct a <a class="reference internal" href="../reference.html#Autograph.TimelineClipboard" title="Autograph.TimelineClipboard"><code class="xref py py-class docutils literal notranslate"><span class="pre">TimelineClipboard</span></code></a> from the string.</p>
<p>Finally, to apply a clipboard to the current timeline selection, you can use <code class="xref py py-meth docutils literal notranslate"><span class="pre">TimelinePanel.applyClipboardToSelection(cb)()</span></code></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">timeline</span><span class="o">.</span><span class="n">getClipboardFromSelection</span><span class="p">()</span><span class="o">.</span><span class="n">storeInSystemClipboard</span><span class="p">()</span>
<span class="o">...</span>
<span class="n">timeline</span><span class="o">.</span><span class="n">applyClipboardToSelection</span><span class="p">(</span><span class="n">timeline</span><span class="o">.</span><span class="n">getClipboardFromSystem</span><span class="p">())</span>
</pre></div>
</div>
</section>
<section id="mapping-time-to-params">
<span id="timemapping"></span><h2>Mapping time to Params<a class="headerlink" href="#mapping-time-to-params" title="Link to this heading"></a></h2>
<p>When accessing keyframes on a <a class="reference internal" href="../reference.html#Autograph.Param" title="Autograph.Param"><code class="xref py py-class docutils literal notranslate"><span class="pre">Param</span></code></a> (e.g: using <a class="reference internal" href="../reference.html#Autograph.DoubleParamBase.getValue" title="Autograph.DoubleParamBase.getValue"><code class="xref py py-meth docutils literal notranslate"><span class="pre">DoubleParamBase.getValue()</span></code></a> or directly using <a class="reference internal" href="../reference.html#Autograph.Curve" title="Autograph.Curve"><code class="xref py py-class docutils literal notranslate"><span class="pre">Curve</span></code></a>), the time is always expressed in seconds, in a time-space local to the parameter.</p>
<p>If a layer has a time-offset or has been time-stretched, the local time of any <a class="reference internal" href="../reference.html#Autograph.Param" title="Autograph.Param"><code class="xref py py-class docutils literal notranslate"><span class="pre">Param</span></code></a> on a layer is no longer the same time as the timeline’s time.</p>
<p>If you need to programmatically change values on a <a class="reference internal" href="../reference.html#Autograph.Param" title="Autograph.Param"><code class="xref py py-class docutils literal notranslate"><span class="pre">Param</span></code></a> at the current <a class="reference internal" href="../reference.html#Autograph.TimelinePanel.currentTime" title="Autograph.TimelinePanel.currentTime"><code class="xref py py-attr docutils literal notranslate"><span class="pre">TimelinePanel.currentTime</span></code></a>, you will need to first map it to the Param local time using:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">paramLocalTime</span><span class="o">=</span><span class="n">timeline</span><span class="o">.</span><span class="n">mapTimelineToParamTime</span><span class="p">(</span><span class="n">param</span><span class="p">,</span> <span class="n">timeline</span><span class="o">.</span><span class="n">timecodeToSeconds</span><span class="p">(</span><span class="n">timeline</span><span class="o">.</span><span class="n">currentTime</span><span class="p">))</span>
</pre></div>
</div>
<p>If you need to map keyframes of a Param to their actual time on the timeline, you need to apply the inverse mapping:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">keyframes</span> <span class="o">=</span> <span class="n">param</span><span class="o">.</span><span class="n">getCurve</span><span class="p">()</span><span class="o">.</span><span class="n">getKeyFrames</span><span class="p">()</span>
<span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">keyframes</span><span class="p">:</span>
<span class="n">keyTimelineTime</span><span class="o">=</span><span class="n">timeline</span><span class="o">.</span><span class="n">mapParamTimeToTimeline</span><span class="p">(</span><span class="n">param</span><span class="p">,</span> <span class="n">k</span><span class="o">.</span><span class="n">time</span><span class="p">)</span>
</pre></div>
</div>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="2DPaths.html" class="btn btn-neutral float-left" title="Using 2D Paths" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="../reference.html" class="btn btn-neutral float-right" title="API Reference" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>© Copyright 2026 Maxon Computer GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>