<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="/feed.php">
        <title>Documentation Center public:software:dazstudio:4:referenceguide:scripting:api_reference:samples:animating:scene_time</title>
        <description></description>
        <link>/</link>
        <image rdf:resource="/lib/tpl/dazdoccenter/images/favicon.ico" />
       <dc:date>2026-04-14T20:50:55+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/animating/scene_time/start"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="/lib/tpl/dazdoccenter/images/favicon.ico">
        <title>Documentation Center</title>
        <link>/</link>
        <url>/lib/tpl/dazdoccenter/images/favicon.ico</url>
    </image>
    <item rdf:about="/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/animating/scene_time/start">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-09T14:20:59+00:00</dc:date>
        <title>Scene Time</title>
        <link>/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/animating/scene_time/start</link>
        <description>
&lt;h1 id=&quot;scene_time&quot;&gt;Scene Time&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Below is an example demonstrating fundamental calculations when working with time, in Daz Studio.
&lt;/p&gt;

&lt;/div&gt;

&lt;h2 id=&quot;api_areas_of_interest&quot;&gt;API Areas of Interest&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/object_q&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:object_q&quot;&gt;QObject&lt;/a&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/base_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:base_dz&quot;&gt;DzBase&lt;/a&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/scene_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:scene_dz&quot;&gt;DzScene&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/time_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:time_dz&quot;&gt;DzTime&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/object&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:object&quot;&gt;Object&lt;/a&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/number&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:number&quot;&gt;Number&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/string&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:string&quot;&gt;String&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/global&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:global&quot;&gt;Global&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;example&quot;&gt;Example&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;div class=&quot;wrap_center wrap_round wrap_download plugin_wrap&quot; style=&quot;width: 90%;&quot;&gt;&lt;ul&gt;&lt;li&gt;License: &lt;a href=&quot;http://creativecommons.org/licenses/by/3.0/&quot; class=&quot;urlextern&quot; target=&quot;_blank&quot; title=&quot;http://creativecommons.org/licenses/by/3.0/&quot; rel=&quot;nofollow noopener&quot;&gt;CC Attribution 3.0 Unported&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Click the name of the example below to save it as a file&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div style=&quot;-webkit-user-select: none;-webkit-touch-callout: none;-moz-user-select: none;-ms-user-select: none;user-select: none;&quot;&gt;&lt;dl class=&quot;code&quot;&gt;
&lt;dt&gt;&lt;a href=&quot;/_export/code/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/animating/scene_time/start?codeblock=0&quot; title=&quot;Download Snippet&quot; class=&quot;mediafile mf_dsa&quot;&gt;Scene_Time.dsa&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;co1&quot;&gt;// Define an anonymous function;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// serves as our main loop,&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// limits the scope of variables&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
&amp;nbsp;
	&lt;span class=&quot;co1&quot;&gt;// Define the number of Ticks Per Second&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; nTPS &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4800&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
	&lt;span class=&quot;co1&quot;&gt;// Get the number of Ticks Per Frame&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; nTPF &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; Scene&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;getTimeStep&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;valueOf&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
	&lt;span class=&quot;co1&quot;&gt;// Calculate the number of Frames Per Second&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; nFPS &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; nTPS &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; nTPF&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
	&lt;span class=&quot;co1&quot;&gt;// Get the current Scene time, in ticks&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; nTicks &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; Scene&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;getTime&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;valueOf&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
	&lt;span class=&quot;co1&quot;&gt;// Calculate the current frame number&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; nFrame &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; nTicks &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; nTPF&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
	&lt;span class=&quot;co1&quot;&gt;// Calculate the current number of seconds&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; nSecs &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; nTicks &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; nTPS&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
	&lt;span class=&quot;co1&quot;&gt;// Feedback information about the current state&lt;/span&gt;
	print&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;TPF:&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; nTPF&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;FPS:&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; nFPS &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	print&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;------------------------------&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	print&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Frame:&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; nFrame&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es1&quot;&gt;\t&lt;/span&gt;Tick:&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; nTicks&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es1&quot;&gt;\t&lt;/span&gt;Second:&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; nSecs &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	print&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;------------------------------&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
	&lt;span class=&quot;co1&quot;&gt;// Define frame range values&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; nInterval &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; nDuration &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;60&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; nStart &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
	&lt;span class=&quot;co1&quot;&gt;// Iterate over the frame range&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; i &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; nStart&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; n &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; nStart &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; nDuration&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy0&quot;&gt;&amp;lt;=&lt;/span&gt; n&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy0&quot;&gt;+=&lt;/span&gt; nInterval &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// Calculate the number of ticks for the i'th frame&lt;/span&gt;
		nTicks &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; i &lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt; nTPF&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
		&lt;span class=&quot;co1&quot;&gt;// Calculate the number of seconds for the i'th frame&lt;/span&gt;
		nSecs &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; nTicks &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; nTPS&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
		&lt;span class=&quot;co1&quot;&gt;// Feedback information about the i'th frame&lt;/span&gt;
		print&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Frame:&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; i&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es1&quot;&gt;\t&lt;/span&gt;Tick:&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; nTicks&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es1&quot;&gt;\t&lt;/span&gt;Second:&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; nSecs &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;// Finalize the function and invoke&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;/dd&gt;&lt;/dl&gt;
&lt;/div&gt;
&lt;/div&gt;
</description>
    </item>
</rdf:RDF>
