<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[SDK: Get total number of scenes and max length of a scene name]]></title><description><![CDATA[<p dir="auto">Hello Mark and Isadora developers,</p>
<div style="font-family:Arial, Verdana;font-size:10pt;font-style:normal;font-variant:normal;font-weight:normal;line-height:normal">I'm rewriting dbengali's plugin JumpByName ([http://troikatronix.com/troikatronixforum/discussion/768](http://troikatronix.com/troikatronixforum/discussion/768)) as I'd like to use it on Windows.</div>
<div style="font-family:Arial, Verdana;font-size:10pt;font-style:normal;font-variant:normal;font-weight:normal;line-height:normal">The way I proceed is quite simple:</div>
<div style="font-family:Arial, Verdana;font-size:10pt;font-style:normal;font-variant:normal;font-weight:normal;line-height:normal">
<ul>
<li><span style="font-size:10pt">browse all scenes in a 'for' loop</span></li>
<li><span style="font-size:10pt">if the name of the currently requested scene (I use the <span style="font-size:small">GetSceneName_ function defined in IsadoraCallbacks.h</span>) matches the requirements according to the parameters, jump to this scene</span></li>
</ul>
</div>
<div style="font-family:Arial, Verdana;font-size:10pt;font-style:normal;font-variant:normal;font-weight:normal;line-height:normal">But this approach raises 2 problems:</div>
<div>
<ol>
<li>The 'for' loop needs a boundary. For now I hardcoded it in a constant, assuming that no Isadora project would use more than, say, 2000 scenes.</li>
<li>The GetSceneName_ function requires a maxLen parameter, which seems to be the size of the string it fills with the scene name. I also used a constant, assuming that no one would have a scene name of 1000 characters.</li>
</ol>
<div>I would like the performance to be optimal, not to mention the ugliness of these solutions. Hence these 2 questions:</div>
<div>
<ol>
<li><span style="font-family:Arial, Verdana;font-size:small">Is there a way to get the total number of scenes in an Isadora project dynamically (something like GetNumberOfScenes_ ?), or at least the maximum size of the scene array (if it's not dynamically assigned) ?</span></li>
<li><span style="font-family:Arial, Verdana;font-size:small">Same question for the size of the scene name string (a constant maybe?)</span></li>
</ol>
<div>Thanks in advance.</div>
</div>
</div>]]></description><link>https://community.troikatronix.com/topic/1108/sdk-get-total-number-of-scenes-and-max-length-of-a-scene-name</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 17:16:07 GMT</lastBuildDate><atom:link href="https://community.troikatronix.com/topic/1108.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 12 Feb 2014 16:21:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to SDK: Get total number of scenes and max length of a scene name on Wed, 05 Mar 2014 14:50:45 GMT]]></title><description><![CDATA[<p dir="auto">Oh... I see. No try/catch, just the return value compared to the <span style="font-family:Verdana, Geneva, sans-serif;font-size:12px;line-height:16.799999237060547px;background-color:rgb(255, 255, 255)">kIzzyErr_SceneDoesntExist constant.</span></p>
<div><span style="font-family:Verdana, Geneva, sans-serif;font-size:12px;line-height:16.799999237060547px;background-color:rgb(255, 255, 255)">I'm feeling lazy to adapt my source right now, I'll keep the empty string comparison for now... works well too.</span></div>]]></description><link>https://community.troikatronix.com/post/10161</link><guid isPermaLink="true">https://community.troikatronix.com/post/10161</guid><dc:creator><![CDATA[djinoui]]></dc:creator><pubDate>Wed, 05 Mar 2014 14:50:45 GMT</pubDate></item><item><title><![CDATA[Reply to SDK: Get total number of scenes and max length of a scene name on Tue, 04 Mar 2014 02:17:45 GMT]]></title><description><![CDATA[<p dir="auto">No problem, dbengali, thanks for your post anyway. The try/catch approach is interesting too, seems more robust in case of a change in the API.</p>
]]></description><link>https://community.troikatronix.com/post/10159</link><guid isPermaLink="true">https://community.troikatronix.com/post/10159</guid><dc:creator><![CDATA[djinoui]]></dc:creator><pubDate>Tue, 04 Mar 2014 02:17:45 GMT</pubDate></item><item><title><![CDATA[Reply to SDK: Get total number of scenes and max length of a scene name on Mon, 03 Mar 2014 18:53:31 GMT]]></title><description><![CDATA[<p dir="auto">Sorry again to disappear while you were working on this and not to save you time!</p>
<div>For #2 I made a similar choice, though I set the max length to 128\.  I believe I left a warning in the actor help about keeping scene labels less than 128 characters.  You were more generous :)</div>
<div>For #1 I also wonder if there is a way to find out the number of scenes somewhere, but I assumed that the scene list is maybe stored internally as a linked list rather than an array, in which case, there isn't necessarily a way to know the number of scenes other than navigating the list.  So, while iterating through the scenes looking for the search string, I just catch the error "kIzzyErr_SceneDoesntExist" to know if I have run past the end of the scene list, and thus can stop checking.  This conveniently avoids the need for a constant boundary on number of scenes.</div>
<div>hope this helps, even though it is a bit late.</div>]]></description><link>https://community.troikatronix.com/post/10157</link><guid isPermaLink="true">https://community.troikatronix.com/post/10157</guid><dc:creator><![CDATA[dbengali]]></dc:creator><pubDate>Mon, 03 Mar 2014 18:53:31 GMT</pubDate></item><item><title><![CDATA[Reply to SDK: Get total number of scenes and max length of a scene name on Fri, 21 Feb 2014 11:13:43 GMT]]></title><description><![CDATA[<p dir="auto">Cool.. the name length is not such an issue..<br />
thanks for putting in the hard work.</p>
]]></description><link>https://community.troikatronix.com/post/10036</link><guid isPermaLink="true">https://community.troikatronix.com/post/10036</guid><dc:creator><![CDATA[DusX]]></dc:creator><pubDate>Fri, 21 Feb 2014 11:13:43 GMT</pubDate></item><item><title><![CDATA[Reply to SDK: Get total number of scenes and max length of a scene name on Thu, 20 Feb 2014 12:12:09 GMT]]></title><description><![CDATA[<p dir="auto">Just a little update. I finally managed to solve problem #1, I just replaced the 'for' loop with a do/while: knowing that GetSceneName_ fills the string parameter <span style="font-family:Arial, Verdana;font-size:small">back with empty content (""), it can be tested as a loop end condition.</span></p>
<div style="font-family:Arial, Verdana;font-size:10pt;font-style:normal;font-variant:normal;font-weight:normal;line-height:normal"><code></code></div>
<div>char loopCurrentSceneName[SCENE_NAME_MAX_LENGTH];</div>
<div>
<div>int i = 1; // scene index (one-based)</div>
<div><span style="font-family:Arial, Verdana;font-size:small">do</span></div>
<div>{</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>GetSceneName_(ip, inActorInfo, mode, i, SCENE_NAME_MAX_LENGTH-1, loopCurrentSceneName); // loopCurrentSceneName pointer now points to the scene name at current index</div>
<div><span style="font-family:Arial, Verdana;font-size:small"><span class="Apple-tab-span" style="white-space:pre"></span>...</span></div>
<div><span style="font-family:Arial, Verdana;font-size:small"><span class="Apple-tab-span" style="white-space:pre"></span>i++;</span></div>
<div><span style="font-family:Arial, Verdana;font-size:small">}while (strcmp(loopCurrentSceneName, "") != 0); // Loop while a scene name is found in scene list</span></div>
<div style="font-family:Arial, Verdana;font-size:10pt;font-style:normal;font-variant:normal;font-weight:normal;line-height:normal"></div>
<div style="font-family:Arial, Verdana;font-size:10pt;font-style:normal;font-variant:normal;font-weight:normal;line-height:normal">As you can see, I didn't solve problem #2 (kept the <span style="font-size:small">SCENE_NAME_MAX_LENGTH</span><span style="font-size:10pt"> constant defined in linked .h file), </span><span style="font-size:10pt">but after all it's no big deal.</span></div>
</div>]]></description><link>https://community.troikatronix.com/post/10017</link><guid isPermaLink="true">https://community.troikatronix.com/post/10017</guid><dc:creator><![CDATA[djinoui]]></dc:creator><pubDate>Thu, 20 Feb 2014 12:12:09 GMT</pubDate></item></channel></rss>