Hi Roland,
Thank you for sharing this. I'm going to stick with this "hack" method of getting the sequence lengths while in Vuforia View. It only takes a fraction of a second, and it works:
//I loop through the pvi files with a recursive function until I’ve collected the number of steps from each:
//‘no’ or ‘yes’ denote whether or not there is an animation associated with that learning chapter.
var chapters = [['intro','no',2,'incomplete'], //_________________0
['tools','no',6,'incomplete'], //_________________1
['components','no',3,'incomplete'], //____________2
['Float_5FValve','yes',9,'incomplete'], //________3
['Exhaust_5FFilters','yes',18,'incomplete'], //____4
['Antisuckback_5FValve','yes',9,'incomplete'] //___5
] // [0,1,2,3]
// Get chapter lengths *******************
var k=0;
var seqLenRequested = false;
getSequenceLengths = function(){
seqLenRequested = true;
if(chapters[k][1]=="yes"){
$scope.setWidgetProp('pump', 'sequence', "app/resources/Uploaded/ASSEMBLY-without54/l-Creo 3D - "+chapters[k][0]+".pvi");
if(k+1<chapters.length){k++}
}
if(chapters[k][1]=="no"){
if(k+1<chapters.length){
k++;
getSequenceLengths();
}
}
};
// event listener for sequence loaded
$scope.$on("sequenceloaded", function (evt, arg) {
if(seqLenRequested){
chapters[k][2]=$scope.app.view.Home.wdg.pump.steps;
if(k<chapters.length){
getSequenceLengths();
}
}
});