Get the Scene Container and Number

Came up with these functions. Either one works… only initialize once on any scene load and from that point forward you will be able to call these extensions to that particular hypeDocument.

var nr = hypeDocument.currentSceneIndex();
var sceneContainer = hypeDocument.currentSceneElement();

These are the corresponding functions that need to be initialized in your first scene load:

hypeDocument.currentSceneIndex = function(){
	var hc = document.getElementById(hypeDocument.documentId());
	var sa = hc.getElementsByClassName("HYPE_scene");
	for (i = 0; i < sa.length; i++) {
		if (sa[i].style.display === "block") return i;
	}
}

hypeDocument.currentSceneElement = function(){
	var hc = document.getElementById(hypeDocument.documentId());
	var sa = hc.getElementsByClassName("HYPE_scene");
	for (i = 0; i < sa.length; i++) {
		if (sa[i].style.display === "block") return sa[i];
	}
}
2 Likes