cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Animation is not working in Hololense

RK_9880418
11-Garnet

Animation is not working in Hololense

I have created 3 animations in 3 different figures in Creo which is not working in Hololense. I have used below java script to call the animation. 

 

 

// $scope, $element, $attrs, $injector, $sce, $timeout, $http, $ionicPopup, and $ionicPopover services are available

$scope.setWidgetProp('model-1', 'currentStep', 'stepnr');
$scope.playStep = function (stepnr) {

switch (stepnr) {
case 1:
{
$scope.view.wdg['3DImage-1'].visible=false;
$scope.view.wdg['3DImage-2'].visible=true;
$scope.view.wdg['3DImage-3'].visible=true;
}
break;

case 2:
{
$scope.view.wdg['3DImage-1'].visible=false;
$scope.view.wdg['3DImage-2'].visible=false;
$scope.view.wdg['3DImage-3'].visible=false;
$scope.view.wdg['3DImage-4'].visible=true;
$scope.view.wdg['3DImage-5'].visible=false;
}
break;
case 3:
{
$scope.view.wdg['3DImage-1'].visible=false;
$scope.view.wdg['3DImage-2'].visible=false;
$scope.view.wdg['3DImage-3'].visible=false;
$scope.view.wdg['3DImage-4'].visible=false;
$scope.view.wdg['3DImage-6'].visible=true;
}

}
  
$scope.$applyAsync(() => {
$scope.setWidgetProp('model-1', 'currentStep', stepnr); });
$timeout(function () {
angular.element(document.getElementById('model-1')).scope().play();
}, 500);
}

$scope.hide = function(){
$scope.view.wdg['3DImage-4']['visible'] = false;
$scope.view.wdg['3DImage-2']['visible'] = true;
$scope.view.wdg['3DImage-3']['visible'] = true;
$scope.view.wdg['3DImage-6']['visible'] = false;
}

 

Each image i have placed "click Js" is below,

 

Image-1 - "playStep(1);"

Image-2- "playStep(2); "

Image-3- "playStep(3);"

 

Kindly help me to play an animation in Hololense

 

@tmccombie @sddgtwaw 

 

1 REPLY 1

possibly you can try :

$scope.setWidgetProp('model-1', 'currentStep', stepnr)
$scope.$applyAsync()
let timeoutValue=300 // if required increase the timeout delay 
//when model more complex to 600 - 1000 milliseconds
$timeout( ()=>{twx.app.fn.triggerWidgetService("model-1", "play");}, 500);

 so looking on your code it should work but possibly  you need more delay and async call after changes if you want to access these changes

Top Tags