manipulating the sceneelement is always kind of a hack. so it’s not supported within the UI. within @MaxZieb’s extensionproject he’s offered a bunch of nice methods to extend hypes API. this includes a save method to get the current sceneelement. you may have a closer look
btw onsceneload the element-argument is always the sceneelement …
Ooooh, that's interesting. It's kinda silly that scenes can have the same name. Naming of scenes would probably be more effective if the name of the scene was the ID. (That would make scene naming more restrictive though.)
The main problem with using a name as apposed to an id is scene names can be duplicated. So there is a risk you will get unexpected results. This is true of showSceneNamed. So a fixed id would in most cases be preferable
It is exactly this - we didn't want to make the UI restrictive or throw up warnings, but this kinda is at odds with an API that also seeks to be perhaps slightly too friendly as well.
If it is your own document, you can of course ensure uniqueness by just making sure you scenes all differently . (You'd need to do just this if you wanted to do manual IDs as well!)
However I imagine @MarkHunte the use case for this request is for something programmatic where you want to make a script that could be used with other people's documents?
I forgot to mention we already have hypeDocument.currentSceneId
Which means you have to be on that scene already to manipulate it and use the hype scope
For me it would just open up the ability to targeting a scene programmatically if needed regardless of it being current or not. Normally you are trying to something with ids outside of the hype scope , would be handy for the use case of trying to do this from a document scope rather than a hypeDocument scope.
And it would bring scenes inline with other elements where we can do this.
I encountered this issue while looping programmatically over scenes, managing transitions to look ahead (like interstitials in a setup using Hype scenes as a slides manager). Another instance is in my Transition efforts in the extensions (Custom Transitions and Hype Scene Magic). The problem arises when the interface only interacts with scene names, causing navigation limitations if there are identical names. This issue also applies to fetching functions with hypeDocument.functions(). Ideally, names should be unique, but Hype allows multiple functions with the same name, as with scenes. Despite this, you can still access the scene with the next scene. I believe the runtime has a function to navigate to a scene by index, although it is not exposed in the API.